Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.tcl 9 Mar 2004 00:59:47 -0000 1.8 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.tcl 25 Aug 2008 00:20:06 -0000 1.9 @@ -19,7 +19,6 @@ @creation-date @author ported by Jerry Asher (jerry@theashergroup.com) @author revised by Bart Teeuwisse (bart.teeuwisse@thecodemill.biz) - } { spam_id:notnull subject:trim,notnull @@ -48,25 +47,18 @@ set expires_to_insert [ec_decode $expires "" "null" $expires] # Get rid of stupid ^Ms - regsub -all "\r" $message "" message -# Doubleclick protection +set title "Spam Sent" +set context [list [list index "Customer Service"] $title] +# Doubleclick protection +set doubleclicked 0 if { [db_string get_log_entries_cnt " select count(*) from ec_spam_log where spam_id = :spam_id"] > 0 } { - - append doc_body " - [ad_admin_header "Spam Sent"] -
You are seeing this page because you probably either hit reload or pushed the Submit button twice.
-If you wonder whether the users got the spam, just check the customer service issues for one of the users (all mail sent to a user is recorded as a customer service issue).
- [ad_admin_footer]" - ad_script_abort + set doubleclicked 1 } set return_url "[ad_conn url]?[export_entire_form_as_url_vars]" @@ -93,26 +85,26 @@ set users_query [db_map users_list] } elseif { [info exists mailing_list] } { if { [llength $mailing_list] == 0 } { - set search_criteria [db_map null_categories] + set search_criteria [db_map null_categories] } elseif { [llength $mailing_list] == 1 } { - set search_criteria [db_map null_subcategory] - set mailing_list_category_id $mailing_list + set search_criteria [db_map null_subcategory] + set mailing_list_category_id $mailing_list } elseif { [llength $mailing_list] == 2 } { - set search_criteria [db_map null_subsubcategory] - set mailing_list_category_id [lindex $mailing_list 0] - set mailing_list_subcategory_id [lindex $mailing_list 1] + set search_criteria [db_map null_subsubcategory] + set mailing_list_category_id [lindex $mailing_list 0] + set mailing_list_subcategory_id [lindex $mailing_list 1] } else { - set search_criteria [db_map null_subsubcategory] - set mailing_list_category_id [lindex $mailing_list 0] - set mailing_list_subcategory_id [lindex $mailing_list 1] - set mailing_list_subsubcategory_id [lindex $mailing_list 2] + set search_criteria [db_map null_subsubcategory] + set mailing_list_category_id [lindex $mailing_list 0] + set mailing_list_subcategory_id [lindex $mailing_list 1] + set mailing_list_subsubcategory_id [lindex $mailing_list 2] } set users_query "[db_map users_email] and $search_criteria" } elseif { [info exists user_class_id] } { if { ![empty_string_p $user_class_id]} { - set users_query [db_map user_class] + set users_query [db_map user_class] } else { - set users_query [db_map all_users] + set users_query [db_map all_users] } } elseif { [info exists product_sku] } { set users_query [db_map bought_product] @@ -124,24 +116,14 @@ set users_query [db_map last_visit] } -# Have to make all variables exist that will be inserted into -# ec_spam_log - -if { ![info exists mailing_list_category_id] } { - set mailing_list_category_id "" +# Have to make all variables exist that will be inserted into ec_spam_log +set var_list [list mailing_list_category_id mailing_list_subcategory_id mailing_list_subsubcategory_id user_class_id product_id] +foreach variable $var_list { + if { ![info exists $variable] + set $variable "" + } } -if { ![info exists mailing_list_subcategory_id] } { - set mailing_list_subcategory_id "" -} -if { ![info exists mailing_list_subsubcategory_id] } { - set mailing_list_subsubcategory_id "" -} -if { ![info exists user_class_id] } { - set user_class_id "" -} -if { ![info exists product_id] } { - set product_id "" -} +# special cases if { ![info exists start] } { set start_date "" } else { @@ -154,7 +136,6 @@ } db_transaction { - db_dml insert_log_for_spam " insert into ec_spam_log (spam_id, spam_date, spam_text, mailing_list_category_id, @@ -169,51 +150,23 @@ to_date(:end_date,'YYYY-MM-DD HH24:MI:SS'))" set sql $users_query - - append doc_body " - [ad_admin_header "Spamming Users..."] -