installers, RT#16584
authorIvan Kohler <ivan@freeside.biz>
Wed, 9 Apr 2014 20:25:38 +0000 (13:25 -0700)
committerIvan Kohler <ivan@freeside.biz>
Wed, 9 Apr 2014 20:25:38 +0000 (13:25 -0700)
httemplate/elements/select-ticketing_queueid.html [new file with mode: 0644]
httemplate/elements/tr-select-ticketing_queueid.html [new file with mode: 0644]

diff --git a/httemplate/elements/select-ticketing_queueid.html b/httemplate/elements/select-ticketing_queueid.html
new file mode 100644 (file)
index 0000000..540b38d
--- /dev/null
@@ -0,0 +1,33 @@
+<SELECT NAME="ticketing_queueid">
+
+  <OPTION VALUE="" <% ! $opt{curr_value} ? 'SELECTED' : '' %>><% $opt{empty_label} %>
+
+% foreach my $queueid ( sort { $a <=> $b } keys %queues ) {
+    <OPTION VALUE="<% $queueid %>" <% $opt{curr_value} == $queueid ? ' SELECTED' : '' %>><% $queueid %>: <% $queues{$queueid} %>
+% } 
+
+% while ( @post_options ) { 
+%   my $post_opt   = shift(@post_options);
+%   my $post_label = shift(@post_options);
+%   my $selected = ( $opt{curr_value} eq $post_opt );
+    <OPTION VALUE="<% $post_opt %>"
+            <% $selected ? 'SELECTED' : '' %>
+    ><% $post_label %>
+% } 
+
+</SELECT>
+
+<%init>
+
+my %opt = @_;
+
+my $conf = new FS::Conf;
+
+my %queues = ();
+if ( $conf->config('ticket_system') ) {
+   %queues = FS::TicketSystem->queues();
+}
+
+my @post_options  = $opt{post_options}  ? @{ $opt{post_options} } : ();
+
+</%init>
diff --git a/httemplate/elements/tr-select-ticketing_queueid.html b/httemplate/elements/tr-select-ticketing_queueid.html
new file mode 100644 (file)
index 0000000..cfa4cf3
--- /dev/null
@@ -0,0 +1,11 @@
+<TR>
+  <TD ALIGN="right"><% $opt{'label'} || 'Ticketing queue' %></TD>
+  <TD>
+    <% include( '/elements/select-ticketing_queueid.html', %opt ) %>
+  </TD>
+</TR>
+<%init>
+
+my %opt = @_;
+
+</%init>