From 12f4cc4b100b849de3584d5d1a2376cebcd8729f Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 27 Jun 2011 07:11:01 +0000 Subject: self-service ticket priority and edit subject, #13199 --- httemplate/config/config-view.cgi | 2 +- httemplate/edit/cust_main/top_misc.html | 10 +++++++++ httemplate/view/cust_main/tickets.html | 38 +++++++++++++++++++++++++++++---- 3 files changed, 45 insertions(+), 5 deletions(-) (limited to 'httemplate') diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 10fcde3c4..4c90ebb8d 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -350,7 +350,7 @@ my @config_items = grep { $page_agent ? $_->per_agent : 1 } my @deleteable = qw( invoice_latexreturnaddress invoice_htmlreturnaddress ); my %deleteable = map { $_ => 1 } @deleteable; -my @sections = qw(required billing invoicing notification UI self-service username password session shell BIND telephony ); +my @sections = qw(required billing invoicing notification UI self-service ticketing username password session shell BIND telephony ); push @sections, '', 'deprecated'; my %section_items = (); diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html index 575b73727..a7545a045 100644 --- a/httemplate/edit/cust_main/top_misc.html +++ b/httemplate/edit/cust_main/top_misc.html @@ -108,6 +108,16 @@ &> % } +% # permission to edit ticket subjects +% if ( $conf->exists('ticket_system-selfservice_edit_subject') ) { + + + edit_subject ? 'CHECKED' : '' %>> + <% mt('Can edit ticket subjects') |h %> + +% } + <%init> diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html index 2175110e4..0c48d2196 100644 --- a/httemplate/view/cust_main/tickets.html +++ b/httemplate/view/cust_main/tickets.html @@ -12,8 +12,7 @@ function updateTicketLink() { <% 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'); +% my %queues = FS::TicketSystem->queues('', 'CreateTicket'); % if( $conf->exists('ticket_system-force_default_queueid') ) { <% $queues{$new_param{'Queue'}} %> @@ -46,7 +45,12 @@ function updateTicketLink() { <% 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 ) { @@ -78,6 +82,14 @@ function updateTicketLink() { <% $ticket->{owner} %> + + + <% $date_formatter->($ticket->{due}) %> + + + + <% $ticket->{timeestimated} %> + <% $ticket->{content} @@ -85,7 +97,13 @@ function updateTicketLink() { : $ticket->{priority} %> - + +% if ( $ss_priority ) { + + <% $ticket->{"CF.{$ss_priority}"} %> + +% } + % } @@ -93,6 +111,8 @@ function updateTicketLink() { <%init> +use Date::Format 'time2str'; +use Date::Parse 'str2time'; my( $conf ) = new FS::Conf; my( $cust_main ) = @_; @@ -102,7 +122,7 @@ 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, + $cust_main->Custnum, { 'statuses' => [ 'resolved' ] } ); @@ -111,4 +131,14 @@ my( $new_base, %new_param ) = my $new_link = FS::TicketSystem->href_new_ticket( $cust_main ); +my $ss_priority = FS::TicketSystem->selfservice_priority; + +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) : ''; +}; + -- cgit v1.2.1