diff --git a/helpdesk/settings.py b/helpdesk/settings.py index 229b52c0..455a62af 100644 --- a/helpdesk/settings.py +++ b/helpdesk/settings.py @@ -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 ''' diff --git a/helpdesk/templates/helpdesk/dashboard.html b/helpdesk/templates/helpdesk/dashboard.html index 2c3715d7..283277c2 100644 --- a/helpdesk/templates/helpdesk/dashboard.html +++ b/helpdesk/templates/helpdesk/dashboard.html @@ -18,12 +18,39 @@ {% endfor %} +{% if helpdesk_settings.HELPDESK_CUSTOM_WELCOME %} +

{% 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?" %}

+{% else %}

{% 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?" %}

+{% endif %} + + + +{% if all_tickets_reported_by_current_user %} +
+ + + + +{% for ticket in all_tickets_reported_by_current_user %} + + + + + + + + +{% endfor %} +
{% trans "All Tickets submitted by you" %}
#{% trans "Pr" %}{% trans "Title" %}{% trans "Queue" %}{% trans "Status" %}{% trans "Last Update" %}
{{ ticket.ticket }}{{ ticket.get_priority_span }}{{ ticket.title }}{{ ticket.queue }}{{ ticket.get_status }}{{ ticket.modified|timesince }}
+{% endif %} + +
- + {% for ticket in user_tickets %} @@ -43,7 +70,7 @@
{% trans "Your Open Tickets" %}
{% trans "Open Tickets assigned to you (you are working on this ticket)" %}
#{% trans "Pr" %}{% trans "Title" %}{% trans "Queue" %}{% trans "Status" %}{% trans "Last Update" %}
- + {% for ticket in unassigned_tickets %} @@ -65,7 +92,7 @@
{% trans "Unassigned Tickets" %}
{% trans "Unassigned Tickets" %} {% trans "(pick up a ticket if you start to work on it)" %}
#{% trans "Pr" %}{% trans "Title" %}{% trans "Queue" %}{% trans "Created" %} 
- + {% for ticket in user_tickets_closed_resolved %} diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index 5a955f8f..b4fef2d7 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -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)
{% trans "Your closed & resolved Tickets" %}
{% trans "Closed & resolved Tickets you used to work on" %}
#{% trans "Pr" %}{% trans "Title" %}{% trans "Queue" %}{% trans "Status" %}{% trans "Last Update" %}