mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-01-27 08:19:36 +01:00
show time until closed for all tickets and those that were opened in the last 60 days. By @kotowicz in 5252ad9d07
This commit is contained in:
parent
80a0198785
commit
f45400e26a
@ -34,7 +34,8 @@
|
||||
<table width='100%'>
|
||||
|
||||
<tr class='row_tablehead' style="color: #fbff00;"><td colspan='2'><i>{% trans "Current Ticket Stats" %}</i></td></tr>
|
||||
<tr><td colspan='2'>- {% trans "Current average number of days until ticket is closed: " %}<strong style="color: red;">{{ basic_ticket_stats.average_nbr_days_until_ticket_closed }}</strong>.
|
||||
<tr><td colspan='2'>- {% trans "Average number of days until ticket is closed (all tickets): " %}<strong style="color: red;">{{ basic_ticket_stats.average_nbr_days_until_ticket_closed }}</strong>.</td></tr>
|
||||
<tr><td colspan='2'>- {% trans "Average number of days until ticket is closed (tickets opened in last 60 days): " %}<strong style="color: red;">{{ basic_ticket_stats.average_nbr_days_until_ticket_closed_last_60_days }}</strong>.
|
||||
{% trans "Click" %} <strong><a href="{% url helpdesk_report_index %}daysuntilticketclosedbymonth">here</a></strong> {% trans "for detailed average by month." %} </td></tr>
|
||||
<tr><td colspan='2'>- {% trans "Distribution of open tickets, grouped by time period:" %}</td></tr>
|
||||
<tr class='row_columnheads'><th>{% trans "Days since opened" %}</th><th>{% trans "Number of open tickets" %}</th></tr>
|
||||
|
@ -1356,10 +1356,6 @@ def calc_average_nbr_days_until_ticket_resolved(Tickets):
|
||||
return mean_per_ticket
|
||||
|
||||
def calc_basic_ticket_stats(Ticket):
|
||||
# all closed tickets - independent of user
|
||||
all_closed_tickets = Ticket.objects.filter(status = Ticket.CLOSED_STATUS)
|
||||
average_nbr_days_until_ticket_closed = calc_average_nbr_days_until_ticket_resolved(all_closed_tickets)
|
||||
|
||||
# all not closed tickets (open, reopened, resolved,) - independent of user
|
||||
all_open_tickets = Ticket.objects.exclude(status = Ticket.CLOSED_STATUS)
|
||||
today = datetime.today()
|
||||
@ -1387,9 +1383,17 @@ def calc_basic_ticket_stats(Ticket):
|
||||
ots.append(['< 30 days', N_ota_le_30, get_color_for_nbr_days(N_ota_le_30), sort_string(date_30_str, ''), ])
|
||||
ots.append(['30 - 60 days', N_ota_le_60_ge_30, get_color_for_nbr_days(N_ota_le_60_ge_30), sort_string(date_60_str, date_30_str), ])
|
||||
ots.append(['> 60 days', N_ota_ge_60, get_color_for_nbr_days(N_ota_ge_60), sort_string('', date_60_str), ])
|
||||
|
||||
|
||||
# all closed tickets - independent of user.
|
||||
all_closed_tickets = Ticket.objects.filter(status = Ticket.CLOSED_STATUS)
|
||||
average_nbr_days_until_ticket_closed = calc_average_nbr_days_until_ticket_resolved(all_closed_tickets)
|
||||
# all closed tickets that were opened in the last 60 days.
|
||||
all_closed_last_60_days = all_closed_tickets.filter(created__gte = date_60_str)
|
||||
average_nbr_days_until_ticket_closed_last_60_days = calc_average_nbr_days_until_ticket_resolved(all_closed_last_60_days)
|
||||
|
||||
# put together basic stats
|
||||
basic_ticket_stats = { 'average_nbr_days_until_ticket_closed': average_nbr_days_until_ticket_closed,
|
||||
'average_nbr_days_until_ticket_closed_last_60_days': average_nbr_days_until_ticket_closed_last_60_days,
|
||||
'open_ticket_stats': ots, }
|
||||
|
||||
return basic_ticket_stats
|
||||
|
Loading…
Reference in New Issue
Block a user