Added groups to report download list.

This commit is contained in:
Martin Edenhofer 2017-04-18 01:14:54 +02:00
parent e3065b1c51
commit 4b332b46cd
2 changed files with 17 additions and 15 deletions

View file

@ -6,7 +6,7 @@
<td><%- @T('Number') %></td> <td><%- @T('Number') %></td>
<td><%- @T('Title') %></td> <td><%- @T('Title') %></td>
<td><%- @T('State') %></td> <td><%- @T('State') %></td>
<td><%- @T('Queue') %></td> <td><%- @T('Group') %></td>
<td><%- @T('Created') %></td> <td><%- @T('Created') %></td>
</tr> </tr>
</thead> </thead>

View file

@ -177,7 +177,7 @@ class ReportsController < ApplicationController
worksheet.set_column(1, 1, 34) worksheet.set_column(1, 1, 34)
worksheet.set_column(2, 2, 10) worksheet.set_column(2, 2, 10)
worksheet.set_column(3, 3, 10) worksheet.set_column(3, 3, 10)
worksheet.set_column(4, 7, 20) worksheet.set_column(4, 8, 20)
# Add and define a format # Add and define a format
format = workbook.add_format # Add a format format = workbook.add_format # Add a format
@ -197,10 +197,11 @@ class ReportsController < ApplicationController
worksheet.write(2, 1, 'Title', format_header) worksheet.write(2, 1, 'Title', format_header)
worksheet.write(2, 2, 'State', format_header) worksheet.write(2, 2, 'State', format_header)
worksheet.write(2, 3, 'Priority', format_header) worksheet.write(2, 3, 'Priority', format_header)
worksheet.write(2, 4, 'Customer', format_header ) worksheet.write(2, 4, 'Group', format_header)
worksheet.write(2, 5, 'Created at', format_header ) worksheet.write(2, 5, 'Customer', format_header)
worksheet.write(2, 6, 'Updated at', format_header ) worksheet.write(2, 6, 'Created at', format_header)
worksheet.write(2, 7, 'Closed at', format_header ) worksheet.write(2, 7, 'Updated at', format_header)
worksheet.write(2, 8, 'Closed at', format_header)
row = 2 row = 2
result[:ticket_ids].each { |ticket_id| result[:ticket_ids].each { |ticket_id|
@ -210,10 +211,11 @@ class ReportsController < ApplicationController
worksheet.write(row, 1, ticket.title) worksheet.write(row, 1, ticket.title)
worksheet.write(row, 2, ticket.state.name) worksheet.write(row, 2, ticket.state.name)
worksheet.write(row, 3, ticket.priority.name) worksheet.write(row, 3, ticket.priority.name)
worksheet.write(row, 4, ticket.customer.fullname) worksheet.write(row, 4, ticket.group.name)
worksheet.write(row, 5, ticket.created_at) worksheet.write(row, 5, ticket.customer.fullname)
worksheet.write(row, 6, ticket.updated_at) worksheet.write(row, 6, ticket.created_at)
worksheet.write(row, 7, ticket.close_at) worksheet.write(row, 7, ticket.updated_at)
worksheet.write(row, 8, ticket.close_at)
} }
workbook.close workbook.close