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

(-)a/Koha/Template/Plugin/CirculationRules.pm (+20 lines)
Lines 42-45 sub Get { Link Here
42
    return $rule->rule_value if $rule;
42
    return $rule->rule_value if $rule;
43
}
43
}
44
44
45
sub Search {
46
    my ( $self, $branchcode, $categorycode, $itemtype, $rule_name ) = @_;
47
48
    $branchcode   = undef if $branchcode eq q{}   or $branchcode eq q{*};
49
    $categorycode = undef if $categorycode eq q{} or $branchcode eq q{*};
50
    $itemtype     = undef if $itemtype eq q{}     or $branchcode eq q{*};
51
52
    my $rule = Koha::CirculationRules->search(
53
        {
54
            branchcode   => $branchcode,
55
            categorycode => $categorycode,
56
            itemtype     => $itemtype,
57
            rule_name    => $rule_name,
58
        }
59
    )->next;
60
61
    return $rule->rule_value if $rule;
62
}
63
64
45
1;
65
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-2 / +1 lines)
Lines 399-405 Link Here
399
                    <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty | html %]"/></td>
399
                    <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty | html %]"/></td>
400
                    <td><input type="text" name="maxonsiteissueqty" size="3" value="[% default_maxonsiteissueqty | html %]"/></td>
400
                    <td><input type="text" name="maxonsiteissueqty" size="3" value="[% default_maxonsiteissueqty | html %]"/></td>
401
                    <td>
401
                    <td>
402
                        [% SET rule_value = CirculationRules.Get( current_branch, '*', undef, 'max_holds' ) %]
402
                        [% SET rule_value = CirculationRules.Search( current_branch, undef, undef, 'max_holds' ) %]
403
                        <input name="max_holds" size="3" value="[% rule_value | html %]" />
403
                        <input name="max_holds" size="3" value="[% rule_value | html %]" />
404
                    </td>
404
                    </td>
405
                    <td>
405
                    <td>
406
- 

Return to bug 22847