Index: openacs-4/packages/ecommerce/www/admin/products/offer-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/offer-delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/offer-delete.adp 15 Aug 2008 12:46:06 -0000 1.1 @@ -0,0 +1,11 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +
+@export_form_vars_html;noquote@ +
+ +
+
Index: openacs-4/packages/ecommerce/www/admin/products/offer-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/offer-delete.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/offer-delete.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/offer-delete.tcl 15 Aug 2008 12:46:06 -0000 1.4 @@ -23,24 +23,7 @@ set delete_or_undelete "Undelete" set deletion_or_undeletion "Undeletion" } +set title "Confirm $deletion_or_undeletion of Retailer Offer on $product_name" +set context [list [list index Products] $title] -doc_body_append "[ad_admin_header "Confirm $deletion_or_undeletion of Retailer Offer on $product_name"] - -

Confirm $deletion_or_undeletion of Retailer Offer on $product_name

- -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "one.tcl?[export_url_vars product_id]" $product_name] "$delete_or_undelete Retailer Offer"] - -
-" - -doc_body_append "
-[export_form_vars deleted_p product_id retailer_id] - -
- -
- -
- -[ad_admin_footer] -" +set export_form_vars_html [export_form_vars deleted_p product_id retailer_id] Index: openacs-4/packages/ecommerce/www/admin/products/offer-edit-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/offer-edit-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/offer-edit-2.adp 15 Aug 2008 12:46:06 -0000 1.1 @@ -0,0 +1,42 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Retailer:@retailer_name_select_html;noquote@
Price:@price_html;noquote@
Shipping:@shipping_html;noquote@
Stock Status:@stock_status_html;noquote@
Offer Begins@offer_begins_html;noquote@
Offer Expires@offer_ends_html;noquote@
Special Offer:@special_offer_html;noquote@
+ +
+@export_form_vars_html;noquote@ +
+ +
+
+ Index: openacs-4/packages/ecommerce/www/admin/products/offer-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/offer-edit-2.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/ecommerce/www/admin/products/offer-edit-2.tcl 21 Apr 2008 14:18:29 -0000 1.5 +++ openacs-4/packages/ecommerce/www/admin/products/offer-edit-2.tcl 15 Aug 2008 12:46:06 -0000 1.6 @@ -106,69 +106,28 @@ return } -doc_body_append "[ad_admin_header "Confirm Retailer Offer on $product_name"] +set title "Confirm Retailer Offer on $product_name" +set context [list [list index Products] $title] -

Confirm Retailer Offer on $product_name

+set currency [parameter::get -package_id [ec_id] -parameter Currency -default "USD"] -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "one.tcl?[export_url_vars product_id]" $product_name] "Confirm Retailer Offer"] +set retailer_name_select_html [db_string retailer_name_select "select retailer_name || ' (' || city || ', ' || usps_abbrev || ')' as retailer_name_to_print from ec_retailers where retailer_id=:retailer_id"] +set price_html [ec_pretty_price $price $currency] -
-" - -set currency [ad_parameter -package_id [ec_id] Currency ecommerce] - -doc_body_append " - - - - - - - - - - -" -if { [info exists shipping_unavailable_p] } { - doc_body_append "\n" +if { [info exists shipping_unavailable_p] && $shipping_unavailable_p eq "t" } { + set shipping_html "Pick Up" } else { - doc_body_append "\n" + set shipping_html "[ec_pretty_price $shipping $currency]" + set shipping_unavailable_p "f" } -doc_body_append " - - - - - - - - - - - - -" -if { $special_offer_p == "t" } { - doc_body_append "\n" -} +set offer_begins_html "[util_AnsiDatetoPrettyDate $offer_begins]" +set offer_ends_html "[util_AnsiDatetoPrettyDate $offer_ends]" -doc_body_append "
Retailer:[db_string retailer_name_select "select retailer_name || ' (' || city || ', ' || usps_abbrev || ')' as retailer_name_to_print from ec_retailers where retailer_id=:retailer_id"]
Price:[ec_pretty_price $price $currency]
Shipping:Pick Up[ec_pretty_price $shipping $currency]
Stock Status: -" if { ![empty_string_p $stock_status] } { - doc_body_append [util_memoize "ad_parameter -package_id [ec_id] \"StockMessage[string toupper $stock_status]\"" [ec_cache_refresh]] + set stock_status_html [util_memoize "ad_parameter -package_id [ec_id] \"StockMessage[string toupper $stock_status]\"" [ec_cache_refresh]] } else { - doc_body_append [ec_message_if_null $stock_status] + set stock_status_html [ec_message_if_null $stock_status] } -doc_body_append "
Offer Begins[util_AnsiDatetoPrettyDate $offer_begins]
Offer Expires[util_AnsiDatetoPrettyDate $offer_ends]
Special Offer:$special_offer_html
- -
-[export_form_vars offer_id product_id retailer_id price shipping stock_status old_retailer_id offer_begins offer_ends special_offer_p special_offer_html shipping_unavailable_p] -
- -
-
- -[ad_admin_footer] -" +set export_form_vars_html "[export_form_vars offer_id product_id retailer_id price shipping stock_status old_retailer_id offer_begins offer_ends special_offer_p special_offer_html shipping_unavailable_p]" Index: openacs-4/packages/ecommerce/www/admin/products/offer-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/offer-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/offer-edit.adp 15 Aug 2008 12:46:06 -0000 1.1 @@ -0,0 +1,63 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +
+@export_form_vars_html;noquote@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Retailer + + +
Price (in $currency)
Shipping (in $currency) +  or   +checked> +Pick Up only +
Stock Status@stock_status_html;noquote@
Offer Begins@offer_begins_html;noquote@
Offer Expires@offer_expires_html;noquote@
Is this a Special Offer? +checked> Yes   +checked> No +
If yes, elaborate:
+ +
+ +
+ +
Index: openacs-4/packages/ecommerce/www/admin/products/offer-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/offer-edit.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/products/offer-edit.tcl 9 Mar 2004 00:59:51 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/products/offer-edit.tcl 15 Aug 2008 12:46:06 -0000 1.5 @@ -16,112 +16,33 @@ set product_name [ec_product_name $product_id] -doc_body_append "[ad_admin_header "Edit Retailer Offer on $product_name"] +set title "Edit Retailer Offer on $product_name" +set context [list [list index Products] $title] -

Edit Retailer Offer on $product_name

- -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "one.tcl?[export_url_vars product_id]" $product_name] "Edit Retailer Offer"] - -
-" - set old_retailer_id $retailer_id +set export_form_vars_html [export_form_vars offer_id product_id product_name old_retailer_id] -doc_body_append "
-[export_form_vars offer_id product_id product_name old_retailer_id] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Retailer - - -
Price (in $currency)
Shipping (in $currency) -  or   - -Pick Up only -
Stock Status[ec_stock_status_widget $stock_status]
Offer Begins[ad_dateentrywidget offer_begins $offer_begins]
Offer Expires[ad_dateentrywidget offer_ends $offer_ends]
Is this a Special Offer? -Yes   -No -
If yes, elaborate:
- -
- -
- -
- -[ad_admin_footer] -" Index: openacs-4/packages/ecommerce/www/admin/products/offers.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/offers.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/offers.adp 15 Aug 2008 12:46:06 -0000 1.1 @@ -0,0 +1,81 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ + +

There are no current offers.

+
+
    +@offers_select_html;noquote@ +
+
+

+ +

Add an Offer

+ +
+@export_product_id_html;noquote@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Retailer + + +
Price (in @currency@)
Shipping (in @currency@) +  or   + +Pick Up only +
Stock Status@stock_status_html;noquote@
Offer Begins@offer_begins_html;noquote@
Offer Expires@offer_expires_html;noquote@
Is this a Special Offer? +Yes   +No +
If yes, elaborate:
+
+
+ +
+
+ +
+

Non-Current or Deleted Offers

+ + +

There are no non-current or deleted offers.

+
+
    +@non_current_offers_select_html;noquote@ +
      + Index: openacs-4/packages/ecommerce/www/admin/products/offers.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/offers.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/products/offers.tcl 9 Mar 2004 00:59:51 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/products/offers.tcl 15 Aug 2008 12:46:06 -0000 1.5 @@ -15,47 +15,47 @@ proc ec_write_out_one_offer {} { uplevel { - doc_body_append "
    • $retailer_name
      + append doc_body "
    • $retailer_name
      Price: [ec_message_if_null [ec_pretty_price $price $currency]]
      Shipping: " if { $shipping_unavailable_p != "t" } { - doc_body_append "[ec_message_if_null [ec_pretty_price $shipping $currency]]
      " + append doc_body "[ec_message_if_null [ec_pretty_price $shipping $currency]]
      " } else { - doc_body_append "Pick Up
      " + append doc_body "Pick Up
      " } - doc_body_append "Stock Status: " + append doc_body "Stock Status: " if { ![empty_string_p $stock_status] } { - doc_body_append [util_memoize "ad_parameter -package_id [ec_id] \"StockMessage[string toupper $stock_status]\"" [ec_cache_refresh]] + append doc_body [util_memoize "ad_parameter -package_id [ec_id] \"StockMessage[string toupper $stock_status]\"" [ec_cache_refresh]] } else { - doc_body_append "[ec_message_if_null $stock_status]
      \n" + append doc_body "[ec_message_if_null $stock_status]
      \n" } - doc_body_append "Offer Begins: [util_AnsiDatetoPrettyDate $offer_begins]
      + append doc_body "Offer Begins: [util_AnsiDatetoPrettyDate $offer_begins]
      Offer Expires: [util_AnsiDatetoPrettyDate $offer_ends]
      " if { $special_offer_p == "t" } { - doc_body_append "Special Offer: $special_offer_html
      \n" + append doc_body "Special Offer: $special_offer_html
      \n" } if { $deleted_p == "t" } { - doc_body_append "This offer is deleted.
      \n" + append doc_body "This offer is deleted.
      \n" } elseif { !$offer_begun_p } { - doc_body_append "This offer has not yet begun.
      \n" + append doc_body "This offer has not yet begun.
      \n" } elseif { $offer_expired_p } { - doc_body_append "This offer has expired.
      \n" + append doc_body "This offer has expired.
      \n" } - doc_body_append "\[edit | edit | " + append doc_body "&[export_url_vars product_id product_name retailer_id]\">" if { $deleted_p == "t" } { - doc_body_append "un" + append doc_body "un" } # Set audit variables @@ -67,24 +67,20 @@ set audit_tables [list ec_offers_audit] set main_tables [list ec_offers] - doc_body_append "delete | audit trail\] + append doc_body "delete | audit trail\]

      " } +return $doc_body } -doc_body_append "[ad_admin_header "Retailer Offers on $product_name"] +set title "Retailer Offers on $product_name" +set context [list [list index Products] $title] -

      Retailer Offers on $product_name

      +set currency [parameter::get -package_id [ec_id] -parameter Currency -default "USD"] -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "one.tcl?[export_url_vars product_id]" $product_name] "Retailer Offers"] - -
      -

      Current Offers

      -
        -" -set currency [ad_parameter -package_id [ec_id] Currency ecommerce] - +set no_offers 0 +set offers_select_html "" db_foreach offers_select " select o.offer_id, o.retailer_id, r.retailer_name, price, shipping, stock_status, special_offer_p, special_offer_html, @@ -94,90 +90,25 @@ from ec_offers_current o, ec_retailers r where o.retailer_id=r.retailer_id and o.product_id=:product_id -order by o.last_modified desc -" { - ec_write_out_one_offer +order by o.last_modified desc" { + append offers_select_html ec_write_out_one_offer } if_no_rows { - doc_body_append "There are no current offers.\n" + set no_offers 1 } -doc_body_append "
      +set export_product_id_html [export_form_vars product_id] -

      - -

      Add an Offer

      - -
      -[export_form_vars product_id] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -Retailer - - -
      Price (in $currency)
      Shipping (in $currency) -  or   - -Pick Up only -
      Stock Status[ec_stock_status_widget]
      Offer Begins[ad_dateentrywidget offer_begins]
      Offer Expires[ad_dateentrywidget offer_ends now]
      Is this a Special Offer? -Yes   -No -
      If yes, elaborate:
      +set stock_status_html [ec_stock_status_widget] +set offer_begins_html [ad_dateentrywidget offer_begins] +set offer_expires_html [ad_dateentrywidget offer_ends now] -

      - -

      - -
      - -
      - -

      - -

      Non-Current or Deleted Offers

      - -
        -" -set currency [ad_parameter -package_id [ec_id] Currency ecommerce] - +set non_current_offers_select_html "" +set no_non_current_offers 0 db_foreach non_current_offers_select " select o.offer_id, o.retailer_id, retailer_name, price, shipping, stock_status, special_offer_p, special_offer_html, @@ -189,14 +120,9 @@ and o.product_id=:product_id and (o.deleted_p='t' or o.offer_begins - sysdate > 0 or o.offer_ends - sysdate < 0) order by o.last_modified desc" { - ec_write_out_one_offer + append non_current_offers_select_html ec_write_out_one_offer } if_no_rows { - doc_body_append "There are no non-current or deleted offers.\n" + set no_non_current_offers 1 } db_release_unused_handles - -doc_body_append "
      - -[ad_admin_footer] -" \ No newline at end of file