Bugzilla – Attachment 10737 Details for
Bug 7910
Batch renewal of subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7910 - Batch renewal of serials
Bug-7910---Batch-renewal-of-serials.patch (text/plain), 5.78 KB, created by
Jonathan Druart
on 2012-07-10 07:11:22 UTC
(
hide
)
Description:
Bug 7910 - Batch renewal of serials
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-07-10 07:11:22 UTC
Size:
5.78 KB
patch
obsolete
>From 421794e2a2af09669089d71ed27d177c148d583e Mon Sep 17 00:00:00 2001 >From: Amit Gupta <amit.gupta@osslabs.biz> >Date: Mon, 4 Jun 2012 09:39:05 +0530 >Subject: [PATCH] Bug 7910 - Batch renewal of serials > >To Test: >1) Go to Serials click on Check expiration link. >2) Search some subscription which have to expire it will give some result. >3) Select atleast one subscription which you want to renew. >4) Check the expiration date after renew. > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >modify >+ subscriptionid => @subscriptionid, >with >+ subscriptionid => \@subscriptionid, > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > .../prog/en/modules/serials/checkexpiration.tt | 34 ++++++++++++++++++-- > serials/subscription-renew.pl | 28 +++++++++++++--- > 2 files changed, 53 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt >index f2b01a5..dc04d2f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt >@@ -25,7 +25,23 @@ > > // ]]> > </script> >-<!-- End of additions --> >+<script type="text/javascript"> >+function selectAll () { >+ $(".selection").attr("checked", "checked"); >+} >+function clearAll () { >+ $(".selection").removeAttr("checked"); >+} >+function checkCheckBoxes() { >+ var checkedItems = $(".selection:checked"); >+ if ($(checkedItems).size() == 0) { >+ alert('Please select atleast one subscription(s) to renew.'); >+ return false; >+ } else{ >+ return true; >+ } >+} >+</script> > </head> > <body id="ser_checkexpiration" class="ser"> > [% INCLUDE 'header.inc' %] >@@ -74,8 +90,15 @@ > [% END %] > will expire before <b>[% date %]</b> > </p> >+<form id="myform" action="/cgi-bin/koha/serials/subscription-renew.pl" method="post" onsubmit="return checkCheckBoxes();"> >+<input type="hidden" name="op" value="renewall" /> >+<input type="hidden" name="subscriptionid" value="[% subscriptions_loo.subscriptionid %]" /> >+<input type="hidden" name="date" value="[% date %]" /> >+<div id="toolbar"><a href="#" onclick="selectAll(); return false;">Select All</a> | >+<a href="#" onclick="clearAll(); return false;">Clear All</a></div> > <table> >- <tr> >+ <tr> >+ <th> </th> > <th>ISSN</th> > <th>Title</th> > <th>Note</th> >@@ -88,6 +111,9 @@ > [% ELSE %] > <tr> > [% END %] >+ <td> >+ <input type="checkbox" class="selection" name="subscriptionid" value="[% subscriptions_loo.subscriptionid %]"/> >+ </td> > <td> > [% subscriptions_loo.issn %] > </td> >@@ -108,7 +134,9 @@ > <td><a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscriptions_loo.subscriptionid %]" onclick="popup([% subscriptions_loo.subscriptionid %]); return false;">Renew</a></td> > </tr> > [% END %] >- </table> >+ </table><br /> >+ <input type="submit" value="Renew"/> >+ </form> > [% ELSE %] > <p>No results for your query</p> > [% END %] >diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl >index 48861bc..c274781 100755 >--- a/serials/subscription-renew.pl >+++ b/serials/subscription-renew.pl >@@ -61,7 +61,8 @@ my $dbh = C4::Context->dbh; > > my $mode = $query->param('mode'); > my $op = $query->param('op') || q{}; >-my $subscriptionid = $query->param('subscriptionid'); >+my @subscriptionid = $query->param('subscriptionid'); >+my $date = $query->param('date'); > my $done = 0; # for after form has been submitted > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >@@ -75,17 +76,32 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > ); > if ( $op eq "renew" ) { > ReNewSubscription( >- $subscriptionid, $loggedinuser, >+ @subscriptionid, $loggedinuser, > C4::Dates->new($query->param('startdate'))->output('iso'), $query->param('numberlength'), > $query->param('weeklength'), $query->param('monthlength'), > $query->param('note') > ); > } > >-my $subscription = GetSubscription($subscriptionid); >+my $subid; >+if ( $op eq "renewall" ) { >+ foreach $subid (@subscriptionid){ >+ next unless $subid; >+ my $data = GetSubscription($subid); >+ my $length = $data->{numberlength}; >+ my $weeklength = $data->{weeklength}; >+ my $monthlength = $data->{monthlength}; >+ my $note = $data->{note}; >+ my $startdate = $data->{enddate} || POSIX::strftime( "%Y-%m-%d", localtime ); >+ ReNewSubscription( $subid,$loggedinuser,$startdate,$length,$weeklength, $monthlength, $note); >+ } >+ print $query->redirect("/cgi-bin/koha/serials/checkexpiration.pl?date=$date"); >+} >+ >+my $subscription = GetSubscription(@subscriptionid); > if ($subscription->{'cannotedit'}){ >- carp "Attempt to renew subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; >- print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); >+ carp "Attempt to renew subscription @subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; >+ print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=@subscriptionid"); > } > > $template->param( >@@ -96,7 +112,7 @@ $template->param( > numberlength => $subscription->{numberlength}, > weeklength => $subscription->{weeklength}, > monthlength => $subscription->{monthlength}, >- subscriptionid => $subscriptionid, >+ subscriptionid => \@subscriptionid, > bibliotitle => $subscription->{bibliotitle}, > $op => 1, > popup => ($query->param('mode')eq "popup"), >-- >1.7.7.3
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 7910
:
9905
|
10717
|
10737
|
74501
|
74502
|
74540
|
74541
|
74545
|
74546
|
74547
|
74687
|
75269