Bugzilla – Attachment 52019 Details for
Bug 14048
Change RefundLostItemFeeOnReturn to be branch specific
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14048: Add a refund rules setting form in smart-rules
Bug-14048-Add-a-refund-rules-setting-form-in-smart.patch (text/plain), 5.46 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-06-03 14:55:27 UTC
(
hide
)
Description:
Bug 14048: Add a refund rules setting form in smart-rules
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-06-03 14:55:27 UTC
Size:
5.46 KB
patch
obsolete
>From e4b008e8b5e2fa8a708f318d5c994d1e4f136b67 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 3 Jun 2016 11:26:11 -0300 >Subject: [PATCH] Bug 14048: Add a refund rules setting form in smart-rules > >This patch introduces the CRUD UI for managing the refund lost item fee >rules on the general 'Circulation and fines rules' page. > >Verify that rules can be added and changed (by adding a new one for >the same branch). The default rule is locked so it cannot be deleted. > >Sponsored-by: DoverNet >Sponsored-by: South-East Kansas Library System >Sponsored-by: SWITCH Library Consortium >--- > admin/smart-rules.pl | 25 ++++++++++ > .../prog/en/modules/admin/smart-rules.tt | 58 ++++++++++++++++++++++ > 2 files changed, 83 insertions(+) > >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index 11a5637..ac6efef 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -30,6 +30,9 @@ use Koha::DateUtils; > use Koha::Database; > use Koha::IssuingRule; > use Koha::IssuingRules; >+use Koha::Logger; >+use Koha::RefundLostItemFeeRule; >+use Koha::RefundLostItemFeeRules; > use Koha::Libraries; > > my $input = CGI->new; >@@ -423,6 +426,28 @@ elsif ($op eq "add-branch-item") { > } > } > } >+elsif ( $op eq 'add-refund-lost-item-fee-rule' ) { >+ my $ref_branchcode = $input->param('ref_branchcode'); >+ my $ref_refund = $input->param('ref_refund'); >+ # We retrieve the object to update it, or create a new one >+ my $refundLostItemFeeRule = Koha::RefundLostItemFeeRules->find({ >+ branchcode => $ref_branchcode >+ }) // Koha::RefundLostItemFeeRule->new; >+ $refundLostItemFeeRule->set({ >+ branchcode => $ref_branchcode, >+ refund => $ref_refund >+ })->store(); >+} >+elsif ( $op eq 'del-refund-lost-item-fee-rule' ) { >+ my $ref_branchcode = $input->param('ref_branchcode'); >+ eval { >+ Koha::RefundLostItemFeeRules->find({ >+ branchcode => $ref_branchcode >+ })->delete; >+ }; >+} >+ >+$template->param( refundLostItemFeeRules => scalar Koha::RefundLostItemFeeRules->search ) ; > > my $branches = GetBranches(); > my @branchloop; >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 fea01f3..4a156cd 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 >@@ -2,6 +2,7 @@ > <title>Koha › Administration › Circulation and fine rules</title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] >+[% USE Branches %] > <script type="text/javascript"> > //<![CDATA[ > >@@ -557,6 +558,63 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde > </form> > </div> > [% END %] >+ >+ <div id="refund-lost-item-fee-on-return" class="container"> >+ <h3>Lost item fee refund on return policy</h3> >+ <p>Specify the default policy for lost item fees on return. >+ </p> >+ <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> >+ <input type="hidden" name="op" value="add-refund-lost-item-fee-rule" /> >+ <table> >+ <tr> >+ <th>Library</th> >+ <th>Refund lost item fee</th> >+ <th> </th> >+ </tr> >+ [% FOREACH refundLostItemFeeRule IN refundLostItemFeeRules %] >+ <tr> >+ <td> >+ [% IF refundLostItemFeeRule.branchcode == '*' %] >+ All >+ [% ELSE %] >+ [% Branches.GetName(refundLostItemFeeRule.branchcode) %] >+ [% END %] >+ </td> >+ <td> >+ [% IF refundLostItemFeeRule.refund %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </td> >+ <td class="actions"> >+ [% IF refundLostItemFeeRule.branchcode != '*' %] >+ <a class="btn btn-mini delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=del-refund-lost-item-fee-rule&ref_branchcode=[% refundLostItemFeeRule.branchcode %]"><i class="fa fa-trash"></i> Delete</a> >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ <tr> >+ <td> >+ <select name="ref_branchcode"> >+ <option value='*'>All</option> >+ [% FOREACH branch IN Branches.all %] >+ <option value="[% branch.branchcode %]">[% branch.branchname %]</option> >+ [% END %] >+ </select> >+ </td> >+ <td> >+ <select name="ref_refund"> >+ <option value="0">No</option> >+ <option value="1">Yes</option> >+ </select> >+ </td> >+ <td class="actions"><button type="submit" class="btn btn-mini"><i class="fa fa-plus"></i> Add</td> >+ </tr> >+ </table> >+ </form> >+ </div> >+ > <div id="holds-policy-by-item-type" class="container"> > <h3>[% IF humanbranch %]Holds policy by item type for [% humanbranch %][% ELSE %]Default holds policy by item type[% END %]</h3> > <p> >-- >2.8.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 14048
:
52016
|
52017
|
52018
|
52019
|
52020
|
52169
|
52170
|
52202
|
52203
|
52286
|
52287
|
52288
|
52289
|
52290
|
52291
|
52292
|
52293
|
52306
|
52444
|
52445
|
52446
|
52447
|
52448
|
52449
|
52450
|
52451
|
52482
|
52658
|
52659
|
52660
|
52661
|
52662
|
52663
|
52664
|
52665
|
52666
|
52667
|
52668
|
52748
|
52749
|
52750
|
52751
|
52752
|
52753
|
52754
|
52755
|
52756
|
52757
|
52835
|
52836
|
52837
|
52838
|
52839
|
52840
|
52841
|
52842
|
52843
|
52844
|
52876
|
52883
|
52894
|
53017
|
53018
|
53019
|
53020
|
53021
|
53022
|
53023
|
53024
|
53025
|
53026
|
53027
|
53028
|
53029