summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/TicketSystem/RT_External.pm29
-rw-r--r--httemplate/view/cust_main/tickets.html25
2 files changed, 43 insertions, 11 deletions
diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm
index cdb4e90f3..2995b88a4 100644
--- a/FS/FS/TicketSystem/RT_External.pm
+++ b/FS/FS/TicketSystem/RT_External.pm
@@ -273,7 +273,7 @@ sub href_customer_tickets {
}
-sub href_new_ticket {
+sub href_params_new_ticket {
my( $self, $custnum_or_cust_main, $requestors ) = @_;
my( $custnum, $cust_main );
@@ -284,14 +284,25 @@ sub href_new_ticket {
$custnum = $custnum_or_cust_main;
$cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
}
- my $queueid = $cust_main->agent->ticketing_queueid || $default_queueid;
-
- $self->baseurl.
- 'Ticket/Create.html?'.
- "Queue=$queueid".
- "&new-MemberOf=freeside://freeside/cust_main/$custnum".
- ( $requestors ? '&Requestors='. uri_escape($requestors) : '' )
- ;
+
+ my %param = (
+ 'Queue' => ($cust_main->agent->ticketing_queueid || $default_queueid),
+ 'new-MemberOf'=> "freeside://freeside/cust_main/$custnum",
+ 'Requestors' => $requestors,
+ );
+
+ ( $self->baseurl.'Ticket/Create.html', %param );
+}
+
+sub href_new_ticket {
+ my $self = shift;
+
+ my( $base, %param ) = $self->href_params_new_ticket(@_);
+
+ my $uri = new URI $base;
+ $uri->query_form(%param);
+ $uri;
+
}
sub href_ticket {
diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html
index 167849c76..e1f9a131e 100644
--- a/httemplate/view/cust_main/tickets.html
+++ b/httemplate/view/cust_main/tickets.html
@@ -1,7 +1,24 @@
+<FORM METHOD="GET" ACTION="<% $new_base %>" NAME="CreateTicketForm">
+<INPUT TYPE="submit" VALUE="Create new ticket">
+in queue
+<SELECT NAME="Queue">
+% my %queues = FS::TicketSystem->queues();
+% foreach my $queueid ( keys %queues ) {
+% #should consider whether the user has ACL to create ticket in each queue
+ <OPTION VALUE="<% $queueid %>"
+ <% $queueid == $new_param{'Queue'} ? 'SELECTED' : '' %>
+ ><% $queues{$queueid} |h %>
+% }
+</SELECT>
+% foreach my $param ( grep { $_ ne 'Queue' } keys %new_param ) {
+ <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $new_param{$param} |h %>">
+% }
+</FORM>
+<BR>
+
(<A HREF="<% $open_link %>">View <% $openlabel %> tickets for this customer</A>)
(<A HREF="<% $res_link %>">View resolved tickets for this customer</A>)
-<BR>
-(<A HREF="<% $new_link %>">Create new ticket for this customer</A>)
+<BR><BR>
<% include("/elements/table-grid.html") %>
% my $bgcolor1 = '#eeeeee';
@@ -73,6 +90,10 @@ my $res_link = FS::TicketSystem->href_customer_tickets(
{ 'statuses' => [ 'resolved' ] }
);
+my( $new_base, %new_param ) = FS::TicketSystem->href_params_new_ticket(
+ $cust_main,
+ join(', ', $cust_main->invoicing_list_emailonly ) );
+
my $new_link = FS::TicketSystem->href_new_ticket(
$cust_main,
join(', ', $cust_main->invoicing_list_emailonly )