Bugzilla – Attachment 142644 Details for
Bug 20817
Add ability to retain 9xx fields when adding on order item to existing record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20817: (QA follow-up) Add new parameter for PrepareItemrecordDisplay
Bug-20817-QA-follow-up-Add-new-parameter-for-Prepa.patch (text/plain), 2.62 KB, created by
Kyle M Hall
on 2022-10-25 16:33:13 UTC
(
hide
)
Description:
Bug 20817: (QA follow-up) Add new parameter for PrepareItemrecordDisplay
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2022-10-25 16:33:13 UTC
Size:
2.62 KB
patch
obsolete
>From 1f1d88ad32f23049f7107182e0bb0f1006d1d3bc Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Tue, 15 Mar 2022 11:34:32 -0400 >Subject: [PATCH] Bug 20817: (QA follow-up) Add new parameter for > PrepareItemrecordDisplay > >--- > C4/Items.pm | 13 ++++++++----- > acqui/neworderempty.pl | 2 +- > 2 files changed, 9 insertions(+), 6 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index f6e74a6453..0831b8cf36 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1262,7 +1262,7 @@ sub _find_value { > > =head2 PrepareItemrecordDisplay > >- PrepareItemrecordDisplay($bibnum,$itemumber,$defaultvalues,$frameworkcode); >+ PrepareItemrecordDisplay($bibnum,$itemumber,$defaultvalues,$frameworkcode, $use_defaults); > > Returns a hash with all the fields for Display a given item data in a template > >@@ -1270,11 +1270,13 @@ $defaultvalues should either contain a hashref of values for the new item, or be > > The $frameworkcode returns the item for the given frameworkcode, ONLY if bibnum is not provided > >+If $use_defaults is true, the returned item values will be generated from the default values only. >+ > =cut > > sub PrepareItemrecordDisplay { > >- my ( $bibnum, $itemnum, $defaultvalues, $frameworkcode ) = @_; >+ my ( $bibnum, $itemnum, $defaultvalues, $frameworkcode, $use_defaults ) = @_; > > my $dbh = C4::Context->dbh; > $frameworkcode = C4::Biblio::GetFrameworkCode($bibnum) if $bibnum; >@@ -1294,11 +1296,12 @@ sub PrepareItemrecordDisplay { > # return nothing if we don't have found an existing framework. > return q{} unless $tagslib; > my $itemrecord; >- if ($itemnum) { >- $itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum ); >- }elsif ($defaultvalues && $defaultvalues->{'itemrecord'} ) { >+ if ($use_defaults) { > $itemrecord = $defaultvalues->{'itemrecord'}; > } >+ elsif ($itemnum) { >+ $itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum ); >+ } > my @loop_data; > > my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index ef469299b6..0ffb1eed29 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -675,7 +675,7 @@ sub staged_items_field { > 'branchcode'=>_trim($iteminfos->{homebranch}) > ); > $all_items_quantity++; >- my $itemprocessed = PrepareItemrecordDisplay('', '', \%defaultvalues , 'ACQ'); >+ my $itemprocessed = PrepareItemrecordDisplay('', '', \%defaultvalues , 'ACQ', 1); > push @itemlist, $itemprocessed->{'iteminformation'}; > } > } >-- >2.30.2
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 20817
:
79867
|
80537
|
86711
|
86746
|
105214
|
105215
|
105216
|
105217
|
105218
|
105219
|
115343
|
118371
|
118372
|
118373
|
118374
|
118375
|
118376
|
118377
|
118378
|
122692
|
122834
|
122841
|
122858
|
122861
|
128766
|
128767
|
128768
|
128769
|
128770
|
128771
|
128772
|
128773
|
128774
|
128775
|
128776
|
128777
|
128782
|
128783
|
128785
|
128786
|
128787
|
128788
|
128789
|
128790
|
128791
|
128792
|
128793
|
128794
|
128795
|
128796
|
128797
|
128798
|
131732
|
131733
|
131734
|
131735
|
131736
|
131737
|
131738
|
131739
|
131740
|
131741
|
131742
|
131743
|
131744
|
131745
|
131746
|
131747
|
131748
|
131749
|
142630
|
142631
|
142632
|
142633
|
142634
|
142635
|
142636
|
142637
|
142638
|
142639
|
142640
|
142641
|
142642
|
142643
|
142644
|
142645
|
142646
|
142647
|
142648
|
142649
|
142650
|
142651
|
142829