Index: openacs-4/packages/calendar/tcl/cal-item-2-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/cal-item-2-procs-oracle.xql,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/calendar/tcl/cal-item-2-procs-oracle.xql 4 Dec 2002 09:44:35 -0000 1.8 +++ openacs-4/packages/calendar/tcl/cal-item-2-procs-oracle.xql 11 Aug 2003 12:14:15 -0000 1.9 @@ -21,10 +21,8 @@ select cal_items.cal_item_id, 0 as n_attachments, - start_date as start_date, - end_date as end_date, - to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, - to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as start_date_ansi, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as end_date_ansi, nvl(e.name, a.name) as name, nvl(e.description, a.description) as description, recurrence_id, @@ -52,16 +50,8 @@ select cal_items.cal_item_id, (select count(*) from attachments where object_id = cal_item_id) as n_attachments, - to_char(start_date,'HH:MIpm')as start_time, - to_char(start_date,'D') as day_of_week, - to_char(start_date,'Day') as pretty_day_of_week, - to_char(start_date,'DD') as day_of_month, - start_date as start_date, - to_char(start_date, 'MM/DD/YYYY') as pretty_short_start_date, - to_char(end_date, 'HH:MIpm') as end_time, - end_date as end_date, - to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, - to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as start_date_ansi, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as end_date_ansi, nvl(e.name, a.name) as name, nvl(e.description, a.description) as description, recurrence_id, Index: openacs-4/packages/calendar/tcl/cal-item-2-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/cal-item-2-procs-postgresql.xql,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/calendar/tcl/cal-item-2-procs-postgresql.xql 23 May 2003 13:08:41 -0000 1.9 +++ openacs-4/packages/calendar/tcl/cal-item-2-procs-postgresql.xql 11 Aug 2003 12:14:15 -0000 1.10 @@ -17,11 +17,9 @@ select i.cal_item_id, 0 as n_attachments, - to_char(start_date, 'YYYY-MM-DD HH:MI:SS') as start_date, - end_date as end_date, - to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, - to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, - coalesce(e.name, a.name) as name, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as start_date_ansi, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as end_date_ansi, + coalesce(a.name, e.name) as name, coalesce(e.description, a.description) as description, recurrence_id, i.item_type_id, @@ -48,16 +46,8 @@ select i.cal_item_id, (select count(*) from attachments where object_id = cal_item_id) as n_attachments, - to_char(start_date,'HH:MIpm') as start_time, - to_char(start_date,'D') as day_of_week, - to_char(start_date,'Day') as pretty_day_of_week, - to_char(start_date,'DD') as day_of_month, - to_char(start_date, 'YYYY-MM-DD HH:MI:SS') as start_date, - to_char(start_date, 'MM/DD/YYYY') as pretty_short_start_date, - to_char(end_date, 'HH:MIpm') as end_time, - end_date as end_date, - to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, - to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as start_date_ansi, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as end_date_ansi, coalesce(a.name, e.name) as name, coalesce(e.description, a.description) as description, recurrence_id, Index: openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/cal-item-2-procs.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl 21 Jul 2003 19:21:36 -0000 1.8 +++ openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl 11 Aug 2003 12:14:15 -0000 1.9 @@ -62,18 +62,28 @@ } db_1row $query_name {} -column_array row + + # Timezonize + + set row(start_date_ansi) [lc_time_utc_to_local $row(start_date_ansi)] + set row(end_date_ansi) [lc_time_utc_to_local $row(end_date_ansi)] + # Localize - set row(start_time) [lc_time_fmt $row(ansi_start_date) "%X"] + set row(start_time) [lc_time_fmt $row(start_date_ansi) "%X"] + # Unfortunately, SQL has weekday starting at 1 = Sunday - set row(day_of_week) [expr [lc_time_fmt $row(ansi_start_date) "%w"] + 1] - set row(pretty_day_of_week) [lc_time_fmt $row(ansi_start_date) "%A"] - set row(day_of_month) [lc_time_fmt $row(ansi_start_date) "%d"] - set row(pretty_short_start_date) [lc_time_fmt $row(ansi_start_date) "%x"] - set row(full_start_date) [lc_time_fmt $row(ansi_start_date) "%x"] - set row(full_end_date) [lc_time_fmt $row(ansi_end_date) "%x"] + set row(start_date) [lc_time_fmt $row(start_date_ansi) "%Y-%m-%d"] + set row(end_date) [lc_time_fmt $row(end_date_ansi) "%Y-%m-%d"] - set row(end_time) [lc_time_fmt $row(ansi_end_date) "%X"] + set row(day_of_week) [expr [lc_time_fmt $row(start_date_ansi) "%w"] + 1] + set row(pretty_day_of_week) [lc_time_fmt $row(start_date_ansi) "%A"] + set row(day_of_month) [lc_time_fmt $row(start_date_ansi) "%d"] + set row(pretty_short_start_date) [lc_time_fmt $row(start_date_ansi) "%x"] + set row(full_start_date) [lc_time_fmt $row(start_date_ansi) "%x"] + set row(full_end_date) [lc_time_fmt $row(end_date_ansi) "%x"] + + set row(end_time) [lc_time_fmt $row(end_date_ansi) "%X"] } ad_proc -public add_recurrence { Index: openacs-4/packages/calendar/tcl/cal-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs.tcl,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/calendar/tcl/cal-item-procs.tcl 30 Nov 2002 17:27:51 -0000 1.11 +++ openacs-4/packages/calendar/tcl/cal-item-procs.tcl 11 Aug 2003 12:14:15 -0000 1.12 @@ -85,6 +85,10 @@ # set the date_format set date_format "YYYY-MM-DD HH24:MI" + # Convert from user timezone to system timezone + set start_date [lc_time_local_to_utc $start_date] + set end_date [lc_time_local_to_utc $end_date] + # find out the timespan_id set timespan_id [db_exec_plsql insert_timespan { begin @@ -159,6 +163,10 @@ # set the date_format set date_format "YYYY-MM-DD HH24:MI" + # Convert from user timezone to system timezone + set start_date [lc_time_local_to_utc $start_date] + set end_date [lc_time_local_to_utc $end_date] + # update the events db_dml update_event "" Index: openacs-4/packages/calendar/tcl/calendar-2-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-2-procs-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/calendar/tcl/calendar-2-procs-oracle.xql 11 Aug 2003 12:14:15 -0000 1.1 @@ -0,0 +1,17 @@ + + + + oracle8.1.6 + + + + select calendar_name, + calendar_id, + acs_permission.permission_p(calendar_id, :user_id, 'calendar_admin') as calendar_admin_p + from calendars + where package_id= :package_id + and (private_p='f' or (private_p='t' and owner_id= :user_id)) + + + + Index: openacs-4/packages/calendar/tcl/calendar-2-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-2-procs-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/calendar/tcl/calendar-2-procs-postgresql.xql 11 Aug 2003 12:14:15 -0000 1.1 @@ -0,0 +1,14 @@ + + + + postgresql7.1 + + + + select calendar_name, calendar_id, acs_permission__permission_p(calendar_id, :user_id, 'calendar_admin') as calendar_admin_p from calendars + where package_id= :package_id + and (private_p='f' or (private_p='t' and owner_id= :user_id)) + + + + Index: openacs-4/packages/calendar/tcl/calendar-2-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-2-procs.xql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/calendar/tcl/calendar-2-procs.xql 26 Jul 2003 20:50:37 -0000 1.5 +++ openacs-4/packages/calendar/tcl/calendar-2-procs.xql 11 Aug 2003 12:14:15 -0000 1.6 @@ -1,14 +1,6 @@ - - -select calendar_name, calendar_id, acs_permission__permission_p(calendar_id, :user_id, 'calendar_admin') as calendar_admin_p from calendars -where package_id= :package_id -and (private_p='f' or (private_p='t' and owner_id= :user_id)) - - - select type, item_type_id from cal_item_types Index: openacs-4/packages/calendar/tcl/calendar-outlook-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-outlook-procs-oracle.xql,v diff -u -N --- openacs-4/packages/calendar/tcl/calendar-outlook-procs-oracle.xql 26 Jul 2002 03:20:28 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ - - -oracle8.1.6 - - - -select to_char(timezone.utc_to_local(tz_id, utc_time), :format) -from timezones, -(select timezone.local_to_utc(tz_id, to_date(:timestamp,:format)) as utc_time -from timezones where tz= :server_tz) -where tz= :user_tz - - - - Index: openacs-4/packages/calendar/tcl/calendar-outlook-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-outlook-procs-postgresql.xql,v diff -u -N --- openacs-4/packages/calendar/tcl/calendar-outlook-procs-postgresql.xql 17 May 2003 10:20:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ - - -postgresql7.1.2 - - - - - select to_char(server.utc_time - timezone__get_offset(timezone__get_id(:user_tz), server.utc_time), :format) - from (select timezone__convert_to_utc(tz_id, :timestamp) as utc_time - from timezones where tz= :server_tz) server; - - - - - Index: openacs-4/packages/calendar/tcl/calendar-outlook-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-outlook-procs.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/calendar/tcl/calendar-outlook-procs.tcl 17 May 2003 10:20:50 -0000 1.9 +++ openacs-4/packages/calendar/tcl/calendar-outlook-procs.tcl 11 Aug 2003 12:14:15 -0000 1.10 @@ -22,15 +22,6 @@ namespace eval calendar::outlook { - ad_proc -private adjust_timezone { - {-timestamp:required} - {-server_tz:required} - {-user_tz:required} - {-format "YYYY-MM-DD HH24:MI:SS"} - } { - return [db_string adjust_timezone {}] - } - ad_proc ics_timestamp_format { {-timestamp:required} } { @@ -75,13 +66,6 @@ calendar::item::get -cal_item_id $cal_item_id -array cal_item # If necessary, select recurrence information - # Convert some dates for timezone - set server_tz [parameter::get_from_package_key -package_key acs-lang -parameter SystemTimezone] - set cal_item(full_start_date) \ - [adjust_timezone -timestamp $cal_item(full_start_date) -format $date_format -user_tz "Universal" -server_tz $server_tz] - set cal_item(full_end_date) \ - [adjust_timezone -timestamp $cal_item(full_end_date) -format $date_format -user_tz "Universal" -server_tz $server_tz] - # Here we have some fields # start_time end_time title description Index: openacs-4/packages/calendar/www/cal-item-delete-confirm-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item-delete-confirm-postgresql.xql,v diff -u -N --- openacs-4/packages/calendar/www/cal-item-delete-confirm-postgresql.xql 28 Apr 2002 21:03:43 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,34 +0,0 @@ - - - - postgresql7.1 - - - - - select to_char(start_date, 'HH24:MI') as start_time, - start_date as raw_start_date, - to_char(start_date, 'MM/DD/YYYY') as start_date, - to_char(end_date, 'HH:MIpm') as end_time, - coalesce(a. name, e.name) as name, - coalesce(e.description, a.description) as description, - recurrence_id, - cal_item_types.type as item_type, - on_which_calendar as calendar_id - from acs_activities a, - acs_events e, - timespans s, - time_intervals t, - cal_items, - cal_item_types - where e.timespan_id = s.timespan_id - and s.interval_id = t.interval_id - and e.activity_id = a.activity_id - and e.event_id = :cal_item_id - and cal_items.cal_item_id= :cal_item_id - and cal_item_types.item_type_id= cal_items.item_type_id - - - - - Index: openacs-4/packages/calendar/www/cal-item-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item-edit.adp,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/calendar/www/cal-item-edit.adp 21 Jul 2003 19:21:36 -0000 1.7 +++ openacs-4/packages/calendar/www/cal-item-edit.adp 11 Aug 2003 12:14:16 -0000 1.8 @@ -11,7 +11,7 @@

