Index: openacs-4/packages/calendar/www/admin/calendar-preferences-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/admin/Attic/calendar-preferences-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/calendar/www/admin/calendar-preferences-postgresql.xql 28 Nov 2001 18:39:39 -0000 1.3 +++ openacs-4/packages/calendar/www/admin/calendar-preferences-postgresql.xql 26 Jul 2003 19:33:32 -0000 1.4 @@ -15,31 +15,13 @@ - - - select distinct(o.object_id) as calendar_id, - calendar__name(o.object_id) as calendar_name, - calendar__show_p(o.object_id, :party_id) as show_p - from acs_objects o - where calendar__readable_p(o.object_id, :party_id) = 't' - and party_id = :party_id - and acs_object_util__object_type_p(o.object_id, 'calendar') = 't' - and calendar__private_p(o.object_id) = 'f' - - union - - select cal_item__on_which_calendar(o.object_id) as calendar_id, - calendar__name(cal_item__on_which_calendar(o.object_id)) as calendar_name, - calendar__show_p(cal_item__on_which_calendar(o.object_id), :party_id) as show_p - from acs_objects o - where privilege = 'cal_item_read' - and party_id = :party_id - and acs_object_util__object_type_p(o.object_id, 'cal_item') = 't' - and calendar__private_p(cal_item__on_which_calendar(o.object_id)) = 'f' - - - - + select calendar_id, + calendar_name, + calendar__show_p(calendar_id, :party_id) as show_p + from calendars + where acs_permission__permission_p(calendar_id, :party_id, 'calendar_read') = 't' + and private_p='f' + Index: openacs-4/packages/calendar/www/admin/calendar-preferences.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/admin/Attic/calendar-preferences.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/calendar/www/admin/calendar-preferences.tcl 18 Sep 2002 12:12:04 -0000 1.2 +++ openacs-4/packages/calendar/www/admin/calendar-preferences.tcl 26 Jul 2003 19:33:32 -0000 1.3 @@ -46,61 +46,18 @@ # ---------------------------------------------- # view, greant, or revoke -# view if { [string equal $action "view"] } { - - - # ---------------------------------------------- - # get calendar_permissions within the system - - db_multirow calendars get_viewable_calendar { - - select unique(object_id) as calendar_id, - calendar.name(object_id) as calendar_name, - calendar.show_p(object_id, :party_id) as show_p - from acs_object_party_privilege_map - where calendar.readable_p(object_id, :party_id) = 't' - and party_id = :party_id - and acs_object_util.object_type_p(object_id, 'calendar') = 't' - and calendar.private_p(object_id) = 'f' - - union - - select cal_item.on_which_calendar(object_id) as calendar_id, - calendar.name(cal_item.on_which_calendar(object_id)) as calendar_name, - calendar.show_p(cal_item.on_which_calendar(object_id), :party_id) as show_p - from acs_object_party_privilege_map - where privilege = 'cal_item_read' - and party_id = :party_id - and acs_object_util.object_type_p(object_id, 'cal_item') = 't' - and calendar.private_p(cal_item.on_which_calendar(object_id)) = 'f' - - - } - -# grant + db_multirow calendars get_viewable_calendar { } } elseif { [string equal $action "edit"] } { - - - - foreach old_items $calendar_old_list { - if { [string equal [lsearch -exact $calendar_hide_list [lindex $old_items 0]] "-1"] } { - # revoke permission - calendar_assign_permissions [lindex $old_items 0] $party_id "calendar_show" - + calendar_assign_permissions [lindex $old_items 0] $party_id "calendar_read" } else { - - calendar_assign_permissions [lindex $old_items 0] $party_id "calendar_show" "revoke" - + calendar_assign_permissions [lindex $old_items 0] $party_id "calendar_read" "revoke" } - - } - set action view ad_returnredirect "calendar-preferences?[export_url_vars action]" ad_script_abort