'extra_sql' => '',
'agent_virt' => 0, #set true and make sure the result is JOINed to
#something with agentnum (usually cust_main)
+ 'agent_null' => 0, #set true to always show un-agented entries
'agent_null_right' => '', #right to see un-agented entries
#or
'records' => \@records, #instead of search params
>
% while ( @pre_options ) {
- <OPTION VALUE="<% shift(@pre_options) %>"><% shift(@pre_options) %>
-
+% my $pre_opt = shift(@pre_options);
+% my $pre_label = shift(@pre_options);
+% my $selected = ( ref($value) && $value->{$pre_opt} )
+% || ( $value eq $pre_opt );
+ <OPTION VALUE="<% $pre_opt %>"
+ <% $selected ? 'SELECTED' : '' %>
+ ><% $pre_label %>
% }
% unless ( $opt{'multiple'} || $opt{'disable_empty'} ) {
$extra_sql .=
( $extra_sql =~ /WHERE/i || scalar(keys %$hashref ) ? ' AND ' : ' WHERE ' ).
$FS::CurrentUser::CurrentUser->agentnums_sql(
- 'null_right' => $opt{'agent_null_right'}
+ 'null' => $opt{'agent_null'},
+ 'null_right' => $opt{'agent_null_right'},
);
}
});
}
-unless ( ! $value
+unless ( $value < 1 # !$value #ignore negatives too
or ref($value)
or ! exists( $opt{hashref}->{disabled} ) #??
or grep { $value == $_->$key() } @records