Bugzilla – Attachment 48254 Details for
Bug 14752
Add multiple copies to a basket at once
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14752 - [QA followup] Auto-Generate barcode if left blank and autoBarcode is set
Bug-14752---QA-followup-Auto-Generate-barcode-if-l.patch (text/plain), 3.90 KB, created by
Nick Clemens (kidclamp)
on 2016-02-19 21:02:49 UTC
(
hide
)
Description:
Bug 14752 - [QA followup] Auto-Generate barcode if left blank and autoBarcode is set
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-02-19 21:02:49 UTC
Size:
3.90 KB
patch
obsolete
>From f937b1c606ab64c250c1359a4646c138b020afe3 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 19 Feb 2016 01:51:19 +0000 >Subject: [PATCH] Bug 14752 - [QA followup] Auto-Generate barcode if left blank > and autoBarcode is set > >Adds a warning/notice to item form and modal that barcodes will be >auto-filled using syspref if autoBarcode is turned on > >Fills in barcodes if passed in blank >--- > acqui/addorder.pl | 11 ++++++++++- > .../intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 8 ++++++++ > 2 files changed, 18 insertions(+), 1 deletion(-) > >diff --git a/acqui/addorder.pl b/acqui/addorder.pl >index f58e58d..fa171a5 100755 >--- a/acqui/addorder.pl >+++ b/acqui/addorder.pl >@@ -129,6 +129,7 @@ use C4::Biblio; # AddBiblio TransformKohaToMarc > use C4::Budgets; > use C4::Items; > use C4::Output; >+use C4::Barcodes; > > ### "-------------------- addorder.pl ----------" > >@@ -303,7 +304,6 @@ if ( $orderinfo->{quantity} ne '0' ) { > push @{$itemhash{$itemid[$i]}->{'indicator'}},$indicator[$i]; > } > foreach my $item (keys %itemhash){ >- > my $xml = TransformHtmlToXml( $itemhash{$item}->{'tags'}, > $itemhash{$item}->{'subfields'}, > $itemhash{$item}->{'field_values'}, >@@ -311,6 +311,15 @@ if ( $orderinfo->{quantity} ne '0' ) { > $itemhash{$item}->{'ind_tag'}, > 'ITEM'); > my $record=MARC::Record::new_from_xml($xml, 'UTF-8'); >+ my ($barcodefield,$barcodesubfield) = GetMarcFromKohaField('items.barcode'); >+ my $barcode = $record->subfield($barcodefield,$barcodesubfield); >+ my $aBpref = C4::Context->preference('autoBarcode'); >+ if( $barcode eq '' && $aBpref ne 'OFF'){ >+ my $barcodeobj = C4::Barcodes->new; >+ $barcode = $barcodeobj->next_value(); >+ $record->field($barcodefield)->delete_subfield( code => $barcodesubfield); >+ $record->field($barcodefield)->add_subfields($barcodesubfield => $barcode); >+ } > my ($biblionumber,$bibitemnum,$itemnumber) = AddItemFromMarc($record,$$orderinfo{biblionumber}); > $order->add_item($itemnumber); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index c993e1c..a009c44 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -1,5 +1,6 @@ > [% USE KohaDates %] > [% INCLUDE 'doc-head-open.inc' %] >+[% USE Koha %] > <title>Koha › Acquisitions › Basket [% basketno %] › [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] > >@@ -451,6 +452,10 @@ $(document).ready(function() > <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div> > [% END %] > >+ [% UNLESS Koha.Preference('autoBarcode') == 'OFF' %] >+ <div class="dialog message">The autoBarcode system preference is set to [% Koha.Preference('autoBarcode') %] and items with blank barcodes will have barcodes generated upon save to database</div> >+ [% END %] >+ > <div id="outeritemblock"></div> > > </fieldset> >@@ -657,6 +662,9 @@ $(document).ready(function() > <li>[% uniqueField %]</li> > [% END %] > </ul> >+ [% UNLESS Koha.Preference('autoBarcode') == 'OFF' %] >+ <h3>If barcode is blank and/or listed in UniqueItemFields barcodes will be generate using the autoBarcode preference setting ([% Koha.Preference('autoBarcode') %]) when saved</h3> >+ [% END %] > </div> > </div> > [% END %] >-- >2.1.4
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 14752
:
46093
|
46439
|
46832
|
46833
|
47223
|
47252
|
47477
|
48254
|
51481
|
52083
|
52587
|
52588
|
52605
|
52606
|
55527
|
55528
|
56649
|
56684