|
Lines 218-229
elsif ($op eq "set-branch-defaults") {
Link Here
|
| 218 |
my $holdallowed = $input->param('holdallowed'); |
218 |
my $holdallowed = $input->param('holdallowed'); |
| 219 |
my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); |
219 |
my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); |
| 220 |
my $returnbranch = $input->param('returnbranch'); |
220 |
my $returnbranch = $input->param('returnbranch'); |
|
|
221 |
my $max_holds = $input->param('max_holds'); |
| 221 |
$maxissueqty =~ s/\s//g; |
222 |
$maxissueqty =~ s/\s//g; |
| 222 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
223 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
| 223 |
$maxonsiteissueqty =~ s/\s//g; |
224 |
$maxonsiteissueqty =~ s/\s//g; |
| 224 |
$maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; |
225 |
$maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; |
| 225 |
$holdallowed =~ s/\s//g; |
226 |
$holdallowed =~ s/\s//g; |
| 226 |
$holdallowed = undef if $holdallowed !~ /^\d+/; |
227 |
$holdallowed = undef if $holdallowed !~ /^\d+/; |
|
|
228 |
$max_holds =~ s/\s//g; |
| 229 |
$max_holds = undef if $max_holds !~ /^\d+/; |
| 227 |
|
230 |
|
| 228 |
if ($branch eq "*") { |
231 |
if ($branch eq "*") { |
| 229 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
232 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
|
Lines 259-264
elsif ($op eq "set-branch-defaults") {
Link Here
|
| 259 |
$sth_insert->execute($branch, $maxissueqty, $maxonsiteissueqty, $holdallowed, $hold_fulfillment_policy, $returnbranch); |
262 |
$sth_insert->execute($branch, $maxissueqty, $maxonsiteissueqty, $holdallowed, $hold_fulfillment_policy, $returnbranch); |
| 260 |
} |
263 |
} |
| 261 |
} |
264 |
} |
|
|
265 |
Koha::CirculationRules->set_rule( |
| 266 |
{ |
| 267 |
branchcode => $branch, |
| 268 |
categorycode => '*', |
| 269 |
itemtype => undef, |
| 270 |
rule_name => 'max_holds', |
| 271 |
rule_value => $max_holds, |
| 272 |
} |
| 273 |
); |
| 262 |
} |
274 |
} |
| 263 |
elsif ($op eq "add-branch-cat") { |
275 |
elsif ($op eq "add-branch-cat") { |
| 264 |
my $categorycode = $input->param('categorycode'); |
276 |
my $categorycode = $input->param('categorycode'); |
|
Lines 326-332
elsif ($op eq "add-branch-cat") {
Link Here
|
| 326 |
|
338 |
|
| 327 |
Koha::CirculationRules->set_rule( |
339 |
Koha::CirculationRules->set_rule( |
| 328 |
{ |
340 |
{ |
| 329 |
branchcode => undef, |
341 |
branchcode => '*', |
| 330 |
categorycode => $categorycode, |
342 |
categorycode => $categorycode, |
| 331 |
itemtype => undef, |
343 |
itemtype => undef, |
| 332 |
rule_name => 'max_holds', |
344 |
rule_name => 'max_holds', |