Bug 18887: (QA follow-up) Remove last occurences of old max_holds

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Josef Moravec 2018-10-01 19:14:41 +00:00 committed by Nick Clemens
parent a30b6b8938
commit 3fb069f8ec
1 changed files with 7 additions and 8 deletions

View File

@ -292,18 +292,18 @@ elsif ($op eq "add-branch-cat") {
if ($branch eq "*") {
if ($categorycode eq "*") {
#FIXME This block is will probably be never used
my $sth_search = $dbh->prepare("SELECT count(*) AS total
FROM default_circ_rules");
my $sth_insert = $dbh->prepare(q|
INSERT INTO default_circ_rules
(maxissueqty, maxonsiteissueqty, max_holds)
VALUES (?, ?, ?)
(maxissueqty, maxonsiteissueqty)
VALUES (?, ?)
|);
my $sth_update = $dbh->prepare(q|
UPDATE default_circ_rules
SET maxissueqty = ?,
maxonsiteissueqty = ?,
max_holds = ?
|);
$sth_search->execute();
@ -385,14 +385,13 @@ elsif ($op eq "add-branch-cat") {
AND categorycode = ?");
my $sth_insert = $dbh->prepare(q|
INSERT INTO branch_borrower_circ_rules
(branchcode, categorycode, maxissueqty, maxonsiteissueqty, max_holds)
VALUES (?, ?, ?, ?, ?)
(branchcode, categorycode, maxissueqty, maxonsiteissueqty)
VALUES (?, ?, ?, ?)
|);
my $sth_update = $dbh->prepare(q|
UPDATE branch_borrower_circ_rules
SET maxissueqty = ?,
maxonsiteissueqty = ?
max_holds = ?
WHERE branchcode = ?
AND categorycode = ?
|);
@ -400,9 +399,9 @@ elsif ($op eq "add-branch-cat") {
$sth_search->execute($branch, $categorycode);
my $res = $sth_search->fetchrow_hashref();
if ($res->{total}) {
$sth_update->execute($maxissueqty, $maxonsiteissueqty, $max_holds, $branch, $categorycode);
$sth_update->execute($maxissueqty, $maxonsiteissueqty, $branch, $categorycode);
} else {
$sth_insert->execute($branch, $categorycode, $maxissueqty, $maxonsiteissueqty, $max_holds);
$sth_insert->execute($branch, $categorycode, $maxissueqty, $maxonsiteissueqty);
}
Koha::CirculationRules->set_rule(