Bugzilla – Attachment 66565 Details for
Bug 17674
Allow UI to delete serials issues in batch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17674 - Move subroutine GetSerialItemsInformations to Koha/Serials.pm
Bug-17674---Move-subroutine-GetSerialItemsInformat.patch (text/plain), 3.62 KB, created by
Philippe Audet-Fortin
on 2017-08-28 19:42:01 UTC
(
hide
)
Description:
Bug 17674 - Move subroutine GetSerialItemsInformations to Koha/Serials.pm
Filename:
MIME Type:
Creator:
Philippe Audet-Fortin
Created:
2017-08-28 19:42:01 UTC
Size:
3.62 KB
patch
obsolete
>From aecaf39bf4b179e3dbe86f23868aa06169b6749b Mon Sep 17 00:00:00 2001 >From: Paudet <philippe.audet-fortin@inlibro.com> >Date: Mon, 28 Aug 2017 15:33:12 -0400 >Subject: [PATCH] Bug 17674 - Move subroutine GetSerialItemsInformations to > Koha/Serials.pm > >--- > C4/Serials.pm | 24 ------------------------ > Koha/Serials.pm | 33 +++++++++++++++++++++++++++++++++ > serials/serials-collection.pl | 1 + > t/db_dependent/Serials.t | 1 + > 4 files changed, 35 insertions(+), 24 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index b881e95..d79c0a5 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -87,7 +87,6 @@ BEGIN { > HasItems > &GetSubscriptionsFromBorrower > &subscriptionCurrentlyOnOrder >- &GetSerialItemsInformations > > ); > } >@@ -2722,29 +2721,6 @@ sub _can_do_on_subscription { > return 0; > } > >-=head1 GetSerialItemsInformations >- >- @serialsitemsinformations = GetSerialItemsInformations (@serialid) >- >- return an array of specifique information of serials and serialitem a given array of serialid >- >-=cut >- >-sub GetSerialItemsInformations{ >- my (@serialid)=@_; >- my @serialitemsinformation; >- my $dbh = C4::Context->dbh; >- foreach my $sid(@serialid){ >- my $sth = $dbh->prepare("select count(i.itemnumber) as countitems,s.itemnumber as itemnumber from items i natural join serialitems s where s.serialid=?"); >- $sth->execute($sid); >- my $line = $sth->fetchrow_hashref; >- if($line->{'countitems'}){ >- push @serialitemsinformation,$line; >- } >- } >- return @serialitemsinformation; >-} >- > =head2 findSerialsByStatus > > @serials = findSerialsByStatus($status, $subscriptionid); >diff --git a/Koha/Serials.pm b/Koha/Serials.pm >index e970448..8d80a77 100644 >--- a/Koha/Serials.pm >+++ b/Koha/Serials.pm >@@ -27,6 +27,17 @@ use Koha::Serial; > > use base qw(Koha::Objects); > >+ >+use vars qw(@ISA @EXPORT); >+ >+BEGIN { >+ require Exporter; >+ @ISA = qw(Exporter); >+ @EXPORT = qw( >+ &GetSerialItemsInformations >+ ); >+} >+ > =head1 NAME > > Koha::Serial - Koha Serial Object class >@@ -49,6 +60,28 @@ sub object_class { > return 'Koha::Serial'; > } > >+=head1 GetSerialItemsInformations >+ >+ @serialsitemsinformations = GetSerialItemsInformations (@serialid) >+ >+ return an array of specifique information of serials and serialitem a given array of serialid >+ >+=cut >+ >+sub GetSerialItemsInformations{ >+ my (@serialid)=@_; >+ my @serialitemsinformation; >+ my $dbh = C4::Context->dbh; >+ foreach my $sid(@serialid){ >+ my $sth = $dbh->prepare("select count(i.itemnumber) as countitems,s.itemnumber as itemnumber from items i natural join serialitems s where s.serialid=?"); >+ $sth->execute($sid); >+ my $line = $sth->fetchrow_hashref; >+ if($line->{'countitems'}){ >+ push @serialitemsinformation,$line; >+ } >+ } >+ return @serialitemsinformation; >+} > =head1 AUTHOR > > Kyle M Hall <kyle@bywatersolutions.com> >diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl >index 02cd788..3490a45 100755 >--- a/serials/serials-collection.pl >+++ b/serials/serials-collection.pl >@@ -29,6 +29,7 @@ use C4::Items; > use C4::Letters; > use C4::Output; > use C4::Context; >+use Koha::Serials; > > use List::MoreUtils qw/uniq/; > >diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t >index 6958cb0..270f4a2 100755 >--- a/t/db_dependent/Serials.t >+++ b/t/db_dependent/Serials.t >@@ -16,6 +16,7 @@ use C4::Budgets; > use C4::Items; > use Koha::DateUtils; > use Koha::Acquisition::Booksellers; >+use Koha::Serials; > use t::lib::Mocks; > use t::lib::TestBuilder; > use Test::More tests => 50; >-- >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 17674
:
57731
|
58262
|
58263
|
58264
|
60925
|
61314
|
61315
|
61316
|
66565
|
69007
|
69010
|
69011
|
69013
|
69976
|
69977
|
69978
|
69979
|
71865
|
71866
|
71867
|
71868
|
71869
|
72985
|
73032
|
73035
|
73036
|
73037
|
73038
|
73039
|
73040
|
74318
|
74359
|
74472
|
75643
|
75644
|
75645
|
75646
|
75647
|
75648
|
75649
|
77745
|
77746
|
77747
|
77748
|
77749
|
77750
|
77751
|
77861
|
77862
|
77863
|
77864
|
77865
|
77866
|
77867
|
77868
|
79415
|
79420
|
79421
|
79422
|
79423
|
79424
|
79425
|
79426
|
79427
|
79428
|
79453
|
79454
|
79455
|
79456
|
79457
|
79458
|
79459
|
79460
|
80859
|
80944
|
80955
|
82237
|
86689
|
95474
|
99434
|
99944
|
99945
|
100906
|
100907