From 9a75e6903c45a3d3822fb5744aaeef9f61733543 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 | 8 +++++++- 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, 20 insertions(+), 1 deletion(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 1359c0b..dce7079 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -274,8 +274,14 @@ foreach my $item (@items) { $item->{waitingdate} = $first_hold->waitingdate; } + # 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 + # 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 5bc1d2f..21b738f 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -136,6 +136,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 be5932b..ac7e5ea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -457,6 +457,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 7c7acfe..e6311aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -186,6 +186,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.7.4