Index: openacs-4/packages/acs-admin/www/users/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-admin/www/users/index.tcl 6 Sep 2002 21:49:53 -0000 1.2 +++ openacs-4/packages/acs-admin/www/users/index.tcl 18 Nov 2002 18:01:17 -0000 1.3 @@ -33,7 +33,7 @@ where email not in ('anonymous', 'system')" set n_users [util_commify_number $n_users] - set last_registration [util_AnsiDatetoPrettyDate $last_registration] + set last_registration [lc_time_fmt $last_registration "%q"] set groups [db_html_select_value_options groups_select { select groups.group_id, Index: openacs-4/packages/acs-admin/www/users/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/one.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-admin/www/users/one.tcl 24 Sep 2002 00:12:32 -0000 1.5 +++ openacs-4/packages/acs-admin/www/users/one.tcl 18 Nov 2002 18:01:17 -0000 1.6 @@ -40,7 +40,7 @@ set context [list [list "./" "Users"] "One User"] set export_edit_vars [export_url_vars user_id return_url] -set registration_date [util_AnsiDatetoPrettyDate $creation_date] +set registration_date [lc_time_fmt $creation_date "%q"] set portrait_p 0 if {[db_0or1row get_item_id "select live_revision as revision_id, nvl(title,'view this portrait') portrait_title Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-oracle.xql 26 Apr 2002 21:43:03 -0000 1.4 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-oracle.xql 18 Nov 2002 18:01:12 -0000 1.5 @@ -3,51 +3,9 @@ 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_date, -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')-7, 'Sunday') + 1) -as monday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 1,'J') -as monday_julian, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 2) -as tuesday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 2,'J') -as tuesday_julian, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 3) -as wednesday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 3,'J') -as wednesday_julian, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 4) -as thursday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 4,'J') -as thursday_julian, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 5) -as friday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 5,'J') -as friday_julian, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 6) -as saturday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 6,'J') -as saturday_julian, -to_date(:current_date,'yyyy-mm-dd') - 7 as last_week, -to_char(to_date(:current_date, 'yyyy-mm-dd') - 7,'Month DD, YYYY') as last_week_pretty, -to_date(:current_date,'yyyy-mm-dd') + 7 as next_week, -to_char(to_date(:current_date, 'yyyy-mm-dd') + 7,'Month DD, YYYY') as next_week_pretty -from dual - - - -select to_char(to_date(:current_date, 'yyyy-mm-dd'), 'Day, DD Month YYYY') -as day_of_the_week, -to_char(to_date(:current_date, 'yyyy-mm-dd')-1, 'yyyy-mm-dd') +select to_char(to_date(:current_date, 'yyyy-mm-dd')-1, 'yyyy-mm-dd') as yesterday, to_char(to_date(:current_date, 'yyyy-mm-dd')+1, 'yyyy-mm-dd') as tomorrow Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql 25 Jul 2002 03:15:12 -0000 1.4 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql 18 Nov 2002 18:01:12 -0000 1.5 @@ -3,51 +3,9 @@ postgresql7.1 - - -select to_char(to_date(:current_date, 'yyyy-mm-dd'), 'D') -as day_of_the_week, -next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') -as sunday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday'),'J') -as sunday_julian, -next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 1 -as monday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 1,'J') -as monday_julian, -next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 2 -as tuesday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 2,'J') -as tuesday_julian, -next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 3 -as wednesday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 3,'J') -as wednesday_julian, -next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 4 -as thursday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 4,'J') -as thursday_julian, -next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 5 -as friday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 5,'J') -as friday_julian, -next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 6 -as saturday_date, -to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'Sunday') + 6,'J') -as saturday_julian, -:current_date::timestamp - '7 days'::timespan as last_week, -to_char(:current_date::timestamp - '7 days'::timespan, 'Month DD, YYYY') as last_week_pretty, -:current_date::timestamp + '7 days'::timespan as next_week, -to_char(:current_date::timestamp + '7 days'::timespan, 'Month DD, YYYY') as next_week_pretty -from dual - - - -select to_char(to_date(:current_date, 'yyyy-mm-dd'), 'Day, DD Month YYYY') -as day_of_the_week, -to_char(to_date(:current_date, 'yyyy-mm-dd')-1, 'yyyy-mm-dd') +select to_char(to_date(:current_date, 'yyyy-mm-dd')-1, 'yyyy-mm-dd') as yesterday, to_char(to_date(:current_date, 'yyyy-mm-dd')+1, 'yyyy-mm-dd') as tomorrow Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl,v diff -u -r1.33 -r1.34 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl 7 Nov 2002 08:41:33 -0000 1.33 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl 18 Nov 2002 18:01:12 -0000 1.34 @@ -55,27 +55,45 @@ set current_date $date - # Get information for the week - db_1row select_week_info {} - + set date_list [dt_ansi_to_list $current_date] + + set year [dt_trim_leading_zeros [lindex $date_list 0]] + set month [dt_trim_leading_zeros [lindex $date_list 1]] + set day [dt_trim_leading_zeros [lindex $date_list 2]] + + set current_date_julian [dt_ansi_to_julian $year $month $day] + + # 1 = Sun ... 7 = Sat + set current_date_weekday_no [expr [clock format [clock scan $date] -format %w] + 1] + + # What day does the week start on? + # 0 = Sunday, 6 = Saturday + set first_day_of_week [lc_get firstdayofweek] + + set first_day_of_week_julian [expr $current_date_julian - (($current_date_weekday_no + 6 - $first_day_of_week) % 7)] + + set last_week [dt_julian_to_ansi [expr $current_date_julian - 7]] + set last_week_pretty [lc_time_fmt $last_week "%q"] + set next_week [dt_julian_to_ansi [expr $current_date_julian + 7]] + set next_week_pretty [lc_time_fmt $next_week "%q"] + # Initialize the ns_set - if [empty_string_p $calendar_details] { + 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" + set julian $first_day_of_week_julian + set return_html "
\n" # Navigation Bar append return_html "
- - +
+
[subst $prev_week_template] - + - [util_AnsiDatetoPrettyDate $sunday_date] - [util_AnsiDatetoPrettyDate $saturday_date] + [lc_time_fmt [dt_julian_to_ansi $first_day_of_week_julian] "%Q"] - [lc_time_fmt [dt_julian_to_ansi [expr $first_day_of_week_julian + 6]] "%Q"] [subst $next_week_template] @@ -88,15 +106,10 @@ " - - set days_of_week [list Sunday "[_ acs-datetime.Sunday]" Monday "[_ acs-datetime.Monday]" Tuesday "[_ acs-datetime.Tuesday]" Wednesday "[_ acs-datetime.Wednesday]" Thursday "[_ acs-datetime.Thursday]" Friday "[_ acs-datetime.Friday]" Saturday "[_ acs-datetime.Saturday]"] - - foreach {eng_day day} $days_of_week { - - set lower_day [string tolower $eng_day] - set julian [set ${lower_day}_julian] - set date [set ${lower_day}_date] - set pretty_date [util_AnsiDatetoPrettyDate $date] + for { set julian $first_day_of_week_julian } { $julian < [expr $first_day_of_week_julian + 7] } { incr julian } { + set date [dt_julian_to_ansi $julian] + set pretty_date [string totitle [lc_time_fmt $date "%q"]] + set day [string totitle [lc_time_fmt $date "%A"]] set day_html [subst $day_template] if {$date == $today_date} { @@ -136,7 +149,6 @@ append return_html "\n" - incr julian } append return_html "
" @@ -184,12 +196,25 @@ set calendar_details [ns_set create calendar_details] } + for { set hour 0 } { $hour < 24 } { incr hour } { + if { ($hour < $start_hour || $hour > $end_hour) && [ns_set find $calendar_details [format "%02d" $hour]] != -1 } { + if { $hour < $start_hour } { + set start_hour $hour + } elseif { $hour > $end_hour } { + set end_hour $hour + } + } + } + # Collect some statistics about the events (for overlap) for {set hour $start_hour} {$hour <= 23} {incr hour} { set n_events($hour) 0 set n_starting_events($hour) 0 } - + + # Count number of overlapping events each hour + + # Make a copy of the calendar_details set that we can work on for a minute, discard afterwards. set calendar_details_2 [ns_set copy $calendar_details] for {set hour $start_hour} {$hour <= $end_hour} {incr hour} { @@ -233,6 +258,8 @@ # Select some basic stuff, sets day_of_the_week, yesterday, tomorrow vars db_1row select_day_info {} + + set day_of_the_week [string totitle [lc_time_fmt $current_date "%Q"]] set return_html "" @@ -247,7 +274,7 @@ append return_html "
" - # The items that have no hour + # The items that have no hour (all day events) set hour "" set next_hour "" set start_time "" @@ -274,7 +301,8 @@ append return_html "" - + + # Normal hour-by-hour display for {set hour $start_hour} {$hour <= $end_hour} {incr hour} { set next_hour [expr $hour + 1] @@ -284,34 +312,9 @@ } else { set index_hour $hour } + + set display_hour [string tolower [string trimleft [lc_time_fmt "0000-00-00 ${hour}:00:00" "%X"] 0]] - # 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 "$ampm_hour" - } else { - set display_hour "$ampm_hour" - } - - append display_hour ":00 " - - if {$pm} { - append display_hour "pm" - } else { - append display_hour "am" - } - if { $odd_row_p } { set class "z_light" set odd_row_p 0 @@ -420,15 +423,15 @@ } if {[empty_string_p $start_date] && ![empty_string_p $end_date]} { - set title "Items until [util_AnsiDatetoPrettyDate $end_date]" + set title "Items until [lc_time_fmt $end_date "%Q"]" } if {![empty_string_p $start_date] && [empty_string_p $end_date]} { - set title "Items starting [util_AnsiDatetoPrettyDate $start_date]" + set title "Items starting [lc_time_fmt $start_date "%Q"]" } if {![empty_string_p $start_date] && ![empty_string_p $end_date]} { - set title "[_ acs-datetime.Items_from] [util_AnsiDatetoPrettyDate $start_date] [_ acs-datetime.to] [util_AnsiDatetoPrettyDate $end_date]" + set title "[_ acs-datetime.Items_from] [lc_time_fmt $start_date "%Q"] [_ acs-datetime.to] [lc_time_fmt $end_date "%Q"]" } set return_html "$title

" Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl 12 Nov 2002 08:54:34 -0000 1.14 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl 18 Nov 2002 18:01:12 -0000 1.15 @@ -43,10 +43,9 @@ HTML formatting) that represents the details. } { if {[string equal $days_of_week "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"]} { - set days_of_week [list [_ acs-datetime.Sunday] [_ acs-datetime.Monday] [_ acs-datetime.Tuesday] [_ acs-datetime.Wednesday] [_ acs-datetime.Thursday] [_ acs-datetime.Friday] [_ acs-datetime.Saturday]] + set days_of_week [nsv_get locale "[lang::conn::locale],day"] } - dt_get_info $date set today_date [dt_sysdate] @@ -58,7 +57,7 @@ set day_of_week $first_day_of_month set julian_date $first_julian_date - set month_heading [format "%s %s" $month $year] + set month_heading [string totitle [lc_time_fmt $date "%B %Y"]] set next_month_url "" set prev_month_url "" @@ -75,7 +74,7 @@ # We offer an option to put the links to next and previous months # in the title bar - if { $prev_next_links_in_title == 0 } { + if { !$prev_next_links_in_title } { set title "

