Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.42 -r1.43 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 2 Dec 2007 21:38:40 -0000 1.42 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 3 Dec 2007 11:19:43 -0000 1.43 @@ -898,6 +898,7 @@ # Set the internal representation based on the components values. set value [list] foreach c [my components] { + #my msg "lappending [$c name] [$c value] " lappend value [$c name] [$c value] } #my msg "[my name]: get_compound_value returns value=$value" @@ -952,6 +953,7 @@ #my msg "DATE has value [my value]" my set widget_type date my set format [string map [list _ " "] [my format]] + my array set defaults {year 2000 month 1 day 1 hour 0 min 0 sec 0} my array set format_map { SS {SS %S 1} MI {MI %M 1} @@ -989,14 +991,21 @@ } FormField::date instproc set_compound_value {value} { - #my msg "original value '[my value]'" + #my msg "[my name] original value '[my value]' // passed='$value'" set value [::xo::db::tcl_date $value tz] #my msg "transformed value '$value'" if {$value ne ""} { set ticks [clock scan [string map [list _ " "] $value]] } else { set ticks "" } + my set defaults(year) [clock format $ticks -format %Y] + my set defaults(month) [clock format $ticks -format %m] + my set defaults(day) [clock format $ticks -format %e] + my set defaults(hour) [clock format $ticks -format %H] + my set defaults(min) [clock format $ticks -format %M] + #my set defaults(sec) [clock format $ticks -format %S] + # set the value parts for each components foreach c [my components] { if {[$c istype ::xowiki::FormField::label]} continue @@ -1029,12 +1038,9 @@ if {"$year$month$day$hour$min$sec" eq ""} { return "" } - if {$year eq ""} {set year 2000} - if {$month eq ""} {set month 1} - if {$day eq ""} {set day 1} - if {$hour eq ""} {set hour 0} - if {$min eq ""} {set min 0} - if {$sec eq ""} {set sec 0} + foreach v [list year month day hour min sec] { + if {[set $v] eq ""} {set $v [my set defaults($v)]} + } #my msg "$year-$month-$day ${hour}:${min}:${sec}" set ticks [clock scan "$year-$month-$day ${hour}:${min}:${sec}"] # TODO: TZ??? @@ -1129,6 +1135,16 @@ } } + FormField::event instproc get_compound_value {} { + set dtstart [my get_component dtstart] + set dtend [my get_component dtend] + set end_day [lindex [$dtstart value] 0] + set end_time [lindex [$dtend value] 1] + $dtend value "$end_day $end_time" + #my msg "[$dtend name] set to '$end_day $end_time' ==> $dtend, [$dtend value]" + next + } + FormField::event instproc pretty_value {v} { array set {} [my value] set dtstart [my get_component dtstart] Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.194 -r1.195 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 30 Nov 2007 12:32:21 -0000 1.194 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 3 Dec 2007 11:19:43 -0000 1.195 @@ -930,12 +930,13 @@ my update_references $item_id [lsort -unique $references] } set html [expr {$render_adp ? [my adp_subst $content] : $content}] -ns_log notice "render of '$content' gives '$html'" - append html "
\n" return $html } Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.118 -r1.119 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 2 Dec 2007 21:38:40 -0000 1.118 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 3 Dec 2007 11:19:43 -0000 1.119 @@ -538,18 +538,20 @@ # of a container to the value of the container. # foreach c [array names containers] { - switch -glob -- $c { - __* {} - _* { - set f [my lookup_form_field -name $c $form_fields] - my set [string range $c 1 end] [$f get_compound_value] - } - default { - set f [my lookup_form_field -name $c $form_fields] - set __ia($c) [$f get_compound_value] - } - } - } + switch -glob -- $c { + __* {} + _* { + set f [my lookup_form_field -name $c $form_fields] + my set [string range $c 1 end] [$f value] + } + default { + set f [my lookup_form_field -name $c $form_fields] + #my msg "compute value of $c" + set __ia($c) [$f value] + #my msg "__ia($c) is set to '[$f value]'" + } + } + } # # Run validators @@ -562,7 +564,7 @@ incr validation_errors } } - #my log "--set instance attributes to [array get __ia]" + #my msg "--set instance attributes to [array get __ia]" my set instance_attributes [array get __ia] return [list $validation_errors $category_ids] } Index: openacs-4/packages/xowiki/www/prototypes/announcement-talk.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/Attic/announcement-talk.page,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/prototypes/announcement-talk.page 3 Dec 2007 11:20:00 -0000 1.1 @@ -0,0 +1,22 @@ +# -*- tcl-*- +# $Id: announcement-talk.page,v 1.1 2007/12/03 11:20:00 gustafn Exp $ +::xowiki::Form new \ + -set name en:announcement-talk \ + -title "Talk Announcement" \ + -set creator "Gustaf Neumann" \ + -set anon_instances t \ + -set form {{} text/html} \ + -set text {@event@+
Abstract: @_text@
@detail_link@