Index: openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml,v
diff -u -r1.44 -r1.45
--- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 10 Sep 2008 08:51:24 -0000 1.44
+++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 13 Sep 2008 19:08:26 -0000 1.45
@@ -35,10 +35,13 @@
Error: includelet '%page_name%' unknown
Error in includelet '{{%arg%}}' of page %name%:
Event
+ End Time
End of Lecture
at
Location
+ Start Time
Start of Lecture
+ Title
Title of Lecture
Can be obtained from the name of the uploaded file
Created form
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.92 -r1.93
--- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 11 Sep 2008 15:59:31 -0000 1.92
+++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 13 Sep 2008 19:08:26 -0000 1.93
@@ -253,8 +253,9 @@
my class ::xowiki::formfield::$s
my remove_omit
if {$old_class ne [my info class]} {
- #my msg "reset class from $old_class to [my info class]"
+ #my msg "[my name]: reset class from $old_class to [my info class]"
my reset_parameter
+ my set __state reset
my initialize
}
#my msg "[my name] [self] [my info class] before searchDefaults, validator='[my validator]'"
@@ -292,6 +293,8 @@
my interprete_single_spec $s
}
+ #my msg "[my name]: after specs"
+ my set __state after_specs
my initialize
#
@@ -792,10 +795,11 @@
::xo::Page requireJS "/resources/xowiki/wymeditor/jquery.wymeditor.pack.js"
regsub -all {[.:]} [my id] {\\\\&} JID
set config [list "skin: 'default'"]
+ #my msg "wym, h [my exists height] || w [my exists width]"
if {[my exists height] || [my exists width]} {
set height_cmd ""
set width_cmd ""
- if {[my exists height]} {set height_cmd "wym_box.find(wym._options.iframeSelector).css('height','[my height]');"}
+ if {[my exists height]} {set height_cmd "jQuery(wym._box).find(wym._options.iframeSelector).css('height','[my height]');"}
if {[my exists width]} {set width_cmd "wym_box.css('width', '[my width]');"}
set postInit [subst -nocommand -nobackslash {
postInit: function(wym) {
@@ -1529,6 +1533,9 @@
MONTH {month %m 1}
YYYY {YYYY %Y 0}
}
+ #my msg "[my name] initialize date, format=[my format] components=[my components]"
+ foreach c [my components] {$c destroy}
+ my components [list]
foreach element [split [my format]] {
if {![my exists format_map($element)]} {
@@ -1549,6 +1556,7 @@
set name $class
set c [::xowiki::formfield::$class create [self]::$name \
-name [my name].$name -id [my id].$name -locale [my locale]]
+ #my msg "creating [my name].$name"
$c set_disabled [my exists disabled]
$c set code $code
$c set trim_zeros $trim_zeros
@@ -1716,18 +1724,27 @@
###########################################################
Class event -superclass CompoundField -parameter {
+ {multiday false}
}
event instproc initialize {} {
- if {[my exists __initialized]} return
+ #my msg "event initialize [my exists __initialized], multi=[my multiday] state=[my set __state]"
+ if {[my set __state] ne "after_specs"} return
my set widget_type event
- my set structure {
- {summary {richtext,required,editor=wym,height=150px,label=#xowiki.event-title_of_lecture#}}
+ if {[my multiday]} {
+ set dtend_format DD_MONTH_YYYY_#xowiki.event-hour_prefix#_HH24_MI
+ set dtend_display_format %Q_%X
+ } else {
+ set dtend_format HH24_MI
+ set dtend_display_format %X
+ }
+ my set structure [subst {
+ {summary {richtext,required,editor=wym,height=150px,label=#xowiki.event-title_of_event#}}
{dtstart {date,required,format=DD_MONTH_YYYY_#xowiki.event-hour_prefix#_HH24_MI,
- default=now,label=#xowiki.event-start_of_lecture#,display_format=%Q_%X}}
- {dtend date,format=HH24_MI,default=now,label=#xowiki.event-end_of_lecture#,display_format=%X}
+ default=now,label=#xowiki.event-start_of_event#,display_format=%Q_%X}}
+ {dtend date,format=$dtend_format,default=now,label=#xowiki.event-end_of_event#,display_format=$dtend_display_format}
{location text,label=#xowiki.event-location#}
- }
+ }]
foreach entry [my set structure] {
foreach {name spec} $entry break
#
@@ -1747,10 +1764,14 @@
}
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]"
+ if {![my multiday]} {
+ # If the event is not a multi-day-event, the end_day is not
+ # given by the dtend widget, but is taken from dtstart.
+ 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
}