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 { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); |
117 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded ); |
|
|
118 |
if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){ |
119 |
$sortfield = 'publicationyear'; |
120 |
} |
118 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
121 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
119 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
122 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
120 |
$shelf->sortfield( $sortfield ); |
123 |
$shelf->sortfield( $sortfield ); |
Lines 272-278
if ( $op eq 'view' ) {
Link Here
|
272 |
if ( $shelf ) { |
275 |
if ( $shelf ) { |
273 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
276 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
274 |
my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting |
277 |
my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting |
275 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); |
278 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded ); |
|
|
279 |
if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){ |
280 |
$sortfield = 'publicationyear'; |
281 |
} |
276 |
my $direction = $query->param('direction') || 'asc'; |
282 |
my $direction = $query->param('direction') || 'asc'; |
277 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
283 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
278 |
my $rows; |
284 |
my $rows; |
279 |
- |
|
|