Lines 226-237
elsif ($op eq "set-branch-defaults") {
Link Here
|
226 |
my $holdallowed = $input->param('holdallowed'); |
226 |
my $holdallowed = $input->param('holdallowed'); |
227 |
my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); |
227 |
my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); |
228 |
my $returnbranch = $input->param('returnbranch'); |
228 |
my $returnbranch = $input->param('returnbranch'); |
|
|
229 |
my $max_holds = $input->param('max_holds'); |
229 |
$maxissueqty =~ s/\s//g; |
230 |
$maxissueqty =~ s/\s//g; |
230 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
231 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
231 |
$maxonsiteissueqty =~ s/\s//g; |
232 |
$maxonsiteissueqty =~ s/\s//g; |
232 |
$maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; |
233 |
$maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; |
233 |
$holdallowed =~ s/\s//g; |
234 |
$holdallowed =~ s/\s//g; |
234 |
$holdallowed = undef if $holdallowed !~ /^\d+/; |
235 |
$holdallowed = undef if $holdallowed !~ /^\d+/; |
|
|
236 |
$max_holds =~ s/\s//g; |
237 |
$max_holds = '' if $max_holds !~ /^\d+/; |
235 |
|
238 |
|
236 |
if ($branch eq "*") { |
239 |
if ($branch eq "*") { |
237 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
240 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
Lines 267-272
elsif ($op eq "set-branch-defaults") {
Link Here
|
267 |
$sth_insert->execute($branch, $maxissueqty, $maxonsiteissueqty, $holdallowed, $hold_fulfillment_policy, $returnbranch); |
270 |
$sth_insert->execute($branch, $maxissueqty, $maxonsiteissueqty, $holdallowed, $hold_fulfillment_policy, $returnbranch); |
268 |
} |
271 |
} |
269 |
} |
272 |
} |
|
|
273 |
Koha::CirculationRules->set_rule( |
274 |
{ |
275 |
branchcode => $branch, |
276 |
categorycode => '*', |
277 |
itemtype => undef, |
278 |
rule_name => 'max_holds', |
279 |
rule_value => $max_holds, |
280 |
} |
281 |
); |
270 |
} |
282 |
} |
271 |
elsif ($op eq "add-branch-cat") { |
283 |
elsif ($op eq "add-branch-cat") { |
272 |
my $categorycode = $input->param('categorycode'); |
284 |
my $categorycode = $input->param('categorycode'); |
Lines 278-284
elsif ($op eq "add-branch-cat") {
Link Here
|
278 |
$maxonsiteissueqty =~ s/\s//g; |
290 |
$maxonsiteissueqty =~ s/\s//g; |
279 |
$maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; |
291 |
$maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; |
280 |
$max_holds =~ s/\s//g; |
292 |
$max_holds =~ s/\s//g; |
281 |
$max_holds = undef if $max_holds !~ /^\d+/; |
293 |
$max_holds = '' if $max_holds !~ /^\d+/; |
282 |
|
294 |
|
283 |
if ($branch eq "*") { |
295 |
if ($branch eq "*") { |
284 |
if ($categorycode eq "*") { |
296 |
if ($categorycode eq "*") { |
Lines 319-325
elsif ($op eq "add-branch-cat") {
Link Here
|
319 |
my $sth_insert = $dbh->prepare(q| |
331 |
my $sth_insert = $dbh->prepare(q| |
320 |
INSERT INTO default_borrower_circ_rules |
332 |
INSERT INTO default_borrower_circ_rules |
321 |
(categorycode, maxissueqty, maxonsiteissueqty) |
333 |
(categorycode, maxissueqty, maxonsiteissueqty) |
322 |
VALUES (?, ?, ?, ?) |
334 |
VALUES (?, ?, ?) |
323 |
|); |
335 |
|); |
324 |
my $sth_update = $dbh->prepare(q| |
336 |
my $sth_update = $dbh->prepare(q| |
325 |
UPDATE default_borrower_circ_rules |
337 |
UPDATE default_borrower_circ_rules |
Lines 337-343
elsif ($op eq "add-branch-cat") {
Link Here
|
337 |
|
349 |
|
338 |
Koha::CirculationRules->set_rule( |
350 |
Koha::CirculationRules->set_rule( |
339 |
{ |
351 |
{ |
340 |
branchcode => undef, |
352 |
branchcode => '*', |
341 |
categorycode => $categorycode, |
353 |
categorycode => $categorycode, |
342 |
itemtype => undef, |
354 |
itemtype => undef, |
343 |
rule_name => 'max_holds', |
355 |
rule_name => 'max_holds', |