Lines 170-180
elsif ($op eq 'add') {
Link Here
|
170 |
|
170 |
|
171 |
} |
171 |
} |
172 |
elsif ($op eq "set-branch-defaults") { |
172 |
elsif ($op eq "set-branch-defaults") { |
173 |
my $categorycode = $input->param('categorycode'); |
173 |
my $categorycode = $input->param('categorycode'); |
174 |
my $maxissueqty = $input->param('maxissueqty'); |
174 |
my $maxissueqty = $input->param('maxissueqty'); |
175 |
my $maxonsiteissueqty = $input->param('maxonsiteissueqty'); |
175 |
my $maxonsiteissueqty = $input->param('maxonsiteissueqty'); |
176 |
my $holdallowed = $input->param('holdallowed'); |
176 |
my $holdallowed = $input->param('holdallowed'); |
177 |
my $returnbranch = $input->param('returnbranch'); |
177 |
my $returnbranch = $input->param('returnbranch'); |
|
|
178 |
my $renew_lost_allowed = $input->param('renew_lost_allowed'); |
179 |
my $renew_lost_found = $input->param('renew_lost_found'); |
180 |
|
178 |
$maxissueqty =~ s/\s//g; |
181 |
$maxissueqty =~ s/\s//g; |
179 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
182 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
180 |
$maxonsiteissueqty =~ s/\s//g; |
183 |
$maxonsiteissueqty =~ s/\s//g; |
Lines 186-202
elsif ($op eq "set-branch-defaults") {
Link Here
|
186 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
189 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
187 |
FROM default_circ_rules"); |
190 |
FROM default_circ_rules"); |
188 |
my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules |
191 |
my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules |
189 |
(maxissueqty, maxonsiteissueqty, holdallowed, returnbranch) |
192 |
(maxissueqty, maxonsiteissueqty, holdallowed, returnbranch, renew_lost_allowed, renew_lost_found) |
190 |
VALUES (?, ?, ?, ?)"); |
193 |
VALUES (?, ?, ?, ?, ?, ?)"); |
191 |
my $sth_update = $dbh->prepare("UPDATE default_circ_rules |
194 |
my $sth_update = $dbh->prepare("UPDATE default_circ_rules |
192 |
SET maxissueqty = ?, maxonsiteissueqty = ?, holdallowed = ?, returnbranch = ?"); |
195 |
SET maxissueqty = ?, maxonsiteissueqty = ?, holdallowed = ?, returnbranch = ?, renew_lost_allowed = ?, renew_lost_found = ?"); |
193 |
|
196 |
|
194 |
$sth_search->execute(); |
197 |
$sth_search->execute(); |
195 |
my $res = $sth_search->fetchrow_hashref(); |
198 |
my $res = $sth_search->fetchrow_hashref(); |
196 |
if ($res->{total}) { |
199 |
if ($res->{total}) { |
197 |
$sth_update->execute($maxissueqty, $maxonsiteissueqty, $holdallowed, $returnbranch); |
200 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty, $holdallowed, $returnbranch, $renew_lost_allowed, $renew_lost_found ); |
198 |
} else { |
201 |
} else { |
199 |
$sth_insert->execute($maxissueqty, $maxonsiteissueqty, $holdallowed, $returnbranch); |
202 |
$sth_insert->execute( $maxissueqty, $maxonsiteissueqty, $holdallowed, $returnbranch, $renew_lost_allowed, $renew_lost_found ); |
200 |
} |
203 |
} |
201 |
} else { |
204 |
} else { |
202 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
205 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
Lines 548-559
if ($branch eq "*") {
Link Here
|
548 |
my $defaults = $sth_defaults->fetchrow_hashref; |
551 |
my $defaults = $sth_defaults->fetchrow_hashref; |
549 |
|
552 |
|
550 |
if ($defaults) { |
553 |
if ($defaults) { |
551 |
$template->param(default_holdallowed_none => 1) if($defaults->{holdallowed} == 0); |
554 |
$template->param( default_holdallowed_none => 1 ) if ( $defaults->{holdallowed} == 0 ); |
552 |
$template->param(default_holdallowed_same => 1) if($defaults->{holdallowed} == 1); |
555 |
$template->param( default_holdallowed_same => 1 ) if ( $defaults->{holdallowed} == 1 ); |
553 |
$template->param(default_holdallowed_any => 1) if($defaults->{holdallowed} == 2); |
556 |
$template->param( default_holdallowed_any => 1 ) if ( $defaults->{holdallowed} == 2 ); |
554 |
$template->param(default_maxissueqty => $defaults->{maxissueqty}); |
557 |
|
555 |
$template->param(default_maxonsiteissueqty => $defaults->{maxonsiteissueqty}); |
558 |
$template->param( default_maxissueqty => $defaults->{maxissueqty} ); |
556 |
$template->param(default_returnbranch => $defaults->{returnbranch}); |
559 |
$template->param( default_maxonsiteissueqty => $defaults->{maxonsiteissueqty} ); |
|
|
560 |
$template->param( default_returnbranch => $defaults->{returnbranch} ); |
561 |
$template->param( default_renew_lost_allowed => $defaults->{renew_lost_allowed} ); |
562 |
$template->param( default_renew_lost_found => $defaults->{renew_lost_found} ); |
557 |
} |
563 |
} |
558 |
|
564 |
|
559 |
$template->param(default_rules => ($defaults ? 1 : 0)); |
565 |
$template->param(default_rules => ($defaults ? 1 : 0)); |