Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-log.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-log.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-log.adp 25 Aug 2008 00:44:12 -0000 1.1 @@ -0,0 +1,12 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +@form_alter_date_html;noquote@ + + + +@rows_to_return;noquote@ +
DateToText
+ Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-log.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-log.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-log.tcl 9 Mar 2004 00:59:47 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-log.tcl 25 Aug 2008 00:44:11 -0000 1.5 @@ -1,5 +1,4 @@ # spam-log.tcl - ad_page_contract { @param use_date_range_p:optional @@ -14,54 +13,30 @@ ad_require_permission [ad_conn package_id] admin -proc spam_to_summary { mailing_list_category_id mailing_list_subcategory_id mailing_list_subsubcategory_id user_class_id product_id full_last_visit_start_date full_last_visit_end_date } { +set title "Spam Log" +set context [list [list index "Customer Service"] $title] + +set form_alter_date_html "
+[ec_report_date_range_widget $start_date(date) $end_date(date)] +[export_form_vars use_date_range_p]
" + +set start $start_date(date) +set end $end_date(date) + +set rows_to_return "" +db_foreach get_spam_people "select spam_text, mailing_list_category_id, mailing_list_subcategory_id, mailing_list_subsubcategory_id, user_class_id, product_id, to_char(last_visit_start_date,'YYYY-MM-DD HH24:MI:SS') as full_last_visit_start_date, to_char(last_visit_end_date,'YYYY-MM-DD HH24:MI:SS') as full_last_visit_end_date, to_char(spam_date,'YYYY-MM-DD HH24:MI:SS') as full_spam_date from ec_spam_log where (spam_date >= to_date('$start 00:00:00','YYYY-MM-DD HH24:MI:SS') and spam_date <= to_date('$end 23:59:59','YYYY-MM-DD HH24:MI:SS')) order by spam_date desc" { + set members_description "All users" if { ![empty_string_p $mailing_list_category_id] } { - return "Members of the [ec_full_categorization_display $mailing_list_category_id $mailing_list_subcategory_id $mailing_list_subsubcategory_id] mailing list." + set members_description "Members of the [ec_full_categorization_display $mailing_list_category_id $mailing_list_subcategory_id $mailing_list_subsubcategory_id] mailing list." } if { ![empty_string_p $user_class_id] } { - return "Members of the [db_string get_user_class_name "select user_class_name from ec_user_classes where user_class_id=:user_class_id"] user class." + set members_description "Members of the [db_string get_user_class_name "select user_class_name from ec_user_classes where user_class_id=:user_class_id"] user class." } if { ![empty_string_p $product_id] } { - return "Customers who purchased [db_string get_product_name "select product_name from ec_products where product_id=:product_id"] (product ID $product_id)." + set members_description "Customers who purchased [db_string get_product_name "select product_name from ec_products where product_id=:product_id"] (product ID $product_id)." } if { ![empty_string_p $full_last_visit_start_date] } { - return "Users whose last visit to the site was between [ec_formatted_full_date $full_last_visit_start_date] and [ec_formatted_full_date $full_last_visit_end_date]." + set members_description "Users whose last visit to the site was between [ec_formatted_full_date $full_last_visit_start_date] and [ec_formatted_full_date $full_last_visit_end_date]." } - return "All users" + append rows_to_return "[ec_formatted_full_date $full_spam_date]${members_description}[ec_display_as_html $spam_text]" } - -append doc_body "[ad_admin_header "Spam Log"] -

Spam Log

