working on dashboard:

- clarify what the individual dashboard ticket lists mean.
- add 'tickets submitted by you' list.
- add possiblity for custom welcome message (HELPDESK_CUSTOM_WELCOME).
This commit is contained in:
Andreas Kotowicz 2011-11-29 14:08:08 +01:00
parent 90721b0746
commit 505a171b61
3 changed files with 45 additions and 5 deletions

View File

@ -63,6 +63,9 @@ HELPDESK_SHOW_CHANGE_PASSWORD = getattr(settings, 'HELPDESK_SHOW_CHANGE_PASSWORD
# 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 '''

View File

@ -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'>
@ -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'>
@ -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'>

View File

@ -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])
@ -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
@ -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)