Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-2.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-2.adp 25 Aug 2008 00:00:29 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-2.adp 25 Aug 2008 05:42:51 -0000 1.2 @@ -14,7 +14,7 @@ From@customer_service_email@ Subject Line Message - Gift Certificate*Amount (@currency@)     Expires @expires_html@ + Gift Certificate*Amount (@currency@)     Expires @expires_html;noquote@ Issue Type**@issue_type_widget_html;noquote@
Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam.adp 25 Aug 2008 00:34:18 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam.adp 25 Aug 2008 05:42:51 -0000 1.2 @@ -10,8 +10,8 @@
    -
  1. Spam all users in a mailing list: @ml_body@
  2. -
  3. Spam all members of a user class: @uc_body@
  4. +
  5. Spam all users in a mailing list: @ml_body;noquote@
  6. +
  7. Spam all members of a user class: @uc_body;noquote@
  8. Spam all users who bought this product:
    Product SKU:
    Show me the users who will be spammed.
    @@ -20,7 +20,7 @@ Product SKU:
    Show me the users who will be spammed.
  9. -
  10. Spam all users who viewed this category: @c_body@
  11. +
  12. Spam all users who viewed this category: @c_body;noquote@
  13. Spam all users whose last visit was:
    @report_date_range_widget_html;noquote@
    Show me the users who will be spammed.
    Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam.tcl 25 Aug 2008 00:34:18 -0000 1.6 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam.tcl 25 Aug 2008 05:42:51 -0000 1.7 @@ -5,6 +5,8 @@ @cvs-id $Id$ @author ported by Jerry Asher (jerry@theashergroup.com) } { + {start_date:date,optional} + {end_date:date,optional} } ad_require_permission [ad_conn package_id] admin @@ -16,16 +18,69 @@ ad_returnredirect "/register.tcl?[export_url_vars return_url]" ad_script_abort } +if { ![info exists start_date(date)] } { + set start_date(date) "0" + set end_date(date) "0" +} +set report_date_range_widget_html [ec_report_date_range_widget $start_date(date) $end_date(date)] + # this proc uses uplevel and assumes the existence of start_date and end_date # or sets them if they do not exist -ec_report_get_start_date_and_end_date +#ec_report_get_start_date_and_end_date +# only used here, so lets put the code here and get it working for now +# Get rid of leading zeroes in start%5fdate.day and +# end%5fdate.day because it can't interpret 08 and +# 09 (It thinks they're octal numbers) +if { [info exists "start%5fdate.day"] } { + set "start%5fdate.day" [string trimleft [set "start%5fdate.day"] "0"] + set "end%5fdate.day" [string trimleft [set "end%5fdate.day"] "0"] + ns_set update $form "start%5fdate.day" [set start%5fdate.day] + ns_set update $form "end%5fdate.day" [set end%5fdate.day] +} + +set current_year [ns_fmttime [ns_time] "%Y"] +set current_month [ns_fmttime [ns_time] "%m"] +set current_date [ns_fmttime [ns_time] "%d"] + +# If there's no time connected to the date, just the date argument to ns_dbformvalue, +# otherwise use the datetime argument +if [catch { ns_dbformvalue [ns_conn form] start_date date start_date} errmsg ] { + if { ![info exists return_date_error_p] || $return_date_error_p == "f" } { + set start_date(date) "$current_year-$current_month-01" + } else { + set start_date(date) "0" + } +} +if [catch { ns_dbformvalue [ns_conn form] end_date date end_date} errmsg ] { + if { ![info exists return_date_error_p] || $return_date_error_p == "f" } { + set end_date(date) "$current_year-$current_month-$current_date" + } else { + set end_date(date) "0" + } +} +if { [string compare $start_date(date) ""] == 0 } { + if { ![info exists return_date_error_p] || $return_date_error_p == "f" } { + set start_date(date) "$current_year-$current_month-01" + } else { + set start_date(date) "0" + } +} +if { [string compare $end_date(date) ""] == 0 } { + if { ![info exists return_date_error_p] || $return_date_error_p == "f" } { + set end_date(date) "$current_year-$current_month-$current_date" + } else { + set end_date(date) "0" + } +} + + set title "Spam Users" set context [list [list index "Customer Service"] $title] -set report_date_range_widget_html [ec_report_date_range_widget $start_date(date) $end_date(date)] + set mailing_list_widget [ec_mailing_list_widget] set user_class_widget [ec_user_class_widget] set only_category_widget [ec_only_category_widget]