Bugzilla – Attachment 7808 Details for
Bug 6875
de-nesting C4 packages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6875 follow-up for Items/Biblio de-nesting
Bug-6875-follow-up-for-ItemsBiblio-de-nesting.patch (text/plain), 3.36 KB, created by
Paul Poulain
on 2012-02-22 16:07:01 UTC
(
hide
)
Description:
Bug 6875 follow-up for Items/Biblio de-nesting
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2012-02-22 16:07:01 UTC
Size:
3.36 KB
patch
obsolete
>From 2a3d80e775c3b5d15aae1ca079d6d256cf8b46a8 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Wed, 22 Feb 2012 16:58:36 +0100 >Subject: [PATCH] Bug 6875 follow-up for Items/Biblio de-nesting > >the sub _find_value is used only in PrepareItemRecord sub, that has been moved to Items package > >This patch moves the _find_value in Items as well. >--- > C4/Biblio.pm | 39 --------------------------------------- > C4/Items.pm | 39 +++++++++++++++++++++++++++++++++++++++ > 2 files changed, 39 insertions(+), 39 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index b3a95b8..f2ebca7 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2876,45 +2876,6 @@ sub _AddBiblioNoZebra { > return %result; > } > >-=head2 _find_value >- >- ($indicators, $value) = _find_value($tag, $subfield, $record,$encoding); >- >-Find the given $subfield in the given $tag in the given >-MARC::Record $record. If the subfield is found, returns >-the (indicators, value) pair; otherwise, (undef, undef) is >-returned. >- >-PROPOSITION : >-Such a function is used in addbiblio AND additem and serial-edit and maybe could be used in Authorities. >-I suggest we export it from this module. >- >-=cut >- >-sub _find_value { >- my ( $tagfield, $insubfield, $record, $encoding ) = @_; >- my @result; >- my $indicator; >- if ( $tagfield < 10 ) { >- if ( $record->field($tagfield) ) { >- push @result, $record->field($tagfield)->data(); >- } else { >- push @result, ""; >- } >- } else { >- foreach my $field ( $record->field($tagfield) ) { >- my @subfields = $field->subfields(); >- foreach my $subfield (@subfields) { >- if ( @$subfield[0] eq $insubfield ) { >- push @result, @$subfield[1]; >- $indicator = $field->indicator(1) . $field->indicator(2); >- } >- } >- } >- } >- return ( $indicator, @result ); >-} >- > =head2 _koha_marc_update_bib_ids > > >diff --git a/C4/Items.pm b/C4/Items.pm >index 1107db9..8025529 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2491,6 +2491,45 @@ sub GetItemHolds { > } > =head1 OTHER FUNCTIONS > >+=head2 _find_value >+ >+ ($indicators, $value) = _find_value($tag, $subfield, $record,$encoding); >+ >+Find the given $subfield in the given $tag in the given >+MARC::Record $record. If the subfield is found, returns >+the (indicators, value) pair; otherwise, (undef, undef) is >+returned. >+ >+PROPOSITION : >+Such a function is used in addbiblio AND additem and serial-edit and maybe could be used in Authorities. >+I suggest we export it from this module. >+ >+=cut >+ >+sub _find_value { >+ my ( $tagfield, $insubfield, $record, $encoding ) = @_; >+ my @result; >+ my $indicator; >+ if ( $tagfield < 10 ) { >+ if ( $record->field($tagfield) ) { >+ push @result, $record->field($tagfield)->data(); >+ } else { >+ push @result, ""; >+ } >+ } else { >+ foreach my $field ( $record->field($tagfield) ) { >+ my @subfields = $field->subfields(); >+ foreach my $subfield (@subfields) { >+ if ( @$subfield[0] eq $insubfield ) { >+ push @result, @$subfield[1]; >+ $indicator = $field->indicator(1) . $field->indicator(2); >+ } >+ } >+ } >+ } >+ return ( $indicator, @result ); >+} >+ > > =head2 PrepareItemrecordDisplay > >-- >1.7.5.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 6875
:
5442
|
5443
|
5496
|
5497
|
5498
|
5499
|
5500
|
5501
|
5502
|
5503
|
5504
|
5505
|
5506
|
5507
|
5508
|
5509
|
5510
|
5511
|
5512
|
7359
|
7360
|
7361
|
7362
|
7363
|
7364
|
7365
|
7652
|
7654
|
7655
|
7656
|
7657
|
7658
|
7770
|
7771
|
7808
|
7844
|
8095
|
8133
|
8134
|
8135