X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Ftickets.html;h=adfaead6ea1cc9f90e657a0d0b3a6df7c2e07166;hb=3ab9b93b970353bfddc44b65bbb79d3aa586ded7;hp=167849c768923935e901dfd86ad0c34ccd205d2a;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git
diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html
index 167849c76..adfaead6e 100644
--- a/httemplate/view/cust_main/tickets.html
+++ b/httemplate/view/cust_main/tickets.html
@@ -1,20 +1,56 @@
-(View <% $openlabel %> tickets for this customer)
-(View resolved tickets for this customer)
+
-(Create new ticket for this customer)
-<% include("/elements/table-grid.html") %>
+(<% mt("View $openlabel tickets for this customer") |h %>)
+(<% mt('View resolved tickets for this customer') |h %>)
+
+
+<& /elements/table-grid.html &>
% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
% my $bgcolor = '';
- # |
- Subject |
- Status |
- Queue |
- Owner |
- Priority |
+ <% mt('#') |h %> |
+ <% mt('Subject') |h %> |
+ <% mt('Status') |h %> |
+ <% mt('Queue') |h %> |
+ <% mt('Owner') |h %> |
+ <% mt('Due') |h %> |
+ <% mt('Estimated Time') |h %> |
+ <% mt('Priority') |h %> |
+% if ( $ss_priority ) {
+ <% mt('Customer Priority') |h %> |
+% }
% foreach my $ticket ( @tickets ) {
@@ -46,6 +82,14 @@
<% $ticket->{owner} %>
|
+
+
+ <% $date_formatter->($ticket->{due}) %>
+ |
+
+
+ <% $ticket->{timeestimated} %>
+ |
<% $ticket->{content}
@@ -53,7 +97,13 @@
: $ticket->{priority}
%>
|
-
+
+% if ( $ss_priority ) {
+
+ <% $ticket->{"CF.{$ss_priority}"} %>
+ |
+% }
+
% }
@@ -61,7 +111,10 @@
<%init>
+use Date::Format 'time2str';
+use Date::Parse 'str2time';
+my( $conf ) = new FS::Conf;
my( $cust_main ) = @_;
my( @tickets ) = $cust_main->tickets;
@@ -73,9 +126,38 @@ my $res_link = FS::TicketSystem->href_customer_tickets(
{ 'statuses' => [ 'resolved' ] }
);
-my $new_link = FS::TicketSystem->href_new_ticket(
- $cust_main,
- join(', ', $cust_main->invoicing_list_emailonly )
- );
+my( $new_base, %new_param ) =
+ FS::TicketSystem->href_params_new_ticket( $cust_main );
+
+my $new_link = FS::TicketSystem->href_new_ticket( $cust_main );
+
+my $ss_priority = FS::TicketSystem->selfservice_priority;
+if ( $ss_priority ) {
+ my $dir = $conf->exists('ticket_system-priority_reverse') ? -1 : 1;
+ use sort 'stable';
+ # sort in the following way:
+ @tickets = sort {
+ # within a severity level...
+ ( $a->{'content'} eq $b->{'content'} ) ? (
+ # no-priority tickets sort last
+ (
+ ($a->{'_selfservice_priority'} eq '') <=>
+ ($b->{'_selfservice_priority'} eq '')
+ ) ||
+ # otherwise obey ticket_system-priority_reverse
+ ( $dir *
+ ($b->{'_selfservice_priority'} <=> $a->{'_selfservice_priority'})
+ )
+ ) : 0; # but don't rearrange between severity levels
+ } @tickets;
+}
+
+my $format = $conf->config('date_format') || '%Y-%m-%d';
+
+my $date_formatter = sub {
+ my $time = str2time($_[0], 'GMT');
+ # exclude times within 24 hours of zero
+ ($time > 86400) ? time2str($format, $time) : '';
+};
%init>