Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.adp 24 Aug 2008 21:35:36 -0000 1.1 @@ -0,0 +1,14 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

@confirm_user_html;noquote@

+ +
+ @export_form_vars_html;noquote@ +

Modify Issue Type: @issue_type_widget_html;noquote@

+
+ +
+
Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.tcl 9 Mar 2004 00:59:47 -0000 1.5 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit.tcl 24 Aug 2008 21:35:36 -0000 1.6 @@ -10,51 +10,23 @@ } { issue_id } -# + ad_require_permission [ad_conn package_id] admin set return_url "[ad_conn url]?[export_entire_form_as_url_vars]" set customer_service_rep [ad_get_user_id] - if {$customer_service_rep == 0} { ad_returnredirect "/register.tcl?[export_url_vars return_url]" ad_script_abort } -set page_title "Edit Issue #$issue_id" -append doc_body "[ad_admin_header $page_title] -

$page_title

+set title "Edit Issue ${issue_id}" +set context [list [list index "Customer Service"] $title] -[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] $page_title] - -
-" - set issue_type_list [db_list get_issue_types "select issue_type from ec_cs_issue_type_map where issue_id=:issue_id"] -append doc_body " -If you are not [db_string get_user_name "select first_names || ' ' || last_name from cc_users where user_id=:customer_service_rep"], please log in +set confirm_user_html "If you are not [db_string get_user_name "select first_names || ' ' || last_name from cc_users where user_id=:customer_service_rep"], please log in" -

- -

-[export_form_vars issue_id] - -Modify Issue Type: -
-[ec_issue_type_widget $issue_type_list] -
- -

- -

- -
- -
- -[ad_admin_footer] -" - -doc_return 200 text/html $doc_body +set export_form_vars_html [export_form_vars issue_id] +set issue_type_widget_html [ec_issue_type_widget $issue_type_list] Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue-open-or-close.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue-open-or-close.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue-open-or-close.adp 24 Aug 2008 21:35:36 -0000 1.1 @@ -0,0 +1,15 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

@confirm_user_html;noquote@

+ +

Please confirm that you wish to @issue_action;noquote@ this issue.

+ +
+ @export_form_vars_html;noquote@ +
+ +
+
Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue-open-or-close.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue-open-or-close.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/customer-service/issue-open-or-close.tcl 9 Mar 2004 00:59:47 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue-open-or-close.tcl 24 Aug 2008 21:35:36 -0000 1.5 @@ -1,5 +1,4 @@ # issue-open-or-close.tcl - ad_page_contract { @param issue_id @param close_p @@ -11,51 +10,27 @@ issue_id close_p } -# + ad_require_permission [ad_conn package_id] admin set return_url "[ad_conn url]?[export_entire_form_as_url_vars]" set customer_service_rep [ad_get_user_id] - if {$customer_service_rep == 0} { ad_returnredirect "/register.tcl?[export_url_vars return_url]" ad_script_abort } - - if { $close_p == "t" } { - set page_title "Close Issue #$issue_id" + set title "Close Issue ${issue_id}" } else { - set page_title "Reopen Issue #$issue_id" + set title "Reopen Issue ${issue_id}" } +set context [list [list index "Customer Service"] $title] -append doc_body "[ad_admin_header $page_title] -

$page_title

+set confirm_user_html "If you are not [db_string get_user_name "select first_names || ' ' || last_name from cc_users where user_id=:customer_service_rep"], please log in" -[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] $page_title] +set issue_action "[ec_decode $close_p "t" "close" "reopen"]" -
-" +set export_form_vars_html [export_form_vars issue_id close_p customer_service_rep] - - -append doc_body " -If you are not [db_string get_user_name "select first_names || ' ' || last_name from cc_users where user_id=:customer_service_rep"], please log in - -

-Please confirm that you wish to [ec_decode $close_p "t" "close" "reopen"] this issue. - -

-[export_form_vars issue_id close_p customer_service_rep] - -
- -
- -[ad_admin_footer] -" - - -doc_return 200 text/html $doc_body Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue.adp 24 Aug 2008 21:35:36 -0000 1.1 @@ -0,0 +1,49 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Customer@user_id_summary_html;noquote@
Order #@order_id@
Issue Type@issue_type;noquote@
Open Date@open_full_date_html;noquote@
Close Date@close_date_html;noquote@
Closed By@closed_rep_name@
+
+ +

