Index: openacs-4/packages/ecommerce/www/admin/orders/gift-certificate-void.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/gift-certificate-void.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/orders/gift-certificate-void.adp 18 Aug 2008 10:45:37 -0000 1.1 @@ -0,0 +1,11 @@ + + @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/orders/gift-certificate-void.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/gift-certificate-void.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/orders/gift-certificate-void.tcl 9 Mar 2004 00:59:50 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/orders/gift-certificate-void.tcl 18 Aug 2008 10:45:37 -0000 1.4 @@ -13,27 +13,8 @@ ad_require_permission [ad_conn package_id] admin -set page_title "Void Gift Certificate" -doc_body_append "[ad_admin_header $page_title] -

$page_title

+set title "Void Gift Certificate" +set context [list [list index "Orders / Shipments / Refunds"] $title] -[ad_context_bar [list "../index" "Ecommerce([ec_system_name])"] [list "index" "Orders"] [list "gift-certificates" "Gift Certificates"] "Void One"] +set export_form_vars_html [export_form_vars gift_certificate_id] -
-Please explain why you are voiding this gift certificate: - -
-[export_form_vars gift_certificate_id] - -
- -
- -
- -
- -
- -[ad_admin_footer] -" Index: openacs-4/packages/ecommerce/www/admin/orders/gift-certificate.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/gift-certificate.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/orders/gift-certificate.adp 18 Aug 2008 10:45:37 -0000 1.1 @@ -0,0 +1,12 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ + +

Gift certificate not found.

+
+ + @doc_body;noquote@ +
+
Index: openacs-4/packages/ecommerce/www/admin/orders/gift-certificate.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/gift-certificate.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/orders/gift-certificate.tcl 9 Aug 2008 10:33:13 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/orders/gift-certificate.tcl 18 Aug 2008 10:45:37 -0000 1.5 @@ -13,65 +13,41 @@ ad_require_permission [ad_conn package_id] admin -doc_body_append "[ad_admin_header "One Gift Certificate"] +set title "One Gift Certificate" +set context [list [list index "Orders / Shipments / Refunds"] $title] -

One Gift Certificate

