Bugzilla – Attachment 28678 Details for
Bug 12375
Store serials enumeration data in separate fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12375 [4] - Replace use of DBI with Koha::Database in C4::Serials::NewIssue
Bug-12375-4---Replace-use-of-DBI-with-KohaDatabase.patch (text/plain), 2.43 KB, created by
Kyle M Hall (khall)
on 2014-06-05 16:33:43 UTC
(
hide
)
Description:
Bug 12375 [4] - Replace use of DBI with Koha::Database in C4::Serials::NewIssue
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-06-05 16:33:43 UTC
Size:
2.43 KB
patch
obsolete
>From 1513dfd4387a56cb8c31a7b2a44387523977146b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 5 Jun 2014 11:26:40 -0400 >Subject: [PATCH] Bug 12375 [4] - Replace use of DBI with Koha::Database in C4::Serials::NewIssue > >--- > C4/Serials.pm | 37 ++++++++++++++++--------------------- > 1 files changed, 16 insertions(+), 21 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 45fea56..7ce3888 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -1630,36 +1630,31 @@ sub NewIssue { > } > ); > >- my $dbh = C4::Context->dbh; > my $serialid = $serial->serialid(); > >- my $query = qq| >- SELECT missinglist,recievedlist >- FROM subscriptionhistory >- WHERE subscriptionid=? >- |; >- my $sth = $dbh->prepare($query); >- $sth->execute($subscriptionid); >- my ( $missinglist, $recievedlist ) = $sth->fetchrow; >+ my $subscription_history = $schema->resultset('Subscriptionhistory')->find($subscriptionid); >+ my $missinglist = $subscription_history->missinglist(); >+ my $recievedlist = $subscription_history->recievedlist(); > > if ( $status == 2 ) { >- ### TODO Add a feature that improves recognition and description. >- ### As such count (serialseq) i.e. : N18,2(N19),N20 >- ### Would use substr and index But be careful to previous presence of () >- $recievedlist .= "; $serialseq" unless (index($recievedlist,$serialseq)>0); >+ ### TODO Add a feature that improves recognition and description. >+ ### As such count (serialseq) i.e. : N18,2(N19),N20 >+ ### Would use substr and index But be careful to previous presence of () >+ $recievedlist .= "; $serialseq" >+ unless ( index( $recievedlist, $serialseq ) > 0 ); > } > if ( $status == 4 ) { >- $missinglist .= "; $serialseq" unless (index($missinglist,$serialseq)>0); >+ $missinglist .= "; $serialseq" >+ unless ( index( $missinglist, $serialseq ) > 0 ); > } >- $query = qq| >- UPDATE subscriptionhistory >- SET recievedlist=?, missinglist=? >- WHERE subscriptionid=? >- |; >- $sth = $dbh->prepare($query); >+ > $recievedlist =~ s/^; //; > $missinglist =~ s/^; //; >- $sth->execute( $recievedlist, $missinglist, $subscriptionid ); >+ >+ $subscription_history->recievedlist($recievedlist); >+ $subscription_history->missinglist($missinglist); >+ $subscription_history->update(); >+ > return $serialid; > } > >-- >1.7.2.5
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 12375
:
28675
|
28676
|
28677
|
28678
|
28679
|
28680
|
28681
|
28682
|
28683
|
28843
|
28844
|
28845
|
28846
|
29928
|
29929
|
30099
|
30100
|
30101
|
30102
|
30103
|
30104
|
30108
|
35155
|
35156
|
35157
|
35158
|
35159
|
35160
|
35161
|
40710
|
40711
|
40712
|
40713
|
40714
|
40715
|
40716
|
46122
|
46123
|
46124
|
46125
|
46126
|
46127
|
46128
|
46319