Index: openacs-4/packages/calendar/tcl/calendar-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/calendar/tcl/calendar-procs-oracle.xql 9 Jan 2004 21:02:50 -0000 1.4 +++ openacs-4/packages/calendar/tcl/calendar-procs-oracle.xql 9 Jan 2004 21:54:24 -0000 1.5 @@ -1,60 +1,49 @@ - oracle8.1.6 +oracle8.1.6 - - - begin - :1 := calendar.new( - owner_id => :owner_id, - private_p => :private_p, - calendar_name => :calendar_name, - package_id => :package_id, - creation_user => :creation_user, - creation_ip => :creation_ip - ); - end; - - - + + + begin + :1 := calendar.new( + owner_id => :owner_id, + private_p => :private_p, + calendar_name => :calendar_name, + package_id => :package_id, + creation_user => :creation_user, + creation_ip => :creation_ip + ); + end; - - - - - select calendar.name(:calendar_id) - from dual - - + - - + 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) - + - + and acs_permission.permission_p(calendar_id, :user_id, :privilege) = 't' - + - + begin calendar.del(:calendar_id); end; - + Index: openacs-4/packages/calendar/tcl/calendar-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/calendar/tcl/calendar-procs-postgresql.xql 9 Jan 2004 21:02:50 -0000 1.7 +++ openacs-4/packages/calendar/tcl/calendar-procs-postgresql.xql 9 Jan 2004 21:54:24 -0000 1.8 @@ -21,14 +21,6 @@ - - - select calendar__name(:calendar_id) - from dual - - - - select calendar_name, 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.19 -r1.20 --- openacs-4/packages/calendar/tcl/calendar-procs.tcl 9 Jan 2004 21:02:50 -0000 1.19 +++ openacs-4/packages/calendar/tcl/calendar-procs.tcl 9 Jan 2004 21:54:24 -0000 1.20 @@ -16,7 +16,8 @@ #------------------------------------------------ -# datetime info extraction +# Should be moved into the calendar:: namespace. Will do after .LRN 2.0 release +# (Dirk 9-Jan-2003) ad_proc calendar_make_datetime { event_date @@ -82,8 +83,8 @@ #------------------------------------------------ -# figure out if user have a private calendar or not -# again, best suited to be rolled into the pl/sql +# Should be moved into the calendar:: namespace. Will do after .LRN 2.0 release +# (Dirk 9-Jan-2003) ad_proc calendar_have_private_p { {-return_id 0} @@ -119,7 +120,8 @@ #------------------------------------------------ -# creating a new calendar +# Should be moved into the calendar:: namespace. Will do after .LRN 2.0 release +# (Dirk 9-Jan-2003) ad_proc calendar_create { owner_id private_p @@ -161,7 +163,8 @@ #------------------------------------------------ -# assign the permission of the calendar to a party +# Should be moved into the calendar:: namespace. Will do after .LRN 2.0 release +# (Dirk 9-Jan-2003) ad_proc calendar_assign_permissions { calendar_id party_id @@ -206,44 +209,13 @@ } -#------------------------------------------------ -# find out the name of a calendar -# NOTE: calendar.name() - -ad_proc calendar_get_name { calendar_id } { - - find out the name of a calendar +ad_proc -public calendar::name { calendar_id } { + Return a calendar's name } { - - return [db_string get_calendar_name { - select calendar.name(:calendar_id) - from dual - } -default ""] - + return [db_string get_calendar_name {} -default ""] } - -#------------------------------------------------ -# figures out if a given calendar is public or not - -ad_proc calendar_public_p { calendar_id } { - - returns 't' if a given calendar is public - and 'f' if it is not - -} { - set private_p [db_string check_calendar_p "select private_p from calendars where calendar_id = :calendar_id"] - - if { $private_p == "t" } { - return "f" - } else { - return "t" - } - -} - - ad_proc -public calendar::get_month_multirow_information { {-current_day:required} {-today_julian_date:required} @@ -428,21 +400,6 @@ } } -ad_proc -public calendar::update { - {-calendar_id:required} - {-calendar_name:required} -} { - Edit calendar -} { - - # Update the calendar table - db_dml update_calendar { - update calendars - set calendar_name = :calendar_name - where calendar_id = :calendar_id - } -} - ad_proc -public calendar::get { {-calendar_id:required} {-array:required} @@ -508,15 +465,16 @@ ad_proc -public calendar::rename { {-calendar_id:required} - {-name:required} + {-calendar_name:required} } { rename a calendar } { db_dml rename_calendar {} } ad_proc -private calendar::compare_day_items_by_current_hour {a b} { - Compare a day item by the current hour (field 0) + Compare a day item by the current hour (field 0). + This is needed by the one-day view for sorting. } { set a_criterium [lindex $a 0] set b_criterium [lindex $b 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.4 -r1.5 --- openacs-4/packages/calendar/tcl/calendar-procs.xql 9 Jan 2004 20:36:13 -0000 1.4 +++ openacs-4/packages/calendar/tcl/calendar-procs.xql 9 Jan 2004 21:54:24 -0000 1.5 @@ -1,16 +1,15 @@ - - - - update calendars - set calendar_name = :calendar_name - where calendar_id = :calendar_id - - - + + + update calendars + set calendar_name = :calendar_name + where calendar_id = :calendar_id + + + select calendar_id, @@ -70,14 +69,15 @@ - - - update calendars - set calendar_name = :name - where calendar_id = :calendar_id - - + + + select calendar_name + from calendars + where calendar_id = :calendar_id; + + + select calendar_id, Index: openacs-4/packages/calendar/www/admin/calendar-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/admin/calendar-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/calendar/www/admin/calendar-edit.tcl 11 Dec 2003 21:39:59 -0000 1.3 +++ openacs-4/packages/calendar/www/admin/calendar-edit.tcl 9 Jan 2004 21:54:24 -0000 1.4 @@ -18,13 +18,13 @@ {html {size 50}} } } -edit_request { - set calendar_name [calendar_get_name $calendar_id] + set calendar_name [calendar::name $calendar_id] } -new_data { calendar::new \ -owner_id [ad_conn user_id] \ -calendar_name $calendar_name } -edit_data { - calendar::update \ + calendar::rename \ -calendar_id $calendar_id \ -calendar_name $calendar_name } -after_submit {