All actions associated with this issue

+ +@actions_assoc_w_user_html;noquote@ + Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/ecommerce/www/admin/customer-service/issue.tcl 9 Mar 2004 04:58:51 -0000 1.5 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue.tcl 24 Aug 2008 21:35:36 -0000 1.6 @@ -1,5 +1,4 @@ # issue.tcl - ad_page_contract { @param issue_id @@ -16,98 +15,37 @@ set return_url "[ad_conn url]?[export_entire_form_as_url_vars]" set customer_service_rep [ad_get_user_id] - if {$customer_service_rep == 0} { ad_returnredirect "/register.tcl?[export_url_vars return_url]" ad_script_abort } +set title "Issue ${issue_id}" +set context [list [list index "Customer Service"] $title] - -set page_title "Issue #$issue_id" -append doc_body "[ad_admin_header $page_title] -

$page_title

- -[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] $page_title] - -
-" - - - db_1row get_user_info "select i.user_identification_id, i.order_id, i.closed_by, i.deleted_p, i.open_date, i.close_date, to_char(i.open_date,'YYYY-MM-DD HH24:MI:SS') as full_open_date, to_char(i.close_date,'YYYY-MM-DD HH24:MI:SS') as full_close_date, u.first_names || ' ' || u.last_name as closed_rep_name from ec_customer_service_issues i, cc_users u where i.closed_by=u.user_id(+) and issue_id=:issue_id" +set user_id_summary_html "[ec_user_identification_summary $user_identification_id]" - if { [empty_string_p $close_date] } { set open_close_link "close" } else { set open_close_link "reopen" } +set choices_html "\[ change issue type | $open_close_link | send email | record an interaction \]" -append doc_body " -\[ change issue type | $open_close_link | send email | record an interaction \] - -

- -

- - - - - -" - -if { ![empty_string_p $order_id] } { - append doc_body " - - - - " -} - 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 [join $issue_type_list ", "] -if { ![empty_string_p $issue_type] } { - append doc_body " - - - - " -} +set open_full_date_html [util_AnsiDatetoPrettyDate [lindex [split $full_open_date " "] 0]] [lindex [split $full_open_date " "] 1] -append doc_body " - - - -" +set close_date_html [util_AnsiDatetoPrettyDate [lindex [split $full_close_date " "] 0]] [lindex [split $full_close_date " "] 1] -if { ![empty_string_p $close_date] } { - append doc_body " - - - - - - - - " -} +set closed_by_user_id_url "[ec_acs_admin_url]users/one?user_id=$closed_by" -append doc_body " -
Customer[ec_user_identification_summary $user_identification_id]
Order #$order_id
Issue Type$issue_type
Open Date[util_AnsiDatetoPrettyDate [lindex [split $full_open_date " "] 0]] [lindex [split $full_open_date " "] 1]
Close Date[util_AnsiDatetoPrettyDate [lindex [split $full_close_date " "] 0]] [lindex [split $full_close_date " "] 1]
Closed By$closed_rep_name
-
- -

- -

All actions associated with this issue

