Bugzilla – Attachment 30249 Details for
Bug 11577
Automatic renewals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11577: Add "Automatic renewal" to the circulation and fine rules
Bug-11577-Add-Automatic-renewal-to-the-circulation.patch (text/plain), 7.04 KB, created by
Chris Cormack
on 2014-07-29 06:02:08 UTC
(
hide
)
Description:
Bug 11577: Add "Automatic renewal" to the circulation and fine rules
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-07-29 06:02:08 UTC
Size:
7.04 KB
patch
obsolete
>From 3f69ba42764a68b4701eed8db33031522dc56f6f Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Holger=20Mei=C3=9Fner?= <h.meissner.82@web.de> >Date: Thu, 15 May 2014 16:30:39 +0200 >Subject: [PATCH] Bug 11577: Add "Automatic renewal" to the circulation and > fine rules >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch adds a column "Automatic renewal" to the circulation and >fine rules table. > >To test: > >1) Add or edit some issuing rules. >2) Confirm that "Automatic Renewal" is set to "No" by default and > can be switched to "Yes". > >Sponsored-by: Hochschule für Gesundheit (hsg), Germany >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > admin/smart-rules.pl | 9 +++++---- > .../intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 14 ++++++++++++++ > 2 files changed, 19 insertions(+), 4 deletions(-) > >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index 5feba9f..eb3e875 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -101,8 +101,8 @@ elsif ($op eq 'delete-branch-item') { > # save the values entered > elsif ($op eq 'add') { > my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?'); >- my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, renewalperiod, norenewalbefore, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, maxsuspensiondays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); >- my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, maxsuspensiondays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, renewalperiod=?, norenewalbefore=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); >+ my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, renewalperiod, norenewalbefore, auto_renew, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, maxsuspensiondays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); >+ my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, maxsuspensiondays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, renewalperiod=?, norenewalbefore=?, auto_renew=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); > > my $br = $branch; # branch > my $bor = $input->param('categorycode'); # borrower category >@@ -118,6 +118,7 @@ elsif ($op eq 'add') { > my $renewalperiod = $input->param('renewalperiod'); > my $norenewalbefore = $input->param('norenewalbefore'); > $norenewalbefore = undef if $norenewalbefore eq '0' or $norenewalbefore =~ /^\s*$/; >+ my $auto_renew = $input->param('auto_renew') eq 'yes' ? 1 : 0; > my $reservesallowed = $input->param('reservesallowed'); > $maxissueqty =~ s/\s//g; > $maxissueqty = undef if $maxissueqty !~ /^\d+/; >@@ -133,9 +134,9 @@ elsif ($op eq 'add') { > $sth_search->execute($br,$bor,$cat); > my $res = $sth_search->fetchrow_hashref(); > if ($res->{total}) { >- $sth_update->execute($fine, $finedays, $maxsuspensiondays, $firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $norenewalbefore, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); >+ $sth_update->execute($fine, $finedays, $maxsuspensiondays, $firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $norenewalbefore, $auto_renew, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); > } else { >- $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $norenewalbefore, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays, $maxsuspensiondays, $firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); >+ $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $norenewalbefore, $auto_renew, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays, $maxsuspensiondays, $firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); > } > } > elsif ($op eq "set-branch-defaults") { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index 1b8b21a..fe846e6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -154,6 +154,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde > <th>Renewals allowed (count)</th> > <th>Renewal period</th> > <th>No renewal before</th> >+ <th>Automatic renewal</th> > <th>Holds allowed (count)</th> > <th>Rental discount (%)</th> > <th colspan="2"> </th> >@@ -213,6 +214,13 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde > <td>[% rule.renewalsallowed %]</td> > <td>[% rule.renewalperiod %]</td> > <td>[% rule.norenewalbefore %]</td> >+ <td> >+ [% IF ( rule.auto_renew ) %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> > <td>[% rule.reservesallowed %]</td> > <td>[% rule.rentaldiscount %]</td> > <td><a href="#" class="editrule">Edit</a></td> >@@ -264,6 +272,12 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde > <td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td> > <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td> > <td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td> >+ <td> >+ <select name="auto_renew" id="auto_renew"> >+ <option value="no" selected>No</option> >+ <option value="yes">Yes</option> >+ </select> >+ </td> > <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td> > <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td> > <td colspan="2"> >-- >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 11577
:
28425
|
28426
|
28427
|
28428
|
28429
|
28430
|
28431
|
28432
|
28433
|
28434
|
28454
|
28595
|
28596
|
28597
|
28598
|
28599
|
28600
|
28601
|
28602
|
28603
|
28604
|
29393
|
29394
|
29395
|
29396
|
29397
|
29398
|
29399
|
29400
|
29401
|
29402
|
29966
|
29967
|
29968
|
29969
|
29970
|
29971
|
29972
|
29973
|
29974
|
29975
|
30248
|
30249
|
30250
|
30251
|
30252
|
30253
|
30254
|
30255
|
30256
|
30257
|
30258
|
30692
|
30693
|
30694
|
30695
|
30696
|
30697
|
30698
|
30699
|
30700
|
30701
|
30702
|
31076
|
31077
|
31078
|
31079
|
31080
|
31081
|
31082
|
31083
|
31084
|
31085
|
31086
|
31198
|
31199
|
31200
|
31201
|
31202
|
31203
|
31204
|
31205
|
31206
|
31207
|
31208
|
31209
|
31640
|
31641
|
31642
|
31643
|
31644
|
31645
|
31646
|
31647
|
31648
|
31649
|
31650
|
31651
|
31652
|
31653
|
31654
|
31655
|
31656
|
31657
|
31658
|
31659
|
31660
|
31661
|
31662
|
31663
|
57734