Index: openacs-4/contrib/packages/events/www/admin/send-mail.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/send-mail.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/events/www/admin/send-mail.tcl 9 Mar 2003 12:08:23 -0000 1.1
+++ openacs-4/contrib/packages/events/www/admin/send-mail.tcl 13 Mar 2003 10:05:27 -0000 1.2
@@ -67,7 +67,7 @@
db_1row select_event_from_addr_count {}
db_1row select_my_email_address {}
- if {[string compare $from_addr_count "1"] == 0} {
+ if { $from_addr_count == "1" } {
element create send-bulk-mail from_addr \
-label "Send Mail From" \
@@ -85,6 +85,14 @@
-value $from_addr
}
+ # LARS:
+ # This is for passing on the initial 'group' page argument to the form processing
+ element create send-bulk-mail group -datatype text -widget hidden
+
+ if { [form is_valid send-bulk-mail] } {
+ set group [element get_value send-bulk-mail group]
+ }
+
# are we sending mail to registrants or organizers?
switch $group {
registrants {
@@ -124,8 +132,12 @@
-datatype text \
-widget submit
- if {[template::form is_valid send-bulk-mail]} {
- template::form get_values send-bulk-mail event_id return_url from_addr to subject message
+ if { [form is_request send-bulk-mail] } {
+ element set_value send-bulk-mail group $group
+ }
+
+ if {[form is_valid send-bulk-mail]} {
+ form get_values send-bulk-mail event_id return_url from_addr to subject message
set query ""
@@ -167,7 +179,7 @@
-if {[exists_and_not_null activity_id]} {
+if { [exists_and_not_null activity_id] } {
# we are sending a message to everybody involved with an activity
events::activity::get -activity_id $activity_id -array activity_info
Index: openacs-4/contrib/packages/events/www/admin/send-mail.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/send-mail.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/events/www/admin/send-mail.xql 9 Mar 2003 12:08:23 -0000 1.1
+++ openacs-4/contrib/packages/events/www/admin/send-mail.xql 13 Mar 2003 10:05:27 -0000 1.2
@@ -27,10 +27,9 @@
select count(*) as from_addr_count
- from parties pa,
- events_events ee
+ from (select contact_user_id from events_events where event_id = :event_id) ee,
+ parties pa
where ee.contact_user_id = pa.party_id
- and ee.event_id = :event_id
or pa.party_id = :user_id
@@ -39,10 +38,9 @@
select CASE WHEN ee.contact_user_id = pa.party_id AND ee.contact_user_id <> :user_id THEN pa.email || ' (the default contact for this event)'
ELSE pa.email END as from_addr, pa.email
- from parties pa,
- events_events ee
+ from (select contact_user_id from events_events where event_id = :event_id) ee,
+ parties pa
where ee.contact_user_id = pa.party_id
- and ee.event_id = :event_id
or pa.party_id = :user_id