Index: openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2.tcl 18 Aug 2008 11:02:22 -0000 1.8 +++ openacs-4/packages/ecommerce/www/admin/customer-service/interaction-add-2.tcl 24 Aug 2008 11:00:43 -0000 1.9 @@ -1,5 +1,5 @@ # interaction-add-2.tcl -ad_page_contract { +ad_page_contract { @param open_date:optional @param interaction_type:optional @param interaction_type_other:optional @@ -44,62 +44,55 @@ # return_to_issue # the customer service rep must be logged on - set customer_service_rep [ad_get_user_id] -if {[empty_string_p $insert_id]} { +if { [empty_string_p $insert_id] } { set insert_id 1 } -if {$insert_id ==0 } { +if { $insert_id == 0 } { # YYYY-MM-DD HH24:MI:SS set open_date_year $open_date(year) set open_date_month $open_date(month) set open_date_day $open_date(day) set open_date_time $open_date(time) - set open_date_str "$open_date_year-$open_date_month-$open_date_day $open_date_time" } -if {$insert_id ==1} { +if { $insert_id == 1 } { set open_date_str [db_string select_time "select to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') from dual"] - } - #doc_return 200 text/html "year: $open_date_year
#month: $open_date_month
#day: $open_date_day
#time: $open_date_time
" -if {$customer_service_rep == 0} { +if { $customer_service_rep == 0 } { set return_url "[ad_conn url]?[export_entire_form_as_url_vars]" ad_returnredirect "/register.tcl?[export_url_vars return_url]" ad_script_abort -} + } if { ![info exists interaction_id] } { - set exception_count 0 set exception_text "" if { ![info exists interaction_type] || [empty_string_p $interaction_type] } { - incr exception_count - append exception_text "
  • You forgot to specify the method of inquiry (phone/email/etc.).\n" + incr exception_count + append exception_text "
  • No method of inquiry (phone/email/etc.) exists. Please add.
  • \n" } elseif { $interaction_type == "other" && (![info exists interaction_type_other] || [empty_string_p $interaction_type_other]) } { - incr exception_count - append exception_text "
  • You forgot to fill in the text box detail for Other.\n" + incr exception_count + append exception_text "
  • The text box detail for Other is empty. Please add detail.
  • \n" } elseif { $interaction_type != "other" && ([info exists interaction_type_other] && ![empty_string_p $interaction_type_other]) } { - incr exception_count - append exception_text "
  • You selected \"Inquired via: [string toupper [string index $interaction_type 0]][string range $interaction_type 1 [expr [string length $interaction_type] -1]]\", but you also filled in something in the \"If Other, specify\" field. This is inconsistent.\n" + incr exception_count + append exception_text "
  • You selected \"Inquired via: [string toupper [string index $interaction_type 0]][string range $interaction_type 1 [expr [string length $interaction_type] -1]]\", but you also filled in something in the \"If Other, specify\" field. Please fill in one or the other, not both.
  • \n" } - if { $exception_count > 0 } { - ad_return_complaint $exception_count $exception_text + ad_return_complaint $exception_count $exception_text ad_script_abort } - # done error checking -} + } # Have to generate action_id @@ -108,238 +101,137 @@ # interaction_id will not be generated until the next page (if it doesn't # exist) so that I can use the fact of its existence or lack of existence # to create this page's UI - set action_id [db_nextval ec_action_id_sequence] +set title "One Issue" +set context [list [list index "Customer Service"] $title] - -append doc_body "[ad_admin_header "One Issue"] -

    One Issue

    -[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] "One Issue (part of New Interaction)"] - -
    " - if { ![info exists c_user_identification_id] } { - append doc_body " -

    Customer identification:

    -

    - Here's what we could determine about the customer given the information you typed - into the previous form: -

    " } -append doc_body "

    One issue

    A customer may discuss several issues during the course of one interaction. Please -enter the information about only one issue below:

    +set export_form_vars1_html [export_form_vars interaction_id c_user_identification_id action_id open_date_str interaction_type interaction_type_other interaction_originator first_names last_name email postal_code other_id_info return_to_issue insert_id] -
    -[export_form_vars interaction_id c_user_identification_id action_id open_date_str interaction_type interaction_type_other interaction_originator first_names last_name email postal_code other_id_info return_to_issue insert_id] - -" - if { [info exists c_user_identification_id] } { - append doc_body " + append form_body_html "\n" + } - append doc_body " - " -} - -if { ![info exists issue_id] } { - append doc_body " - - - - - - - - - - - - " -} else { +if { [info exists issue_id] } { set order_id [db_string get_order_id "select order_id from ec_customer_service_issues where issue_id=:issue_id"] - set issue_type_list [db_list get_is` - - - - - - - - - - - -" + set issue_type_list [db_list get_issue_type_list "select issue_type from ec_cs_issue_type_map where issue_id=:issue_id"] + set issue_type_list_html [join $issue_type_list ", "] + set export_form_vars_issue_id_html [export_form_vars issue_id] + set order_id_html [ec_decode $order_id "" "none" $order_id] +} else { + set issue_type_widget_html [ec_issue_type_widget] } -append doc_body " - - - - - - - - - - - - +set info_used_widget_html [ec_info_used_widget] - - -
    Customer: [ec_user_identification_summary $c_user_identification_id "t"]" if { [info exists postal_code] } { - append doc_body "
    - [ec_location_based_on_zip_code $postal_code]" + append form_body_html "
    [ec_location_based_on_zip_code $postal_code]" } + append form_body_html "
    Previous Issue ID: - If this is a new issue, please leave this blank (a new Issue ID will be generated)
    New Issue Type: (leave blank if based on an existing issue) [ec_issue_type_widget]
    Order ID: - Fill this in if this inquiry is about a specific order. -
    Issue ID:$issue_id[export_form_vars issue_id]
    Issue Type[join $issue_type_list ", "]
    Order ID:[ec_decode $order_id "" "none" $order_id]
    Issue details:
    (action_details)
    Resources used:Information used to respond to inquiry [ec_info_used_widget]
    Requires follow-up? -yes requires follow-up
    -    Please elaborate: -
    no (resolved)
    -" - -append doc_body "
    Customer - - -
    -
    -[ad_admin_footer] -" -doc_return 200 text/html $doc_body -