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.37 -r1.38 --- openacs-4/packages/calendar/www/cal-item-new.tcl 2 Sep 2008 21:02:27 -0000 1.37 +++ openacs-4/packages/calendar/www/cal-item-new.tcl 8 Sep 2008 20:13:37 -0000 1.38 @@ -165,7 +165,11 @@ } -new_request { # Seamlessly create a private calendar if the user doesn't have one if { ![calendar::have_private_p -party_id $user_id] } { - calendar::new -owner_id $user_id -private_p "t" -calendar_name "Personal" -package_id $package_id + set calendar_id [calendar::new \ + -owner_id $user_id \ + -private_p "t" \ + -calendar_name "Personal" \ + -package_id $package_id] } set date [calendar::from_sql_datetime -sql_date $ansi_date -format "YYY-MM-DD"] Index: openacs-4/packages/calendar/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/index.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/calendar/www/index.tcl 6 May 2004 15:21:41 -0000 1.17 +++ openacs-4/packages/calendar/www/index.tcl 8 Sep 2008 20:13:37 -0000 1.18 @@ -13,7 +13,11 @@ set user_id [ad_conn user_id] if { ![calendar::have_private_p -party_id $user_id] } { - calendar::new -owner_id $user_id -private_p "t" -calendar_name "Personal" -package_id $package_id + set calendar_id [calendar::new \ + -owner_id $user_id \ + -private_p "t" \ + -calendar_name "Personal" \ + -package_id $package_id] } ad_returnredirect "view" Index: openacs-4/packages/calendar/www/view-list-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-list-display.adp,v diff -u -r1.17 -r1.18 --- openacs-4/packages/calendar/www/view-list-display.adp 2 Sep 2008 20:52:42 -0000 1.17 +++ openacs-4/packages/calendar/www/view-list-display.adp 8 Sep 2008 20:13:37 -0000 1.18 @@ -11,7 +11,7 @@ 30  |  60 ] - + 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 -r1.29 -r1.30 --- openacs-4/packages/calendar/www/view-list-display.tcl 2 Sep 2008 20:49:14 -0000 1.29 +++ openacs-4/packages/calendar/www/view-list-display.tcl 8 Sep 2008 20:13:37 -0000 1.30 @@ -8,36 +8,6 @@ } } -if {[info exists url_stub_callback]} { - # This parameter is only set if this file is called from .LRN. - # This way I make sure that for the time being this adp/tcl - # snippet is backwards-compatible. - set portlet_mode_p 1 -} else { - set portlet_mode_p 0 -} - -if {![info exists return_url]} { - set return_url [ad_urlencode "../"] -} - -if {[info exists portlet_mode_p] && $portlet_mode_p} { - set event_url_template "\${url_stub}cal-item-view?show_cal_nav=0&return_url=$return_url&action=edit&cal_item_id=\$item_id" - set url_stub_callback "calendar_portlet_display::get_url_stub" - set page_num_formvar [export_form_vars page_num] - set page_num "&page_num=$page_num" -} else { - set event_url_template "cal-item-view?cal_item_id=\$item_id" - set url_stub_callback "" - set page_num_formvar "" - set page_num "" - set base_url "" -} - -if { ![info exists url_template] } { - set url_template {?sort_by=$sort_by} -} - if { ![info exists show_calendar_name_p] } { set show_calendar_name_p 1 } @@ -66,14 +36,6 @@ #} set end_date [clock format [clock scan "+${period_days} days" -base [clock scan $start_date]] -format "%Y-%m-%d 00:00"] -if {[exists_and_not_null page_num]} { - set page_num_formvar [export_form_vars page_num] - set page_num "&page_num=$page_num" -} else { - set page_num_formvar "" - set page_num "" -} - set package_id [ad_conn package_id] set user_id [ad_conn user_id] @@ -98,9 +60,6 @@ set today_ansi_list [dt_ansi_to_list $today_date] set today_julian_date [dt_ansi_to_julian [lindex $today_ansi_list 0] [lindex $today_ansi_list 1] [lindex $today_ansi_list 2]] -set item_type_url "?view=list&sort_by=item_type&start_date=$start_date&period_days=$period_days$page_num" -set start_date_url "?view=list&sort_by=start_date&start_date=$start_date&period_days=$period_days$page_num" - set view list set form_vars [export_vars -form -entire_form -exclude {period_days}] set url_vars [export_vars -url -entire_form -exclude {period_days}] @@ -183,21 +142,11 @@ set today "" } - # reset url stub - set url_stub "" + set event_url [export_vars -base [site_node::get_url_from_object_id -object_id $cal_package_id]cal-item-view {return_url {cal_item_id $item_id}}] - # In case we need to dispatch to a different URL (ben) - if {![empty_string_p $url_stub_callback]} { - # Cache the stuff - if {![info exists url_stubs($calendar_id)]} { - set url_stubs($calendar_id) [$url_stub_callback $calendar_id] - } - set url_stub $url_stubs($calendar_id) - } - multirow append items \ $name \ - [subst $event_url_template] \ + $event_url \ $calendar_name \ $item_type \ $pretty_weekday \ @@ -210,7 +159,7 @@ "calendar-ItemListName" \ "calendar-ItemListDescription" \ "calendar-ItemListContainer" \ - "[subst $event_url_template]&export=print" + $event_url&[export_vars {{export print}}] } set start_year [lc_time_fmt $start_date "%Y"] @@ -256,4 +205,4 @@ {value "$period_days"} {after_html "[_ calendar.days]"} } -} -on_submit { } \ No newline at end of file +} -on_submit { } 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.23 -r1.24 --- openacs-4/packages/calendar/www/view-month-display.tcl 30 Aug 2008 19:51:23 -0000 1.23 +++ openacs-4/packages/calendar/www/view-month-display.tcl 8 Sep 2008 20:13:37 -0000 1.24 @@ -15,50 +15,14 @@ dt_get_info $date -if {[info exists url_stub_callback]} { - # This parameter is only set if this file is called from .LRN. - # This way I make sure that for the time being this adp/tcl - # snippet is backwards-compatible. - set portlet_mode_p 1 -} - if {![info exists return_url]} { set return_url [ad_urlencode "../"] } -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=$return_url&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 { - 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 "" -} - if { ![info exists show_calendar_name_p] } { set show_calendar_name_p 1 } -if { [info exists calendar_id_list] } { - if {[llength $calendar_id_list] > 1} { - set force_calendar_id [calendar::have_private_p -return_id 1 -calendar_id_list $calendar_id_list -party_id [ad_conn user_id]] - } else { - set force_calendar_id [lindex $calendar_id_list 0] - } - - calendar::get -calendar_id $force_calendar_id -array force_calendar - set base_url [apm_package_url_from_id $force_calendar(package_id)] -} else { - set base_url "" -} - - if {[exists_and_not_null calendar_id_list]} { set calendars_clause [db_map dbqd.calendar.www.views.openacs_in_portal_calendar] } else { @@ -76,8 +40,8 @@ set user_id [ad_conn user_id] set today_date [dt_sysdate] -set previous_month_url "[subst $prev_month_template]" -set next_month_url "[subst $next_month_template]" +set previous_month_url ?[export_vars {{view month} {date $prev_month} page_num}] +set next_month_url ?[export_vars {{view month} {date $next_month} page_num}] set first_day_of_week [lc_get firstdayofweek] set last_day_of_week [expr [expr $first_day_of_week + 6] % 7] @@ -200,12 +164,14 @@ -today_julian_date $today_julian_date \ -first_julian_date_of_month $first_julian_date_of_month] + set current_day_ansi [dt_julian_to_ansi $current_day] + multirow append items \ "" \ "" \ "" \ "" \ - [lc_time_fmt [dt_julian_to_ansi $current_day] %Q] \ + [lc_time_fmt $current_day_ansi %Q] \ "" \ "" \ "" \ @@ -217,39 +183,28 @@ $display_information(today_p) \ 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" \ + [export_vars -base ${calendar_url}cal-item-new {{date $current_day_ansi} {start_time ""} {end_time ""}}] \ + ?[export_vars {{view day} {date $current_day_ansi} page_num}] \ "calendar-${system_type}Item" \ $num_attachments \ - [lc_time_fmt [dt_julian_to_ansi $current_day] %w] + [lc_time_fmt $current_day_ansi %w] } } - # reset url stub - set url_stub "" - - # In case we need to dispatch to a different URL (ben) - if {![empty_string_p $url_stub_callback]} { - # Cache the stuff - if {![info exists url_stubs($calendar_id)]} { - set url_stubs($calendar_id) [$url_stub_callback $calendar_id] - } - - set url_stub $url_stubs($calendar_id) - } - array set display_information \ [calendar::get_month_multirow_information \ -current_day $current_day \ -today_julian_date $today_julian_date \ -first_julian_date_of_month $first_julian_date_of_month] + set current_day_ansi [dt_julian_to_ansi $current_day] + multirow append items \ $name \ - [subst $item_template] \ + [export_vars -base [site_node::get_url_from_object_id -object_id $cal_package_id]cal-item-view {return_url {cal_item_id $item_id}}] \ $description \ $calendar_name \ - [lc_time_fmt [dt_julian_to_ansi $current_day] %Q] \ + [lc_time_fmt $current_day_ansi %Q] \ $pretty_start_date \ $pretty_end_date \ $pretty_start_time \ @@ -261,11 +216,11 @@ $display_information(today_p) \ 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" \ + [export_vars -base ${calendar_url}cal-item-new {{date $current_day_ansi} {start_time ""} {end_time ""}}]" \ + ?[export_vars {{view day} {date $current_day_ansi} page_num}] \ "calendar-${system_type}Item" \ $num_attachments \ - [lc_time_fmt [dt_julian_to_ansi $current_day] %w] + [lc_time_fmt $current_day_ansi %w] } if { !$exporting_p } { @@ -279,13 +234,15 @@ -current_day $current_day \ -today_julian_date $today_julian_date \ -first_julian_date_of_month $first_julian_date_of_month] + + set current_day_ansi [dt_julian_to_ansi $current_day] multirow append items \ "" \ "" \ "" \ "" \ - [lc_time_fmt [dt_julian_to_ansi $current_day] %Q] \ + [lc_time_fmt $current_day_ansi %Q] \ "" \ "" \ "" \ @@ -297,11 +254,11 @@ $display_information(today_p) \ 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" \ + [export_vars -base ${calendar_url}cal-item-new {{date $current_day_ansi} {start_time ""} {end_time ""}}] \ + ?[export_vars {{view day} {date $current_day_ansi} page_num}] \ "" \ "" \ - [lc_time_fmt [dt_julian_to_ansi $current_day] %w] + [lc_time_fmt $current_day_ansi %w] } # Add cells for remaining days outside the month 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.37 -r1.38 --- openacs-4/packages/calendar/www/view-one-day-display.tcl 30 Aug 2008 19:51:23 -0000 1.37 +++ openacs-4/packages/calendar/www/view-one-day-display.tcl 8 Sep 2008 20:13:37 -0000 1.38 @@ -9,7 +9,6 @@ # show_calendar_name_p (optional): 0 or 1 # start_display_hour (optional): 0-23 # end_display_hour (optional): 0-23 -# url_stub_callback (optional): #Display constants, should match up with default styles in calendar.css. set hour_height_inside 43 @@ -19,28 +18,9 @@ set bump_right_delta 155 set bump_right_units px -if {[info exists url_stub_callback]} { - # This parameter is only set if this file is called from .LRN. - # This way I make sure that for the time being this adp/tcl - # snippet is backwards-compatible. - set portlet_mode_p 1 -} else { - set portlet_mode_p 0 -} - set current_date $date set pretty_date [lc_time_fmt $current_date %Q] -if {[info exists portlet_mode_p] && $portlet_mode_p} { - set event_url_template "\${url_stub}cal-item-view?show_cal_nav=0&return_url=[ad_urlencode "../"]&action=edit&cal_item_id=\$item_id" - set url_stub_callback "calendar_portlet_display::get_url_stub" - set hour_template "calendar/cal-item-new?date=$current_date&start_time=\$grid_hour" -} else { - set event_url_template "cal-item-view?cal_item_id=\$item_id" - set url_stub_callback "" - set hour_template {cal-item-new?date=$current_date&start_time=$grid_hour} -} - if { ![info exists show_calendar_name_p] } { set show_calendar_name_p 1 } @@ -104,29 +84,20 @@ #query but slows this one. db_foreach dbqd.calendar.www.views.select_all_day_items {} { + # 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"] - # In case we need to dispatch to a different URL (ben). - # The calculated url_stub is fed back into the event_url_template. - set url_stub "" - if {![empty_string_p $url_stub_callback]} { - # Cache the url stub lookup. - if {![info exists url_stubs($calendar_id)]} { - set url_stubs($calendar_id) [$url_stub_callback $calendar_id] - } - - set url_stub $url_stubs($calendar_id) - } + set event_url [export_vars -base [site_node::get_url_from_object_id -object_id $cal_package_id]cal-item-view {return_url {cal_item_id $item_id}}] #height will be overwritten once we know how the vertical hour span. multirow append items 1 "calendar-${system_type}Item" \ $name \ - [subst $event_url_template] \ + $event_url \ $description \ $calendar_name \ $pretty_weekday \ @@ -154,7 +125,6 @@ db_foreach dbqd.calendar.www.views.select_items {} { - set ansi_start_date [lc_time_system_to_conn $ansi_start_date] set ansi_end_date [lc_time_system_to_conn $ansi_end_date] @@ -198,21 +168,11 @@ } } - # In case we need to dispatch to a different URL (ben). - # The calculated url_stub is fed back into the event_url_template. - set url_stub "" - if {![empty_string_p $url_stub_callback]} { - # Cache the url stub lookup. - if {![info exists url_stubs($calendar_id)]} { - set url_stubs($calendar_id) [$url_stub_callback $calendar_id] - } - - set url_stub $url_stubs($calendar_id) - } + set event_url [export_vars -base [site_node::get_url_from_object_id -object_id $cal_package_id]cal-item-view {return_url {cal_item_id $item_id}}] multirow append items 0 "calendar-${system_type}Item" \ "$name ($start_time - $end_time)" \ - [subst $event_url_template] \ + $event_url \ $description \ $calendar_name \ $pretty_weekday \ @@ -245,13 +205,7 @@ db_1row dbqd.calendar.www.views.select_day_info {} -if {$portlet_mode_p} { - set previous_week_url "?page_num=$page_num&date=[ns_urlencode $yesterday]" - set next_week_url "?page_num=$page_num&&date=[ns_urlencode $tomorrow]" -} else { - set previous_week_url "view?view=day&date=[ns_urlencode $yesterday]" - set next_week_url "view?view=day&date=[ns_urlencode $tomorrow]" -} + set dates [lc_time_fmt $date "%q"] set curr_day_name [lc_time_fmt $date "%A"] set curr_month [lc_time_fmt $date "%B"] @@ -262,13 +216,15 @@ set grid_start $adjusted_start_display_hour set grid_first_hour [lc_time_fmt "$current_date $grid_start:00:00" "%X"] set grid_hour $grid_start -set grid_first_add_url [subst $hour_template] +set grid_first_add_url [export_vars -base ${calendar_url}cal-item-new \ + {{date $current_date} {start_time $grid_hour}}] incr grid_start multirow create grid hour add_url for { set grid_hour $grid_start } { $grid_hour <= $adjusted_end_display_hour } { incr grid_hour } { set localized_grid_hour [lc_time_fmt "$current_date $grid_hour:00:00" "%X"] - multirow append grid $localized_grid_hour [subst $hour_template] + multirow append grid $localized_grid_hour \ + [export_vars -base ${calendar_url}cal-item-new {{date $current_date} {start_time $grid_hour}}] } if { [info exists export] && [string equal $export print] } { Index: openacs-4/packages/calendar/www/view-week-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/calendar/www/view-week-display.tcl 30 Aug 2008 19:51:23 -0000 1.22 +++ openacs-4/packages/calendar/www/view-week-display.tcl 8 Sep 2008 20:13:37 -0000 1.23 @@ -1,7 +1,6 @@ #Expects: # date (required but empty string okay): YYYY-MM-DD # show_calendar_name_p (optional): 0 or 1 -# url_stub_callback (optional): #Display constants, should match up with default styles in calendar.css. set day_width 70 @@ -24,30 +23,8 @@ set day_width_$i $day_width } -if {[info exists url_stub_callback]} { - # This parameter is only set if this file is called from .LRN. - # This way I make sure that for the time being this adp/tcl - # snippet is backwards-compatible. - set portlet_mode_p 1 -} else { - set portlet_mode_p 0 -} - set current_date $date -if {[info exists portlet_mode_p] && $portlet_mode_p} { - set event_url_template "\${url_stub}cal-item-view?show_cal_nav=0&return_url=[ad_urlencode "../"]&action=edit&cal_item_id=\$item_id" - set url_stub_callback "calendar_portlet_display::get_url_stub" - set page_num_formvar [export_form_vars page_num] - set page_num_urlvar "&page_num=$page_num" -} else { - set event_url_template "cal-item-view?cal_item_id=\$item_id" - set url_stub_callback "" - set page_num_formvar "" - set page_num_urlvar "" - set base_url "" -} - if { ![info exists show_calendar_name_p] } { set show_calendar_name_p 1 } @@ -144,16 +121,6 @@ set no_time_p f } - # In case we need to dispatch to a different URL (ben) - if {![empty_string_p $url_stub_callback]} { - # Cache the stuff - if {![info exists url_stubs($calendar_id)]} { - set url_stubs($calendar_id) [$url_stub_callback $calendar_id] - } - - set url_stub $url_stubs($calendar_id) - } - if { $day_of_week != $loop_day_of_week } { set day_width_$loop_day_of_week [expr ($day_width) + (($max_bumps+$all_day_events) * $event_bump_delta) + 5] set event_left_base 0 @@ -228,9 +195,11 @@ incr top [expr $bumps*5] incr left [expr $bumps*$event_bump_delta] + set event_url [export_vars -base [site_node::get_url_from_object_id -object_id $cal_package_id]cal-item-view {return_url {cal_item_id $item_id}}] + multirow append items \ "$name" \ - [subst $event_url_template] \ + $event_url \ $description \ $calendar_name \ $start_date_weekday \ @@ -241,8 +210,8 @@ $start_time \ $end_time \ $no_time_p \ - "?view=day&date=$ansi_start_date&page_num_urlvar" \ - "${base_url}cal-item-new?date=${ansi_this_date}&start_time=&end_time=" \ + ?[export_vars {{view day} {date ansi_start_date} page_num}] \ + [export_vars -base ${calendar_url}cal-item-new {{date $ansi_this_date} {start_time ""} {end_time ""}}] \ "calendar-Item" \ $top \ $height \ @@ -275,13 +244,10 @@ # Navigation Bar set dates "[lc_time_fmt $first_weekday_date "%q"] - [lc_time_fmt $last_weekday_date "%q"]" -if {$portlet_mode_p} { - set previous_week_url "?$page_num_urlvar&view=week&date=[ad_urlencode [dt_julian_to_ansi [expr $first_weekday_julian - 7]]]\#calendar" - set next_week_url "?$page_num_urlvar&view=week&date=[ad_urlencode [dt_julian_to_ansi [expr $first_weekday_julian + 7]]]\#calendar" -} else { - set previous_week_url "?view=week&date=[ad_urlencode [dt_julian_to_ansi [expr $first_weekday_julian - 7]]]\#calendar" - set next_week_url "?view=week&date=[ad_urlencode [dt_julian_to_ansi [expr $first_weekday_julian + 7]]]\#calendar" -} +set prev_date_ansi [ad_urlencode [dt_julian_to_ansi [expr $first_weekday_julian - 7]]] +set previous_week_url ?[export_vars {page_num {view week} {date $prev_date_ansi}}]\#calendar +set next_date_ansi [ad_urlencode [dt_julian_to_ansi [expr $first_weekday_julian + 7]]] +set next_week_url ?[export_vars {page_num {view week} {date $next_date_ansi}}]\#calendar #Calendar grid. set grid_start $adjusted_start_display_hour Index: openacs-4/packages/calendar/www/view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view.adp,v diff -u -r1.34 -r1.35 --- openacs-4/packages/calendar/www/view.adp 30 Aug 2008 19:51:23 -0000 1.34 +++ openacs-4/packages/calendar/www/view.adp 8 Sep 2008 20:13:37 -0000 1.35 @@ -30,27 +30,42 @@
- + - + - + - +
Index: openacs-4/packages/calendar/www/views-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/views-oracle.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/calendar/www/views-oracle.xql 7 Oct 2007 22:36:55 -0000 1.7 +++ openacs-4/packages/calendar/www/views-oracle.xql 8 Sep 2008 20:13:37 -0000 1.8 @@ -21,6 +21,7 @@ (select type from cal_item_types where item_type_id= ci.item_type_id) as item_type, cals.calendar_id, cals.calendar_name, + cals.package_id as cal_package_id, (select count(1) from attachments where object_id=e.event_id) as num_attachments $additional_select_clause from cal_items ci, @@ -57,6 +58,7 @@ (select type from cal_item_types where item_type_id= ci.item_type_id) as item_type, cals.calendar_id, cals.calendar_name, + cals.package_id as cal_package_id, (select count(1) from attachments where object_id=e.event_id) as num_attachments $additional_select_clause from cal_items ci, Index: openacs-4/packages/calendar/www/views-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/views-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/calendar/www/views-postgresql.xql 7 Oct 2007 22:36:55 -0000 1.7 +++ openacs-4/packages/calendar/www/views-postgresql.xql 8 Sep 2008 20:13:37 -0000 1.8 @@ -20,6 +20,7 @@ cit.type as item_type, cals.calendar_id, cals.calendar_name, + cals.package_id as cal_package_id, (select count(1) from attachments where object_id=e.event_id) as num_attachments $additional_select_clause from acs_activities a, @@ -58,6 +59,7 @@ (select type from cal_item_types where item_type_id= ci.item_type_id) as item_type, cals.calendar_id, cals.calendar_name, + cals.package_id as cal_package_id, (select count(1) from attachments where object_id=e.event_id) as num_attachments $additional_select_clause from cal_items ci, Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.AR_EG.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.AR_EG.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.AR_EG.utf-8.xml 30 Jul 2008 11:50:20 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.AR_EG.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + أضف بندًا إدارة المفكرة Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.AR_LB.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.AR_LB.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.AR_LB.utf-8.xml 30 Jul 2008 11:50:20 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.AR_LB.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + أضف بنداً إدارة المفكرة Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.FA_IR.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.FA_IR.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.FA_IR.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.FA_IR.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + مديريت تقويم تقويم Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.RO_RO.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.RO_RO.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.RO_RO.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.RO_RO.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Adaugă un element Administrare Calendar Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.TH_TH.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.TH_TH.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.TH_TH.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.TH_TH.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + เพิ่มรายการ ปฎิทิน Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ast_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ast_ES.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ast_ES.ISO-8859-1.xml 30 Jul 2008 11:50:20 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ast_ES.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Axuntar un �tem Alministraci�n del Calandariu Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ch_zh.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ch_zh.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ch_zh.utf-8.xml 30 Jul 2008 11:50:20 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ch_zh.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + 增加条目 日历管理 Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.da_DK.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.da_DK.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.da_DK.ISO-8859-1.xml 30 Jul 2008 11:50:20 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.da_DK.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Tilf�j en kalenderpost Administation af Kalender Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.de_DE.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.de_DE.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.de_DE.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,12 +1,13 @@ - + Eintrag hinzuf�gen Kalender verwalten Neuen Eintrag hinzuf�gen Kalender Eintragskategorien �ndern Eintragskategorien �ndern + Angezeigte Tage in der Listendarstellung (standard) Kalender Tagesplan Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.en_US.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.en_US.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.en_US.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,12 +1,13 @@ - + Add an item Calendar Administration Create a new Event Full Calendar Manage Calendar Event Types Manage Item Types + Period days for the list view (default) Calendar Schedule Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.es_ES.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.es_ES.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.es_ES.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,12 +1,13 @@ - + A�adir una cita - Administraci�n del Calendario - Crear una Cita nueva - Calendario Completo - Administrar las categor�as de Citas + Administraci�n del calendario + Crear un nuevo evento + Calendario completo + Administrar las categor�as del calendario Administrar categor�as + Per�odo Calendario Planificaci�n Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.fi_FI.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.fi_FI.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.fi_FI.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.fi_FI.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Lisää tapahtuma Kalenterin ylläpito Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.fr_FR.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.fr_FR.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.fr_FR.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.fr_FR.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Ajouter un �l�ment Administration de l'agenda Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.gl_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.gl_ES.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.gl_ES.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.gl_ES.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Engadir un �tem Administraci�n do Calendario Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.hu_HU.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.hu_HU.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.hu_HU.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.hu_HU.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Új bejegyzés Naptár adminisztrációja Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.it_IT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.it_IT.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.it_IT.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.it_IT.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Aggiungi un appuntamento Amministrazione del Calendario Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ja_JP.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ja_JP.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ja_JP.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ja_JP.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + カレンダー全体 Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ko_KR.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ko_KR.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ko_KR.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ko_KR.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + 항목 추가 달력 관리 Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ms_my.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ms_my.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ms_my.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ms_my.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,7 +1,7 @@ - + - Tambah suatu butiran + Tambah satu butiran Pengendalian Takwim Reka Peristiwa baru Takwim Lengkap Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.nl_NL.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.nl_NL.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.nl_NL.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.nl_NL.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Gebeurtenis toevoegen Kalender administratie Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.no_NO.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.no_NO.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.no_NO.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.no_NO.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Legg inn avtale Kalenderadministrasjon @@ -8,5 +8,5 @@ Administrer kalender innleggstyper Administrer avtaletyper Kalender - Avtale + Aktiviteter Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pl_PL.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pl_PL.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pl_PL.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pl_PL.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Dodaj termin Administracja Kalendarzem Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pt_BR.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pt_BR.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pt_BR.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pt_BR.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Adicionar um item Administra��o do Calend�rio Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pt_PT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pt_PT.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pt_PT.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.pt_PT.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Adicionar um item Administra��o do Calend�rio Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ru_RU.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ru_RU.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ru_RU.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.ru_RU.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Добавить запись Администрирование календаря Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.sh_HR.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.sh_HR.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.sh_HR.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.sh_HR.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + Dodaj stavku Citav Kalendar Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.sv_SE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.sv_SE.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.sv_SE.ISO-8859-1.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.sv_SE.ISO-8859-1.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,5 @@ - + L�gg till en post Kalenderadministration Index: openacs-4/packages/calendar-includelet/catalog/calendar-includelet.tr_TR.utf-8.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/catalog/calendar-includelet.tr_TR.utf-8.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/catalog/calendar-includelet.tr_TR.utf-8.xml 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/catalog/calendar-includelet.tr_TR.utf-8.xml 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,12 @@ - + + Bir madde ekle + Takvim Yoneticisi + Yeni bir olay yarat Bütün Takvim + Takvim olay turlerini yonet + Madde turlerini yonet + Takvim + Cizelge Index: openacs-4/packages/calendar-includelet/lib/calendar-admin-includelet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/lib/calendar-admin-includelet.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/lib/calendar-admin-includelet.adp 14 Aug 2008 20:25:48 -0000 1.1 +++ openacs-4/packages/calendar-includelet/lib/calendar-admin-includelet.adp 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,5 +1,9 @@ - Index: openacs-4/packages/calendar-includelet/lib/calendar-admin-includelet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/lib/calendar-admin-includelet.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/calendar-includelet/lib/calendar-admin-includelet.tcl 1 Sep 2008 00:51:02 -0000 1.4 +++ openacs-4/packages/calendar-includelet/lib/calendar-admin-includelet.tcl 8 Sep 2008 20:13:37 -0000 1.5 @@ -4,16 +4,18 @@ @author Arjun Sanyal (arjun@openforce.net) @author Ben Adida (ben@openforce.net) @cvs_id $Id$ +} { + {period_days:optional} +} -properties { + } -# get stuff out of the config array -set view $default_view - -if {[llength $calendar_id] > 1} { - return -code error "shouldn't be more than one calendar in admin!" +if { ![info exists period_days] } { + set period_days [parameter::get -package_id $package_id -parameter ListView_DefaultPeriodDays] +} else { + parameter::set_value -package_id $package_id -parameter ListView_DefaultPeriodDays -value $period_days } -template::head::add_css -href /resources/calendar/calendar.css set url [site_node::get_url_from_object_id -object_id $package_id] ad_return_template Index: openacs-4/packages/calendar-includelet/lib/calendar-full-includelet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/lib/calendar-full-includelet.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/calendar-includelet/lib/calendar-full-includelet.adp 1 Sep 2008 01:22:08 -0000 1.4 +++ openacs-4/packages/calendar-includelet/lib/calendar-full-includelet.adp 8 Sep 2008 20:13:37 -0000 1.5 @@ -4,90 +4,90 @@ base_url="@ad_conn_url@" page_num="@page_num@" view="@view@"> +
- - - +

-

- -
- + page_num="@page_num@" + >

- - #calendar-portlet.Add_an_item# + #calendar.Add_Item# + + + #calendar.lt_Calendar_Administrati# + - - #calendar-portlet.Manage_Item_Types# -

+

+ @notification_chunk;noquote@ +

+ +

+ #calendar.Calendars#: +

+
-
+ +
- + - + - + - + - + -
+
Index: openacs-4/packages/calendar-includelet/lib/calendar-full-includelet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/lib/calendar-full-includelet.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/calendar-includelet/lib/calendar-full-includelet.tcl 1 Sep 2008 00:51:02 -0000 1.3 +++ openacs-4/packages/calendar-includelet/lib/calendar-full-includelet.tcl 8 Sep 2008 20:13:37 -0000 1.4 @@ -9,6 +9,8 @@ {date ""} {period_days:optional} {julian_date ""} + {export ""} + {sort_by ""} } -properties { } -validate { @@ -24,6 +26,11 @@ # Note that the variable calendar_id is a list of all calendar_id parameter values set for # this layout element. +set private_calendar_id [calendar_includelet::get_private_calendar_id \ + -user_id [ad_conn user_id] \ + -package_id $package_id] +lappend calendar_id $private_calendar_id + if {[empty_string_p $view]} { set view $default_view } @@ -32,6 +39,15 @@ set base_url [ad_conn package_url] set calendar_url [site_node::get_url_from_object_id -object_id $package_id] +set notification_chunk [notification::display::request_widget \ + -type calendar_notif \ + -object_id $package_id \ + -pretty_name [site_node::get_element \ + -node_id [site_node::get_node_id_from_object_id \ + -object_id $package_id] \ + -element instance_name] \ + -url $calendar_url] + if {$scoped_p == "t"} { set show_calendar_name_p 1 } else { @@ -45,130 +61,32 @@ set period_days [parameter::get -package_id $package_id -parameter ListView_DefaultPeriodDays -default 31] } -if {[llength $calendar_id] > 1} { - set force_calendar_id [calendar::have_private_p -return_id 1 -calendar_id_list $calendar_id -party_id [ad_conn user_id]] -} else { - set force_calendar_id [lindex $calendar_id 0] -} - # permissions -set create_p [ad_permission_p $force_calendar_id cal_item_create] -set edit_p [ad_permission_p $force_calendar_id cal_item_edit] -set admin_p [ad_permission_p $force_calendar_id calendar_admin] +set admin_p [permission::permission_p -object_id $package_id -privilege admin] - # set up some vars if {[empty_string_p $date]} { - if {[empty_string_p $julian_date]} { - set date [dt_sysdate] - } else { - set date [db_string select_from_julian "select to_date(:julian_date ,'J') from dual"] - } + set date [dt_sysdate] } # global variables -set current_date $date set date_format "YYYY-MM-DD HH24:MI" set return_url "[ns_conn url]?[ns_conn query]" -set encoded_return_url [ns_urlencode $return_url] -set add_item_url [export_vars -base ${calendar_url}cal-item-new {{date $current_date} {time_p 1} return_url}] +set add_item_url [export_vars -base ${calendar_url}cal-item-new {{date $date} {time_p 1} return_url}] -set item_template "\[ad_quotehtml \$item\]" - -if {$create_p} { - set hour_template "\$localized_day_current_hour" - set item_add_template "+" -} else { - set hour_template "\$localized_day_current_hour" - set item_add_template "" +multirow create calendars calendar_name calendar_id calendar_admin_p url +foreach calendar $calendar_id { + multirow append calendars [calendar::name $calendar] $calendar \ + [permission::permission_p -object_id $calendar -privilege admin] \ + [export_vars -base ${calendar_url}calendar-item-types {calendar_id}] } -set url_stub_callback "calendar_portlet_display::get_url_stub" - -if {$view == "day"} { - if {[catch {set yest [clock format [clock scan "1 day ago" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set previous_link "" - } else { - if {[catch {clock scan $yest}]} { - set previous_link "" - } else { - set previous_link "\"back" - } - } - - if {[catch {set tomor [clock format [clock scan "1 day" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set next_link "" - } else { - if {[catch {clock scan $tomor}]} { - set next_link "" - } else { - set next_link "\"forward" - } - } -} - -if {$view == "week"} { - if {[catch {set last_w [clock format [clock scan "1 week ago" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set previous_link "" - } else { - if {[catch {clock scan $last_w}]} { - set previous_link "" - } else { - set previous_link "\"back" - } - } - - if {[catch {set next_w [clock format [clock scan "1 week" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set next_link "" - } else { - if {[catch {clock scan $next_w}]} { - set next_link "" - } else { - set next_link "\"forward" - } - } - - set prev_week_template "\"back" - set next_week_template "\"forward" -} - - -if {$view == "month"} { - if {[catch {set prev_m [clock format [clock scan "1 month ago" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set prev_month_template "" - } else { - if {[catch {clock scan $prev_m}]} { - set prev_month_template "" - } else { - set prev_month_template "\"back" - } - } - - if {[catch {set next_m [clock format [clock scan "1 month" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set next_month_template "" - } else { - if {[catch {clock scan $next_m}]} { - set next_month_template "" - } else { - set next_month_template "\"forward" - } - } -} - - -if {$view == "list"} { - set sort_by [ns_queryget sort_by] - - +if {$view eq "list"} { set start_date [ns_fmttime [expr [ns_time]] "%Y-%m-%d 00:00"] set end_date [ns_fmttime [expr {[ns_time] + 60*60*24*$period_days}] "%Y-%m-%d 00:00"] - - set url_template "?view=list&sort_by=\$order_by&page_num=$page_num" } -set export [ns_queryget export] - if { [lsearch [list csv vcalendar] $export] != -1 } { set user_id [ad_conn user_id] set package_id [ad_conn package_id] Index: openacs-4/packages/calendar-includelet/lib/calendar-includelet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/lib/calendar-includelet.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/lib/calendar-includelet.adp 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/lib/calendar-includelet.adp 8 Sep 2008 20:13:37 -0000 1.2 @@ -3,57 +3,42 @@ - - - + + + + start_date="@start_date@" + end_date="@end_date@" + date="@date@" + period_days="@period_days@" + calendar_id_list="@calendar_id@" + page_num="@page_num@" + sort_by="@sort_by@"> + date="@date@" + calendar_id_list="@calendar_id@" + page_num="@page_num@" + calendar_url="@calendar_url@"> + date="@date@" + calendar_id_list="@calendar_id@" + base_url="@base_url@calendar/" + page_num="@page_num@" + calendar_url="@calendar_url@"> Index: openacs-4/packages/calendar-includelet/lib/calendar-includelet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/lib/calendar-includelet.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/calendar-includelet/lib/calendar-includelet.tcl 1 Sep 2008 00:51:02 -0000 1.3 +++ openacs-4/packages/calendar-includelet/lib/calendar-includelet.tcl 8 Sep 2008 20:13:37 -0000 1.4 @@ -9,6 +9,7 @@ {date ""} {period_days 30} {julian_date ""} + {sort_by ""} } -properties { } -validate { @@ -21,13 +22,20 @@ } } - template::head::add_css -href /resources/calendar/calendar.css -# get stuff out of the config array +# set up some vars +if {[empty_string_p $date]} { + if {[empty_string_p $julian_date]} { + set date [dt_sysdate] + } else { + set date [db_string select_from_julian "select to_date(:julian_date ,'J') from dual"] + } +} + set view $default_view -set list_of_calendar_ids $calendar_id -set base_url [ad_conn url] +set base_url [ad_conn package_url] +set calendar_url [site_node::get_url_from_object_id -object_id $package_id] set scoped_p $scoped_p @@ -37,118 +45,21 @@ set show_calendar_name_p 0 } -if {[llength $list_of_calendar_ids] > 1} { - set force_calendar_id [calendar::have_private_p \ - -return_id 1 \ - -calendar_id_list $list_of_calendar_ids \ - -party_id [ad_conn user_id]] -} else { - set force_calendar_id [lindex $list_of_calendar_ids 0] -} +# Note that the variable calendar_id is a list of all calendar_id parameter values set for +# this layout element. -# permissions -set create_p [ad_permission_p $force_calendar_id cal_item_create] -set edit_p [ad_permission_p $force_calendar_id cal_item_edit] -set admin_p [ad_permission_p $force_calendar_id calendar_admin] +set private_calendar_id [calendar_includelet::get_private_calendar_id \ + -user_id [ad_conn user_id] \ + -package_id $package_id] +lappend calendar_id $private_calendar_id -# set up some vars -set date [ns_queryget date] -if {[empty_string_p $date]} { - set date [dt_sysdate] -} -set current_date $date -set date_format "YYYY-MM-DD HH24:MI" +set add_item_url [export_vars -base ${calendar_url}cal-item-new {{date $date} {time_p 1} return_url}] -set item_template "\[ad_quotehtml \$item\]" -if {$create_p} { - set hour_template "\$localized_day_current_hour" - set item_add_template "+" -} else { - set hour_template "\$localized_day_current_hour" - set item_add_template "" +if {$view eq "list"} { + set start_date [ns_fmttime [expr [ns_time]] "%Y-%m-%d 00:00"] + set end_date [ns_fmttime [expr {[ns_time] + 60*60*24*$period_days}] "%Y-%m-%d 00:00"] } -set url_stub_callback "calendar_includelet_display::get_url_stub" -if { $view == "day" } { - if {[catch {set yest [clock format [clock scan "1 day ago" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set previous_link "" - } else { - if {[catch {clock scan $yest}]} { - set previous_link "" - } else { - set previous_link "\"back" - } - } - - if {[catch {set tomor [clock format [clock scan "1 day" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set next_link "" - } else { - if {[catch {clock scan $tomor}]} { - set next_link "" - } else { - set next_link "\"forward" - } - } -} - -if {$view == "week"} { - if {[catch {set last_w [clock format [clock scan "1 week ago" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set previous_link "" - } else { - if {[catch {clock scan $last_w}]} { - set previous_link "" - } else { - set previous_link "\"back" - } - } - - if {[catch {set next_w [clock format [clock scan "1 week" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set next_link "" - } else { - if {[catch {clock scan $next_w}]} { - set next_link "" - } else { - set next_link "\"forward" - } - } - set prev_week_template "\"back" - set next_week_template "\"forward" -} - -if {$view == "month"} { - if {[catch {set prev_m [clock format [clock scan "1 month ago" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set previous_link "" - } else { - if {[catch {clock scan $prev_m}]} { - set previous_link "" - } else { - set previous_link "\"back" - } - } - - if {[catch {set next_m [clock format [clock scan "1 month" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set next_link "" - } else { - if {[catch {clock scan $next_m}]} { - set next_link "" - } else { - set next_link "\"forward" - } - } -} - -if {$view == "list"} { - set sort_by [ns_queryget sort_by] - - set thirty_days [expr 60*60*24*30] - - set start_date [ns_fmttime [expr [ns_time] - $thirty_days] "%Y-%m-%d 00:00"] - set end_date [ns_fmttime [expr [ns_time] + $thirty_days] "%Y-%m-%d 00:00"] - - set url_template "?view=list&sort_by=\$order_by&page_num=$page_num" -} - - ad_return_template Index: openacs-4/packages/calendar-includelet/lib/calendar-list-includelet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/lib/calendar-list-includelet.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/lib/calendar-list-includelet.adp 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/lib/calendar-list-includelet.adp 8 Sep 2008 20:13:37 -0000 1.2 @@ -1,14 +1,7 @@ - - Index: openacs-4/packages/calendar-includelet/lib/calendar-list-includelet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/lib/calendar-list-includelet.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/calendar-includelet/lib/calendar-list-includelet.tcl 1 Sep 2008 00:51:02 -0000 1.3 +++ openacs-4/packages/calendar-includelet/lib/calendar-list-includelet.tcl 8 Sep 2008 20:13:37 -0000 1.4 @@ -7,7 +7,6 @@ {view ""} {page_num ""} {date ""} - {julian_date ""} {period_days 60} {sort_by ""} } -properties { @@ -24,55 +23,31 @@ template::head::add_css -href /resources/calendar/calendar.css +set calendar_url [site_node::get_url_from_object_id -object_id $package_id] + # get stuff out of the config array if { $view eq "" } { set view $default_view } -set list_of_calendar_ids $calendar_id if {$scoped_p == "t"} { set show_calendar_name_p 1 } else { set show_calendar_name_p 0 } -if {[llength $list_of_calendar_ids] > 1} { - set force_calendar_id [calendar::have_private_p \ - -return_id 1 \ - -calendar_id_list $list_of_calendar_ids \ - -party_id [ad_conn user_id]] -} else { - set force_calendar_id [lindex $list_of_calendar_ids 0] -} +# Note that the variable calendar_id is a list of all calendar_id parameter values set for +# this layout element. -# permissions -set create_p [ad_permission_p $force_calendar_id cal_item_create] -set edit_p [ad_permission_p $force_calendar_id cal_item_edit] -set admin_p [ad_permission_p $force_calendar_id calendar_admin] +set private_calendar_id [calendar_includelet::get_private_calendar_id \ + -user_id [ad_conn user_id] \ + -package_id $package_id] +lappend calendar_id $private_calendar_id -# set up some vars -if {[empty_string_p $date]} { - if {[empty_string_p $julian_date]} { - set date [dt_sysdate] - } else { - set date [db_string select_from_julian "select to_date(:julian_date ,'J') from dual"] - } -} +set start_date [ns_fmttime [expr [ns_time]] "%Y-%m-%d 00:00"] +set end_date [ns_fmttime [expr {[ns_time] + 60*60*24*$period_days}] "%Y-%m-%d 00:00"] -set current_date $date set date_format "YYYY-MM-DD HH24:MI" set return_url "[ns_conn url]?[ns_conn query]" -set encoded_return_url [ns_urlencode $return_url] -# List view only -set sort_by [ns_queryget sort_by] - -set item_template "\[ad_quotehtml \$item\]" - -set thirty_days [expr 60*60*24*30] -set start_date [ns_fmttime [expr [ns_time] - $thirty_days] "%Y-%m-%d 00:00"] - -set url_template "?view=list&sort_by=\$order_by&page_num=$page_num" -set url_stub_callback "calendar_includelet_display::get_url_stub" - ad_return_template Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/calendar-includelet/tcl/calendar-includelet-display-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/calendar-includelet/tcl/calendar-includelet-utility-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/tcl/calendar-includelet-utility-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/tcl/calendar-includelet-utility-procs.tcl 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/tcl/calendar-includelet-utility-procs.tcl 8 Sep 2008 20:13:37 -0000 1.2 @@ -43,6 +43,7 @@ set package_id [layout::element::get_column_value \ -element_id $element_id \ -column package_id] + set node_id [site_node::get_node_id_from_object_id -object_id $package_id] set party_id [layout::pageset::get_column_value \ -pageset_id $pageset_id \ -column owner_id] @@ -63,23 +64,8 @@ -package_id $package_id] } - } else { - - # We're initializing a personal portal. Create a calendar for the user - # if they don't already have one. The group calendar's id has already been - # copied over by the portal package. - - if { ![db_0or1row get_calendar_id {}] } { - set calendar_id [calendar::new \ - -owner_id $party_id \ - -private_p t \ - -calendar_name Personal \ - -package_id $package_id] - } + layout::element::parameter::add_values \ + -element_id $element_id \ + -parameters [list calendar_id $calendar_id default_view day scoped_p f] } - - layout::element::parameter::add_values \ - -element_id $element_id \ - -parameters [list calendar_id $calendar_id default_view day scoped_p f] - } Index: openacs-4/packages/calendar-includelet/tcl/calendar-includelet-utility-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-includelet/tcl/calendar-includelet-utility-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar-includelet/tcl/calendar-includelet-utility-procs.xql 30 Jul 2008 11:50:21 -0000 1.1 +++ openacs-4/packages/calendar-includelet/tcl/calendar-includelet-utility-procs.xql 8 Sep 2008 20:13:37 -0000 1.2 @@ -2,21 +2,12 @@ - - select calendar_id - from calendars - where private_p = 'f' - and owner_id = :group_id - + + select calendar_id + from calendars + where private_p = 'f' + and owner_id = :group_id + - - - - select calendar_id - from calendars - where private_p = 't' - and owner_id = :party_id - -