Index: openacs-4/packages/calendar/tcl/calendar-display-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-display-procs.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/calendar/tcl/calendar-display-procs.tcl 23 Jan 2002 08:11:16 -0000 1.2
+++ openacs-4/packages/calendar/tcl/calendar-display-procs.tcl 11 Feb 2002 06:07:39 -0000 1.3
@@ -13,9 +13,9 @@
ad_proc -public one_month_display {
{-calendar_id_list ""}
- {-one_day_link ""}
- {-one_item_link ""}
- {-item_add_link ""}
+ {-day_template "\$day_number"}
+ {-item_template "\$item"}
+ {-item_add_template ""}
{-date ""}
} {
Creates a month widget with events for that month
@@ -38,36 +38,28 @@
set calendar_name [calendar_get_name $calendar_id]
db_foreach select_monthly_items {} {
- set item "$name ($calendar_name)"
- if {![empty_string_p $one_item_link]} {
- set item "$item
"
- }
+ set item "$name"
+ set item "[subst $item_template]
"
- ns_set put $items $start_date $item
+ ns_set put $items $start_date $item
}
}
# Display stuff
- if {[empty_string_p $one_day_link]} {
- set one_day_template {$day_number}
+ if {[empty_string_p $item_add_template]} {
+ set day_number_template "$day_template"
} else {
- set one_day_template "\$day_number"
+ set day_number_template "$item_add_template $day_template"
}
- if {[empty_string_p $item_add_link]} {
- set day_number_template "$one_day_template"
- } else {
- set day_number_template "ADD $one_day_template"
- }
-
return [dt_widget_month -calendar_details $items -date $date -day_number_template $day_number_template -today_bgcolor #cccccc]
}
ad_proc -public one_week_display {
{-calendar_id_list ""}
- {-one_day_link ""}
- {-one_item_link ""}
- {-item_add_link ""}
+ {-day_template "\$day"}
+ {-item_template "\$item"}
+ {-item_add_template ""}
{-date ""}
} {
Creates a week widget
@@ -97,26 +89,19 @@
db_foreach select_week_items {} {
set item "$pretty_start_date - $pretty_end_date: $name ($calendar_name)"
- if {![empty_string_p $one_item_link]} {
- set item "$item
"
- }
+ set item "[subst $item_template]
"
ns_set put $items $start_date $item
}
}
# display stuff
- if {[empty_string_p $one_day_link]} {
- set one_day_template {$day}
- } else {
- set one_day_template "\$day"
- }
- if {[empty_string_p $item_add_link]} {
- set day_number_template "$one_day_template"
+ if {[empty_string_p $item_add_template]} {
+ set day_number_template "$day_template"
} else {
- set day_number_template "$one_day_template (ADD)"
+ set day_number_template "$day_template $item_add_template"
}
return [dt_widget_week -calendar_details $items -date $date -day_template $day_number_template -today_bgcolor #cccccc]
@@ -156,20 +141,20 @@
# Loop through the calendars
foreach calendar_id $calendar_id_list {
set calendar_name [calendar_get_name $calendar_id]
- ns_log Notice "bma: one calendar $calendar_name"
+ # ns_log Notice "bma: one calendar $calendar_name"
db_foreach select_day_items {} {
set item "$pretty_start_date - $pretty_end_date: $name ($calendar_name)"
set item [subst $item_template]
- ns_log Notice "bma-calendar: adding $item at $start_hour"
+ # ns_log Notice "bma-calendar: adding $item at $start_hour"
ns_set put $items $start_hour $item
}
}
set hour {$display_hour}
- set start_time {$hour:00}
+ set start_time {$hour}
set hour_template [subst $hour_template]
Index: openacs-4/packages/calendar/www/cal-item.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/calendar/www/cal-item.tcl 23 Jan 2002 08:11:16 -0000 1.4
+++ openacs-4/packages/calendar/www/cal-item.tcl 11 Feb 2002 06:07:39 -0000 1.5
@@ -9,7 +9,8 @@
@cvs-id $Id$
} {
{action add}
- {date now}
+ {date ""}
+ {julian_date ""}
{cal_item_id 0}
{start_time "now"}
{end_time "now"}
@@ -31,6 +32,14 @@
calendars:multirow
}
+
+if {[empty_string_p $date]} {
+ if {[empty_string_p $julian_date]} {
+ set date now
+ } else {
+ set date [db_string select_from_julian "select to_date(:julian_date ,'J') from dual"]
+ }
+}
# find out the user_id
Index: openacs-4/packages/calendar/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/index.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/calendar/www/index.tcl 23 Jan 2002 08:11:16 -0000 1.3
+++ openacs-4/packages/calendar/www/index.tcl 11 Feb 2002 06:07:39 -0000 1.4
@@ -10,7 +10,8 @@
} {
{view day}
{action view}
- {date now}
+ {date ""}
+ {julian_date ""}
{calendar_list:multiple,optional {}}
{return_url ""}
} -properties {
@@ -21,6 +22,13 @@
view:onevalue
}
+if {[empty_string_p $date]} {
+ if {[empty_string_p $julian_date]} {
+ set date now
+ } else {
+ set date [db_string select_from_julian "select to_date(:julian_date ,'J') from dual"]
+ }
+}
# find out the user_id
set user_id [ad_verify_and_get_user_id]