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

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 429-435 sub CanItemBeReserved { Link Here
429
            rule_name    => 'max_holds',
429
            rule_name    => 'max_holds',
430
        }
430
        }
431
    );
431
    );
432
    if ( $rule ) {
432
    if ( $rule && defined( $rule->rule_value ) && $rule->rule_value ne '' ) {
433
        my $total_holds_count = Koha::Holds->search(
433
        my $total_holds_count = Koha::Holds->search(
434
            {
434
            {
435
                borrowernumber => $borrower->{borrowernumber}
435
                borrowernumber => $borrower->{borrowernumber}
(-)a/admin/smart-rules.pl (-1 / +1 lines)
Lines 232-238 elsif ($op eq "set-branch-defaults") { Link Here
232
    $holdallowed =~ s/\s//g;
232
    $holdallowed =~ s/\s//g;
233
    $holdallowed = undef if $holdallowed !~ /^\d+/;
233
    $holdallowed = undef if $holdallowed !~ /^\d+/;
234
    $max_holds =~ s/\s//g;
234
    $max_holds =~ s/\s//g;
235
    $max_holds = undef if $max_holds !~ /^\d+/;
235
    $max_holds = '' if $max_holds !~ /^\d+/;
236
236
237
    if ($branch eq "*") {
237
    if ($branch eq "*") {
238
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
238
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
(-)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 520-526 Link Here
520
                        </td>
520
                        </td>
521
                        <td>
521
                        <td>
522
                            [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode, branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %]
522
                            [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode, branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %]
523
                            [% IF rule_value  %]
523
                            [% IF rule_value.defined && rule_value != '' %]
524
                                [% rule_value %]
524
                                [% rule_value %]
525
                            [% ELSE %]
525
                            [% ELSE %]
526
                                Unlimited
526
                                Unlimited
527
- 

Return to bug 18887