calendar::have_private_p (public)

 calendar::have_private_p [ -return_id return_id ] \
    [ -calendar_id_list calendar_id_list ] [ -party_id party_id ]

Defined in packages/calendar/tcl/calendar-procs.tcl

Check to see if the user has a private calendar. When the provided -return_id is 1, then proc will return the calendar_id

Switches:
-return_id (defaults to "0") (optional)
-calendar_id_list (optional)
If you supply the calendar_id_list, then we'll only search for a personal calendar among the calendars supplied here.
-party_id (defaults to "party_id") (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 calendar_have_private_p calendar_have_private_p (public, deprecated) calendar::have_private_p calendar::have_private_p calendar_have_private_p->calendar::have_private_p packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl packages/calendar/www/cal-item-new.tcl->calendar::have_private_p packages/calendar/www/index.tcl packages/calendar/ www/index.tcl packages/calendar/www/index.tcl->calendar::have_private_p db_string db_string (public) calendar::have_private_p->db_string

Testcases:
No testcase defined.
Source code:
    # Check whether the user is logged in at all
    if {!$party_id} {
        return -1
    }

    if { [llength $calendar_id_list] > 0 } {
        set result [db_string get_calendar_info_calendar_id_list {} -default 0]
    } else {
        set result [db_string get_calendar_info {} -default 0]
    }

    if { $result ne "0" } {

        if {$return_id eq "1"} {
            return $result
        } else {
            return 1
        }

    } else {

        return 0
    }
Generic XQL file:
<fullquery name="calendar::have_private_p.get_calendar_info">
    <querytext>
	select calendar_id
	from calendars
	where owner_id = :party_id
	and private_p = 't'
    </querytext>
</fullquery>

<fullquery name="calendar::have_private_p.get_calendar_info_calendar_id_list">
    <querytext>
    	select    calendar_id
	from      calendars
	where     owner_id = :party_id
	and       private_p = 't'
	and       calendar_id in ([join $calendar_id_list ", "])
    </querytext>
</fullquery>
packages/calendar/tcl/calendar-procs.xql

PostgreSQL XQL file:
packages/calendar/tcl/calendar-procs-postgresql.xql

Oracle XQL file:
packages/calendar/tcl/calendar-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: