Lines 120-126
if ( $op eq 'add_form' ) {
Link Here
|
120 |
if ( $shelf ) { |
120 |
if ( $shelf ) { |
121 |
$op = $referer; |
121 |
$op = $referer; |
122 |
my $sortfield = $query->param('sortfield'); |
122 |
my $sortfield = $query->param('sortfield'); |
123 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); |
123 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded ); |
|
|
124 |
if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){ |
125 |
$sortfield = 'publicationyear'; |
126 |
} |
124 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
127 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
125 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
128 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
126 |
$shelf->sortfield( $sortfield ); |
129 |
$shelf->sortfield( $sortfield ); |
Lines 278-284
if ( $op eq 'view' ) {
Link Here
|
278 |
if ( $shelf ) { |
281 |
if ( $shelf ) { |
279 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
282 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
280 |
my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting |
283 |
my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting |
281 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); |
284 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded ); |
|
|
285 |
if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){ |
286 |
$sortfield = 'publicationyear'; |
287 |
} |
282 |
my $direction = $query->param('direction') || 'asc'; |
288 |
my $direction = $query->param('direction') || 'asc'; |
283 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
289 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
284 |
my $rows; |
290 |
my $rows; |
285 |
- |
|
|