From 6cb68b471dc1bf7658dfc1aa73aa23ce685342a8 Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Wed, 23 Mar 2016 12:22:02 +1300 Subject: [PATCH] Bug 16130 - Show the item non-public note on the detail view MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To test: 1) Ensure your non-public note field is mapped to the items.itemnotes_nonpublic database column 2) Edit an item, add a test nonpublic note 3) Verify the nonpublic note is shown in the items table on the Detail view. sponsored-by: New Zealand Ministry of Education Library sponsored-by: New Zealand Central Agencies Library Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Removed a stray Data::Dumper Signed-off-by: Brendan A Gallagher --- catalogue/detail.pl | 16 ++++++++++++---- .../prog/en/modules/catalogue/detail.tt | 4 ++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 96e77523b2..e971ce7928 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -42,7 +42,6 @@ use Koha::DateUtils; use C4::HTML5Media; use C4::CourseReserves qw(GetItemCourseReservesInfo); use C4::Acquisition qw(GetOrdersByBiblionumber); - use Koha::Virtualshelves; my $query = CGI->new(); @@ -220,7 +219,7 @@ foreach my $item (@items) { $item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) ); my $copynumber = $item->{'copynumber'}; $item->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumber) && defined($copynumbers) && exists( $copynumbers->{$copynumber} ) ); - foreach (qw(ccode enumchron copynumber stocknumber itemnotes uri)) { + foreach (qw(ccode enumchron copynumber stocknumber itemnotes itemnotes_nonpublic uri)) { $itemfields{$_} = 1 if ( $item->{$_} ); } @@ -254,7 +253,15 @@ foreach my $item (@items) { $item->{nocancel} = 1; } - # item has a host number if its biblio number does not match the current bib + foreach my $f (qw( itemnotes )) { + if ($item->{$f}) { + $item->{$f} =~ s|\n|
|g; + $itemfields{$f} = 1; + } + } + + #item has a host number if its biblio number does not match the current bib + if ($item->{biblionumber} ne $biblionumber){ $item->{hostbiblionumber} = $item->{biblionumber}; $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title}; @@ -319,7 +326,8 @@ $template->param( itemdata_copynumber => $itemfields{copynumber}, itemdata_stocknumber => $itemfields{stocknumber}, volinfo => $itemfields{enumchron}, - itemdata_itemnotes => $itemfields{itemnotes}, + itemdata_itemnotes => $itemfields{itemnotes}, + itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic}, z3950_search_params => C4::Search::z3950_search_args($dat), hostrecords => $hostrecords, analytics_flag => $analytics_flag, 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 5cf669758c..0f5140a3c1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -593,6 +593,7 @@ function verify_images() { [% IF ( itemdata_stocknumber ) %]Inventory number[% END %] [% IF materials %]Materials specified[% END %] [% IF ( itemdata_itemnotes ) %]Public notes[% END %] + [% IF ( itemdata_nonpublicnotes ) %]Non-public notes[% END %] [% IF ( SpineLabelShowPrintOnBibDetails ) %]Spine label[% END %] [% IF ( hostrecords ) %]Host records[% END %] [% IF ( analyze ) %]Used in[% END %] @@ -764,6 +765,9 @@ function verify_images() { [% IF ( itemdata_itemnotes ) %]
[% item.itemnotes %]
[% END %] + [% IF itemdata_nonpublicnotes %] + [% item.itemnotes_nonpublic %] + [% END %] [% IF ( SpineLabelShowPrintOnBibDetails ) %] Print label [% END %] -- 2.39.5