X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Ftickets.html;h=2175110e4f95a2cd80db83b659778720b029338a;hb=2238711675eefa60cd2feb47c8d3e43d3e6f1860;hp=72d68152acab2e35d1284435161bd8d09e8ac1b6;hpb=4ae2e675666602cc034b46622cccfd2e214de952;p=freeside.git diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html index 72d68152a..2175110e4 100644 --- a/httemplate/view/cust_main/tickets.html +++ b/httemplate/view/cust_main/tickets.html @@ -1,54 +1,114 @@ -<% - my( $cust_main ) = @_; +
+ +<% mt('Create new ticket') |h %> + <% mt('in queue') |h %> +%# fetch list of queues in which the user can create tickets +% my $session = FS::TicketSystem->session(); +% my %queues = FS::TicketSystem->queues($session, 'CreateTicket'); +% if( $conf->exists('ticket_system-force_default_queueid') ) { +<% $queues{$new_param{'Queue'}} %> + +% } +% else { + + +% } +
+
- my $conf = new FS::Conf; - my $num = 10; +(<% mt("View $openlabel tickets for this customer") |h %>) +(<% mt('View resolved tickets for this customer') |h %>) +

- my @tickets = (); - unless ( $conf->config('ticket_system-custom_priority_field') ) { +<& /elements/table-grid.html &> +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = ''; - @tickets = - @{ FS::TicketSystem->customer_tickets($cust_main->custnum, $num) }; - - } else { + + <% mt('#') |h %> + <% mt('Subject') |h %> + <% mt('Status') |h %> + <% mt('Queue') |h %> + <% mt('Owner') |h %> + <% mt('Priority') |h %> + - foreach my $priority ( - $conf->config('ticket_system-custom_priority_field-values'), '' - ) { - last if scalar(@tickets) >= $num; - push @tickets, - @{ FS::TicketSystem->customer_tickets( $cust_main->custnum, - $num - scalar(@tickets), - $priority, - ) - }; - } +% foreach my $ticket ( @tickets ) { +% my $href = FS::TicketSystem->href_ticket($ticket->{id}); +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } - } + + + + ><% $ticket->{id} %> + + + + ><% $ticket->{subject} %> + + + + <% $ticket->{status} %> + + + + <% $ticket->{queue} %> + + + + <% $ticket->{owner} %> + + + + <% $ticket->{content} + ? $ticket->{content}.' ('.$ticket->{priority}.')' + : $ticket->{priority} + %> + + + -%> +% } -Highest priority tickets -(View all tickets for this customer) -(New ticket for this customer) -<%= table() %> - - # - Subject - Priority - Queue - Status - -<% foreach my $ticket ( @tickets ) { - my $href = FS::TicketSystem->href_ticket($ticket->{id}); -%> - - ><%= $ticket->{id} %> - ><%= $ticket->{subject} %> - <%= $ticket->{content} || $ticket->{priority} %> - <%= $ticket->{name} %> - <%= $ticket->{status} %> - -<% } %> +<%init> + +my( $conf ) = new FS::Conf; +my( $cust_main ) = @_; +my( @tickets ) = $cust_main->tickets; + +my $open_link = FS::TicketSystem->href_customer_tickets($cust_main->custnum); +my $openlabel = join('/', FS::TicketSystem->statuses ); + +my $res_link = FS::TicketSystem->href_customer_tickets( + $cust_main->custnum, + { 'statuses' => [ 'resolved' ] } + ); + +my( $new_base, %new_param ) = + FS::TicketSystem->href_params_new_ticket( $cust_main ); + +my $new_link = FS::TicketSystem->href_new_ticket( $cust_main ); + +