-
-" - set sql "select a.action_id, a.interaction_id, a.action_details, a.follow_up_required, 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, i.interaction_type, m.info_used from ec_customer_service_actions a, ec_customer_serv_interactions i, ec_cs_action_info_used_map m where a.interaction_id=i.interaction_id @@ -118,36 +56,30 @@ set old_action_id "" set info_used_list [list] set action_counter 0 +set actions_assoc_w_user_html "" db_foreach get_actions_assoc_w_user $sql { incr action_counter - if { [string compare $action_id $old_action_id] != 0 } { - if { [llength $info_used_list] > 0 } { - append doc_body "[join $info_used_list "
"]" - set info_used_list [list] - } else { - append doc_body " " - } - - if { ![empty_string_p $old_action_id] } { - append doc_body "$old_interaction_id - Details:
[ec_display_as_html $old_action_details]
- " - if { ![empty_string_p $old_follow_up_required] } { - append doc_body "Follow-up Required:
[ec_display_as_html $old_follow_up_required]
" - } - append doc_body " -

- " - } - append doc_body " + if { [llength $info_used_list] > 0 } { + append actions_assoc_w_user_html "" + set info_used_list [list] + } else { + append actions_assoc_w_user_html "" + } + if { ![empty_string_p $old_action_id] } { + append actions_assoc_w_user_html " + \n" + if { ![empty_string_p $old_follow_up_required] } { + append actions_assoc_w_user_html "" + } + append actions_assoc_w_user_html "
[join $info_used_list "
"]
 $old_interaction_id
Details:
[ec_display_as_html $old_action_details]
Follow-up Required:
[ec_display_as_html $old_follow_up_required]

" + } + append actions_assoc_w_user_html " - - " + " } - if { ![empty_string_p $info_used] } { - lappend info_used_list $info_used + lappend info_used_list $info_used } set old_action_id $action_id set old_interaction_id $interaction_id @@ -156,27 +88,16 @@ } if { [llength $info_used_list] > 0 } { - append doc_body "" + append actions_assoc_w_user_html "" set info_used_list [list] } else { - append doc_body "" + append actions_assoc_w_user_html "" } if { ![empty_string_p $old_action_id] } { - append doc_body " - - " + append actions_assoc_w_user_html " + \n" if { ![empty_string_p $follow_up_required] } { - append doc_body " - " + append actions_assoc_w_user_html "\n" } - append doc_body "
DateRepOriginatorInquired ViaInfo UsedInteraction
[util_AnsiDatetoPrettyDate [lindex [split $full_interaction_date " "] 0]] [lindex [split $full_interaction_date " "] 1][ec_decode $customer_service_rep "" " " "$customer_service_rep"]$interaction_originator$interaction_type
[util_AnsiDatetoPrettyDate [lindex [split $full_interaction_date " "] 0]] [lindex [split $full_interaction_date " "] 1][ec_decode $customer_service_rep "" " " "$customer_service_rep"]$interaction_originator$interaction_type[join $info_used_list "
"]
[join $info_used_list "
"]
  $interaction_id
Details:
[ec_display_as_html $action_details]
$interaction_id
Details:
[ec_display_as_html $action_details]
Follow-up Required:
[ec_display_as_html $follow_up_required]
Follow-up Required:
[ec_display_as_html $follow_up_required]
- " + append actions_assoc_w_user_html "\n" } - -append doc_body "

-[ad_admin_footer] -" - - - -doc_return 200 text/html $doc_body Index: openacs-4/packages/ecommerce/www/admin/customer-service/issues.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issues.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issues.adp 24 Aug 2008 21:35:36 -0000 1.1 @@ -0,0 +1,28 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ + +@export_form_vars_html;noquote@ + + + + + + + + + + + + +
Issue TypeStatusOpen Date
@linked_status_list_html;noquote@@linked_open_date_list_html;noquote@
+ + + + + @issues_list_html;noquote@
+
+

None found.

+
Index: openacs-4/packages/ecommerce/www/admin/customer-service/issues.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issues.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/customer-service/issues.tcl 9 Mar 2004 00:59:47 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issues.tcl 24 Aug 2008 21:35:36 -0000 1.5 @@ -1,5 +1,4 @@ # issues.tcl - ad_page_contract { @author @creation-date @@ -28,113 +27,75 @@ set order_by_sql "i.issue_id" } else { switch $order_by { - "issue_id" { - set order_by_sql "i.issue_id" - } - "open_date" { - set order_by_sql "i.open_date" - } - "close_date" { - set order_by_sql "i.close_date" - } - "customer" { - set order_by_sql "u.last_name, u.first_names" - } - "order_id" { - set order_by_sql "i.order_id" - } - "issue_type" { - set order_by_sql "m.issue_type" - } - default { - set order_by_sql "i.issue_id" - } + "issue_id" { + set order_by_sql "i.issue_id" + } + "open_date" { + set order_by_sql "i.open_date" + } + "close_date" { + set order_by_sql "i.close_date" + } + "customer" { + set order_by_sql "u.last_name, u.first_names" + } + "order_id" { + set order_by_sql "i.order_id" + } + "issue_type" { + set order_by_sql "m.issue_type" + } + default { + set order_by_sql "i.issue_id" + } } } -append doc_body "[ad_admin_header "Customer Service Issues"] +set title "Issues" +set context [list [list index "Customer Service"] $title] -

Customer Service Issues

+set export_form_vars_html [export_form_vars view_status view_open_date order_by] -[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] "Issues"] - -
- -
-[export_form_vars view_status view_open_date order_by] - - - - - - - - - - -
Issue TypeStatusOpen Date
- - -" set status_list [list "open" "closed"] - set linked_status_list [list] - foreach status $status_list { if { $status == $view_status } { - lappend linked_status_list "$status" + lappend linked_status_list "$status" } else { - lappend linked_status_list "$status" + lappend linked_status_list "$status" } } +set linked_status_list_html "\[ [join $linked_status_list " | "] \]" -append doc_body "\[ [join $linked_status_list " | "] \] - -" - set open_date_list [list [list last_24 "last 24 hrs"] [list last_week "last week"] [list last_month "last month"] [list all all]] - set linked_open_date_list [list] - foreach open_date $open_date_list { if {$view_open_date == [lindex $open_date 0]} { - lappend linked_open_date_list "[lindex $open_date 1]" + lappend linked_open_date_list "[lindex $open_date 1]" } else { - lappend linked_open_date_list "[lindex $open_date 1]" + lappend linked_open_date_list "[lindex $open_date 1]" } } +set linked_open_date_list_html "\[ [join $linked_open_date_list " | "] \]" -append doc_body "\[ [join $linked_open_date_list " | "] \] - -
- -
-
-" - if { $view_status == "open" } { set status_query_bit "and i.close_date is null" } else { set status_query_bit "and i.close_date is not null" } - if { $view_open_date == "last_24" } { set open_date_query_bit [db_map last_24] } elseif { $view_open_date == "last_week" } { @@ -146,29 +107,23 @@ } if { $view_issue_type == "uncategorized" } { - set sql_query [db_map uncategorized] - } elseif { $view_issue_type == "all others" } { - if { [llength $important_issue_type_list] > 0 } { - # taking advantage of the fact that tcl lists are just strings - set safe_important_issue_type_list [DoubleApos $important_issue_type_list] - set issue_type_query_bit "and m.issue_type not in ('[join $safe_important_issue_type_list "', '"]')" + # taking advantage of the fact that tcl lists are just strings + set safe_important_issue_type_list [DoubleApos $important_issue_type_list] + set issue_type_query_bit "and m.issue_type not in ('[join $safe_important_issue_type_list "', '"]')" } else { - set issue_type_query_bit "" + set issue_type_query_bit "" } set sql_query [db_map all_others] - } else { - set sql_query [db_map default_query] } set link_beginning "issues.tcl?[export_url_vars view_issue_type view_status view_open_date]" -set table_header " - +set table_header " @@ -178,60 +133,35 @@ " set sql $sql_query - set row_counter 0 +set issues_list_html "" db_foreach loop_through_issues $sql { - if { $row_counter == 0 } { - append doc_body $table_header + append issues_list_html $table_header } elseif { $row_counter == 20 } { - append doc_body "
Issue ID Open Date Close Date
-

- $table_header - " - set row_counter 1 + append issues_list_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 " + append issues_list_html " - - " - + " if { ![empty_string_p $user_id] } { - append doc_body "" + append issues_list_html "" } else { - append doc_body "" + append issues_list_html "" } - - append doc_body "" - + append issues_list_html "" if { $view_issue_type =="uncategorized" } { - append doc_body "" + append issues_list_html "" } else { - append doc_body "" + append issues_list_html "" } - - append doc_body "" + append issues_list_html "\n" incr row_counter } - -if { $row_counter != 0 } { - append doc_body "
$issue_id
$issue_id [ec_formatted_full_date $full_open_date][ec_decode $full_close_date "" " " [ec_formatted_full_date $full_close_date]][ec_decode $full_close_date "" " " [ec_formatted_full_date $full_close_date]]$users_last_name, $users_first_names$users_last_name, $users_first_namesunregistered user $user_identification_idunregistered user $user_identification_id[ec_decode $order_id "" " " "$order_id"][ec_decode $order_id "" " " "$order_id"]  $issue_type$issue_type
" -} else { - append doc_body "

None Found
" -} - -append doc_body " -
-[ad_admin_footer] -" - - - -doc_return 200 text/html $doc_body