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 itemcallnumber dateadded dateaccessioned ); |
124 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
124 |
if ( $shelf->can_be_managed( $loggedinuser ) ) { |
125 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
125 |
$shelf->shelfname( scalar $query->param('shelfname') ); |
126 |
$shelf->sortfield( $sortfield ); |
126 |
$shelf->sortfield( $sortfield ); |
Lines 278-286
if ( $op eq 'view' ) {
Link Here
|
278 |
if ( $shelf ) { |
278 |
if ( $shelf ) { |
279 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
279 |
if ( $shelf->can_be_viewed( $loggedinuser ) ) { |
280 |
my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting |
280 |
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 ); |
281 |
$sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); |
282 |
my $direction = $query->param('direction') || 'asc'; |
282 |
my $direction = $query->param('direction') || 'asc'; |
283 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
283 |
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; |
|
|
284 |
|
285 |
# If sorting by dateaccessioned set direction to descending by default |
286 |
$direction = 'desc' if $sortfield eq 'dateaccessioned'; |
287 |
|
284 |
my $rows; |
288 |
my $rows; |
285 |
if ( $query->param('print') ) { |
289 |
if ( $query->param('print') ) { |
286 |
$page = ""; |
290 |
$page = ""; |
Lines 326-331
if ( $op eq 'view' ) {
Link Here
|
326 |
$this_item->{part_name} = $biblio->part_name; |
330 |
$this_item->{part_name} = $biblio->part_name; |
327 |
$this_item->{author} = $biblio->author; |
331 |
$this_item->{author} = $biblio->author; |
328 |
$this_item->{dateadded} = $content->dateadded; |
332 |
$this_item->{dateadded} = $content->dateadded; |
|
|
333 |
$this_item->{dateaccessioned} = $biblio->items->get_column("dateaccessioned"); |
329 |
$this_item->{imageurl} = $itemtype ? C4::Koha::getitemtypeimagelocation( 'intranet', $itemtype->imageurl ) : q{}; |
334 |
$this_item->{imageurl} = $itemtype ? C4::Koha::getitemtypeimagelocation( 'intranet', $itemtype->imageurl ) : q{}; |
330 |
$this_item->{description} = $itemtype ? $itemtype->description : q{}; #FIXME Should this be translated_description ? |
335 |
$this_item->{description} = $itemtype ? $itemtype->description : q{}; #FIXME Should this be translated_description ? |
331 |
$this_item->{notforloan} = $itemtype->notforloan if $itemtype; |
336 |
$this_item->{notforloan} = $itemtype->notforloan if $itemtype; |
332 |
- |
|
|