@@ -, +, @@ --- Koha/Biblio.pm | 9 ++--- cataloguing/moveitem.pl | 5 ++- .../prog/en/modules/cataloguing/moveitem.tt | 37 +++++++++++++++++++ 3 files changed, 44 insertions(+), 7 deletions(-) --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -351,20 +351,17 @@ sub article_requests_finished { =head3 items -my @items = $biblio->items(); my $items = $biblio->items(); -Returns the related Koha::Items object for this biblio in scalar context, -or list of Koha::Item objects in list context. +Returns the related Koha::Items object for this biblio =cut sub items { my ($self) = @_; - $self->{_items} ||= Koha::Items->search( { biblionumber => $self->biblionumber() } ); - - return wantarray ? $self->{_items}->as_list : $self->{_items}; + my $items_rs = $self->_result->items; + return Koha::Items->_new_from_dbic( $items_rs ); } =head3 itemtype --- a/cataloguing/moveitem.pl +++ a/cataloguing/moveitem.pl @@ -77,7 +77,10 @@ if ( $barcode && $biblionumber ) { my $moveresult = MoveItemFromBiblio( $itemnumber, $frombiblionumber, $biblionumber ); if ($moveresult) { - $template->param( success => 1 ); + $template->param( + success => 1, + from_biblio => scalar Koha::Biblios->find($frombiblionumber), + ); } else { $template->param( --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt @@ -1,3 +1,4 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Cataloging › Attach an item to [% bibliotitle | html %] [% INCLUDE 'doc-head-close.inc' %] @@ -62,7 +63,21 @@

+ + +
+ [% IF from_biblio.items.count == 0 %] +
+ The record [% from_biblio.title | html %] has [% from_biblio.items.count | html %] attached items. +

+ + + +

+
+ [% END %] [% ELSE %] [% IF ( missingparameter ) %]
@@ -97,4 +112,26 @@ +[% MACRO jsinclude BLOCK %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] --