Index: openacs-4/packages/ecommerce/www/admin/templates/add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/add-2.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/templates/add-2.adp 19 Aug 2008 02:46:21 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/templates/add-2.adp 19 Aug 2008 05:41:47 -0000 1.2 @@ -4,6 +4,7 @@

@title@

+@export_form_vars_html;noquote@

Name: @template_name@

ADP template:

Index: openacs-4/packages/ecommerce/www/admin/templates/category-associate-2.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/category-associate-2.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ecommerce/www/admin/templates/category-associate-2.adp	19 Aug 2008 05:41:47 -0000	1.1
@@ -0,0 +1,15 @@
+
+  @title;noquote@
+  @context;noquote@
+

@title@

+ +

This will cause @category_name@ to no longer be associated with its previous template, @old_template@. Continue?

+ + +@export_vars_html;noquote@ +@export_form_vars_html;noquote@ +@hidden_input_html;noquote@ +
+ +
+ Index: openacs-4/packages/ecommerce/www/admin/templates/category-associate-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/category-associate-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/templates/category-associate-2.tcl 9 Mar 2004 00:59:54 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/templates/category-associate-2.tcl 19 Aug 2008 05:41:47 -0000 1.5 @@ -19,16 +19,12 @@ # see if the category_id is already in ec_category_template_map because # then the user should be warned and also we can then do an update instead # of an insert - - - if { [db_0or1row check_existence_t "select template_name as old_template from ec_templates, ec_category_template_map m where ec_templates.template_id = m.template_id and m.category_id=:category_id"] ==0 } { # then this category_id isn't already in the map table - db_dml insert_cat_temp_map "insert into ec_category_template_map (category_id, template_id) values (:category_id, :template_id)" ad_returnredirect "index" @@ -50,30 +46,11 @@ # we have to warn the user first that the category will no longer be mapped to its previous template +set title "Confirm Association" +set context [list [list index "Product Templates"] $title] -set page_html "[ad_admin_header "Confirm Association"] +set export_vars_html [ad_export_vars -form t {confirmed yes} template_id category_id] -

Confirm Association

+set export_form_vars_html [export_form_vars template_id category_id] +set hidden_input_html [ec_hidden_input "confirmed" "yes"] -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Product Templates"] [list "one.tcl?template_id=$template_id" "$template_name"] "Confirm Association"] - -
- -This will cause $category_name to no longer be associated with its previous template, $old_template. Continue? - -
-[ad_export_vars -form t {confirmed yes} template_id category_id] -foo -[export_form_vars template_id category_id] -[ec_hidden_input "confirmed" "yes"] - -
- -
-
- -[ad_admin_footer] -" - - -doc_return 200 text/html $page_html \ No newline at end of file Index: openacs-4/packages/ecommerce/www/admin/templates/category-associate.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/category-associate.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/templates/category-associate.adp 19 Aug 2008 05:41:47 -0000 1.1 @@ -0,0 +1,43 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

+The point of doing this is just to make it a little faster when +you are adding new products. It is completely optional. +

+ +If you associate this template with a product category, then whenever +you add a new product of that category, the product will by default be +set to display with this template, although you can always change it. +(However, if you add a new product and put it in more than one +category, then this template might not end up being the default for +that product.) + +

+ +This template may be associated with as many categories as you like. + + +

Currently this template is associated with the +category(ies):

    +@template_associations_html;noquote@ +
+ +

This template has not yet been associated with any categories.

+
+ + +

All categories are associated with this template. There are none left to add!

+
+
+ @export_form_vars_html;noquote@ +

Category: + + +

+
+
Index: openacs-4/packages/ecommerce/www/admin/templates/category-associate.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/category-associate.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/templates/category-associate.tcl 9 Mar 2004 00:59:54 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/templates/category-associate.tcl 19 Aug 2008 05:41:47 -0000 1.4 @@ -1,7 +1,6 @@ # www/[ec_url_concat [ec_url] /admin]/templates/category-associate.tcl ad_page_contract { - @param template - + @param template @author @creation-date @cvs-id $Id$ @@ -12,102 +11,46 @@ ad_require_permission [ad_conn package_id] admin -db_1row get_template_data " -select template_name, template +db_1row get_template_data "select template_name, template from ec_templates - where template_id=:template_id -" + where template_id=:template_id" -set page_html "[ad_admin_header "Associate with a Category"] +set title "Associate with a Category" +set context [list [list index "Product Templates"] $title] -

Associate with a Category

- -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Product Templates"] [list "one.tcl?template_id=$template_id" "$template_name"] "Associate with a Category"] - -
- -The point of doing this is just to make it a little faster when -you are adding new products. It is completely optional. - -

- -If you associate this template with a product category, then whenever -you add a new product of that category, the product will by default be -set to display with this template, although you can always change it. -(However, if you add a new product and put it in more than one -category, then this template might not end up being the default for -that product.) - -

