Index: openacs-4/packages/dotlrn/www/spam.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam.tcl,v diff -u -r1.21.6.7 -r1.21.6.8 --- openacs-4/packages/dotlrn/www/spam.tcl 11 Aug 2004 22:45:06 -0000 1.21.6.7 +++ openacs-4/packages/dotlrn/www/spam.tcl 26 Aug 2004 19:36:58 -0000 1.21.6.8 @@ -27,21 +27,39 @@ {referer "control-panel"} {spam_all 0} } -validate { + + recipients_split { + if { [info exists recipients_str] && ![info exists recipients] } { + set recipients [split $recipients_str] + } + } + + rel_types_split { + if { [info exists rel_types_str] && ![info exists rel_types] } { + set rel_types [split $rel_types_str] + } + } + recipients_specified { - if { ![info exists recipients_str] && ![info exists recipients] } { - ad_complain "[_ dotlrn.Must_specify_recipients]" - } + + set recipients_p 0 + if {[info exists rel_types] && ![empty_string_p $rel_types]} { + set recipients_p 1 + } elseif {[info exists recipients] && ![empty_string_p $recipients]} { + set recipients_p 1 + } elseif {[info exists spam_all] && $spam_all != 0} { + set recipients_p 1 + } elseif { [info exists rel_types_str] && ![empty_string_p rel_types_str] } { + set recipients_p 1 + } elseif { [info exists recipients_str] && ![empty_string_p recipients_str] } { + set recipients_p 1 + } + + if { $recipients_p == 0} { + ad_complain "[_ dotlrn.Must_specify_recipients]" + } } - recipients_split { - if { [info exists recipients_str] && ![info exists recipients] } { - set recipients [split $recipients_str] - } - } - rel_types_split { - if { [info exists rel_types_str] && ![info exists rel_types] } { - set rel_types [split $rel_types_str] - } - } + } -properties { context_bar:onevalue portal_id:onevalue