@@ -, +, @@ --- Koha/Exceptions.pm | 2 +- .../prog/en/modules/catalogue/detail.tt | 2 +- .../prog/en/modules/virtualshelves/shelves.tt | 42 ++++++++++++---------- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- .../bootstrap/en/modules/opac-shareshelf.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 8 ++--- opac/opac-sendshelf.pl | 2 +- opac/opac-shelves.pl | 11 +++++- virtualshelves/shelves.pl | 11 +++++- 9 files changed, 53 insertions(+), 29 deletions(-) --- a/Koha/Exceptions.pm +++ a/Koha/Exceptions.pm @@ -15,7 +15,7 @@ use Exception::Class ( 'Koha::Exceptions::Virtualshelves::DuplicateObject' => { isa => 'Koha::Exceptions::DuplicateObject', - description => "poeut", + description => "Duplicate shelf object", }, 'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => { isa => 'Koha::Exceptions::Exception', --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -357,7 +357,7 @@ function verify_images() { [% IF ( XSLTDetailsDisplay ) %] [% XSLTBloc %] - [% IF shelves %] + [% IF shelves.count %] Lists that include this title: [% FOREACH s IN shelves %] [% s.shelfname %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -564,24 +564,30 @@ function placeHold () { [% END %] - [% FOR permission IN ['allow_add', 'allow_delete_own', 'allow_delete_other'] %] -
  • - [% IF loop.first %] - - [% ELSE %] - - [% END %] - - [% SWITCH permission %] - [% CASE 'allow_add' %] anyone else to add entries. - [% CASE 'allow_delete_own' %] anyone to remove his own contributed entries. - [% CASE 'allow_delete_other' %] anyone to remove other contributed entries. - [% END %] -
  • - [% END %] +
  • + + +  anyone else to add entries. +
  • +
  • + + +  anyone to remove his own contributed entries. +
  • +
  • + + +  anyone to remove other contributed entries. +
  • --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -390,7 +390,7 @@ [% END # / LibraryThingForLibrariesID %] - [% IF shelves %] + [% IF shelves.count %] List(s) this item appears in: [% FOREACH s IN shelves %] [% s.shelfname %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt @@ -59,7 +59,7 @@
    - Cancel + Cancel
    --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -22,8 +22,8 @@
  •  anyone to remove his own contributed entries.
  • @@ -168,7 +168,7 @@ Download list [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] - Send list + Send list [% END %] Print list @@ -521,7 +521,7 @@ [% END %] [% IF itemsloop && can_remove_biblios %] - + --- a/opac/opac-sendshelf.pl +++ a/opac/opac-sendshelf.pl @@ -52,7 +52,7 @@ my $email = $query->param('email'); my $dbh = C4::Context->dbh; my $shelf = Koha::Virtualshelves->find( $shelfid ); -if ( $shelf->can_be_viewed( $borrowernumber ) ) { +if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { if ( $email ) { my $message = Koha::Email->new(); --- a/opac/opac-shelves.pl +++ a/opac/opac-shelves.pl @@ -222,7 +222,16 @@ if ( $op eq 'view' ) { $rows = C4::Context->preference('OPACnumSearchResults') || 20; $page = ( $query->param('page') ? $query->param('page') : 1 ); } - my $contents = $shelf->get_contents->search({}, { join => [ 'biblionumber' ], page => $page, rows => $rows, order_by => "$sortfield $direction", }); + my $order_by = $sortfield eq 'itemcallnumber' ? 'items.itemcallnumber' : $sortfield; + my $contents = $shelf->get_contents->search( + {}, + { + prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ], + page => $page, + rows => $rows, + order_by => "$order_by $direction", + } + ); # get biblionumbers stored in the cart my @cart_list; --- a/virtualshelves/shelves.pl +++ a/virtualshelves/shelves.pl @@ -201,7 +201,16 @@ if ( $op eq 'view' ) { $page = ( $query->param('page') ? $query->param('page') : 1 ); } - my $contents = $shelf->get_contents->search({}, { join => [ 'biblionumber' ], page => $page, rows => $rows, order_by => "$sortfield $direction", }); + my $order_by = $sortfield eq 'itemcallnumber' ? 'items.itemcallnumber' : $sortfield; + my $contents = $shelf->get_contents->search( + {}, + { + prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ], + page => $page, + rows => $rows, + order_by => "$order_by $direction", + } + ); my $borrower = GetMember( borrowernumber => $loggedinuser ); --