projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f626fd7
)
sort locations in dropdown, RT#10766
author
ivan
<ivan>
Sat, 4 Dec 2010 03:29:06 +0000
(
03:29
+0000)
committer
ivan
<ivan>
Sat, 4 Dec 2010 03:29:06 +0000
(
03:29
+0000)
httemplate/elements/tr-select-cust_location.html
patch
|
blob
|
history
diff --git
a/httemplate/elements/tr-select-cust_location.html
b/httemplate/elements/tr-select-cust_location.html
index
f06ea0f
..
d44b1c4
100644
(file)
--- a/
httemplate/elements/tr-select-cust_location.html
+++ b/
httemplate/elements/tr-select-cust_location.html
@@
-150,7
+150,7
@@
Example:
% my @locations = $cust_main ? $cust_main->cust_location : ();
% push @locations, $cust_location
% if !$cust_main && $cust_location && $cust_location->locationnum>0;
% my @locations = $cust_main ? $cust_main->cust_location : ();
% push @locations, $cust_location
% if !$cust_main && $cust_location && $cust_location->locationnum>0;
-% foreach my $loc ( @locations ) {
+% foreach my $loc (
sort $location_sort
@locations ) {
<OPTION VALUE="<% $loc->locationnum %>"
<% $locationnum == $loc->locationnum ? 'SELECTED' : '' %>
><% $loc->line |h %>
<OPTION VALUE="<% $loc->locationnum %>"
<% $locationnum == $loc->locationnum ? 'SELECTED' : '' %>
><% $loc->line |h %>
@@
-223,6
+223,13
@@
if ( $locationnum && $locationnum != -1 ) {
}
}
}
}
+my $location_sort = sub {
+ $a->country cmp $b->country
+ or $a->city cmp $b->city
+ or $a->address1 cmp $b->address1
+ or $a->address2 cmp $b->address2
+};
+
my $disabled = ( $locationnum == -1 || ($editable && $locationnum) )
? ''
: 'DISABLED';
my $disabled = ( $locationnum == -1 || ($editable && $locationnum) )
? ''
: 'DISABLED';