Index: openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-oracle.xql,v
diff -u -r1.3 -r1.3.8.1
--- openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-oracle.xql 26 May 2002 04:36:49 -0000 1.3
+++ openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-oracle.xql 19 Dec 2004 10:25:01 -0000 1.3.8.1
@@ -30,4 +30,25 @@
+
+
+ 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
+
+
+
+
+
+ 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
+
+
+
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 -r1.3.8.1
--- openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-postgresql.xql 26 May 2002 04:36:49 -0000 1.3
+++ openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs-postgresql.xql 19 Dec 2004 10:25:01 -0000 1.3.8.1
@@ -29,5 +29,25 @@
(:issue_id, :user_identification_id, :order_id, current_timestamp, current_timestamp, :customer_service_rep, :gift_certificate_id)
+
+
+
+ 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)
+ where i.user_identification_id = id.user_identification_id
+ and id.user_id = :user_id
+ order by i.issue_id
+
+
+
+
+
+ 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
+ on (i.issue_id = m.issue_id)
+ where i.user_identification_id = :user_identification_id
+ order by i.issue_id
+
+
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 -r1.5.8.1
--- openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs.tcl 10 Sep 2002 22:22:36 -0000 1.5
+++ openacs-4/packages/ecommerce/tcl/ecommerce-customer-service-procs.tcl 19 Dec 2004 10:25:01 -0000 1.5.8.1
@@ -111,49 +111,66 @@
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 "
"
+ set old_issue_id ""
+ set issue_type_list [list]
+
if { ![empty_string_p $user_id] } {
- set sql {
+ set sql
+
+ 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 ", "])"
+ set issue_type_list [list]
+ }
+ append to_return "- $issue_id: opened [util_AnsiDatetoPrettyDate $open_date]"
+ if { ![empty_string_p $close_date] } {
+ append to_return ", closed [util_AnsiDatetoPrettyDate $close_date]"
+ }
+ }
+ if { ![empty_string_p $issue_type] } {
+ lappend issue_type_list $issue_type
+ }
+ set old_issue_id $issue_id
+ }
+
} else {
- set sql {
+ 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
- }
- }
+ } {
- set old_issue_id ""
- set issue_type_list [list]
-
- db_foreach user_customer_service_issue $sql {
-
- if { $issue_id != $old_issue_id } {
- if { [llength $issue_type_list] > 0 } {
- append to_return " ([join $issue_type_list ", "])"
- set issue_type_list [list]
+ if { $issue_id != $old_issue_id } {
+ if { [llength $issue_type_list] > 0 } {
+ append to_return " ([join $issue_type_list ", "])"
+ set issue_type_list [list]
+ }
+ append to_return "
- $issue_id: opened [util_AnsiDatetoPrettyDate $open_date]"
+ if { ![empty_string_p $close_date] } {
+ append to_return ", closed [util_AnsiDatetoPrettyDate $close_date]"
+ }
}
- append to_return "
- $issue_id: opened [util_AnsiDatetoPrettyDate $open_date]"
- if { ![empty_string_p $close_date] } {
- append to_return ", closed [util_AnsiDatetoPrettyDate $close_date]"
+ if { ![empty_string_p $issue_type] } {
+ lappend issue_type_list $issue_type
}
- }
- if { ![empty_string_p $issue_type] } {
- lappend issue_type_list $issue_type
- }
- set old_issue_id $issue_id
+ set old_issue_id $issue_id
+ }
}
+
if { [llength $issue_type_list] > 0 } {
append to_return " ([join $issue_type_list ", "])"
}