Index: openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificate-void.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificate-void.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificate-void.adp 21 Aug 2008 10:43:40 -0000 1.1
@@ -0,0 +1,15 @@
+ Please explain why you are voiding this gift certificate: Customer: @customer_info_html;noquote@@title@
+
+$page_title
-
-[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] $page_title]
-
-
-Please explain why you are voiding this gift certificate:
-
-
-
-[ad_admin_footer]
-"
-
-doc_return 200 text/html $doc_body
\ No newline at end of file
+set export_form_vars_html [export_form_vars gift_certificate_id]
Index: openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificates.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificates.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificates.adp 21 Aug 2008 10:43:40 -0000 1.1
@@ -0,0 +1,24 @@
+@title@
+
+
Grant a gift certificate
+ +@gift_certs_for_users_html;noquote@ + Index: openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificates.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificates.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificates.tcl 9 Mar 2004 00:59:47 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificates.tcl 21 Aug 2008 10:43:40 -0000 1.5 @@ -1,5 +1,4 @@ # gift-certificates.tcl - ad_page_contract { @param user_id @author @@ -12,44 +11,17 @@ ad_require_permission [ad_conn package_id] admin -set page_title "Gift Certificates" -append doc_body "[ad_admin_header $page_title] -- -Gift Certificate Account Balance: [ec_pretty_price [db_string get_pretty_price "select ec_gift_certificate_balance(:user_id) from dual"]] - -
-Grant a gift certificate -
- -- -" - set sql "select c.*, i.first_names || ' ' || i.last_name as issuer, i.user_id as issuer_user_id, p.first_names || ' ' || p.last_name as purchaser, p.user_id as purchaser_user_id, gift_certificate_amount_left(c.gift_certificate_id) as amount_left, decode(sign(sysdate-expires),1,'t',0,'t','f') as expired_p, v.first_names as voided_by_first_names, v.last_name as voided_by_last_name from ec_gift_certificates c, cc_users i, cc_users p, cc_users v where c.issued_by=i.user_id(+) @@ -61,60 +33,36 @@ set gift_certificate_counter 0 set current_printed 0 set old_printed 0 +set gift_certs_for_users_html db_foreach get_gift_certificates_for_user $sql { - if { $current_printed == 0 && $expired_p == "f" && $amount_left > 0 && $gift_certificate_state != "void"} { - append doc_body "Currently Available Gift Certificates -
- " - set current_printed 1 + append gift_certs_for_users_html "" - } - append doc_body "Expired or Used Gift Certificates -Currently Available Gift Certificates
" + set current_printed 1 } elseif { $old_printed == 0 && ($expired_p == "t" || $amount_left == 0 || $gift_certificate_state == "void") } { - if { $current_printed == 1 } { - append doc_body "
- " - set old_printed 1 + if { $current_printed == 1 } { + # do nothing + } + append gift_certs_for_users_html "" -} - -append doc_body "[ad_admin_footer] -" - - -doc_return 200 text/html $doc_bodyExpired or Usded Gift Certificates
" + set old_printed 1 } - incr gift_certificate_counter - append doc_body " --
- Gift Certificate ID $gift_certificate_id - Amount Left [ec_pretty_price $amount_left] (out of [ec_pretty_price $amount]) - " + append gift_certs_for_users_html " Issue Date [util_AnsiDatetoPrettyDate $issue_date] \n
" - - if { $expired_p == "f" && $amount_left > 0 && $gift_certificate_state != "void"} { - append doc_body "(void this) - " - } - - append doc_body "+ Gift Certificate ID $gift_certificate_id" + if { $expired_p == "f" && $amount_left > 0 && $gift_certificate_state != "void"} { + append gift_certs_for_users_html " (void this) " + } + append gift_certs_for_users_html " + Amount Left [ec_pretty_price $amount_left] (out of [ec_pretty_price $amount]) \n" if { ![empty_string_p $issuer_user_id] } { - append doc_body " Issue Date [util_AnsiDatetoPrettyDate $issue_date] " + append gift_certs_for_users_html " Issued By $issuer \n" } else { - append doc_body " Issued By $issuer " + append gift_certs_for_users_html " Purchased By $purchaser \n" } - append doc_body " Purchased By $purchaser - " - + append gift_certs_for_users_html " [ec_decode $expired_p "t" "Expired" "Expires"] [ec_decode $expires "" "never" [util_AnsiDatetoPrettyDate $expires]] \n" if { $gift_certificate_state == "void" } { - append doc_body " [ec_decode $expired_p "t" "Expired" "Expires"] [ec_decode $expires "" "never" [util_AnsiDatetoPrettyDate $expires]] " + append gift_certs_for_users_html " Voided [util_AnsiDatetoPrettyDate $voided_date] by $voided_by_first_names $voided_by_last_name because: $reason_for_void \n" } - - append doc_body " Voided [util_AnsiDatetoPrettyDate $voided_date] by $voided_by_first_names $voided_by_last_name because: $reason_for_void - " + append gift_certs_for_users_html "
" } -if { $current_printed == 1 || $old_printed == 1 } { - append doc_body "