Lines 255-261
elsif ($op eq 'add') {
Link Here
|
255 |
my $itemtype = $input->param('itemtype'); # item type |
255 |
my $itemtype = $input->param('itemtype'); # item type |
256 |
my $fine = $input->param('fine'); |
256 |
my $fine = $input->param('fine'); |
257 |
my $finedays = $input->param('finedays'); |
257 |
my $finedays = $input->param('finedays'); |
258 |
my $maxsuspensiondays = $input->param('maxsuspensiondays') || ''; |
258 |
my $maxsuspensiondays = $input->param('maxsuspensiondays') || q{}; |
259 |
my $suspension_chargeperiod = $input->param('suspension_chargeperiod') || 1; |
259 |
my $suspension_chargeperiod = $input->param('suspension_chargeperiod') || 1; |
260 |
my $firstremind = $input->param('firstremind'); |
260 |
my $firstremind = $input->param('firstremind'); |
261 |
my $chargeperiod = $input->param('chargeperiod'); |
261 |
my $chargeperiod = $input->param('chargeperiod'); |
Lines 263-297
elsif ($op eq 'add') {
Link Here
|
263 |
my $maxissueqty = strip_non_numeric( scalar $input->param('maxissueqty') ); |
263 |
my $maxissueqty = strip_non_numeric( scalar $input->param('maxissueqty') ); |
264 |
my $maxonsiteissueqty = strip_non_numeric( scalar $input->param('maxonsiteissueqty') ); |
264 |
my $maxonsiteissueqty = strip_non_numeric( scalar $input->param('maxonsiteissueqty') ); |
265 |
my $renewalsallowed = $input->param('renewalsallowed'); |
265 |
my $renewalsallowed = $input->param('renewalsallowed'); |
266 |
my $unseen_renewals_allowed = $input->param('unseen_renewals_allowed'); |
266 |
my $unseen_renewals_allowed = defined $input->param('unseen_renewals_allowed') ? strip_non_numeric( scalar $input->param('unseen_renewals_allowed') ) : q{}; |
267 |
my $renewalperiod = $input->param('renewalperiod'); |
267 |
my $renewalperiod = $input->param('renewalperiod'); |
268 |
my $norenewalbefore = $input->param('norenewalbefore'); |
268 |
my $norenewalbefore = $input->param('norenewalbefore'); |
269 |
$norenewalbefore = '' if $norenewalbefore =~ /^\s*$/; |
269 |
$norenewalbefore = q{} if $norenewalbefore =~ /^\s*$/; |
270 |
my $auto_renew = $input->param('auto_renew') eq 'yes' ? 1 : 0; |
270 |
my $auto_renew = $input->param('auto_renew') eq 'yes' ? 1 : 0; |
271 |
my $no_auto_renewal_after = $input->param('no_auto_renewal_after'); |
271 |
my $no_auto_renewal_after = $input->param('no_auto_renewal_after'); |
272 |
$no_auto_renewal_after = '' if $no_auto_renewal_after =~ /^\s*$/; |
272 |
$no_auto_renewal_after = q{} if $no_auto_renewal_after =~ /^\s*$/; |
273 |
my $no_auto_renewal_after_hard_limit = $input->param('no_auto_renewal_after_hard_limit') || ''; |
273 |
my $no_auto_renewal_after_hard_limit = $input->param('no_auto_renewal_after_hard_limit') || q{}; |
274 |
$no_auto_renewal_after_hard_limit = eval { dt_from_string( scalar $no_auto_renewal_after_hard_limit ) } if ( $no_auto_renewal_after_hard_limit ); |
274 |
$no_auto_renewal_after_hard_limit = eval { dt_from_string( scalar $no_auto_renewal_after_hard_limit ) } if ( $no_auto_renewal_after_hard_limit ); |
275 |
$no_auto_renewal_after_hard_limit = output_pref( { dt => $no_auto_renewal_after_hard_limit, dateonly => 1, dateformat => 'iso' } ) if ( $no_auto_renewal_after_hard_limit ); |
275 |
$no_auto_renewal_after_hard_limit = output_pref( { dt => $no_auto_renewal_after_hard_limit, dateonly => 1, dateformat => 'iso' } ) if ( $no_auto_renewal_after_hard_limit ); |
276 |
my $reservesallowed = strip_non_numeric( scalar $input->param('reservesallowed') ); |
276 |
my $reservesallowed = strip_non_numeric( scalar $input->param('reservesallowed') ); |
277 |
my $holds_per_record = strip_non_numeric( scalar $input->param('holds_per_record') ); |
277 |
my $holds_per_record = strip_non_numeric( scalar $input->param('holds_per_record') ); |
278 |
my $holds_per_day = strip_non_numeric( scalar $input->param('holds_per_day') ); |
278 |
my $holds_per_day = strip_non_numeric( scalar $input->param('holds_per_day') ); |
279 |
my $onshelfholds = $input->param('onshelfholds') || 0; |
279 |
my $onshelfholds = $input->param('onshelfholds') || 0; |
280 |
my $issuelength = $input->param('issuelength'); |
280 |
my $issuelength = $input->param('issuelength') || 0; |
281 |
$issuelength = $issuelength eq q{} ? undef : $issuelength; |
|
|
282 |
my $daysmode = $input->param('daysmode'); |
281 |
my $daysmode = $input->param('daysmode'); |
283 |
my $lengthunit = $input->param('lengthunit'); |
282 |
my $lengthunit = $input->param('lengthunit'); |
284 |
my $hardduedate = $input->param('hardduedate') || undef; |
283 |
my $hardduedate = $input->param('hardduedate') || q{}; |
285 |
$hardduedate = eval { dt_from_string( scalar $hardduedate ) } if ( $hardduedate ); |
284 |
$hardduedate = eval { dt_from_string( scalar $hardduedate ) } if ( $hardduedate ); |
286 |
$hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate ); |
285 |
$hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate ); |
287 |
my $hardduedatecompare = $input->param('hardduedatecompare'); |
286 |
my $hardduedatecompare = $input->param('hardduedatecompare'); |
288 |
my $rentaldiscount = $input->param('rentaldiscount'); |
287 |
my $rentaldiscount = $input->param('rentaldiscount') || 0; |
289 |
my $opacitemholds = $input->param('opacitemholds') || 0; |
288 |
my $opacitemholds = $input->param('opacitemholds') || 0; |
290 |
my $article_requests = $input->param('article_requests') || 'no'; |
289 |
my $article_requests = $input->param('article_requests') || 'no'; |
291 |
my $overduefinescap = $input->param('overduefinescap') || ''; |
290 |
my $overduefinescap = $input->param('overduefinescap') || q{}; |
292 |
my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || '') eq 'on'; |
291 |
my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || q{}) eq 'on'; |
293 |
my $note = $input->param('note'); |
292 |
my $note = $input->param('note'); |
294 |
my $decreaseloanholds = $input->param('decreaseloanholds') || undef; |
293 |
my $decreaseloanholds = $input->param('decreaseloanholds') || q{}; |
295 |
my $recalls_allowed = $input->param('recalls_allowed'); |
294 |
my $recalls_allowed = $input->param('recalls_allowed'); |
296 |
my $recalls_per_record = $input->param('recalls_per_record'); |
295 |
my $recalls_per_record = $input->param('recalls_per_record'); |
297 |
my $on_shelf_recalls = $input->param('on_shelf_recalls'); |
296 |
my $on_shelf_recalls = $input->param('on_shelf_recalls'); |
Lines 481-487
elsif ( $op eq "add-open-article-requests-limit" ) {
Link Here
|
481 |
|
480 |
|
482 |
Koha::Exception->throw("No value passed for article request limit") |
481 |
Koha::Exception->throw("No value passed for article request limit") |
483 |
if not defined $open_article_requests_limit # There is a JS check for that |
482 |
if not defined $open_article_requests_limit # There is a JS check for that |
484 |
|| $open_article_requests_limit eq ''; |
483 |
|| $open_article_requests_limit eq q{}; |
485 |
|
484 |
|
486 |
if ( $branch eq "*" ) { |
485 |
if ( $branch eq "*" ) { |
487 |
if ( $categorycode eq "*" ) { |
486 |
if ( $categorycode eq "*" ) { |
Lines 555-561
elsif ( $op eq "set-article-request-fee" ) {
Link Here
|
555 |
|
554 |
|
556 |
Koha::Exception->throw("No value passed for article request fee") |
555 |
Koha::Exception->throw("No value passed for article request fee") |
557 |
if not defined $fee # There is a JS check for that |
556 |
if not defined $fee # There is a JS check for that |
558 |
|| $fee eq ''; |
557 |
|| $fee eq q{}; |
559 |
|
558 |
|
560 |
Koha::CirculationRules->set_rules( |
559 |
Koha::CirculationRules->set_rules( |
561 |
{ categorycode => ( $category eq '*' ) ? undef : $category, |
560 |
{ categorycode => ( $category eq '*' ) ? undef : $category, |
Lines 713-719
my $definedbranch = $all_rules->count ? 1 : 0;
Link Here
|
713 |
my $rules = {}; |
712 |
my $rules = {}; |
714 |
while ( my $r = $all_rules->next ) { |
713 |
while ( my $r = $all_rules->next ) { |
715 |
$r = $r->unblessed; |
714 |
$r = $r->unblessed; |
716 |
$rules->{ $r->{categorycode} // '' }->{ $r->{itemtype} // '' }->{ $r->{rule_name} } = $r->{rule_value}; |
715 |
$rules->{ $r->{categorycode} // q{} }->{ $r->{itemtype} // q{} }->{ $r->{rule_name} } = $r->{rule_value}; |
717 |
} |
716 |
} |
718 |
|
717 |
|
719 |
$template->param(show_branch_cat_rule_form => 1); |
718 |
$template->param(show_branch_cat_rule_form => 1); |
Lines 763-768
sub by_itemtype {
Link Here
|
763 |
sub strip_non_numeric { |
762 |
sub strip_non_numeric { |
764 |
my $string = shift; |
763 |
my $string = shift; |
765 |
$string =~ s/\s//g; |
764 |
$string =~ s/\s//g; |
766 |
$string = '' if $string !~ /^\d+/; |
765 |
$string = q{} if $string !~ /^\d+/; |
767 |
return $string; |
766 |
return $string; |
768 |
} |
767 |
} |