Bugzilla – Attachment 21285 Details for
Bug 10773
Add item-level descriptions for Label Printing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10773 - Replace item-level codes with names/descriptions for Label Printing
Bug-10773---Replace-item-level-codes-with-namesdes.patch (text/plain), 2.53 KB, created by
Kyle M Hall (khall)
on 2013-09-20 18:02:09 UTC
(
hide
)
Description:
Bug 10773 - Replace item-level codes with names/descriptions for Label Printing
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-09-20 18:02:09 UTC
Size:
2.53 KB
patch
obsolete
>From 15c4873dd0a16d93e43018f5ea8733e1e4ae519c Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 21 Aug 2013 15:18:31 +1000 >Subject: [PATCH] Bug 10773 - Replace item-level codes with names/descriptions for Label Printing > >This patch replaces item-level codes for certain fields so that names >and descriptions are printed out instead of codes when using the Label >Creator. > >The fields in question are "ccode", "homebranch", "holdingbranch", >"location", and "permanent_location". > >Test Plan: > >1) Edit a layout in the Label Creator so that it includes any of these >fields. I suggest including "homebranch" and perhaps "ccode" if you >have them in your item data. >2) Add items to a batch in the Label Creator. >3) Export the batch using the layout, and view as PDF >4) Note how the codes for homebranch (and ccode if available) come >up instead of the name of the homebranch (and ccode). > >5) Apply patch > >6) Export the batch again >7) Note how the branch name and category name are now displaying >instead of the codes that showed before. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Labels/Label.pm | 13 +++++++++++++ > 1 files changed, 13 insertions(+), 0 deletions(-) > >diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm >index f62d50c..638b4bb 100644 >--- a/C4/Labels/Label.pm >+++ b/C4/Labels/Label.pm >@@ -94,6 +94,19 @@ sub _get_label_item { > my $data1 = $sth1->fetchrow_hashref; > $data->{'itemtype'} = $data1->{'description'}; > $data->{'itype'} = $data1->{'description'}; >+ #Replace item's branch codes with branch names >+ if ($data->{'homebranch'} || $data->{'holdingbranch'}){ >+ require C4::Branch; >+ $data->{'homebranch'} = C4::Branch::GetBranchName($data->{'homebranch'}) if $data->{'homebranch'}; >+ $data->{'holdingbranch'} = C4::Branch::GetBranchName($data->{'holdingbranch'}) if $data->{'holdingbranch'}; >+ } >+ #Replace ccode, location, permanent_location with descriptions >+ my $ccode = C4::Biblio::GetAuthorisedValueDesc('','', $data->{'ccode'} ,'','','CCODE', 1); >+ $data->{'ccode'} = $ccode if $ccode; >+ my $location = C4::Biblio::GetAuthorisedValueDesc('','', $data->{'location'} ,'','','LOC', 1); >+ $data->{'location'} = $location if $location; >+ my $permanent_location = C4::Biblio::GetAuthorisedValueDesc('','', $data->{'permanent_location'} ,'','','LOC', 1); >+ $data->{'permanent_location'} = $permanent_location if $permanent_location; > $barcode_only ? return $data->{'barcode'} : return $data; > } > >-- >1.7.2.5
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 10773
:
20520
|
20541
|
21285
|
34539
|
34634
|
35031
|
36051
|
36052
|
36085
|
36086