Bugzilla – Attachment 104899 Details for
Bug 25400
Circulation and fine rules cloning from one table to another does not copy "current checkouts allowed"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25400: [< 20.05] Fix cloning of circulation rules
Bug-25400--2005-Fix-cloning-of-circulation-rules.patch (text/plain), 1.64 KB, created by
Bernardo Gonzalez Kriegel
on 2020-05-14 20:01:38 UTC
(
hide
)
Description:
Bug 25400: [< 20.05] Fix cloning of circulation rules
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2020-05-14 20:01:38 UTC
Size:
1.64 KB
patch
obsolete
>From ac8cdf0419d7b9f4cc34484a808432f345ca92ce Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 8 May 2020 12:14:07 +0200 >Subject: [PATCH] Bug 25400: [< 20.05] Fix cloning of circulation rules > >This patch is for 19.11 and anterior versions. > >The clone functionnality does not clone the "already moved rules" >maxissueqty and maxonsiteissueqty. > >Test plan: >Clone some circ rules from one branch to another >Confirm that all the rules have been copied correctly > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Tested on 19.11, no errors >--- > admin/clone-rules.pl | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/admin/clone-rules.pl b/admin/clone-rules.pl >index dd071252d9..814351a71a 100755 >--- a/admin/clone-rules.pl >+++ b/admin/clone-rules.pl >@@ -32,6 +32,7 @@ use C4::Output; > use C4::Auth; > use C4::Koha; > use C4::Debug; >+use Koha::CirculationRules; > > my $input = new CGI; > my $dbh = C4::Context->dbh; >@@ -91,6 +92,16 @@ if ($frombranch && $tobranch) { > $sth = $dbh->prepare($query); > $res = $sth->execute(); > >+ # For already moved rules, maxissueqty and maxonsiteissueqty >+ Koha::CirculationRules->search({branchcode => $tobranch})->delete; >+ my $rules = Koha::CirculationRules->search({ branchcode => $frombranch eq '*' ? undef : $frombranch }); >+ while ( my $rule = $rules->next ) { >+ my $cloned_rule = $rule->unblessed; >+ $cloned_rule->{branchcode} = $tobranch; >+ delete $cloned_rule->{id}; >+ Koha::CirculationRule->new( $cloned_rule )->store; >+ } >+ > $template->param(result => "1"); > $template->param(error => $error); > } >-- >2.17.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 25400
:
104455
|
104456
|
104577
|
104654
| 104899