Lines 32-37
use C4::Output;
Link Here
|
32 |
use C4::Auth; |
32 |
use C4::Auth; |
33 |
use C4::Koha; |
33 |
use C4::Koha; |
34 |
use C4::Debug; |
34 |
use C4::Debug; |
|
|
35 |
use Koha::CirculationRules; |
35 |
|
36 |
|
36 |
my $input = new CGI; |
37 |
my $input = new CGI; |
37 |
my $dbh = C4::Context->dbh; |
38 |
my $dbh = C4::Context->dbh; |
Lines 91-96
if ($frombranch && $tobranch) {
Link Here
|
91 |
$sth = $dbh->prepare($query); |
92 |
$sth = $dbh->prepare($query); |
92 |
$res = $sth->execute(); |
93 |
$res = $sth->execute(); |
93 |
|
94 |
|
|
|
95 |
# For already moved rules, maxissueqty and maxonsiteissueqty |
96 |
Koha::CirculationRules->search({branchcode => $tobranch})->delete; |
97 |
my $rules = Koha::CirculationRules->search({ branchcode => $frombranch }); |
98 |
while ( my $rule = $rules->next ) { |
99 |
my $cloned_rule = $rule->unblessed; |
100 |
$cloned_rule->{branchcode} = $tobranch; |
101 |
delete $cloned_rule->{id}; |
102 |
Koha::CirculationRule->new( $cloned_rule )->store; |
103 |
} |
104 |
|
94 |
$template->param(result => "1"); |
105 |
$template->param(result => "1"); |
95 |
$template->param(error => $error); |
106 |
$template->param(error => $error); |
96 |
} |
107 |
} |
97 |
- |
|
|