$title \n" - foreach day_of_week $days_of_week { + set days_of_week {} + foreach day [nsv_get locale [lang::conn::locale],day] { + lappend days_of_week [string totitle $day] + } + for { set i 0 } { $i < 7 } { incr i } { + set day_of_week [lindex $days_of_week [expr ($i + $first_day_of_week) % 7 ]] append output " " } else { append result " " @@ -529,20 +536,23 @@ Returns the monthly navbar } { set now [clock scan $date] - set curr_month_en_US [clock format $now -format "%B"] - set curr_month_localized [_ acs-datetime.${curr_month_en_US}] + + + set curr_month_localized [string totitle [lc_time_fmt [clock_to_ansi $now] "%B %Y"]] + set prev_month [clock format [clock scan "1 month ago" -base $now] -format "%Y-%m-%d"] set next_month [clock format [clock scan "1 month" -base $now] -format "%Y-%m-%d"] + set prev_month_localized [string totitle [lc_time_fmt $prev_month "%B %Y"]] + set next_month_localized [string totitle [lc_time_fmt $next_month "%B %Y"]] + append results "
$month_heading @@ -102,7 +101,12 @@
@@ -433,6 +437,7 @@ } ad_proc -private dt_navbar_view { + {-link_current_view:boolean} view base_url date @@ -457,16 +462,18 @@ Week {set text "[_ acs-datetime.Week]"} Month {set text "[_ acs-datetime.Month]"} } + + set url "${base_url}view=$viewname&date=$date" - if { $viewname == $view } { + if { !$link_current_view_p && [string equal $viewname $view] } { # current view append result " $text - + $text
\n" @@ -551,7 +561,8 @@ ad_proc dt_widget_calendar_navigation { - {} + {-today_bgcolor "#e9e99c"} + -link_current_view:boolean {base_url ""} {view "week"} {date ""} @@ -604,20 +615,25 @@ set output "
- - + $curr_month_localized - - +
- [dt_navbar_view $view $base_url $date] + [dt_navbar_view -link_current_view=$link_current_view_p $view $base_url $date] [dt_navbar_year $view $base_url $date]\n" if [string equal $view month] { # month view + append output "
" + + set months_list [list] + foreach month_name [nsv_get locale [lang::conn::locale],mon] { + lappend months_list [string totitle $month_name] + } - set months_list [dt_month_names] set now [clock scan $date] set curr_month [expr [dt_trim_leading_zeros [clock format $now -format "%m"]]-1] @@ -681,6 +697,8 @@ append output "" } else { + + # day or week view append output " [dt_navbar_month $view $base_url $date] @@ -693,18 +711,23 @@ " - set days_of_week "[_ acs-datetime.S_M_T_W_T_F_S]" + set first_day_of_week [nsv_get locale [lang::conn::locale],firstdayofweek] - - foreach day_of_week $days_of_week { - append output "\n" + set days_of_week {} + foreach day [nsv_get locale [lang::conn::locale],abday] { + lappend days_of_week [string toupper [string range $day 0 0]] + } + for { set i 0 } { $i < 7 } { incr i } { + append output "\n" } append output "" set day_of_week 1 set julian_date $first_julian_date set day_number $first_day + set julian_date_todays_date [dt_ansi_to_julian_single_arg [dt_sysdate]] + while {1} { if {$julian_date < $first_julian_date_of_month} { @@ -732,20 +755,26 @@ append output "\n" } + if { $julian_date == $julian_date_todays_date } { + set bgcolor " bgcolor=\"${today_bgcolor}\"" + } else { + set bgcolor {} + } + if {$before_month_p || $after_month_p} { append output " - " } elseif {$julian_date == $julian_date_today} { append output " - " } else { append output " - " @@ -788,10 +817,10 @@ } append output " - [_ acs-datetime.is] [dt_ansi_to_pretty] + [_ acs-datetime.is] [lc_time_fmt [dt_sysdate] "%q"]}] \ + [list send_date "[_ bulk-mail.Send_Date]" {bulk_mail_messages.send_date $order} {}] \ [list from_addr "[_ bulk-mail.From]" {bulk_mail_messages.from_addr $order} {}] \ [list subject "[_ bulk-mail.Subject]" {bulk_mail_messages.subject $order} {}] \ [list sent_p "[_ bulk-mail.Sent]" {bulk_mail_messages.sent_p $order} {}] \ Index: openacs-4/packages/calendar/tcl/cal-item-2-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/cal-item-2-procs-oracle.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/calendar/tcl/cal-item-2-procs-oracle.xql 21 Sep 2002 17:03:37 -0000 1.6 +++ openacs-4/packages/calendar/tcl/cal-item-2-procs-oracle.xql 18 Nov 2002 18:01:10 -0000 1.7 @@ -21,13 +21,7 @@ select cal_items.cal_item_id, 0 as n_attachments, - to_char(start_date,'HH:MIpm')as start_time, - to_char(start_date,'D') as day_of_week, - to_char(start_date,'Day') as pretty_day_of_week, - to_char(start_date,'DD') as day_of_month, start_date as start_date, - to_char(start_date, 'MM/DD/YYYY') as pretty_short_start_date, - to_char(end_date, 'HH:MIpm') as end_time, end_date as end_date, to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as full_start_date, to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as full_end_date, Index: openacs-4/packages/calendar/tcl/cal-item-2-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/cal-item-2-procs-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/calendar/tcl/cal-item-2-procs-postgresql.xql 21 Sep 2002 17:03:37 -0000 1.5 +++ openacs-4/packages/calendar/tcl/cal-item-2-procs-postgresql.xql 18 Nov 2002 18:01:10 -0000 1.6 @@ -17,13 +17,7 @@ select i.cal_item_id, 0 as n_attachments, - to_char(start_date,'HH:MIpm') as start_time, - to_char(start_date,'D') as day_of_week, - to_char(start_date,'Day') as pretty_day_of_week, - to_char(start_date,'DD') as day_of_month, to_char(start_date, 'YYYY-MM-DD HH:MI:SS') as start_date, - to_char(start_date, 'MM/DD/YYYY') as pretty_short_start_date, - to_char(end_date, 'HH:MIpm') as end_time, end_date as end_date, to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as full_start_date, to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as full_end_date, Index: openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/cal-item-2-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl 10 Sep 2002 22:22:31 -0000 1.5 +++ openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl 18 Nov 2002 18:01:10 -0000 1.6 @@ -62,6 +62,15 @@ } db_1row $query_name {} -column_array row + + set row(start_time) [lc_time_fmt $row(full_start_date) "%X"] + # Unfortunately, SQL has weekday starting at 1 = Sunday + set row(day_of_week) [expr [lc_time_fmt $row(full_start_date) "%w"] + 1] + set row(pretty_day_of_week) [lc_time_fmt $row(full_start_date) "%A"] + set row(day_of_month) [lc_time_fmt $row(full_start_date) "%d"] + set row(pretty_short_start_date) [lc_time_fmt $row(full_start_date) "%x"] + + set row(end_time) [lc_time_fmt $row(full_end_date) "%X"] } ad_proc -public add_recurrence { Index: openacs-4/packages/calendar/tcl/calendar-2-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-2-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/calendar/tcl/calendar-2-procs.tcl 10 Sep 2002 22:22:31 -0000 1.8 +++ openacs-4/packages/calendar/tcl/calendar-2-procs.tcl 18 Nov 2002 18:01:10 -0000 1.9 @@ -13,8 +13,9 @@ {-sql_date:required} {-format:required} } { - # for now, we recognize only "YYYY-MM-DD" "HH12:MIam" and "HH24:MI" - + + } { + # for now, we recognize only "YYYY-MM-DD" "HH12:MIam" and "HH24:MI". set date [template::util::date::create] switch -exact -- $format { @@ -49,6 +50,9 @@ set date [template::util::date::set_property hours $date $sql_date] set date [template::util::date::set_property minutes $date 0] } + default { + set date [template::util::date::set_property ansi $date $sql_date] + } } return $date Index: openacs-4/packages/calendar/tcl/calendar-display-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-display-procs-oracle.xql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/calendar/tcl/calendar-display-procs-oracle.xql 25 Jul 2002 03:15:32 -0000 1.11 +++ openacs-4/packages/calendar/tcl/calendar-display-procs-oracle.xql 18 Nov 2002 18:01:10 -0000 1.12 @@ -7,8 +7,8 @@ select to_char(start_date, 'j') as start_date, - to_char(start_date, 'HH:MIpm') as start_time, - to_char(end_date, 'HH:MIpm') as end_time, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, nvl(e.name, a.name) as name, nvl(e.description, a.description) as description, nvl(e.status_summary, a.status_summary) as status_summary, @@ -36,26 +36,13 @@ - - - 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'), 'Saturday')) - as saturday_of_the_week - from dual - - - - select to_char(start_date, 'J') as start_date_julian, - to_char(start_date, 'HH:MIpm') as pretty_start_date, - to_char(end_date, 'HH:MIpm') as pretty_end_date, to_char(start_date,'HH24:MI') as start_date, to_char(end_date,'HH24:MI') as end_date, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, nvl(e.name, a.name) as name, nvl(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, @@ -72,10 +59,9 @@ where e.timespan_id = s.timespan_id and s.interval_id = t.interval_id and e.activity_id = a.activity_id -and e.event_id = cal_items.cal_item_id -and start_date between - to_date(:sunday_of_the_week,'YYYY-MM-DD') and - to_date(:saturday_of_the_week,'YYYY-MM-DD') +and e.event_id = cal_items.cal_item_id +and start_date >= to_date(:first_day_of_week_julian, 'J') +and start_date <= to_date(:first_day_of_week_julian + 7, 'J') and e.event_id in ( select cal_item_id @@ -89,10 +75,10 @@ select to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'HH:MIpm') as pretty_start_date, - to_char(end_date, 'HH:MIpm') as pretty_end_date, to_char(start_date, 'HH24:MI') as start_date, to_char(end_date, 'HH24:MI') as end_date, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, nvl(e.name, a.name) as name, nvl(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, @@ -126,10 +112,8 @@ select to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'MM/DD/YYYY') as pretty_date, - to_char(start_date, 'Day') as pretty_weekday, - to_char(start_date, 'HH:MIpm') as pretty_start_date, - to_char(end_date, 'HH:MIpm') as pretty_end_date, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, nvl(e.name, a.name) as name, nvl(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, @@ -155,34 +139,5 @@ order by $sort_by - - - - - select to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'HH:MIpm') as pretty_start_date, - to_char(end_date, 'HH:MIpm') as pretty_end_date, - nvl(e.name, a.name) as name, - nvl(e.status_summary, a.status_summary) as status_summary, - e.event_id as item_id -from acs_activities a, - acs_events e, - timespans s, - time_intervals t -where e.timespan_id = s.timespan_id -and s.interval_id = t.interval_id -and e.activity_id = a.activity_id -and start_date between - to_date(:current_date,:date_format) and - to_date(:current_date,:date_format) + (24 - 1/3600)/24 -and e.event_id -in ( - select cal_item_id - from cal_items - where on_which_calendar = :calendar_id - ) - - - Index: openacs-4/packages/calendar/tcl/calendar-display-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-display-procs-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/calendar/tcl/calendar-display-procs-postgresql.xql 25 Jul 2002 03:20:24 -0000 1.7 +++ openacs-4/packages/calendar/tcl/calendar-display-procs-postgresql.xql 18 Nov 2002 18:01:10 -0000 1.8 @@ -7,8 +7,8 @@ select to_char(start_date, 'J') as start_date, - to_char(start_date, 'HH:MIpm') as start_time, - to_char(end_date, 'HH:MIpm') as end_time, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, coalesce(e.name, a.name) as name, coalesce(e.description, a.description) as description, coalesce(e.status_summary, a.status_summary) as status_summary, @@ -35,26 +35,13 @@ - - - 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')- '1 week'::timespan, 'Sunday'), 'YYYY-MM-DD') - as sunday_of_the_week, - to_char(next_day(to_date(:current_date, 'yyyy-mm-dd'), 'Saturday'), 'YYYY-MM-DD') - as saturday_of_the_week - from dual - - - - select to_char(start_date, 'J') as start_date_julian, - to_char(start_date, 'HH:MIpm') as pretty_start_date, - to_char(end_date, 'HH:MIpm') as pretty_end_date, to_char(start_date,'HH24:MI') as start_date, to_char(end_date,'HH24:MI') as end_date, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, coalesce(e.name, a.name) as name, coalesce(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, @@ -87,10 +74,10 @@ select to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'HH:MIpm') as pretty_start_date, - to_char(end_date, 'HH:MIpm') as pretty_end_date, to_char(start_date, 'HH24:MI') as start_date, to_char(end_date, 'HH24:MI') as end_date, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, coalesce(e.name, a.name) as name, coalesce(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, @@ -124,10 +111,8 @@ select to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'MM/DD/YYYY') as pretty_date, - to_char(start_date, 'Day') as pretty_weekday, - to_char(start_date, 'HH:MIpm') as pretty_start_date, - to_char(end_date, 'HH:MIpm') as pretty_end_date, + to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date, + to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date, coalesce(e.name, a.name) as name, coalesce(e.status_summary, a.status_summary) as status_summary, e.event_id as item_id, @@ -154,34 +139,5 @@ - - - - - select to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'HH:MIpm') as pretty_start_date, - to_char(end_date, 'HH:MIpm') as pretty_end_date, - coalesce(e.name, a.name) as name, - coalesce(e.status_summary, a.status_summary) as status_summary, - e.event_id as item_id -from acs_activities a, - acs_events e, - timespans s, - time_intervals t -where e.timespan_id = s.timespan_id -and s.interval_id = t.interval_id -and e.activity_id = a.activity_id -and start_date between - to_date(:current_date,:date_format) and - to_date(:current_date,:date_format) + (24 - 1/3600)/24 -and e.event_id -in ( - select cal_item_id - from cal_items - where on_which_calendar = :calendar_id - ) - - - 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.28 -r1.29 --- openacs-4/packages/calendar/tcl/calendar-display-procs.tcl 21 Sep 2002 16:03:27 -0000 1.28 +++ openacs-4/packages/calendar/tcl/calendar-display-procs.tcl 18 Nov 2002 18:01:10 -0000 1.29 @@ -46,6 +46,9 @@ db_foreach select_monthly_items {} { + set start_time [lc_time_fmt $ansi_start_date "%X"] + set end_time [lc_time_fmt $ansi_end_date "%X"] + # Calendar name now set in query # set calendar_name [calendar_get_name $calendar_id] @@ -143,13 +146,14 @@ set items [ns_set create] - # This isn't going to be pretty. First we make it work, though. (ben) + # Find the first day of the week in julian + set current_date_weekday_no [expr [clock format [clock scan $date] -format %w] + 1] + set first_day_of_week_julian [expr [dt_ansi_to_julian_single_arg $date] - (($current_date_weekday_no + 6 - [lc_get firstdayofweek]) % 7)] - db_1row select_weekday_info {} - # Loop through the calendars db_foreach select_week_items {} { - ns_log Notice "ONE WEEK ITEM" + set pretty_start_date [lc_time_fmt $ansi_start_date "%X"] + set pretty_end_date [lc_time_fmt $ansi_end_date "%X"] # now selected from the query # set calendar_name [calendar_get_name $calendar_id] @@ -239,6 +243,9 @@ # Loop through the calendars db_foreach select_day_items {} { + set pretty_start_date [lc_time_fmt $ansi_start_date "%X"] + set pretty_end_date [lc_time_fmt $ansi_end_date "%X"] + # Not needed anymore # set calendar_name [calendar_get_name $calendar_id] @@ -354,6 +361,11 @@ append item " ($calendar_name)" } + set pretty_date [lc_time_fmt $ansi_start_date "%x"] + 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"] + ns_set put $items $start_hour [list $pretty_date $pretty_start_date $pretty_end_date $pretty_weekday $item_type $item] } @@ -370,83 +382,4 @@ } -# ad_proc -public list_display { -# {-date ""} -# {-calendar_id_list ""} -# {-item_template {$item}} -# {-url_stub_callback ""} -# {-show_calendar_name_p 1} -# } { -# Creates a list widget -# } { -# if {[empty_string_p $date]} { -# set date [dt_sysdate] -# } - -# set date_format "YYYY-MM-DD HH24:MI" -# set current_date $date - -# # If we were given no calendars, we assume we display the -# # private calendar. It makes no sense for this to be called with -# # no data whatsoever. -# if {[empty_string_p $calendar_id_list]} { -# set calendar_id_list [list [calendar_have_private_p -return_id 1 [ad_get_user_id]]] -# } - -# set items [ns_set create] - -# # Loop through the calendars -# foreach calendar_id $calendar_id_list { -# set calendar_name [calendar_get_name $calendar_id] - -# # In case we need to dispatch to a different URL (ben) -# if {![empty_string_p $url_stub_callback]} { -# set url_stub [$url_stub_callback $calendar_id] -# } - -# db_foreach select_day_items {} { -# # ns_log Notice "bma: one item" -# set item "$pretty_start_date - $pretty_end_date: $name" - -# if {$show_calendar_name_p} { -# append item " ($calendar_name)" -# } - -# set item [subst $item_template] - -# ns_set put $items $start_hour $item -# } - -# } - -# set return_html "Items for [util_AnsiDatetoPrettyDate $date]:

    \n" - -# for {set i 0} {$i <= 23} {incr i} { -# if {$i < 10} { -# set index_hour "0$i" -# } else { -# set index_hour $i -# } - -# while {1} { -# set index [ns_set find $items $index_hour] -# if {$index == -1} { -# break -# } - -# # ns_log Notice "bma: one item found !!" - -# append return_html "
  • [ns_set value $items $index]\n" -# ns_set delete $items $index -# } -# append return_html "

    " -# } - -# append return_html "

