|
Lines 113-119
if ( $op eq 'add_form' ) {
Link Here
|
| 113 |
if ( $shelf ) { |
113 |
if ( $shelf ) { |
| 114 |
$op = $referer; |
114 |
$op = $referer; |
| 115 |
my $sortfield = $query->param('sortfield'); |
115 |
my $sortfield = $query->param('sortfield'); |
| 116 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); |
116 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); |
| 117 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
117 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
| 118 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
118 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
| 119 |
$shelf->sortfield( $sortfield ); |
119 |
$shelf->sortfield( $sortfield ); |
|
Lines 271-279
if ( $op eq 'view' ) {
Link Here
|
| 271 |
if ( $shelf ) { |
271 |
if ( $shelf ) { |
| 272 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
272 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
| 273 |
my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting |
273 |
my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting |
| 274 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded ); |
274 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); |
| 275 |
my $direction = $query->param('direction') || 'asc'; |
275 |
|
| 276 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
276 |
# If sorting by dateaccessioned set direction to descending by default |
|
|
277 |
my $direction = $query->param('direction'); |
| 278 |
if ( $sortfield eq 'dateaccessioned' and $direction ne 'asc' and $direction ne 'desc' ) { |
| 279 |
$direction = 'desc'; |
| 280 |
} elsif ( $direction ne 'asc' and $direction ne 'desc' ) { |
| 281 |
$direction = 'asc'; |
| 282 |
} |
| 283 |
|
| 277 |
my ( $rows, $page ); |
284 |
my ( $rows, $page ); |
| 278 |
unless ( $query->param('print') ) { |
285 |
unless ( $query->param('print') ) { |
| 279 |
$rows = C4::Context->preference('numSearchResults') || 20; |
286 |
$rows = C4::Context->preference('numSearchResults') || 20; |
|
Lines 317-322
if ( $op eq 'view' ) {
Link Here
|
| 317 |
$this_item->{part_name} = $biblio->part_name; |
324 |
$this_item->{part_name} = $biblio->part_name; |
| 318 |
$this_item->{author} = $biblio->author; |
325 |
$this_item->{author} = $biblio->author; |
| 319 |
$this_item->{dateadded} = $content->dateadded; |
326 |
$this_item->{dateadded} = $content->dateadded; |
|
|
327 |
$this_item->{dateaccessioned} = $biblio->items->get_column("dateaccessioned"); |
| 320 |
$this_item->{imageurl} = $itemtype ? C4::Koha::getitemtypeimagelocation( 'intranet', $itemtype->imageurl ) : q{}; |
328 |
$this_item->{imageurl} = $itemtype ? C4::Koha::getitemtypeimagelocation( 'intranet', $itemtype->imageurl ) : q{}; |
| 321 |
$this_item->{description} = $itemtype ? $itemtype->description : q{}; #FIXME Should this be translated_description ? |
329 |
$this_item->{description} = $itemtype ? $itemtype->description : q{}; #FIXME Should this be translated_description ? |
| 322 |
$this_item->{notforloan} = $itemtype->notforloan if $itemtype; |
330 |
$this_item->{notforloan} = $itemtype->notforloan if $itemtype; |
| 323 |
- |
|
|