|
Lines 123-133
if ( $op eq 'add_form' ) {
Link Here
|
| 123 |
if ($shelf) { |
123 |
if ($shelf) { |
| 124 |
$op = $referer; |
124 |
$op = $referer; |
| 125 |
my $sortfield = $query->param('sortfield'); |
125 |
my $sortfield = $query->param('sortfield'); |
| 126 |
$sortfield = 'title' |
126 |
$sortfield = $shelf->_validate_sortfield($sortfield); |
| 127 |
unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded ); |
|
|
| 128 |
if ( $sortfield eq 'copyrightdate' and C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
| 129 |
$sortfield = 'publicationyear'; |
| 130 |
} |
| 131 |
if ( $shelf->can_be_managed($loggedinuser) ) { |
127 |
if ( $shelf->can_be_managed($loggedinuser) ) { |
| 132 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
128 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
| 133 |
$shelf->sortfield($sortfield); |
129 |
$shelf->sortfield($sortfield); |
|
Lines 294-305
if ( $op eq 'view' ) {
Link Here
|
| 294 |
$query->param('sortfield') |
290 |
$query->param('sortfield') |
| 295 |
|| $shelf->sortfield |
291 |
|| $shelf->sortfield |
| 296 |
|| 'title'; # Passed in sorting overrides default sorting |
292 |
|| 'title'; # Passed in sorting overrides default sorting |
| 297 |
$sortfield = 'title' |
293 |
$sortfield = $shelf->_validate_sortfield($sortfield); |
| 298 |
unless grep { $_ eq $sortfield } |
|
|
| 299 |
qw( title author copyrightdate publicationyear itemcallnumber dateadded ); |
| 300 |
if ( $sortfield eq 'copyrightdate' and C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
| 301 |
$sortfield = 'publicationyear'; |
| 302 |
} |
| 303 |
my $direction = $query->param('direction') || 'asc'; |
294 |
my $direction = $query->param('direction') || 'asc'; |
| 304 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
295 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
| 305 |
my $rows; |
296 |
my $rows; |
| 306 |
- |
|
|