Bugzilla – Attachment 11291 Details for
Bug 7913
Automatically receive serial issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Receiving serials in a loop
Receiving-serials-in-a-loop.patch (text/plain), 4.19 KB, created by
Paul Poulain
on 2012-08-02 10:00:35 UTC
(
hide
)
Description:
Receiving serials in a loop
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2012-08-02 10:00:35 UTC
Size:
4.19 KB
patch
obsolete
>From 09cc909c0ef2edc66c28240c6f99b302eba8c029 Mon Sep 17 00:00:00 2001 >From: Lyon3 Team <koha@univ-lyon3.fr> >Date: Tue, 22 May 2012 15:43:02 +0200 >Subject: [PATCH] Receiving serials in a loop > >generate the number of issues entered from a message box and apply >'arrived' status. > >http://bugs.koha-community.org/show_bug.cgi?id=7913 >Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com> >--- > .../prog/en/modules/serials/serials-collection.tt | 6 +++++ > serials/serials-collection.pl | 22 +++++++++++-------- > 2 files changed, 19 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >index 23b496b..65d778d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >@@ -4,6 +4,11 @@ > > <script type="text/javascript"> > //<![CDATA[ >+function generateReceive(subscriptionid) { >+ if(nbissues=prompt(_("How many issues do you want to receive ?"))){ >+ document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid+'&nbissues='+nbissues; >+ } >+} > function print_slip(subscriptionid,issue){ > var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue; > window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes'); >@@ -190,6 +195,7 @@ $(document).ready(function() { > <p> > <input type="submit" value="Edit serials" /> > <input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" /> >+ [% IF ( subscriptions.size == 1 ) %] <input type="button" value="Multi receiving" onclick="javascript:generateReceive([% subscriptionidlist %])" />[% END %] > </p> > [% END %] > >diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl >index 610de60..7d5d6b4 100755 >--- a/serials/serials-collection.pl >+++ b/serials/serials-collection.pl >@@ -34,6 +34,7 @@ use List::MoreUtils qw/uniq/; > > my $query = new CGI; > my $op = $query->param('op') || q{}; >+my $nbissues=$query->param('nbissues'); > my $dbh = C4::Context->dbh; > > my ($template, $loggedinuser, $cookie); >@@ -55,19 +56,20 @@ my $subscriptions; > > if($op eq 'gennext' && @subscriptionid){ > my $subscriptionid = $subscriptionid[0]; >- my $subscription = GetSubscription($subscriptionid); >- >- my $sth = $dbh->prepare("SELECT publisheddate, serialid, serialseq, planneddate >+ my $sth = $dbh->prepare("SELECT publisheddate, serialid, serialseq, planneddate > FROM serial WHERE status = 1 AND subscriptionid = ?"); >+ my $status = defined( $nbissues ) ? 2 : 3; >+ $nbissues ||= 1; >+ for ( my $i = 0; $i < $nbissues; $i++ ){ > $sth->execute($subscriptionid); >- > # modify actual expected issue, to generate the next > if ( my $issue = $sth->fetchrow_hashref ) { > ModSerialStatus( $issue->{serialid}, $issue->{serialseq}, > $issue->{planneddate}, $issue->{publisheddate}, >- 3, "" ); >+ $status, "" ); > }else{ >- my $expected = GetNextExpected($subscriptionid); >+ my $subscription = GetSubscription($subscriptionid); >+ my $expected = GetNextExpected($subscriptionid); > my ( > $newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, > $newinnerloop1, $newinnerloop2, $newinnerloop3 >@@ -82,14 +84,16 @@ if($op eq 'gennext' && @subscriptionid){ > ## Updating the subscription seq status > my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? > WHERE subscriptionid = ?"; >- $sth = $dbh->prepare($squery); >- $sth->execute( >+ my $seqsth = $dbh->prepare($squery); >+ $seqsth->execute( > $newlastvalue1, $newlastvalue2, $newlastvalue3, $newinnerloop1, > $newinnerloop2, $newinnerloop3, $subscriptionid > ); > > } >- >+ last if $nbissues == 1; >+ last if HasSubscriptionExpired($subscriptionid) > 0; >+ } > print $query->redirect('/cgi-bin/koha/serials/serials-collection.pl?subscriptionid='.$subscriptionid); > } > >-- >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 7913
:
9702
|
9703
| 11291 |
12388
|
12615