Index: openacs-4/packages/survey/www/admin/send-mail-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/send-mail-postgresql.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/survey/www/admin/send-mail-postgresql.xql 9 Oct 2002 11:55:25 -0000 1.1.2.1 +++ openacs-4/packages/survey/www/admin/send-mail-postgresql.xql 23 Oct 2002 14:51:24 -0000 1.1.2.2 @@ -5,9 +5,9 @@ - select '$sender_email' as from_addr, - '$sender_first_names' as sender_first_names, - '$sender_last_name' as sender_last_name, + select '[db_quote $sender_email]' as from_addr, + '[db_quote $sender_first_names]' as sender_first_names, + '[db_quote $sender_last_name]' as sender_last_name, parties.email, coalesce(acs_objects.object_type, 'user', @@ -29,8 +29,8 @@ from persons where person_id = parties.party_id), '') as last_name, - '$community_name' as community_name, - '$community_url' as community_url + '[db_quote $community_name]' as community_name, + '[db_quote $community_url]' as community_url from party_approved_member_map, parties, acs_objects @@ -43,9 +43,9 @@ - select '$sender_email' as from_addr, - '$sender_first_names' as sender_first_names, - '$sender_last_name' as sender_last_name, + select '[db_quote $sender_email]' as from_addr, + '[db_quote $sender_first_names]' as sender_first_names, + '[db_quote $sender_last_name]' as sender_last_name, parties.email, coalesce(acs_objects.object_type, 'user', @@ -67,8 +67,8 @@ from persons where person_id = parties.party_id), '') as last_name, - '$community_name' as community_name, - '$community_url' as community_url + '[db_quote $community_name]' as community_name, + '[db_quote $community_url]' as community_url from party_approved_member_map, parties, acs_objects @@ -84,9 +84,9 @@ - select '$sender_email' as from_addr, - '$sender_first_names' as sender_first_names, - '$sender_last_name' as sender_last_name, + select '[db_quote $sender_email]' as from_addr, + '[db_quote $sender_first_names]' as sender_first_names, + '[db_quote $sender_last_name]' as sender_last_name, parties.email, coalesce(acs_objects.object_type, 'user', @@ -108,8 +108,8 @@ from persons where person_id = parties.party_id), '') as last_name, - '$community_name' as community_name, - '$community_url' as community_url + '[db_quote $community_name]' as community_name, + '[db_quote $community_url]' as community_url from party_approved_member_map, parties, acs_objects @@ -125,13 +125,12 @@ - select '$sender_email' as from_addr, - '$sender_first_names' as sender_first_names, - '$sender_last_name' as sender_last_name, - parties.email, + select '[db_quote $sender_email]' as from_addr, + '[db_quote $sender_first_names]' as sender_first_names, + '[db_quote $sender_last_name]' as sender_last_name, + parties.email from parties - where parties.party_id = acs_objects.object_id - and parties.party_id in ( + where parties.party_id in ( select survey_response__initial_user_id(response_id) from survey_responses_latest where survey_id=$survey_id) Index: openacs-4/packages/survey/www/admin/send-mail.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/send-mail.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/survey/www/admin/send-mail.tcl 18 Sep 2002 12:15:21 -0000 1.2 +++ openacs-4/packages/survey/www/admin/send-mail.tcl 23 Oct 2002 14:51:25 -0000 1.2.2.1 @@ -11,13 +11,12 @@ } { survey_id:integer,notnull {package_id:integer 0} - {to "all"} + {to "responded"} } set package_id [ad_conn package_id] set user_id [ad_conn user_id] set sender_id [ad_conn user_id] -set rel_type "dotlrn_member_rel" ad_require_permission $survey_id survey_admin_survey @@ -26,6 +25,7 @@ db_1row select_sender_info {} set dotlrn_installed_p [apm_package_installed_p dotlrn] if {$dotlrn_installed_p} { + set rel_type "dotlrn_member_rel" set community_id [dotlrn_community::get_community_id] set segment_id [db_string select_rel_segment_id {}] set community_name [dotlrn_community::get_community_name $community_id] @@ -70,26 +70,26 @@ } -on_submit { set query "" + +if {$dotlrn_installed_p} { switch $to { all { - if {$dotlrn_installed_p} { - set query [db_map dotlrn_all {}] + set query [db_map dotlrn_all] } - } + responded { - if {$dotlrn_installed_p} { - set query [db_map dotlrn_responded {}] - } else { - set query [db_map responded {}] + set query [db_map dotlrn_responded] } - } + not_responded { - if {$dotlrn_installed_p} { - set query [db_map dotlrn_not_responded {}] - } + set query [db_map dotlrn_not_responded] } - } + } +} else { + set query [db_map responded] +} +ns_log notice "DAVE-SURVEY: $query" bulk_mail::new \ -package_id $package_id \ -from_addr $sender_email \