-[ad_context_bar [list "../index" "Ecommerce([ec_system_name])"] [list "index" "Customer Service Administration"] [list "spam" "Spam Users"] "Spam Log"] - -
-" - -append doc_body "
-[ec_report_date_range_widget $start_date(date) $end_date(date)] - -[export_form_vars use_date_range_p] - -
- - - -" - -set start $start_date(date) -set end $end_date(date) - -set rows_to_return "" -db_foreach get_spam_people "select spam_text, mailing_list_category_id, mailing_list_subcategory_id, mailing_list_subsubcategory_id, user_class_id, product_id, to_char(last_visit_start_date,'YYYY-MM-DD HH24:MI:SS') as full_last_visit_start_date, to_char(last_visit_end_date,'YYYY-MM-DD HH24:MI:SS') as full_last_visit_end_date, to_char(spam_date,'YYYY-MM-DD HH24:MI:SS') as full_spam_date from ec_spam_log where (spam_date >= to_date('$start 00:00:00','YYYY-MM-DD HH24:MI:SS') and spam_date <= to_date('$end 23:59:59','YYYY-MM-DD HH24:MI:SS')) order by spam_date desc" { - - append rows_to_return "" -} - -append doc_body "$rows_to_return -
DateToText
[ec_formatted_full_date $full_spam_date][spam_to_summary $mailing_list_category_id $mailing_list_subcategory_id $mailing_list_subsubcategory_id $user_class_id $product_id $full_last_visit_start_date $full_last_visit_end_date][ec_display_as_html $spam_text]
- -[ad_admin_footer] -" - - -doc_return 200 text/html $doc_body \ No newline at end of file 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam.adp 25 Aug 2008 00:34:18 -0000 1.1 @@ -0,0 +1,28 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +
+

+@report_date_range_widget_html;noquote@ +

+
+ +
    +
  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 who bought this product: +
    Product SKU:
    + Show me the users who will be spammed.
    +
  6. +
  7. Spam all users who viewed this product: +
    Product SKU:
    + Show me the users who will be spammed.
    +
  8. +
  9. Spam all users who viewed this category: @c_body@
  10. +
  11. Spam all users whose last visit was: +
    @report_date_range_widget_html;noquote@
    + Show me the users who will be spammed.
    +
  12. +
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.5 -r1.6 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam.tcl 9 Mar 2004 00:59:47 -0000 1.5 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam.tcl 25 Aug 2008 00:34:18 -0000 1.6 @@ -1,5 +1,4 @@ # spam.tcl - ad_page_contract { @author @creation-date @@ -13,116 +12,32 @@ set return_url "[ad_conn url]" set customer_service_rep [ad_get_user_id] - if {$customer_service_rep == 0} { ad_returnredirect "/register.tcl?[export_url_vars return_url]" ad_script_abort } -# this proc uses uplevel and assumes the existence of -# it sets the variables start_date and end_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 -append doc_body "[ad_admin_header "Spam Users"] -

Spam Users

+set title "Spam Users" +set context [list [list index "Customer Service"] $title] -[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] "Spam Users"] +set report_date_range_widget_html [ec_report_date_range_widget $start_date(date) $end_date(date)] -
-
-

- -[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] foreach {v name widget} [list ml_body {Mailing lists} $mailing_list_widget uc_body {User classes} $user_class_widget c_body {Category} $only_category_widget] { if {[string equal [string trim $widget] "none"]} { - set $v " -

$name: $widget - No one to spam -

- " + set $v "$name: $widget - No one to spam.\n" } else { - set $v " -

-$name: $widget
-Show me the users who will be spammed.
-

-

- -
-
-" + set $v "
+

$name: $widget
Show me the users who will be spammed.

+
\n" } } -append doc_body "
    - -
  1. Spam all users in a mailing list: - -$ml_body - -
  2. Spam all members of a user class: - -$uc_body - -

    - -

  3. Spam all users who bought this product: - -
    -Product SKU:
    -Show me the users who will be spammed.
    -

    -

    - -
    -
    - -

    - -

  4. Spam all users who viewed this product: - -
    -Product SKU:
    -Show me the users who will be spammed.
    -

    -

    - -
    -
    - -

    - -

  5. Spam all users who viewed this category: - -$c_body - -

    - -

  6. Spam all users whose last visit was: - -
    -" - -append doc_body " -[ec_report_date_range_widget $start_date(date) $end_date(date)]
    -Show me the users who will be spammed.
    -

    -

    - -
    -
    - -
- -[ad_admin_footer] -" - -doc_return 200 text/html $doc_body - +set report_date_range_widget_html [ec_report_date_range_widget $start_date(date) $end_date(date)]