- -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Orders"] [list "gift-certificates" "Gift Certificates"] "One"] - -
-
-" - - - - - -if {![db_0or1row gift_certificate_select " +set found_p [db_0or1row gift_certificate_select " 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, o.first_names || ' ' || o.last_name as owned_by from ec_gift_certificates c, cc_users i, cc_users p, cc_users v, cc_users o where c.issued_by=i.user_id(+) and c.purchased_by=p.user_id(+) and c.voided_by=v.user_id(+) and c.user_id=o.user_id(+) and c.gift_certificate_id=:gift_certificate_id -"]} { - doc_body_append "Not Found. [ad_admin_footer]" - return -} +"] -doc_body_append " - - - -" -if { ![empty_string_p $issuer_user_id] } { - doc_body_append " +if { $found_p } { +set doc_body "" + if { ![empty_string_p $issuer_user_id] } { + append doc_body "" -} else { - doc_body_append " - - " + } else { + append doc_body " + " - if { ![empty_string_p $user_id] } { - doc_body_append "" + if { ![empty_string_p $user_id] } { + append doc_body "" + } + } + append doc_body "" -} -doc_body_append " -" + if { $gift_certificate_state == "void" } { + append doc_body "" + } -if { $gift_certificate_state == "void" } { - doc_body_append "" + if { $expired_p == "f" && $amount_left > 0 && $gift_certificate_state != "void"} { + append doc_body "" + } } -doc_body_append "
Gift Certificate ID    $gift_certificate_id
Amount Left[ec_pretty_pure_price $amount_left] (out of [ec_pretty_pure_price $amount])
Issued By$issuer on [util_AnsiDatetoPrettyDate $issue_date]
Issued By$issuer on [util_AnsiDatetoPrettyDate $issue_date]
Issued To$owned_by
Purchased By$purchaser on [util_AnsiDatetoPrettyDate $issue_date]
Sent To$recipient_email
Purchased By$purchaser on [util_AnsiDatetoPrettyDate $issue_date]
Sent To$recipient_email
Claimed By$owned_by on [util_AnsiDatetoPrettyDate $claimed_date]
Claimed By$owned_by on [util_AnsiDatetoPrettyDate $claimed_date]
[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
(void this)
" - -if { $expired_p == "f" && $amount_left > 0 && $gift_certificate_state != "void"} { - doc_body_append "(void this) - " -} - -doc_body_append "
-[ad_admin_footer] -" Index: openacs-4/packages/ecommerce/www/admin/orders/gift-certificates-issued.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/gift-certificates-issued.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/orders/gift-certificates-issued.adp 18 Aug 2008 10:45:37 -0000 1.1 @@ -0,0 +1,36 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +
+ + + + + + + + + +
RepIssue Date
+ + + + @linked_issue_date_list_html;noquote@ +
+
+ + + + + @header_html;noquote + + @gift_certificates_select_html;noquote@ +
+
+

None found.

+
Index: openacs-4/packages/ecommerce/www/admin/orders/gift-certificates-issued.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/gift-certificates-issued.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/ecommerce/www/admin/orders/gift-certificates-issued.tcl 9 Aug 2008 10:33:13 -0000 1.6 +++ openacs-4/packages/ecommerce/www/admin/orders/gift-certificates-issued.tcl 18 Aug 2008 10:45:37 -0000 1.7 @@ -16,65 +16,35 @@ ad_require_permission [ad_conn package_id] admin -doc_body_append " - [ad_admin_header "Gift Certificate Issue History"] +set title "Gift Certificate Issue History" +set context [list [list index "Orders / Shipments / Refunds"] $title] -

Gift Certificate Issue History

+set export_form_vars_html [export_form_vars view_issue_date order_by] - [ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Orders"] "Gift Certificate Issue History"] - -
- -
- [export_form_vars view_issue_date order_by] - - - - - - - - - - -
RepIssue Date
- - - " - set issue_date_list [list [list last_24 "last 24 hrs"] [list last_week "last week"] [list last_month "last month"] [list all all]] set linked_issue_date_list [list] - foreach issue_date $issue_date_list { if {$view_issue_date == [lindex $issue_date 0]} { - lappend linked_issue_date_list "[lindex $issue_date 1]" + lappend linked_issue_date_list "[lindex $issue_date 1]" } else { - lappend linked_issue_date_list "[lindex $issue_date 1]" + lappend linked_issue_date_list "[lindex $issue_date 1]" } } -doc_body_append " - \[ [join $linked_issue_date_list " | "] \] -
-
-
" +set linked_issue_date_list_html "\[ [join $linked_issue_date_list " | "] \]" if { $view_issue_date == "last_24" } { set issue_date_query_bit [db_map last_24] @@ -101,53 +71,34 @@ "recipient" "r.last_name, r.first_names" \ "amount" "g.amount"] -set table_header " - - - +set table_header " - - " + " set row_counter 0 - -db_foreach gift_certificates_select " - select g.gift_certificate_id, g.issue_date, g.amount, +set gift_certificates_select_html "" +db_foreach gift_certificates_select "select g.gift_certificate_id, g.issue_date, g.amount, g.issued_by, u.first_names, u.last_name, g.user_id as issued_to, r.first_names as issued_to_first_names, r.last_name as issued_to_last_name from ec_gift_certificates_issued g, cc_users u, cc_users r where g.issued_by=u.user_id and g.user_id=r.user_id $issue_date_query_bit $rep_query_bit order by $order_by_clause" { - if { $row_counter == 0 } { - doc_body_append $table_header - } # even rows are white, odd are grey if { [expr floor($row_counter/2.)] == [expr $row_counter/2.] } { - set bgcolor "white" + set bgcolor "#ffffff" } else { - set bgcolor "ececec" + set bgcolor "#ececec" } - doc_body_append " - + append gift_certificates_select_html " - " + " incr row_counter } -if { $row_counter != 0 } { - doc_body_append "
IDID Date Issued Issued By RecipientAmount
Amount
$gift_certificate_id [ec_nbsp_if_null [util_AnsiDatetoPrettyDate $issue_date]] [ec_decode $last_name "" " " "$last_name, $first_names"] [ec_decode $last_name "" " " "$issued_to_last_name, $issued_to_first_names"][ec_pretty_pure_price $amount][ec_pretty_pure_price $amount]
" -} else { - doc_body_append "
None Found
" -} - -doc_body_append " -
- - [ad_admin_footer]" Index: openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.adp 18 Aug 2008 10:45:37 -0000 1.1 @@ -0,0 +1,33 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +
+ @export_form_vars_html;noquote@ + + + + + + + + + +
Gift Certificate StateIssue Date
+ @linked_issue_date_list_html;noquote@ +
+
+ + + + + @table_header_html;noquote@ + + @gift_certificates_select_html;noquote@ +
+
+

None found.

+
Index: openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.tcl 9 Aug 2008 10:33:13 -0000 1.6 +++ openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.tcl 18 Aug 2008 10:45:37 -0000 1.7 @@ -16,64 +16,37 @@ ad_require_permission [ad_conn package_id] admin -doc_body_append " - [ad_admin_header "Gift Certificate Purchase History"] +set title "Gift Certificate Purchase History" +set context [list [list index "Orders / Shipments / Refunds"] $title] -

Gift Certificate Purchase History

+set export_form_vars_html [export_form_vars view_issue_date order_by] - [ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Orders"] "Gift Certificate Purchase History"] - -
- -
- [export_form_vars view_issue_date order_by] - - - - - - - - - - -
Gift Certificate StateIssue Date
- - " - set issue_date_list [list [list last_24 "last 24 hrs"] [list last_week "last week"] [list last_month "last month"] [list all all]] set linked_issue_date_list [list] - foreach issue_date $issue_date_list { if {$view_issue_date == [lindex $issue_date 0]} { - lappend linked_issue_date_list "[lindex $issue_date 1]" + lappend linked_issue_date_list "[lindex $issue_date 1]" } else { - lappend linked_issue_date_list "[lindex $issue_date 1]" + lappend linked_issue_date_list "[lindex $issue_date 1]" } } -doc_body_append " - \[ [join $linked_issue_date_list " | "] \] -
-
-
" +set linked_issue_date_list_html "\[ [join $linked_issue_date_list " | "] \]" set gift_certificate_state_query_bit "and g.gift_certificate_state=:view_gift_certificate_state" @@ -97,54 +70,34 @@ "recipient_email" "g.recipient_email" \ "amount" "g.amount"] -set table_header " - - - +set table_header_html " - - " + " set row_counter 0 +set gift_certificates_select_html "" db_foreach gift_certificates_select " select g.gift_certificate_id, g.issue_date, g.gift_certificate_state, g.recipient_email, g.purchased_by, g.amount, u.first_names, u.last_name from ec_gift_certificates g, cc_users u where g.purchased_by=u.user_id $issue_date_query_bit $gift_certificate_state_query_bit order by $order_by_clause" { - if { $row_counter == 0 } { - doc_body_append $table_header - } - # Even rows are white, odd are grey - if { [expr floor($row_counter/2.)] == [expr $row_counter/2.] } { - set bgcolor "white" + set bgcolor "#ffffff" } else { - set bgcolor "ececec" + set bgcolor "#ececec" } - doc_body_append " - + append gift_certificates_select_html " - " + " incr row_counter } - -if { $row_counter != 0 } { - doc_body_append "
IDID Date Issued Gift Certificate State Purchased By RecipientAmount
Amount
$gift_certificate_id [ec_nbsp_if_null [util_AnsiDatetoPrettyDate $issue_date]] $gift_certificate_state [ec_decode $last_name "" " " "$last_name, $first_names"] $recipient_email[ec_pretty_pure_price $amount][ec_pretty_pure_price $amount]
" -} else { - doc_body_append "
None Found
" -} - -doc_body_append " -
- - [ad_admin_footer]"