Browse files

Corrections

  • Loading branch information...
1 parent 6963c0c commit 2fb2c09c3aa0953a3571cef41d039527ca480ffc Carlos Vicente committed May 17, 2012
Showing with 7 additions and 7 deletions.
  1. +1 −1 etc/netdot.meta
  2. +6 −6 htdocs/generic/sortresults.mhtml
View
2 etc/netdot.meta
@@ -418,7 +418,7 @@ $meta = {
index => [ ['serial_number'], ['inventory_number'], ['po_number'] ],
isjoin => '0',
primary_key => 'id',
- label => ['product_id', 'serial_number', 'physaddr'],
+ label => ['serial_number', 'physaddr', 'product_id' ],
unique => [ ['physaddr'], ['product_id', 'serial_number'] ]
},
Availability => {
View
12 htdocs/generic/sortresults.mhtml
@@ -125,8 +125,8 @@ if ( defined($object) && scalar @$object ){
map { $objindex{$i++} = $_ } @{ $object };
print "sort == $sort" if $DEBUG;
}else{
- # Default to label field
- my $sort_field = $lblf;
+ # Default to first column
+ my $sort_field = $orderbrief[0];
# But maybe the sort field was specified
if ( defined($sort) && $sort ne '' ){
@@ -152,19 +152,19 @@ if ( defined($object) && scalar @$object ){
}
$lbl = $obj->$sort_field->get_label;
}else{
- if ( $lbl =~ /\D/o ){
- $alpha = 1;
- }
$lbl = $obj->$sort_field;
}
+ if ( $lbl =~ /\D+/o ){
+ $alpha = 1;
+ }
push @lbls, [$obj , $lbl];
}
if ( $ip ){
@lbls = sort {
$a->[0]->$sort_field->address_numeric <=>
$b->[0]->$sort_field->address_numeric
} @lbls;
- }elsif ( $alpha ){
+ }elsif ( $alpha ){
@lbls = sort { $a->[1] cmp $b->[1] } @lbls;
}else{
@lbls = sort { $a->[1] <=> $b->[1] } @lbls;

0 comments on commit 2fb2c09

Please sign in to comment.