Lines 32-37
use Koha::Logger;
Link Here
|
32 |
use Koha::RefundLostItemFeeRule; |
32 |
use Koha::RefundLostItemFeeRule; |
33 |
use Koha::RefundLostItemFeeRules; |
33 |
use Koha::RefundLostItemFeeRules; |
34 |
use Koha::Libraries; |
34 |
use Koha::Libraries; |
|
|
35 |
use Koha::CirculationRules; |
35 |
use Koha::Patron::Categories; |
36 |
use Koha::Patron::Categories; |
36 |
use Koha::Caches; |
37 |
use Koha::Caches; |
37 |
|
38 |
|
Lines 97-102
elsif ($op eq 'delete-branch-cat') {
Link Here
|
97 |
AND categorycode = ?"); |
98 |
AND categorycode = ?"); |
98 |
$sth_delete->execute($branch, $categorycode); |
99 |
$sth_delete->execute($branch, $categorycode); |
99 |
} |
100 |
} |
|
|
101 |
Koha::CirculationRules->set_rule( |
102 |
{ |
103 |
branchcode => $branch, |
104 |
categorycode => $categorycode, |
105 |
itemtype => undef, |
106 |
rule_name => 'max_holds', |
107 |
rule_value => undef, |
108 |
} |
109 |
); |
100 |
} |
110 |
} |
101 |
elsif ($op eq 'delete-branch-item') { |
111 |
elsif ($op eq 'delete-branch-item') { |
102 |
my $itemtype = $input->param('itemtype'); |
112 |
my $itemtype = $input->param('itemtype'); |
Lines 287-296
elsif ($op eq "add-branch-cat") {
Link Here
|
287 |
$sth_search->execute(); |
297 |
$sth_search->execute(); |
288 |
my $res = $sth_search->fetchrow_hashref(); |
298 |
my $res = $sth_search->fetchrow_hashref(); |
289 |
if ($res->{total}) { |
299 |
if ($res->{total}) { |
290 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty, $max_holds ); |
300 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty ); |
291 |
} else { |
301 |
} else { |
292 |
$sth_insert->execute( $maxissueqty, $maxonsiteissueqty, $max_holds ); |
302 |
$sth_insert->execute( $maxissueqty, $maxonsiteissueqty ); |
293 |
} |
303 |
} |
|
|
304 |
|
305 |
Koha::CirculationRules->set_rule( |
306 |
{ |
307 |
branchcode => undef, |
308 |
categorycode => undef, |
309 |
itemtype => undef, |
310 |
rule_name => 'max_holds', |
311 |
rule_value => $max_holds, |
312 |
} |
313 |
); |
294 |
} else { |
314 |
} else { |
295 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
315 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
296 |
FROM default_borrower_circ_rules |
316 |
FROM default_borrower_circ_rules |
Lines 310-319
elsif ($op eq "add-branch-cat") {
Link Here
|
310 |
$sth_search->execute($categorycode); |
330 |
$sth_search->execute($categorycode); |
311 |
my $res = $sth_search->fetchrow_hashref(); |
331 |
my $res = $sth_search->fetchrow_hashref(); |
312 |
if ($res->{total}) { |
332 |
if ($res->{total}) { |
313 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty, $max_holds, $categorycode ); |
333 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty, $categorycode ); |
314 |
} else { |
334 |
} else { |
315 |
$sth_insert->execute( $categorycode, $maxissueqty, $maxonsiteissueqty, $max_holds ); |
335 |
$sth_insert->execute( $categorycode, $maxissueqty, $maxonsiteissueqty ); |
316 |
} |
336 |
} |
|
|
337 |
|
338 |
Koha::CirculationRules->set_rule( |
339 |
{ |
340 |
branchcode => undef, |
341 |
categorycode => $categorycode, |
342 |
itemtype => undef, |
343 |
rule_name => 'max_holds', |
344 |
rule_value => $max_holds, |
345 |
} |
346 |
); |
317 |
} |
347 |
} |
318 |
} elsif ($categorycode eq "*") { |
348 |
} elsif ($categorycode eq "*") { |
319 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
349 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
Lines 363-368
elsif ($op eq "add-branch-cat") {
Link Here
|
363 |
} else { |
393 |
} else { |
364 |
$sth_insert->execute($branch, $categorycode, $maxissueqty, $maxonsiteissueqty, $max_holds); |
394 |
$sth_insert->execute($branch, $categorycode, $maxissueqty, $maxonsiteissueqty, $max_holds); |
365 |
} |
395 |
} |
|
|
396 |
|
397 |
Koha::CirculationRules->set_rule( |
398 |
{ |
399 |
branchcode => $branch, |
400 |
categorycode => $categorycode, |
401 |
itemtype => undef, |
402 |
rule_name => 'max_holds', |
403 |
rule_value => $max_holds, |
404 |
} |
405 |
); |
366 |
} |
406 |
} |
367 |
} |
407 |
} |
368 |
elsif ($op eq "add-branch-item") { |
408 |
elsif ($op eq "add-branch-item") { |