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 @@ <tr><td>From</td><td>@customer_service_email@</td></tr> <tr><td>Subject Line</td><td><input type=text name=subject size=30></td></tr> <tr><td valign=top>Message</td><td><textarea wrap=hard name=message cols=50 rows=35></textarea></td></tr> - <tr><td>Gift Certificate*</td><td>Amount <input type=text name=amount size=5> (@currency@) Expires @expires_html@</td></tr> + <tr><td>Gift Certificate*</td><td>Amount <input type=text name=amount size=5> (@currency@) Expires @expires_html;noquote@</td></tr> <tr><td valign=top>Issue Type**</td><td valign=top>@issue_type_widget_html;noquote@</td></tr> </table> <br> 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 @@ </form> <ol> - <li><b>Spam all users in a mailing list:</b> @ml_body@</li> - <li><b>Spam all members of a user class:</b> @uc_body@</li> + <li><b>Spam all users in a mailing list:</b> @ml_body;noquote@</li> + <li><b>Spam all members of a user class:</b> @uc_body;noquote@</li> <li><b>Spam all users who bought this product:</b> <form method=post action=spam-2>Product SKU: <input type=text name=product_sku size=5><br> <input type=checkbox name=show_users_p value="t" checked>Show me the users who will be spammed.</br> @@ -20,7 +20,7 @@ <form method=post action=spam-2>Product SKU: <input type=text name=viewed_product_sku size=5><br> <input type=checkbox name=show_users_p value="t" checked>Show me the users who will be spammed.<br> <center><input type=submit value="Continue"></center></form></li> - <li><b>Spam all users who viewed this category:</b> @c_body@</li> + <li><b>Spam all users who viewed this category:</b> @c_body;noquote@</li> <li><b>Spam all users whose last visit was:</b> <form method=post action=spam-2>@report_date_range_widget_html;noquote@<br> <input type=checkbox name=show_users_p value="t" checked>Show me the users who will be spammed.<br> 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]