Index: openacs-4/packages/ecommerce/www/admin/products/custom-field-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-field-add-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/custom-field-add-2.adp 14 Aug 2008 21:48:24 -0000 1.1 @@ -0,0 +1,34 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ + + + + + + + + + + + + + + + + + +
Unique Identifier:@field_identifier@
Field Name:@field_name@
Default Value:@default_value@
Kind of Information:@column_type_html;noquote@
+ +

Please note that you can never remove a custom field, although + you can deactivate it. Furthermore, the Unique Identifier cannot + be changed and, in most cases, neither can Kind of Information.

+ +
+ @export_form_vars_html;noquote@ +
+ +
+
Index: openacs-4/packages/ecommerce/www/admin/products/custom-field-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-field-add-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/products/custom-field-add-2.tcl 9 Mar 2004 00:59:51 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/products/custom-field-add-2.tcl 14 Aug 2008 21:48:24 -0000 1.5 @@ -24,7 +24,7 @@ if { [empty_string_p $field_identifier] } { incr exception_count - append exception_text "
  • You forgot to enter a unique identifier.
  • " + append exception_text "
  • The form requires a unique identifier.
  • " } elseif { [regexp {[^a-z]} $field_identifier] } { incr exception_count append exception_text "
  • The unique identifier can only contain lowercase letters; no other characters are allowed.
  • " @@ -44,55 +44,22 @@ if { [empty_string_p $field_name] } { incr exception_count - append exception_text "
  • You forgot to enter a field name.
  • " + append exception_text "
  • Form requires a field name.
  • " } if { [empty_string_p $column_type] } { incr exception_count - append exception_text "
  • You forgot to enter the kind of information.
  • " + append exception_text "
  • Form requires identifying the field type (kind of information).
  • " } if { $exception_count > 0 } { ad_return_complaint $exception_count $exception_text return } -doc_body_append " - [ad_admin_header "Confirm Custom Field"] +set title "Confirm Custom Field" +set context [list [list index Products] $title] -

    Confirm Custom Field

    +set column_type_html [ec_pretty_column_type $column_type] - [ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "custom-fields.tcl" "Custom Fields"] "Confirm New Custom Field"] - -
    - - - - - - - - - - - - - - - - - - -
    Unique Identifier:$field_identifier
    Field Name:$field_name
    Default Value:$default_value
    Kind of Information:[ec_pretty_column_type $column_type]
    - -

    Please note that you can never remove a custom field, although - you can deactivate it. Furthermore, the Unique Identifier cannot - be changed and, in most cases, neither can Kind of Information.

    - -
    - [export_form_vars field_identifier field_name default_value column_type] -
    - -
    -
    - [ad_admin_footer]" +set export_form_vars_html [export_form_vars field_identifier field_name default_value column_type] Index: openacs-4/packages/ecommerce/www/admin/products/custom-field-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-field-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/custom-field-add.adp 14 Aug 2008 21:48:24 -0000 1.1 @@ -0,0 +1,34 @@ + + @title;noquote@ + @context;noquote@ +

    @title@

    + +
    + + + + + + + + + + + + + + + + + + + + +
    Unique IdentifierNo spaces or special characters (just lowercase letters). The customers won't see this, but the site + administrator might, so make it indicative of what the field is.
    Field NameThis is the name that the customers will see (if you choose to display this field on the site) and + the name you'll see when adding/updating products.
    What kind of information will this field hold?@custom_field_type_html;noquote@
    Default Value (if any)For Date type, entering "0" here will set the default value to the current time of each new item. For other dates, use the format "YYYY-MM-DD"
    + +
    + +
    +
    Index: openacs-4/packages/ecommerce/www/admin/products/custom-field-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-field-add.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/ecommerce/www/admin/products/custom-field-add.tcl 13 Jan 2005 13:58:02 -0000 1.5 +++ openacs-4/packages/ecommerce/www/admin/products/custom-field-add.tcl 14 Aug 2008 21:48:24 -0000 1.6 @@ -13,45 +13,7 @@ ad_require_permission [ad_conn package_id] admin -doc_body_append " - [ad_admin_header "Add a Custom Field"] +set title "Add a Custom Field" +set context [list [list index Products] $title] -

    Add a Custom Field

    - - [ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "custom-fields.tcl" "Custom Fields"] "Add a Custom Field"] - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Unique IdentifierNo spaces or special characters (just lowercase letters). The customers won't see this, but the site - administrator might, so make it indicative of what the field is.
    Field NameThis is the name that the customers will see (if you choose to display this field on the site) and - the name you'll see when adding/updating products.
    What kind of information will this field hold?[ec_column_type_widget]
    Default Value (if any)For Date type, entering \"0\" here will set the default value to the current time of each new item. For other dates, use the format \"YYYY-MM-DD\"
    - -
    - -
    -
    - [ad_admin_footer]" +set custom_field_type_html [ec_column_type_widget] Index: openacs-4/packages/ecommerce/www/admin/products/custom-field-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-field-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/custom-field-edit.adp 14 Aug 2008 21:48:24 -0000 1.1 @@ -0,0 +1,38 @@ + + @title;noquote@ + @context;noquote@ +

    @title@

    + +
    + @export_vars_html;noquote@ + + + + + + + + + + + + + + + + + + + + + + +
    Unique Identifier:@field_identifier@This can't be changed.
    Field Name:
    Default Value:
    Kind of Information:@column_type_html;noquote@We might not be able to change this, depending on what it + is, what you're trying to change it to, and what values are + already in the database for this field (you can always try it + & find out).
    + +
    + +
    +
    Index: openacs-4/packages/ecommerce/www/admin/products/custom-field-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-field-edit.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/products/custom-field-edit.tcl 9 Mar 2004 00:59:51 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/products/custom-field-edit.tcl 14 Aug 2008 21:48:24 -0000 1.5 @@ -21,46 +21,8 @@ set old_column_type $column_type -doc_body_append " - [ad_admin_header "Edit $field_name"] +set title "Edit $field_name" +set context [list [list index Products] $title] -

    Edit $field_name

    - - [ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Products"] [list "custom-fields" "Custom Fields"] "Edit Custom Field"] - -
    - -
    - [export_form_vars old_column_type field_identifier] - - - - - - - - - - - - - - - - - - - - - - -
    Unique Identifier:$field_identifierThis can't be changed.
    Field Name:
    Default Value:
    Kind of Information:[ec_column_type_widget $column_type]We might not be able to change this, depending on what it - is, what you're trying to change it to, and what values are - already in the database for this field (you can always try it - & find out).
    - -
    - -
    -
    - [ad_admin_footer]" +set export_vars_html [export_form_vars old_column_type field_identifier] +set column_type_html [ec_column_type_widget $column_type] Index: openacs-4/packages/ecommerce/www/admin/products/custom-field.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-field.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/custom-field.adp 14 Aug 2008 21:48:24 -0000 1.1 @@ -0,0 +1,42 @@ + + @title;noquote@ + @context;noquote@ +

    @title@

    + + + + + + + + + + + + + + + + + + + + + + +
    Unique Identifier:@field_identifier@
    Field Name:@field_name@
    Default Value:@default_value@
    Kind of Information:@column_type_html;noquote@
    Active:@active_p_html;noquote@
    + +

    Actions:

    + + + Index: openacs-4/packages/ecommerce/www/admin/products/custom-field.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-field.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/custom-field.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/custom-field.tcl 14 Aug 2008 21:48:24 -0000 1.4 @@ -14,56 +14,14 @@ db_1row custom_field_select " select field_name, default_value, column_type, active_p from ec_custom_product_fields -where field_identifier=:field_identifier -" +where field_identifier=:field_identifier" -doc_body_append "[ad_admin_header "$field_name"] +set title "Custom Field ${field_name}" +set context [list [list index Products] $title] -

    $field_name

    +set column_type_html [ec_pretty_column_type $column_type] +set active_p_html [util_PrettyBoolean $active_p] -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Products"] [list "custom-fields" "Custom Fields"] "One Custom Field"] - -
    - - - - - - - - - - - - - - - - - - - - - - -
    Unique Identifier:$field_identifier
    Field Name:$field_name
    Default Value:$default_value
    Kind of Information:[ec_pretty_column_type $column_type]
    Active:[util_PrettyBoolean $active_p]
    - -

    - -

    Actions:

    - -

    - -

      -
    • Edit -" - -if { $active_p == "t" } { - doc_body_append "
    • Make Inactive" -} else { - doc_body_append "
    • Reactivate" -} - # Set audit variables # audit_name, audit_id, audit_id_column, return_url, audit_tables, main_tables set audit_name "$field_name" @@ -73,8 +31,4 @@ set audit_tables [list ec_custom_product_fields_audit] set main_tables [list ec_custom_product_fields] -doc_body_append "
    • Audit Trail -
    - -[ad_admin_footer] -" +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]" Index: openacs-4/packages/ecommerce/www/admin/products/custom-fields.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-fields.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/custom-fields.adp 14 Aug 2008 21:48:24 -0000 1.1 @@ -0,0 +1,11 @@ + + @title;noquote@ + @context;noquote@ +

    @title@

    + + Index: openacs-4/packages/ecommerce/www/admin/products/custom-fields.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/custom-fields.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/custom-fields.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/custom-fields.tcl 14 Aug 2008 21:48:24 -0000 1.4 @@ -11,39 +11,19 @@ ad_require_permission [ad_conn package_id] admin -doc_body_append "[ad_admin_header "Custom Fields"] +set title "Custom Fields" +set context [list [list index Products] $title] -

    Custom Fields

    - -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Products"] "Custom Fields"] - -
    - -
      - -" - +set custom_fields_select_html "" db_foreach custom_fields_select " select field_identifier, field_name, active_p from ec_custom_product_fields -order by active_p desc, field_name -" { - doc_body_append "
    • $field_name" +order by active_p desc, field_name" { + append custom_fields_select_html "
    • $field_name" if { $active_p == "f" } { - doc_body_append " (inactive)" + append custom_fields_select_html " (inactive)" } - doc_body_append "\n" } set table_names_and_id_column [list ec_custom_product_fields ec_custom_product_fields_audit field_identifier] - -doc_body_append "

      - -

    • Add a custom field - -

      - -

    • Audit All Custom Fields -
    -[ad_admin_footer] -" +set audit_url_html "[ec_url_concat [ec_url] /admin]/audit-tables?[export_url_vars table_names_and_id_column]" Index: openacs-4/packages/ecommerce/www/admin/products/delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/products/delete.adp 14 Aug 2008 21:53:58 -0000 1.1 @@ -0,0 +1,17 @@ + + @title;noquote@ + @context;noquote@ +

    @title@

    +

    +Are you sure you want to delete $product_name? +

    +

    The system will not let you delete a product if anyone has already ordered it +(you might want to mark the product "discontinued" instead). +

    +

    +

    +@export_vars_html;noquote@ +
    + +
    +
    Index: openacs-4/packages/ecommerce/www/admin/products/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/delete.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/products/delete.tcl 9 Mar 2004 00:59:51 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/products/delete.tcl 14 Aug 2008 21:53:58 -0000 1.4 @@ -14,25 +14,7 @@ set product_name [ec_product_name $product_id] -doc_body_append "[ad_admin_header "Confirm Deletion of $product_name"] +set title "Confirm Deletion of $product_name" +set context [list [list index Products] $title] -

    Confirm Deletion

    - -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index.tcl" "Products"] [list "one.tcl?[export_url_vars product_id]" "One"] "Confirm Deletion"] - -
    - -Are you sure you want to delete $product_name? Note that the system -will not let you delete a product if anyone has already ordered it -(you might want to mark the product \"discontinued\" instead). - -

    -

    -[export_form_vars product_id] -
    - -
    -
    - -[ad_admin_footer] -" +set export_vars_html [export_form_vars product_id]