mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-06-18 15:46:40 +02:00
Settings.py cleanup (#200): Remove HELPDESK_DASHBOARD_HIDE_EMPTY_QUEUES
This commit is contained in:
parent
07a9093dae
commit
99e9bd33d8
@ -122,9 +122,6 @@ HELPDESK_CREATE_TICKET_HIDE_ASSIGNED_TO = getattr(settings, 'HELPDESK_CREATE_TIC
|
|||||||
|
|
||||||
|
|
||||||
''' options for dashboard '''
|
''' options for dashboard '''
|
||||||
# hide empty queues in dashboard overview?
|
|
||||||
HELPDESK_DASHBOARD_HIDE_EMPTY_QUEUES = getattr(settings, 'HELPDESK_DASHBOARD_HIDE_EMPTY_QUEUES', True)
|
|
||||||
|
|
||||||
# show basic ticket stats on dashboard?
|
# show basic ticket stats on dashboard?
|
||||||
HELPDESK_DASHBOARD_BASIC_TICKET_STATS = getattr(settings, 'HELPDESK_DASHBOARD_BASIC_TICKET_STATS', False)
|
HELPDESK_DASHBOARD_BASIC_TICKET_STATS = getattr(settings, 'HELPDESK_DASHBOARD_BASIC_TICKET_STATS', False)
|
||||||
|
|
||||||
|
@ -94,33 +94,18 @@ def dashboard(request):
|
|||||||
# Queue 2 4 12
|
# Queue 2 4 12
|
||||||
|
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
if helpdesk_settings.HELPDESK_DASHBOARD_HIDE_EMPTY_QUEUES:
|
cursor.execute("""
|
||||||
cursor.execute("""
|
SELECT q.id as queue,
|
||||||
SELECT q.id as queue,
|
q.title AS name,
|
||||||
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 '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 '3' THEN t.id END) AS resolved,
|
COUNT(CASE t.status WHEN '4' THEN t.id END) AS closed
|
||||||
COUNT(CASE t.status WHEN '4' THEN t.id END) AS closed
|
FROM helpdesk_ticket t,
|
||||||
FROM helpdesk_ticket t,
|
helpdesk_queue q
|
||||||
helpdesk_queue q
|
WHERE q.id = t.queue_id
|
||||||
WHERE q.id = t.queue_id
|
GROUP BY queue, name
|
||||||
GROUP BY queue, name
|
ORDER BY q.id;
|
||||||
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;
|
|
||||||
""")
|
|
||||||
|
|
||||||
|
|
||||||
dash_tickets = query_to_dict(cursor.fetchall(), cursor.description)
|
dash_tickets = query_to_dict(cursor.fetchall(), cursor.description)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user