|
Lines 219-230
elsif ($op eq "set-branch-defaults") {
Link Here
|
| 219 |
my $holdallowed = $input->param('holdallowed'); |
219 |
my $holdallowed = $input->param('holdallowed'); |
| 220 |
my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); |
220 |
my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); |
| 221 |
my $returnbranch = $input->param('returnbranch'); |
221 |
my $returnbranch = $input->param('returnbranch'); |
|
|
222 |
my $max_holds = $input->param('max_holds'); |
| 222 |
$maxissueqty =~ s/\s//g; |
223 |
$maxissueqty =~ s/\s//g; |
| 223 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
224 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
| 224 |
$maxonsiteissueqty =~ s/\s//g; |
225 |
$maxonsiteissueqty =~ s/\s//g; |
| 225 |
$maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; |
226 |
$maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; |
| 226 |
$holdallowed =~ s/\s//g; |
227 |
$holdallowed =~ s/\s//g; |
| 227 |
$holdallowed = undef if $holdallowed !~ /^\d+/; |
228 |
$holdallowed = undef if $holdallowed !~ /^\d+/; |
|
|
229 |
$max_holds =~ s/\s//g; |
| 230 |
$max_holds = undef if $max_holds !~ /^\d+/; |
| 228 |
|
231 |
|
| 229 |
if ($branch eq "*") { |
232 |
if ($branch eq "*") { |
| 230 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
233 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
|
Lines 260-265
elsif ($op eq "set-branch-defaults") {
Link Here
|
| 260 |
$sth_insert->execute($branch, $maxissueqty, $maxonsiteissueqty, $holdallowed, $hold_fulfillment_policy, $returnbranch); |
263 |
$sth_insert->execute($branch, $maxissueqty, $maxonsiteissueqty, $holdallowed, $hold_fulfillment_policy, $returnbranch); |
| 261 |
} |
264 |
} |
| 262 |
} |
265 |
} |
|
|
266 |
Koha::CirculationRules->set_rule( |
| 267 |
{ |
| 268 |
branchcode => $branch, |
| 269 |
categorycode => '*', |
| 270 |
itemtype => undef, |
| 271 |
rule_name => 'max_holds', |
| 272 |
rule_value => $max_holds, |
| 273 |
} |
| 274 |
); |
| 263 |
} |
275 |
} |
| 264 |
elsif ($op eq "add-branch-cat") { |
276 |
elsif ($op eq "add-branch-cat") { |
| 265 |
my $categorycode = $input->param('categorycode'); |
277 |
my $categorycode = $input->param('categorycode'); |
|
Lines 312-318
elsif ($op eq "add-branch-cat") {
Link Here
|
| 312 |
my $sth_insert = $dbh->prepare(q| |
324 |
my $sth_insert = $dbh->prepare(q| |
| 313 |
INSERT INTO default_borrower_circ_rules |
325 |
INSERT INTO default_borrower_circ_rules |
| 314 |
(categorycode, maxissueqty, maxonsiteissueqty) |
326 |
(categorycode, maxissueqty, maxonsiteissueqty) |
| 315 |
VALUES (?, ?, ?, ?) |
327 |
VALUES (?, ?, ?) |
| 316 |
|); |
328 |
|); |
| 317 |
my $sth_update = $dbh->prepare(q| |
329 |
my $sth_update = $dbh->prepare(q| |
| 318 |
UPDATE default_borrower_circ_rules |
330 |
UPDATE default_borrower_circ_rules |
|
Lines 330-336
elsif ($op eq "add-branch-cat") {
Link Here
|
| 330 |
|
342 |
|
| 331 |
Koha::CirculationRules->set_rule( |
343 |
Koha::CirculationRules->set_rule( |
| 332 |
{ |
344 |
{ |
| 333 |
branchcode => undef, |
345 |
branchcode => '*', |
| 334 |
categorycode => $categorycode, |
346 |
categorycode => $categorycode, |
| 335 |
itemtype => undef, |
347 |
itemtype => undef, |
| 336 |
rule_name => 'max_holds', |
348 |
rule_name => 'max_holds', |