Bugzilla – Attachment 44778 Details for
Bug 15168
Remove C4::Serials::ItemizeSerials which is not used anymore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 15168: Remove C4:Serials::ItemizeSerials
PASSED-QA-Bug-15168-Remove-C4SerialsItemizeSerials.patch (text/plain), 8.59 KB, created by
Katrin Fischer
on 2015-11-11 21:17:32 UTC
(
hide
)
Description:
[PASSED QA] Bug 15168: Remove C4:Serials::ItemizeSerials
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-11-11 21:17:32 UTC
Size:
8.59 KB
patch
obsolete
>From e1194bb7edd9ac16a0f873067c699bfe80305b18 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 11 Nov 2015 08:54:12 +0000 >Subject: [PATCH] [PASSED QA] Bug 15168: Remove C4:Serials::ItemizeSerials >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This subroutine has been introduced in 2006, when C4::Serials has been >added to the codebase. >If you checkout this commit >commit 18d2cd099085e443d713a1546e029faa81481814 >Date: Fri Jul 7 08:45:47 2006 +0000 > this file replace C4/Bull.pm > >You won't find any occurrences of this subroutine neither. > >Interesting module's name by the way. > >Test plan: > git grep ItemizeSerials >should not return any result > >Followed test plan, no results found. >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Serials.pm | 137 +---------------------------------------------- > t/db_dependent/Serials.t | 4 +- > 2 files changed, 2 insertions(+), 139 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 7e977df..5f348ce 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -69,7 +69,7 @@ BEGIN { > &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire > &GetSubscriptionHistoryFromSubscriptionId > >- &GetNextSeq &GetSeq &NewIssue &ItemizeSerials &GetSerials >+ &GetNextSeq &GetSeq &NewIssue &GetSerials > &GetLatestSerials &ModSerialStatus &GetNextDate &GetSerials2 > &ReNewSubscription &GetLateOrMissingIssues > &GetSerialInformation &AddItem2Serial >@@ -1588,141 +1588,6 @@ sub NewIssue { > return $serialid; > } > >-=head2 ItemizeSerials >- >-ItemizeSerials($serialid, $info); >-$info is a hashref containing barcode branch, itemcallnumber, status, location >-$serialid the serialid >-return : >-1 if the itemize is a succes. >-0 and @error otherwise. @error containts the list of errors found. >- >-=cut >- >-sub ItemizeSerials { >- my ( $serialid, $info ) = @_; >- >- return unless ($serialid); >- >- my $now = POSIX::strftime( "%Y-%m-%d", localtime ); >- >- my $dbh = C4::Context->dbh; >- my $query = qq| >- SELECT * >- FROM serial >- WHERE serialid=? >- |; >- my $sth = $dbh->prepare($query); >- $sth->execute($serialid); >- my $data = $sth->fetchrow_hashref; >- if ( C4::Context->preference("RoutingSerials") ) { >- >- # check for existing biblioitem relating to serial issue >- my ( $count, @results ) = GetBiblioItemByBiblioNumber( $data->{'biblionumber'} ); >- my $bibitemno = 0; >- for ( my $i = 0 ; $i < $count ; $i++ ) { >- if ( $results[$i]->{'volumeddesc'} eq $data->{'serialseq'} . ' (' . $data->{'planneddate'} . ')' ) { >- $bibitemno = $results[$i]->{'biblioitemnumber'}; >- last; >- } >- } >- if ( $bibitemno == 0 ) { >- my $sth = $dbh->prepare( "SELECT * FROM biblioitems WHERE biblionumber = ? ORDER BY biblioitemnumber DESC" ); >- $sth->execute( $data->{'biblionumber'} ); >- my $biblioitem = $sth->fetchrow_hashref; >- $biblioitem->{'volumedate'} = $data->{planneddate}; >- $biblioitem->{'volumeddesc'} = $data->{serialseq} . ' (' . format_date( $data->{'planneddate'} ) . ')'; >- $biblioitem->{'dewey'} = $info->{itemcallnumber}; >- } >- } >- >- my $fwk = GetFrameworkCode( $data->{'biblionumber'} ); >- if ( $info->{barcode} ) { >- my @errors; >- if ( is_barcode_in_use( $info->{barcode} ) ) { >- push @errors, 'barcode_not_unique'; >- } else { >- my $marcrecord = MARC::Record->new(); >- my ( $tag, $subfield ) = GetMarcFromKohaField( "items.barcode", $fwk ); >- my $newField = MARC::Field->new( "$tag", '', '', "$subfield" => $info->{barcode} ); >- $marcrecord->insert_fields_ordered($newField); >- if ( $info->{branch} ) { >- my ( $tag, $subfield ) = GetMarcFromKohaField( "items.homebranch", $fwk ); >- >- #warn "items.homebranch : $tag , $subfield"; >- if ( $marcrecord->field($tag) ) { >- $marcrecord->field($tag)->add_subfields( "$subfield" => $info->{branch} ); >- } else { >- my $newField = MARC::Field->new( "$tag", '', '', "$subfield" => $info->{branch} ); >- $marcrecord->insert_fields_ordered($newField); >- } >- ( $tag, $subfield ) = GetMarcFromKohaField( "items.holdingbranch", $fwk ); >- >- #warn "items.holdingbranch : $tag , $subfield"; >- if ( $marcrecord->field($tag) ) { >- $marcrecord->field($tag)->add_subfields( "$subfield" => $info->{branch} ); >- } else { >- my $newField = MARC::Field->new( "$tag", '', '', "$subfield" => $info->{branch} ); >- $marcrecord->insert_fields_ordered($newField); >- } >- } >- if ( $info->{itemcallnumber} ) { >- my ( $tag, $subfield ) = GetMarcFromKohaField( "items.itemcallnumber", $fwk ); >- >- if ( $marcrecord->field($tag) ) { >- $marcrecord->field($tag)->add_subfields( "$subfield" => $info->{itemcallnumber} ); >- } else { >- my $newField = MARC::Field->new( "$tag", '', '', "$subfield" => $info->{itemcallnumber} ); >- $marcrecord->insert_fields_ordered($newField); >- } >- } >- if ( $info->{notes} ) { >- my ( $tag, $subfield ) = GetMarcFromKohaField( "items.itemnotes", $fwk ); >- >- if ( $marcrecord->field($tag) ) { >- $marcrecord->field($tag)->add_subfields( "$subfield" => $info->{notes} ); >- } else { >- my $newField = MARC::Field->new( "$tag", '', '', "$subfield" => $info->{notes} ); >- $marcrecord->insert_fields_ordered($newField); >- } >- } >- if ( $info->{location} ) { >- my ( $tag, $subfield ) = GetMarcFromKohaField( "items.location", $fwk ); >- >- if ( $marcrecord->field($tag) ) { >- $marcrecord->field($tag)->add_subfields( "$subfield" => $info->{location} ); >- } else { >- my $newField = MARC::Field->new( "$tag", '', '', "$subfield" => $info->{location} ); >- $marcrecord->insert_fields_ordered($newField); >- } >- } >- if ( $info->{status} ) { >- my ( $tag, $subfield ) = GetMarcFromKohaField( "items.notforloan", $fwk ); >- >- if ( $marcrecord->field($tag) ) { >- $marcrecord->field($tag)->add_subfields( "$subfield" => $info->{status} ); >- } else { >- my $newField = MARC::Field->new( "$tag", '', '', "$subfield" => $info->{status} ); >- $marcrecord->insert_fields_ordered($newField); >- } >- } >- if ( C4::Context->preference("RoutingSerials") ) { >- my ( $tag, $subfield ) = GetMarcFromKohaField( "items.dateaccessioned", $fwk ); >- if ( $marcrecord->field($tag) ) { >- $marcrecord->field($tag)->add_subfields( "$subfield" => $now ); >- } else { >- my $newField = MARC::Field->new( "$tag", '', '', "$subfield" => $now ); >- $marcrecord->insert_fields_ordered($newField); >- } >- } >- require C4::Items; >- C4::Items::AddItemFromMarc( $marcrecord, $data->{'biblionumber'} ); >- return 1; >- } >- return ( 0, @errors ); >- } >-} >- > =head2 HasSubscriptionStrictlyExpired > > 1 or 0 = HasSubscriptionStrictlyExpired($subscriptionid) >diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t >index 3a4942d..1f3ebb0 100644 >--- a/t/db_dependent/Serials.t >+++ b/t/db_dependent/Serials.t >@@ -15,7 +15,7 @@ use C4::Bookseller; > use C4::Biblio; > use C4::Budgets; > use Koha::DateUtils; >-use Test::More tests => 46; >+use Test::More tests => 45; > > BEGIN { > use_ok('C4::Serials'); >@@ -175,8 +175,6 @@ is(C4::Serials::ModSerialStatus(),undef, 'test modding serials'); > > is(C4::Serials::NewIssue(), undef, 'test getting 0 when nothing is entered'); > >-is(C4::Serials::ItemizeSerials(),undef, 'test getting nothing when nothing is entered'); >- > is(C4::Serials::HasSubscriptionStrictlyExpired(), undef, 'test if the subscriptions has expired'); > is(C4::Serials::HasSubscriptionExpired(), undef, 'test if the subscriptions has expired'); > >-- >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 15168
:
44724
|
44733
| 44778 |
44935