" - -# return $return_html -# } - - - } Index: openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl 3 Jun 2002 07:26:55 -0000 1.4 +++ openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl 18 Nov 2002 18:01:11 -0000 1.5 @@ -21,6 +21,6 @@ set cal_item(no_time_p) [dt_no_time_p -start_time $cal_item(start_time) -end_time $cal_item(end_time)] # cal nav -set cal_nav [dt_widget_calendar_navigation "view" day $cal_item(start_date) "calendar_id="] +set cal_nav [dt_widget_calendar_navigation -link_current_view "view" day $cal_item(start_date) "calendar_id="] ad_return_template Index: openacs-4/packages/calendar/www/cal-item-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item-edit.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/calendar/www/cal-item-edit.adp 7 Nov 2002 12:45:07 -0000 1.4 +++ openacs-4/packages/calendar/www/cal-item-edit.adp 18 Nov 2002 18:01:11 -0000 1.5 @@ -1,6 +1,7 @@ #calendar.Calendar_Edit_Item# #calendar.Edit# +cal_item.title
$day_of_week[lindex $days_of_week [expr ($i + $first_day_of_week) % 7 ]]

+ $day_number + $day_number + $day_number

-
[_ acs-datetime.Date_as] YYYYMMDD +
[_ acs-datetime.Date_as_YYYYMMDD] " @@ -821,7 +850,7 @@ Returns the following (example for the_date = 2000-12-08): julian_date_today 2451887 - month December + month December (localized) year 2000 first_julian_date 2451875 first_julian_date_of_month 2451880 @@ -835,8 +864,8 @@ prev_month 2000-11-08 beginning_of_year 2000-01-01 days_in_last_month 30 - next_month_name January - prev_month_name November + next_month_name January (localized) + prev_month_name November (localized) Input: @@ -862,7 +891,7 @@ ns_set put $dt_info_set julian_date_today \ [dt_ansi_to_julian $year $month $day] ns_set put $dt_info_set month \ - [clock format [clock scan $the_date] -format %B] + [lc_time_fmt $the_date "%B"] ns_set put $dt_info_set year \ [clock format [clock scan $the_date] -format %Y] ns_set put $dt_info_set first_julian_date_of_month \ @@ -885,19 +914,23 @@ [dt_next_month_name $year $month] ns_set put $dt_info_set prev_month_name \ [dt_prev_month_name $year $month] + ns_set put $dt_info_set first_day_of_week \ + [nsv_get locale [lang::conn::locale],firstdayofweek] - # We need the variables from the ns_set + # We need the variables from the ns_set here ad_ns_set_to_tcl_vars $dt_info_set ns_set put $dt_info_set first_julian_date \ - [expr $first_julian_date_of_month + 1 - $first_day_of_month] + [expr $first_julian_date_of_month - (($first_day_of_month + 6 - $first_day_of_week) % 7)] + ns_set put $dt_info_set first_day \ - [expr $days_in_last_month + 2 - $first_day_of_month] + [expr $days_in_last_month - (($first_day_of_month + 6 - $first_day_of_week) %7) + 1] + ns_set put $dt_info_set last_julian_date_in_month \ [expr $first_julian_date_of_month + $num_days_in_month - 1] set days_in_next_month \ - [expr (7-(($num_days_in_month + $first_day_of_month - 1) % 7)) % 7] + [expr (7-(($num_days_in_month + $first_day_of_month - $first_day_of_week - 1) % 7)) % 7] ns_set put $dt_info_set last_julian_date \ [expr $first_julian_date_of_month + $num_days_in_month - 1 + $days_in_next_month] Index: openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl 7 Nov 2002 08:41:33 -0000 1.6 +++ openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl 18 Nov 2002 18:01:12 -0000 1.7 @@ -49,27 +49,26 @@ ad_proc dt_month_names {} { Returns the calendar month names as a Tcl list (January, February, ...) } { - #set month_names [list] - - #for {set i 1} {$i <= 12} {incr i} { - #lappend month_names [clock format [clock scan "2000-$i-1"] -format "%B"] - #} - - #return $month_names - - return [list [_ acs-datetime.January] [_ acs-datetime.February] [_ acs-datetime.March] [_ acs-datetime.April] [_ acs-datetime.May] [_ acs-datetime.June] [_ acs-datetime.July] [_ acs-datetime.August] [_ acs-datetime.September] [_ acs-datetime.October] [_ acs-datetime.November] [_ acs-datetime.December]] + return [nsv_get locale [lang::conn::locale],mon] } ad_proc dt_month_abbrev {} { Returns the calendar month names as a Tcl list (Jan, Feb, ...) } { - set month_names [list] - - for {set i 1} {$i <= 12} {incr i} { - lappend month_names [clock format [clock scan "2000-$i-1"] -format "%b"] - } + return [nsv_get locale [lang::conn::locale],abmon] +} - return $month_names +ad_proc dt_ansi_to_julian_single_arg { + ansi + {era ""} +} { + set date_list [dt_ansi_to_list $ansi] + + set year [dt_trim_leading_zeros [lindex $date_list 0]] + set month [dt_trim_leading_zeros [lindex $date_list 1]] + set day [dt_trim_leading_zeros [lindex $date_list 2]] + + return [dt_ansi_to_julian $year $month $day $era] } ad_proc dt_ansi_to_julian { @@ -276,7 +275,7 @@ set month [expr $month + 1] } - return [clock format [clock scan $year-$month-01] -format %B] + return [lc_time_fmt [clock_to_ansi [clock scan $year-$month-01]] "%B"] } ad_proc dt_prev_month_name { @@ -292,7 +291,7 @@ set month [expr $month - 1] } - return [clock format [clock scan $year-$month-01] -format %B] + return [lc_time_fmt [clock_to_ansi [clock scan $year-$month-01]] "%B"] } ad_proc -public dt_widget_datetime { Index: openacs-4/packages/acs-lang/tcl/localization-data-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/localization-data-init.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-lang/tcl/localization-data-init.tcl 10 Jul 2002 11:57:19 -0000 1.2 +++ openacs-4/packages/acs-lang/tcl/localization-data-init.tcl 18 Nov 2002 17:58:35 -0000 1.3 @@ -17,9 +17,12 @@ nsv_set locale en_GB,am_str "" nsv_set locale en_GB,currency_symbol "�" nsv_set locale en_GB,day {{Sunday} {Monday} {Tuesday} {Wednesday} {Thursday} {Friday} {Saturday}} +nsv_set locale en_GB,firstdayofweek 0 nsv_set locale en_GB,decimal_point "." nsv_set locale en_GB,d_fmt "%d/%m/%y" nsv_set locale en_GB,d_t_fmt "%a %d %B %Y %H:%M %Z" +nsv_set locale en_GB,dlong_fmt "%d %B %Y" +nsv_set locale en_GB,dlongweekday_fmt "%A %d %B %Y" nsv_set locale en_GB,frac_digits 2 nsv_set locale en_GB,grouping {3 3 } nsv_set locale en_GB,int_curr_symbol "GBP " @@ -40,16 +43,20 @@ nsv_set locale en_GB,t_fmt_ampm "" nsv_set locale en_GB,t_fmt "%H:%M" nsv_set locale en_GB,thousands_sep "," +nsv_set locale en_GB,formbuilder_time_format "HH12:MI AM" # US nsv_set locale en_US,abday {{Sun} {Mon} {Tue} {Wed} {Thu} {Fri} {Sat}} nsv_set locale en_US,abmon {{Jan} {Feb} {Mar} {Apr} {May} {Jun} {Jul} {Aug} {Sep} {Oct} {Nov} {Dec}} nsv_set locale en_US,am_str "AM" nsv_set locale en_US,currency_symbol "$" nsv_set locale en_US,day {{Sunday} {Monday} {Tuesday} {Wednesday} {Thursday} {Friday} {Saturday}} +nsv_set locale en_US,firstdayofweek 0 nsv_set locale en_US,decimal_point "." nsv_set locale en_US,d_fmt "%m/%d/%y" nsv_set locale en_US,d_t_fmt "%a %B %d, %Y %r %Z" +nsv_set locale en_US,dlong_fmt "%B %d, %Y" +nsv_set locale en_US,dlongweekday_fmt "%A %B %d, %Y" nsv_set locale en_US,frac_digits 2 nsv_set locale en_US,grouping {3 3 } nsv_set locale en_US,int_curr_symbol "USD " @@ -70,16 +77,20 @@ nsv_set locale en_US,t_fmt_ampm "%I:%M:%S %p" nsv_set locale en_US,t_fmt "%r" nsv_set locale en_US,thousands_sep "," +nsv_set locale en_US,formbuilder_time_format "HH12:MI AM" # France nsv_set locale fr_FR,abday {{dim} {lun} {mar} {mer} {jeu} {ven} {sam}} nsv_set locale fr_FR,abmon {{jan} {f�v} {mar} {avr} {mai} {jun} {jui} {ao�} {sep} {oct} {nov} {d�c}} nsv_set locale fr_FR,am_str "" nsv_set locale fr_FR,currency_symbol "F" nsv_set locale fr_FR,day {{dimanche} {lundi} {mardi} {mercredi} {jeudi} {vendredi} {samedi}} +nsv_set locale fr_FR,firstdayofweek 1 nsv_set locale fr_FR,decimal_point "," nsv_set locale fr_FR,d_fmt "%d.%m.%Y" nsv_set locale fr_FR,d_t_fmt "%a %d %B %Y %H:%M %Z" +nsv_set locale fr_FR,dlong_fmt "%d %B %Y" +nsv_set locale fr_FR,dlongweekday_fmt "%A %d %B %Y" nsv_set locale fr_FR,frac_digits 2 nsv_set locale fr_FR,grouping {-1 -1 } nsv_set locale fr_FR,int_curr_symbol "FRF " @@ -100,16 +111,20 @@ nsv_set locale fr_FR,t_fmt_ampm "" nsv_set locale fr_FR,t_fmt "%H:%M" nsv_set locale fr_FR,thousands_sep "." +nsv_set locale fr_FR,formbuilder_time_format "HH24:MI" # Germany nsv_set locale de_DE,abday {{Son} {Mon} {Die} {Mit} {Don} {Fre} {Sam}} nsv_set locale de_DE,abmon {{Jan} {Feb} {M�r} {Apr} {Mai} {Jun} {Jul} {Aug} {Sep} {Okt} {Nov} {Dez}} nsv_set locale de_DE,am_str "" nsv_set locale de_DE,currency_symbol "DM" nsv_set locale de_DE,day {{Sonntag} {Montag} {Dienstag} {Mittwoch} {Donnerstag} {Freitag} {Samstag}} +nsv_set locale de_DE,firstdayofweek 1 nsv_set locale de_DE,decimal_point "," nsv_set locale de_DE,d_fmt "%d.%m.%Y" nsv_set locale de_DE,d_t_fmt "%a %d %B %Y %H:%M %Z" +nsv_set locale de_DE,dlong_fmt "%d %B %Y" +nsv_set locale de_DE,dlongweekday_fmt "%A %d %B %Y" nsv_set locale de_DE,frac_digits 2 nsv_set locale de_DE,grouping {3 3 } nsv_set locale de_DE,int_curr_symbol "DEM " @@ -130,16 +145,20 @@ nsv_set locale de_DE,t_fmt_ampm "" nsv_set locale de_DE,t_fmt "%H:%M" nsv_set locale de_DE,thousands_sep "." +nsv_set locale de_DE,formbuilder_time_format "HH24:MI" # Spain nsv_set locale es_ES,abday {{dom} {lun} {mar} {mi�} {jue} {vie} {s�b}} nsv_set locale es_ES,abmon {{ene} {feb} {mar} {abr} {may} {jun} {jul} {ago} {sep} {oct} {nov} {dic}} nsv_set locale es_ES,am_str "" nsv_set locale es_ES,currency_symbol "Pts" nsv_set locale es_ES,day {{domingo} {lunes} {martes} {mi�rcoles} {jueves} {viernes} {s�bado}} +nsv_set locale es_ES,firstdayofweek 1 nsv_set locale es_ES,decimal_point "," nsv_set locale es_ES,d_fmt "%d/%m/%y" nsv_set locale es_ES,d_t_fmt "%a %d %B %Y %H:%M %Z" +nsv_set locale es_ES,dlong_fmt "%d %B %Y" +nsv_set locale es_ES,dlongweekday_fmt "%A %d %B %Y" nsv_set locale es_ES,frac_digits 0 nsv_set locale es_ES,grouping {-1 -1 } nsv_set locale es_ES,int_curr_symbol "ESP " @@ -160,7 +179,42 @@ nsv_set locale es_ES,t_fmt_ampm "" nsv_set locale es_ES,t_fmt "%H:%M" nsv_set locale es_ES,thousands_sep "" +nsv_set locale es_ES,formbuilder_time_format "HH24:MI" +# Danish +nsv_set locale da_DK,abday {{s�n} {man} {tir} {ons} {tor} {fre} {l�r}} +nsv_set locale da_DK,abmon {{jan} {feb} {mar} {apr} {maj} {jun} {jul} {aug} {sep} {okt} {nov} {dec}} +nsv_set locale da_DK,am_str "" +nsv_set locale da_DK,currency_symbol "kr" +nsv_set locale da_DK,day {{s�ndag} {mandag} {tirsdag} {onsdag} {torsdag} {fredag} {l�rdag}} +nsv_set locale da_DK,firstdayofweek 1 +nsv_set locale da_DK,decimal_point "," +nsv_set locale da_DK,d_fmt "%e/%m-%y" +nsv_set locale da_DK,d_t_fmt "%a %e. %B %Y %r %Z" +nsv_set locale da_DK,dlong_fmt "%e. %B %Y" +nsv_set locale da_DK,dlongweekday_fmt "%A den %e. %B %Y" +nsv_set locale da_DK,frac_digits 2 +nsv_set locale da_DK,grouping {3 3 } +nsv_set locale da_DK,int_curr_symbol "DKK " +nsv_set locale da_DK,int_frac_digits 2 +nsv_set locale da_DK,mon_decimal_point "," +nsv_set locale da_DK,mon_grouping {3 3 } +nsv_set locale da_DK,mon {{januar} {februar} {marts} {april} {maj} {juni} {juli} {august} {september} {oktober} {november} {december}} +nsv_set locale da_DK,mon_thousands_sep "." +nsv_set locale da_DK,n_cs_precedes 1 +nsv_set locale da_DK,negative_sign "-" +nsv_set locale da_DK,n_sep_by_space 0 +nsv_set locale da_DK,n_sign_posn 1 +nsv_set locale da_DK,p_cs_precedes 1 +nsv_set locale da_DK,pm_str "" +nsv_set locale da_DK,positive_sign "" +nsv_set locale da_DK,p_sep_by_space 0 +nsv_set locale da_DK,p_sign_posn 1 +nsv_set locale da_DK,t_fmt_ampm "" +nsv_set locale da_DK,t_fmt "%H:%M" +nsv_set locale da_DK,thousands_sep "." +nsv_set locale da_DK,formbuilder_time_format "HH24:MI" + # Monetary amounts nsv_set locale money:000 {($num$sym)} nsv_set locale money:001 {($num $sym)} Index: openacs-4/packages/acs-lang/tcl/localization-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/localization-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-lang/tcl/localization-procs.tcl 7 Oct 2002 14:32:46 -0000 1.4 +++ openacs-4/packages/acs-lang/tcl/localization-procs.tcl 18 Nov 2002 17:58:35 -0000 1.5 @@ -169,7 +169,7 @@ ad_proc -public lc_numeric { num {fmt {}} - {locale en_US} + {locale ""} } { Given a number and a locale return a formatted version of the number @@ -182,6 +182,10 @@ @return Localized form of the number } { + if { ![exists_and_not_null locale] } { + set locale [ad_conn locale] + } + if {![empty_string_p $fmt]} { set out [format $fmt $num] } else { @@ -319,10 +323,34 @@ return [subst [nsv_get locale "money:$cs_precedes$sign_pos$sep_by_space"]] } +ad_proc -public clock_to_ansi { + seconds +} { + Convert a time in the Tcl internal clock seeconds format to ANSI format, usable by lc_time_fmt. + + @author Lars Pind (lars@pinds.com) + @return ANSI (YYYY-MM-DD HH24:MI:SS) formatted date. + @see lc_time_fmt +} { + return [clock format $seconds -format "%Y-%m-%d %H:%M:%S"] +} + +ad_proc -public lc_get { + key +} { + Get a certain format string for the current locale. + @param key the key of for the format string you want. + @return the format string for the current locale. + @see packages/acs-lang/tcl/localization-data-init.tcl + @author Lars Pind (lars@pinds.com) +} { + return [nsv_get locale "[ad_conn locale],$key"] +} + ad_proc -public lc_time_fmt { datetime fmt - {locale en_US} + {locale ""} } { Formats a time for the specified locale. @@ -356,6 +384,8 @@ %p FDCC-set's equivalent of either AM or PM. %r 12-hour clock time (01-12) using the AM/PM notation. + %q Long date without weekday (OpenACS addition to the standard) + %Q Long date with weekday (OpenACS addition to the standard) %S Seconds as a decimal number (00-61). %t A character. %T 24-hour clock time in the format HH:MM:SS. @@ -375,6 +405,7 @@ determinable. %% A character. + See also
man strftime
on a UNIX shell prompt for more of these abbreviations. @param locale Locale identifier must be in the locale database @error Fails if given a non-existant locale or a malformed datetime Doesn't check for impossible dates. Ask it for 29 Feb 1999 and it will tell you it was a Monday @@ -383,7 +414,10 @@ (or have an 'on this day in history' style page that goes back a good few hundred years). @return A date formatted for a locale } { - + if { ![exists_and_not_null locale] } { + set locale [ad_conn locale] + } + # Some initialisation... # Now, expect d_fmt, t_fmt and d_t_fmt to exist of the form in ISO spec # Rip $date into $lc_time_* as numbers, no leading zeroes @@ -392,9 +426,14 @@ set matchfull "$matchdate $matchtime" if {![nsv_exists locale "$locale,d_t_fmt"]} { - error "Unsupported locale: $locale" + ns_log Error "Unsupported locale: $locale; using site-wide default." + set locale [lang::system::locale -site_wide] + if {![nsv_exists locale "$locale,d_t_fmt"]} { + error "Site-Wide locale $locale doesn't have date and time formats defined." + } } - + + set lc_time_p 1 if {![regexp -- $matchfull $datetime match lc_time_year lc_time_month lc_time_days lc_time_hours lc_time_minutes lc_time_seconds]} { if {[regexp -- $matchdate $datetime match lc_time_year lc_time_month lc_time_days]} { set lc_time_hours 0 @@ -429,7 +468,7 @@ set percent_match(r) {[lc_leading_zeros [lc_time_drop_meridian $lc_time_hours] 2]:[lc_leading_zeros $lc_time_minutes 2] [lc_time_name_meridian $locale $lc_time_hours]} # Direct Subst - set percent_match(e) {[lc_leading_space $lc_time_month]} + set percent_match(e) {[lc_leading_space $lc_time_days]} set percent_match(f) {[lc_wrap_sunday $lc_time_day_no]} set percent_match(Y) {$lc_time_year} @@ -476,6 +515,14 @@ append transformed_string $done_portion set to_process "[nsv_get locale "$locale,d_t_fmt"]$remaining" } + q { + append transformed_string $done_portion + set to_process "[nsv_get locale "$locale,dlong_fmt"]$remaining" + } + Q { + append transformed_string $done_portion + set to_process "[nsv_get locale "$locale,dlongweekday_fmt"]$remaining" + } default { append transformed_string "${done_portion}[subst $percent_match($percent_modifier)]" set to_process $remaining Index: openacs-4/packages/acs-subsite/www/pvt/home.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/home.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/www/pvt/home.tcl 6 Sep 2002 21:50:08 -0000 1.5 +++ openacs-4/packages/acs-subsite/www/pvt/home.tcl 18 Nov 2002 18:01:13 -0000 1.6 @@ -94,7 +94,7 @@ set portrait_state "upload" } else { set portrait_state "show" - set portrait_publish_date [util_AnsiDatetoPrettyDate $publish_date] + set portrait_publish_date [lc_time_fmt $publish_date "%q"] } } else { set portrait_state "none" Index: openacs-4/packages/acs-subsite/www/pvt/set-on-vacation-until.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/Attic/set-on-vacation-until.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/pvt/set-on-vacation-until.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/pvt/set-on-vacation-until.tcl 18 Nov 2002 18:01:13 -0000 1.2 @@ -31,6 +31,6 @@ set home_link [ad_pvt_home_link] set site_link [ad_site_home_link] -set pretty_date [util_AnsiDatetoPrettyDate $on_vacation_until] +set pretty_date [lc_time_fmt $on_vacation_until "%q"] ad_return_template \ No newline at end of file Index: openacs-4/packages/acs-subsite/www/pvt/unsubscribe.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/unsubscribe.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/pvt/unsubscribe.tcl 28 Aug 2002 13:20:21 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/pvt/unsubscribe.tcl 18 Nov 2002 18:01:13 -0000 1.3 @@ -18,7 +18,7 @@ set site_link [ad_site_home_link] -set pretty_no_alerts_until_date [util_AnsiDatetoPrettyDate $no_alerts_until] +set pretty_no_alerts_until_date [lc_time_fmt $no_alerts_until "%q"] set date_entry_widget [ad_dateentrywidget_default_to_today on_vacation_until] if [db_0or1row nospam "select dont_spam_me_p Index: openacs-4/packages/acs-subsite/www/shared/community-member.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/community-member.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/shared/community-member.tcl 20 Sep 2002 22:28:55 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/shared/community-member.tcl 18 Nov 2002 18:01:14 -0000 1.5 @@ -135,7 +135,7 @@ set context [list "Community member"] set system_name [ad_system_name] -set pretty_creation_date [util_AnsiDatetoPrettyDate $creation_date] +set pretty_creation_date [lc_time_fmt $creation_date "%q"] set login_export_vars "return_url=[ns_urlencode [acs_community_member_url -user_id $user_id]]" ad_return_template Index: openacs-4/packages/acs-subsite/www/shared/portrait.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/portrait.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/shared/portrait.tcl 6 Sep 2002 21:50:11 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/shared/portrait.tcl 18 Nov 2002 18:01:14 -0000 1.4 @@ -43,6 +43,6 @@ set context [list [list [acs_community_member_url -user_id $user_id] "One Member"] "Portrait"] set export_vars [export_url_vars user_id] -set publish_date [util_AnsiDatetoPrettyDate $publish_date] +set publish_date [lc_time_fmt $publish_date "%q"] ad_return_template Index: openacs-4/packages/acs-subsite/www/user/portrait/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/user/portrait/index.tcl 18 Sep 2002 14:54:54 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/user/portrait/index.tcl 18 Nov 2002 18:01:15 -0000 1.4 @@ -92,7 +92,7 @@ set system_name [ad_system_name] set export_vars [export_url_vars user_id] -set pretty_date [util_AnsiDatetoPrettyDate $publish_date] +set pretty_date [lc_time_fmt $publish_date "%q"] set export_edit_vars [export_url_vars user_id return_url] ad_return_template \ No newline at end of file Index: openacs-4/packages/acs-tcl/tcl/defs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/defs-procs.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 7 Oct 2002 14:56:13 -0000 1.20 +++ openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 18 Nov 2002 18:02:06 -0000 1.21 @@ -36,7 +36,7 @@ set year [string range $release_date 0 3] set month [string range $release_date 4 5] set day [string range $release_date 6 7] - return [util_AnsiDatetoPrettyDate "$year-$month-$day"] + return [lc_time_fmt "$year-$month-$day" "%q"] } else { return "not released" } Index: openacs-4/packages/acs-templating/resources/forms/standard-lars.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/Attic/standard-lars.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-templating/resources/forms/standard-lars.adp 14 Sep 2002 19:26:10 -0000 1.5 +++ openacs-4/packages/acs-templating/resources/forms/standard-lars.adp 18 Nov 2002 18:01:06 -0000 1.6 @@ -41,8 +41,12 @@ - - + + + +
\@formgroup.widget@
\@formgroup.widget@ + +

