mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-03-05 02:31:42 +01:00
add option to 'hide empty queues' in dashboard overview.
code to show empty queue is from b7df9b9495
This commit is contained in:
parent
71d69278bc
commit
1e6fa7a92d
@ -109,6 +109,9 @@ HELPDESK_CREATE_TICKET_HIDE_ASSIGNED_TO = getattr(settings, 'HELPDESK_CREATE_TIC
|
|||||||
# show delete button next to unassigned tickets
|
# show delete button next to unassigned tickets
|
||||||
HELPDESK_DASHBOARD_SHOW_DELETE_UNASSIGNED = getattr(settings, 'HELPDESK_DASHBOARD_SHOW_DELETE_UNASSIGNED', True)
|
HELPDESK_DASHBOARD_SHOW_DELETE_UNASSIGNED = getattr(settings, 'HELPDESK_DASHBOARD_SHOW_DELETE_UNASSIGNED', True)
|
||||||
|
|
||||||
|
# hide empty queues in dashboard overview?
|
||||||
|
HELPDESK_DASHBOARD_HIDE_EMPTY_QUEUES = getattr(settings, 'HELPDESK_DASHBOARD_HIDE_EMPTY_QUEUES', True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
''' options for footer '''
|
''' options for footer '''
|
||||||
|
@ -85,6 +85,7 @@ 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,
|
||||||
@ -97,6 +98,21 @@ def dashboard(request):
|
|||||||
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)
|
||||||
|
|
||||||
return render_to_response('helpdesk/dashboard.html',
|
return render_to_response('helpdesk/dashboard.html',
|
||||||
|
Loading…
Reference in New Issue
Block a user