Index: openacs-4/packages/calendar/calendar.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/calendar.info,v diff -u -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 @@ <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - <version name="2.1.0b3" url="http://openacs.org/repository/download/apm/calendar-2.1.0b3.apm"> + <version name="2.1.0b4" url="http://openacs.org/repository/download/apm/calendar-2.1.0b4.apm"> <owner url="mailto:openacs-calendar@dirkgomez.de">Dirk Gomez</owner> <summary>Personal and shared event calendars.</summary> - <release-date>2004-03-04</release-date> + <release-date>2005-06-03</release-date> <vendor url="http://openacs.org">OpenACS</vendor> <description format="text/html">Manage group and shared calendars with download.</description> - <provides url="calendar" version="2.1.0b3"/> + <provides url="calendar" version="2.1.0b4"/> <requires url="acs-datetime" version="4.0"/> <requires url="acs-events" version="0.1d"/> <requires url="acs-lang" version="5.0.0b4"/> <requires url="notifications" version="5.0.0b4"/> <requires url="ref-timezones" version="5.0.0b4"/> - <callbacks> - <callback type="after-install" proc="calendar::install::package_install"/> - <callback type="before-uninstall" proc="calendar::install::package_uninstall"/> - <callback type="before-upgrade" proc="calendar::install::package_upgrade"/> + <callbacks> </callbacks> - <parameters> <parameter datatype="number" min_n_values="1" max_n_values="1" name="Attachments" default="0" description="Allow Files to be Uploaded"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="DefaultView" default="day" description="The default list for this instance of calendar: one of day, list, week, month. Defaults to day."/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="ShowSynchP" default="1" description="Determines if options to synch to Outlook are visible. Set to 1 to show sync options, set to 0 to supress synch options."/> </parameters> </version> 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 -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 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<message_catalog package_key="calendar" package_version="2.1.0b3" locale="en_US" charset="ISO-8859-1"> +<message_catalog package_key="calendar" package_version="2.1.0b1" locale="en_US" charset="ISO-8859-1"> <msg key="_You_may_choose_to">. You may choose to:</msg> <msg key="Add">Add</msg> <msg key="add">add</msg> <msg key="Add_a_new_Audience">Add a new Audience</msg> <msg key="add_an_event">add an event</msg> - <msg key="Add_an_item">Add an item</msg> <msg key="Add_Item">Add Item</msg> - <msg key="Add_item_beginning_at">Add an item beginning at %localized_day_current_hour% on %localized_date_current%</msg> <msg key="Add_Recurrence">Add Recurrence</msg> <msg key="All_Day_Event">All Day Event</msg> <msg key="all_events">all events</msg> @@ -55,9 +53,6 @@ <msg key="Events_over_a">Events over a</msg> <msg key="Friday">Friday</msg> <msg key="from">from</msg> - <msg key="Go_to_monthsname">Go to %months.name%</msg> - <msg key="Go_to_year_next_year">Go to year %next_year%</msg> - <msg key="Go_to_year_prev_year">Go to year %prev_year%</msg> <msg key="Grant">Grant</msg> <msg key="Grant_Permissions">Grant Permissions</msg> <msg key="is_recurring">Item is recurring.</msg> @@ -80,29 +75,6 @@ <msg key="lt_Edit_your_Calendar_Pr">Edit your Calendar Preferences</msg> <msg key="lt_everyone_have_read_pe">everyone have read permission, and can see the items, registered and un-reg-ed users alike.</msg> - <msg key="lt_Go_to_month_name_days">Go to %month_name% %days.day_number%, %year%</msg> - <msg key="lt_Go_to_monthsname_curr">Go to %months.name% %curr_year%</msg> - <msg key="lt_Go_to_monthsname_curr_1">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%</msg> <msg key="lt_Hide_Checked_Calendar">Hide Selected Calendars</msg> <msg key="lt_Manage_Calendar_Audie">Manage Calendar Audiences</msg> <msg key="lt_no_parties_exist_cont">no parties exist. contact your system admin</msg> @@ -142,8 +114,6 @@ <msg key="Saturday">Saturday</msg> <msg key="Select_Calendars">Select Calendars</msg> <msg key="Sharing">Sharing</msg> - <msg key="skip_day_calendar">Skip day calendar</msg> - <msg key="skip_month_calendar">Skip month calendar</msg> <msg key="Start_Time">Start Time</msg> <msg key="start_time_before_end_time">Start time is before end time</msg> <msg key="Submit_query">Submit query</msg> 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 -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 -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 -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 -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 -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 @@ </querytext> </fullquery> - <fullquery name="callback::MergeShowUserInfo::impl::calendar.get_calendars"> - <querytext> - select calendar_name - from calendars - where owner_id = :user_id - </querytext> - </fullquery> - - <fullquery name="callback::MergePackageUser::impl::calendar.get_from_calendars"> - <querytext> - select calendar_id,package_id - from calendars - where owner_id = :from_user_id - </querytext> - </fullquery> - - <fullquery name="callback::MergePackageUser::impl::calendar.get_repeated_pkgs"> - <querytext> - select count(*) - from calendars - where owner_id = :to_user_id - and package_id = :l_pkg_id - </querytext> - </fullquery> - - <fullquery name="callback::MergePackageUser::impl::calendar.calendars_upd"> - <querytext> - update calendars - set owner_id = :to_user_id - where owner_id = :from_user_id - and calendar_id = :l_cal_id - </querytext> - </fullquery> - - <fullquery name="callback::MergePackageUser::impl::calendar.gettocalid"> - <querytext> - select calendar_id - from calendars - where package_id = :l_pkg_id - and owner_id = :to_user_id - </querytext> - </fullquery> - - <fullquery name="callback::MergePackageUser::impl::calendar.calendar_items_upd"> - <querytext> - update cal_items - set on_which_calendar = :to_cal_id - where on_which_calendar = :l_cal_id - </querytext> - </fullquery> - - <fullquery name="callback::MergePackageUser::impl::calendar.del_from_cal"> - <querytext> - delete - from calendars - where calendar_id = :l_cal_id - </querytext> - </fullquery> - </queryset> 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 -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 -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 @@ <div id="viewadp-mini-calendar"> <include src="mini-calendar" base_url="view" view="@view@" date="@ansi_date@"> </div> - + <div id="events"> <formtemplate id="cal_item"></formtemplate> </div> -</if> + <script language="JavaScript"> TimePChanged(); </script> 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 -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 {<input type='reset' value=' ... ' onclick=\"return showCalendar('sel1', 'y-m-d');\"> \[<b>y-m-d </b>\] - }} - - } - + {format "Month DD YYYY"} + {html {id date} } + {after_html {<input type="button" style="height:23px; width:23px; background: url('/resources/acs-templating/calendar.gif');" onclick ="return showCalendarWithDateWidget('date', 'y-m-d');" />} } } {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 -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 -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 @@ </if> <else> <td> - <a href="@views.url@" title="@views.title@">@views.name@</a> + <a href="@views.url@">@views.name@</a> </td> </else> </multiple> @@ -20,16 +20,15 @@ <tr> <if @view@ eq "month"> <td class="back"> - <a href="@prev_year_url@" title="#calendar.Go_to_year_prev_year#"><img border="0" src="/resources/acs-subsite/left.gif"></a> + <a href="@prev_year_url@"><img border="0" src="/resources/acs-subsite/left.gif"></a> </td> <td class="current_view" colspan="2">@curr_year@</td> <td class="forward"> - <a href="@next_year_url@" title="#calendar.Go_to_year_next_year#"><img border="0" src="/resources/acs-subsite/right.gif"></a> + <a href="@next_year_url@"><img border="0" src="/resources/acs-subsite/right.gif"></a> </td> </if> <else> <td class="back"> - <a href="#month_calendar_end" alt="#calendar.skip_month_calendar#"></a> <a href="@prev_month_url@"><img border=0 src="/resources/acs-subsite/left.gif"></a> </td> <td class="current_view" colspan="2">@curr_month@</td> @@ -41,7 +40,8 @@ </table> </td> </tr> - + + <tr> <td colspan="4"> <table id="at-a-glance" cellspacing="0" cellpadding="0"> @@ -52,22 +52,22 @@ </tr><tr> </if> <if @months.current_month_p@ true> - <td class="months selected"><a href="@months.url@" title="#calendar.lt_Go_to_monthsname_curr#" >@months.name@</a></td> + <td class="months selected"><a href="@months.url@">@months.name@</a></td> </if> <else> - <td class="months"><a href="@months.url@" title="#calendar.Go_to_monthsname#">@months.name@</a> - </td> - </else> - </multiple> - </if> - <else> - <tr class="days"> + <td class="months"><a href="@months.url@">@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"> + </tr> + + <multiple name="days"> <if @days.beginning_of_week_p@ true> <tr> </if> @@ -80,21 +80,21 @@ </if> <else> <td class="active" onclick="javascript:location.href='@days.url@';"> - <a href="@days.url@" title="#calendar.lt_Go_to_month_name_days#">@days.day_number@</a> + <a href="@days.url@">@days.day_number@</a> </td> </else> </if> <else> <td class="inactive" onclick="javascript:location.href='@days.url@';"> - <a href="@days.url@" title="#calendar.lt_Go_to_month_name_days#">@days.day_number@</a> + <a href="@days.url@">@days.day_number@</a> </td> </else> <if @days.end_of_week_p@ true> </tr> </if> </multiple> - </else> + </else> </table> @@ -121,7 +121,6 @@ @form_vars;noquote@ @page_num_formvar;noquote@ </form> - <a name="month_calendar_end" /> </td> </tr> </table> 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 -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 -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 @@ <table class="cal-table-display" cellpadding="0" cellspacing="0" border="0" width="99%"> <tr> <td class="cal-month-title-text" colspan="7"> - <a href="@previous_month_url@"><img border=0 src="<%=[dt_left_arrow]%>" alt="back one month"></a> + <a href="@previous_month_url;noquote@"><img border=0 src="<%=[dt_left_arrow]%>" alt="back one month"></a> @month_string@ @year@ - <a href="@next_month_url@"><img border=0 src="<%=[dt_right_arrow]%>" alt="forward one month"></a> + <a href="@next_month_url;noquote@"><img border=0 src="<%=[dt_right_arrow]%>" alt="forward one month"></a> </td> </tr> <tr> @@ -30,12 +30,12 @@ </if> <else> <if @items.today_p@ true> - <td class="cal-month-today" onclick="javascript:location.href='@items.add_url@';"> + <td class="cal-month-today" <if @add_p@> onclick="javascript:location.href='@items.add_url@';"</if>> </if> <else> - <td class="cal-month-day" onclick="javascript:location.href='@items.add_url@';"> + <td class="cal-month-day" <if @add_p@>onclick="javascript:location.href='@items.add_url@';"</if>> </else> - <a href="@items.day_url@">@items.day_number@</a> + <if @items.day_url@ not nil><a href="@items.day_url@">@items.day_number@</a></if><else>@items.day_number@</else> <group column="day_number"> <if @items.event_name@ true> 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 -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 -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 @@ <table class="cal-table-display" cellpadding="1" cellspacing="2" width="99%"> <tr> <td class="cal-month-title-text"> - <a href="#day_calendar_end" alt="#calendar.skip_day_calendar#"></a> <a href="@previous_week_url@"><img border=0 src="<%=[dt_left_arrow]%>" alt="back one day"></a> @dates@ <a href="@next_week_url@"><img border=0 src="<%=[dt_right_arrow]%>" alt="forward one day"></a> @@ -15,7 +14,7 @@ <tr> <td> <tr class="cal-row-light"> - <td width="1%" class="cal-day-time"><a href="@item_add_without_time@" title="#calendar.Add_an_item#"><img border="0" align="left" src="/resources/acs-subsite/add.gif" alt="No Time"></a></td> + <td width="1%" class="cal-day-time"><a href="@item_add_without_time@"><img border="0" align="left" src="/resources/acs-subsite/add.gif" alt="No Time"></a></td> <td> <table> <multiple name="items_without_time"> @@ -38,7 +37,7 @@ </else> <td width="10%" class="cal-day-time"> - <a href="@items.add_url@" title="@items.add_title@">@items.localized_current_hour@</a> + <a href="@items.add_url@">@items.localized_current_hour@</a> </td> <group column="current_hour"> @@ -60,4 +59,3 @@ </td> </tr> </table> -<a name="day_calendar_end" /> 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 -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 -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 @@ </td> <td width="95%" class="cal-week"> - [<a href="@items.day_url@">@items.start_date@</a> | <a href="@items.add_url@"> - #calendar.Add_Item# - </a>] - + <a href="@items.add_url@"> + <img border="0" align="right" height="7" width="7" + src="/resources/acs-subsite/add.gif" alt="#calendar.Add_Item#"> + </a> + <a href="@items.day_url@">@items.start_date@</a> </td> </tr> 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 -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 -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;