Index: openacs-4/packages/acs-templating/resources/forms/standard.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/standard.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/resources/forms/standard.adp 14 Sep 2002 19:26:10 -0000 1.2 +++ openacs-4/packages/acs-templating/resources/forms/standard.adp 18 Nov 2002 18:01:06 -0000 1.3 @@ -42,10 +42,14 @@
> - +
- - + + + +
\@formgroup.widget@
\@formgroup.widget@ + +

Index: openacs-4/packages/acs-templating/tcl/date-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/date-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-templating/tcl/date-procs.tcl 10 Sep 2002 22:22:15 -0000 1.14 +++ openacs-4/packages/acs-templating/tcl/date-procs.tcl 18 Nov 2002 18:01:07 -0000 1.15 @@ -69,21 +69,11 @@ ad_proc -public template::util::date::monthName { month length } { Return the specified month name (short or long) } { - variable month_data - if { [string equal $length long] } { - set index 0 + return [lc_time_fmt "2002-[format "%02d" $month]-01" "%B"] } else { - set index 1 + return [lc_time_fmt "2002-[format "%02d" $month]-01" "%b"] } - - set month [template::util::leadingTrim $month] - - if { [info exists month_data($month)] } { - return [lindex $month_data($month) $index] - } else { - return "" - } } @@ -152,6 +142,25 @@ return [eval create $today] } +ad_proc -public template::util::date::from_ansi { + ansi_date + {format "YYYY MM DD"} +} { + Create a new templating system date structure from a full ANSI + date, i.e. in the format YYYY-MM-DD HH24:MI:SS. + + @param ansi_date Date in full ANSI format YYYY-MM-DD HH24:MI:SS (time portion is optional). + @param format Format for the date object. Optional, defaults to YYYY MM DD. + @return Date object for use with e.g. form builder. + @author Lars Pind (lars@pinds.com) + @creation-date November 18, 2002 +} { + set date [template::util::date::create] + set date [template::util::date::set_property format $date $format] + set date [template::util::date::set_property ansi $date $ansi_date] + return $date +} + ad_proc -public template::util::date::get_property { what date } { Access properties of the Date object Is it better to name them symbolically, as opposed to @@ -283,7 +292,7 @@ lappend date_list "[string range $pad [string length $fragment] end]$fragment" set pad "00" } - set value [util_AnsiDatetoPrettyDate [join $date_list "-"]] + set value [lc_time_fmt [join $date_list "-"] "%q"] unpack $date if { ![string equal $hours {}] && \ ![string equal $minutes {}] } { @@ -385,6 +394,26 @@ lappend new_date $old_format return $new_date } + ansi { + # Some initialisation... + # Rip $date into $ansi_* as numbers, no leading zeroes + set matchdate {([0-9]{4})\-0?(1?[0-9])\-0?([1-3]?[0-9])} + set matchtime {0?([1-2]?[0-9]):0?([1-5]?[0-9]):0?([1-6]?[0-9])} + set matchfull "$matchdate $matchtime" + + set time_p 1 + if {![regexp -- $matchfull $value match ansi_year ansi_month ansi_days ansi_hours ansi_minutes ansi_seconds]} { + if {[regexp -- $matchdate $value match ansi_year ansi_month ansi_days]} { + set ansi_hours 0 + set ansi_minutes 0 + set ansi_seconds 0 + } else { + error "Invalid date: $datetime" + } + } + # Return new date, but use old format + return [list $ansi_year $ansi_month $ansi_days $ansi_hours $ansi_minutes $ansi_seconds [lindex $date 6]] + } now { return [template::util::date set_property clock $date [clock seconds]] } Index: openacs-4/packages/bulk-mail/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/www/index.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/bulk-mail/www/index.tcl 29 Oct 2002 18:01:00 -0000 1.8 +++ openacs-4/packages/bulk-mail/www/index.tcl 18 Nov 2002 18:01:15 -0000 1.9 @@ -20,7 +20,7 @@ set context [list All] set table_def [list \ - [list send_date "[_ bulk-mail.Send_Date]" {bulk_mail_messages.send_date $order} {
[util_AnsiDatetoPrettyDate $send_date][lc_time_fmt $send_date "%q"]$from_addr$subject[ad_decode $sent_p t [_ bulk-mail.Yes] [_ bulk-mail.No]]
Index: openacs-4/packages/calendar/www/cal-item-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/cal-item-edit.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/calendar/www/cal-item-edit.tcl 7 Nov 2002 12:45:07 -0000 1.13 +++ openacs-4/packages/calendar/www/cal-item-edit.tcl 18 Nov 2002 18:01:11 -0000 1.14 @@ -31,13 +31,15 @@ -label " " -datatype text -widget radio -options [list [list "[_ calendar.All_Day_Event]" 0] [list "[_ calendar.Use_Hours_Below]" 1]] element create cal_item start_time \ - -label "[_ calendar.Start_Time]" -datatype date -widget date -format "HH12:MI AM" + -label "[_ calendar.Start_Time]" -datatype date -widget date \ + -format [lc_get formbuilder_time_format] -optional element create cal_item end_time \ - -label "[_ calendar.End_Time]" -datatype date -widget date -format "HH12:MI AM" + -label "[_ calendar.End_Time]" -datatype date -widget date \ + -format [lc_get formbuilder_time_format] -optional element create cal_item description \ - -label "[_ calendar.Description]" -datatype text -widget textarea -html {cols 60 rows 3 wrap soft} + -label "[_ calendar.Description]" -datatype text -widget textarea -html {cols 60 rows 3 wrap soft} -optional element create cal_item item_type_id \ -label "[_ calendar.Type_1]" -datatype integer -widget select -optional @@ -47,7 +49,7 @@ if {[form is_valid cal_item]} { - template::form get_values cal_item cal_item_id title date time_p start_time end_time description item_type_id repeat_p + form get_values cal_item cal_item_id title date time_p start_time end_time description item_type_id repeat_p # set up the datetimes set start_date [calendar::to_sql_datetime -date $date -time $start_time -time_p $time_p] @@ -75,26 +77,34 @@ # Prepare the form nicely element set_properties cal_item item_type_id -options [calendar::get_item_types -calendar_id $cal_item(calendar_id)] -element set_properties cal_item cal_item_id -value $cal_item(cal_item_id) -element set_properties cal_item title -value $cal_item(name) -element set_properties cal_item date -value [calendar::from_sql_datetime -sql_date $cal_item(start_date) -format {YYYY-MM-DD}] -element set_properties cal_item start_time -value [calendar::from_sql_datetime -sql_date $cal_item(start_time) -format {HH12:MIam}] -element set_properties cal_item end_time -value [calendar::from_sql_datetime -sql_date $cal_item(end_time) -format {HH12:MIam}] -element set_properties cal_item description -value $cal_item(description) -element set_properties cal_item item_type_id -value $cal_item(item_type_id) - -if {[dt_no_time_p -start_time $cal_item(start_time) -end_time $cal_item(end_time)]} { - element set_properties cal_item time_p -value 0 -} else { - element set_properties cal_item time_p -value 1 +# Hide the type widget if there *are* no types to choose from +if { [llength [element get_property cal_item item_type_id options]] <= 1 } { + element set_properties cal_item item_type_id -widget hidden } # if no recurrence, don't show the repeat stuff if {[empty_string_p $cal_item(recurrence_id)]} { element set_properties cal_item repeat_p -widget hidden } -set cal_nav [dt_widget_calendar_navigation "view" day $cal_item(start_date) "calendar_id"] +if { [form is_request cal_item] } { + element set_properties cal_item cal_item_id -value $cal_item(cal_item_id) + element set_properties cal_item title -value $cal_item(name) + element set_properties cal_item date -value [template::util::date::from_ansi $cal_item(start_date)] + element set_properties cal_item start_time -value [template::util::date::from_ansi $cal_item(full_start_date) [lc_get formbuilder_time_format]] + element set_properties cal_item end_time -value [template::util::date::from_ansi $cal_item(full_end_date) [lc_get formbuilder_time_format]] + element set_properties cal_item description -value $cal_item(description) + element set_properties cal_item item_type_id -value $cal_item(item_type_id) + if {[dt_no_time_p -start_time $cal_item(start_time) -end_time $cal_item(end_time)]} { + element set_properties cal_item time_p -value 0 + } else { + element set_properties cal_item time_p -value 1 + } +} + + +set cal_nav [dt_widget_calendar_navigation -link_current_view "view" day $cal_item(start_date) "calendar_id"] + ad_return_template 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.5 -r1.6 --- openacs-4/packages/calendar/www/cal-item-new.adp 7 Nov 2002 12:45:07 -0000 1.5 +++ openacs-4/packages/calendar/www/cal-item-new.adp 18 Nov 2002 18:01:11 -0000 1.6 @@ -1,6 +1,7 @@ #calendar.Calendar_Add_Item# #calendar.Add# +cal_item.title
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.5 -r1.6 --- openacs-4/packages/calendar/www/cal-item-new.tcl 7 Nov 2002 12:45:07 -0000 1.5 +++ openacs-4/packages/calendar/www/cal-item-new.tcl 18 Nov 2002 18:01:11 -0000 1.6 @@ -1,4 +1,3 @@ - ad_page_contract { Creating a new Calendar Item @@ -47,13 +46,15 @@ -label " " -datatype text -widget radio -options [list [list "[_ calendar.All_Day_Event]" 0] [list "[_ calendar.Use_Hours_Below]" 1]] element create cal_item start_time \ - -label "[_ calendar.Start_Time]" -datatype date -widget date -format "HH12:MI AM" -optional + -label "[_ calendar.Start_Time]" -datatype date -widget date \ + -format [lc_get formbuilder_time_format] -optional element create cal_item end_time \ - -label "[_ calendar.End_Time]" -datatype date -widget date -format "HH12:MI AM" -optional + -label "[_ calendar.End_Time]" -datatype date -widget date \ + -format [lc_get formbuilder_time_format] -optional element create cal_item description \ - -label "[_ calendar.Description]" -datatype text -widget textarea -html {cols 60 rows 3 wrap soft} + -label "[_ calendar.Description]" -datatype text -widget textarea -html {cols 60 rows 3 wrap soft} -optional element create cal_item item_type_id \ -label "[_ calendar.Type_1]" -datatype integer -widget select -options [calendar::get_item_types -calendar_id $calendar_id] -optional @@ -87,26 +88,33 @@ ad_script_abort } -# Set some properties -element set_properties cal_item date -value [calendar::from_sql_datetime -sql_date $date -format "YYYY-MM-DD"] +# Hide the type widget if there *are* no types to choose from +if { [llength [element get_property cal_item item_type_id options]] <= 1 } { + element set_properties cal_item item_type_id -widget hidden +} -if {[dt_no_time_p -start_time $start_time -end_time $end_time]} { - # No time event - element set_properties cal_item time_p -value 0 -} else { - if {![empty_string_p $start_time]} { - set start_time_date [calendar::from_sql_datetime -sql_date $start_time -format {HH24}] - element set_properties cal_item start_time -value $start_time_date +if { [form is_request cal_item] } { + # Set some properties + element set_properties cal_item date -value [calendar::from_sql_datetime -sql_date $date -format "YYYY-MM-DD"] + + if {[dt_no_time_p -start_time $start_time -end_time $end_time]} { + # No time event + element set_properties cal_item time_p -value 0 + } else { + if {![empty_string_p $start_time]} { + set start_time_date [calendar::from_sql_datetime -sql_date $start_time -format {HH24}] + element set_properties cal_item start_time -value $start_time_date + } + + if {![empty_string_p $end_time]} { + set end_time_date [calendar::from_sql_datetime -sql_date $end_time -format {HH24}] + element set_properties cal_item end_time -value $end_time_date + } + + element set_properties cal_item time_p -value 1 } - - if {![empty_string_p $end_time]} { - set end_time_date [calendar::from_sql_datetime -sql_date $end_time -format {HH24}] - element set_properties cal_item end_time -value $end_time_date - } - - element set_properties cal_item time_p -value 1 } -set cal_nav [dt_widget_calendar_navigation "view" day $date "calendar_id=$calendar_id"] +set cal_nav [dt_widget_calendar_navigation -link_current_view "view" day $date "calendar_id=$calendar_id"] ad_return_template Index: openacs-4/packages/calendar/www/cal-item-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.adp,v diff -u -r1.14 -r1.15 --- openacs-4/packages/calendar/www/cal-item-view.adp 7 Nov 2002 12:45:07 -0000 1.14 +++ openacs-4/packages/calendar/www/cal-item-view.adp 18 Nov 2002 18:01:11 -0000 1.15 @@ -21,9 +21,9 @@
- + - - + + Index: openacs-4/packages/dotlrn/www/admin/terms.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/terms.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/admin/terms.tcl 23 Oct 2002 12:38:40 -0000 1.5 +++ openacs-4/packages/dotlrn/www/admin/terms.tcl 18 Nov 2002 17:58:53 -0000 1.6 @@ -28,7 +28,10 @@ set context_bar "[_ dotlrn.Terms]" -db_multirow terms select_terms {} +db_multirow -extend { start_date_pretty end_date_pretty } terms select_terms {} { + set start_date_pretty [lc_time_fmt $start_date_ansi "%q"] + set end_date_pretty [lc_time_fmt $end_date_ansi "%q"] +} ad_return_template Index: openacs-4/packages/dotlrn/www/admin/terms.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/terms.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/admin/terms.xql 1 May 2002 01:19:47 -0000 1.6 +++ openacs-4/packages/dotlrn/www/admin/terms.xql 18 Nov 2002 17:58:53 -0000 1.7 @@ -7,8 +7,8 @@ select dotlrn_terms.term_id, dotlrn_terms.term_name, dotlrn_terms.term_year, - to_char(dotlrn_terms.start_date, 'Mon DD YYYY') as start_date, - to_char(dotlrn_terms.end_date, 'Mon DD YYYY') as end_date, + to_char(dotlrn_terms.start_date, 'YYYY-MM-DD') as start_date_ansi, + to_char(dotlrn_terms.end_date, 'YYYY-MM-DD') as end_date_ansi, (select count(*) from dotlrn_class_instances where dotlrn_class_instances.term_id = dotlrn_terms.term_id) as n_classes Index: openacs-4/packages/dotlrn/www/admin/user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/www/admin/user.tcl 12 Nov 2002 08:44:06 -0000 1.12 +++ openacs-4/packages/dotlrn/www/admin/user.tcl 18 Nov 2002 17:58:53 -0000 1.13 @@ -51,9 +51,9 @@ if {[empty_string_p $screen_name]} { set screen_name "<[_ dotlrn.none_set_up]>" } -set registration_date [util_AnsiDatetoPrettyDate $registration_date] +set registration_date [lc_time_fmt $registration_date "%q"] if {![empty_string_p $last_visit]} { - set last_visit [util_AnsiDatetoPrettyDate $last_visit] + set last_visit [lc_time_fmt $last_visit "%q"] } set dotlrn_package_id [dotlrn::get_package_id] Index: openacs-4/packages/dotlrn-bm/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bm/www/admin/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-bm/www/admin/index.tcl 13 Jul 2002 00:13:09 -0000 1.2 +++ openacs-4/packages/dotlrn-bm/www/admin/index.tcl 18 Nov 2002 18:01:20 -0000 1.3 @@ -18,7 +18,7 @@ set context_bar {All} set table_def { - {send_date {Send Date} {bulk_mail_messages.send_date $order} {}} + {send_date {Send Date} {bulk_mail_messages.send_date $order} {}} {from_addr From {bulk_mail_messages.from_addr $order} {}} {subject Subject {bulk_mail_messages.subject $order} {}} {sent_p {Sent?} {bulk_mail_messages.sent_p $order} {}} Index: openacs-4/packages/dotlrn-fs/www/all-objects.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/www/all-objects.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn-fs/www/all-objects.tcl 5 Nov 2002 17:21:23 -0000 1.11 +++ openacs-4/packages/dotlrn-fs/www/all-objects.tcl 18 Nov 2002 18:01:20 -0000 1.12 @@ -67,7 +67,7 @@ lappend table_def [list folder_name [_ dotlrn-fs.Folder] {} ""] lappend table_def [list type [_ dotlrn-fs.Type] {fs_objects.type $order} {c}] lappend table_def [list content_size [_ dotlrn-fs.Size] {fs_objects.content_size $order} {}] -lappend table_def [list last_modified [_ dotlrn-fs.Last_Modified] {fs_objects.last_modified $order} {}] +lappend table_def [list last_modified [_ dotlrn-fs.Last_Modified] {fs_objects.last_modified $order} {}] set dotlrn_package_key [dotlrn::package_key] Index: openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql,v diff -u -r1.19 -r1.20 --- openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 17 Sep 2002 21:03:26 -0000 1.19 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-oracle.xql 18 Nov 2002 18:01:04 -0000 1.20 @@ -57,7 +57,7 @@ fs_objects.name, fs_objects.live_revision, fs_objects.type, - to_char(fs_objects.last_modified, 'Month DD YYYY HH24:MI') as last_modified, + to_char(fs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, fs_objects.content_size, fs_objects.url, fs_objects.key, Index: openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql,v diff -u -r1.29 -r1.30 --- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 17 Sep 2002 21:03:26 -0000 1.29 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 18 Nov 2002 18:01:04 -0000 1.30 @@ -53,7 +53,7 @@ fs_objects.name, fs_objects.live_revision, fs_objects.type, - to_char(fs_objects.last_modified, 'Month DD YYYY HH24:MI') as last_modified, + to_char(fs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, fs_objects.content_size, fs_objects.url, fs_objects.key, Index: openacs-4/packages/file-storage/tcl/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.tcl,v diff -u -r1.27 -r1.28 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 8 Nov 2002 21:00:37 -0000 1.27 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 18 Nov 2002 18:01:04 -0000 1.28 @@ -379,7 +379,18 @@ set user_id [acs_magic_object the_public] } - return [db_list_of_ns_sets select_folder_contents {}] + set list_of_ns_sets [db_list_of_ns_sets select_folder_contents {}] + + foreach set $list_of_ns_sets { + # in plain Tcl: + # set last_modified [lc_time_fmt $last_modified_ansi "%x %X"] + ns_set put $set last_modified [lc_time_fmt [ns_set get $set last_modified_ansi] "%x %X"] + + # set content_size_pretty [lc_numeric $content_size] + ns_set put $set content_size_pretty [lc_numeric [ns_set get $set content_size]] + } + + return $list_of_ns_sets } ad_proc -public get_folder_contents_count { Index: openacs-4/packages/file-storage/www/file-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-add-2.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/file-storage/www/file-add-2.tcl 12 Nov 2002 08:36:44 -0000 1.8 +++ openacs-4/packages/file-storage/www/file-add-2.tcl 18 Nov 2002 18:01:05 -0000 1.9 @@ -54,15 +54,19 @@ # create the new item if {$indb_p} { + ns_log Notice LARS1 set file_id [db_exec_plsql new_lob_file {}] - + + ns_log Notice LARS2 set version_id [db_exec_plsql new_version {}] + ns_log Notice LARS3 db_dml lob_content {} -blob_files [list ${upload_file.tmpfile}] - + ns_log Notice LARS4 # Unfortunately, we can only calculate the file size after the lob is uploaded db_dml lob_size {} + ns_log Notice LARS5 } else { Index: openacs-4/packages/file-storage/www/file-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-oracle.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/file-storage/www/file-oracle.xql 17 Sep 2002 21:03:27 -0000 1.6 +++ openacs-4/packages/file-storage/www/file-oracle.xql 18 Nov 2002 18:01:05 -0000 1.7 @@ -26,7 +26,7 @@ r.revision_id as version_id, person.name(o.creation_user) as author, r.mime_type as type, - to_char(o.last_modified,'YYYY-MM-DD HH24:MI') as last_modified, + to_char(o.last_modified,'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, r.description, acs_permission.permission_p(r.revision_id,:user_id,'admin') as admin_p, acs_permission.permission_p(r.revision_id,:user_id,'delete') as delete_p, Index: openacs-4/packages/file-storage/www/file-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/file-storage/www/file-postgresql.xql 24 Sep 2002 16:18:35 -0000 1.6 +++ openacs-4/packages/file-storage/www/file-postgresql.xql 18 Nov 2002 18:01:05 -0000 1.7 @@ -26,7 +26,7 @@ r.revision_id as version_id, person__name(o.creation_user) as author, r.mime_type as type, - to_char(o.last_modified,'YYYY-MM-DD HH24:MI') as last_modified, + to_char(o.last_modified,'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, r.description, acs_permission__permission_p(r.revision_id,:user_id,'admin') as admin_p, acs_permission__permission_p(r.revision_id,:user_id,'delete') as delete_p, Index: openacs-4/packages/file-storage/www/file.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/file-storage/www/file.adp 5 Nov 2002 17:19:59 -0000 1.9 +++ openacs-4/packages/file-storage/www/file.adp 18 Nov 2002 18:01:05 -0000 1.10 @@ -52,7 +52,7 @@ @version.title@ - + Index: openacs-4/packages/file-storage/www/file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/file-storage/www/file.tcl 5 Nov 2002 17:19:59 -0000 1.9 +++ openacs-4/packages/file-storage/www/file.tcl 18 Nov 2002 18:01:05 -0000 1.10 @@ -57,22 +57,10 @@ set show_versions [db_map show_live_version] } -set sql " -select r.title, - r.revision_id as version_id, - person.name(o.creation_user) as author, - r.mime_type as type, - to_char(o.last_modified,'YYYY-MM-DD HH24:MI') as last_modified, - r.description, - acs_permission.permission_p(r.revision_id,:user_id,'admin') as admin_p, - acs_permission.permission_p(r.revision_id,:user_id,'delete') as delete_p, - r.content_length as content_size -from acs_objects o, cr_revisions r -where o.object_id = r.revision_id -and acs_permission.permission_p(r.revision_id, :user_id, 'read') = 't' -$show_versions" +db_multirow -extend { last_modified content_size_pretty } version version_info {} { + set last_modified [lc_time_fmt $last_modified_ansi "%x %X"] + set content_size_pretty [lc_numeric $content_size] +} -db_multirow version version_info $sql - ad_return_template Index: openacs-4/packages/file-storage/www/folder-chunk-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-chunk-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/file-storage/www/folder-chunk-oracle.xql 17 Sep 2002 21:03:27 -0000 1.1 +++ openacs-4/packages/file-storage/www/folder-chunk-oracle.xql 18 Nov 2002 18:01:05 -0000 1.2 @@ -8,7 +8,7 @@ fs_objects.name, fs_objects.live_revision, fs_objects.type, - to_char(fs_objects.last_modified, 'Month DD YYYY HH24:MI') as last_modified, + to_char(fs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, fs_objects.content_size, fs_objects.url, fs_objects.key, Index: openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql 17 Sep 2002 21:03:27 -0000 1.1 +++ openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql 18 Nov 2002 18:01:05 -0000 1.2 @@ -8,7 +8,7 @@ fs_objects.name, fs_objects.live_revision, fs_objects.type, - to_char(fs_objects.last_modified, 'Month DD YYYY HH24:MI') as last_modified, + to_char(fs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, fs_objects.content_size, fs_objects.url, fs_objects.key, Index: openacs-4/packages/file-storage/www/folder-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/file-storage/www/folder-chunk.adp 5 Nov 2002 17:19:59 -0000 1.11 +++ openacs-4/packages/file-storage/www/folder-chunk.adp 18 Nov 2002 18:01:05 -0000 1.12 @@ -23,7 +23,7 @@ @@ -35,7 +35,7 @@ @contents.name@#file-storage.new# - - + Index: openacs-4/packages/file-storage/www/folder-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/file-storage/www/folder-chunk.tcl 5 Nov 2002 17:19:59 -0000 1.9 +++ openacs-4/packages/file-storage/www/folder-chunk.tcl 18 Nov 2002 18:01:05 -0000 1.10 @@ -31,37 +31,11 @@ set folder_name [fs::get_object_name -object_id $folder_id] -db_multirow -extend { write_p delete_p admin_p read_p} contents select_folder_contents {} { - set file_upload_name [fs::remove_special_file_system_characters -string $file_upload_name] - if { $type == "url" } { - #url is the only type that uses this in the UI and permission checking is expensive. - set admin_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "admin"] - if { $admin_p } { - set write_p 1 - set delete_p 1 - set read_p 1 - } else { - set write_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "write"] - set delete_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "delete"] - if {!$write_p && !$delete_p} { - set read_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "read"] - } else { - set read_p 1 - } - } - } else { - set admin_p 0 - set write_p 0 - set delete_p 0 - set read_p 0 - } -} - set rows [fs::get_folder_contents \ -folder_id $folder_id \ -user_id $viewing_user_id \ -n_past_days $n_past_days \ ] -template::util::list_of_ns_sets_to_multirow -rows $rows -var_name "contents" +util::list_of_ns_sets_to_multirow -rows $rows -var_name "contents" ad_return_template Index: openacs-4/packages/file-storage/www/folder-contents.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-contents.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/file-storage/www/folder-contents.tcl 12 Nov 2002 08:36:44 -0000 1.11 +++ openacs-4/packages/file-storage/www/folder-contents.tcl 18 Nov 2002 18:01:05 -0000 1.12 @@ -69,7 +69,7 @@ lappend table_def [list folder_name Folder {} ""] lappend table_def {type Type {fs_objects.type $order} {c}} lappend table_def {content_size Size {fs_objects.content_size $order} {}} -lappend table_def {last_modified {Last Modified} {fs_objects.last_modified $order} {}} +lappend table_def {last_modified {Last Modified} {fs_objects.last_modified $order} {}} #JCD BROKEN QUERY NEEDS db_map Index: openacs-4/packages/forums/tcl/messages-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/Attic/messages-procs-oracle.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/forums/tcl/messages-procs-oracle.xql 2 Jul 2002 19:42:19 -0000 1.6 +++ openacs-4/packages/forums/tcl/messages-procs-oracle.xql 18 Nov 2002 18:01:07 -0000 1.7 @@ -14,7 +14,7 @@ (select fm2.subject from forums_messages fm2 where fm2.message_id = forums_message.root_message_id(forums_messages.message_id)) as root_subject, - to_char(forums_messages.posting_date, 'Mon DD YYYY HH24:MI:SS') as posting_date + to_char(forums_messages.posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi from forums_messages where forums_messages.message_id = :message_id @@ -31,7 +31,7 @@ (select fm2.subject from forums_messages fm2 where fm2.message_id = forums_message.root_message_id(forums_messages.message_id)) as root_subject, - to_char(forums_messages.posting_date, 'Mon DD YYYY HH24:MI:SS') as posting_date + to_char(forums_messages.posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi from forums_messages where forums_messages.message_id = :message_id Index: openacs-4/packages/forums/tcl/messages-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/messages-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/forums/tcl/messages-procs.tcl 25 Oct 2002 13:00:01 -0000 1.12 +++ openacs-4/packages/forums/tcl/messages-procs.tcl 18 Nov 2002 18:01:07 -0000 1.13 @@ -166,6 +166,8 @@ } db_1row $query {} -column_array row + + set row(posting_date_pretty) [lc_time_fmt $row(posting_date_ansi) "%x %X"] } ad_proc -private set_state { Index: openacs-4/packages/forums/www/forum-view-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/forum-view-oracle.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/forums/www/forum-view-oracle.xql 24 Jun 2002 21:40:16 -0000 1.5 +++ openacs-4/packages/forums/www/forum-view-oracle.xql 18 Nov 2002 18:01:08 -0000 1.6 @@ -14,7 +14,7 @@ from forums_messages_approved fm1 where fm1.forum_id = :forum_id and fm1.tree_sortkey between tree.left(fm.tree_sortkey) and tree.right(fm.tree_sortkey)) as n_messages, - to_char(acs_objects.last_modified, 'Mon DD YYYY HH24:MI:SS') as last_modified, + to_char(acs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, case when acs_objects.last_modified > (sysdate - 1) then 't' else 'f' end as new_p from forums_messages_approved fm, acs_objects @@ -37,7 +37,7 @@ from forums_messages fm1 where fm1.forum_id = :forum_id and fm1.tree_sortkey between tree.left(fm.tree_sortkey) and tree.right(fm.tree_sortkey)) as n_messages, - to_char(acs_objects.last_modified, 'Mon DD YYYY HH24:MI:SS') as last_modified, + to_char(acs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, case when acs_objects.last_modified > (sysdate - 1) then 't' else 'f' end as new_p from forums_messages fm, acs_objects Index: openacs-4/packages/forums/www/forum-view-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/forum-view-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/forums/www/forum-view-postgresql.xql 24 Jun 2002 21:40:16 -0000 1.4 +++ openacs-4/packages/forums/www/forum-view-postgresql.xql 18 Nov 2002 18:01:08 -0000 1.5 @@ -14,7 +14,7 @@ from forums_messages_approved fm1 where fm1.forum_id = :forum_id and fm1.tree_sortkey between tree_left(fm.tree_sortkey) and tree_right(fm.tree_sortkey)) as n_messages, - to_char(acs_objects.last_modified, 'Mon DD YYYY HH24:MI:SS') as last_modified, + to_char(acs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, case when acs_objects.last_modified > (now() - 1) then 't' else 'f' end as new_p from forums_messages_approved fm, acs_objects @@ -37,7 +37,7 @@ from forums_messages fm1 where fm1.forum_id = :forum_id and fm1.tree_sortkey between tree_left(fm.tree_sortkey) and tree_right(fm.tree_sortkey)) as n_messages, - to_char(acs_objects.last_modified, 'Mon DD YYYY HH24:MI:SS') as last_modified, + to_char(acs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, case when acs_objects.last_modified > (now() - 1) then 't' else 'f' end as new_p from forums_messages fm, acs_objects Index: openacs-4/packages/forums/www/forum-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/forum-view.adp,v diff -u -r1.15 -r1.16 --- openacs-4/packages/forums/www/forum-view.adp 25 Oct 2002 13:00:02 -0000 1.15 +++ openacs-4/packages/forums/www/forum-view.adp 18 Nov 2002 18:01:08 -0000 1.16 @@ -70,7 +70,7 @@ - + Index: openacs-4/packages/forums/www/forum-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/forum-view.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/forums/www/forum-view.tcl 25 Oct 2002 13:00:02 -0000 1.9 +++ openacs-4/packages/forums/www/forum-view.tcl 18 Nov 2002 18:01:08 -0000 1.10 @@ -66,7 +66,9 @@ set query messages_select_moderator } -db_multirow messages $query {} +db_multirow -extend { last_modified_pretty } messages $query {} { + set last_modified_pretty [lc_time_fmt $last_modified_ansi "%x %X"] +} set notification_chunk [notification::display::request_widget \ -type forums_forum_notif \ Index: openacs-4/packages/forums/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/index-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/forums/www/index-oracle.xql 6 Jun 2002 00:46:55 -0000 1.2 +++ openacs-4/packages/forums/www/index-oracle.xql 18 Nov 2002 18:01:08 -0000 1.3 @@ -10,7 +10,7 @@ from forums_messages where forums_messages.forum_id = forums_forums_enabled.forum_id and 1 = tree.tree_level(forums_messages.tree_sortkey)) as n_threads, - to_char(acs_objects.last_modified, 'Mon DD YYYY HH24:MI:SS') as last_modified, + to_char(acs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, case when last_modified > (sysdate - 1) then 't' else 'f' end as new_p from forums_forums_enabled, acs_objects Index: openacs-4/packages/forums/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/index-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/forums/www/index-postgresql.xql 24 Jun 2002 21:40:16 -0000 1.2 +++ openacs-4/packages/forums/www/index-postgresql.xql 18 Nov 2002 18:01:08 -0000 1.3 @@ -10,7 +10,7 @@ from forums_messages where forums_messages.forum_id = forums_forums_enabled.forum_id and 1 = tree_level(forums_messages.tree_sortkey)) as n_threads, - to_char(acs_objects.last_modified, 'Mon DD YYYY HH24:MI:SS') as last_modified, + to_char(acs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, case when last_modified > (now() - 1) then 't' else 'f' end as new_p from forums_forums_enabled, acs_objects Index: openacs-4/packages/forums/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/index.adp,v diff -u -r1.14 -r1.15 --- openacs-4/packages/forums/www/index.adp 25 Oct 2002 13:00:02 -0000 1.14 +++ openacs-4/packages/forums/www/index.adp 18 Nov 2002 18:01:08 -0000 1.15 @@ -60,7 +60,7 @@ Index: openacs-4/packages/forums/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/index.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/forums/www/index.tcl 25 Oct 2002 13:00:02 -0000 1.7 +++ openacs-4/packages/forums/www/index.tcl 18 Nov 2002 18:01:08 -0000 1.8 @@ -30,11 +30,10 @@ -widget hidden \ -value "" -db_multirow forums select_forums {} +db_multirow -extend { last_modified_pretty } forums select_forums {} { + set last_modified_pretty [lc_time_fmt $last_modified_ansi "%x %X"] +} set context {} ad_return_template - - - Index: openacs-4/packages/forums/www/message-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/message-chunk.adp,v diff -u -r1.12 -r1.13 --- openacs-4/packages/forums/www/message-chunk.adp 25 Oct 2002 13:00:02 -0000 1.12 +++ openacs-4/packages/forums/www/message-chunk.adp 18 Nov 2002 18:01:08 -0000 1.13 @@ -13,7 +13,7 @@ - + Index: openacs-4/packages/forums/www/message-post-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/message-post-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/forums/www/message-post-oracle.xql 2 Aug 2002 20:17:42 -0000 1.2 +++ openacs-4/packages/forums/www/message-post-oracle.xql 18 Nov 2002 18:01:08 -0000 1.3 @@ -4,7 +4,7 @@ - select to_char(sysdate, 'Mon DD YYYY HH24:MI:SS') + select to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') from dual Index: openacs-4/packages/forums/www/message-post-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/message-post-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/www/message-post-postgresql.xql 30 Jul 2002 22:41:15 -0000 1.1 +++ openacs-4/packages/forums/www/message-post-postgresql.xql 18 Nov 2002 18:01:08 -0000 1.2 @@ -5,7 +5,7 @@ - select to_char(current_timestamp, 'Mon DD YYYY HH24:MI:SS') + select to_char(current_timestamp, 'YYYY-MM-DD HH24:MI:SS') Index: openacs-4/packages/forums/www/message-post.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/forums/www/message-post.tcl 25 Oct 2002 13:00:02 -0000 1.16 +++ openacs-4/packages/forums/www/message-post.tcl 18 Nov 2002 18:01:08 -0000 1.17 @@ -104,7 +104,8 @@ set message(content) $content set message(user_id) $user_id set message(user_name) [db_string select_name {}] - set message(posting_date) [db_string select_date {}] + set message(posting_date_ansi) [db_string select_date {}] + set message(posting_date_pretty) [lc_time_fmt $message(posting_date_ansi) "%x %X"] # Let's check if this person is subscribed to the forum # in case we might want to subscribe them to the thread Index: openacs-4/packages/forums/www/message-view-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-view-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/forums/www/message-view-oracle.xql 30 Jul 2002 22:04:59 -0000 1.4 +++ openacs-4/packages/forums/www/message-view-oracle.xql 18 Nov 2002 18:01:08 -0000 1.5 @@ -10,7 +10,7 @@ content, html_p, person.name(user_id) as user_name, - to_char(posting_date, 'Mon DD YYYY HH24:MI:SS') as posting_date, + to_char(posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi, tree.tree_level(tree_sortkey) as tree_level, state, user_id @@ -29,7 +29,7 @@ content, html_p, person.name(user_id) as user_name, - to_char(posting_date, 'Mon DD YYYY HH24:MI:SS') as posting_date, + to_char(posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi, tree.tree_level(tree_sortkey) as tree_level, state, user_id Index: openacs-4/packages/forums/www/message-view-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-view-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/forums/www/message-view-postgresql.xql 30 Jul 2002 22:04:59 -0000 1.5 +++ openacs-4/packages/forums/www/message-view-postgresql.xql 18 Nov 2002 18:01:08 -0000 1.6 @@ -11,7 +11,7 @@ content, html_p, person__name(user_id) as user_name, - to_char(posting_date, 'Mon DD YYYY HH24:MI:SS') as posting_date, + to_char(posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi, tree_level(tree_sortkey) as tree_level, state, user_id @@ -30,7 +30,7 @@ content, html_p, person__name(user_id) as user_name, - to_char(posting_date, 'Mon DD YYYY HH24:MI:SS') as posting_date, + to_char(posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi, tree_level(tree_sortkey) as tree_level, state, user_id Index: openacs-4/packages/forums/www/message-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-view.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/forums/www/message-view.tcl 25 Oct 2002 13:00:02 -0000 1.12 +++ openacs-4/packages/forums/www/message-view.tcl 18 Nov 2002 18:01:08 -0000 1.13 @@ -88,7 +88,9 @@ set order_by "tree_sortkey" } -db_multirow responses $query {} +db_multirow -extend { posting_date_pretty } responses $query {} { + set posting_date_pretty [lc_time_fmt $posting_date_ansi "%x %X"] +} # If this is a top-level thread, we allow subscriptions here if {[empty_string_p $message(parent_id)]} { Index: openacs-4/packages/forums/www/user-history.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/user-history.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/forums/www/user-history.adp 25 Oct 2002 13:00:02 -0000 1.7 +++ openacs-4/packages/forums/www/user-history.adp 18 Nov 2002 18:01:08 -0000 1.8 @@ -45,7 +45,7 @@ - + @@ -88,7 +88,7 @@ - + Index: openacs-4/packages/forums/www/user-history.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/user-history.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/forums/www/user-history.tcl 25 Oct 2002 13:00:02 -0000 1.7 +++ openacs-4/packages/forums/www/user-history.tcl 18 Nov 2002 18:01:08 -0000 1.8 @@ -29,7 +29,9 @@ } # Select the postings -db_multirow messages $query {} +db_multirow -extend { posting_date_pretty } messages $query {} { + set posting_date_pretty [lc_time_fmt $posting_date_ansi "%x %X"] +} # Get user information oacs::user::get -user_id $user_id -array user Index: openacs-4/packages/forums/www/user-history.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/user-history.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/forums/www/user-history.xql 2 Jul 2002 20:00:23 -0000 1.2 +++ openacs-4/packages/forums/www/user-history.xql 18 Nov 2002 18:01:08 -0000 1.3 @@ -6,7 +6,7 @@ select forums_messages.message_id, forums_messages.subject, - to_char(forums_messages.posting_date, 'Mon DD YYYY HH24:MI:SS') as posting_date, + to_char(forums_messages.posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi, forums_forums.forum_id, forums_forums.name as forum_name from forums_messages, @@ -22,7 +22,7 @@ select forums_messages.message_id, forums_messages.subject, - to_char(forums_messages.posting_date, 'Mon DD YYYY HH24:MI:SS') as posting_date, + to_char(forums_messages.posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi, forums_forums.forum_id, forums_forums.name as forum_name from forums_messages, Index: openacs-4/packages/forums/www/moderate/message-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/message-delete.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/forums/www/moderate/message-delete.tcl 25 Oct 2002 13:00:04 -0000 1.6 +++ openacs-4/packages/forums/www/moderate/message-delete.tcl 18 Nov 2002 18:01:09 -0000 1.7 @@ -8,7 +8,7 @@ } { message_id:integer,notnull - {return_url ""} + {return_url "../message-view"} {confirm_p 0} } Index: openacs-4/packages/news/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/index.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/news/www/index.tcl 29 Oct 2002 08:01:14 -0000 1.6 +++ openacs-4/packages/news/www/index.tcl 18 Nov 2002 17:59:10 -0000 1.7 @@ -87,23 +87,16 @@ # use template::query to limit result to allowed number of rows. -db_multirow news_items item_list " -select item_id, - package_id, - publish_title, - publish_date -from news_items_approved -where $view_clause -and package_id = :package_id -order by publish_date desc, item_id desc" { - +db_multirow -extend { publish_date } news_items item_list {} { # this code block enables paging counter, no direct data manipulation # alternatives are: = [expr $start + $max_dspl] } break + + set publish_date [lc_time_fmt $publish_date_ansi "%x"] } Index: openacs-4/packages/news/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/index.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/news/www/index.xql 15 Oct 2001 13:41:03 -0000 1.1 +++ openacs-4/packages/news/www/index.xql 18 Nov 2002 17:59:10 -0000 1.2 @@ -8,7 +8,7 @@ select item_id, package_id, publish_title, - publish_date + to_char(news_items_approved.publish_date, 'YYYY-MM-DD HH24:MI:SS') as publish_date_ansi from news_items_approved where $view_clause and package_id = :package_id Index: openacs-4/packages/news/www/preview.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/preview.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news/www/preview.adp 29 Oct 2002 08:01:14 -0000 1.4 +++ openacs-4/packages/news/www/preview.adp 18 Nov 2002 17:59:10 -0000 1.5 @@ -6,13 +6,13 @@
  • #news.lt_Your_news_item_will_b# -
  • #news.It_will_go_live_on# @publish_date_ansi@. +
  • #news.It_will_go_live_on# @publish_date_pretty@.
  • #news.lt_And_be_live_until_rev# - #news.It_will_move_into_archive_on# @archive_date_ansi@. + #news.It_will_move_into_archive_on# @archive_date_pretty@. Index: openacs-4/packages/news/www/preview.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/preview.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/news/www/preview.tcl 29 Oct 2002 08:01:14 -0000 1.6 +++ openacs-4/packages/news/www/preview.tcl 18 Nov 2002 17:59:10 -0000 1.7 @@ -105,7 +105,10 @@ if { $news_admin_p == 1 } { set publish_date_ansi "$publish_date(year)-$publish_date(month)-$publish_date(day)" - set archive_date_ansi "$archive_date(year)-$archive_date(month)-$archive_date(day)" + set archive_date_ansi "$archive_date(year)-$archive_date(month)-$archive_date(day)" + + set publish_date_pretty [lc_time_fmt $publish_date_ansi "%x"] + set archive_date_pretty [lc_time_fmt $archive_date_ansi "%x"] if { [dt_interval_check $archive_date_ansi $publish_date_ansi] >= 0 } { ad_return_error "[_ news.Scheduling_Error]" \ Index: openacs-4/packages/news/www/admin/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/index-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/news/www/admin/index-oracle.xql 15 Oct 2001 13:41:03 -0000 1.1 +++ openacs-4/packages/news/www/admin/index-oracle.xql 18 Nov 2002 17:59:12 -0000 1.2 @@ -12,8 +12,8 @@ content_revision.get_number(news_id) as revision_no, publish_title, html_p, - publish_date, - archive_date, + to_char(to_date(publish_date, 'MM-DD-yyyy'), 'YYYY-MM-DD HH24:MI:SS') as publish_date_ansi, + to_char(to_date(archive_date, 'MM-DD-yyyy'), 'YYYY-MM-DD HH24:MI:SS') as archive_date_ansi, creation_user, item_creator, package_id, Index: openacs-4/packages/news/www/admin/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/index-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/news/www/admin/index-postgresql.xql 15 Oct 2001 13:41:03 -0000 1.1 +++ openacs-4/packages/news/www/admin/index-postgresql.xql 18 Nov 2002 17:59:12 -0000 1.2 @@ -12,8 +12,8 @@ content_revision__get_number(news_id) as revision_no, publish_title, html_p, - publish_date, - archive_date, + to_char(publish_date, 'YYYY-MM-DD HH24:MI:SS') as publish_date_ansi, + to_char(archive_date, 'YYYY-MM-DD HH24:MI:SS') as archive_date_ansi, creation_user, item_creator, package_id, Index: openacs-4/packages/news/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/index.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news/www/admin/index.tcl 7 Nov 2002 18:10:27 -0000 1.4 +++ openacs-4/packages/news/www/admin/index.tcl 18 Nov 2002 17:59:12 -0000 1.5 @@ -62,25 +62,10 @@ # administrator sees all news items -db_multirow news_items itemlist " -select - item_id, - content_item.get_best_revision(item_id) as revision_id, - content_revision.get_number(news_id) as revision_no, - publish_title, - html_p, - publish_date, - archive_date, - creation_user, - item_creator, - package_id, - status -from - news_items_live_or_submitted -where - package_id = :package_id - $view_option -order by item_id desc" +db_multirow -extend { publish_date archive_date } news_items itemlist {} { + set publish_date [lc_time_fmt $publish_date_ansi "%x"] + set archive_date [lc_time_fmt $archive_date_ansi "%x"] +} ad_return_template Index: openacs-4/packages/news/www/admin/process.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/process.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news/www/admin/process.tcl 29 Oct 2002 08:01:15 -0000 1.4 +++ openacs-4/packages/news/www/admin/process.tcl 18 Nov 2002 17:59:12 -0000 1.5 @@ -55,54 +55,20 @@ # 'archive' or 'making permanent' only after release possible if {[regexp -nocase {archive|permanent} $action ]} { - - db_multirow unapproved unapproved_list " - select - item_id, - publish_title, - creation_date, - item_creator - from - news_items_unapproved - where - item_id in ([join $bind_id_list ","])" - + db_multirow unapproved unapproved_list {} set halt_p [array size unapproved] } # proceed if no errors if { ![info exist halt_p] || $halt_p==0 } { - db_multirow news_items item_list " - select - item_id, - content_item.get_best_revision(item_id) as revision_id, - package_id, - publish_title, - creation_date, - item_creator - from - news_items_live_or_submitted - where - item_id in ([join $bind_id_list ","])" + db_multirow news_items item_list {} { + set creation_date [lc_time_fmt $creation_date "%x"] + } } set hidden_vars [export_form_vars action n_items item_id] ad_return_template - - - - - - - - - - - - - - Index: openacs-4/packages/news-portlet/www/news-portlet-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/Attic/news-portlet-oracle.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/news-portlet/www/news-portlet-oracle.xql 20 Jun 2002 22:49:57 -0000 1.5 +++ openacs-4/packages/news-portlet/www/news-portlet-oracle.xql 18 Nov 2002 17:59:27 -0000 1.6 @@ -12,7 +12,7 @@ where site_nodes.object_id = news_items_approved.package_id) as url, news_items_approved.item_id, news_items_approved.publish_title, - news_items_approved.publish_date + to_char(news_items_approved.publish_date, 'YYYY-MM-DD HH24:MI:SS') as publish_date_ansi from news_items_approved where news_items_approved.publish_date < sysdate and (news_items_approved.archive_date >= sysdate or news_items_approved.archive_date is null) Index: openacs-4/packages/news-portlet/www/news-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/Attic/news-portlet-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/news-portlet/www/news-portlet-postgresql.xql 17 Jul 2002 20:22:30 -0000 1.1 +++ openacs-4/packages/news-portlet/www/news-portlet-postgresql.xql 18 Nov 2002 17:59:27 -0000 1.2 @@ -12,7 +12,7 @@ where site_nodes.object_id = news_items_approved.package_id) as url, news_items_approved.item_id, news_items_approved.publish_title, - news_items_approved.publish_date + to_char(news_items_approved.publish_date, 'YYYY-MM-DD HH24:MI:SS') as publish_date_ansi from news_items_approved where news_items_approved.publish_date < current_timestamp and (news_items_approved.archive_date >= current_timestamp or news_items_approved.archive_date is null) Index: openacs-4/packages/news-portlet/www/news-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/news-portlet.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/news-portlet/www/news-portlet.tcl 9 Aug 2002 18:39:32 -0000 1.14 +++ openacs-4/packages/news-portlet/www/news-portlet.tcl 18 Nov 2002 17:59:27 -0000 1.15 @@ -31,4 +31,6 @@ set list_of_package_ids $config(package_id) set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0] -db_multirow news_items select_news_items {} +db_multirow -extend { publish_date } news_items select_news_items {} { + set publish_date [lc_time_fmt $publish_date_ansi "%x"] +}
@cal_item.description@
#calendar.Date_1# #calendar.and_Time#:@cal_item.pretty_short_start_date@, #calendar.from# @cal_item.start_time@ #calendar.to# @cal_item.end_time@
#calendar.Title#@cal_item.name@
@cal_item.description@
#calendar.Type#@cal_item.item_type@
#calendar.Attachments# <% 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.8 -r1.9 --- openacs-4/packages/calendar/www/cal-item-view.tcl 10 Sep 2002 22:22:31 -0000 1.8 +++ openacs-4/packages/calendar/www/cal-item-view.tcl 18 Nov 2002 18:01:11 -0000 1.9 @@ -49,7 +49,7 @@ } # cal nav -set cal_nav [dt_widget_calendar_navigation "view" day $cal_item(start_date) "calendar_id="] +set cal_nav [dt_widget_calendar_navigation -link_current_view "view" day $cal_item(start_date) "calendar_id="] ad_return_template Index: openacs-4/packages/dotlrn/www/community-member.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-member.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/community-member.tcl 12 Nov 2002 08:44:05 -0000 1.11 +++ openacs-4/packages/dotlrn/www/community-member.tcl 18 Nov 2002 17:58:53 -0000 1.12 @@ -117,7 +117,7 @@ set context_bar [ad_context_bar_ws_or_index "[_ dotlrn.Community_member]"] set system_name [ad_system_name] -set pretty_creation_date [util_AnsiDatetoPrettyDate $creation_date] +set pretty_creation_date [lc_time_fmt $creation_date "%q"] set login_export_vars "return_url=[ns_urlencode [acs_community_member_url -user_id $user_id]]" ad_return_template Index: openacs-4/packages/dotlrn/www/admin/terms.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/terms.adp,v diff -u -r1.16 -r1.17 --- openacs-4/packages/dotlrn/www/admin/terms.adp 23 Oct 2002 12:38:40 -0000 1.16 +++ openacs-4/packages/dotlrn/www/admin/terms.adp 18 Nov 2002 17:58:53 -0000 1.17 @@ -57,8 +57,8 @@
@terms.term_name@ @terms.term_year@@terms.start_date@@terms.end_date@@terms.start_date_pretty@@terms.end_date_pretty@ @terms.n_classes@
[util_AnsiDatetoPrettyDate $send_date][lc_time_fmt $send_date "%q"]$from_addr$subject[ad_decode $sent_p t Yes No]\$folder_name[ad_decode $type folder "$content_size item[ad_decode $content_size 1 {} s]" url {} "$content_size byte[ad_decode $content_size 1 {} s]"][util_AnsiDatetoPrettyDate $last_modified][lc_time_fmt $last_modified "%q"] @version.author@@version.content_size@@version.content_size_pretty@ @version.type@ @version.last_modified@ @version.description@   - @contents.content_size@ #file-storage.items##file-storage.item# + @contents.content_size_pretty@ #file-storage.items##file-storage.item# #file-storage.folder# @contents.last_modified@ + [ @@ -71,7 +71,7 @@ ] @contents.content_size@ bytes@contents.content_size_pretty@ bytes @contents.type@ @contents.last_modified@ \$folder_name[ad_decode $type folder "$content_size item[ad_decode $content_size 1 {} s]" url {} "$content_size byte[ad_decode $content_size 1 {} s]"][util_AnsiDatetoPrettyDate $last_modified][lc_time_format $last_modified "%q"] @messages.user_name@ @messages.n_messages@@messages.last_modified@@messages.last_modified_pretty@
- @forums.last_modified@ + @forums.last_modified_pretty@
@message.user_name@@message.posting_date@@message.posting_date_pretty@ @messages.forum_name@ @messages.subject@@messages.posting_date@@messages.posting_date_pretty@
@messages.subject@@messages.posting_date@@messages.posting_date_pretty@