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