summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2007-11-14 23:10:25 +0000
committerivan <ivan>2007-11-14 23:10:25 +0000
commit6eae8e86517298d4de53d9754487d53b4f29765d (patch)
tree471bdb0645b7ff12c54415bfa064d77bb51a8944
parent1737abc0d3f9e5b615e833af0f2a7afd59f876e8 (diff)
add link to resolved tickets too
-rw-r--r--FS/FS/TicketSystem/RT_External.pm16
-rw-r--r--httemplate/view/cust_main/tickets.html6
2 files changed, 17 insertions, 5 deletions
diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm
index be5f22a77..bcad43bc5 100644
--- a/FS/FS/TicketSystem/RT_External.pm
+++ b/FS/FS/TicketSystem/RT_External.pm
@@ -173,18 +173,28 @@ sub statuses {
}
sub href_customer_tickets {
- my( $self, $custnum, $priority ) = @_;
+ my( $self, $custnum ) = ( shift, shift );
+ my( $priority, @statuses);
+ if ( ref($_[0]) ) {
+ my $opt = shift;
+ $priority = $opt->{'priority'};
+ @statuses = $opt->{'statuses'} ? @{$opt->{'statuses'}} : $self->statuses;
+ } else {
+ $priority = shift;
+ @statuses = $self->statuses;
+ }
#my $href = $self->baseurl;
#i snarfed this from an RT bookmarked search, then unescaped (some of) it with
#perl -npe 's/%([0-9A-F]{2})/pack('C', hex($1))/eg;'
- my $href .=
+ #$href .=
+ my $href =
"Search/Results.html?Order=ASC&".
"Query= MemberOf = 'freeside://freeside/cust_main/$custnum' ".
#" AND ( Status = 'open' OR Status = 'new' OR Status = 'stalled' )"
- " AND ( ". join(' OR ', map "Status = '$_'", $self->statuses ). " ) "
+ " AND ( ". join(' OR ', map "Status = '$_'", @statuses ). " ) "
;
if ( defined($priority) && $field && $priority_field_queue ) {
diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html
index c4183ae55..c9c3b6d1b 100644
--- a/httemplate/view/cust_main/tickets.html
+++ b/httemplate/view/cust_main/tickets.html
@@ -6,8 +6,10 @@
<A NAME="tickets"><FONT SIZE="+2">Tickets</FONT></A>
<BR>
-(<A HREF="<% FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View all tickets for this customer</A>)
-(<A HREF="<% FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>)
+(<A HREF="<% FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View <% join('/', FS::TicketSystem->statuses ) %> tickets for this customer</A>)
+(<A HREF="<% FS::TicketSystem->href_customer_tickets($cust_main->custnum, { 'statuses' => [ 'resolved' ] } ) %>">View resolved tickets for this customer</A>)
+<BR>
+(<A HREF="<% FS::TicketSystem->href_new_ticket($cust_main, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">Create new ticket for this customer</A>)
<% include("/elements/table-grid.html") %>
% my $bgcolor1 = '#eeeeee';