Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-procs-2-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/Attic/acs-calendar-procs-2-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-datetime/tcl/acs-calendar-procs-2-oracle.xql 22 Jan 2002 05:15:02 -0000 1.1
@@ -0,0 +1,21 @@
+
+
+
+ oracle8.1.6
+
+
+
+select to_char(to_date(:current_date, 'yyyy-mm-dd'), 'D')
+as day_of_the_week,
+to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday'))
+as sunday_of_the_week,
+to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday'),'J')
+as sunday_julian,
+to_char(next_day(to_date(:current_date, 'yyyy-mm-dd'), 'Saturday'))
+as saturday_of_the_week
+from dual
+
+
+
+
+
Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-procs-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/Attic/acs-calendar-procs-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-datetime/tcl/acs-calendar-procs-2.tcl 22 Jan 2002 05:15:02 -0000 1.1
@@ -0,0 +1,167 @@
+
+ad_proc dt_widget_week {
+ {
+ -calendar_details ""
+ -date ""
+ -days_of_week "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
+ -large_calendar_p 1
+ -master_bgcolor "black"
+ -header_bgcolor "black"
+ -header_text_color "white"
+ -header_text_size "+2"
+ -day_template {$day}
+ -day_header_size 2
+ -day_header_bgcolor "#666666"
+ -calendar_width "100%"
+ -day_bgcolor "#DDDDDD"
+ -today_bgcolor "#DDDDDD"
+ -day_text_color "white"
+ -empty_bgcolor "white"
+ -next_week_template ""
+ -prev_week_template ""
+ -prev_next_links_in_title 0
+ -fill_all_days 0
+ }
+} {
+ Returns a calendar for a specific week, with details supplied by
+ Julian date. Defaults to this week.
+
+ To specify details for the individual days (if large_calendar_p is
+ set) put data in an ns_set calendar_details. The key is the
+ Julian date of the day, and the value is a string (possibly with
+ HTML formatting) that represents the details.
+} {
+
+ if {[empty_string_p $date]} {
+ set date [dt_sysdate]
+ }
+
+ set current_date $date
+
+ # Get information for the week
+ db_1row select_week_info {}
+
+ # Initialize the ns_set
+ if [empty_string_p $calendar_details] {
+ set calendar_details [ns_set create calendar_details]
+ }
+
+ # Loop through the days of the week
+ set julian $sunday_julian
+ set return_html "
\n"
+
+ foreach day $days_of_week {
+
+ set day_html [subst $day_template]
+
+ append return_html "$day_html |
+ "
+
+ # Go through events
+ while {1} {
+ set index [ns_set find $calendar_details $julian]
+ if {$index == -1} {
+ break
+ }
+
+ append return_html "[ns_set value $calendar_details $index] \n"
+
+ ns_set delete $calendar_details $index
+ }
+
+ append return_html " |
\n"
+ incr julian
+ }
+
+ append return_html "
"
+
+ return $return_html
+}
+
+
+
+ad_proc dt_widget_day {
+ {
+ -calendar_details ""
+ -date ""
+ -hours_of_day {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
+ -master_bgcolor "black"
+ -header_bgcolor "black"
+ -header_text_color "white"
+ -header_text_size "+2"
+ -calendar_width "100%"
+ -day_bgcolor "#DDDDDD"
+ -today_bgcolor "#DDDDDD"
+ -day_text_color "white"
+ -empty_bgcolor "white"
+ }
+} {
+ Returns a calendar for a specific day, with details supplied by
+ hour. Defaults to today.
+
+} {
+
+ if {[empty_string_p $date]} {
+ set date [dt_sysdate]
+ }
+
+ set current_date $date
+
+ # Initialize the ns_set
+ if [empty_string_p $calendar_details] {
+ set calendar_details [ns_set create calendar_details]
+ }
+
+ # Loop through the hours of the day
+ set return_html "\n"
+
+ foreach hour $hours_of_day {
+
+ # display stuff
+ if {$hour >= 12} {
+ set ampm_hour [expr $hour - 12]
+ set pm 1
+ } else {
+ set ampm_hour $hour
+ set pm 0
+ }
+
+ if {$ampm_hour == 0} {
+ set ampm_hour 12
+ }
+
+ if {$ampm_hour < 10} {
+ set display_hour "0$ampm_hour"
+ } else {
+ set display_hour "$ampm_hour"
+ }
+
+ append display_hour ":00 "
+
+ if {$pm} {
+ append display_hour "pm"
+ } else {
+ append display_hour "am"
+ }
+
+ append return_html "$display_hour | \n"
+
+ # Go through events
+ while {1} {
+ set index [ns_set find $calendar_details $hour]
+ if {$index == -1} {
+ break
+ }
+
+ append return_html "[ns_set value $calendar_details $index] \n"
+
+ ns_set delete $calendar_details $index
+ }
+
+ append return_html " |
\n"
+ }
+
+ append return_html "
"
+
+ return $return_html
+}