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

(-)a/admin/smart-rules.pl (-1 / +8 lines)
Lines 576-582 my $itemtypes = Koha::ItemTypes->search_with_localization; Link Here
576
576
577
my $humanbranch = ( $branch ne '*' ? $branch : undef );
577
my $humanbranch = ( $branch ne '*' ? $branch : undef );
578
578
579
my $definedbranch = Koha::CirculationRules->search({ branchcode => $humanbranch })->count ? 1 : 0;
579
my $all_rules = Koha::CirculationRules->search({ branchcode => $humanbranch });
580
my $definedbranch = $all_rules->count ? 1 : 0;
581
582
while ( my $r = $all_rules->next ) {
583
    $r = $r->unblessed;
584
    $rules->{ $r->{categorycode} }->{ $r->{itemtype} }->{ $r->{rule_name} } = $r->{rule_value};
585
}
580
586
581
$template->param(show_branch_cat_rule_form => 1);
587
$template->param(show_branch_cat_rule_form => 1);
582
588
Lines 586-591 $template->param( Link Here
586
    humanbranch       => $humanbranch,
592
    humanbranch       => $humanbranch,
587
    current_branch    => $branch,
593
    current_branch    => $branch,
588
    definedbranch     => $definedbranch,
594
    definedbranch     => $definedbranch,
595
    all_rules         => $rules,
589
);
596
);
590
output_html_with_http_headers $input, $cookie, $template->output;
597
output_html_with_http_headers $input, $cookie, $template->output;
591
598
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-30 / +31 lines)
Lines 123-158 Link Here
123
            <tbody>
123
            <tbody>
124
                [% SET row_count = 0 %]
124
                [% SET row_count = 0 %]
125
                [% FOREACH c IN categorycodes %]
125
                [% FOREACH c IN categorycodes %]
126
                    [% SET c = '' UNLESS c.defined %]
126
                    [% FOREACH i IN itemtypes %]
127
                    [% FOREACH i IN itemtypes %]
127
                        [% SET note = CirculationRules.Search( branchcode, c, i, 'note' ) %]
128
                        [% SET i = '' UNLESS i.defined %]
128
                        [% SET maxissueqty = CirculationRules.Search( branchcode, c, i, 'maxissueqty' ) %]
129
                        [% SET note = all_rules.$c.$i.note %]
129
                        [% SET maxonsiteissueqty = CirculationRules.Search( branchcode, c, i, 'maxonsiteissueqty' ) %]
130
                        [% SET maxissueqty = all_rules.$c.$i.maxissueqty %]
130
                        [% SET issuelength = CirculationRules.Search( branchcode, c, i, 'issuelength' ) %]
131
                        [% SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %]
131
                        [% SET lengthunit = CirculationRules.Search( branchcode, c, i, 'lengthunit' ) %]
132
                        [% SET issuelength = all_rules.$c.$i.issuelength %]
132
                        [% SET hardduedate = CirculationRules.Search( branchcode, c, i, 'hardduedate' ) %]
133
                        [% SET lengthunit = all_rules.$c.$i.lengthunit %]
133
                        [% SET hardduedatecompare = CirculationRules.Search( branchcode, c, i, 'hardduedatecompare' ) %]
134
                        [% SET hardduedate = all_rules.$c.$i.hardduedate %]
134
                        [% SET fine = CirculationRules.Search( branchcode, c, i, 'fine' ) %]
135
                        [% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %]
135
                        [% SET chargeperiod = CirculationRules.Search( branchcode, c, i, 'chargeperiod' ) %]
136
                        [% SET fine = all_rules.$c.$i.fine %]
136
                        [% SET chargeperiod_charge_at = CirculationRules.Search( branchcode, c, i, 'chargeperiod_charge_at' ) %]
137
                        [% SET chargeperiod = all_rules.$c.$i.chargeperiod %]
137
                        [% SET firstremind = CirculationRules.Search( branchcode, c, i, 'firstremind' ) %]
138
                        [% SET chargeperiod_charge_at = all_rules.$c.$i.chargeperiod_charge_at %]
138
                        [% SET overduefinescap = CirculationRules.Search( branchcode, c, i, 'overduefinescap' ) %]
