Index: openacs-4/packages/calendar/tcl/calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs.tcl,v diff -u -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/calendar/tcl/calendar-procs.tcl 2 Oct 2002 11:28:45 -0000 1.10.2.1 +++ openacs-4/packages/calendar/tcl/calendar-procs.tcl 6 Mar 2003 15:15:21 -0000 1.10.2.2 @@ -122,14 +122,23 @@ # figure out if user have a private calendar or not # again, best suited to be rolled into the pl/sql -ad_proc calendar_have_private_p { {-return_id 0} party_id } { - +ad_proc calendar_have_private_p { + {-return_id 0} + {-calendar_id_list {}} + party_id +} { check to see if ther user have a prviate calendar if -return_id is 1, then proc will return the calendar_id + @param calendar_id_list If you supply the calendar_id_list, then we'll only search + for a personal calendar among the calendars supplied here. } { - set result [db_string get_calendar_info "" -default 0] + 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 { ![string equal $result "0"] } { Index: openacs-4/packages/calendar/tcl/calendar-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs.xql,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/calendar/tcl/calendar-procs.xql 15 Oct 2001 18:46:59 -0000 1.2 +++ openacs-4/packages/calendar/tcl/calendar-procs.xql 6 Mar 2003 15:15:21 -0000 1.2.4.1 @@ -28,4 +28,14 @@ + + + select calendar_id + from calendars + where owner_id = :party_id + and private_p = 't' + and calendar_id in ([join $calendar_id_list ", "]) + + +