calendar::calendar_list (public)

 calendar::calendar_list [ -package_id package_id ] \
    [ -user_id user_id ] [ -privilege privilege ]

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

Switches:
-package_id (optional)
-user_id (optional)
-privilege (optional)
Returns:
a list of calendars

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::calendar_list calendar::calendar_list test_cal_item_add_delete->calendar::calendar_list ad_conn ad_conn (public) calendar::calendar_list->ad_conn db_list_of_lists db_list_of_lists (public) calendar::calendar_list->db_list_of_lists packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl packages/calendar/www/cal-item-new.tcl->calendar::calendar_list packages/calendar/www/cal-options.tcl packages/calendar/ www/cal-options.tcl packages/calendar/www/cal-options.tcl->calendar::calendar_list packages/calendar/www/view.tcl packages/calendar/ www/view.tcl packages/calendar/www/view.tcl->calendar::calendar_list

Testcases:
cal_item_add_delete
Source code:
    # If no user_id
    if {$user_id eq ""} {
        set user_id [ad_conn user_id]
    }

    if {$package_id eq ""} {
        set package_id [ad_conn package_id]
    }

    set permissions_clause {}
    if { $privilege ne "" } {
        set permissions_clause {and acs_permission.permission_p(calendar_id, :user_id, :privilege)}
    }

    set new_list [db_list_of_lists select_calendar_list [subst {
       select calendar_name,
              calendar_id,
              acs_permission.permission_p(calendar_id, :user_id, 'calendar_admin') as calendar_admin_p
       from   calendars
       where  (private_p = 'f' and package_id = :package_id $permissions_clause) or
              (private_p = 't' and owner_id = :user_id)
       order  by private_p asc, upper(calendar_name)
    }]]
Generic XQL file:
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: