X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-agent.html;h=3107ff9d40eec41612e78835b473e7b9c4dae58e;hb=f731dc5a2bab0f3d04a43d7501257e18164bdcd8;hp=78ec25f826a74c50443ee576f2202b5d1155219d;hpb=c0e8da2f1e89729efa1032241e4239765a296514;p=freeside.git diff --git a/httemplate/elements/select-agent.html b/httemplate/elements/select-agent.html index 78ec25f82..3107ff9d4 100644 --- a/httemplate/elements/select-agent.html +++ b/httemplate/elements/select-agent.html @@ -1,18 +1,19 @@ -<% - my( $agentnum, %opt ) = @_; - - my %select_opt = (); - $select_opt{'records'} = $opt{'agents'} - if $opt{'agents'}; - -%><%= include( '/elements/select-table.html', +% +% my( $agentnum, %opt ) = @_; +% +% $opt{'records'} = delete $opt{'agents'} +% if $opt{'agents'}; +% +% +<% include( '/elements/select-table.html', 'table' => 'agent', 'name_col' => 'agent', - 'value' => $agentnum, + 'value' => $agentnum || '', 'empty_label' => 'all', 'hashref' => { 'disabled' => '' }, 'extra_sql' => ' AND '. - $FS::CurrentUser::CurrentUser->agentnums_sql, - %select_opt, + $FS::CurrentUser::CurrentUser->agentnums_sql. + ' ORDER BY agent', + %opt, ) %>