- -This template may be associated with as many categories as you like. -" # see if it's already associated with any categories - -set n_categories_associated_with [db_string get_n_category_assocs " -select count(*) +set n_categories_associated_with [db_string get_n_category_assocs "select count(*) from ec_category_template_map - where template_id=:template_id -"] + where template_id=:template_id"] + +set template_associations_html "" if { $n_categories_associated_with > 0 } { - append page_html "Currently this template is associated with the category(ies):\n

    \n" - db_foreach get_each_template_assoc " select m.category_id, c.category_name from ec_category_template_map m, ec_categories c where m.category_id = c.category_id - and m.template_id = :template_id - " { - - append page_html "
  • $category_name\n" + and m.template_id = :template_id" { + append template_associations_html "
  • $category_name
  • " } +} - append page_html "
\n" - -} else { - append page_html " This template has not yet been associated with any categories." -} - # see if there are any categories left to associate it with -set n_categories_left [db_string get_n_left " -select count(*) +set n_categories_left [db_string get_n_left "select count(*) from ec_categories where category_id not in (select category_id from ec_category_template_map - where template_id=:template_id) -"] + where template_id=:template_id)"] -if { $n_categories_left == 0 } { - append page_html "All categories are associated with this template. There are none left to add!" -} else { +if { $n_categories_left > 0 } { - append page_html " -
- [export_form_vars template_id] - - Category: - - -
- " } - -append page_html [ad_admin_footer] - -doc_return 200 text/html $page_html Index: openacs-4/packages/ecommerce/www/admin/templates/delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/templates/delete.adp 19 Aug 2008 05:41:47 -0000 1.1 @@ -0,0 +1,15 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

+Please confirm that you want to delete this template. If any products are set to use this template, they will +now be displayed with the default template. +

+
+ @export_form_vars_html;noquote@ +
+ +
+
Index: openacs-4/packages/ecommerce/www/admin/templates/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/delete.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/templates/delete.tcl 9 Mar 2004 00:59:54 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/templates/delete.tcl 19 Aug 2008 05:41:47 -0000 1.4 @@ -14,44 +14,20 @@ # check if this is the template that the admin has assigned as the default # in which case they'll have to select a new default before they can delete # this one - - set default_template_id [db_string get_default_id "select default_template from ec_admin_settings"] if { $template_id == $default_template_id } { - ad_return_complaint 1 "You cannot delete this template because it is the default template that + ad_return_complaint 1 "
  • You cannot delete this template because it is the default template that products will be displayed with if they are not set to be displayed with a different template. -

    +

    If you want to delete this template, you can do so by first setting a different template to be the default template. (To do this, go to a different template and click \"Make this template - be the default template\".)" + be the default template\".)

  • " return } +set title "Confirm Deletion" +set context [list [list index "Product Templates"] $title] -set page_html "[ad_admin_header "Confirm Deletion"] - -

    Confirm Deletion

    - -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Product Templates"] "Delete Template"] - -
    - -Please confirm that you want to delete this template. If any products are set to use this template, they will -now be displayed with the default template. - -
    -[export_form_vars template_id] -
    - -
    - -
    - -[ad_admin_footer] -" - - - -doc_return 200 text/html $page_html \ No newline at end of file +set export_form_vars_html [export_form_vars template_id] Index: openacs-4/packages/ecommerce/www/admin/templates/make-default.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/make-default.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/templates/make-default.adp 19 Aug 2008 05:41:47 -0000 1.1 @@ -0,0 +1,15 @@ + + @title;noquote@ + @context;noquote@ +

    @title@

    + +

    +Please confirm that you want this to become the default template that products will be displayed with +if no template has been specifically assigned to them. +

    +
    +@export_form_vars_html;noquote@ +
    + +
    +
    Index: openacs-4/packages/ecommerce/www/admin/templates/make-default.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/make-default.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/templates/make-default.tcl 9 Mar 2004 00:59:54 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/templates/make-default.tcl 19 Aug 2008 05:41:47 -0000 1.4 @@ -13,30 +13,7 @@ db_1row get_template_info "select template_name, template from ec_templates where template_id=:template_id" +set title "Set Default Template" +set context [list [list index "Product Templates"] $title] -set page_html "[ad_admin_header "Set Default Template"] - -

    Set Default Template

    - -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Product Templates"] [list "one.tcl?template_id=$template_id" "$template_name"] "Set as Default"] - -
    - -Please confirm that you want this to become the default template that products will be displayed with -if no template has been specifically assigned to them. - -

    -

    -[export_form_vars template_id] -
    - -
    -
    - -[ad_admin_footer] -" - -doc_return 200 text/html $page_html - - - +set export_form_vars_html [export_form_vars template_id] Index: openacs-4/packages/ecommerce/www/admin/templates/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/templates/one.adp 19 Aug 2008 05:41:47 -0000 1.1 @@ -0,0 +1,28 @@ + + @title;noquote@ + @context;noquote@ +

    @title@

    + + +

    This is the default template used for product display.

    +
    +

    The template: @template_name@

    +
    +@template@
    +
    +
    +

    Actions:

    + Index: openacs-4/packages/ecommerce/www/admin/templates/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/templates/one.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/templates/one.tcl 9 Mar 2004 00:59:54 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/templates/one.tcl 19 Aug 2008 05:41:47 -0000 1.4 @@ -13,43 +13,15 @@ db_1row get_template_data "select template_name, template from ec_templates where template_id=:template_id" - set default_template_id [db_string get_default_template "select default_template from ec_admin_settings"] +set title "Template ${template_name}" +set context [list [list index "Product Templates"] $title] -set page_html "[ad_admin_header "$template_name"] +set default_template_p [expr { $template_id == $default_template_id } ] -

    $template_name

    +set export_url_vars_html [export_url_vars template_id] -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Product Templates"] "One Template"] - -
    -" - -if { $template_id == $default_template_id } { - append page_html "This is the default template used for product display.

    " -} - -append page_html "

    The template:

    - -
    -
    -[ns_quotehtml $template]
    -
    -
    - -

    - -

    Actions:

    - - - -[ad_admin_footer] -" - - -doc_return 200 text/html $page_html - - +set audit_url_html "[ec_url_concat [ec_url] /admin]/audit?[export_url_vars audit_name audit_id audit_id_column return_url audit_tables main_tables]"