139
                        [% SET firstremind = all_rules.$c.$i.firstremind %]
139
                        [% SET cap_fine_to_replacement_price = CirculationRules.Search( branchcode, c, i, 'cap_fine_to_replacement_price' ) %]
140
                        [% SET overduefinescap = all_rules.$c.$i.overduefinescap %]
140
                        [% SET finedays = CirculationRules.Search( branchcode, c, i, 'finedays' ) %]
141
                        [% SET cap_fine_to_replacement_price = all_rules.$c.$i.cap_fine_to_replacement_price %]
141
                        [% SET maxsuspensiondays = CirculationRules.Search( branchcode, c, i, 'maxsuspensiondays' ) %]
142
                        [% SET finedays = all_rules.$c.$i.finedays %]
142
                        [% SET suspension_chargeperiod = CirculationRules.Search( branchcode, c, i, 'suspension_chargeperiod' ) %]
143
                        [% SET maxsuspensiondays = all_rules.$c.$i.maxsuspensiondays %]
143
                        [% SET renewalsallowed = CirculationRules.Search( branchcode, c, i, 'renewalsallowed' ) %]
144
                        [% SET suspension_chargeperiod = all_rules.$c.$i.suspension_chargeperiod %]
144
                        [% SET renewalperiod = CirculationRules.Search( branchcode, c, i, 'renewalperiod' ) %]
145
                        [% SET renewalsallowed = all_rules.$c.$i.renewalsallowed %]
145
                        [% SET norenewalbefore = CirculationRules.Search( branchcode, c, i, 'norenewalbefore' ) %]
146
                        [% SET renewalperiod = all_rules.$c.$i.renewalperiod %]
146
                        [% SET auto_renew = CirculationRules.Search( branchcode, c, i, 'auto_renew' ) %]
147
                        [% SET norenewalbefore = all_rules.$c.$i.norenewalbefore %]
147
                        [% SET no_auto_renewal_after = CirculationRules.Search( branchcode, c, i, 'no_auto_renewal_after' ) %]
148
                        [% SET auto_renew = all_rules.$c.$i.auto_renew %]
148
                        [% SET no_auto_renewal_after_hard_limit = CirculationRules.Search( branchcode, c, i, 'no_auto_renewal_after_hard_limit' ) %]
149
                        [% SET no_auto_renewal_after = all_rules.$c.$i.no_auto_renewal_after %]
149
                        [% SET reservesallowed = CirculationRules.Search( branchcode, c, i, 'reservesallowed' ) %]
150
                        [% SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.no_auto_renewal_after_hard_limit %]
150
                        [% SET holds_per_day = CirculationRules.Search( branchcode, c, i, 'holds_per_day' ) %]
151
                        [% SET reservesallowed = all_rules.$c.$i.reservesallowed %]
151
                        [% SET holds_per_record = CirculationRules.Search( branchcode, c, i, 'holds_per_record' ) %]
152
                        [% SET holds_per_day = all_rules.$c.$i.holds_per_day %]
152
                        [% SET onshelfholds = CirculationRules.Search( branchcode, c, i, 'onshelfholds' ) %]
153
                        [% SET holds_per_record = all_rules.$c.$i.holds_per_record %]
153
                        [% SET opacitemholds = CirculationRules.Search( branchcode, c, i, 'opacitemholds' ) %]
154
                        [% SET onshelfholds = all_rules.$c.$i.onshelfholds %]
154
                        [% SET article_requests = CirculationRules.Search( branchcode, c, i, 'article_requests' ) %]
155
                        [% SET opacitemholds = all_rules.$c.$i.opacitemholds %]
155
                        [% SET rentaldiscount = CirculationRules.Search( branchcode, c, i, 'rentaldiscount' ) %]
156
                        [% SET article_requests = all_rules.$c.$i.article_requests %]
157
                        [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %]
156
158
157
                        [% SET show_rule = maxissueqty || maxonsiteissueqty || issuelength || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %]
159
                        [% SET show_rule = maxissueqty || maxonsiteissueqty || issuelength || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %]
158
                        [% IF show_rule %]
160
                        [% IF show_rule %]
159
- 

Return to bug 24670