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 @@ +<master> + <property name="doc(title)">@title;noquote@</property> + <property name="context">@context;noquote@</property> +<h2>@title@</h2> + +<p>@confirm_user_html;noquote@</p> + +<form method=post action=issue-edit-2> + @export_form_vars_html;noquote@ + <p>Modify Issue Type: @issue_type_widget_html;noquote@</p> + <center> + <input type=submit value="Submit Changes"> + </center> +</form> 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] -<h2>$page_title</h2> +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] - -<hr> -" - 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 <a href=\"/register?[export_url_vars return_url]\">log in</a> +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 <a href=\"/register?[export_url_vars return_url]\">log in</a>" -<p> - -<form method=post action=issue-edit-2> -[export_form_vars issue_id] - -Modify Issue Type: -<blockquote> -[ec_issue_type_widget $issue_type_list] -</blockquote> - -<p> - -<center> -<input type=submit value=\"Submit Changes\"> -</center> - -</form> - -[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 @@ +<master> + <property name="doc(title)">@title;noquote@</property> + <property name="context">@context;noquote@</property> +<h2>@title@</h2> + +<p>@confirm_user_html;noquote@</p> + +<p>Please confirm that you wish to @issue_action;noquote@ this issue.</p> + +<form method=post action=issue-open-or-close-2> + @export_form_vars_html;noquote@ + <center> + <input type=submit value="Confirm"> + </center> +</form> 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] -<h2>$page_title</h2> +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 <a href=\"/register?[export_url_vars return_url]\">log in</a>" -[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"]" -<hr> -" +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 <a href=\"/register?[export_url_vars return_url]\">log in</a> - -<p> -Please confirm that you wish to [ec_decode $close_p "t" "close" "reopen"] this issue. - -<form method=post action=issue-open-or-close-2> -[export_form_vars issue_id close_p customer_service_rep] - -<center> -<input type=submit value=\"Confirm\"> -</center> - -[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 @@ +<master> + <property name="doc(title)">@title;noquote@</property> + <property name="context">@context;noquote@</property> +<h2>@title@</h2> + + +<table> +<tr> + <td align=right><b>Customer</td> + <td>@user_id_summary_html;noquote@</td> +</tr> + +<if @order_id@ not nil> + <tr> + <td align=right><b>Order #</td> + <td><a href=\"../orders/one?order_id=$order_id\">@order_id@</a></td> + </tr> +</if> + +<if @issue_type@ not nil> + <tr> + <td align=right><b>Issue Type</td> + <td>@issue_type;noquote@</td> + </tr> +</if> + +<tr> + <td align=right><b>Open Date</td> + <td>@open_full_date_html;noquote@</td> +</tr> + +<if @close_date@ not nil> + <tr> + <td align=right><b>Close Date</td> + <td>@close_date_html;noquote@</td> + </tr> + <tr> + <td align=right><b>Closed By</td> + <td><a href="@closed_by_user_id_url@">@closed_rep_name@</a></td> + </tr> +</if> + +</table> +<br> + +<h3>All actions associated with this issue</h3> + +@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] -<h2>$page_title</h2> - -[ad_context_bar [list "../index.tcl" "Ecommerce([ec_system_name])"] [list "index.tcl" "Customer Service Administration"] $page_title] - -<hr> -" - - - 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 "<a href=\"issue-open-or-close?close_p=t&[export_url_vars issue_id]\">close</a>" } else { set open_close_link "<a href=\"issue-open-or-close?close_p=f&[export_url_vars issue_id]\">reopen</a>" } +set choices_html "\[ <a href=\"issue-edit?[export_url_vars issue_id]\">change issue type</a> | $open_close_link | <a href=\"email-send?[export_url_vars issue_id user_identification_id]\">send email</a> | <a href=\"interaction-add?[export_url_vars issue_id user_identification_id]\">record an interaction</a> \]" -append doc_body " -\[ <a href=\"issue-edit?[export_url_vars issue_id]\">change issue type</a> | $open_close_link | <a href=\"email-send?[export_url_vars issue_id user_identification_id]\">send email</a> | <a href=\"interaction-add?[export_url_vars issue_id user_identification_id]\">record an interaction</a> \] - -<p> - -<blockquote> -<table> -<tr> -<td align=right><b>Customer</td> -<td>[ec_user_identification_summary $user_identification_id]</td> -</tr> -" - -if { ![empty_string_p $order_id] } { - append doc_body "<tr> - <td align=right><b>Order #</td> - <td><a href=\"../orders/one?order_id=$order_id\">$order_id</a></td> - </tr> - " -} - 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 "<tr> - <td align=right><b>Issue Type</td> - <td>$issue_type</td> - </tr> - " -} +set open_full_date_html [util_AnsiDatetoPrettyDate [lindex [split $full_open_date " "] 0]] [lindex [split $full_open_date " "] 1] -append doc_body "<tr> -<td align=right><b>Open Date</td> -<td>[util_AnsiDatetoPrettyDate [lindex [split $full_open_date " "] 0]] [lindex [split $full_open_date " "] 1]</td> -</tr> -" +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 "<tr> - <td align=right><b>Close Date</td> - <td>[util_AnsiDatetoPrettyDate [lindex [split $full_close_date " "] 0]] [lindex [split $full_close_date " "] 1]</td> - </tr> - <tr> - <td align=right><b>Closed By</td> - <td><a href=\"[ec_acs_admin_url]users/one?user_id=$closed_by\">$closed_rep_name</a></td> - </tr> - " -} +set closed_by_user_id_url "[ec_acs_admin_url]users/one?user_id=$closed_by" -append doc_body " -</table> -</blockquote> - -<p> - -<h3>All actions associated with this issue</h3> -<center> -" - 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 "<td>[join $info_used_list "<br>"]</td>" - set info_used_list [list] - } else { - append doc_body "<td> </td>" - } - - if { ![empty_string_p $old_action_id] } { - append doc_body "<td><a href=\"interaction?interaction_id=$old_interaction_id\">$old_interaction_id</a></tr> - <tr><td colspan=6><b>Details:</b><br><blockquote>[ec_display_as_html $old_action_details]</blockquote></td></tr> - " - if { ![empty_string_p $old_follow_up_required] } { - append doc_body "<tr><td colspan=6><b>Follow-up Required:</b><br><blockquote>[ec_display_as_html $old_follow_up_required]</blockquote></td></tr>" - } - append doc_body "</table> - <p> - " - } - append doc_body "<table width=90%> + if { [llength $info_used_list] > 0 } { + append actions_assoc_w_user_html "<td>[join $info_used_list "<br>"]</td>" + set info_used_list [list] + } else { + append actions_assoc_w_user_html "<td> </td>" + } + if { ![empty_string_p $old_action_id] } { + append actions_assoc_w_user_html "<td><a href=\"interaction?interaction_id=$old_interaction_id\">$old_interaction_id</a></tr> + <tr><td colspan=6><b>Details:</b><br><blockquote>[ec_display_as_html $old_action_details]</blockquote></td></tr>\n" + if { ![empty_string_p $old_follow_up_required] } { + append actions_assoc_w_user_html "<tr><td colspan=6><b>Follow-up Required:</b><br><blockquote>[ec_display_as_html $old_follow_up_required]</blockquote></td></tr>" + } + append actions_assoc_w_user_html "</table><br>" + } + append actions_assoc_w_user_html "<table width=90%> <tr bgcolor=\"ececec\"><th>Date</th><th>Rep</th><th>Originator</th><th>Inquired Via</th><th>Info Used</th><th>Interaction</th></tr> - <tr bgcolor=\"ececec\"><td>[util_AnsiDatetoPrettyDate [lindex [split $full_interaction_date " "] 0]] [lindex [split $full_interaction_date " "] 1]</td><td>[ec_decode $customer_service_rep "" " " "<a href=\"[ec_acs_admin_url]users/one?user_id=$customer_service_rep\">$customer_service_rep</a>"]</td><td>$interaction_originator</td><td>$interaction_type</td> - " + <tr bgcolor=\"ececec\"><td>[util_AnsiDatetoPrettyDate [lindex [split $full_interaction_date " "] 0]] [lindex [split $full_interaction_date " "] 1]</td><td>[ec_decode $customer_service_rep "" " " "<a href=\"[ec_acs_admin_url]users/one?user_id=$customer_service_rep\">$customer_service_rep</a>"]</td><td>$interaction_originator</td><td>$interaction_type</td>" } - 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 "<td>[join $info_used_list "<br>"]</td>" + append actions_assoc_w_user_html "<td>[join $info_used_list "<br>"]</td>" set info_used_list [list] } else { - append doc_body "<td> </td>" + append actions_assoc_w_user_html "<td> </td>" } if { ![empty_string_p $old_action_id] } { - append doc_body "<td><a href=\"interaction?interaction_id=$interaction_id\">$interaction_id</a></tr> - <tr><td colspan=6><b>Details:</b><br><blockquote>[ec_display_as_html $action_details]</blockquote></td></tr> - " + append actions_assoc_w_user_html "<td><a href=\"interaction?interaction_id=$interaction_id\">$interaction_id</a></tr> + <tr><td colspan=6><b>Details:</b><br><blockquote>[ec_display_as_html $action_details]</blockquote></td></tr>\n" if { ![empty_string_p $follow_up_required] } { - append doc_body "<tr><td colspan=6><b>Follow-up Required:</b><br><blockquote>[ec_display_as_html $follow_up_required]</blockquote></td></tr> - " + append actions_assoc_w_user_html "<tr><td colspan=6><b>Follow-up Required:</b><br><blockquote>[ec_display_as_html $follow_up_required]</blockquote></td></tr>\n" } - append doc_body "</table> - " + append actions_assoc_w_user_html "</table>\n" } - -append doc_body "</center> -[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 @@ +<master> + <property name="doc(title)">@title;noquote@</property> + <property name="context">@context;noquote@</property> +<h2>@title@</h2> + +<form method=post action=issues> +@export_form_vars_html;noquote@ + + <table border=0 cellspacing=0 cellpadding=0 width=100%> + <tr bgcolor=#ececec> + <td align=center><b>Issue Type</b></td> + <td align=center><b>Status</b></td> + <td align=center><b>Open Date</b></td> + </tr> + <tr> + <td align=center><select name=view_issue_type>@issue_select_html;noquote@</select><input type=submit value="Change"></td> + <td align=center>@linked_status_list_html;noquote@</td> + <td align=center>@linked_open_date_list_html;noquote@</td> + </tr> + </table> + +</form> + +<if @row_counter@ gt 0> + <table>@issues_list_html;noquote@</table> +</if><else> + <center><p>None found.</p></center> +</else> 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] -<h2>Customer Service Issues</h2> +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"] - -<hr> - -<form method=post action=issues> -[export_form_vars view_status view_open_date order_by] - -<table border=0 cellspacing=0 cellpadding=0 width=100%> -<tr bgcolor=ececec> -<td align=center><b>Issue Type</b></td> -<td align=center><b>Status</b></td> -<td align=center><b>Open Date</b></td> -</tr> -<tr> -<td align=center><select name=view_issue_type> -" - - - set important_issue_type_list [db_list get_issue_type_list "select picklist_item from ec_picklist_items where picklist_name='issue_type' order by sort_key"] set issue_type_list [concat [list "uncategorized"] $important_issue_type_list [list "all others"]] +set issue_select_html "" foreach issue_type $issue_type_list { if { $issue_type == $view_issue_type } { - append doc_body "<option value=\"$issue_type\" selected>$issue_type" + append issue_select_html "<option value=\"$issue_type\" selected>$issue_type</option>" } else { - append doc_body "<option value=\"$issue_type\">$issue_type" + append issue_select_html "<option value=\"$issue_type\">$issue_type</option>" } } -append doc_body "</select> -<input type=submit value=\"Change\"> -</td> -<td align=center> -" set status_list [list "open" "closed"] - set linked_status_list [list] - foreach status $status_list { if { $status == $view_status } { - lappend linked_status_list "<b>$status</b>" + lappend linked_status_list "<b>$status</b>" } else { - lappend linked_status_list "<a href=\"issues?[export_url_vars view_issue_type view_open_date order_by]&view_status=$status\">$status</a>" + lappend linked_status_list "<a href=\"issues?[export_url_vars view_issue_type view_open_date order_by]&view_status=$status\">$status</a>" } } +set linked_status_list_html "\[ [join $linked_status_list " | "] \]" -append doc_body "\[ [join $linked_status_list " | "] \] -</td> -<td align=center> -" - 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 "<b>[lindex $open_date 1]</b>" + lappend linked_open_date_list "<b>[lindex $open_date 1]</b>" } else { - lappend linked_open_date_list "<a href=\"issues?[export_url_vars view_issue_type view_status order_by]&view_open_date=[lindex $open_date 0]\">[lindex $open_date 1]</a>" + lappend linked_open_date_list "<a href=\"issues?[export_url_vars view_issue_type view_status order_by]&view_open_date=[lindex $open_date 0]\">[lindex $open_date 1]</a>" } } +set linked_open_date_list_html "\[ [join $linked_open_date_list " | "] \]" -append doc_body "\[ [join $linked_open_date_list " | "] \] - -</td></tr></table> - -</form> -<blockquote> -" - 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 "<table> -<tr> +set table_header "<tr> <td><b><a href=\"$link_beginning&order_by=[ns_urlencode "issue_id"]\">Issue ID</a></b></td> <td><b><a href=\"$link_beginning&order_by=[ns_urlencode "open_date"]\">Open Date</a></b></td> <td><b><a href=\"$link_beginning&order_by=[ns_urlencode "close_date"]\">Close Date</a></b></td> @@ -178,60 +133,35 @@ </tr>" 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 "</table> - <p> - $table_header - " - set row_counter 1 + append issues_list_html "</table><br><table>${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 "<tr bgcolor=\"$bgcolor\"><td><a href=\"issue?issue_id=$issue_id\">$issue_id</a></td> + append issues_list_html "<tr bgcolor=\"$bgcolor\"><td><a href=\"issue?issue_id=$issue_id\">$issue_id</a></td> <td>[ec_formatted_full_date $full_open_date]</td> - <td>[ec_decode $full_close_date "" " " [ec_formatted_full_date $full_close_date]]</td> - " - + <td>[ec_decode $full_close_date "" " " [ec_formatted_full_date $full_close_date]]</td>" if { ![empty_string_p $user_id] } { - append doc_body "<td><a href=\"[ec_acs_admin_url]users/one?user_id=$user_id\">$users_last_name, $users_first_names</a></td>" + append issues_list_html "<td><a href=\"[ec_acs_admin_url]users/one?user_id=$user_id\">$users_last_name, $users_first_names</a></td>" } else { - append doc_body "<td>unregistered user <a href=\"user-identification?[export_url_vars user_identification_id]\">$user_identification_id</a></td>" + append issues_list_html "<td>unregistered user <a href=\"user-identification?[export_url_vars user_identification_id]\">$user_identification_id</a></td>" } - - append doc_body "<td>[ec_decode $order_id "" " " "<a href=\"../orders/one?order_id=$order_id\">$order_id</a>"]</td>" - + append issues_list_html "<td>[ec_decode $order_id "" " " "<a href=\"../orders/one?order_id=$order_id\">$order_id</a>"]</td>" if { $view_issue_type =="uncategorized" } { - append doc_body "<td> </td>" + append issues_list_html "<td> </td>" } else { - append doc_body "<td>$issue_type</td>" + append issues_list_html "<td>$issue_type</td>" } - - append doc_body "</tr>" + append issues_list_html "</tr>\n" incr row_counter } - -if { $row_counter != 0 } { - append doc_body "</table>" -} else { - append doc_body "<center>None Found</center>" -} - -append doc_body " -</blockquote> -[ad_admin_footer] -" - - - -doc_return 200 text/html $doc_body