Bugzilla – Attachment 31090 Details for
Bug 12743
Allow default values from the ACQ framework to be used when creating a record in acquisitions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12743: ACQ: default values for catalogue records
SIGNED-OFF-Bug-12743-ACQ-default-values-for-catalo.patch (text/plain), 2.55 KB, created by
Gaetan Boisson
on 2014-08-22 12:46:42 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12743: ACQ: default values for catalogue records
Filename:
MIME Type:
Creator:
Gaetan Boisson
Created:
2014-08-22 12:46:42 UTC
Size:
2.55 KB
patch
obsolete
>From 73e5c89bebcb3fe72687a912b621f6d5c975ab21 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 20 Aug 2014 17:05:19 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 12743: ACQ: default values for catalogue > records > >At the moment, it is possible to create records in acquisitions, but the >ACQ framework is only used for items created in this module. > >This patch allows to defined default values in the ACQ framework for >records created on the acquisition module. > >Test plan: >1/ Make sure you have the ACQ framework created (otherwise create it >from the default framework). >2/ Define a default value for a field (for instance 099$z=1). >3/ Go in the acquisition module and create a new order from a new >record. >4/ Fill mandatory information and save. >5/ Go on the detail page of this record and verify the default value >exist. > >Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com> >--- > acqui/addorder.pl | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > >diff --git a/acqui/addorder.pl b/acqui/addorder.pl >index e048d05..99cf762 100755 >--- a/acqui/addorder.pl >+++ b/acqui/addorder.pl >@@ -129,6 +129,8 @@ use C4::Biblio; # AddBiblio TransformKohaToMarc > use C4::Budgets; > use C4::Items; > use C4::Output; >+use C4::Koha qw( subfield_is_koha_internal_p ); >+use MARC::Field; > > ### "-------------------- addorder.pl ----------" > >@@ -259,6 +261,25 @@ if ( $orderinfo->{quantity} ne '0' ) { > "aqorders.discount" => $$orderinfo{discount} ? $$orderinfo{discount} : "", > }); > >+ >+ my $tagslib = C4::Biblio::GetMarcStructure( 1, 'ACQ' ); >+ if ( $tagslib ) { >+ my ( $itemfield ) = C4::Biblio::GetMarcFromKohaField( 'items.itemnumber', '' ); >+ for my $tag ( sort keys %$tagslib ) { >+ next unless $tag; >+ next if $tag == $itemfield; >+ for my $subfield ( sort keys %{ $tagslib->{$tag} } ) { >+ next if ( subfield_is_koha_internal_p($subfield) ); >+ my $defaultvalue = $tagslib->{$tag}{$subfield}{defaultvalue}; >+ if ( defined $defaultvalue and $defaultvalue ne '' ) { >+ $record->insert_fields_ordered( >+ MARC::Field->new( $tag, '', '', $subfield => $defaultvalue ) >+ ); >+ } >+ } >+ } >+ } >+ > # create the record in catalogue, with framework '' > my ($biblionumber,$bibitemnum) = AddBiblio($record,''); > # change suggestion status if applicable >-- >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 12743
:
31028
|
31090
|
31098
|
33196
|
33237
|
34894
|
39032