Index: openacs-4/packages/calendar/calendar.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/calendar.info,v diff -u -N -r1.31 -r1.31.2.1 --- openacs-4/packages/calendar/calendar.info 24 Feb 2005 13:33:05 -0000 1.31 +++ openacs-4/packages/calendar/calendar.info 19 Jun 2005 07:49:35 -0000 1.31.2.1 @@ -7,29 +7,26 @@ f f - + Dirk Gomez Personal and shared event calendars. - 2004-03-04 + 2005-06-03 OpenACS Manage group and shared calendars with download. - + - - - - + - + Index: openacs-4/packages/calendar/catalog/calendar.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/catalog/calendar.en_US.ISO-8859-1.xml,v diff -u -N -r1.26 -r1.26.2.1 --- openacs-4/packages/calendar/catalog/calendar.en_US.ISO-8859-1.xml 11 May 2005 17:53:44 -0000 1.26 +++ openacs-4/packages/calendar/catalog/calendar.en_US.ISO-8859-1.xml 19 Jun 2005 07:49:35 -0000 1.26.2.1 @@ -1,14 +1,12 @@ - + . You may choose to: Add add Add a new Audience add an event - Add an item Add Item - Add an item beginning at %localized_day_current_hour% on %localized_date_current% Add Recurrence All Day Event all events @@ -55,9 +53,6 @@ Events over a Friday from - Go to %months.name% - Go to year %next_year% - Go to year %prev_year% Grant Grant Permissions Item is recurring. @@ -80,29 +75,6 @@ Edit your Calendar Preferences everyone have read permission, and can see the items, registered and un-reg-ed users alike. - Go to %month_name% %days.day_number%, %year% - Go to %months.name% %curr_year% - Go to %months.name% %curr_year%>%months.name%</a></td> - </else> - </multiple> - </if> - - <else> - <tr class="days"> - <multiple name="days_of_week"> - <td>%days_of_week.day_short%</td> - </multiple> - </tr> - - <multiple name="days"> - <if %days.beginning_of_week_p% true> - <tr> - </if> - - <if %days.active_p% true> - <if %days.today_p% true> - <td class="today" onclick="javascript:location.href='%days.url%';"> - <a href="%days.url%" title="<#_ Go to %month_name% %days.day_number%, %year% Hide Selected Calendars Manage Calendar Audiences no parties exist. contact your system admin @@ -142,8 +114,6 @@ Saturday Select Calendars Sharing - Skip day calendar - Skip month calendar Start Time Start time is before end time Submit query Index: openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql,v diff -u -N -r1.11 -r1.11.2.1 --- openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql 13 Jan 2005 13:56:27 -0000 1.11 +++ openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql 19 Jun 2005 07:49:35 -0000 1.11.2.1 @@ -29,8 +29,7 @@ cal_item_types.type as item_type, on_which_calendar as calendar_id, c.calendar_name, - o.creation_user, - c.package_id as calendar_package_id + o.creation_user from acs_activities a, acs_events e, timespans s, @@ -64,8 +63,7 @@ cal_item_types.type as item_type, on_which_calendar as calendar_id, c.calendar_name, - o.creation_user, - c.package_id as calendar_package_id + o.creation_user from acs_activities a, acs_events e, timespans s, @@ -139,7 +137,6 @@ begin :1 := cal_item.new( on_which_calendar => :calendar_id, - name => :name, activity_id => :activity_id, timespan_id => :timespan_id, item_type_id => :item_type_id, Index: openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql,v diff -u -N -r1.18 -r1.18.2.1 --- openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql 1 Apr 2004 21:00:49 -0000 1.18 +++ openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql 19 Jun 2005 07:49:35 -0000 1.18.2.1 @@ -25,8 +25,7 @@ it.type as item_type, on_which_calendar as calendar_id, c.calendar_name, - o.creation_user, - c.package_id as calendar_package_id + o.creation_user from acs_events e join timespans s on (e.timespan_id = s.timespan_id) @@ -54,15 +53,14 @@ (select count(*) from attachments where object_id = cal_item_id) as n_attachments, 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.name, a.name) as name, coalesce(e.description, a.description) as description, recurrence_id, i.item_type_id, it.type as item_type, on_which_calendar as calendar_id, c.calendar_name, - o.creation_user, - c.package_id as calendar_package_id + o.creation_user from acs_events e join timespans s on (e.timespan_id = s.timespan_id) @@ -134,8 +132,8 @@ select cal_item__new ( null, :calendar_id, - :name, null, + null, null, null, :timespan_id, 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.20 -r1.20.2.1 --- openacs-4/packages/calendar/tcl/cal-item-procs.tcl 12 Jul 2004 14:49:55 -0000 1.20 +++ openacs-4/packages/calendar/tcl/cal-item-procs.tcl 19 Jun 2005 07:49:35 -0000 1.20.2.1 @@ -58,7 +58,7 @@ # by default, the cal_item permissions # are going to be inherited from the calendar permissions set cal_item_id [db_exec_plsql cal_item_add {}] - + db_dml set_item_type_id "update cal_items set item_type_id=:item_type_id where cal_item_id=:cal_item_id" assign_permission $cal_item_id $creation_user read assign_permission $cal_item_id $creation_user write assign_permission $cal_item_id $creation_user delete 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 -N -r1.25.2.1 -r1.25.2.2 --- openacs-4/packages/calendar/tcl/calendar-procs.tcl 13 Jun 2005 19:39:55 -0000 1.25.2.1 +++ openacs-4/packages/calendar/tcl/calendar-procs.tcl 19 Jun 2005 07:49:35 -0000 1.25.2.2 @@ -15,84 +15,7 @@ namespace eval calendar {} namespace eval calendar::notification {} -namespace eval calendar::merge { - ad_proc -callback MergeShowUserInfo -impl calendar { - -user_id:required - } { - Shows the calendar tables user info - } { - set msg "Calendars of user_id: $user_id" - set return_msg [list $msg] - - set cals [db_list get_calendars {*SQL*} ] - if { [empty_string_p $cals ] } { - lappend return_msg "none" - } else { - lappend return_msg $cals - } - - return $return_msg - } - ad_proc -callback MergePackageUser -impl calendar { - -from_user_id:required - -to_user_id:required - } { - Merge the calendars of two users. - The from_user_id is the user_id of the user - that will be deleted and all the calendar elements - of this user will be mapped to the to_user_id. - } { - set msg "Merging calendar" - ns_log Notice $msg - set return_msg [list $msg] - - set from_calendars [db_list_of_lists get_from_calendars {*SQL*} ] - db_transaction { - ns_log Notice " Entering to calendar transaction" - foreach calendar $from_calendars { - # l_* vars will represent - # each item of the from_user_id list of lists - set l_cal_id [lindex $calendar 0] - set l_pkg_id [lindex $calendar 1] - - # if the pkg_id of this cal_id is the - # the same for some to_user_id cal - # we have to delete it, else we must - # change the items from one cal to the other one - if { [db_string get_repeated_pkgs {*SQL*} ] } { - # We will move the cal items if the - # calendars are of the same type (package_id) - set to_cal_id [db_string gettocalid {*SQL*} ] - - db_dml calendar_items_upd { *SQL* } - - # ns_log Notice " Deleting calendar" - # TODO: calendar::delete -calendar_id $l_cal_i is broken - # so, we will delete directly from the calendars table - db_dml del_from_cal { *SQL* } - - } else { - ns_log Notice " Change owner of $calendar" - # change the owner - db_dml calendars_upd { *SQL* } - } - } - set msg " Calendar merge is done" - ns_log Notice $msg - lappend return_msg $msg - } - # I commented this section to avoid partial merges - # If something is wrong the merge should be stopped. - # on_error { - # set msg " I couldn't merge calendar. The error was $errmsg" - # ns_log Notice $msg - # lappend return_msg $msg - # } - return $return_msg - } -} - ad_proc calendar::make_datetime { event_date {event_time ""} @@ -478,6 +401,7 @@ } { return the item types } { + return [concat [list [list {--} {}]] \ [db_list_of_lists select_item_types {}]] } 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 -N -r1.6.6.1 -r1.6.6.2 --- openacs-4/packages/calendar/tcl/calendar-procs.xql 13 Jun 2005 19:39:55 -0000 1.6.6.1 +++ openacs-4/packages/calendar/tcl/calendar-procs.xql 19 Jun 2005 07:49:35 -0000 1.6.6.2 @@ -82,63 +82,4 @@ - - - select calendar_name - from calendars - where owner_id = :user_id - - - - - - select calendar_id,package_id - from calendars - where owner_id = :from_user_id - - - - - - select count(*) - from calendars - where owner_id = :to_user_id - and package_id = :l_pkg_id - - - - - - update calendars - set owner_id = :to_user_id - where owner_id = :from_user_id - and calendar_id = :l_cal_id - - - - - - select calendar_id - from calendars - where package_id = :l_pkg_id - and owner_id = :to_user_id - - - - - - update cal_items - set on_which_calendar = :to_cal_id - where on_which_calendar = :l_cal_id - - - - - - delete - from calendars - where calendar_id = :l_cal_id - - - Index: openacs-4/packages/calendar/www/cal-item-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-delete.tcl,v diff -u -N -r1.5 -r1.5.2.1 --- openacs-4/packages/calendar/www/cal-item-delete.tcl 18 Mar 2005 14:12:08 -0000 1.5 +++ openacs-4/packages/calendar/www/cal-item-delete.tcl 19 Jun 2005 07:49:35 -0000 1.5.2.1 @@ -9,13 +9,13 @@ {confirm_p 0} } -permission::require_permission -object_id $cal_item_id -privilege delete - if {!$confirm_p} { ad_returnredirect "cal-item-delete-confirm?cal_item_id=$cal_item_id" ad_script_abort } +auth::require_login + calendar::item::delete -cal_item_id $cal_item_id ad_returnredirect $return_url 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.15 -r1.15.6.1 --- openacs-4/packages/calendar/www/cal-item-new.adp 15 Feb 2004 12:16:23 -0000 1.15 +++ openacs-4/packages/calendar/www/cal-item-new.adp 19 Jun 2005 07:49:35 -0000 1.15.6.1 @@ -40,12 +40,12 @@
- +
- + 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.26 -r1.26.2.1 --- openacs-4/packages/calendar/www/cal-item-new.tcl 13 Jan 2005 13:56:28 -0000 1.26 +++ openacs-4/packages/calendar/www/cal-item-new.tcl 19 Jun 2005 07:49:35 -0000 1.26.2.1 @@ -15,6 +15,7 @@ {start_time ""} {end_time ""} {view "month"} + {return_url ""} } auth::require_login @@ -38,8 +39,9 @@ from cal_items where cal_item_id = :cal_item_id } -default ""] +} else { + set calendar_id [lindex [lindex $calendar_options 0] 1] } - # TODO: Move into ad_form if { [exists_and_not_null cal_item_id] } { set page_title "One calendar item" @@ -54,17 +56,14 @@ {title:text(text) {label "[_ calendar.Title_1]"} - {html {size 60} maxlength 255} + {html {size 45} maxlength 255} } - - {date:text(text) + {return_url:text(hidden)} + {date:date {label "[_ calendar.Date_1]"} - {html {id sel1}} - {after_html { \[y-m-d \] - }} - - } - + {format "Month DD YYYY"} + {html {id date} } + {after_html {} } } {time_p:text(radio) {label " "} {html {onClick "javascript:TimePChanged(this);"}} @@ -84,7 +83,7 @@ {description:text(textarea),optional {label "[_ calendar.Description]"} - {html {cols 60 rows 3 wrap soft} maxlength 255} + {html {cols 45 rows 10 wrap soft} maxlength 255} } {calendar_id:integer(radio) {label "[_ calendar.Sharing]"} @@ -156,6 +155,9 @@ {title {[string length $title] <= 4000} "Title is too long" } + {description {[string equal [set msg [ad_html_security_check $description]] ""]} + $msg + } } -new_request { # Seamlessly create a private calendar if the user doesn't have one if { ![calendar::have_private_p -party_id $user_id] } { @@ -177,11 +179,13 @@ set start_time "{} {} {} 0 0 {} {HH24:MI}" set end_time "{} {} {} 0 0 {} {HH24:MI}" } + # set the calendar_id before setting item_types form element (see top of script) DAVEB set calendar_id [lindex [lindex $calendar_options 0] 1] } -edit_request { calendar::item::get -cal_item_id $cal_item_id -array cal_item + permission::require_write_permission -object_id $cal_item_id -creation_user $cal_item(creation_user) set cal_item_id $cal_item(cal_item_id) @@ -209,23 +213,27 @@ } # To support green calendar # set date [template::util::date::from_ansi $ansi_start_date] - set date [lindex $ansi_start_date 0] + # set date [lindex $ansi_start_date 0] + set date [calendar::from_sql_datetime -sql_date $ansi_start_date -format "YYY-MM-DD"] set start_time [template::util::date::from_ansi $ansi_start_date [lc_get formbuilder_time_format]] set end_time [template::util::date::from_ansi $ansi_end_date [lc_get formbuilder_time_format]] } -new_data { # To support green calendar - set date [split $date "-"] - lappend date "" - lappend date "" - lappend date "" - lappend date "YYYY MM DD" + # set date [split $date "-"] + # lappend date "" + # lappend date "" + # lappend date "" + # lappend date "YYYY MM DD" + # set date [calendar::to_sql_datetime -date $date -time ""] + set date "[template::util::date::get_property year $date] [template::util::date::get_property month $date] [template::util::date::get_property day $date]" + ns_log Notice " ** $date **" + set start_date [calendar::to_sql_datetime -date $date -time $start_time -time_p $time_p] set end_date [calendar::to_sql_datetime -date $date -time $end_time -time_p $time_p] if { ![calendar::personal_p -calendar_id $calendar_id] } { permission::require_permission -object_id $calendar_id -privilege create } - set cal_item_id [calendar::item::new \ -start_date $start_date \ -end_date $end_date \ @@ -235,19 +243,26 @@ -item_type_id $item_type_id] if {$repeat_p} { - ad_returnredirect [export_vars -base cal-item-create-recurrence { cal_item_id }] + ad_returnredirect [export_vars -base cal-item-create-recurrence { cal_item_id return_url}] } else { - ad_returnredirect [export_vars -base cal-item-view { cal_item_id }] - } + if {![empty_string_p $return_url]} { + ad_returnredirect $return_url + } else { + ad_returnredirect [export_vars -base cal-item-view { cal_item_id }] + } + } ad_script_abort } -edit_data { - set date [split $date "-"] - lappend date "" - lappend date "" - lappend date "" - lappend date "YYYY MM DD" + #set date [split $date "-"] + #lappend date "" + #lappend date "" + #lappend date "" + #lappend date "YYYY MM DD" + # set date [calendar::to_sql_datetime -date $date -time ""] + set date "[template::util::date::get_property year $date] [template::util::date::get_property month $date] [template::util::date::get_property day $date]" + ns_log Notice " ** $date **" # Require write permission on the item and create on the calendar into which we're putting it permission::require_write_permission -object_id $cal_item_id @@ -259,6 +274,8 @@ set start_date [calendar::to_sql_datetime -date $date -time $start_time -time_p $time_p] set end_date [calendar::to_sql_datetime -date $date -time $end_time -time_p $time_p] + + # Do the edit calendar::item::edit \ -cal_item_id $cal_item_id \ @@ -270,7 +287,11 @@ -edit_all_p $edit_all_p \ -calendar_id $calendar_id - ad_returnredirect [export_vars -base cal-item-view { cal_item_id }] + if {![empty_string_p $return_url]} { + ad_returnredirect $return_url + } else { + ad_returnredirect [export_vars -base cal-item-view { cal_item_id }] + } ad_script_abort } Index: openacs-4/packages/calendar/www/cal-item-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.tcl,v diff -u -N -r1.15 -r1.15.2.1 --- openacs-4/packages/calendar/www/cal-item-view.tcl 13 Jan 2005 13:56:30 -0000 1.15 +++ openacs-4/packages/calendar/www/cal-item-view.tcl 19 Jun 2005 07:49:35 -0000 1.15.2.1 @@ -37,6 +37,8 @@ } set date $cal_item(start_date) +set show_synch_p [parameter::get -package_id $package_id -parameter ShowSynchP -default 1] +set cal_item(description) [ad_html_text_convert -from text/enhanced -to text/html $cal_item(description)] ad_return_template Index: openacs-4/packages/calendar/www/mini-calendar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/mini-calendar.adp,v diff -u -N -r1.16 -r1.16.2.1 --- openacs-4/packages/calendar/www/mini-calendar.adp 11 May 2005 17:53:44 -0000 1.16 +++ openacs-4/packages/calendar/www/mini-calendar.adp 19 Jun 2005 07:49:35 -0000 1.16.2.1 @@ -8,7 +8,7 @@ - @views.name@ + @views.name@ @@ -20,16 +20,15 @@ - + @curr_year@ - + - @curr_month@ @@ -41,7 +40,8 @@ - + + @@ -52,22 +52,22 @@ - + - - - - - - + + + + + + + - - - + + + @@ -80,21 +80,21 @@ - +
@months.name@@months.name@ @months.name@ -
@months.name@
@days_of_week.day_short@
- @days.day_number@ + @days.day_number@ - @days.day_number@ + @days.day_number@
@@ -121,7 +121,6 @@ @form_vars;noquote@ @page_num_formvar;noquote@ - Index: openacs-4/packages/calendar/www/mini-calendar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/mini-calendar.tcl,v diff -u -N -r1.15 -r1.15.2.1 --- openacs-4/packages/calendar/www/mini-calendar.tcl 11 May 2005 16:12:26 -0000 1.15 +++ openacs-4/packages/calendar/www/mini-calendar.tcl 19 Jun 2005 07:49:35 -0000 1.15.2.1 @@ -32,15 +32,8 @@ month #acs-datetime.Month# } -array set message_key_title_array { - list #acs-datetime.view_calendar_list# - day #acs-datetime.view_calendar_day# - week #acs-datetime.view_calendar_week# - month #acs-datetime.view_calendar_month# -} - # Create row with existing views -multirow create views name text active_p url title +multirow create views name text active_p url foreach viewname {list day week month} { if { [string equal $viewname $view] } { set active_p t @@ -49,12 +42,10 @@ } if {[string equal $viewname list]} { multirow append views [lang::util::localize $message_key_array($viewname)] $viewname $active_p \ - "[export_vars -base $base_url {date {view $viewname}}]${page_num}${url_stub_period_days}" \ - [lang::util::localize $message_key_title_array($viewname)] + "[export_vars -base $base_url {date {view $viewname}}]${page_num}${url_stub_period_days}" } else { multirow append views [lang::util::localize $message_key_array($viewname)] $viewname $active_p \ - "[export_vars -base $base_url {date {view $viewname}}]${page_num}" \ - [lang::util::localize $message_key_title_array($viewname)] + "[export_vars -base $base_url {date {view $viewname}}]${page_num}" } } @@ -72,7 +63,6 @@ set date_list [dt_ansi_to_list $date] set year [dt_trim_leading_zeros [lindex $date_list 0]] set month [dt_trim_leading_zeros [lindex $date_list 1]] - set month_name [lindex [dt_month_names] $month] set day [dt_trim_leading_zeros [lindex $date_list 2]] set months_list [dt_month_names] @@ -174,7 +164,8 @@ set end_of_week_p f } - multirow append days $day_number $beginning_of_week_p $end_of_week_p $today_p $active_p "[export_vars -base $base_url {{date $ansi_date} view}]${page_num}${url_stub_period_days}" + multirow append days $day_number $beginning_of_week_p $end_of_week_p $today_p $active_p \ + "[export_vars -base $base_url {{date $ansi_date} view}]${page_num}${url_stub_period_days}" incr day_number incr day_of_week } Index: openacs-4/packages/calendar/www/view-month-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-month-display.adp,v diff -u -N -r1.13 -r1.13.6.1 --- openacs-4/packages/calendar/www/view-month-display.adp 26 Feb 2004 12:43:23 -0000 1.13 +++ openacs-4/packages/calendar/www/view-month-display.adp 19 Jun 2005 07:49:35 -0000 1.13.6.1 @@ -1,9 +1,9 @@ @@ -30,12 +30,12 @@ -
- back one month + back one month @month_string@ @year@ - forward one month + forward one month
+ onclick="javascript:location.href='@items.add_url@';"> - + onclick="javascript:location.href='@items.add_url@';"> - @items.day_number@ + @items.day_number@@items.day_number@ Index: openacs-4/packages/calendar/www/view-month-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-month-display.tcl,v diff -u -N -r1.17 -r1.17.2.1 --- openacs-4/packages/calendar/www/view-month-display.tcl 6 May 2004 15:21:41 -0000 1.17 +++ openacs-4/packages/calendar/www/view-month-display.tcl 19 Jun 2005 07:49:35 -0000 1.17.2.1 @@ -1,8 +1,14 @@ +if {![info exists add_p] || [string equal "" $add_p]} { + set add_p t +} +if {![info exists link_day_p] || [string equal "" $link_day_p]} { + set link_day_p t +} if {![info exists date] || [empty_string_p $date]} { # Default to todays date in the users (the connection) timezone set server_now_time [dt_systime] set user_now_time [lc_time_system_to_conn $server_now_time] - set date [lc_time_fmt $user_now_time "%x"] + set date $user_now_time } dt_get_info $date @@ -14,20 +20,26 @@ set portlet_mode_p 1 } +set url_stub_callback "" +set page_num_urlvar "" +set base_url "" if {[info exists portlet_mode_p] && $portlet_mode_p} { set page_num_urlvar "&page_num=$page_num" set item_template "\${url_stub}cal-item-view?show_cal_nav=0&return_url=[ad_urlencode "../"]&action=edit&cal_item_id=\$item_id" set prev_month_template "?view=month&date=\[ad_urlencode \$prev_month\]&page_num=$page_num" set next_month_template "?view=month&date=\[ad_urlencode \$next_month\]&page_num=$page_num" set url_stub_callback "calendar_portlet_display::get_url_stub" -} else { +} elseif {![info exists item_template] || [string equal "" $item_template]} { + # allow item_template to be passed in as a parameter set item_template "cal-item-view?cal_item_id=\$item_id" - set prev_month_template "view?view=month&\date=[ad_urlencode $prev_month]" - set next_month_template "view?view=month&\date=[ad_urlencode $next_month]" - set url_stub_callback "" - set page_num_urlvar "" - set base_url "" +} +# allow prev_month_template and next_month_template to be passed in +if {![info exists prev_month_template] || [string equal "" $prev_month_template]} { + set prev_month_template "view?view=month&date=\[ad_urlencode \$prev_month\]" } +if {![info exists next_month_template] || [string equal "" $next_month_template]} { + set next_month_template "view?view=month&date=\[ad_urlencode \$next_month\]" +} if { ![info exists show_calendar_name_p] } { set show_calendar_name_p 1 @@ -148,6 +160,11 @@ -current_day $current_day \ -today_julian_date $today_julian_date \ -first_julian_date_of_month $first_julian_date_of_month] + if {$link_day_p} { + set day_link "?view=day&date=[dt_julian_to_ansi $current_day]&$page_num_urlvar" + } else { + set day_link "" + } multirow append items \ "" \ "" \ @@ -161,7 +178,7 @@ f \ 0 \ "${base_url}cal-item-new?date=[dt_julian_to_ansi $current_day]&start_time=&end_time" \ - "?view=day&date=[dt_julian_to_ansi $current_day]&$page_num_urlvar" + $day_link } } @@ -187,7 +204,11 @@ -current_day $current_day \ -today_julian_date $today_julian_date \ -first_julian_date_of_month $first_julian_date_of_month] - + if {$link_day_p} { + set day_link "?view=day&date=[dt_julian_to_ansi $current_day]&$page_num_urlvar" + } else { + set day_link "" + } multirow append items \ $name \ [subst $item_template] \ @@ -201,7 +222,7 @@ f \ $time_p \ "${base_url}cal-item-new?date=[dt_julian_to_ansi $current_day]&start_time=&end_time" \ - "?view=day&date=[dt_julian_to_ansi $current_day]&$page_num_urlvar" + $day_link } # Add cells for remaining days inside the month @@ -212,6 +233,12 @@ -today_julian_date $today_julian_date \ -first_julian_date_of_month $first_julian_date_of_month] + if {$link_day_p} { + set day_link "?view=day&date=[dt_julian_to_ansi $current_day]&$page_num_urlvar" + } else { + set day_link "" + } + multirow append items \ "" \ "" \ @@ -225,7 +252,7 @@ f \ 0 \ "${base_url}cal-item-new?date=[dt_julian_to_ansi $current_day]&start_time=&end_time" \ - "?view=day&date=[dt_julian_to_ansi $current_day]&$page_num_urlvar" + $day_link } # Add cells for remaining days outside the month Index: openacs-4/packages/calendar/www/view-one-day-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-one-day-display.adp,v diff -u -N -r1.17 -r1.17.2.1 --- openacs-4/packages/calendar/www/view-one-day-display.adp 11 May 2005 17:53:44 -0000 1.17 +++ openacs-4/packages/calendar/www/view-one-day-display.adp 19 Jun 2005 07:49:35 -0000 1.17.2.1 @@ -1,7 +1,6 @@ - + Index: openacs-4/packages/calendar/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/admin/index.tcl,v diff -u -N -r1.6 -r1.6.2.1 --- openacs-4/packages/calendar/www/admin/index.tcl 1 Mar 2005 00:01:26 -0000 1.6 +++ openacs-4/packages/calendar/www/admin/index.tcl 19 Jun 2005 07:49:35 -0000 1.6.2.1 @@ -9,7 +9,7 @@ } # find out the user_id -set user_id [ad_conn user_id] +set user_id [ad_verify_and_get_user_id] set package_id [ad_conn package_id] set page_title [_ calendar.lt_Calendar_Administrati] Index: openacs-4/packages/calendar/www/resources/calendar.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/resources/calendar.css,v diff -u -N -r1.7 -r1.7.2.1 --- openacs-4/packages/calendar/www/resources/calendar.css 13 Jan 2005 13:56:31 -0000 1.7 +++ openacs-4/packages/calendar/www/resources/calendar.css 19 Jun 2005 07:49:36 -0000 1.7.2.1 @@ -1,5 +1,5 @@ -.cal-table-header { - background: #99CCFF; +ca.cal-table-header { + background: #587d91; color: #000000; margin: 0px; padding: 0px; @@ -9,7 +9,7 @@ .cal-month-title-text { font-size: 140%; font-weight: bold; - background-color: #003366; + background-color: #003b53; text-align: center; color: #FFFFFF; } @@ -27,7 +27,7 @@ font-weight: bold; border-width: 0px 0px 1px 0px; border-style: solid; - border-color: #99CCFF; + border-color: #dfe2e5; } .cal-week { @@ -36,11 +36,11 @@ font-weight: bold; border-width: 0px 0px 1px 0px; border-style: solid; - border-color: #99CCFF; + border-color: #dfe2e5; } .cal-month-day { - background: #DDEEFF; + background: #dfe2e5; border: 0px none; color: #003366; font-weight: bold; @@ -56,7 +56,7 @@ .cal-month-today { font-weight: bold; - background-color: #003366; + background-color: #587d91; text-align: left; color: #FFFFFF; border: 0px solid; @@ -69,7 +69,7 @@ cursor: pointer; } .cal-month-today a { - color: #DDEEFF; + color: #dfe2e5; } .cal-no-border { @@ -82,10 +82,10 @@ font-size: 8pt; white-space: nowrap; font-weight: bold; - border-top: 0px solid #99CCFF; - border-right: 0px solid #99CCFF; - border-bottom: 1px solid #99CCFF; - border-left: 0px solid #99CCFF; + border-top: 0px solid #dfe2e5; + border-right: 0px solid #dfe2e5; + border-bottom: 1px solid #dfe2e5; + border-left: 0px solid #dfe2e5; } .mini-calendar .view-list td { @@ -97,7 +97,7 @@ } .mini-calendar .view-list .selected { - background-color: #CEE6FF; + background-color: #6b96ad; } .mini-calendar .view-list a { @@ -130,7 +130,7 @@ color: #000000; margin: 0px; padding: 0px; - border: 1px solid #99CCFF; + border: 1px solid #dfe2e5; background-color: #FFFFFF; } @@ -192,7 +192,7 @@ white-space: nowrap; border-width: 0px 0px 0px 1px; border-style: solid; - border-color: #99CCFF; + border-color: #dfe2e5; } .cal-navbar-spacer-start { @@ -247,7 +247,7 @@ } .cal-row-dark { - background: #DDEEFF; + background: #dfe2e5; } .cal-row-light { @@ -256,12 +256,12 @@ .cal-row-hi { font-weight: bold; - border: 0px solid #7D7DFF; + border: 0px solid #6b96ad; } .cal-row-lo { color: #999999; - border: 0px solid #7D7DFF; + border: 0px solid #6b96ad; } #at-a-glance { @@ -275,7 +275,7 @@ padding: 1px; width: 30px; border: 1px solid #ffffff; - background-color: #DDEEFF; + background-color: #Dfe2e5; } #at-a-glance td.months { @@ -316,7 +316,7 @@ } #at-a-glance td.inactive { - background-color: #DDEEFF; + background-color: #dfe2e5; text-align: right; } @@ -325,7 +325,7 @@ } #at-a-glance td.active { - background-color: #DDEEFF; + background-color: #dfe2e5; text-align: right; } #at-a-glance td.active:hover { @@ -344,7 +344,7 @@ } #jump { - background: #99CCFF; + background: #6b96ad; color: #000000; margin: 0px; padding: 0px; @@ -388,34 +388,34 @@ } .mini-calendar .header td.back { - background-color: #003366; + background-color: #003b53; vertical-align: middle; text-align: left; } .mini-calendar .header td.forward { - background-color: #003366; + background-color: #003b53; vertical-align: middle; text-align: right; } .mini-calendar .header td.current_view { font-size: 140%; font-weight: bold; - background-color: #003366; + background-color: #003b53; text-align: center; color: #FFFFFF; } .mini-calendar { - border: 1px solid #99CCFF; + border: 1px solid #dfe2e5; font-size: 90%; width: 240px; } .cal-month { font-weight: bold; - background-color: #DDEEFF; + background-color: #Dfe2e5; text-align: center; line-height: 160%; @@ -434,7 +434,7 @@ } .cal-week-events { width: 100%; - background-color: #DDEEFF; + background-color: #dfe2e5; } @@ -487,7 +487,6 @@ } .cal-day-time { - white-space: nowrap; font-weight: bold; text-align: right; font-size: 80%; @@ -500,12 +499,12 @@ } .cal-week-event-notime { - background-color: #DDEEFF; + background-color: #dfe2e5; font-weight: bold; } .cal-week-event-notime a { - background-color: #DDEEFF; + background-color: #dfe2e5; } .cal-day-event-notime { @@ -528,17 +527,18 @@ .cal-table-data-title { background: #FFFFFF; font-weight: bold; - border: 0px solid #99CCFF; + border: 0px solid #dfe2e5; text-align: right; padding-top: 0px 10px 0px 0px; width: 1%; white-space: nowrap; + vertical-align: top; } .cal-table-data-action { - background: #DDEEFF; + background: #dfe2e5; font-weight: bold; - border: 1px solid #99CCFF; + border: 1px solid #dfe2e5; text-align: center; width: 1%; white-space: nowrap;
- back one day @dates@ forward one day @@ -15,7 +14,7 @@
No TimeNo Time @@ -38,7 +37,7 @@ @@ -60,4 +59,3 @@
- @items.localized_current_hour@ + @items.localized_current_hour@
- 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.32 -r1.32.2.1 --- openacs-4/packages/calendar/www/view-one-day-display.tcl 11 May 2005 17:53:44 -0000 1.32 +++ openacs-4/packages/calendar/www/view-one-day-display.tcl 19 Jun 2005 07:49:35 -0000 1.32.2.1 @@ -85,7 +85,6 @@ set day_current_hour 0 set localized_day_current_hour "" -set localized_date_current "" set item_add_without_time [subst $hour_template] # Now items with time @@ -95,7 +94,6 @@ calendar_name \ status_summary \ add_url \ - add_title \ localized_current_hour \ current_hour \ start_time \ @@ -161,26 +159,23 @@ for { } { $day_current_hour < $item_start_hour } { incr day_current_hour } { set localized_day_current_hour [lc_time_fmt "$current_date $day_current_hour:00:00" "%X"] - set localized_date_current [lc_time_fmt "$current_date $day_current_hour:00:00" "%x"] multirow append items \ "" \ "" \ "" \ "" \ [subst $hour_template] \ - "[_ calendar.Add_item_beginning_at]" \ $localized_day_current_hour \ $day_current_hour \ 0 \ 0 \ "" \ - "" + "" } } set day_current_hour [lindex $this_item 0] set localized_day_current_hour [lc_time_fmt "$current_date $day_current_hour:00:00" "%X"] - set localized_date_current [lc_time_fmt "$current_date $day_current_hour:00:00" "%x"] # reset url stub set url_stub "" @@ -208,7 +203,6 @@ [lindex $this_item 3] \ [lindex $this_item 4] \ $current_hour_link \ - "[_ calendar.Add_item_beginning_at]" \ $localized_day_current_hour \ $day_current_hour \ [lindex $this_item 7] \ @@ -223,14 +217,12 @@ # need to add dummy entries to show all hours for { } { $day_current_hour < $end_display_hour } { incr day_current_hour } { set localized_day_current_hour [lc_time_fmt "$current_date $day_current_hour:00:00" "%X" [ad_conn locale]] - set localized_date_current [lc_time_fmt "$current_date $day_current_hour:00:00" "%x" [ad_conn locale]] multirow append items \ "" \ "" \ "" \ "" \ "[subst $hour_template]" \ - "[_ calendar.Add_item_beginning_at]" \ $localized_day_current_hour \ $day_current_hour \ "" \ Index: openacs-4/packages/calendar/www/view-week-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display.adp,v diff -u -N -r1.10 -r1.10.2.1 --- openacs-4/packages/calendar/www/view-week-display.adp 11 May 2005 16:12:57 -0000 1.10 +++ openacs-4/packages/calendar/www/view-week-display.adp 19 Jun 2005 07:49:35 -0000 1.10.2.1 @@ -17,10 +17,11 @@
- [@items.start_date@ | - #calendar.Add_Item# - ] - + + #calendar.Add_Item# + + @items.start_date@