|
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 |
|
37 |
|
| 37 |
my $input = CGI->new; |
38 |
my $input = CGI->new; |
|
Lines 93-98
elsif ($op eq 'delete-branch-cat') {
Link Here
|
| 93 |
AND categorycode = ?"); |
94 |
AND categorycode = ?"); |
| 94 |
$sth_delete->execute($branch, $categorycode); |
95 |
$sth_delete->execute($branch, $categorycode); |
| 95 |
} |
96 |
} |
|
|
97 |
Koha::CirculationRules->set_rule( |
| 98 |
{ |
| 99 |
branchcode => $branch, |
| 100 |
categorycode => $categorycode, |
| 101 |
itemtype => undef, |
| 102 |
rule_name => 'max_holds', |
| 103 |
rule_value => undef, |
| 104 |
} |
| 105 |
); |
| 96 |
} |
106 |
} |
| 97 |
elsif ($op eq 'delete-branch-item') { |
107 |
elsif ($op eq 'delete-branch-item') { |
| 98 |
my $itemtype = $input->param('itemtype'); |
108 |
my $itemtype = $input->param('itemtype'); |
|
Lines 283-292
elsif ($op eq "add-branch-cat") {
Link Here
|
| 283 |
$sth_search->execute(); |
293 |
$sth_search->execute(); |
| 284 |
my $res = $sth_search->fetchrow_hashref(); |
294 |
my $res = $sth_search->fetchrow_hashref(); |
| 285 |
if ($res->{total}) { |
295 |
if ($res->{total}) { |
| 286 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty, $max_holds ); |
296 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty ); |
| 287 |
} else { |
297 |
} else { |
| 288 |
$sth_insert->execute( $maxissueqty, $maxonsiteissueqty, $max_holds ); |
298 |
$sth_insert->execute( $maxissueqty, $maxonsiteissueqty ); |
| 289 |
} |
299 |
} |
|
|
300 |
|
| 301 |
Koha::CirculationRules->set_rule( |
| 302 |
{ |
| 303 |
branchcode => undef, |
| 304 |
categorycode => undef, |
| 305 |
itemtype => undef, |
| 306 |
rule_name => 'max_holds', |
| 307 |
rule_value => $max_holds, |
| 308 |
} |
| 309 |
); |
| 290 |
} else { |
310 |
} else { |
| 291 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
311 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
| 292 |
FROM default_borrower_circ_rules |
312 |
FROM default_borrower_circ_rules |
|
Lines 306-315
elsif ($op eq "add-branch-cat") {
Link Here
|
| 306 |
$sth_search->execute($categorycode); |
326 |
$sth_search->execute($categorycode); |
| 307 |
my $res = $sth_search->fetchrow_hashref(); |
327 |
my $res = $sth_search->fetchrow_hashref(); |
| 308 |
if ($res->{total}) { |
328 |
if ($res->{total}) { |
| 309 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty, $max_holds, $categorycode ); |
329 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty, $categorycode ); |
| 310 |
} else { |
330 |
} else { |
| 311 |
$sth_insert->execute( $categorycode, $maxissueqty, $maxonsiteissueqty, $max_holds ); |
331 |
$sth_insert->execute( $categorycode, $maxissueqty, $maxonsiteissueqty ); |
| 312 |
} |
332 |
} |
|
|
333 |
|
| 334 |
Koha::CirculationRules->set_rule( |
| 335 |
{ |
| 336 |
branchcode => undef, |
| 337 |
categorycode => $categorycode, |
| 338 |
itemtype => undef, |
| 339 |
rule_name => 'max_holds', |
| 340 |
rule_value => $max_holds, |
| 341 |
} |
| 342 |
); |
| 313 |
} |
343 |
} |
| 314 |
} elsif ($categorycode eq "*") { |
344 |
} elsif ($categorycode eq "*") { |
| 315 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
345 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
|
Lines 359-364
elsif ($op eq "add-branch-cat") {
Link Here
|
| 359 |
} else { |
389 |
} else { |
| 360 |
$sth_insert->execute($branch, $categorycode, $maxissueqty, $maxonsiteissueqty, $max_holds); |
390 |
$sth_insert->execute($branch, $categorycode, $maxissueqty, $maxonsiteissueqty, $max_holds); |
| 361 |
} |
391 |
} |
|
|
392 |
|
| 393 |
Koha::CirculationRules->set_rule( |
| 394 |
{ |
| 395 |
branchcode => $branch, |
| 396 |
categorycode => $categorycode, |
| 397 |
itemtype => undef, |
| 398 |
rule_name => 'max_holds', |
| 399 |
rule_value => $max_holds, |
| 400 |
} |
| 401 |
); |
| 362 |
} |
402 |
} |
| 363 |
} |
403 |
} |
| 364 |
elsif ($op eq "add-branch-item") { |
404 |
elsif ($op eq "add-branch-item") { |