- + Index: openacs-4/packages/calendar/www/cal-item-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item-edit.tcl,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/calendar/www/cal-item-edit.tcl 21 Jul 2003 19:21:36 -0000 1.18 +++ openacs-4/packages/calendar/www/cal-item-edit.tcl 11 Aug 2003 12:14:16 -0000 1.19 @@ -15,6 +15,8 @@ # Permissions # FIXME: we need to add a permissions check here! +set calendar_list [calendar::calendar_list] + # Create the form form create cal_item @@ -89,8 +91,8 @@ element set_properties cal_item cal_item_id -value $cal_item(cal_item_id) element set_properties cal_item title -value $cal_item(name) element set_properties cal_item date -value [template::util::date::from_ansi $cal_item(start_date)] - element set_properties cal_item start_time -value [template::util::date::from_ansi $cal_item(ansi_start_date) [lc_get formbuilder_time_format]] - element set_properties cal_item end_time -value [template::util::date::from_ansi $cal_item(ansi_end_date) [lc_get formbuilder_time_format]] + element set_properties cal_item start_time -value [template::util::date::from_ansi $cal_item(start_date_ansi) [lc_get formbuilder_time_format]] + element set_properties cal_item end_time -value [template::util::date::from_ansi $cal_item(end_date_ansi) [lc_get formbuilder_time_format]] element set_properties cal_item description -value $cal_item(description) element set_properties cal_item item_type_id -value $cal_item(item_type_id) Index: openacs-4/packages/calendar/www/cal-item-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-new.adp,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/calendar/www/cal-item-new.adp 26 Jul 2003 20:55:11 -0000 1.9 +++ openacs-4/packages/calendar/www/cal-item-new.adp 11 Aug 2003 12:14:16 -0000 1.10 @@ -2,9 +2,37 @@ #calendar.Calendar_Add_Item# #calendar.Add# cal_item.title +TimePChanged() + + @@ -23,3 +51,7 @@
+ + Index: openacs-4/packages/calendar/www/cal-item-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-new.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/calendar/www/cal-item-new.tcl 26 Jul 2003 20:55:11 -0000 1.10 +++ openacs-4/packages/calendar/www/cal-item-new.tcl 11 Aug 2003 12:14:16 -0000 1.11 @@ -27,10 +27,9 @@ ad_script_abort } - set calendar_id [lindex $calendar_list 0] + set calendar_id [lindex [lindex $calendar_list 0] 1] } - # Create the form form create cal_item @@ -44,7 +43,7 @@ -label "[_ calendar.Date_1]" -datatype date -widget date element create cal_item time_p \ - -label " " -datatype text -widget radio -options [list [list "[_ calendar.All_Day_Event]" 0] [list "[_ calendar.Use_Hours_Below]" 1]] + -label " " -datatype text -widget radio -html {onchange "javascript:TimePChanged();"} -options [list [list "[_ calendar.All_Day_Event]" 0] [list "[_ calendar.Use_Hours_Below]" 1]] element create cal_item start_time \ -label "[_ calendar.Start_Time]" -datatype date -widget date \ Index: openacs-4/packages/calendar/www/cal-item-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item-oracle.xql,v diff -u -N --- openacs-4/packages/calendar/www/cal-item-oracle.xql 16 Mar 2002 21:06:44 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ - - - - oracle8.1.6 - - - - - select to_char(start_date, 'MM/DD/YYYY') as start_date, - to_char(start_date, 'HH24:MI') as start_time, - to_char(end_date, 'HH24:MI') as end_time, - nvl(a. name, e.name) as name, - nvl(e.description, a.description) as description, - recurrence_id, - item_type_id, - on_which_calendar as calendar_id - from acs_activities a, - acs_events e, - timespans s, - time_intervals t, - cal_items - where e.timespan_id = s.timespan_id - and s.interval_id = t.interval_id - and e.activity_id = a.activity_id - and e.event_id = :cal_item_id - and cal_items.cal_item_id = :cal_item_id - - - - - - - - - select calendar_id, calendar_name - from calendars - where acs_permission.permission_p(calendar_id, :user_id, 'calendar_write') = 't' - and private_p = 'f' - - - - - - - - Index: openacs-4/packages/calendar/www/cal-item-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item-postgresql.xql,v diff -u -N --- openacs-4/packages/calendar/www/cal-item-postgresql.xql 9 Jan 2002 23:52:44 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,39 +0,0 @@ - - - - postgresql7.1 - - - - - select to_char(start_date, 'HH24:MI') as start_time, - to_char(start_date, 'MM/DD/YYYY') as start_date, - to_char(end_date, 'HH24:MI') as end_time, - coalesce(a. name, e.name) as name, - coalesce(e.description, a.description) as description - from acs_activities a, - acs_events e, - timespans s, - time_intervals t - where e.timespan_id = s.timespan_id - and s.interval_id = t.interval_id - and e.activity_id = a.activity_id - and e.event_id = :cal_item_id - - - - - - - - - select calendar_id, calendar_name - from calendars - where acs_permission__permission_p(calendar_id, :user_id, 'calendar_write') = 't' - and private_p = 'f'; - - - - - - Index: openacs-4/packages/calendar/www/cal-item.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item.adp,v diff -u -N --- openacs-4/packages/calendar/www/cal-item.adp 21 Jul 2003 19:21:36 -0000 1.15 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,212 +0,0 @@ - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- #calendar.Title_1# - - -
- #calendar.Date_1# - - <%= [dt_widget_datetime -date_time_sep "
" -default @start_date@ event_date days] %> - -
- CHECKED TYPE=radio name=no_time_p value=0>Use Hours Below     CHECKED TYPE=radio name=no_time_p value=1>#calendar.No_Time# -
- #calendar.Start_Time# - - <%= [dt_widget_datetime -use_am_pm 1 -show_date 0 -date_time_sep "
" -default @start_time@ start_time quarters] %> -
- #calendar.End_Time# - - <%= [dt_widget_datetime -use_am_pm 1 -show_date 0 -date_time_sep "
" -default @end_time@ end_time quarters] %> -
- #calendar.Description# - - -
#calendar.Item_Type# - -
- #calendar.Calendar# - - - @force_calendar_name@ - - - - - -
- #calendar.Repeat_1# - - No       - #calendar.Yes# -
- - - #calendar.lt_This_event_is_a_singl# - - #calendar.This_event_is# #calendar.repeated#:
- #calendar.lt_Edit_ALL_instances_of#
- #calendar.lt_Edit_only_THIS_instan#

