projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use any card on file when making a payment, RT#23741
[freeside.git]
/
httemplate
/
elements
/
select-table.html
diff --git
a/httemplate/elements/select-table.html
b/httemplate/elements/select-table.html
index
e736388
..
4b6ddb4
100644
(file)
--- a/
httemplate/elements/select-table.html
+++ b/
httemplate/elements/select-table.html
@@
-28,6
+28,7
@@
Example:
'agent_null_right' => '', #right to see un-agented entries
#or
'records' => \@records, #instead of search params
'agent_null_right' => '', #right to see un-agented entries
#or
'records' => \@records, #instead of search params
+ 'presorted' => 0, #set true to disable sorting the records on name_col
#instead of the primary key... only for special cases
'value_col' => 'columnname',
#instead of the primary key... only for special cases
'value_col' => 'columnname',
@@
-89,10
+90,12
@@
Example:
<OPTION VALUE=""><% $opt{'empty_label'} || 'all' %>
% }
<OPTION VALUE=""><% $opt{'empty_label'} || 'all' %>
% }
-% foreach my $record ( sort { $a->$name_col() cmp $b->$name_col()
-% || $a->$key() <=> $b->$key()
-% }
-% @records
+% foreach my $record (
+% # we have the order_by parameter for this
+% #sort { $a->$name_col() cmp $b->$name_col()
+% # || $a->$key() <=> $b->$key()
+% # }
+% @records
% )
% {
% my $recvalue = $record->$key();
% )
% {
% my $recvalue = $record->$key();
@@
-175,6
+178,8
@@
if ( $opt{'agent_virt'} ) {
my @records = ();
if ( $opt{'records'} ) {
@records = @{ $opt{'records'} };
my @records = ();
if ( $opt{'records'} ) {
@records = @{ $opt{'records'} };
+ @records = sort { $a->get($name_col) cmp $b->get($name_col) } @records
+ unless $opt{'presorted'};
} else {
@records = qsearch( {
'table' => $opt{'table'},
} else {
@records = qsearch( {
'table' => $opt{'table'},