mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-16 10:57:58 +02:00
Settings.py cleanup (#200): Remove HELPDESK_DASHBOARD_HIDE_EMPTY_QUEUES
This commit is contained in:
@ -94,33 +94,18 @@ def dashboard(request):
|
||||
# Queue 2 4 12
|
||||
|
||||
cursor = connection.cursor()
|
||||
if helpdesk_settings.HELPDESK_DASHBOARD_HIDE_EMPTY_QUEUES:
|
||||
cursor.execute("""
|
||||
SELECT q.id as queue,
|
||||
q.title AS name,
|
||||
COUNT(CASE t.status WHEN '1' THEN t.id WHEN '2' THEN t.id END) AS open,
|
||||
COUNT(CASE t.status WHEN '3' THEN t.id END) AS resolved,
|
||||
COUNT(CASE t.status WHEN '4' THEN t.id END) AS closed
|
||||
FROM helpdesk_ticket t,
|
||||
helpdesk_queue q
|
||||
WHERE q.id = t.queue_id
|
||||
GROUP BY queue, name
|
||||
ORDER BY q.id;
|
||||
""")
|
||||
else:
|
||||
cursor.execute("""
|
||||
SELECT q.id as queue,
|
||||
q.title AS name,
|
||||
COUNT(CASE t.status WHEN '1' THEN t.id WHEN '2' THEN t.id END) AS open,
|
||||
COUNT(CASE t.status WHEN '3' THEN t.id END) AS resolved,
|
||||
COUNT(CASE t.status WHEN '4' THEN t.id END) AS closed
|
||||
FROM helpdesk_queue q
|
||||
LEFT OUTER JOIN helpdesk_ticket t
|
||||
ON q.id = t.queue_id
|
||||
GROUP BY queue, name
|
||||
ORDER BY q.id;
|
||||
""")
|
||||
|
||||
cursor.execute("""
|
||||
SELECT q.id as queue,
|
||||
q.title AS name,
|
||||
COUNT(CASE t.status WHEN '1' THEN t.id WHEN '2' THEN t.id END) AS open,
|
||||
COUNT(CASE t.status WHEN '3' THEN t.id END) AS resolved,
|
||||
COUNT(CASE t.status WHEN '4' THEN t.id END) AS closed
|
||||
FROM helpdesk_ticket t,
|
||||
helpdesk_queue q
|
||||
WHERE q.id = t.queue_id
|
||||
GROUP BY queue, name
|
||||
ORDER BY q.id;
|
||||
""")
|
||||
|
||||
dash_tickets = query_to_dict(cursor.fetchall(), cursor.description)
|
||||
|
||||
|
Reference in New Issue
Block a user