View | Details | Raw Unified | Return to bug 18887
Collapse All | Expand All

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 416-422 sub CanItemBeReserved { Link Here
416
            rule_name    => 'max_holds',
416
            rule_name    => 'max_holds',
417
        }
417
        }
418
    );
418
    );
419
    if ( $rule ) {
419
    if ( $rule && defined( $rule->rule_value ) && $rule->rule_value ne '' ) {
420
        my $total_holds_count = Koha::Holds->search(
420
        my $total_holds_count = Koha::Holds->search(
421
            {
421
            {
422
                borrowernumber => $borrower->{borrowernumber}
422
                borrowernumber => $borrower->{borrowernumber}
(-)a/admin/smart-rules.pl (-2 / +2 lines)
Lines 234-240 elsif ($op eq "set-branch-defaults") { Link Here
234
    $holdallowed =~ s/\s//g;
234
    $holdallowed =~ s/\s//g;
235
    $holdallowed = undef if $holdallowed !~ /^\d+/;
235
    $holdallowed = undef if $holdallowed !~ /^\d+/;
236
    $max_holds =~ s/\s//g;
236
    $max_holds =~ s/\s//g;
237
    $max_holds = undef if $max_holds !~ /^\d+/;
237
    $max_holds = '' if $max_holds !~ /^\d+/;
238
238
239
    if ($branch eq "*") {
239
    if ($branch eq "*") {
240
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
240
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
Lines 290-296 elsif ($op eq "add-branch-cat") { Link Here
290
    $maxonsiteissueqty =~ s/\s//g;
290
    $maxonsiteissueqty =~ s/\s//g;
291
    $maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/;
291
    $maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/;
292
    $max_holds =~ s/\s//g;
292
    $max_holds =~ s/\s//g;
293
    $max_holds = undef if $max_holds !~ /^\d+/;
293
    $max_holds = '' if $max_holds !~ /^\d+/;
294
294
295
    if ($branch eq "*") {
295
    if ($branch eq "*") {
296
        if ($categorycode eq "*") {
296
        if ($categorycode eq "*") {
(-)a/installer/data/mysql/atomicupdate/bug_18887.perl (-2 / +2 lines)
Lines 20-31 if( CheckVersion( $DBversion ) ) { Link Here
20
20
21
    $dbh->do(q{
21
    $dbh->do(q{
22
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
22
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
23
        SELECT branchcode, categorycode, NULL, 'max_holds', max_holds FROM branch_borrower_circ_rules
23
        SELECT branchcode, categorycode, NULL, 'max_holds', COALESCE( max_holds, '' ) FROM branch_borrower_circ_rules
24
    });
24
    });
25
25
26
    $dbh->do(q{
26
    $dbh->do(q{
27
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
27
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
28
        SELECT NULL, categorycode, NULL, 'max_holds', max_holds FROM branch_borrower_circ_rules
28
        SELECT NULL, categorycode, NULL, 'max_holds', COALESCE( max_holds, '' ) FROM default_borrower_circ_rules
29
    });
29
    });
30
30
31
    $dbh->do(q{
31
    $dbh->do(q{
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-2 / +1 lines)
Lines 501-507 Link Here
501
                        </td>
501
                        </td>
502
                        <td>
502
                        <td>
503
                            [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode, branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %]
503
                            [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode, branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %]
504
                            [% IF rule_value  %]
504
                            [% IF rule_value.defined && rule_value != '' %]
505
                                [% rule_value %]
505
                                [% rule_value %]
506
                            [% ELSE %]
506
                            [% ELSE %]
507
                                Unlimited
507
                                Unlimited
508
- 

Return to bug 18887