Fixed issue #1194 - Add date/time information to time accounting (xls export).

This commit is contained in:
Rolf Schmidt 2017-07-06 11:05:28 +02:00
parent 0065028ee6
commit 714b88aa93
2 changed files with 96 additions and 0 deletions

View file

@ -13,6 +13,8 @@
<th><%- @T('Agent') %>
<th><%- @T('Time Units') %>
<th><%- @T('Time Units Total') %>
<th><%- @T('Created at') %>
<th><%- @T('Closed at') %>
</thead>
<tbody>
<% for row in @rows: %>
@ -24,6 +26,8 @@
<td><%= row.agent %>
<td><%= row.time_unit %>
<td><%= row.ticket.time_unit %>
<td><%- @humanTime(row.ticket.created_at) %>
<td><%- @humanTime(row.ticket.close_at) %>
<% end %>
</tbody>
</table>

View file

@ -93,9 +93,84 @@ class TimeAccountingsController < ApplicationController
name: 'Time Units Total',
width: 10,
},
{
name: 'Created at',
width: 10,
},
{
name: 'Closed at',
width: 10,
},
{
name: 'Close Escalation At',
width: 10,
},
{
name: 'Close In Min',
width: 10,
},
{
name: 'Close Diff In Min',
width: 10,
},
{
name: 'First Response At',
width: 10,
},
{
name: 'First Response Escalation At',
width: 10,
},
{
name: 'First Response In Min',
width: 10,
},
{
name: 'First Response Diff In Min',
width: 10,
},
{
name: 'Update Escalation At',
width: 10,
},
{
name: 'Update In Min',
width: 10,
},
{
name: 'Update Diff In Min',
width: 10,
},
{
name: 'Last Contact At',
width: 10,
},
{
name: 'Last Contact Agent At',
width: 10,
},
{
name: 'Last Contact Customer At',
width: 10,
},
{
name: 'Article Count',
width: 10,
},
{
name: 'Escalation At',
width: 10,
},
]
result = []
results.each { |row|
row[:ticket].keys.each{|field|
next if row[:ticket][field].blank?
next if !row[:ticket][field].kind_of?(ActiveSupport::TimeWithZone)
row[:ticket][field] = row[:ticket][field].iso8601
}
result_row = [
row[:ticket]['number'],
row[:ticket]['title'],
@ -104,6 +179,23 @@ class TimeAccountingsController < ApplicationController
row[:agent],
row[:time_unit],
row[:ticket]['time_unit'],
row[:ticket]['created_at'],
row[:ticket]['close_at'],
row[:ticket]['close_escalation_at'],
row[:ticket]['close_in_min'],
row[:ticket]['close_diff_in_min'],
row[:ticket]['first_response_at'],
row[:ticket]['first_response_escalation_at'],
row[:ticket]['first_response_in_min'],
row[:ticket]['first_response_diff_in_min'],
row[:ticket]['update_escalation_at'],
row[:ticket]['update_in_min'],
row[:ticket]['update_diff_in_min'],
row[:ticket]['last_contact_at'],
row[:ticket]['last_contact_agent_at'],
row[:ticket]['last_contact_customer_at'],
row[:ticket]['article_count'],
row[:ticket]['escalation_at'],
]
result.push result_row
}