Index: openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-postgresql.xql,v diff -u -r1.3.8.1 -r1.3.8.2 --- openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-postgresql.xql 19 Dec 2004 10:25:01 -0000 1.3.8.1 +++ openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-postgresql.xql 12 Feb 2005 08:14:57 -0000 1.3.8.2 @@ -30,7 +30,7 @@ - + select i.issue_id, i.open_date, i.close_date, m.issue_type from ec_user_identification id, ec_customer_service_issues i left join ec_cs_issue_type_map m on (i.issue_id = m.issue_id) @@ -40,7 +40,7 @@ - + select i.issue_id, i.open_date, i.close_date, m.issue_type from ec_customer_service_issues i left join ec_cs_issue_type_map m Index: openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs.tcl,v diff -u -r1.5.8.1 -r1.5.8.2 --- openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs.tcl 19 Dec 2004 10:25:01 -0000 1.5.8.1 +++ openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs.tcl 12 Feb 2005 08:14:57 -0000 1.5.8.2 @@ -108,25 +108,21 @@ return [list $user_identification_id $issue_id] } -ad_proc ec_all_cs_issues_by_one_user { {user_id ""} {user_identification_id ""} } { lists all issues by user_id or user_identification } { - set to_return "
    " - +ad_proc ec_all_cs_issues_by_one_user { + {user_id ""} + {user_identification_id ""} +} { + creates html list of all issues by user_id or user_identification +} { + set to_return "" + set no_issues 0 set old_issue_id "" set issue_type_list [list] if { ![empty_string_p $user_id] } { - set sql + db_foreach user_customer_service_issue {} { - db_foreach user_customer_service_issue { - select i.issue_id, i.open_date, i.close_date, m.issue_type - from ec_customer_service_issues i, ec_cs_issue_type_map m, ec_user_identification id - where i.issue_id = m.issue_id(+) - and i.user_identification_id = id.user_identification_id - and id.user_id = :user_id - order by i.issue_id - } { - if { $issue_id != $old_issue_id } { if { [llength $issue_type_list] > 0 } { append to_return " ([join $issue_type_list ", "])" @@ -141,17 +137,14 @@ lappend issue_type_list $issue_type } set old_issue_id $issue_id + + } if_no_rows { + set no_issues 1 } - } else { + } elseif { ![empty_string_p $user_identification_id] } { - db_foreach customer_service_issue { - select i.issue_id, i.open_date, i.close_date, m.issue_type - from ec_customer_service_issues i, ec_cs_issue_type_map m - where i.issue_id = m.issue_id(+) - and i.user_identification_id = :user_identification_id - order by i.issue_id - } { + db_foreach ident_customer_service_issue {} { if { $issue_id != $old_issue_id } { if { [llength $issue_type_list] > 0 } { @@ -167,14 +160,16 @@ lappend issue_type_list $issue_type } set old_issue_id $issue_id + + } if_no_rows { + set no_issues 1 } } - - if { [llength $issue_type_list] > 0 } { - append to_return " ([join $issue_type_list ", "])" + if { $no_issues } { + set to_return "

    No customer service issues found for this contact.

    " + } else { + set to_return "
      ${to_return}
    " } - - append to_return "
" return $to_return }