Commit 82d437b3 authored by Frank Bergmann's avatar Frank Bergmann

- Helpdesk:

  Showing now statistics per department
parent 21e8353c
...@@ -102,6 +102,12 @@ Ext.onReady(function () { ...@@ -102,6 +102,12 @@ Ext.onReady(function () {
if ("" != "@ticket_customer_contact_id@" && 0 != parseInt("@ticket_customer_contact_id@")) { if ("" != "@ticket_customer_contact_id@" && 0 != parseInt("@ticket_customer_contact_id@")) {
url = url + "&ticket_customer_contact_id=@ticket_customer_contact_id@"; url = url + "&ticket_customer_contact_id=@ticket_customer_contact_id@";
} }
if ("" != "@ticket_customer_contact_dept_code@") {
url = url + "&customer_contact_dept_code=@ticket_customer_contact_dept_code@";
}
if ("" != "@ticket_assignee_dept_code@") {
url = url + "&assignee_dept_code=@ticket_assignee_dept_code@";
}
window.open(url); window.open(url);
} }
} }
......
...@@ -23,7 +23,10 @@ ad_page_contract { ...@@ -23,7 +23,10 @@ ad_page_contract {
{ customer_id:integer 0 } { customer_id:integer 0 }
{ customer_contact_id:integer 0 } { customer_contact_id:integer 0 }
{ assignee_id:integer 0 } { assignee_id:integer 0 }
{ customer_contact_dept_id:nohtml 0 }
{ customer_contact_dept_code:nohtml "" }
{ assignee_dept_id:nohtml 0 } { assignee_dept_id:nohtml 0 }
{ assignee_dept_code:nohtml "" }
{ letter:trim "" } { letter:trim "" }
{ start_idx:integer 0 } { start_idx:integer 0 }
{ how_many "" } { how_many "" }
...@@ -344,19 +347,48 @@ if {[empty_string_p $ticket_creator_id] == 0 && $ticket_creator_id != 0 } { ...@@ -344,19 +347,48 @@ if {[empty_string_p $ticket_creator_id] == 0 && $ticket_creator_id != 0 } {
if {0 != $assignee_id && "" != $assignee_id} { if {0 != $assignee_id && "" != $assignee_id} {
lappend criteria "t.ticket_assignee_id = :assignee_id" lappend criteria "t.ticket_assignee_id = :assignee_id"
} }
if {0 != $assignee_dept_id && "" != $assignee_dept_id} {
if {"null" == $assignee_dept_id} { # Assignee Department
lappend criteria "t.ticket_assignee_id is null" if {"null" == $assignee_dept_id} {
} else { lappend criteria "t.ticket_assignee_id is null"
lappend criteria "t.ticket_assignee_id in ( set assignee_dept_code ""
select e.employee_id } else {
from im_employees e, if {0 != $assignee_dept_id} {
im_cost_centers cc set assignee_dept_code [db_string dept_code "select im_cost_center_code_from_id(:assignee_dept_id)" -default ""]
where cc.cost_center_id = :assignee_dept_id and
e.department_id = cc.cost_center_id
)"
} }
} }
if {"" != $assignee_dept_code} {
lappend criteria "t.ticket_assignee_id in (
select e.employee_id
from im_employees e,
im_cost_centers cc
where e.department_id = cc.cost_center_id and
substring(cc.cost_center_code for (length(:assignee_dept_code))) = :assignee_dept_code
)"
}
# Customer_Contact Department
if {"null" == $customer_contact_dept_id} {
lappend criteria "t.ticket_customer_contact_id is null"
set customer_contact_dept_code ""
} else {
if {0 != $customer_contact_dept_id} {
set customer_contact_dept_code [db_string dept_code "select im_cost_center_code_from_id(:customer_contact_dept_id)" -default ""]
}
}
if {"" != $customer_contact_dept_code} {
lappend criteria "t.ticket_customer_contact_id in (
select e.employee_id
from im_employees e,
im_cost_centers cc
where e.department_id = cc.cost_center_id and
substring(cc.cost_center_code for (length(:customer_contact_dept_code))) = :customer_contact_dept_code
)"
}
if {![empty_string_p $customer_id] && $customer_id != 0 } { if {![empty_string_p $customer_id] && $customer_id != 0 } {
lappend criteria "p.company_id = :customer_id" lappend criteria "p.company_id = :customer_id"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment