View | Details | Raw Unified | Return to bug 18925
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{};
49
    $categorycode = undef if $categorycode eq q{};
50
    $itemtype     = undef if $itemtype 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 (-7 / +5 lines)
Lines 533-541 Link Here
533
                    <th>&nbsp;</th>
533
                    <th>&nbsp;</th>
534
                </tr>
534
                </tr>
535
                [% FOREACH c IN categorycodes %]
535
                [% FOREACH c IN categorycodes %]
536
                    [% SET patron_maxissueqty = CirculationRules.Get( branchcode, c, undef, 'patron_maxissueqty' ) %]
536
                    [% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %]
537
                    [% SET patron_maxonsiteissueqty = CirculationRules.Get( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %]
537
                    [% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %]
538
                    [% SET max_holds = CirculationRules.Get( branchcode, c, undef, 'max_holds' ) %]
538
                    [% SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %]
539
539
540
                    [% IF patron_maxissueqty || patron_maxonsiteissueqty || max_holds %]
540
                    [% IF patron_maxissueqty || patron_maxonsiteissueqty || max_holds %]
541
                    <tr>
541
                    <tr>
Lines 561-569 Link Here
561
                            [% END %]
561
                            [% END %]
562
                        </td>
562
                        </td>
563
                        <td>
563
                        <td>
564
                            [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode || '*', branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %]
564
                            [% IF max_holds.defined && max_holds != '' %]
565
                            [% IF rule_value.defined && rule_value != '' %]
565
                                [% max_holds | html %]
566
                                [% rule_value | html %]
567
                            [% ELSE %]
566
                            [% ELSE %]
568
                                <span>Unlimited</span>
567
                                <span>Unlimited</span>
569
                            [% END %]
568
                            [% END %]
570
- 

Return to bug 18925