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 (optional, defaults to "0")
when set to 1, this proc will return the calendar_id
-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 (optional, defaults to "party_id")
Returns:
boolean or the calendar_id according to 'return_id' flag.

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::have_private_p calendar::have_private_p test_cal_item_add_delete->calendar::have_private_p db_string db_string (public) calendar::have_private_p->db_string calendar_have_private_p calendar_have_private_p (public, deprecated) 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

Testcases:
cal_item_add_delete
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 != 0 } {
        if { $return_id == 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 ([ns_dbquotelist $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: