Index: openacs-4/packages/ecommerce/www/admin/products/sale-price-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/sale-price-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/sale-price-add.adp 16 Aug 2008 10:34:42 -0000 1.1 @@ -0,0 +1,37 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ + + + + + + + + + + + + + + + + + + + + + +
Sale Price@sale_price_html;noquote@
Name@sale_name@
Sale Begins@sale_begins_html;noquote@
Sale Ends@sale_ends_html;noquote@
Offer Code@offer_code_html;noquote@
+ +
+@export_form_vars_html;noquote@ + + +
+ +
+ +
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.7 -r1.8 --- openacs-4/packages/ecommerce/www/admin/products/sale-price-add.tcl 21 Apr 2008 14:18:29 -0000 1.7 +++ openacs-4/packages/ecommerce/www/admin/products/sale-price-add.tcl 16 Aug 2008 10:34:42 -0000 1.8 @@ -79,50 +79,18 @@ set product_name [ec_product_name $product_id] -doc_body_append "[ad_admin_header "Confirm Sale Price for $product_name"] +set title "Confirm Sale Price for $product_name" +set context [list [list index Products] $title] -

Confirm Sale Price for $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 Sale Price"] - -
-" - -set currency [ad_parameter -package_id [ec_id] Currency ecommerce] - set sale_price_id [db_nextval ec_sale_price_id_sequence] -doc_body_append " - - - - - - - - - - - - - - - - - - - - -
Sale Price[ec_pretty_price $sale_price $currency]
Name$sale_name
Sale Begins[util_AnsiDatetoPrettyDate [ec_date_text sale_begins]] [ec_time_text sale_begins]
Sale Ends[util_AnsiDatetoPrettyDate [ec_date_text sale_ends]] [ec_time_text sale_ends]
Offer Code[ec_decode $offer_code "" "None Needed" $offer_code]
+set sale_price_html [ec_pretty_price $sale_price $currency] +set sale_begins_html "[util_AnsiDatetoPrettyDate [ec_date_text sale_begins]] [ec_time_text sale_begins]" +set sale_ends_html "[util_AnsiDatetoPrettyDate [ec_date_text sale_ends]] [ec_time_text sale_ends]" +set offer_code_html [ec_decode $offer_code "" "None Needed" $offer_code] +set export_form_vars_html [export_form_vars sale_price_id product_id product_name sale_price sale_name offer_code] -
-[export_form_vars sale_price_id product_id product_name sale_price sale_name offer_code] - - -
- -
- -
-[ad_admin_footer] -" +set form_sale_begins_html [ec_datetime_text sale_begins] +set form_sale_ends_html [ec_datetime_text sale_ends] Index: openacs-4/packages/ecommerce/www/admin/products/sale-price-edit-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/sale-price-edit-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/sale-price-edit-2.adp 16 Aug 2008 10:34:42 -0000 1.1 @@ -0,0 +1,36 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ + + + + + + + + + + + + + + + + + + + + + +
Sale Price@sale_price_html@
Name@sale_name@
Sale Begins@sale_begins_html;noquote@
Sale Ends@sale_ends_html;noquote@
Offer Code@offer_code_html@
+ +
+ @export_form_vars_html;noquote@ + + +
+ +
+
Index: openacs-4/packages/ecommerce/www/admin/products/sale-price-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/sale-price-edit-2.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/ecommerce/www/admin/products/sale-price-edit-2.tcl 21 Apr 2008 14:18:29 -0000 1.6 +++ openacs-4/packages/ecommerce/www/admin/products/sale-price-edit-2.tcl 16 Aug 2008 10:34:42 -0000 1.7 @@ -1,7 +1,3 @@ - -set exception_count 0 -set exception_text "" - ad_page_contract { Update a sale price. @@ -22,19 +18,21 @@ sale_begins:array,date sale_ends:array,date offer_code_needed - offer_code:optional + {offer_code {}} } -validate { sale_begins_ok { set errmsg [ec_time_widget_validate sale_begins] + set exception_count 0 + set exception_text "" if { $errmsg ne "" } { - append exception_text "
  • $errmsg.\n" + append exception_text "
  • $errmsg.
  • \n" incr exception_count } } sale_ends_ok { set errmsg [ec_time_widget_validate sale_ends] if { $errmsg ne "" } { - append exception_text "
  • $errmsg.\n" + append exception_text "
  • $errmsg.
  • \n" incr exception_count } } @@ -49,7 +47,7 @@ if { $offer_code_needed == "yes_supplied" && (![info exists offer_code] || [empty_string_p $offer_code]) } { incr exception_count - append exception_text "
  • You forgot to specify an offer code.\n" + append exception_text "
  • You forgot to specify an offer code.
  • \n" } if { $exception_count > 0 } { @@ -60,6 +58,8 @@ # Error checking done set product_name [ec_product_name $product_id] +set title "Confirm Sale Price for $product_name" +set context [list [list index Products] $title] # If offer_code_needed is yes_generate, I need to generate a # offer_code @@ -68,53 +68,12 @@ set offer_code [ec_generate_random_string 8] } -# For the case where no offer code is required to get the sale price +set currency [parameter::get -package_id [ec_id] -parameter Currency -default "USD"] -if { ![info exists offer_code] } { - set offer_code "" -} - -doc_body_append " - [ad_admin_header "Confirm Sale Price for $product_name"] - -

    Confirm Sale Price for $product_name

    - - [ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "one.tcl?[export_url_vars product_id]" $product_name] "Confirm Sale Price"] - -
    " - -set currency [ad_parameter -package_id [ec_id] Currency ecommerce] - -doc_body_append " - - - - - - - - - - - - - - - - - - - - - -
    Sale Price[ec_pretty_price $sale_price $currency]
    Name$sale_name
    Sale Begins[util_AnsiDatetoPrettyDate [ec_date_text sale_begins]] [ec_time_text sale_begins]
    Sale Ends[util_AnsiDatetoPrettyDate [ec_date_text sale_ends]] [ec_time_text sale_ends]
    Offer Code[ec_decode $offer_code "" "None Needed" $offer_code]
    - -
    - [export_form_vars sale_price_id product_id product_name sale_price sale_name offer_code] - - -
    - -
    -
    - [ad_admin_footer]" +set sale_price_html [ec_pretty_price $sale_price $currency] +set sale_begins_html "[util_AnsiDatetoPrettyDate [ec_date_text sale_begins]] [ec_time_text sale_begins]" +set sale_ends_html "[util_AnsiDatetoPrettyDate [ec_date_text sale_ends]] [ec_time_text sale_ends]" +set offer_code_html [ec_decode $offer_code "" "None Needed" $offer_code] +set export_form_vars_html "[export_form_vars sale_price_id product_id product_name sale_price sale_name offer_code]" +set sale_begins_text [ec_datetime_text sale_begins] +set sale_ends_text [ec_datetime_text sale_ends] Index: openacs-4/packages/ecommerce/www/admin/products/sale-price-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/sale-price-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/sale-price-edit.adp 16 Aug 2008 10:34:42 -0000 1.1 @@ -0,0 +1,38 @@ + + @title;noquote@ + @context;noquote@ +

    @title@

    + +
    +@export_form_vars_html;noquote@ + + + + + + + + + + + + + + + + + + + + + +
    Sale Price (in @currency_html@)
    Name (like Special Offer or Introductory Price or Sale Price)
    Sale Begins@sale_begins_html;noquote@
    Sale Ends@sale_ends_html;noquote@
    Offer Code None needed
    + Require this code: +
    + Please generate a @offer_code_new_html@ code +
    + +
    + +
    +
    Index: openacs-4/packages/ecommerce/www/admin/products/sale-price-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/sale-price-edit.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/ecommerce/www/admin/products/sale-price-edit.tcl 9 Mar 2004 00:59:51 -0000 1.5 +++ openacs-4/packages/ecommerce/www/admin/products/sale-price-edit.tcl 16 Aug 2008 10:34:42 -0000 1.6 @@ -17,55 +17,20 @@ set product_name [ec_product_name $product_id] -doc_body_append " - [ad_admin_header "Edit Sale Price for $product_name"] +set title "Edit Sale Price for $product_name" +set context [list [list index Products] $title] -

    Edit Sale Price for $product_name

    +set export_form_vars_html [export_form_vars product_id product_name sale_price_id] - [ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "one.tcl?[export_url_vars product_id]" $product_name] "Edit Sale Price"] - -
    -
    - - [export_form_vars product_id product_name sale_price_id]" - db_1row sale_price_select " select sale_price, to_char(sale_begins,'YYYY-MM-DD HH24:MI:SS') as sale_begins, to_char(sale_ends,'YYYY-MM-DD HH24:MI:SS') as sale_ends, sale_name, offer_code from ec_sale_prices where sale_price_id = :sale_price_id" -doc_body_append " - - - - - - - - - - - - - - - - - - - - - -
    Sale Price (in [ad_parameter -package_id [ec_id] Currency ecommerce])
    Name (like Special Offer or Introductory Price or Sale Price)
    Sale Begins[ad_dateentrywidget sale_begins [ec_date_with_time_stripped $sale_begins]] [ec_time_widget sale_begins [lindex [split $sale_begins " "] 1]]
    Sale Ends[ad_dateentrywidget sale_ends [ec_date_with_time_stripped $sale_ends]] [ec_time_widget sale_ends [lindex [split $sale_ends " "] 1]]
    Offer Code None needed
    - Require this code: -
    - Please generate a [ec_decode $offer_code "" "" "new "]code -
    +set sale_begins_html "[ad_dateentrywidget sale_begins [ec_date_with_time_stripped $sale_begins]] [ec_time_widget sale_begins [lindex [split $sale_begins " "] 1]]" +set sale_ends_html "[ad_dateentrywidget sale_ends [ec_date_with_time_stripped $sale_ends]] [ec_time_widget sale_ends [lindex [split $sale_ends " "] 1]]" -
    - -
    - -
    - - [ad_admin_footer] " +set offer_code_none_html [ec_decode $offer_code "" "checked" ""] +set offer_code_required_html [ec_decode $offer_code "" "" "checked"] +set offer_code_new_html [ec_decode $offer_code "" "" "new"] +set currency_html [parameter::get -package_id [ec_id] -parameter Currency -default "USD"]