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 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

Please explain why you are voiding this gift certificate:

+ +
+@export_form_vars_html;noquote@ + +
+ +
+
+ Index: openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificate-void.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificate-void.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificate-void.tcl 9 Mar 2004 00:59:47 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/customer-service/gift-certificate-void.tcl 21 Aug 2008 10:43:40 -0000 1.5 @@ -1,5 +1,4 @@ # gift-certificate-void.tcl - ad_page_contract { @param gift_certificate_id @author @@ -20,31 +19,7 @@ ad_script_abort } +set title "Void Gift Certificate" +set context [list [list index "Customer Service"] $title] - -set page_title "Void Gift Certificate" -append doc_body "[ad_admin_header $page_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: - -
-[export_form_vars gift_certificate_id] - -
- -
- -
- -
- -
- -[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;noquote@ + @context;noquote@ +

@title@

+ +

Customer: @customer_info_html;noquote@

+Gift Certificate Account Balance: @gift_cert_account_bal_html;noquote@

+

Grant a gift certificate

+
+@export_form_vars_html;noquote@ + + + + + + + + + + +
Amount ()
Expires@gc_expires_widget_html;noquote
+
+@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] -

$page_title

+set title "Gift Certificates" +set context [list [list index "Customer Service"] $title] -[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] $page_title] +set customer_info_html "[db_string get_customer_info "select first_names || ' ' || last_name from cc_users where user_id=:user_id"]" -
-" +set gift_cert_account_bal_html "[ec_pretty_price [db_string get_pretty_price "select ec_gift_certificate_balance(:user_id) from dual"]]" +set export_form_vars_html [export_form_vars user_id] +set currency [parameter::get -package_id [ec_id] -parameter Currency -default "USD"] +set gc_expires_widget_html [ec_gift_certificate_expires_widget "in 1 year"] - -append doc_body "Customer: [db_string get_customer_info "select first_names || ' ' || last_name from cc_users where user_id=:user_id"] - -

- -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 -

-
-[export_form_vars user_id] - - - - - - - - - - -
Amount ([ad_parameter -package_id [ec_id] Currency ecommerce])
Expires[ec_gift_certificate_expires_widget "in 1 year"]
-
-
- -" - 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 "

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 "
" - } - append doc_body "Expired or Used Gift Certificates -
- " - set old_printed 1 + if { $current_printed == 1 } { + # do nothing + } + append gift_certs_for_users_html "

Expired or Usded Gift Certificates

" + set old_printed 1 } - incr gift_certificate_counter - append doc_body " - - - - - " + append gift_certs_for_users_html "
Gift Certificate ID    $gift_certificate_id
Amount Left[ec_pretty_price $amount_left] (out of [ec_pretty_price $amount])
Issue Date[util_AnsiDatetoPrettyDate $issue_date]
\n + + \n" if { ![empty_string_p $issuer_user_id] } { - append doc_body "" + append gift_certs_for_users_html "\n" } else { - append doc_body "" + append gift_certs_for_users_html "\n" } - append doc_body " - " - + append gift_certs_for_users_html "\n" if { $gift_certificate_state == "void" } { - append doc_body "" + append gift_certs_for_users_html "\n" } - - 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])
Issue Date[util_AnsiDatetoPrettyDate $issue_date]
Issued By$issuer
Issued By$issuer
Purchased By$purchaser
Purchased By$purchaser
[ec_decode $expired_p "t" "Expired" "Expires"][ec_decode $expires "" "never" [util_AnsiDatetoPrettyDate $expires]]
[ec_decode $expired_p "t" "Expired" "Expires"][ec_decode $expires "" "never" [util_AnsiDatetoPrettyDate $expires]]
Voided[util_AnsiDatetoPrettyDate $voided_date] by $voided_by_first_names $voided_by_last_name because: $reason_for_void
Voided[util_AnsiDatetoPrettyDate $voided_date] by $voided_by_first_names $voided_by_last_name because: $reason_for_void
" - - if { $expired_p == "f" && $amount_left > 0 && $gift_certificate_state != "void"} { - append doc_body "(void this) - " - } - - append doc_body "

- " + append gift_certs_for_users_html "
" } -if { $current_printed == 1 || $old_printed == 1 } { - append doc_body "

" -} - -append doc_body "[ad_admin_footer] -" - - -doc_return 200 text/html $doc_body