- -

- - - - - - - - - - - - #calendar.Delete# - - -
- -
- -
- - - - - - - - - - - - Index: openacs-4/packages/calendar/www/cal-item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item.tcl,v diff -u -N --- openacs-4/packages/calendar/www/cal-item.tcl 21 Jul 2003 19:21:36 -0000 1.15 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,153 +0,0 @@ -# /packages/calendar/www/cal-item.tcl - -ad_page_contract { - - Single calendar item view - - @author Gary Jin (gjin@arsdigita.com) - @creation-date Dec 14, 2000 - @cvs-id $Id: cal-item.tcl,v 1.15 2003/07/21 19:21:36 dirkg Exp $ -} { - {action add} - {date ""} - {julian_date ""} - {cal_item_id 0} - {start_time "now"} - {end_time "now"} - {return_url ""} - {force_calendar_id ""} -} -properties { - cal_item_id:onevalue - - name:onevalue - description:onevalue - - start_date:onevalue - start_time:onevalue - end_time:onevalue - - edit_p:onevalue - delete_p:onevalue - admin_p:onevalue - - calendars:multirow - -} - -if {[empty_string_p $date]} { - if {[empty_string_p $julian_date]} { - set date now - } else { - set date [db_string select_from_julian "select to_date(:julian_date ,'J') from dual"] - } -} - - -# find out the user_id -set user_id [ad_verify_and_get_user_id] - - -# find out the calendar_id -# for this case, we are assuming that its -# a private calendar -set calendar_id [calendar_have_private_p -return_id 1 $user_id] - -# set up all the default values -set name "" -set description "" - -if {$date == "now"} { - set start_date "now" -} else { - set start_date $date -} - -#------------------------------------------------ -# check the permission on the party to the object -# then set up the variable to the template - -# write permission -set edit_p [ad_permission_p $cal_item_id cal_item_write] - -# delete permission -set delete_p [ad_permission_p $cal_item_id cal_item_delete] - -# admin permission -set admin_p [ad_permission_p $cal_item_id calendar_admin] - -set item_type_id "" - -#------------------------------------------------ -# only worry about the query when it is an edit -if { $action == "edit" } { - - # check so that cal_item_id does exist - if { [empty_string_p $cal_item_id] } { - # barf error - ad_return_complaint 1 "you need to supply a cal_item_id" - } - - - # get data time - db_1row get_item_data { - select to_char(start_date,'HH24:MI')as start_time, - to_char(start_date, 'MM/DD/YYYY') as start_date, - to_char(end_date, 'HH24:MI') as end_time, - nvl(a. name, e.name) as name, - nvl(e.description, a.description) as description, - recurrence_id, - item_type_id, - on_which_calendar as calendar_id - from acs_activities a, - acs_events e, - timespans s, - time_intervals t, - cal_items - where e.timespan_id = s.timespan_id - and s.interval_id = t.interval_id - and e.activity_id = a.activity_id - and e.event_id = :cal_item_id - and cal_items.cal_item_id= :cal_item_id - } - - set force_calendar_id $calendar_id - - set cal_item_types [calendar::get_item_types -calendar_id $force_calendar_id] - # forced error checking - -} elseif { [string equal $action "add"] } { - # get calendar names that user has calendar - # write permission to - - - # write permission for the calendar - set edit_p [ad_permission_p $calendar_id calendar_write] - - # user has no private calendar - if { [string equal $calendar_id 0] } { - set edit_p 1 - } - - db_multirow calendars list_calendars {} - - if {![empty_string_p $force_calendar_id]} { - set force_calendar_name [calendar_get_name $force_calendar_id] - - set cal_item_types [calendar::get_item_types -calendar_id $force_calendar_id] - } - -} - -set no_time_p [dt_no_time_p -start_time $start_time -end_time $end_time] - -ad_return_template - - - - - - - - - - Index: openacs-4/packages/calendar/www/cal-options.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-options.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/calendar/www/cal-options.tcl 26 Jul 2003 21:24:36 -0000 1.8 +++ openacs-4/packages/calendar/www/cal-options.tcl 11 Aug 2003 12:14:16 -0000 1.9 @@ -1,7 +1,6 @@ ad_page_contract { - List all the calendars for which the user has the read privilege - the user has read privilege + List all the calendars for which the user has the read privilege. @author Dirk Gomez (openacs@dirkgomez.de) @authorr Gary Jin (gjin@arsdigita.com) Index: openacs-4/packages/calendar/www/view-list-display-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/view-list-display-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/calendar/www/view-list-display-oracle.xql 26 Jul 2003 21:58:28 -0000 1.1 +++ openacs-4/packages/calendar/www/view-list-display-oracle.xql 11 Aug 2003 12:14:16 -0000 1.2 @@ -5,11 +5,9 @@ - - - select to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + select to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, + to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as ansi_today, nvl(e.name, a.name) as name, nvl(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, Index: openacs-4/packages/calendar/www/view-list-display-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/view-list-display-postgresql.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/calendar/www/view-list-display-postgresql.xql 26 Jul 2003 21:22:27 -0000 1.3 +++ openacs-4/packages/calendar/www/view-list-display-postgresql.xql 11 Aug 2003 12:14:16 -0000 1.4 @@ -2,44 +2,38 @@ postgresql7.1 - - - - select - to_char(start_date, 'J') as julian_start_date, - to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'YYYY-MM-DD') as pretty_start_date, - to_char(start_date, 'HH24:MI:SS') as start_time, - to_char(end_date, 'YYYY-MM-DD') as pretty_end_date, - to_char(start_date, 'HH24:MI') as pretty_start_time, - to_char(end_date, 'HH24:MI') as pretty_end_time, + + + + select to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, + to_char(now(), 'YYYY-MM-DD HH24:MI:SS') as ansi_today, coalesce(e.name, a.name) as name, + coalesce(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, - (select type from cal_item_types where item_type_id= cal_items.item_type_id) as item_type, - to_char(start_date, 'Day') as pretty_weekday, - cals.calendar_id, - cals.calendar_name + recurrence_id, + (select type from cal_item_types where item_type_id= cal_items.item_type_id) as item_type from acs_activities a, acs_events e, timespans s, time_intervals t, - cal_items ci, - calendars cals + cal_items where e.timespan_id = s.timespan_id and s.interval_id = t.interval_id and e.activity_id = a.activity_id and cal_items.cal_item_id= e.event_id -and (start_date >= to_date(:start_date,:date_format) or :start_date is null) -and (start_date <= to_date(:end_date,:date_format) or :end_date is null) -and cals.package_id= :package_id -and (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id)) -and cals.calendar_id = ci.on_which_calendar -and e.event_id = ci.cal_item_id +and (start_date > to_date(:start_date,:date_format) or :start_date is null) and + (start_date < to_date(:end_date,:date_format) or :end_date is null) +and e.event_id +in ( + select cal_item_id + from cal_items + where on_which_calendar = :calendar_id + ) order by $sort_by - - - + + - + Index: openacs-4/packages/calendar/www/view-list-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-list-display.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/calendar/www/view-list-display.tcl 26 Jul 2003 21:22:49 -0000 1.3 +++ openacs-4/packages/calendar/www/view-list-display.tcl 11 Aug 2003 12:14:16 -0000 1.4 @@ -1,3 +1,11 @@ +if { ![exists_and_not_null calendar_id]} { + set calendar_list [calendar::calendar_list] + + set calendar_id [lindex [lindex $calendar_list 0] 1] +} + +set calendar_name [calendar_get_name $calendar_id] + set package_id [ad_conn package_id] set user_id [ad_conn user_id] # sort by cannot be empty @@ -41,6 +49,22 @@ # Loop through the events, and add them db_foreach select_list_items {} { + # Timezonize + set ansi_start_date [lc_time_utc_to_local $ansi_start_date] + set ansi_end_date [lc_time_utc_to_local $ansi_end_date] + set ansi_today [lc_time_utc_to_local $ansi_today] + + # Localize + set pretty_weekday [lc_time_fmt $ansi_start_date "%A"] + set pretty_start_date [lc_time_fmt $ansi_start_date "%x"] + set pretty_end_date [lc_time_fmt $ansi_end_date "%x"] + set pretty_start_time [lc_time_fmt $ansi_start_date "%X"] + set pretty_end_time [lc_time_fmt $ansi_end_date "%X"] + set pretty_today [lc_time_fmt $ansi_today "%x"] + + set start_date_seconds [clock scan $pretty_start_date] + set today_seconds [clock scan $pretty_today] + # Adjust the display of no-time items if {[dt_no_time_p -start_time $pretty_start_date -end_time $pretty_end_date]} { set pretty_start_time "--" @@ -60,9 +84,10 @@ incr flip } - if {$julian_start_date == $today_julian_date} { + # Give the row different appearance depending on whether it's before today, today, or after today + if {$start_date_seconds == $today_seconds} { set today row-hi - } elseif {$julian_start_date < $today_julian_date} { + } elseif {$start_date_seconds < $today_seconds} { set today row-lo } else { set today "" @@ -71,4 +96,3 @@ multirow append calendar_items $calendar_name $item_id $name $item_type $pretty_weekday $pretty_start_date $pretty_end_date $pretty_start_time $pretty_end_time $flip $today } - Index: openacs-4/packages/calendar/www/view-one-day-display-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/view-one-day-display-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/calendar/www/view-one-day-display-oracle.xql 26 Jul 2003 21:58:27 -0000 1.1 +++ openacs-4/packages/calendar/www/view-one-day-display-oracle.xql 11 Aug 2003 12:14:16 -0000 1.2 @@ -5,7 +5,7 @@ - select to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, +select to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, nvl(e.name, a.name) as name, nvl(e.status_summary, a.status_summary) as status_summary, @@ -14,9 +14,7 @@ on_which_calendar as calendar_id, (select calendar_name from calendars where calendar_id = on_which_calendar) - as calendar_name, - to_char(timezone.local_to_utc(timezone.get_id(:timezone),to_date(:current_date,:date_format)),'YYYY-MM-DD HH24:MI:SS') as start_interval, - to_char(timezone.local_to_utc(timezone.get_id(:timezone),to_date(:current_date,:date_format) + (24 - 1/3600)/24),'YYYY-MM-DD HH24:MI:SS') as end_interval + as calendar_name from acs_activities a, acs_events e, timespans s, @@ -26,8 +24,8 @@ and s.interval_id = t.interval_id and e.activity_id = a.activity_id and start_date between - timezone.local_to_utc(timezone.get_id(:timezone),to_date(:current_date,:date_format)) and - timezone.local_to_utc(timezone.get_id(:timezone),to_date(:current_date,:date_format) + (24 - 1/3600)/24) + to_date(:current_date,:date_format) and + (to_date(:current_date,:date_format) + (24 - 1/3600)/24) and cal_items.cal_item_id= e.event_id and e.event_id in ( Index: openacs-4/packages/calendar/www/view-one-day-display-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/view-one-day-display-postgresql.xql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/calendar/www/view-one-day-display-postgresql.xql 26 Jul 2003 21:22:27 -0000 1.4 +++ openacs-4/packages/calendar/www/view-one-day-display-postgresql.xql 11 Aug 2003 12:14:16 -0000 1.5 @@ -5,10 +5,8 @@ - select to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'HH24:MI') as start_time, - to_char(end_date, 'HH24') as end_hour, - to_char(end_date, 'HH24:MI') as end_time, + select to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, coalesce(e.name, a.name) as name, coalesce(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, Index: openacs-4/packages/calendar/www/view-one-day-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-one-day-display.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/calendar/www/view-one-day-display.tcl 26 Jul 2003 21:22:49 -0000 1.4 +++ openacs-4/packages/calendar/www/view-one-day-display.tcl 11 Aug 2003 12:14:16 -0000 1.5 @@ -10,6 +10,9 @@ set package_id [ad_conn package_id] set user_id [ad_conn user_id] +# LARS: ERROR: +# calendar_id_list now contains {Personal 1961 t} + # Loop through the calendars multirow create day_items_without_time name status_summary item_id calendar_name Index: openacs-4/packages/calendar/www/view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view.tcl,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/calendar/www/view.tcl 26 Jul 2003 20:55:11 -0000 1.14 +++ openacs-4/packages/calendar/www/view.tcl 11 Aug 2003 12:14:16 -0000 1.15 @@ -23,8 +23,6 @@ } } - - set package_id [ad_conn package_id] set user_id [ad_conn user_id]