Lines 148-154
if ( $op eq 'add_form' ) {
Link Here
|
148 |
if ( $shelf ) { |
148 |
if ( $shelf ) { |
149 |
$op = $referer; |
149 |
$op = $referer; |
150 |
my $sortfield = $query->param('sortfield'); |
150 |
my $sortfield = $query->param('sortfield'); |
151 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); |
151 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); |
152 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
152 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
153 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
153 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
154 |
$shelf->sortfield( $sortfield ); |
154 |
$shelf->sortfield( $sortfield ); |
Lines 312-320
if ( $op eq 'view' ) {
Link Here
|
312 |
$sortfield = $shelf->sortfield; |
312 |
$sortfield = $shelf->sortfield; |
313 |
$direction = 'asc'; |
313 |
$direction = 'asc'; |
314 |
} |
314 |
} |
315 |
$direction = $query->param('direction') if $query->param('direction'); |
315 |
|
|
|
316 |
# By default order descending if sorting by dateaccessioned |
317 |
if ( $query->param('direction') ) { |
318 |
$direction = $query->param('direction'); |
319 |
} elsif ( $sortfield eq 'dateaccessioned' and !$query->param('direction') ) { |
320 |
$direction = 'desc'; |
321 |
} |
316 |
$direction = 'asc' if !$direction or ( $direction ne 'asc' and $direction ne 'desc' ); |
322 |
$direction = 'asc' if !$direction or ( $direction ne 'asc' and $direction ne 'desc' ); |
317 |
$sortfield = 'title' if !$sortfield or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); |
323 |
$sortfield = 'title' if !$sortfield or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); |
318 |
|
324 |
|
319 |
my $rows; |
325 |
my $rows; |
320 |
if ( $query->param('print') or $query->param('rss') ) { |
326 |
if ( $query->param('print') or $query->param('rss') ) { |
321 |
- |
|
|