Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.118.2.3.4.5 -r1.118.2.3.4.6 --- openacs-4/packages/dotlrn/dotlrn.info 27 Aug 2004 18:21:16 -0000 1.118.2.3.4.5 +++ openacs-4/packages/dotlrn/dotlrn.info 14 Sep 2004 15:34:25 -0000 1.118.2.3.4.6 @@ -7,14 +7,14 @@ f f - + OpenACS A Course Management System 2004-03-10 OpenACS Course Management - + Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/upgrade/upgrade-2.1.0a2-2.1.0b1.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.183.2.3.4.10 -r1.183.2.3.4.11 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 8 Aug 2004 20:17:11 -0000 1.183.2.3.4.10 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 14 Sep 2004 15:34:27 -0000 1.183.2.3.4.11 @@ -762,6 +762,9 @@ [get_toplevel_community_type_from_community_id $community_id] if {[string equal $toplevel_community_type dotlrn_class_instance]} { + if {$rel_type == "dotlrn_member_rel"} { + set rel_type "dotlrn_student_rel" + } dotlrn_class::add_user \ -rel_type $rel_type \ -community_id $community_id \ Index: openacs-4/packages/dotlrn/www/spam-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/spam-oracle.xql,v diff -u -r1.2.6.3 -r1.2.6.4 --- openacs-4/packages/dotlrn/www/spam-oracle.xql 11 Aug 2004 22:45:06 -0000 1.2.6.3 +++ openacs-4/packages/dotlrn/www/spam-oracle.xql 14 Sep 2004 15:34:27 -0000 1.2.6.4 @@ -6,8 +6,8 @@ select '$from' as from_addr, - '$sender_first_names' as sender_first_names, - '$sender_last_name' as sender_last_name, + '[db_quote $sender_first_names]' as sender_first_names, + '[db_quote $sender_last_name]' as sender_last_name, parties.email, decode(acs_objects.object_type, 'user', @@ -36,7 +36,8 @@ acs_objects where (acs_rels.object_id_one = $community_id and acs_rels.object_id_two = parties.party_id - $query_restriction + and (acs_rels.rel_type in ($rel_types_str) + or acs_rels.object_id_two in ($recipients_str)) and parties.party_id = acs_objects.object_id and parties.party_id in (select acs_rels.object_id_two from acs_rels, membership_rels Index: openacs-4/packages/dotlrn/www/spam-recipients.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam-recipients.adp,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/packages/dotlrn/www/spam-recipients.adp 30 Jul 2004 02:19:00 -0000 1.1.2.4 +++ openacs-4/packages/dotlrn/www/spam-recipients.adp 14 Sep 2004 15:34:27 -0000 1.1.2.5 @@ -28,12 +28,15 @@

-Send to the following roles:

-@rel_types_html;noquote@ + #dotlrn.Send_to_all#

+Send to the following roles:

+@rel_types_html;noquote@ +

+ In addition, send to the following people (if you have not selected "Send to Everyone" above):

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.8 -r1.21.6.9 --- openacs-4/packages/dotlrn/www/spam.tcl 26 Aug 2004 19:36:58 -0000 1.21.6.8 +++ openacs-4/packages/dotlrn/www/spam.tcl 14 Sep 2004 15:34:27 -0000 1.21.6.9 @@ -28,44 +28,44 @@ {spam_all 0} } -validate { - recipients_split { - if { [info exists recipients_str] && ![info exists recipients] } { - set recipients [split $recipients_str] - } - } + 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] - } + if { [info exists rel_types_str] && ![info exists rel_types] } { + set rel_types [split $rel_types_str] + } } - + recipients_specified { - - 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]" - } + 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]" + } } } -properties { context_bar:onevalue portal_id:onevalue } -set spam_name [bulk_mail::parameter -parameter PrettyName -default [_ dotlrn.Spam]] +set spam_name [bulk_mail::parameter -parameter PrettyName -default [_ dotlrn.Spam_]] set context_bar [list [list $referer [_ dotlrn.Admin]] "$spam_name [_ dotlrn.Community]"] if {[empty_string_p $community_id]} { @@ -159,7 +159,7 @@ set community_url "[ad_parameter -package_id [ad_acs_kernel_id] SystemURL][dotlrn_community::get_community_url $community_id]" set recipients_str [join [split $recipients_str] ,] - set rel_types_str [join [split $rel_types_str] ','] + set rel_types_str "'[join [split $rel_types_str] ',']'" # POSTGRES - change to plural @@ -171,27 +171,21 @@ if { $spam_all } { # if there is a spam_all, choose all the rel_types! + # Note - right now, all bulk_mail queiries have the same + # format and use the same base query. + # Another possibility is - set rel_types_str [join [db_list select_rel_segments " - select rel_segments.rel_type - from rel_segments - where rel_segments.group_id = :community_id"] ','] + set rel_types_str "select distinct rel_type from acs_rel_types" } if {[empty_string_p $recipients_str]} { set recipients_str '' } - if {![string equal $rel_types_str ''] && [string equal $recipients_str ''] } { - set query_restriction "and acs_rels.rel_type in ('$rel_types_str')" - } elseif {[string equal $rel_types_str ''] && ![string equal $recipients_str ''] } { - set query_restriction "and acs_rels.object_id_two in ($recipients_str)" - } elseif {![string equal $rel_types_str ''] && ![string equal $recipients_str ''] } { - set query_restriction "and (acs_rels.rel_type in ('$rel_types_str') or acs_rels.object_id_two in ($recipients_str))" - } set query [db_map sender_info] + if {$format == "html"} { set message "$message" set message_type "html"