Lines 114-120
if ( $op eq 'add_form' ) {
Link Here
|
114 |
if ( $shelf ) { |
114 |
if ( $shelf ) { |
115 |
$op = $referer; |
115 |
$op = $referer; |
116 |
my $sortfield = $query->param('sortfield'); |
116 |
my $sortfield = $query->param('sortfield'); |
117 |
$sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber ); |
117 |
$sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber dateadded ); |
118 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
118 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
119 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
119 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
120 |
$shelf->sortfield( $sortfield ); |
120 |
$shelf->sortfield( $sortfield ); |
Lines 235-241
if ( $op eq 'view' ) {
Link Here
|
235 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
235 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
236 |
$category = $shelf->category; |
236 |
$category = $shelf->category; |
237 |
my $sortfield = $query->param('sortfield') || $shelf->sortfield; # Passed in sorting overrides default sorting |
237 |
my $sortfield = $query->param('sortfield') || $shelf->sortfield; # Passed in sorting overrides default sorting |
238 |
$sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber ); |
238 |
$sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber dateadded ); |
239 |
my $direction = $query->param('direction') || 'asc'; |
239 |
my $direction = $query->param('direction') || 'asc'; |
240 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
240 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
241 |
my ( $page, $rows ); |
241 |
my ( $page, $rows ); |