Index: openacs-4/packages/ecommerce/www/admin/customer-service/customer-history.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/customer-history.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/customer-service/customer-history.tcl 18 Aug 2008 11:07:04 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/customer-service/customer-history.tcl 20 Aug 2008 20:34:33 -0000 1.3 @@ -37,133 +37,84 @@ set order_by "interaction_id" } - -append doc_body "[ad_admin_header "Customer History"] - -
-" if {$customer_type == "user_identification_id"} { set customer_query_bit "and i.user_identification_id=:customer_id" } else { set customer_query_bit "and i.user_id=:customer_id" } - if { $view_rep == "all" } { set rep_query_bit "" } else { set rep_query_bit "and i.customer_service_rep=:view_rep" } - if { $view_interaction_originator == "all" } { set interaction_originator_query_bit "" } else { set interaction_originator_query_bit "and i.interaction_originator=:view_interaction_originator" } - if { $view_interaction_type == "all" } { set interaction_type_query_bit "" } else { set interaction_type_query_bit "and i.interaction_type=:view_interaction_type" } - if { $view_interaction_date == "last_24" } { #set interaction_date_query_bit "and sysdate-i.interaction_date <= 1" set interaction_date_query_bit [db_map last_24] @@ -179,15 +130,12 @@ set link_beginning "customer-history.tcl?[export_url_vars customer_type customer_id view_rep view_interaction_originator view_interaction_type view_interaction_date]" -set table_header "-[ad_admin_footer] -" - -doc_return 200 text/html $doc_body-
-- Interaction ID +set table_header "" + Interaction ID Date Rep Customer Originator -Type -Type \n" #set sql "select i.interaction_id, i.customer_service_rep, i.interaction_date, #to_char(i.interaction_date,'YYYY-MM-DD HH24:MI:SS') as full_interaction_date, i.interaction_originator, @@ -203,57 +151,33 @@ #order by $order_by" set sql [db_map get_customer_interaction_detail_sql] - set row_counter 0 - - +set customer_interaction_detail_html "" db_foreach get_customer_interaction_detail $sql { - if { $row_counter == 0 } { - append doc_body $table_header + append customer_interaction_detail_html $table_header } elseif { $row_counter == 20 } { - append doc_body "- $table_header - " - set row_counter 1 + append customer_interaction_detail_html "
${table_header}" + set row_counter 1 } # even rows are white, odd are grey if { [expr floor($row_counter/2.)] == [expr $row_counter/2.] } { - set bgcolor "white" + set bgcolor "#ffffff" } else { - set bgcolor "ececec" + set bgcolor "#ececec" } - - append doc_body "
" -} else { - append doc_body "$interaction_id -[ec_formatted_full_date $full_interaction_date] - " + append customer_interaction_detail_html "- " + append customer_interaction_detail_html " $interaction_id [ec_formatted_full_date $full_interaction_date] " if { ![empty_string_p $customer_service_rep] } { - append doc_body "$rep_last_name, $rep_first_names " + append customer_interaction_detail_html "$rep_last_name, $rep_first_names " } else { - append doc_body "" + append customer_interaction_detail_html " " } if { ![empty_string_p $customer_user_id] } { - append doc_body " $customer_last_name, $customer_first_names " + append customer_interaction_detail_html "$customer_last_name, $customer_first_names " } else { - append doc_body "unregistered user: $user_identification_id " + append customer_interaction_detail_html "unregistered user: $user_identification_id " } - append doc_body "$interaction_originator -$interaction_type -$interaction_originator $interaction_type \n" incr row_counter } -if { $row_counter != 0 } { - append doc_body "None Found " -} - -append doc_body " -