Bugzilla – Attachment 7977 Details for
Bug 7379
copynumber is displayed 'as is' when linked to autorised values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch #2
0001-Bug-7379-display-of-copynumber-description-aut.-valu.patch (text/plain), 5.92 KB, created by
Adrien SAURAT
on 2012-03-02 10:13:14 UTC
(
hide
)
Description:
proposed patch #2
Filename:
MIME Type:
Creator:
Adrien SAURAT
Created:
2012-03-02 10:13:14 UTC
Size:
5.92 KB
patch
obsolete
>From 9e392b0efa61bca0157a2991457016b1f1ff3ace Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Fri, 2 Mar 2012 11:06:12 +0100 >Subject: [PATCH] Bug 7379: display of copynumber description (aut. value) > >The biblio/items detail pages display the copynumber >description if an authorized value is configured >accordingly. >--- > catalogue/detail.pl | 4 ++++ > catalogue/moredetail.pl | 11 ++++++++++- > .../prog/en/modules/catalogue/moredetail.tt | 2 +- > opac/opac-detail.pl | 8 +++++--- > 4 files changed, 20 insertions(+), 5 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index db38551..8251f22 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -171,6 +171,7 @@ $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items; > > my $shelflocations = GetKohaAuthorisedValues('items.location', $fw); > my $collections = GetKohaAuthorisedValues('items.ccode' , $fw); >+my $copynumbers = GetKohaAuthorisedValues('items.copynumber', $fw); > my (@itemloop, %itemfields); > my $norequests = 1; > my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw); >@@ -201,10 +202,13 @@ foreach my $item (@items) { > $item->{itemdamagedloop} = GetAuthorisedValues($authvalcode_items_damaged, $item->{damaged}) if $authvalcode_items_damaged; > } > #get shelf location and collection code description if they are authorised value. >+ # same thing for copy number > my $shelfcode = $item->{'location'}; > $item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) ); > my $ccode = $item->{'ccode'}; > $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 itemnotes uri)) { > $itemfields{$_} = 1 if ( $item->{$_} ); > } >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index f5bb904..62fa878 100755 >--- a/catalogue/moredetail.pl >+++ b/catalogue/moredetail.pl >@@ -116,6 +116,7 @@ $data->{'showncount'}=$showncount; > $data->{'hiddencount'}=$hiddencount; # can be zero > > my $ccodes= GetKohaAuthorisedValues('items.ccode',$fw); >+my $copynumbers = GetKohaAuthorisedValues('items.copynumber',$fw); > my $itemtypes = GetItemTypes; > > $data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'}; >@@ -132,7 +133,15 @@ foreach my $item (@items){ > $item->{'itype'} = $itemtypes->{ $item->{'itype'} }->{'description'}; > $item->{'replacementprice'} = sprintf( "%.2f", $item->{'replacementprice'} ); > $item->{$_} = format_date( $item->{$_} ) foreach qw/datelastborrowed dateaccessioned datelastseen lastreneweddate/; >- $item->{'copyvol'} = $item->{'copynumber'}; >+ if ( defined $item->{'copynumber'} ) { >+ $item->{'displaycopy'} = 1; >+ if ($copynumbers) { >+ $item->{'copyvol'} = $copynumbers->{ $item->{'copynumber'} } >+ } >+ else { >+ $item->{'copyvol'} = $item->{'copynumber'}; >+ } >+ } > > > # item has a host number if its biblio number does not match the current bib >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 1a9536b..3b3cd25 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -56,7 +56,7 @@ > [% END %] > [% IF ( ITEM_DAT.collection ) %]<li><span class="label">Collection:</span> [% ITEM_DAT.collection %]</li> [% END %] > <li><span class="label">Item Callnumber:</span> [% ITEM_DAT.itemcallnumber %] </li> >- [% IF ( ITEM_DAT.copyvol ) %]<li><span class="label">Copy / Vol :</span> [% ITEM_DAT.copyvol %] </li> [% END %] >+ [% IF ( ITEM_DAT.displaycopy ) %]<li><span class="label">Copy / Vol :</span> [% ITEM_DAT.copyvol %] </li> [% END %] > [% IF ( ITEM_DAT.replacementprice ) %]<li><span class="label">Replacement Price:</span> [% ITEM_DAT.replacementprice %] </li> [% END %] > [% IF ITEM_DAT.materials %]<li><span class="label">Materials Specified:</span> [% ITEM_DAT.materials %] </li> [% END %] > </ol></div> >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 27684d4..c7345c6 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -439,6 +439,7 @@ if ( $itemtype ) { > } > my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac'); > my $collections = GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac'); >+my $copynumbers = GetKohaAuthorisedValues('items.copynumber',$dat->{'frameworkcode'}, 'opac'); > > #coping with subscriptions > my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber); >@@ -498,9 +499,10 @@ for my $itm (@items) { > $itm->{datelastseen} = format_date($itm->{datelastseen}); > > # get collection code description, too >- if ( my $ccode = $itm->{'ccode'} ) { >- $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) ); >- } >+ my $ccode = $itm->{'ccode'}; >+ $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) ); >+ my $copynumber = $itm->{'copynumber'}; >+ $itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) ); > if ( defined $itm->{'location'} ) { > $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} }; > } >-- >1.7.4.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7379
:
7025
|
7026
|
7029
|
7030
|
7977
|
10036
|
12954