Index: openacs-4/packages/ecommerce/ecommerce.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/ecommerce.info,v diff -u -r1.13 -r1.14 --- openacs-4/packages/ecommerce/ecommerce.info 6 Jan 2002 22:53:15 -0000 1.13 +++ openacs-4/packages/ecommerce/ecommerce.info 29 Jan 2002 00:11:46 -0000 1.14 @@ -1003,6 +1003,7 @@ + Index: openacs-4/packages/ecommerce/tcl/ecommerce-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-email-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/tcl/ecommerce-email-procs.tcl 18 Jul 2001 23:46:14 -0000 1.2 +++ openacs-4/packages/ecommerce/tcl/ecommerce-email-procs.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -23,7 +23,7 @@ ns_set merge $extra_headers $additional_headers } - set from "\"[ec_system_name] Customer Service\" <$reply_to>" + set from "\"[util_memoize {ad_parameter -package_id [ec_id] CustomerServiceEmailDescription ecommerce} [ec_cache_refresh]]\" <$reply_to>" qmail $email_to $from $email_subject $email_body $extra_headers } @@ -461,7 +461,7 @@ set user_identification_id [db_string user_identification_id_select "select user_identification_id from ec_user_identification where upper(email)=upper(:email)" -default ""] if { [empty_string_p $user_identification_id] } { - set user_identification_id [db_string user_identification_id_seq "select ec_user_ident_id_sequence.nextval from dual"] + set user_identification_id [db_nextval ec_user_ident_id_sequence] set trimmed_email [string trim $email] db_dml user_identification_id_insert { Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 24 Nov 2001 03:52:22 -0000 1.6 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 29 Jan 2002 00:11:46 -0000 1.7 @@ -1517,11 +1517,12 @@ } -default ""] } -ad_proc ec_country_name_from_country_code {country_code} {Returns "United States" from an argument of $db and "us"} { - return [db_string country_name_from_country_code { - select default_name from countries where iso=:country_code - } -default ""] -} +# Duplicate of ecommerce-utilities-procs.tcl +# ad_proc ec_country_name_from_country_code {country_code} {Returns "United States" from an argument of $db and "us"} { +# return [db_string country_name_from_country_code { +# select default_name from countries where iso=:country_code +# } -default ""] +# } ################################################## ### file manager functions from acs-3.48 Index: openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-oracle.xql 22 Jul 2001 06:13:37 -0000 1.3 +++ openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-oracle.xql 29 Jan 2002 00:11:46 -0000 1.4 @@ -44,13 +44,6 @@ - - - select ec_transaction_id_sequence.nextval from dual - - - - insert into ec_financial_transactions Index: openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-postgresql.xql 21 Aug 2001 04:40:14 -0000 1.5 +++ openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.6 @@ -47,13 +47,6 @@ - - - select ec_transaction_id_sequence.nextval - - - - insert into ec_financial_transactions Index: openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs.tcl 18 Jul 2001 18:19:01 -0000 1.3 +++ openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs.tcl 29 Jan 2002 00:11:46 -0000 1.4 @@ -67,7 +67,7 @@ set total_amount [db_string total_amount_select "select ec_order_cost(:order_id) from dual"] if { $total_amount > 0 } { # create a new financial transaction - set transaction_id [db_string transaction_id_select "select ec_transaction_id_sequence.nextval from dual"] + set transaction_id [db_nextval ec_transaction_id_sequence] db_dml financial_transaction_insert "insert into ec_financial_transactions (transaction_id, order_id, transaction_amount, transaction_type, inserted_date) values Index: openacs-4/packages/ecommerce/tcl/ecommerce-utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-utilities-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/ecommerce/tcl/ecommerce-utilities-procs.tcl 23 Oct 2001 05:07:14 -0000 1.5 +++ openacs-4/packages/ecommerce/tcl/ecommerce-utilities-procs.tcl 29 Jan 2002 00:11:46 -0000 1.6 @@ -496,33 +496,33 @@ # it 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 [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 "$current_year-$current_month-01" + set start_date(date) "$current_year-$current_month-01" } else { - set start_date "0" + 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 "$current_year-$current_month-$current_date" + set end_date(date) "$current_year-$current_month-$current_date" } else { - set end_date "0" + set end_date(date) "0" } } - if { [string compare $start_date ""] == 0 } { + if { [string compare $start_date(date) ""] == 0 } { if { ![info exists return_date_error_p] || $return_date_error_p == "f" } { - set start_date "$current_year-$current_month-01" + set start_date(date) "$current_year-$current_month-01" } else { - set start_date "0" + set start_date(date) "0" } } - if { [string compare $end_date ""] == 0 } { + if { [string compare $end_date(date) ""] == 0 } { if { ![info exists return_date_error_p] || $return_date_error_p == "f" } { - set end_date "$current_year-$current_month-$current_date" + set end_date(date) "$current_year-$current_month-$current_date" } else { - set end_date "0" + set end_date(date) "0" } } } Index: openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs-oracle.xql 20 Jul 2001 21:53:59 -0000 1.3 +++ openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs-oracle.xql 29 Jan 2002 00:11:46 -0000 1.4 @@ -1,48 +1,47 @@ - oracle8.1.6 + oracle8.1.6 - - - select to_char(sysdate, 'YYYY-MM-DD') from dual - - + + + sysdate + + - - - + + + select to_char(sysdate, 'YYYY-MM-DD') from dual + + + + + select to_char(sysdate, 'HH24:MI:SS') from dual - - + + - - - - select c.category_id, c.category_name, - s.subcategory_id, s.subcategory_name, - ss.subsubcategory_id, ss.subsubcategory_name + + + select c.category_id, c.category_name, + s.subcategory_id, s.subcategory_name, + ss.subsubcategory_id, ss.subsubcategory_name from ec_categories c, ec_subcategories s, ec_subsubcategories ss - where c.category_id = s.category_id (+) - and s.subcategory_id = ss.subcategory_id (+) - order by c.sort_key, s.sort_key, ss.sort_key + where c.category_id = s.category_id (+) + and s.subcategory_id = ss.subcategory_id (+) + order by c.sort_key, s.sort_key, ss.sort_key + + - - - - - - - - select c.category_id, c.category_name, s.subcategory_id, s.subcategory_name, ss.subsubcategory_id, ss.subsubcategory_name + + + select c.category_id, c.category_name, s.subcategory_id, s.subcategory_name, ss.subsubcategory_id, ss.subsubcategory_name from ec_categories c, ec_subcategories s, ec_subsubcategories ss, ec_cat_mailing_lists m - where m.category_id=c.category_id(+) - and m.subcategory_id=s.subcategory_id(+) - and m.subsubcategory_id=ss.subsubcategory_id(+) - order by decode(c.category_id, null, 0, c.sort_key), decode(s.subcategory_id, null, 0, s.sort_key), decode(ss.subcategory_id, null, 0, ss.sort_key) - - - - - + where m.category_id=c.category_id(+) + and m.subcategory_id=s.subcategory_id(+) + and m.subsubcategory_id=ss.subsubcategory_id(+) + order by decode(c.category_id, null, 0, c.sort_key), decode(s.subcategory_id, null, 0, s.sort_key), decode(ss.subcategory_id, null, 0, ss.sort_key) + + + Index: openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs-postgresql.xql 20 Jul 2001 21:53:59 -0000 1.3 +++ openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.4 @@ -1,51 +1,50 @@ - postgresql7.1 + postgresql7.1 - - - select to_char(current_timestamp, 'YYYY-MM-DD') - - + + + current_timestamp + + - - - + + + select to_char(current_timestamp, 'YYYY-MM-DD') + + + + + select to_char(current_timestamp, 'HH24:MI:SS') - - + + - - - - - select c.category_id, c.category_name, - s.subcategory_id, s.subcategory_name, - ss.subsubcategory_id, ss.subsubcategory_name + + + select c.category_id, c.category_name, + s.subcategory_id, s.subcategory_name, + ss.subsubcategory_id, ss.subsubcategory_name from ec_categories c - LEFT JOIN ec_subcategories s using (category_id) - LEFT JOIN ec_subsubcategories ss on (s.subcategory_id = ss.subcategory_id) - order by c.sort_key, s.sort_key, ss.sort_key + LEFT JOIN ec_subcategories s using (category_id) + LEFT JOIN ec_subsubcategories ss on (s.subcategory_id = ss.subcategory_id) + order by c.sort_key, s.sort_key, ss.sort_key + + - - - - - - - - select c.category_id, c.category_name, s.subcategory_id, s.subcategory_name, ss.subsubcategory_id, ss.subsubcategory_name + + + select c.category_id, c.category_name, s.subcategory_id, s.subcategory_name, ss.subsubcategory_id, ss.subsubcategory_name from ec_cat_mailing_lists m - LEFT JOIN ec_categories c on (m.category_id=c.category_id) - LEFT JOIN ec_subcategories s on (m.subcategory_id=s.subcategory_id) - LEFT JOIN ec_subsubcategories ss on (m.subsubcategory_id=ss.subsubcategory_id) - order by - case when c.category_id is null then 0 else c.sort_key end, - case when s.subcategory_id is null then 0 else s.sort_key end, - case when ss.subcategory_id is null then 0 else ss.sort_key end - - - - + LEFT JOIN ec_categories c on (m.category_id=c.category_id) + LEFT JOIN ec_subcategories s on (m.subcategory_id=s.subcategory_id) + LEFT JOIN ec_subsubcategories ss on (m.subsubcategory_id=ss.subsubcategory_id) + order by + case when c.category_id is null then 0 else c.sort_key end, + case when s.subcategory_id is null then 0 else s.sort_key end, + case when ss.subcategory_id is null then 0 else ss.sort_key end + + + Index: openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl 23 Oct 2001 05:07:14 -0000 1.10 +++ openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl 29 Jan 2002 00:11:46 -0000 1.11 @@ -979,7 +979,8 @@ } ad_proc ec_gift_certificate_expires_widget { {default "none"} } "Gives the HTML code for the select list from which customer service can change when a consumer's gift_certificate expires." { - set option_spec_list [list [list "sysdate + 1" "in 1 day"] [list "sysdate + 2" "in 2 days"] [list "sysdate + 3" "in 3 days"] [list "sysdate + 4" "in 4 days"] [list "sysdate + 5" "in 5 days"] [list "sysdate + 6" "in 6 days"] [list "sysdate + 7" "in 1 week"] [list "sysdate + 14" "in 2 weeks"] [list "sysdate + 21" "in 3 weeks"] [list "add_months(sysdate,1)" "in 1 month"] [list "add_months(sysdate,2)" "in 2 months"] [list "add_months(sysdate,3)" "in 3 months"] [list "add_months(sysdate,4)" "in 4 months"] [list "add_months(sysdate,5)" "in 5 months"] [list "add_months(sysdate,6)" "in 6 months"] [list "add_months(sysdate,7)" "in 7 months"] [list "add_months(sysdate,8)" "in 8 months"] [list "add_months(sysdate,9)" "in 9 months"] [list "add_months(sysdate,10)" "in 10 months"] [list "add_months(sysdate,11)" "in 11 months"] [list "add_months(sysdate,12)" "in 1 year"] [list "add_months(sysdate,24)" "in 2 years"] ] + set now [db_map now] + set option_spec_list [list [list "$now + 1" "in 1 day"] [list "$now + 2" "in 2 days"] [list "$now + 3" "in 3 days"] [list "$now + 4" "in 4 days"] [list "$now + 5" "in 5 days"] [list "$now + 6" "in 6 days"] [list "$now + 7" "in 1 week"] [list "$now + 14" "in 2 weeks"] [list "$now + 21" "in 3 weeks"] [list "add_months($now,1)" "in 1 month"] [list "add_months($now,2)" "in 2 months"] [list "add_months($now,3)" "in 3 months"] [list "add_months($now,4)" "in 4 months"] [list "add_months($now,5)" "in 5 months"] [list "add_months($now,6)" "in 6 months"] [list "add_months($now,7)" "in 7 months"] [list "add_months($now,8)" "in 8 months"] [list "add_months($now,9)" "in 9 months"] [list "add_months($now,10)" "in 10 months"] [list "add_months($now,11)" "in 11 months"] [list "add_months($now,12)" "in 1 year"] [list "add_months($now,24)" "in 2 years"] ] set name_of_select "expires" Index: openacs-4/packages/ecommerce/www/credit-card-correction-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/credit-card-correction-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/credit-card-correction-2.tcl 20 Apr 2001 20:51:13 -0000 1.1 +++ openacs-4/packages/ecommerce/www/credit-card-correction-2.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -119,7 +119,7 @@ # done with all the checks! # do some inserts -set creditcard_id [db_string set_creditcard_id_from_seq "select ec_creditcard_id_sequence.nextval from dual"] +set creditcard_id [db_nextval ec_creditcard_id_sequence] db_transaction { set cc_fmt "[string range $creditcard_number [expr [string length $creditcard_number] -4] [expr [string length $creditcard_number] -1]]" Index: openacs-4/packages/ecommerce/www/gift-certificate-finalize-order-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/gift-certificate-finalize-order-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/gift-certificate-finalize-order-oracle.xql 10 Jul 2001 20:42:02 -0000 1.1 +++ openacs-4/packages/ecommerce/www/gift-certificate-finalize-order-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -14,13 +14,6 @@ - - - select ec_creditcard_id_sequence.nextval from dual - - - - insert into ec_gift_certificates @@ -32,13 +25,6 @@ - - - select ec_transaction_id_sequence.nextval from dual - - - - insert into ec_financial_transactions @@ -64,13 +50,6 @@ - - - select ec_gift_cert_id_sequence.nextval from dual - - - - select round((sysdate-issue_date)*86400) as n_seconds from ec_gift_certificates where gift_certificate_id = :gift_certificate_id Index: openacs-4/packages/ecommerce/www/gift-certificate-finalize-order-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/gift-certificate-finalize-order-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/gift-certificate-finalize-order-postgresql.xql 20 Aug 2001 06:31:31 -0000 1.2 +++ openacs-4/packages/ecommerce/www/gift-certificate-finalize-order-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.3 @@ -26,14 +26,6 @@ - - - - select ec_creditcard_id_sequence.nextval - - - - insert into ec_gift_certificates @@ -44,14 +36,7 @@ - - - - select ec_transaction_id_sequence.nextval - - - insert into ec_financial_transactions @@ -77,13 +62,6 @@ - - - select ec_gift_cert_id_sequence.nextval - - - - select extract(day from (current_timestamp-issue_date))*86400 + Index: openacs-4/packages/ecommerce/www/gift-certificate-finalize-order.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/gift-certificate-finalize-order.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/gift-certificate-finalize-order.tcl 20 Apr 2001 20:51:13 -0000 1.1 +++ openacs-4/packages/ecommerce/www/gift-certificate-finalize-order.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,23 +1,23 @@ # www/ecommerce/gift-certificate-finalize-order.tcl ad_page_contract { - this script will: - (1) put this order into the 'confirmed' state - (2) try to authorize the user's credit card info and either - (a) redirect them to a thank you page, or - (b) redirect them to a "please fix your credit card info" page - If they reload, we don't have to worry about the credit card - authorization code being executed twice because the order has - already been moved to the 'confirmed' state, which means that - they will be redirected out of this page. - We will redirect them to the thank you page which displays the - order with the most recent confirmation date. - The only potential problem is that maybe the first time the - order got to this page it was confirmed but then execution of - the page stopped before authorization of the order could occur. - This problem is solved by the scheduled procedure, - ec_query_for_cybercash_zombies, which will try to authorize - any 'confirmed' orders over half an hour old. + this script will: + (1) put this order into the 'confirmed' state + (2) try to authorize the user's credit card info and either + (a) redirect them to a thank you page, or + (b) redirect them to a "please fix your credit card info" page + If they reload, we don't have to worry about the credit card + authorization code being executed twice because the order has + already been moved to the 'confirmed' state, which means that + they will be redirected out of this page. + We will redirect them to the thank you page which displays the + order with the most recent confirmation date. + The only potential problem is that maybe the first time the + order got to this page it was confirmed but then execution of + the page stopped before authorization of the order could occur. + This problem is solved by the scheduled procedure, + ec_query_for_cybercash_zombies, which will try to authorize + any 'confirmed' orders over half an hour old. @param gift_certificate_id @param certificate_to @@ -167,56 +167,55 @@ # try to auth transaction db_transaction { - - set creditcard_id [db_string get_cc_id "select ec_creditcard_id_sequence.nextval from dual"] + + set creditcard_id [db_nextval ec_creditcard_id_sequence] + set ccstuff_1 "[string range $creditcard_number [expr [string length $creditcard_number] -4] [expr [string length $creditcard_number] -1]]" + set expiry "$creditcard_expire_1/$creditcard_expire_2" - set ccstuff_1 "[string range $creditcard_number [expr [string length $creditcard_number] -4] [expr [string length $creditcard_number] -1]]" - set expiry "$creditcard_expire_1/$creditcard_expire_2" - -db_dml get_ec_credit_card "insert into ec_creditcards + db_dml get_ec_credit_card "insert into ec_creditcards (creditcard_id, user_id, creditcard_number, creditcard_last_four, creditcard_type, creditcard_expire, billing_zip_code) values (:creditcard_id, :user_id, :creditcard_number, :ccstuff_1, :creditcard_type,:expiry,:billing_zip_code) " - - # claim check is generated as follows: - # 1. username of recipient (part of email address up to the @ symbol) up to 10 characters - # 2. 10 character random string - # 3. gift_certificate_id - # all separated by dashes - - # The username is added as protection in case someone cracks the random number algorithm. - # The gift_certificate_id is added as a guarantee of uniqueness. + + # claim check is generated as follows: + # 1. username of recipient (part of email address up to the @ symbol) up to 10 characters + # 2. 10 character random string + # 3. gift_certificate_id + # all separated by dashes + + # The username is added as protection in case someone cracks the random number algorithm. + # The gift_certificate_id is added as a guarantee of uniqueness. - # philg_email_valid_p ensures that there will be an @ sign, thus a username will be set - regexp {(.+)@} $recipient_email match username + # philg_email_valid_p ensures that there will be an @ sign, thus a username will be set + regexp {(.+)@} $recipient_email match username - if { [string length $username] > 10 } { - set username [string range $username 0 9] - } + if { [string length $username] > 10 } { + set username [string range $username 0 9] + } - set random_string [ec_generate_random_string 10] + set random_string [ec_generate_random_string 10] - set claim_check "$username-$random_string-$gift_certificate_id" + set claim_check "$username-$random_string-$gift_certificate_id" - set peeraddr [ns_conn peeraddr] - set gc_months [util_memoize {ad_parameter -package_id [ec_id] GiftCertificateMonths ecommerce} [ec_cache_refresh]] - db_dml insert_new_gc_into_db "insert into ec_gift_certificates + set peeraddr [ns_conn peeraddr] + set gc_months [util_memoize {ad_parameter -package_id [ec_id] GiftCertificateMonths ecommerce} [ec_cache_refresh]] + db_dml insert_new_gc_into_db "insert into ec_gift_certificates (gift_certificate_id, gift_certificate_state, amount, issue_date, purchased_by, expires, claim_check, certificate_message, certificate_to, certificate_from, recipient_email, last_modified, last_modifying_user, modified_ip_address) values (:gift_certificate_id, 'confirmed', :amount, sysdate, :user_id, add_months(sysdate,:gc_months),:claim_check, :certificate_message, :certificate_to, :certificate_from, :recipient_email, sysdate, :user_id, :peeraddr) " - - set transaction_id [db_string get_transaction_id "select ec_transaction_id_sequence.nextval from dual"] - - db_dml insert_ec_financial_trans "insert into ec_financial_transactions + + set transaction_id [db_nextval ec_transaction_id_sequence] + + db_dml insert_ec_financial_trans "insert into ec_financial_transactions (transaction_id, gift_certificate_id, creditcard_id, transaction_amount, transaction_type, inserted_date) values (:transaction_id, :gift_certificate_id, :creditcard_id, :amount, 'charge', sysdate) " - + } # try to authorize the transaction @@ -311,8 +310,8 @@ } # give them a gift_certificate_id and a new form - set gift_certificate_id [db_string get_cert_id_seq "select ec_gift_cert_id_sequence.nextval from dual"] - + set gift_certificate_id [db_nextval ec_gift_cert_id_sequence] + set page_html "[ad_header "Credit Card Correction Needed"] [ec_header_image]
@@ -364,16 +363,16 @@ " } elseif { $cybercash_status == "unknown-reload" } { set n_seconds [db_string get_n_seconds "select round((sysdate-issue_date)*86400) as n_seconds from ec_gift_certificates where gift_certificate_id = :gift_certificate_id"] - + set page_html "[ad_header "Gift Certificate Order Already Processed"] You've probably hit submit twice from the same form. We are already in possession of a gift certificate order with id # $gift_certificate_id (placed $n_seconds seconds ago) and it is being processed. You can check on the status of this gift certificate order if you like. - [ec_footer] - " +[ec_footer] +" } Index: openacs-4/packages/ecommerce/www/gift-certificate-order-4.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/gift-certificate-order-4.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/gift-certificate-order-4.tcl 20 Apr 2001 20:51:13 -0000 1.1 +++ openacs-4/packages/ecommerce/www/gift-certificate-order-4.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -106,7 +106,7 @@ -set gift_certificate_id [db_string get_gc_id "select ec_gift_cert_id_sequence.nextval from dual"] +set gift_certificate_id [db_nextval ec_gift_cert_id_sequence] set user_email [db_string get_email_for_user "select email from cc_users where user_id=:user_id"] set hidden_form_variables [export_form_vars certificate_to certificate_from certificate_message amount recipient_email creditcard_number creditcard_type creditcard_expire_1 creditcard_expire_2 billing_zip_code gift_certificate_id] Index: openacs-4/packages/ecommerce/www/process-payment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/process-payment.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/process-payment.tcl 20 Apr 2001 20:51:13 -0000 1.1 +++ openacs-4/packages/ecommerce/www/process-payment.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -210,7 +210,7 @@ db_dml use_existing_cc_for_order "update ec_orders set creditcard_id=:creditcard_id where order_id=:order_id" } else { # using new credit card - set creditcard_id [db_string get_id_for_new_cc "select ec_creditcard_id_sequence.nextval from dual"] + set creditcard_id [db_nextval ec_creditcard_id_sequence] set cc_no [string range $creditcard_number [expr [string length $creditcard_number] -4] [expr [string length $creditcard_number] -1]] set expiry "$creditcard_expire_1/$creditcard_expire_2" db_dml insert_new_cc "insert into ec_creditcards Index: openacs-4/packages/ecommerce/www/shipping-address-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/Attic/shipping-address-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/shipping-address-2.tcl 22 Oct 2001 07:38:06 -0000 1.2 +++ openacs-4/packages/ecommerce/www/shipping-address-2.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -68,7 +68,7 @@ return } -set address_id [db_string get_new_address_id_from_seq "select ec_address_id_sequence.nextval from dual"] +set address_id [db_nextval ec_address_id_sequence] db_transaction { Index: openacs-4/packages/ecommerce/www/shipping-address-international-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/Attic/shipping-address-international-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/shipping-address-international-2.tcl 20 Apr 2001 20:51:13 -0000 1.1 +++ openacs-4/packages/ecommerce/www/shipping-address-international-2.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -70,7 +70,7 @@ return } -set address_id [db_string get_address_id_from_seq "select ec_address_id_sequence.nextval from dual"] +set address_id [db_nextval ec_address_id_sequence] db_transaction { Index: openacs-4/packages/ecommerce/www/shopping-cart-add-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/shopping-cart-add-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/shopping-cart-add-oracle.xql 10 Jul 2001 20:42:02 -0000 1.1 +++ openacs-4/packages/ecommerce/www/shopping-cart-add-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -3,13 +3,6 @@ oracle8.1.6 - - - select ec_order_id_sequence.nextval from dual - - - - insert into ec_orders Index: openacs-4/packages/ecommerce/www/shopping-cart-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/shopping-cart-add-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/shopping-cart-add-postgresql.xql 10 Jul 2001 20:42:02 -0000 1.1 +++ openacs-4/packages/ecommerce/www/shopping-cart-add-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -2,13 +2,6 @@ postgresql7.1 - - - - select ec_order_id_sequence.nextval - - - Index: openacs-4/packages/ecommerce/www/shopping-cart-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/shopping-cart-add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/shopping-cart-add.tcl 20 Apr 2001 20:51:13 -0000 1.1 +++ openacs-4/packages/ecommerce/www/shopping-cart-add.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -72,7 +72,7 @@ # string (if it is, log the error and redirect them to product.tcl). if { [empty_string_p $order_id] } { - set order_id [db_string get_new_ec_order_id "select ec_order_id_sequence.nextval from dual"] + set order_id [db_nextval ec_order_id_sequence] # create the order (iff an in_basket order *still* doesn't exist) db_dml insert_new_ec_order "insert into ec_orders (order_id, user_session_id, order_state, in_basket_date) Index: openacs-4/packages/ecommerce/www/admin/cat/category-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/cat/category-add.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/cat/category-add.tcl 17 Jul 2001 23:59:03 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/cat/category-add.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -51,7 +51,7 @@
" -set category_id [db_string get_new_category_id "select ec_category_id_sequence.nextval from dual"] +set category_id [db_nextval ec_category_id_sequence] append page_html "
[export_form_vars category_name category_id prev_sort_key next_sort_key] Index: openacs-4/packages/ecommerce/www/admin/cat/subcategory-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/cat/subcategory-add.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/cat/subcategory-add.tcl 17 Jul 2001 23:59:03 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/cat/subcategory-add.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -61,7 +61,7 @@ " -set subcategory_id [db_string get_subcat_id_seq "select ec_subcategory_id_sequence.nextval from dual"] +set subcategory_id [db_nextval ec_subcategory_id_sequence] append page_html " [export_form_vars category_name category_id subcategory_name subcategory_id prev_sort_key next_sort_key] Index: openacs-4/packages/ecommerce/www/admin/cat/subsubcategory-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/cat/subsubcategory-add.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/cat/subsubcategory-add.tcl 18 Jul 2001 02:52:45 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/cat/subsubcategory-add.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -65,7 +65,7 @@ " -set subsubcategory_id [db_string get_new_subsub_id "select ec_subsubcategory_id_sequence.nextval from dual"] +set subsubcategory_id [db_nextval ec_subsubcategory_id_sequence] append page_html " [export_form_vars category_name category_id subcategory_name subcategory_id subsubcategory_name subsubcategory_id prev_sort_key next_sort_key] Index: openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2-oracle.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -2,13 +2,6 @@ oracle8.1.6 - - - - select ec_interaction_id_sequence.nextval from dual - - - Index: openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2-postgresql.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -3,13 +3,6 @@ postgresql7.1 - - - select ec_interaction_id_sequence.nextval - - - - insert into ec_customer_serv_interactions Index: openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/email-send-2.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -65,9 +65,9 @@ db_transaction { -set interaction_id [db_string get_new_csa_seq_id "select ec_interaction_id_sequence.nextval from dual"] + set interaction_id [db_nextval ec_interaction_id_sequence] -db_dml insert_new_cs_interaction "insert into ec_customer_serv_interactions + db_dml insert_new_cs_interaction "insert into ec_customer_serv_interactions (interaction_id, customer_service_rep, user_identification_id, interaction_date, interaction_originator, interaction_type) values (:interaction_id, :customer_service_rep, :user_identification_id, sysdate, 'rep', 'email') Index: openacs-4/packages/ecommerce/www/admin/customer-service/email-send.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/email-send.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/customer-service/email-send.tcl 26 Aug 2001 23:38:30 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/customer-service/email-send.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -64,7 +64,7 @@ # generate action_id here for double-click protection -set action_id [db_string get_new_action_id "select ec_action_id_sequence.nextval from dual"] +set action_id [db_nextval ec_action_id_sequence] append doc_body "If you are not [db_string get_full_name "select first_names || ' ' || last_name from cc_users where user_id=:customer_service_rep"], please log in Index: openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2-oracle.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -8,13 +8,5 @@ select to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') from dual - - - - select ec_action_id_sequence.nextval from dual - - - - Index: openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2-postgresql.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -8,13 +8,5 @@ select to_char(current_timestamp, 'YYYY-MM-DD HH24:MI:SS') - - - - select ec_action_id_sequence.nextval - - - - Index: openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -109,7 +109,7 @@ # exist) so that I can use the fact of its existence or lack of existence # to create this page's UI -set action_id [db_string get_interaction_id "select ec_action_id_sequence.nextval from dual"] +set action_id [db_nextval ec_action_id_sequence] Index: openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3-oracle.xql 26 Aug 2001 23:03:42 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3-oracle.xql 29 Jan 2002 00:11:46 -0000 1.3 @@ -9,28 +9,7 @@ - - - - select ec_interaction_id_sequence.nextval from dual - - - - - - select ec_interaction_id_sequence.nextval from dual - - - - - - - select ec_user_ident_id_sequence.nextval from dual - - - - @@ -44,7 +23,8 @@ null - + + Index: openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3-postgresql.xql 26 Aug 2001 23:03:42 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.3 @@ -10,27 +10,6 @@ - - - select ec_interaction_id_sequence.nextval - - - - - - - select ec_interaction_id_sequence.nextval - - - - - - - select ec_user_ident_id_sequence.nextval - - - - Index: openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3.tcl 26 Aug 2001 23:03:42 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-3.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -328,12 +328,12 @@ # interaction_id will either be a number or it will not exist if { ![info exists interaction_id] } { - set interaction_id [db_string get_new_interaction_id "select ec_interaction_id_sequence.nextval from dual"] + set interaction_id [db_nextval ec_interaction_id_sequence] } # issue_id will either be a number or it will be the empty string if { [empty_string_p $issue_id] } { - set issue_id [db_string get_new_interaction_id "select ec_issue_id_sequence.nextval from dual"] + set issue_id [db_nextval ec_issue_id_sequence] set create_new_issue_p "t" } else { set create_new_issue_p "f" @@ -357,7 +357,7 @@ set user_id_to_insert $d_user_id } - set uiid_to_insert [db_string get_uiid_to_insert_from_seq "select ec_user_ident_id_sequence.nextval from dual"] + set uiid_to_insert [db_nextval ec_user_ident_id_sequence] db_dml insert_new_uiid "insert into ec_user_identification (user_identification_id, user_id, email, first_names, last_name, postal_code, other_id_info) values Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -17,16 +17,19 @@ ad_require_permission [ad_conn package_id] admin -db_transaction { +# Another hack to make this crap code work. The foreach below loops only over +# the list of issue type already assigned to the issue. Hence, to make this work +# the new list is concatenated to the old list. +set issue_type_list [concat $issue_type_list $issue_type] -db_dml delete_from_issue_type_map "delete from ec_cs_issue_type_map where issue_id=:issue_id" - -foreach issue_type $issue_type_list { - db_dml insert_into_type_map "insert into ec_cs_issue_type_map (issue_id, issue_type) values (:issue_id,:issue_type)" +db_transaction { + db_dml delete_from_issue_type_map "delete from ec_cs_issue_type_map where issue_id=:issue_id" + foreach issue_type $issue_type_list { + if {$issue_type != "" } { + db_dml insert_into_type_map "insert into ec_cs_issue_type_map (issue_id, issue_type) values (:issue_id,:issue_type)" + } + } } - -} - db_release_unused_handles ad_returnredirect "issue?[export_url_vars issue_id]" \ No newline at end of file Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,18 +1,16 @@ - - + + delete from ec_cs_issue_type_map where issue_id=:issue_id - - - - - - + + + + + insert into ec_cs_issue_type_map (issue_id, issue_type) values (:issue_id,:issue_type) - - - - + + + Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -22,8 +22,6 @@ return } - - set page_title "Edit Issue #$issue_id" append doc_body "[ad_admin_header $page_title]

$page_title

@@ -33,7 +31,6 @@
" - set issue_type_list [db_list get_issue_types "select issue_type from ec_cs_issue_type_map where issue_id=:issue_id"] append doc_body " @@ -60,5 +57,4 @@ [ad_admin_footer] " - doc_return 200 text/html $doc_body Index: openacs-4/packages/ecommerce/www/admin/customer-service/picklist-item-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/picklist-item-add.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/customer-service/picklist-item-add.tcl 27 Aug 2001 00:06:28 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/customer-service/picklist-item-add.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -48,7 +48,7 @@
" -set picklist_item_id [db_string get_item_id_from_seq "select ec_picklist_item_id_sequence.nextval from dual"] +set picklist_item_id [db_nextval ec_picklist_item_id_sequence] append doc_body "
    Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-2-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-2-oracle.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-2-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,16 +1,24 @@ - - - - oracle8.1.6 - - - - -select ec_spam_id_sequence.nextval - from dual - - - - - - + + + + oracle8.1.6 + + + + select unique u.user_id, first_names, last_name from cc_users u, ec_items i, ec_orders o, ec_products p where i.order_id=o.order_id and o.user_id=u.user_id and i.product_id = p.product_id and p.sku=:product_sku + + + + + + select unique u.user_id, first_names, last_name from cc_users u, ec_user_session_info ui, ec_user_sessions us, ec_products p where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.product_id = p.product_id and p.sku=:viewed_product_sku + + + + + + select unique u.user_id, first_names, last_name from cc_users u, ec_user_session_info ui, ec_user_sessions us where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.category_id=:category_id + + + + \ No newline at end of file Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-2-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-2-postgresql.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-2-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,16 +1,30 @@ - - - - postgresql7.1 - - - - -select ec_spam_id_sequence.nextval - - - - - - - + + + + postgresql7.1 + + + + select distinct u.user_id, first_names, last_name + from cc_users u, ec_items i, ec_orders o, ec_products p + where i.order_id=o.order_id and o.user_id=u.user_id and i.product_id = p.product_id and p.sku=:product_sku + + + + + + select distinct u.user_id, first_names, last_name + from cc_users u, ec_user_session_info ui, ec_user_sessions us, ec_products p + where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.product_id = p.product_id and p.sku=:viewed_product_sku + + + + + + select distinct u.user_id, first_names, last_name + from cc_users u, ec_user_session_info ui, ec_user_sessions us + where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.category_id=:category_id + + + + \ No newline at end of file Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-2.tcl 26 Aug 2001 23:38:30 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-2.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -3,11 +3,11 @@ ad_page_contract { @param mailing_list:optional @param user_class_id:optional - @param product_id:optional + @param product_sku:optional @param user_id_list:optional @param category_id:optional - @param viewed_product_id:optional + @param viewed_product_sku:optional @param show_users_p:optional @@ -18,17 +18,15 @@ } { mailing_list:optional user_class_id:optional - product_id:optional + product_sku:optional user_id_list:optional category_id:optional - viewed_product_id:optional + viewed_product_sku:optional show_users_p:optional start_date:array,date,optional end_date:array,date,optional } -ns_set print [ns_getform] - ad_require_permission [ad_conn package_id] admin set return_url "[ad_conn url]?[export_entire_form_as_url_vars]" @@ -40,11 +38,6 @@ return } -if { [info exists start_date] && [info exists end_date] } { - set start_date $start_date(date) - set end_date $end_date(date) -} - append doc_body "[ad_admin_header "Spam Users, Cont."]

    Spam Users, Cont.

    @@ -53,89 +46,59 @@
    " -ns_log debug spam-2 0 - if { [info exists show_users_p] && $show_users_p == "t" } { -ns_log debug spam-2 1 if { [info exists user_id_list] } { - ns_log debug spam-2 a - set sql " - select user_id, first_names, last_name - from cc_users - where user_id in ([join $user_id_list ", "])" + set sql [db_map mailing_list] + # select user_id, first_names, last_name from cc_users where user_id in ([join $user_id_list ", "]) } elseif { [info exists mailing_list] } { - ns_log debug spam-2 b if { [llength $mailing_list] == 0 } { - set search_criteria "(category_id is null and subcategory_id is null and subsubcategory_id is null)" + set search_criteria [db_map null_categories] + # (category_id is null and subcategory_id is null and subsubcategory_id is null) } elseif { [llength $mailing_list] == 1 } { - set search_criteria "(category_id=$mailing_list and subcategory_id is null)" + set search_criteria [db_map null_subcategory] + # (category_id=$mailing_list and subcategory_id is null) } elseif { [llength $mailing_list] == 2 } { - set search_criteria "(subcategory_id=[lindex $mailing_list 1] and subsubcategory_id is null)" + set search_criteria [db_map null_subsubcategory] + # (subcategory_id=[lindex $mailing_list 1] and subsubcategory_id is null) } else { - set search_criteria "subsubcategory_id=[lindex $mailing_list 2]" + set search_criteria [db_map subsubcategory] + # subsubcategory_id=[lindex $mailing_list 2] } - - set sql " - select users.user_id, first_names, last_name - from cc_users, ec_cat_mailing_lists - where users.user_id=ec_cat_mailing_lists.user_id - and $search_criteria" + set sql "[db_map null_categories] and $search_criteria" + # select users.user_id, first_names, last_name from cc_users, ec_cat_mailing_lists where users.user_id=ec_cat_mailing_lists.user_id } elseif { [info exists user_class_id] } { - ns_log debug spam-2 c if { ![empty_string_p $user_class_id]} { - set sql_query " - select users.user_id, first_names, last_name - from cc_users, ec_user_class_user_map m - where m.user_class_id=:user_class_id - and m.user_id=users.user_id" + set sql [db_map user_class] + # select users.user_id, first_names, last_name from cc_users, ec_user_class_user_map m where m.user_class_id=:user_class_id and m.user_id=users.user_id } else { - set sql_query " - select user_id, first_names, last_name - from cc_users" + set sql [db_map all_users] + # select user_id, first_names, last_name from cc_users } - - set sql $sql_query - } elseif { [info exists product_id] } { - ns_log debug spam-2 d - set sql " - select unique cc_users.user_id, first_names, last_name - from cc_users, ec_items, ec_orders - where ec_items.order_id=ec_orders.order_id - and ec_orders.user_id=ccusers.user_id - and ec_items.product_id=:product_id" - } elseif { [info exists viewed_product_id] } { - ns_log debug spam-2 e - set sql " - select unique u.user_id, first_names, last_name - from cc_users u, ec_user_session_info ui, ec_user_sessions us - where us.user_session_id=ui.user_session_id - and us.user_id=u.user_id - and ui.product_id=:viewed_product_id" + } elseif { [info exists product_sku] } { + set sql [db_map bought_product] + # select unique cc_users.user_id, first_names, last_name from cc_users, ec_items, ec_orders where ec_items.order_id=ec_orders.order_id and ec_orders.user_id=ccusers.user_id and ec_items.sku=:product_sku + } elseif { [info exists viewed_product_sku] } { + set sql [db_map viewed_product] + # select unique u.user_id, first_names, last_name from cc_users u, ec_user_session_info ui, ec_user_sessions us where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.sku=:viewed_product_sku } elseif { [info exists category_id] } { - ns_log debug spam-2 f - set sql " - select unique u.user_id, first_names, last_name - from cc_users u, ec_user_session_info ui, ec_user_sessions us - where us.user_session_id=ui.user_session_id - and us.user_id=u.user_id - and ui.category_id=:category_id" + set sql [db_map viewed_category] + # select unique u.user_id, first_names, last_name from cc_users u, ec_user_session_info ui, ec_user_sessions us where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.category_id=:category_id } elseif { [info exists start_date] } { - ns_log debug spam-2 g - set sql " - select user_id, first_names, last_name - from cc_users - where last_visit >= to_date(:start_date,'YYYY-MM-DD HH24:MI:SS') - and last_visit <= to_date(:end_date,'YYYY-MM-DD HH24:MI:SS')" + set start $start_date(date) + set end $end_date(date) + set sql [db_map last_visit] + # select user_id, first_names, last_name from cc_users where last_visit >= to_date(:start,'YYYY-MM-DD HH24:MI:SS') and last_visit <= to_date(:end,'YYYY-MM-DD HH24:MI:SS') } else { + set start "" + set end "" ad_return_complaint 1 "
  • I could not determine who you wanted to spam. Please go back and make a selection." return } append doc_body "The following users will be spammed:
      " - ns_log debug spam-2 h [info exists sql] db_foreach get_users_for_spam $sql { @@ -144,10 +107,7 @@ append doc_body "
    " } -set spam_id [db_string get_spam_id_seq_nextval " -select ec_spam_id_sequence.nextval - from dual -"] +set spam_id [db_nextval ec_spam_id_sequence] # will export start_date and end_date separately so that they don't have to be re-put-together # in spam-3.tcl @@ -156,7 +116,7 @@ [ec_hidden_input var_to_spellcheck "message"] [ec_hidden_input target_url "[ec_url_concat [ec_url] /admin]/customer-service/spam-3.tcl"] [export_entire_form] -[export_form_vars spam_id start_date end_date] +[export_form_vars spam_id start end] @@ -183,7 +143,4 @@ [ad_admin_footer] " -doc_return 200 text/html $doc_body - - - +doc_return 200 text/html $doc_body \ No newline at end of file Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-3-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-3-oracle.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-3-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,24 +1,61 @@ - oracle8.1.6 + oracle8.1.6 - - - - insert into ec_gift_certificates - (gift_certificate_id, user_id, amount, - expires, - issue_date, issued_by, gift_certificate_state, - last_modified, last_modifying_user, modified_ip_address) - values - (ec_gift_cert_id_sequence.nextval, :user_id, :amount, - $expires_to_insert, - sysdate, :customer_service_rep, 'authorized', - sysdate, :customer_service_rep, '[ns_conn peeraddr]') - - - + + + select unique u.user_id as user_id, first_names, last_name, email + from cc_users u, ec_items 1, ec_orders o, ec_products p + where i.order_id=o.order_id and o.user_id=u.user_id and i_items.product_id=p.product_id and p.sku=:product_sku + + - + + + select unique u.user_id as user_id, first_names, last_name, email + from cc_users u, ec_user_session_info ui, ec_user_sessions us, ec_products p + where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.product_id=p.product_ud and p.sku=:viewed_product_sku + + + + + + select unique u.user_id as user_id, first_names, last_name, email + from cc_users u, ec_user_session_info ui, ec_user_sessions us + where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.category_id=:category_id + + + + + + insert into ec_gift_certificates + (gift_certificate_id, user_id, amount, + expires, + issue_date, issued_by, gift_certificate_state, + last_modified, last_modifying_user, modified_ip_address) + values + (ec_gift_cert_id_sequence.nextval, :user_id, :amount, + $expires_to_insert, + sysdate, :customer_service_rep, 'authorized', + sysdate, :customer_service_rep, '[ns_conn peeraddr]') + + + + + + insert into ec_spam_log + (spam_id, spam_date, spam_text, mailing_list_category_id, + mailing_list_subcategory_id, mailing_list_subsubcategory_id, + user_class_id, product_id, + last_visit_start_date, last_visit_end_date) + values + (:spam_id, sysdate, :message, :mailing_list_category_id, + :mailing_list_subcategory_id, :mailing_list_subsubcategory_id, + :user_class_id, :product_id, + to_date(:start,'YYYY-MM-DD HH24:MI:SS'), + to_date(:end,'YYYY-MM-DD HH24:MI:SS')) + + + Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-3-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-3-postgresql.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-3-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,24 +1,61 @@ - postgresql7.1 + postgresql7.1 - - - - insert into ec_gift_certificates - (gift_certificate_id, user_id, amount, - expires, - issue_date, issued_by, gift_certificate_state, - last_modified, last_modifying_user, modified_ip_address) - values - (ec_gift_cert_id_sequence.nextval, :user_id, :amount, - $expires_to_insert, - current_timestamp, :customer_service_rep, 'authorized', - current_timestamp, :customer_service_rep, '[ns_conn peeraddr]') - - - + + + select distinct u.user_id as user_id, first_names, last_name, email + from cc_users u, ec_items 1, ec_orders o, ec_products p + where i.order_id=o.order_id and o.user_id=u.user_id and i_items.product_id=p.product_id and p.sku=:product_sku + + - + + + select distinct u.user_id as user_id, first_names, last_name, email + from cc_users u, ec_user_session_info ui, ec_user_sessions us, ec_products p + where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.product_id=p.product_ud and p.sku=:viewed_product_sku + + + + + + select distinct u.user_id as user_id, first_names, last_name, email + from cc_users u, ec_user_session_info ui, ec_user_sessions us + where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.category_id=:category_id + + + + + + insert into ec_gift_certificates + (gift_certificate_id, user_id, amount, + expires, + issue_date, issued_by, gift_certificate_state, + last_modified, last_modifying_user, modified_ip_address) + values + (ec_gift_cert_id_sequence.nextval, :user_id, :amount, + $expires_to_insert, + current_timestamp, :customer_service_rep, 'authorized', + current_timestamp, :customer_service_rep, '[ns_conn peeraddr]') + + + + + + insert into ec_spam_log + (spam_id, spam_date, spam_text, mailing_list_category_id, + mailing_list_subcategory_id, mailing_list_subsubcategory_id, + user_class_id, product_id, + last_visit_start_date, last_visit_end_date) + values + (:spam_id, current_timestamp, :message, :mailing_list_category_id, + :mailing_list_subcategory_id, :mailing_list_subsubcategory_id, + :user_class_id, :product_id, + to_date(:start,'YYYY-MM-DD HH24:MI:SS'), + to_date(:end,'YYYY-MM-DD HH24:MI:SS')) + + + 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.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -9,11 +9,11 @@ @param expires @param mailing_list:optional @param user_class_id:optional - @param product_id:optional - @param start_date:optional - @param end_date:optional + @param product_sku:optional + @param start:optional + @param end:optional @param user_id_list:optional,multiple - @param viewed_product_id:optional + @param viewed_product_sku:optional @param category_id:optional @param show_users_p:optional @@ -30,15 +30,15 @@ expires mailing_list:optional user_class_id:optional - product_id:optional - start_date:optional - end_date:optional + product_sku:optional + start:optional + end:optional user_id_list:optional,multiple - viewed_product_id:optional + viewed_product_sku:optional category_id:optional show_users_p:optional } -# + ad_require_permission [ad_conn package_id] admin set issue_type_list $issue_type @@ -75,8 +75,6 @@ return } - - # 1. Write row to spam log # 2. Select the users to be spammed # 3. For each user: @@ -91,61 +89,52 @@ set mailing_list_subsubcategory_id "" if { [info exists user_id_list] } { - set users_query "select user_id, email - from cc_users - where user_id in ([join $user_id_list ", "])" - + set users_query [db_map users_list] + # select user_id, email from cc_users where user_id in ([join $user_id_list ", "]) } elseif { [info exists mailing_list] } { if { [llength $mailing_list] == 0 } { - set search_criteria "(category_id is null and subcategory_id is null and subsubcategory_id is null)" + set search_criteria [db_map null_categories] + # (category_id is null and subcategory_id is null and subsubcategory_id is null) } elseif { [llength $mailing_list] == 1 } { - set search_criteria "(category_id=:mailing_list and subcategory_id is null)" + set search_criteria [db_map null_subcategory] + # (category_id=:mailing_list and subcategory_id is null) set mailing_list_category_id $mailing_list } elseif { [llength $mailing_list] == 2 } { - set search_criteria "(subcategory_id=[lindex $mailing_list 1] and subsubcategory_id is null)" + set search_criteria [db_map null_subsubcategory] + # (subcategory_id=[lindex $mailing_list 1] and subsubcategory_id is null) set mailing_list_category_id [lindex $mailing_list 0] set mailing_list_subcategory_id [lindex $mailing_list 1] } else { - set search_criteria "subsubcategory_id=[lindex $mailing_list 2]" + set search_criteria [db_map null_subsubcategory] + # subsubcategory_id=[lindex $mailing_list 2] 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 "select users.user_id as user_id, email from cc_users, ec_cat_mailing_lists where users.user_id=ec_cat_mailing_lists.user_id and $search_criteria" + set users_query "[db_map users_email] and $search_criteria" + # select users.user_id as user_id, email from cc_users, ec_cat_mailing_lists where users.user_id=ec_cat_mailing_lists.user_id } elseif { [info exists user_class_id] } { if { ![empty_string_p $user_class_id]} { - set users_query "select users.user_id as user_id, first_names, last_name, email - from cc_users, ec_user_class_user_map m - where m.user_class_id=:user_class_id - and m.user_id=users.user_id" + set users_query [db_map user_class] + # select u.user_id as user_id, first_names, last_name, email from cc_users u, ec_user_class_user_map m where m.user_class_id=:user_class_id and m.user_id=u.user_id } else { - set users_query "select user_id, first_names, last_name, email - from cc_users" + set users_query [db_map all_users] + # select user_id, first_names, last_name, email from cc_users } -} elseif { [info exists product_id] } { - set users_query "select unique users.user_id as user_id, first_names, last_name, email - from cc_users, ec_items, ec_orders - where ec_items.order_id=ec_orders.order_id - and ec_orders.user_id=users.user_id - and ec_items.product_id=:product_id" -} elseif { [info exists viewed_product_id] } { - set users_query "select unique u.user_id as user_id, first_names, last_name, email - from cc_users u, ec_user_session_info ui, ec_user_sessions us - where us.user_session_id=ui.user_session_id - and us.user_id=u.user_id - and ui.product_id=:viewed_product_id" +} elseif { [info exists product_sku] } { + set users_query [db_map bought_product] + # select unique u.user_id as user_id, first_names, last_name, email from cc_users u, ec_items 1, ec_orders o, ec_products p where i.order_id=o.order_id and o.user_id=u.user_id and i_items.product_id=p.product_id and p.sku=:product_sku +} elseif { [info exists viewed_product_sku] } { + set users_query + # select unique u.user_id as user_id, first_names, last_name, email from cc_users u, ec_user_session_info ui, ec_user_sessions us, ec_products p where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.product_id=p.product_ud and p.sku=:viewed_product_sku } elseif { [info exists category_id] } { - set users_query "select unique u.user_id as user_id, first_names, last_name, email - from cc_users u, ec_user_session_info ui, ec_user_sessions us - where us.user_session_id=ui.user_session_id - and us.user_id=u.user_id - and ui.category_id=:category_id" -} elseif { [info exists start_date] } { - set users_query "select user_id, first_names, last_name, email - from cc_users - where last_visit >= to_date(:start_date,'YYYY-MM-DD HH24:MI:SS') and last_visit <= to_date(:end_date,'YYYY-MM-DD HH24:MI:SS')" + set users_query [db_map viewed_category] + # select unique u.user_id as user_id, first_names, last_name, email from cc_users u, ec_user_session_info ui, ec_user_sessions us where us.user_session_id=ui.user_session_id and us.user_id=u.user_id and ui.category_id=:category_id +} elseif { [info exists start] } { + set users_query [db_map last_visit] + # select user_id, first_names, last_name, email from cc_users where last_visit >= to_date(:start,'YYYY-MM-DD HH24:MI:SS') and last_visit <= to_date(:end,'YYYY-MM-DD HH24:MI:SS') } # have to make all variables exist that will be inserted into ec_spam_log @@ -164,32 +153,32 @@ if { ![info exists product_id] } { set product_id "" } -if { ![info exists start_date] } { - set start_date "" +if { ![info exists start] } { + set start "" } -if { ![info exists end_date] } { - set end_date "" +if { ![info exists end] } { + set end "" } db_transaction { db_dml insert_log_for_spam " insert into ec_spam_log - (spam_id, spam_text, mailing_list_category_id, + (spam_id, spam_date, spam_text, mailing_list_category_id, mailing_list_subcategory_id, mailing_list_subsubcategory_id, user_class_id, product_id, last_visit_start_date, last_visit_end_date) values - (:spam_id, :message, :mailing_list_category_id, + (:spam_id, sysdate, :message, :mailing_list_category_id, :mailing_list_subcategory_id, :mailing_list_subsubcategory_id, :user_class_id, :product_id, - to_date(:start_date,'YYYY-MM-DD HH24:MI:SS'), - to_date(:end_date,'YYYY-MM-DD HH24:MI:SS')) + to_date(:start,'YYYY-MM-DD HH24:MI:SS'), + to_date(:end,'YYYY-MM-DD HH24:MI:SS')) " -set sql $users_query + set sql $users_query -append doc_body "[ad_admin_header "Spamming Users..."] + append doc_body "[ad_admin_header "Spamming Users..."]

    Spamming Users...

    [ad_admin_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] "Spamming Users..."] @@ -200,7 +189,6 @@ db_foreach get_users_for_spam $sql { - # create a customer service issue/interaction/action set user_identification_and_issue_id [ec_customer_service_simple_issue "" "automatic" "email" "To: $email\nFrom: [util_memoize {ad_parameter -package_id [ec_id] CustomerServiceEmailAddress ecommerce} [ec_cache_refresh]]\nSubject: $subject" "" $issue_type_list $message $user_id "" "f"] Index: openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-3.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,30 +1,66 @@ - - - select count(*) from ec_spam_log where spam_id=:spam_id - - + + + select user_id, email from cc_users where user_id in ([join $user_id_list ", "]) + + - - - - - insert into ec_spam_log - (spam_id, spam_text, mailing_list_category_id, - mailing_list_subcategory_id, mailing_list_subsubcategory_id, - user_class_id, product_id, - last_visit_start_date, last_visit_end_date) - values - (:spam_id, :message, :mailing_list_category_id, - :mailing_list_subcategory_id, :mailing_list_subsubcategory_id, - :user_class_id, :product_id, - to_date(:start_date,'YYYY-MM-DD HH24:MI:SS'), - to_date(:end_date,'YYYY-MM-DD HH24:MI:SS')) - - - + + + (category_id is null and subcategory_id is null and subsubcategory_id is null) + + - + + + (category_id=:mailing_list and subcategory_id is null) + + + + + + (subcategory_id=[lindex $mailing_list 1] and subsubcategory_id is null) + + + + + + (subcategory_id=[lindex $mailing_list 1] and subsubcategory_id is null) + + + + + + select u.user_id as user_id, email from cc_users u, ec_cat_mailing_lists l where u.user_id=l.user_id + + + + + + select u.user_id as user_id, first_names, last_name, email from cc_users u, ec_user_class_user_map m where m.user_class_id=:user_class_id and m.user_id=u.user_id + + + + + + select user_id, first_names, last_name, email from cc_users + + + + + + select user_id, first_names, last_name, email + from cc_users + where last_visit >= to_date(:start,'YYYY-MM-DD HH24:MI:SS') and last_visit <= to_date(:end,'YYYY-MM-DD HH24:MI:SS') + + + + + + select count(*) from ec_spam_log where spam_id=:spam_id + + + 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.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam-log.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam-log.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -8,19 +8,12 @@ @cvs-id spam-log.tcl,v 3.0.12.6 2000/09/22 01:34:54 kevin Exp @author ported by Jerry Asher (jerry@theashergroup.com) } { - use_date_range_p:optional start_date:array,date end_date:array,date } ad_require_permission [ad_conn package_id] admin -if { $use_date_range_p == "t" } { - set start_date $start_date(date) - set end_date $end_date(date) -} - - 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 } { 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." @@ -34,23 +27,18 @@ 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]." } + return "All users" } - - append doc_body "[ad_admin_header "Spam Log"]

    Spam Log

    [ad_admin_context_bar [list "../index" "Ecommerce([ec_system_name])"] [list "index" "Customer Service Administration"] [list "spam" "Spam Users"] "Spam Log"]
    " -ec_report_get_start_date_and_end_date - -set date_part_of_query "(spam_date >= to_date('$start_date 00:00:00','YYYY-MM-DD HH24:MI:SS') and spam_date <= to_date('$end_date 23:59:59','YYYY-MM-DD HH24:MI:SS'))" -set user_date_range_p "t" append doc_body " -[ec_report_date_range_widget $start_date $end_date] +[ec_report_date_range_widget $start_date(date) $end_date(date)] [export_form_vars use_date_range_p] @@ -60,12 +48,13 @@ " -set sql "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 $date_part_of_query order by spam_date desc" +set start $start_date(date) +set end $end_date(date) set rows_to_return "" -db_foreach get_spam_people $sql { +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 rows_to_return "" } append doc_body "$rows_to_return 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.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/spam.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/spam.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -19,17 +19,22 @@ return } +# this proc uses uplevel and assumes the existence of +# it sets the variables start_date and end_date +ec_report_get_start_date_and_end_date - append doc_body "[ad_admin_header "Spam Users"]

    Spam Users

    [ad_admin_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] "Spam Users"]
    -

    -View spam log + +

    + +[ec_report_date_range_widget $start_date(date) $end_date(date)]

    + " set mailing_list_widget [ec_mailing_list_widget] @@ -71,7 +76,7 @@
  • Spam all users who bought this product:
    -Product ID:
    +Product SKU:
    Show me the users who will be spammed.

    @@ -84,7 +89,7 @@
  • Spam all users who viewed this product: -Product ID:
    +Product SKU:
    Show me the users who will be spammed.

    @@ -105,12 +110,8 @@ " -# this proc uses uplevel and assumes the existence of -# it sets the variables start_date and end_date -ec_report_get_start_date_and_end_date - append doc_body " -[ec_report_date_range_widget $start_date $end_date]
    +[ec_report_date_range_widget $start_date(date) $end_date(date)]
    Show me the users who will be spammed.

    Index: openacs-4/packages/ecommerce/www/admin/orders/address-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/address-add-3.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/address-add-3.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/address-add-3.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -25,16 +25,16 @@ # insert the address into ec_addresses, update the address in ec_orders db_transaction { - set address_id [db_string address_id_select "select ec_address_id_sequence.nextval from dual"] - set user_id [db_string user_id_select "select user_id from ec_orders where order_id=:order_id"] + set address_id [db_nextval ec_address_id_sequence] + set user_id [db_string user_id_select "select user_id from ec_orders where order_id=:order_id"] - db_dml address_insert "insert into ec_addresses + db_dml address_insert "insert into ec_addresses (address_id, user_id, address_type, attn, line1, line2, city, usps_abbrev, full_state_name, zip_code, country_code, phone, phone_time) values (:address_id, :user_id, 'shipping', :attn, :line1, :line2, :city, :usps_abbrev, :full_state_name, :zip_code, :country_code, :phone, :phone_time) " - db_dml ec_orders_update "update ec_orders set shipping_address=:address_id where order_id=:order_id" + db_dml ec_orders_update "update ec_orders set shipping_address=:address_id where order_id=:order_id" } ad_returnredirect "one?[export_url_vars order_id]" Index: openacs-4/packages/ecommerce/www/admin/orders/creditcard-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/creditcard-add-3.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/creditcard-add-3.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/creditcard-add-3.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -20,7 +20,7 @@ set user_id [db_string user_id_select "select user_id from ec_orders where order_id=:order_id"] - set creditcard_id [db_string creditcard_id_select "select ec_creditcard_id_sequence.nextval from dual"] + set creditcard_id [db_nextval ec_creditcard_id_sequence] set creditcard_last_four [string range $creditcard_number [expr [string length $creditcard_number] -4] [expr [string length $creditcard_number] -1]] set creditcard_expire "$creditcard_expire_1/$creditcard_expire_2" Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-2.tcl 22 Aug 2001 04:20:41 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-2.tcl 29 Jan 2002 00:11:46 -0000 1.4 @@ -102,7 +102,7 @@
    " -set shipment_id [db_string get_new_ship_seq "select ec_shipment_id_sequence.nextval from dual"] +set shipment_id [db_nextval ec_shipment_id_sequence] if { [info exists item_id] && ![empty_string_p item_id] } { set sql "select i.item_id, p.product_name, p.one_line_description, p.product_id, i.price_charged, i.price_name, i.color_choice, i.size_choice, i.style_choice Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,125 +1,105 @@ - oracle8.1.6 + oracle8.1.6 - - + + select nvl(sum(price_charged),0) from ec_items where item_id in ([join $item_id_vars ", "]) - - - - - - + + + + + select nvl(sum(shipping_charged),0) from ec_items where item_id in ([join $item_id_vars ", "]) - - - - - - + + + + + select ec_tax(:total_price_of_items, :total_shipping_of_items, :order_id) from dual - - - - - - + + + + + insert into ec_shipments - (shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address) - values - (:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, sysdate, :customer_service_rep, :peeraddr) + (shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address) + values + (:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, sysdate, :customer_service_rep, :peeraddr) + + - - - - - - + + select ec_shipment_cost(:shipment_id) from dual - - - - - - + + + + + select ec_order_cost(:order_id) from dual - - - - - - + + + + + update ec_financial_transactions set shipment_id=:shipment_id, to_be_captured_p='t', to_be_captured_date=sysdate where transaction_id=:transaction_id - - + + - - - - insert into ec_problems_log - (problem_id, problem_date, problem_details, order_id) - values - (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) - - - - - - - - update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id - - - - - - + + insert into ec_financial_transactions (transaction_id, order_id, shipment_id, transaction_amount, transaction_type, to_be_captured_p, inserted_date, to_be_captured_date) values - (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',sysdate,sysdate) - - - + (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',sysdate, sysdate) + + + + + + insert into ec_problems_log + (problem_id, problem_date, problem_details, order_id) + values + (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) + + + + + + update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id + + - - - - - insert into ec_problems_log - (problem_id, problem_date, problem_details, order_id) - values - (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) - - - - - - - + + + insert into ec_problems_log + (problem_id, problem_date, problem_details, order_id) + values + (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) + + + + + update ec_financial_transactions set authorized_date=sysdate where transaction_id=:transaction_id - - + + - - - + + insert into ec_problems_log - (problem_id, problem_date, problem_details, order_id) - values - (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) - - - - - - - + (problem_id, problem_date, problem_details, order_id) + values + (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) + + + + + update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id - - - - + + + Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,111 +1,85 @@ - postgresql7.1 + postgresql7.1 - - + + select ec_tax(:total_price_of_items, :total_shipping_of_items, :order_id) - - - - - - + + + + + insert into ec_shipments - (shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address) - values - (:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, current_timestamp, :customer_service_rep, :peeraddr) + (shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address) + values + (:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, current_timestamp, :customer_service_rep, :peeraddr) + + - - - - - - + + select ec_shipment_cost(:shipment_id) - - - - - - + + + + + select ec_order_cost(:order_id) - - - - - - + + + + + update ec_financial_transactions set shipment_id=:shipment_id, to_be_captured_p='t', to_be_captured_date=current_timestamp where transaction_id=:transaction_id - - + + - - - - insert into ec_problems_log - (problem_id, problem_date, problem_details, order_id) - values - (ec_problem_id_sequence.nextval, current_timestamp, :problem_details, :order_id) - - - - - - - - update ec_financial_transactions set marked_date=current_timestamp where transaction_id=:transaction_id - - - - - - + + insert into ec_financial_transactions (transaction_id, order_id, shipment_id, transaction_amount, transaction_type, to_be_captured_p, inserted_date, to_be_captured_date) values - (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',current_timestamp,current_timestamp) + (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t', current_timestamp, current_timestamp) + + + + + + insert into ec_problems_log + (problem_id, problem_date, problem_details, order_id) + values + (ec_problem_id_sequence.nextval, current_timestamp, :problem_details, :order_id) - - + + + + + + update ec_financial_transactions set marked_date=current_timestamp where transaction_id=:transaction_id + + - - - - - insert into ec_problems_log - (problem_id, problem_date, problem_details, order_id) - values - (ec_problem_id_sequence.nextval, current_timestamp, :problem_details, :order_id) - - - - - - - + + update ec_financial_transactions set authorized_date=current_timestamp where transaction_id=:transaction_id - - + + - - - + + insert into ec_problems_log - (problem_id, problem_date, problem_details, order_id) - values - (ec_problem_id_sequence.nextval, current_timestamp, :problem_details, :order_id) - - - + (problem_id, problem_date, problem_details, order_id) + values + (ec_problem_id_sequence.nextval, current_timestamp, :problem_details, :order_id) + + - - - + + update ec_financial_transactions set marked_date=current_timestamp where transaction_id=:transaction_id - - - - + + + Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,19 +1,19 @@ # /www/[ec_url_concat [ec_url] /admin]/orders/fulfill-3.tcl ad_page_contract { - @author Eve Andersson (eveander@arsdigita.com) - @creation-date Summer 1999 - @cvs-id fulfill-3.tcl,v 3.4.2.6 2000/08/18 21:46:57 stevenp Exp - @author ported by Jerry Asher (jerry@theashergroup.com) + @author Eve Andersson (eveander@arsdigita.com) + @creation-date Summer 1999 + @cvs-id fulfill-3.tcl,v 3.4.2.6 2000/08/18 21:46:57 stevenp Exp + @author ported by Jerry Asher (jerry@theashergroup.com) } { - shipment_id:integer,notnull - order_id:integer,notnull - shipment_date:notnull - expected_arrival_date - carrier:optional - carrier_other:optional - tracking_number:optional - item_id + shipment_id:integer,notnull + order_id:integer,notnull + shipment_date:notnull + expected_arrival_date + carrier:optional + carrier_other:optional + tracking_number:optional + item_id } ad_require_permission [ad_conn package_id] admin @@ -59,8 +59,8 @@ # doubleclick protection if { [db_string doubleclick_select "select count(*) from ec_shipments where shipment_id=:shipment_id"] > 0 } { - ad_returnredirect "fulfillment" - return + ad_returnredirect "fulfillment" + return } set shipping_method [db_string shipping_method_select "select shipping_method from ec_orders where order_id=:order_id"] @@ -71,30 +71,30 @@ set item_id_vars [list] foreach item_id $item_id_list { - set var_name "item_id_[llength $item_id_vars]" - set $var_name $item_id - lappend item_id_vars ":$var_name" + set var_name "item_id_[llength $item_id_vars]" + set $var_name $item_id + lappend item_id_vars ":$var_name" } set total_price_of_items [db_string total_price_of_items_select "select nvl(sum(price_charged),0) from ec_items where item_id in ([join $item_id_vars ", "])"] if { $shippable_p } { - # see if base shipping cost should be included in total_shipping_of_items - set n_shipments_already [db_string n_shipments_already_select "select count(*) from ec_shipments where order_id=:order_id"] - - set shipping_of_items [db_string shipping_of_items_select "select nvl(sum(shipping_charged),0) from ec_items where item_id in ([join $item_id_vars ", "])"] - - if { $n_shipments_already == 0 } { - set total_shipping_of_items [db_string total_shipping_of_items_select "select $shipping_of_items + shipping_charged from ec_orders where order_id=:order_id"] - } else { - set total_shipping_of_items $shipping_of_items - } + # see if base shipping cost should be included in total_shipping_of_items + set n_shipments_already [db_string n_shipments_already_select "select count(*) from ec_shipments where order_id=:order_id"] + + set shipping_of_items [db_string shipping_of_items_select "select nvl(sum(shipping_charged),0) from ec_items where item_id in ([join $item_id_vars ", "])"] + + if { $n_shipments_already == 0 } { + set total_shipping_of_items [db_string total_shipping_of_items_select "select $shipping_of_items + shipping_charged from ec_orders where order_id=:order_id"] + } else { + set total_shipping_of_items $shipping_of_items + } } else { - # it's a pickup order - set total_shipping_of_items 0 - set expected_arrival_date "" - set carrier "" - set tracking_number "" + # it's a pickup order + set total_shipping_of_items 0 + set expected_arrival_date "" + set carrier "" + set tracking_number "" } set total_tax_of_items [db_string total_tax_of_items_select "select ec_tax(:total_price_of_items, :total_shipping_of_items, :order_id) from dual"] @@ -103,124 +103,125 @@ set shippable_p_tf [ec_decode $shippable_p 0 f t] db_transaction { - db_dml insert_shipment_info "insert into ec_shipments + db_dml insert_shipment_info "insert into ec_shipments (shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address) values (:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, sysdate, :customer_service_rep, :peeraddr) " - db_dml item_state_update " + db_dml item_state_update " update ec_items set item_state='shipped', shipment_id=:shipment_id where item_id in ([join $item_id_vars ", "]) " - # calculate the total shipment cost (price + shipping + tax - gift certificate) of the shipment - set shipment_cost [db_string shipment_cost_select "select ec_shipment_cost(:shipment_id) from dual"] + # calculate the total shipment cost (price + shipping + tax - gift certificate) of the shipment + set shipment_cost [db_string shipment_cost_select "select ec_shipment_cost(:shipment_id) from dual"] - # calculate the total order cost (price + shipping + tax - gift_certificate) so we'll - # know if we can use the original transaction - set order_cost [db_string order_cost_select "select ec_order_cost(:order_id) from dual"] + # calculate the total order cost (price + shipping + tax - gift_certificate) so we'll + # know if we can use the original transaction + set order_cost [db_string order_cost_select "select ec_order_cost(:order_id) from dual"] - # It is conceivable, albeit unlikely, that a partial shipment, - # return, and an addition of more items to the order by the site - # administrator can make the order_cost equal the shipment_cost - # even if it isn't the first shipment, which is fine. But if - # this happens twice, this would have caused the system (which is - # trying to minimize financial transactions) to try to reuse an old - # transaction, which will fail, so I've added the 2nd half of the - # "if statement" below to make sure that transaction doesn't get reused: + # It is conceivable, albeit unlikely, that a partial shipment, + # return, and an addition of more items to the order by the site + # administrator can make the order_cost equal the shipment_cost + # even if it isn't the first shipment, which is fine. But if + # this happens twice, this would have caused the system (which is + # trying to minimize financial transactions) to try to reuse an old + # transaction, which will fail, so I've added the 2nd half of the + # "if statement" below to make sure that transaction doesn't get reused: - if { $shipment_cost == $order_cost && [db_string to_be_captured_p_select "select count(*) from ec_financial_transactions where order_id=:order_id and to_be_captured_p='t'"] == 0} { - set transaction_id [db_string transaction_id_select "select max(transaction_id) from ec_financial_transactions where order_id=:order_id"] - # 1999-08-11: added shipment_id to the update - - # 1999-08-29: put the update inside an if statement in case there is - # no transaction to update - if { ![empty_string_p $transaction_id] } { - db_dml transaction_update "update ec_financial_transactions set shipment_id=:shipment_id, to_be_captured_p='t', to_be_captured_date=sysdate where transaction_id=:transaction_id" - } + if { $shipment_cost == $order_cost && [db_string to_be_captured_p_select "select count(*) from ec_financial_transactions where order_id=:order_id and to_be_captured_p='t'"] == 0} { + set transaction_id [db_string transaction_id_select "select max(transaction_id) from ec_financial_transactions where order_id=:order_id"] + # 1999-08-11: added shipment_id to the update + + # 1999-08-29: put the update inside an if statement in case there is + # no transaction to update + if { ![empty_string_p $transaction_id] } { + db_dml transaction_update "update ec_financial_transactions set shipment_id=:shipment_id, to_be_captured_p='t', to_be_captured_date=sysdate where transaction_id=:transaction_id" + } - # try to mark the transaction - # 1999-08-29: put the marking inside an if statement in case there is - # no transaction to update - if { ![empty_string_p $transaction_id] } { + # try to mark the transaction + # 1999-08-29: put the marking inside an if statement in case there is + # no transaction to update + if { ![empty_string_p $transaction_id] } { - set cc_mark_result [ec_creditcard_marking $transaction_id] - if { $cc_mark_result == "invalid_input" } { - set problem_details "When trying to mark shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_mark_result" - db_dml problems_log_insert "insert into ec_problems_log + set cc_mark_result [ec_creditcard_marking $transaction_id] + if { $cc_mark_result == "invalid_input" } { + set problem_details "When trying to mark shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_mark_result" + db_dml problems_log_insert "insert into ec_problems_log (problem_id, problem_date, problem_details, order_id) values (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) " - } elseif { $cc_mark_result == "success" } { - db_dml transaction_success_update "update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id" - } - } - } else { - if { $shipment_cost > 0 } { - # 1. add a row to ec_financial_transactions with to_be_captured_p and to_be_captured_date set - # 2. do a new authorization - # 3. mark transaction - - # Note: 1 is the only one we want to do inside the transaction; if 2 & 3 fail, they will be - # tried later with a cron job (they involve talking to CyberCash, so you never know what will - # happen with them) - - set transaction_id [db_string transaction_id_select "select ec_transaction_id_sequence.nextval from dual"] - # 1999-08-11: added shipment_id to the insert - - db_dml transaction_id_insert "insert into ec_financial_transactions + } elseif { $cc_mark_result == "success" } { + db_dml transaction_success_update "update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id" + } + } + } else { + if { $shipment_cost >= 0 } { + # 1. add a row to ec_financial_transactions with to_be_captured_p and to_be_captured_date set + # 2. do a new authorization + # 3. mark transaction + + # Note: 1 is the only one we want to do inside the transaction; if 2 & 3 fail, they will be + # tried later with a cron job (they involve talking to CyberCash, so you never know what will + # happen with them) + + # Get id for the new transaction. + set transaction_id [db_nextval ec_transaction_id_sequence] + # 1999-08-11: added shipment_id to the insert + + db_dml transaction_insert "insert into ec_financial_transactions (transaction_id, order_id, shipment_id, transaction_amount, transaction_type, to_be_captured_p, inserted_date, to_be_captured_date) values - (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',sysdate,sysdate) + (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',sysdate, sysdate) " - # CyberCash stuff - # this attempts an auth and returns failed_authorization, authorized_plus_avs, authorized_minus_avs, no_recommendation, or invalid_input - set cc_result [ec_creditcard_authorization $order_id $transaction_id] - if { $cc_result == "failed_authorization" || $cc_result == "invalid_input" } { - set problem_details "When trying to authorize shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_result" - db_dml problems_insert " + # CyberCash stuff + # this attempts an auth and returns failed_authorization, authorized_plus_avs, authorized_minus_avs, no_recommendation, or invalid_input + set cc_result [ec_creditcard_authorization $order_id $transaction_id] + if { $cc_result == "failed_authorization" || $cc_result == "invalid_input" } { + set problem_details "When trying to authorize shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_result" + db_dml problems_insert " insert into ec_problems_log (problem_id, problem_date, problem_details, order_id) values (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) " - if { [util_memoize {ad_parameter -package_id [ec_id] DisplayTransactionMessagesDuringFulfillmentP ecommerce} [ec_cache_refresh]] } { - ad_return_warning "Credit Card Failure" "Warning: the credit card authorization for this shipment (shipment_id $shipment_id) of order_id $order_id failed. You may wish to abort the shipment (if possible) until this is issue is resolved. A note has been made in the problems log.

    Continue with order fulfillment." - return - } - if { $cc_result == "failed_p" } { - db_dml transaction_failed_update "update ec_financial_transactions set failed_p='t' where transaction_id=:transaction_id" - } - } elseif { $cc_result == "authorized_plus_avs" || $cc_result == "authorized_minus_avs" } { - # put authorized_date into ec_financial_transacions - db_dml transaction_authorized_udpate "update ec_financial_transactions set authorized_date=sysdate where transaction_id=:transaction_id" - # try to mark the transaction - set cc_mark_result [ec_creditcard_marking $transaction_id] - ns_log Notice "fulfill-3.tcl: cc_mark_result is $cc_mark_result" - if { $cc_mark_result == "invalid_input" } { - set problem_details "When trying to mark shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_mark_result" - db_dml problems_insert "insert into ec_problems_log + if { [util_memoize {ad_parameter -package_id [ec_id] DisplayTransactionMessagesDuringFulfillmentP ecommerce} [ec_cache_refresh]] } { + ad_return_warning "Credit Card Failure" "Warning: the credit card authorization for this shipment (shipment_id $shipment_id) of order_id $order_id failed. You may wish to abort the shipment (if possible) until this is issue is resolved. A note has been made in the problems log.

    Continue with order fulfillment." + return + } + if { $cc_result == "failed_p" } { + db_dml transaction_failed_update "update ec_financial_transactions set failed_p='t' where transaction_id=:transaction_id" + } + } elseif { $cc_result == "authorized_plus_avs" || $cc_result == "authorized_minus_avs" } { + # put authorized_date into ec_financial_transacions + db_dml transaction_authorized_udpate "update ec_financial_transactions set authorized_date=sysdate where transaction_id=:transaction_id" + # try to mark the transaction + set cc_mark_result [ec_creditcard_marking $transaction_id] + ns_log Notice "fulfill-3.tcl: cc_mark_result is $cc_mark_result" + if { $cc_mark_result == "invalid_input" } { + set problem_details "When trying to mark shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_mark_result" + db_dml problems_insert "insert into ec_problems_log (problem_id, problem_date, problem_details, order_id) values (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) " - } elseif { $cc_mark_result == "success" } { - db_dml transaction_success_update "update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id" + } elseif { $cc_mark_result == "success" } { + db_dml transaction_success_update "update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id" + } + } } - } } - } } # send the "Order Shipped" email iff it was a shippable order if { $shippable_p } { - ec_email_order_shipped $shipment_id + ec_email_order_shipped $shipment_id } ad_returnredirect "fulfillment" Index: openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -21,7 +21,7 @@ The following items are needed in order to fulfill all outstanding orders:

  • From
    DateToText
    [ec_formatted_full_date $full_spam_date][spam_to_summary_sub $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]
    [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]
    - + " db_foreach items_needed_select " @@ -46,7 +46,7 @@ } set options [join $option_list ", "] - doc_body_append "\n" + doc_body_append "\n" } doc_body_append "
    QuantityProduct
    QuantitySKUProduct
    $quantity$product_name[ec_decode $options "" "" "; $options"]
    $quantity$sku$product_name[ec_decode $options "" "" "; $options"]
    Index: openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -4,12 +4,12 @@ - select p.product_id, p.product_name, + select p.product_id, p.product_name, p.sku, i.color_choice, i.size_choice, i.style_choice, count(*) as quantity from ec_products p, ec_items_shippable i where p.product_id=i.product_id - group by p.product_id, p.product_name, + group by p.product_id, p.product_name, p.sku, i.color_choice, i.size_choice, i.style_choice order by quantity desc Index: openacs-4/packages/ecommerce/www/admin/orders/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/index.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/index.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -60,8 +60,8 @@ from ec_refunds " -set n_standard_to_ship [db_string unused "select count(*) from ec_orders_shippable where shipping_method='standard'"] -set n_express_to_ship [db_string unused "select count(*) from ec_orders_shippable where shipping_method='express'"] +set n_standard_to_ship [db_string standard_shipping "select count(*) from ec_orders_shippable where shipping_method='standard'"] +set n_express_to_ship [db_string express_shipping "select count(*) from ec_orders_shippable where shipping_method='express'"] doc_body_append "
  • Orders ($n_o_in_last_24_hours in last 24 hours; $n_o_in_last_7_days in last 7 days) @@ -86,6 +86,10 @@
    +By Product SKU: +
    + +
    By Product Name:
    Index: openacs-4/packages/ecommerce/www/admin/orders/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/index.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/index.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/index.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -1,78 +1,65 @@ - - - -select - sum(one_if_within_n_days(confirmed_date,1)) as n_o_in_last_24_hours, - sum(one_if_within_n_days(confirmed_date,7)) as n_o_in_last_7_days -from ec_orders_reportable + + + select + sum(one_if_within_n_days(confirmed_date,1)) as n_o_in_last_24_hours, + sum(one_if_within_n_days(confirmed_date,7)) as n_o_in_last_7_days + from ec_orders_reportable + + - - + + + select + sum(one_if_within_n_days(issue_date,1)) as n_g_in_last_24_hours, + sum(one_if_within_n_days(issue_date,7)) as n_g_in_last_7_days + from ec_gift_certificates_purchased + + - - - - -select - sum(one_if_within_n_days(issue_date,1)) as n_g_in_last_24_hours, - sum(one_if_within_n_days(issue_date,7)) as n_g_in_last_7_days -from ec_gift_certificates_purchased + + + select + sum(one_if_within_n_days(issue_date,1)) as n_gi_in_last_24_hours, + sum(one_if_within_n_days(issue_date,7)) as n_gi_in_last_7_days + from ec_gift_certificates_issued + + - - + + + select + sum(one_if_within_n_days(shipment_date,1)) as n_s_in_last_24_hours, + sum(one_if_within_n_days(shipment_date,7)) as n_s_in_last_7_days + from ec_shipments + + + + + + select + sum(one_if_within_n_days(refund_date,1)) as n_r_in_last_24_hours, + sum(one_if_within_n_days(refund_date,7)) as n_r_in_last_7_days + from ec_refunds + + + + + + select count(*) + from ec_orders_shippable + where shipping_method='standard' + + - - - - -select - sum(one_if_within_n_days(issue_date,1)) as n_gi_in_last_24_hours, - sum(one_if_within_n_days(issue_date,7)) as n_gi_in_last_7_days -from ec_gift_certificates_issued - - - - - - - - -select - sum(one_if_within_n_days(shipment_date,1)) as n_s_in_last_24_hours, - sum(one_if_within_n_days(shipment_date,7)) as n_s_in_last_7_days -from ec_shipments - - - - - - - - -select - sum(one_if_within_n_days(refund_date,1)) as n_r_in_last_24_hours, - sum(one_if_within_n_days(refund_date,7)) as n_r_in_last_7_days -from ec_refunds - - - - - - - - select count(*) from ec_orders_shippable where shipping_method='standard' - - - - - - - select count(*) from ec_orders_shippable where shipping_method='standard' - - - - + + + select count(*) + from ec_orders_shippable + where shipping_method='express' + + + Index: openacs-4/packages/ecommerce/www/admin/orders/items-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-add-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/items-add-2.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/items-add-2.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -7,7 +7,7 @@ @author ported by Jerry Asher (jerry@theashergroup.com) } { order_id:integer,notnull - product_id:integer,optional + sku:optional product_name:optional } @@ -22,8 +22,8 @@
    " -if { [exists_and_not_null product_id] } { - set additional_query_part "product_id=:product_id" +if { [exists_and_not_null sku] } { + set additional_query_part "sku=:sku" } else { set additional_query_part "upper(product_name) like '%' || upper(:product_name) || '%'" } @@ -38,7 +38,6 @@ " } incr product_counter -# doc_body_append "
  • $product_name\n" doc_body_append "
  • $product_name
    [ec_add_to_cart_link $product_id "Add to Order" "Add to Order" "items-add-3" $order_id] Index: openacs-4/packages/ecommerce/www/admin/orders/items-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-add-3.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/items-add-3.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/items-add-3.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -26,7 +26,7 @@
    " -set item_id [db_string item_id_select "select ec_item_id_sequence.nextval from dual"] +set item_id [db_nextval ec_item_id_sequence] set user_id [db_string user_id_select "select user_id from ec_orders where order_id=:order_id"] set lowest_price_and_price_name [ec_lowest_price_and_price_name_for_an_item $product_id $user_id ""] Index: openacs-4/packages/ecommerce/www/admin/orders/items-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/items-add.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/items-add.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -35,7 +35,7 @@
    [export_form_vars order_id] -
  • By ID: +
  • By SKU:
  • Index: openacs-4/packages/ecommerce/www/admin/orders/items-return-4-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-return-4-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/items-return-4-oracle.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/items-return-4-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -3,13 +3,6 @@ oracle8.1.6 - - - select creditcard_id_sequence.nextval from dual - - - - insert into ec_refunds @@ -55,14 +48,7 @@ - - - - select ec_transaction_id_sequence.nextval from dual - - - insert into ec_financial_transactions Index: openacs-4/packages/ecommerce/www/admin/orders/items-return-4-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-return-4-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/items-return-4-postgresql.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/items-return-4-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -3,13 +3,6 @@ postgresql7.1 - - - select creditcard_id_sequence.nextval - - - - insert into ec_refunds @@ -42,13 +35,6 @@ - - - select ec_transaction_id_sequence.nextval - - - - insert into ec_financial_transactions Index: openacs-4/packages/ecommerce/www/admin/orders/items-return-4.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-return-4.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/items-return-4.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/items-return-4.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -213,7 +213,7 @@ if {$case_b_p} { # insert a new credit card into ec_creditcards - set creditcard_id [db_string get_new_creditcard_id "select creditcard_id_sequence.nextval from dual"] + set creditcard_id [db_nextval creditcard_id_sequence] set cc_thing "[string range $creditcard_number [expr [string length $creditcard_number] -4] [expr [string length $creditcard_number] -1]]" @@ -268,7 +268,7 @@ if { [expr $cash_amount_to_refund] > 0 } { # 1999-08-11: added refund_id to the insert - set transaction_id [db_string get_new_trans_id "select ec_transaction_id_sequence.nextval from dual"] + set transaction_id [db_nextval ec_transaction_id_sequence] db_dml insert_new_financial_trans "insert into ec_financial_transactions (transaction_id, order_id, refund_id, creditcard_id, transaction_amount, transaction_type, inserted_date) values Index: openacs-4/packages/ecommerce/www/admin/orders/items-return.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-return.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/items-return.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/items-return.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -29,7 +29,7 @@ " # generate the new refund_id here (we don't want them reusing this form) -set refund_id [db_string refund_id_select "select refund_id_sequence.nextval from dual"] +set refund_id [db_nextval refund_id_sequence] doc_body_append "
    [export_form_vars order_id refund_id] Index: openacs-4/packages/ecommerce/www/admin/orders/search-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/search-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/search-oracle.xql 23 Jul 2001 06:38:24 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/search-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -24,6 +24,30 @@ + + + + select o.order_id, o.confirmed_date, o.order_state, + ec_total_price(o.order_id) as price_to_display, + o.user_id, + u.first_names, u.last_name, + p.product_name, + count(*) as n_items + from ec_orders o, cc_users u, ec_items i, ec_products p + where upper(p.sku) like upper(:product_sku_query_string) + and i.product_id=p.product_id + and o.user_id=u.user_id(+) + and o.order_id=i.order_id + group by o.order_id, o.confirmed_date, o.order_state, + ec_total_price(o.order_id), + o.user_id, + u.first_names, u.last_name, p.product_name + order by order_id + + + + + Index: openacs-4/packages/ecommerce/www/admin/orders/search-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/search-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/search-postgresql.xql 23 Jul 2001 06:38:24 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/search-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -24,6 +24,30 @@ + + + + select o.order_id, o.confirmed_date, o.order_state, + ec_total_price(o.order_id) as price_to_display, + o.user_id, + u.first_names, u.last_name, + p.product_name, + count(*) as n_items + from ec_orders o + JOIN ec_items i on (o.order_id=i.order_id) + JOIN ec_products p on (i.product_id=p.product_id) + LEFT JOIN cc_users u on (o.user_id=u.user_id) + where upper(p.sku) like upper(:product_sku_query_string) + group by o.order_id, o.confirmed_date, o.order_state, + ec_total_price(o.order_id), + o.user_id, + u.first_names, u.last_name, p.product_name + order by order_id + + + + + Index: openacs-4/packages/ecommerce/www/admin/orders/search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/search.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/orders/search.tcl 23 Jul 2001 06:38:24 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/orders/search.tcl 29 Jan 2002 00:11:46 -0000 1.3 @@ -8,6 +8,7 @@ @author ported by Jerry Asher (jerry@theashergroup.com) } { order_id_query_string:integer,optional + product_sku_query_string:optional product_name_query_string:optional customer_last_name_query_string:optional } @@ -44,6 +45,10 @@ # ec_total_price(o.order_id), o.user_id, # u.first_names, u.last_name # order by order_id +} elseif { [info exists product_sku_query_string] } { + set product_header "Product" + set product_sku_query_string "%$product_sku_query_string%" + set query [db_map product_sku_query_string_sql] } elseif { [info exists product_name_query_string] } { set product_header "Product" # append product_name_query_string "%" Index: openacs-4/packages/ecommerce/www/admin/products/offer-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/offer-add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/products/offer-add.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/products/offer-add.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -169,7 +169,7 @@ doc_body_append " " -set offer_id [db_string offer_id_select "select ec_offer_sequence.nextval from dual"] +set offer_id [db_nextval ec_offer_sequence] doc_body_append " [export_form_vars offer_id product_id retailer_id price shipping stock_status shipping_unavailable_p offer_begins offer_ends special_offer_p special_offer_html] Index: openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/products/recommendation-add-3.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -34,7 +34,7 @@ } -set recommendation_id [db_string recommendation_id_select "select ec_recommendation_id_sequence.nextval from dual"] +set recommendation_id [db_nextval ec_recommendation_id_sequence] doc_body_append "[ad_admin_header "Confirm Product Recommendation"] Index: openacs-4/packages/ecommerce/www/admin/products/review-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/review-add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/products/review-add.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/products/review-add.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -48,7 +48,7 @@ " -set review_id [db_string review_id_select "select ec_product_review_id_sequence.nextval from dual"] +set review_id [db_nextval ec_product_review_id_sequence] doc_body_append " [export_form_vars product_id publication display_p review review_id author_name] Index: openacs-4/packages/ecommerce/www/admin/products/sale-price-add-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/sale-price-add-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/products/sale-price-add-oracle.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/products/sale-price-add-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -8,13 +8,5 @@ select 1 from dual where to_date('$sale_begins(date)','YYYY-MM-DD HH24:MI:SS') >to_date('$sale_ends(date)', 'YYYY-MM-DD HH24:MI:SS') - - - - select ec_sale_price_id_sequence.nextval from dual - - - - Index: openacs-4/packages/ecommerce/www/admin/products/sale-price-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/sale-price-add-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/products/sale-price-add-postgresql.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/products/sale-price-add-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2 @@ -8,13 +8,5 @@ select 1 where to_date('$sale_begins(date)','YYYY-MM-DD HH24:MI:SS') >to_date('$sale_ends(date)', 'YYYY-MM-DD HH24:MI:SS') - - - - select ec_sale_price_id_sequence.nextval - - - - Index: openacs-4/packages/ecommerce/www/admin/products/sale-price-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/sale-price-add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/products/sale-price-add.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/products/sale-price-add.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -91,7 +91,7 @@ set currency [util_memoize {ad_parameter -package_id [ec_id] Currency ecommerce} [ec_cache_refresh]] -set sale_price_id [db_string sale_price_id_select "select ec_sale_price_id_sequence.nextval from dual"] +set sale_price_id [db_nextval ec_sale_price_id_sequence] doc_body_append " Index: openacs-4/packages/ecommerce/www/admin/retailers/add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/retailers/add-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/retailers/add-2.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/retailers/add-2.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -183,7 +183,6 @@ " -#set retailer_id [db_string get_retailer_id_seq "select ec_retailer_sequence.nextval from dual"] set retailer_id [db_nextval ec_retailer_sequence] append page_html "[export_form_vars retailer_id retailer_name primary_contact_name secondary_contact_name primary_contact_info secondary_contact_info line1 line2 city usps_abbrev zip_code phone fax url country_code reach nexus_states financing_policy return_policy price_guarantee_policy delivery_policy installation_policy] Index: openacs-4/packages/ecommerce/www/admin/templates/add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/add-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/templates/add-2.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/templates/add-2.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -49,7 +49,7 @@ " -set template_id [db_string get_template_nextval "select ec_template_id_sequence.nextval from dual"] +set template_id [db_nextval ec_template_id_sequence] append page_html " [export_form_vars template_id template_name template] Index: openacs-4/packages/ecommerce/www/admin/user-classes/add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/user-classes/add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/user-classes/add.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/user-classes/add.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -28,7 +28,7 @@ " -set user_class_id [db_string get_uc_id_seq "select ec_user_class_id_sequence.nextval from dual"] +set user_class_id [db_nextval ec_user_class_id_sequence] append page_html " [export_form_vars user_class_name user_class_id] Index: openacs-4/packages/ecommerce/www/templates/store/rexy3back.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/templates/store/Attic/rexy3back.jpg,v diff -u -r1.1 -r1.2 Binary files differ