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 (-1 / +3 lines)
Lines 226-232 elsif ($op eq "set-branch-defaults") { Link Here
226
    $holdallowed =~ s/\s//g;
226
    $holdallowed =~ s/\s//g;
227
    $holdallowed = undef if $holdallowed !~ /^\d+/;
227
    $holdallowed = undef if $holdallowed !~ /^\d+/;
228
    $max_holds =~ s/\s//g;
228
    $max_holds =~ s/\s//g;
229
    $max_holds = undef if $max_holds !~ /^\d+/;
229
    $max_holds = '' if $max_holds !~ /^\d+/;
230
230
231
    if ($branch eq "*") {
231
    if ($branch eq "*") {
232
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
232
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
Lines 280-285 elsif ($op eq "add-branch-cat") { Link Here
280
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
280
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
281
    $maxonsiteissueqty =~ s/\s//g;
281
    $maxonsiteissueqty =~ s/\s//g;
282
    $maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/;
282
    $maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/;
283
    $max_holds =~ s/\s//g;
284
    $max_holds = '' if $max_holds !~ /^\d+/;
283
285
284
    if ($branch eq "*") {
286
    if ($branch eq "*") {
285
        if ($categorycode eq "*") {
287
        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 498-504 Link Here
498
                        </td>
498
                        </td>
499
                        <td>
499
                        <td>
500
                            [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode, branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %]
500
                            [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode, branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %]
501
                            [% IF rule_value  %]
501
                            [% IF rule_value.defined && rule_value != '' %]
502
                                [% rule_value %]
502
                                [% rule_value %]
503
                            [% ELSE %]
503
                            [% ELSE %]
504
                                Unlimited
504
                                Unlimited
505
- 

Return to bug 18887