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

(-)a/Koha/Template/Plugin/Branches.pm (+13 lines)
Lines 105-108 sub pickup_locations { Link Here
105
    return $libraries;
105
    return $libraries;
106
}
106
}
107
107
108
sub HasCirculationRules {
109
    my ( $self, $branchcode) = @_;
110
111
    $branchcode   = undef if $branchcode eq q{};
112
    
113
    my @rules = Koha::CirculationRules->search(
114
        {
115
            branchcode   => $branchcode
116
        }
117
    );
118
119
    return scalar(@rules) > 1;
120
}
108
1;
121
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-5 / +6 lines)
Lines 397-402 Link Here
397
        <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
397
        <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
398
            <input type="hidden" name="op" value="set-branch-defaults" />
398
            <input type="hidden" name="op" value="set-branch-defaults" />
399
            <input type="hidden" name="branch" value="[% current_branch | html %]"/>
399
            <input type="hidden" name="branch" value="[% current_branch | html %]"/>
400
            
400
            <table>
401
            <table>
401
                <tr>
402
                <tr>
402
                    <th>&nbsp;</th>
403
                    <th>&nbsp;</th>
Lines 409-414 Link Here
409
                    <th>Actions</th>
410
                    <th>Actions</th>
410
                </tr>
411
                </tr>
411
                <tr>
412
                <tr>
413
                    [% SET default_rules = Branches.HasCirculationRules( branchcode ) %]
412
                    <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
414
                    <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
413
                    <td>
415
                    <td>
414
                        [% SET patron_maxissueqty = CirculationRules.Get( branchcode, undef, undef, 'patron_maxissueqty' ) %]
416
                        [% SET patron_maxissueqty = CirculationRules.Get( branchcode, undef, undef, 'patron_maxissueqty' ) %]
Lines 419-430 Link Here
419
                        <input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxonsiteissueqty | html %]"/>
421
                        <input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxonsiteissueqty | html %]"/>
420
                    </td>
422
                    </td>
421
                    <td>
423
                    <td>
422
                        [% SET rule_value = CirculationRules.Get( current_branch, '*', undef, 'max_holds' ) %]
424
                        [% SET rule_value = CirculationRules.Get( branchcode, '*', undef, 'max_holds' ) %]
423
                        <input name="max_holds" size="3" value="[% rule_value | html %]" />
425
                        <input name="max_holds" size="3" value="[% rule_value | html %]" />
424
                    </td>
426
                    </td>
425
                    <td>
427
                    <td>
426
                        <select name="holdallowed">
428
                        <select name="holdallowed">
427
                            [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed' ) %]
429
                            [% SET holdallowed = CirculationRules.Search( branchcode, undef, undef, 'holdallowed' ) %]
428
                            <option value="">
430
                            <option value="">
429
                                Not set
431
                                Not set
430
                            </option>
432
                            </option>
Lines 456-462 Link Here
456
                    </td>
458
                    </td>
457
                    <td>
459
                    <td>
458
                        <select name="hold_fulfillment_policy">
460
                        <select name="hold_fulfillment_policy">
459
                            [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy' ) %]
461
                            [% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, undef, 'hold_fulfillment_policy' ) %]
460
462
461
                            <option value="">
463
                            <option value="">
462
                                Not set
464
                                Not set
Lines 495-501 Link Here
495
                    </td>
497
                    </td>
496
                    <td>
498
                    <td>
497
                        <select name="returnbranch">
499
                        <select name="returnbranch">
498
                            [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch' ) %]
500
                            [% SET returnbranch = CirculationRules.Search( branchcode, undef, undef, 'returnbranch' ) %]
499
501
500
                            <option value="">
502
                            <option value="">
501
                                Not set
503
                                Not set
502
- 

Return to bug 18928