Lines 188-198
elsif ($op eq 'add') {
Link Here
|
188 |
|
188 |
|
189 |
} |
189 |
} |
190 |
elsif ($op eq "set-branch-defaults") { |
190 |
elsif ($op eq "set-branch-defaults") { |
191 |
my $categorycode = $input->param('categorycode'); |
191 |
my $categorycode = $input->param('categorycode'); |
192 |
my $maxissueqty = $input->param('maxissueqty'); |
192 |
my $maxissueqty = $input->param('maxissueqty'); |
193 |
my $maxonsiteissueqty = $input->param('maxonsiteissueqty'); |
193 |
my $maxonsiteissueqty = $input->param('maxonsiteissueqty'); |
194 |
my $holdallowed = $input->param('holdallowed'); |
194 |
my $holdallowed = $input->param('holdallowed'); |
195 |
my $returnbranch = $input->param('returnbranch'); |
195 |
my $returnbranch = $input->param('returnbranch'); |
|
|
196 |
my $renew_lost_allowed = $input->param('renew_lost_allowed'); |
197 |
my $renew_lost_found = $input->param('renew_lost_found'); |
198 |
|
196 |
$maxissueqty =~ s/\s//g; |
199 |
$maxissueqty =~ s/\s//g; |
197 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
200 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
198 |
$maxonsiteissueqty =~ s/\s//g; |
201 |
$maxonsiteissueqty =~ s/\s//g; |
Lines 204-220
elsif ($op eq "set-branch-defaults") {
Link Here
|
204 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
207 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
205 |
FROM default_circ_rules"); |
208 |
FROM default_circ_rules"); |
206 |
my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules |
209 |
my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules |
207 |
(maxissueqty, maxonsiteissueqty, holdallowed, returnbranch) |
210 |
(maxissueqty, maxonsiteissueqty, holdallowed, returnbranch, renew_lost_allowed, renew_lost_found) |
208 |
VALUES (?, ?, ?, ?)"); |
211 |
VALUES (?, ?, ?, ?, ?, ?)"); |
209 |
my $sth_update = $dbh->prepare("UPDATE default_circ_rules |
212 |
my $sth_update = $dbh->prepare("UPDATE default_circ_rules |
210 |
SET maxissueqty = ?, maxonsiteissueqty = ?, holdallowed = ?, returnbranch = ?"); |
213 |
SET maxissueqty = ?, maxonsiteissueqty = ?, holdallowed = ?, returnbranch = ?, renew_lost_allowed = ?, renew_lost_found = ?"); |
211 |
|
214 |
|
212 |
$sth_search->execute(); |
215 |
$sth_search->execute(); |
213 |
my $res = $sth_search->fetchrow_hashref(); |
216 |
my $res = $sth_search->fetchrow_hashref(); |
214 |
if ($res->{total}) { |
217 |
if ($res->{total}) { |
215 |
$sth_update->execute($maxissueqty, $maxonsiteissueqty, $holdallowed, $returnbranch); |
218 |
$sth_update->execute( $maxissueqty, $maxonsiteissueqty, $holdallowed, $returnbranch, $renew_lost_allowed, $renew_lost_found ); |
216 |
} else { |
219 |
} else { |
217 |
$sth_insert->execute($maxissueqty, $maxonsiteissueqty, $holdallowed, $returnbranch); |
220 |
$sth_insert->execute( $maxissueqty, $maxonsiteissueqty, $holdallowed, $returnbranch, $renew_lost_allowed, $renew_lost_found ); |
218 |
} |
221 |
} |
219 |
} else { |
222 |
} else { |
220 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
223 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total |
Lines 575-586
if ($branch eq "*") {
Link Here
|
575 |
my $defaults = $sth_defaults->fetchrow_hashref; |
578 |
my $defaults = $sth_defaults->fetchrow_hashref; |
576 |
|
579 |
|
577 |
if ($defaults) { |
580 |
if ($defaults) { |
578 |
$template->param(default_holdallowed_none => 1) if($defaults->{holdallowed} == 0); |
581 |
$template->param( default_holdallowed_none => 1 ) if ( $defaults->{holdallowed} == 0 ); |
579 |
$template->param(default_holdallowed_same => 1) if($defaults->{holdallowed} == 1); |
582 |
$template->param( default_holdallowed_same => 1 ) if ( $defaults->{holdallowed} == 1 ); |
580 |
$template->param(default_holdallowed_any => 1) if($defaults->{holdallowed} == 2); |
583 |
$template->param( default_holdallowed_any => 1 ) if ( $defaults->{holdallowed} == 2 ); |
581 |
$template->param(default_maxissueqty => $defaults->{maxissueqty}); |
584 |
|
582 |
$template->param(default_maxonsiteissueqty => $defaults->{maxonsiteissueqty}); |
585 |
$template->param( default_maxissueqty => $defaults->{maxissueqty} ); |
583 |
$template->param(default_returnbranch => $defaults->{returnbranch}); |
586 |
$template->param( default_maxonsiteissueqty => $defaults->{maxonsiteissueqty} ); |
|
|
587 |
$template->param( default_returnbranch => $defaults->{returnbranch} ); |
588 |
$template->param( default_renew_lost_allowed => $defaults->{renew_lost_allowed} ); |
589 |
$template->param( default_renew_lost_found => $defaults->{renew_lost_found} ); |
584 |
} |
590 |
} |
585 |
|
591 |
|
586 |
$template->param(default_rules => ($defaults ? 1 : 0)); |
592 |
$template->param(default_rules => ($defaults ? 1 : 0)); |