Skip to content

Commit

Permalink
working on dashboard:
Browse files Browse the repository at this point in the history
- clarify what the individual dashboard ticket lists mean.
- add 'tickets submitted by you' list.
- add possiblity for custom welcome message (HELPDESK_CUSTOM_WELCOME).
  • Loading branch information
kotowicz committed Nov 29, 2011
1 parent 90721b0 commit 505a171
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
3 changes: 3 additions & 0 deletions helpdesk/settings.py
Expand Up @@ -63,6 +63,9 @@
# allow user to override default layout for 'followups' - work in progress.
HELPDESK_FOLLOWUP_MOD = getattr(settings, 'HELPDESK_FOLLOWUP_MOD', False)

# show custom welcome message in dashboard?
HELPDESK_CUSTOM_WELCOME = getattr(settings, 'HELPDESK_CUSTOM_WELCOME', False)



''' options for public pages '''
Expand Down
33 changes: 30 additions & 3 deletions helpdesk/templates/helpdesk/dashboard.html
Expand Up @@ -18,12 +18,39 @@
{% endfor %}
</table>

{% if helpdesk_settings.HELPDESK_CUSTOM_WELCOME %}
<p style='margin-left: 42%;'>{% trans "Welcome to your Helpdesk Dashboard! From here you can quickly see tickets submitted by you, tickets you are working on, and those tickets that have no owner. Why not pick up an orphan ticket and sort it out for a customer?" %}</p>
{% else %}
<p style='margin-left: 42%;'>{% trans "Welcome to your Helpdesk Dashboard! From here you can quickly see your own tickets, and those tickets that have no owner. Why not pick up an orphan ticket and sort it out for a customer?" %}</p>
{% endif %}



{% if all_tickets_reported_by_current_user %}
<br style='clear: both;' />

<table width='100%'>
<tr class='row_tablehead'><td colspan='6'>{% trans "All Tickets submitted by you" %}</td></tr>
<tr class='row_columnheads'><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Status" %}</th><th>{% trans "Last Update" %}</th></tr>
{% for ticket in all_tickets_reported_by_current_user %}
<tr class='row_{% cycle odd,even %} row_hover'>
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.ticket }}</a></th>
<td>{{ ticket.get_priority_span }}</td>
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
<td>{{ ticket.queue }}</td>
<td>{{ ticket.get_status }}</td>
<td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|timesince }}</span></td>
</tr>
{% endfor %}
</table>
{% endif %}



<br style='clear: both;' />

<table width='100%'>
<tr class='row_tablehead'><td colspan='6'>{% trans "Your Open Tickets" %}</td></tr>
<tr class='row_tablehead'><td colspan='6'>{% trans "Open Tickets assigned to you (you are working on this ticket)" %}</td></tr>
<tr class='row_columnheads'><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Status" %}</th><th>{% trans "Last Update" %}</th></tr>
{% for ticket in user_tickets %}
<tr class='row_{% cycle odd,even %} row_hover'>
Expand All @@ -43,7 +70,7 @@
<br style='clear: both;' />

<table width='100%'>
<tr class='row_tablehead'><td colspan='6'>{% trans "Unassigned Tickets" %}</td></tr>
<tr class='row_tablehead'><td colspan='6'>{% trans "Unassigned Tickets" %} {% trans "(pick up a ticket if you start to work on it)" %}</td></tr>
<tr class='row_columnheads'><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Created" %}</th><th>&nbsp;</th></tr>
{% for ticket in unassigned_tickets %}
<tr class='row_{% cycle odd,even %} row_hover'>
Expand All @@ -65,7 +92,7 @@
<br style='clear: both;' />

<table width='100%'>
<tr class='row_tablehead'><td colspan='6'>{% trans "Your closed & resolved Tickets" %}</td></tr>
<tr class='row_tablehead'><td colspan='6'>{% trans "Closed & resolved Tickets you used to work on" %}</td></tr>
<tr class='row_columnheads'><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Status" %}</th><th>{% trans "Last Update" %}</th></tr>
{% for ticket in user_tickets_closed_resolved %}
<tr class='row_{% cycle odd,even %} row_hover'>
Expand Down
14 changes: 12 additions & 2 deletions helpdesk/views/staff.py
Expand Up @@ -51,14 +51,14 @@ def dashboard(request):
with options for them to 'Take' ownership of said tickets.
"""

# open & reopened tickets
# open & reopened tickets, assigned to current user
tickets = Ticket.objects.filter(
assigned_to=request.user,
).exclude(
status__in = [Ticket.CLOSED_STATUS, Ticket.RESOLVED_STATUS],
)

# closed & resolved tickets
# closed & resolved tickets, assigned to current user
tickets_closed_resolved = Ticket.objects.filter(
assigned_to=request.user,
status__in = [Ticket.CLOSED_STATUS, Ticket.RESOLVED_STATUS])
Expand All @@ -69,6 +69,15 @@ def dashboard(request):
status=Ticket.CLOSED_STATUS,
)

# all tickets, reported by current user
all_tickets_reported_by_current_user = ''
email_current_user = request.user.email
if email_current_user:
all_tickets_reported_by_current_user = Ticket.objects.filter(
submitter_email=email_current_user,
).order_by('status')


# The following query builds a grid of queues & ticket statuses,
# to be displayed to the user. EG:
# Open Resolved
Expand All @@ -95,6 +104,7 @@ def dashboard(request):
'user_tickets': tickets,
'user_tickets_closed_resolved': tickets_closed_resolved,
'unassigned_tickets': unassigned_tickets,
'all_tickets_reported_by_current_user': all_tickets_reported_by_current_user,
'dash_tickets': dash_tickets,
}))
dashboard = staff_member_required(dashboard)
Expand Down

0 comments on commit 505a171

Please sign in to comment.