Bugzilla – Attachment 40671 Details for
Bug 12670
Show materials label instead of code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12670: Show materials label instead of code
Bug-12670-Show-materials-label-instead-of-code.patch (text/plain), 2.04 KB, created by
Julian Maurice
on 2015-06-26 14:15:22 UTC
(
hide
)
Description:
Bug 12670: Show materials label instead of code
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2015-06-26 14:15:22 UTC
Size:
2.04 KB
patch
obsolete
>From fc9609d74667183368e6d2e9f43424258f3b97ab Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 24 Jul 2014 11:23:25 +0200 >Subject: [PATCH] Bug 12670: Show materials label instead of code > >In catalogue/detail.pl, if items.materials is linked to an authorised >values list, show label instead of code. > >Test plan: >1/ Create an authorised values list 'MATERIALS' with some values >2/ In default MARC biblio framework, link an item subfield to >'items.materials', and to the AV list 'MATERIALS' >3/ Edit an item and give a value for this subfield >4/ Go to biblio record detail page (catalogue/detail.pl) >5/ In the items table, the authorised value label should be displayed. >--- > catalogue/detail.pl | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index b7ba9a4..7d24f92 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -190,6 +190,17 @@ my $norequests = 1; > my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw); > my $authvalcode_items_damaged = GetAuthValCode('items.damaged', $fw); > >+my $materials_authvalcode = GetAuthValCode('items.materials', $fw); >+my %materials_map; >+if ($materials_authvalcode) { >+ my $materials_authvals = GetAuthorisedValues($materials_authvalcode); >+ if ($materials_authvals) { >+ foreach my $value (@$materials_authvals) { >+ $materials_map{$value->{authorised_value}} = $value->{lib}; >+ } >+ } >+} >+ > my $analytics_flag; > my $materials_flag; # set this if the items have anything in the materials field > my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef; >@@ -272,7 +283,10 @@ foreach my $item (@items) { > } > > if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){ >- $materials_flag = 1; >+ $materials_flag = 1; >+ if (defined $materials_map{ $item->{materials} }) { >+ $item->{materials} = $materials_map{ $item->{materials} }; >+ } > } > > if ( C4::Context->preference('UseCourseReserves') ) { >-- >1.9.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 12670
:
30290
|
32765
|
40671
|
41888
|
48298
|
48299
|
48300
|
48301
|
48302
|
49512
|
49513