From 58c1f7ef422b6ccb0e26cfd47a4154058b8c77ed Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Mon, 16 Oct 2017 07:51:09 +0000 Subject: [PATCH] Bug 19470: Add information about item being in rotating collection on detail page Test plan: 0) Apply the patch 1) Go to tools > rotating collections, create a collection and add some items 2) Go through detail.pl and moredetail.pl (items detail) of added items and confirm there is information about this collection and that the link to collection does work 3) Go to detail pages of biblio without items in any collection and confirm there is no regression Signed-off-by: Simon Pouchol --- catalogue/detail.pl | 9 ++++++++- catalogue/moredetail.pl | 5 +++++ koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 58d4511..7c9c8d3 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -270,7 +270,14 @@ foreach my $item (@items) { $item->{CheckedOutFor} = $checkout->patron; } - # Check the transit status + # checking for rotating collection + my $rotating_collection = $item_object->rotating_collection; + if ( $rotating_collection ) { + $item->{rotating_collection} = $rotating_collection; + $item->{IsInRotatingCollection} = 1; + } + + # Check the transit status my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber}); if ( defined( $transfertwhen ) && ( $transfertwhen ne '' ) ) { $item->{transfertwhen} = $transfertwhen; diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index c82e653..dca9bcd 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -133,6 +133,11 @@ foreach ( keys %{$data} ) { foreach my $item (@items){ $item->{object} = Koha::Items->find( $item->{itemnumber} ); $item->{'collection'} = $ccodes->{ $item->{ccode} } if ($ccodes); + my $rotating_collection = $item->{object}->rotating_collection; + if ( $rotating_collection ) { + $item->{rotating_collection} = $rotating_collection; + $item->{IsInRotatingCollection} = 1; + } $item->{'itype'} = $itemtypes->{ $item->{'itype'} }->{'translated_description'}; $item->{'replacementprice'} = sprintf( "%.2f", $item->{'replacementprice'} ); if ( defined $item->{'copynumber'} ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 3640a9c..2af016c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -447,6 +447,10 @@ ([% item.restricted %]) [% END %] + [% IF (item.IsInRotatingCollection) %] +
Item is part of rotating collection [% item.rotating_collection.colTitle %] + [% END %] + [% item.datelastseen | $KohaDates %] [% item.barcode %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 3fb7856..fb2c65c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -189,6 +189,10 @@ [% IF ITEM_DAT.withdrawn != "" && ITEM_DAT.withdrawn_on %]
  • Withdrawn on:[% ITEM_DAT.withdrawn_on | $KohaDates %]  
  • [% END %] + + [% IF ITEM_DAT.IsInRotatingCollection %] +
  • Rotating collection:[% ITEM_DAT.rotating_collection.colTitle %]
  • + [% END %] [% END %] -- 2.1.4