summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-agent.html
diff options
context:
space:
mode:
authorivan <ivan>2006-04-22 00:58:40 +0000
committerivan <ivan>2006-04-22 00:58:40 +0000
commit1a033848671cad2cbe7687b37fc718b3b2a68b83 (patch)
tree01fc1ca352726cdc5786e0ccaf78515e9326ba84 /httemplate/elements/select-agent.html
parent303cb4ce4b6ce634e108e3b7a0b43086a5e4f184 (diff)
start of package class web UI (add/edit package classes, package class selection in package def edit)
Diffstat (limited to 'httemplate/elements/select-agent.html')
-rw-r--r--httemplate/elements/select-agent.html32
1 files changed, 12 insertions, 20 deletions
diff --git a/httemplate/elements/select-agent.html b/httemplate/elements/select-agent.html
index c2a5e4bde..aa480a54b 100644
--- a/httemplate/elements/select-agent.html
+++ b/httemplate/elements/select-agent.html
@@ -1,24 +1,16 @@
<%
my( $agentnum, %opt ) = @_;
- my @agents;
- if ( $opt{'agents'} ) {
- @agents = @{ $opt{'agents'} };
- } else {
- @agents = qsearch( 'agent', { disabled=>'' } );
- }
-
+ my %select_opt = ();
+ $select_opt{'records'} = $opt{'agents'}
+ if $opt{'agents'};
+
+%><%= include( '/elements/select-table.html',
+ 'table' => 'agent',
+ 'name_col' => 'agent',
+ 'value' => $agentnum,
+ 'empty_label' => 'all',
+ 'hashref' => { 'disabled' => '' },
+ %select_opt,
+ )
%>
-
-<SELECT NAME="agentnum">
-
- <OPTION VALUE="">all</OPTION>
-
- <% foreach my $agent ( sort { $a->agent cmp $b->agent } @agents ) { %>
-
- <OPTION VALUE="<%= $agent->agentnum %>"<%= $agentnum == $agent->agentnum ? ' SELECTED' : '' %>><%= $agent->agent %>
-
- <% } %>
-
-</SELECT>
-