<INPUT TYPE="text" NAME="ip_gateway" SIZE="15">/<INPUT TYPE="text" NAME="ip_netmask" SIZE="2">
);
$html_foot .= include( '/elements/select-agent.html',
- 'agent_virt' => 1,
- 'agent_null_right' => 'Broadband global configuration',
+ 'agent_null_right' => 'Broadband global configuration',
);
$html_foot .= qq(
<INPUT TYPE="submit" NAME="submit" VALUE="Add">
<% include( '/elements/select-table.html',
- 'table' => 'agent',
- 'name_col' => 'agent',
- 'value' => $agentnum || '',
- 'empty_label' => 'all',
- 'hashref' => { 'disabled' => '' },
- 'order_by' => ' ORDER BY agent',
+ 'table' => 'agent',
+ 'name_col' => 'agent',
+ 'value' => $agentnum || '',
+ 'agent_virt' => 1,
+ 'empty_label' => 'all',
+ 'hashref' => { 'disabled' => '' },
+ 'order_by' => ' ORDER BY agent',
'disable_empty' => $disable_empty,
%opt,
)
if $opt{'agents'};
my $curuser = $FS::CurrentUser::CurrentUser;
-my $disable_empty = 1;
-if ( $opt{'agent_null_right'} &&
- $curuser->access_right($opt{'agent_null_right'})
- )
-{
- $disable_empty--;
+my $disable_empty = 0;
+if ( $opt{'agent_null_right'} ) {
+ if ( $curuser->access_right($opt{'agent_null_right'}) ) {
+ $disable_empty = 0;
+ } else {
+ $disable_empty = 1;
+ }
}
</%init>
my %opt = @_;
my $agentnum = $opt{'curr_value'} || $opt{'value'};
-my @agents;
-if ( $opt{'agents'} ) {
- #@agents = @{ $opt{'agents'} };
- #here is the agent virtualization
- my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href;
- @agents = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agents'} };
- delete $opt{'agents'};
-} else {
- @agents = $FS::CurrentUser::CurrentUser->agents;
-}
+my @agents = $opt{'agents'}
+ ? @{ $opt{'agents'} }
+ : $FS::CurrentUser::CurrentUser->agents;
</%init>