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

(-)a/admin/smart-rules.pl (-74 / +2 lines)
Lines 504-554 $template->param( Link Here
504
504
505
my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description'] });
505
my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description'] });
506
506
507
my @row_loop;
508
my $itemtypes = Koha::ItemTypes->search_with_localization;
507
my $itemtypes = Koha::ItemTypes->search_with_localization;
509
508
510
my $sth2 = $dbh->prepare("
509
my $issuing_rules = Koha::IssuingRules->search({ branchcode => $branch });
511
    SELECT  issuingrules.*,
512
            itemtypes.description AS humanitemtype,
513
            categories.description AS humancategorycode,
514
            COALESCE( localization.translation, itemtypes.description ) AS translated_description
515
    FROM issuingrules
516
    LEFT JOIN itemtypes
517
        ON (itemtypes.itemtype = issuingrules.itemtype)
518
    LEFT JOIN categories
519
        ON (categories.categorycode = issuingrules.categorycode)
520
    LEFT JOIN localization ON issuingrules.itemtype = localization.code
521
        AND localization.entity = 'itemtypes'
522
        AND localization.lang = ?
523
    WHERE issuingrules.branchcode = ?
524
");
525
$sth2->execute($language, $branch);
526
527
while (my $row = $sth2->fetchrow_hashref) {
528
    $row->{'current_branch'} ||= $row->{'branchcode'};
529
    $row->{humanitemtype} ||= $row->{itemtype};
530
    $row->{default_translated_description} = 1 if $row->{humanitemtype} eq '*';
531
    $row->{'humancategorycode'} ||= $row->{'categorycode'};
532
    $row->{'default_humancategorycode'} = 1 if $row->{'humancategorycode'} eq '*';
533
    $row->{'fine'} = sprintf('%.2f', $row->{'fine'});
534
    if ($row->{'hardduedate'} && $row->{'hardduedate'} ne '0000-00-00') {
535
       my $harddue_dt = eval { dt_from_string( $row->{'hardduedate'} ) };
536
       $row->{'hardduedate'} = eval { output_pref( { dt => $harddue_dt, dateonly => 1 } ) } if ( $harddue_dt );
537
       $row->{'hardduedatebefore'} = 1 if ($row->{'hardduedatecompare'} == -1);
538
       $row->{'hardduedateexact'} = 1 if ($row->{'hardduedatecompare'} ==  0);
539
       $row->{'hardduedateafter'} = 1 if ($row->{'hardduedatecompare'} ==  1);
540
    } else {
541
       $row->{'hardduedate'} = 0;
542
    }
543
    if ($row->{no_auto_renewal_after_hard_limit}) {
544
       my $dt = eval { dt_from_string( $row->{no_auto_renewal_after_hard_limit} ) };
545
       $row->{no_auto_renewal_after_hard_limit} = eval { output_pref( { dt => $dt, dateonly => 1 } ) } if $dt;
546
    }
547
548
    push @row_loop, $row;
549
}
550
551
my @sorted_row_loop = sort by_category_and_itemtype @row_loop;
552
510
553
my $sth_branch_item;
511
my $sth_branch_item;
554
if ($branch eq "*") {
512
if ($branch eq "*") {
Lines 624-664 $template->param(default_rules => ($defaults ? 1 : 0)); Link Here
624
$template->param(
582
$template->param(
625
    patron_categories => $patron_categories,
583
    patron_categories => $patron_categories,
626
                        itemtypeloop => $itemtypes,
584
                        itemtypeloop => $itemtypes,
627
                        rules => \@sorted_row_loop,
585
                        rules => $issuing_rules,
628
                        humanbranch => ($branch ne '*' ? $branch : ''),
586
                        humanbranch => ($branch ne '*' ? $branch : ''),
629
                        current_branch => $branch,
587
                        current_branch => $branch,
630
                        definedbranch => scalar(@sorted_row_loop)>0
631
                        );
588
                        );
632
output_html_with_http_headers $input, $cookie, $template->output;
589
output_html_with_http_headers $input, $cookie, $template->output;
633
590
634
exit 0;
591
exit 0;
635
592
636
# sort by patron category, then item type, putting
637
# default entries at the bottom
638
sub by_category_and_itemtype {
639
    unless (by_category($a, $b)) {
640
        return by_itemtype($a, $b);
641
    }
642
}
643
644
sub by_category {
645
    my ($a, $b) = @_;
646
    if ($a->{'default_humancategorycode'}) {
647
        return ($b->{'default_humancategorycode'} ? 0 : 1);
648
    } elsif ($b->{'default_humancategorycode'}) {
649
        return -1;
650
    } else {
651
        return $a->{'humancategorycode'} cmp $b->{'humancategorycode'};
652
    }
653
}
654
655
sub by_itemtype {
656
    my ($a, $b) = @_;
657
    if ($a->{default_translated_description}) {
658
        return ($b->{'default_translated_description'} ? 0 : 1);
659
    } elsif ($b->{'default_translated_description'}) {
660
        return -1;
661
    } else {
662
        return lc $a->{'translated_description'} cmp lc $b->{'translated_description'};
663
    }
664
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-206 / +227 lines)
Lines 2-7 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE Categories %]
4
[% USE Categories %]
5
[% USE KohaDates %]
6
[% USE ItemTypes %]
5
[% USE CirculationRules %]
7
[% USE CirculationRules %]
6
[% SET footerjs = 1 %]
8
[% SET footerjs = 1 %]
7
9
Lines 58-64 Link Here
58
                    [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch, unfiltered => 1 ) %]
60
                    [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch, unfiltered => 1 ) %]
59
                </select>
61
                </select>
60
            </form>
62
            </form>
61
            [% IF ( definedbranch ) %]
63
            [% IF ( rules.count ) %]
62
                <form action="/cgi-bin/koha/admin/clone-rules.pl" method="post">
64
                <form action="/cgi-bin/koha/admin/clone-rules.pl" method="post">
63
                    <label for="tobranch"><strong>Clone these rules to:</strong></label>
65
                    <label for="tobranch"><strong>Clone these rules to:</strong></label>
64
                    <input type="hidden" name="frombranch" value="[% current_branch | html %]" />
66
                    <input type="hidden" name="frombranch" value="[% current_branch | html %]" />
Lines 75-255 Link Here
75
            <input type="hidden" name="branch" value="[% current_branch | html %]"/>
77
            <input type="hidden" name="branch" value="[% current_branch | html %]"/>
76
            <table id="default-circulation-rules">
78
            <table id="default-circulation-rules">
77
            <thead>
79
            <thead>
78
            <tr>
80
                <tr>
79
                <th>Patron category</th>
81
                    <th>&nbsp;</th>
80
                <th>Item type</th>
82
                    <th>Patron category</th>
81
                <th>Actions</th>
83
                    <th>&nbsp;</th>
82
                <th>Note</th>
84
                    <th>Item type</th>
83
                <th>Current checkouts allowed</th>
85
                    <th>Actions</th>
84
                <th>Current on-site checkouts allowed</th>
86
                    <th>Note</th>
85
                <th>Loan period</th>
87
                    <th>Current checkouts allowed</th>
86
                <th>Unit</th>
88
                    <th>Current on-site checkouts allowed</th>
87
                <th>Hard due date</th>
89
                    <th>Loan period</th>
88
                <th>Fine amount</th>
90
                    <th>Unit</th>
89
                <th>Fine charging interval</th>
91
                    <th>Hard due date</th>
90
                <th>When to charge</th>
92
                    <th>Fine amount</th>
91
                <th>Fine grace period</th>
93
                    <th>Fine charging interval</th>
92
                <th>Overdue fines cap (amount)</th>
94
                    <th>When to charge</th>
93
                <th>Cap fine at replacement price</th>
95
                    <th>Fine grace period</th>
94
                <th>Suspension in days (day)</th>
96
                    <th>Overdue fines cap (amount)</th>
95
                <th>Max. suspension duration (day)</th>
97
                    <th>Cap fine at replacement price</th>
96
                <th>Suspension charging interval</th>
98
                    <th>Suspension in days (day)</th>
97
                <th>Renewals allowed (count)</th>
99
                    <th>Max. suspension duration (day)</th>
98
                <th>Renewal period</th>
100
                    <th>Suspension charging interval</th>
99
                <th>No renewal before</th>
101
                    <th>Renewals allowed (count)</th>
100
                <th>Automatic renewal</th>
102
                    <th>Renewal period</th>
101
                <th>No automatic renewal after</th>
103
                    <th>No renewal before</th>
102
                <th>No automatic renewal after (hard limit)</th>
104
                    <th>Automatic renewal</th>
103
                <th>Holds allowed (total)</th>
105
                    <th>No automatic renewal after</th>
104
                <th>Holds allowed (daily)</th>
106
                    <th>No automatic renewal after (hard limit)</th>
105
                <th>Holds per record (count)</th>
107
                    <th>Holds allowed (total)</th>
106
                <th>On shelf holds allowed</th>
108
                    <th>Holds allowed (daily)</th>
107
                <th>Item level holds</th>
109
                    <th>Holds per record (count)</th>
108
                <th>Article requests</th>
110
                    <th>On shelf holds allowed</th>
109
                <th>Rental discount (%)</th>
111
                    <th>Item level holds</th>
110
                <th>Actions</th>
112
                    <th>Article requests</th>
111
            </tr>
113
                    <th>Rental discount (%)</th>
114
                    <th>Actions</th>
115
                </tr>
112
            </thead>
116
            </thead>
117
            <tfoot>
118
                <tr>
119
                    <th>&nbsp;</th>
120
                    <th>Patron category</th>
121
                    <th>&nbsp;</th>
122
                    <th>Item type</th>
123
                    <th>&nbsp;</th>
124
                    <th>Note</th>
125
                    <th>Current checkouts allowed</th>
126
                    <th>Current on-site checkouts allowed</th>
127
                    <th>Loan period</th>
128
                    <th>Unit</th>
129
                    <th>Hard due date</th>
130
                    <th>Fine amount</th>
131
                    <th>Fine charging interval</th>
132
                    <th>Charge when?</th>
133
                    <th>Fine grace period</th>
134
                    <th>Overdue fines cap (amount)</th>
135
                    <th>Cap fine at replacement price</th>
136
                    <th>Suspension in days (day)</th>
137
                    <th>Max. suspension duration (day)</th>
138
                    <th>Suspension charging interval</th>
139
                    <th>Renewals allowed (count)</th>
140
                    <th>Renewal period</th>
141
                    <th>No renewal before</th>
142
                    <th>Automatic renewal</th>
143
                    <th>No automatic renewal after</th>
144
                    <th>No automatic renewal after (hard limit)</th>
145
                    <th>Holds allowed (total)</th>
146
                    <th>Holds allowed (daily)</th>
147
                    <th>Holds per record (count)</th>
148
                    <th>On shelf holds allowed</th>
149
                    <th>Item level holds</th>
150
                    <th>Article requests</th>
151
                    <th>Rental discount (%)</th>
152
                    <th>&nbsp;</th>
153
                </tr>
154
              </tfoot>
113
            <tbody>
155
            <tbody>
114
				[% FOREACH rule IN rules %]
156
				[% FOREACH rule IN rules %]
115
					<tr id="row_[% loop.count | html %]">
157
					<tr id="row_[% loop.count | html %]">
116
							<td>[% IF ( rule.default_humancategorycode ) %]
158
                        <td>[% IF ( rule.categorycode == '*' ) %]1[% ELSE %]0[% END %]</td>
117
									<em>All</em>
159
                        <td>[% IF ( rule.categorycode == '*' ) %]
118
								[% ELSE %]
160
                                <em>All</em>
119
									[% rule.humancategorycode | html %]
161
                            [% ELSE %]
120
								[% END %]
162
                                [% Categories.GetName(rule.categorycode) | html %]
121
							</td>
163
                            [% END %]
122
                            <td>[% IF rule.default_translated_description %]
164
                        </td>
123
									<em>All</em>
165
                        <td>[% IF ( rule.itemtype == '*' ) %]1[% ELSE %]0[% END %]</td>
124
								[% ELSE %]
166
                        <td>[% IF rule.itemtype == '*' %]
125
									[% rule.translated_description | html %]
167
                                <em>All</em>
126
								[% END %]
168
                            [% ELSE %]
127
							</td>
169
                                [% ItemTypes.GetDescription(rule.itemtype) | html %]
128
                                                        <td class="actions">
170
                            [% END %]
129
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
171
                        </td>
130
                                                          <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype | html %]&amp;categorycode=[% rule.categorycode | html %]&amp;branch=[% rule.current_branch | html %]"><i class="fa fa-trash"></i> Delete</a>
172
                        <td class="actions">
131
                                                        </td>
173
                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
174
                          <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype | html %]&amp;categorycode=[% rule.categorycode | html %]&amp;branch=[% rule.branchcode | html %]"><i class="fa fa-trash"></i> Delete</a>
175
                        </td>
132
176
133
                                                        <td>
177
                        <td>
134
                                                            [% IF rule.note %]
178
                            [% IF rule.note %]
135
                                                                <a name="viewnote" data-toggle="popover" title="Note" data-content="[% rule.note | html %]" data-placement="top" data-trigger="hover">View note</a>
179
                                <a name="viewnote" data-toggle="popover" title="Note" data-content="[% rule.note | html %]" data-placement="top" data-trigger="hover">View note</a>
136
                                                            [% ELSE %]&nbsp;[% END %]
180
                            [% ELSE %]&nbsp;[% END %]
137
                                                        </td>
181
                        </td>
138
                            <td>
182
                        <td>
139
                                [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxissueqty' ) %]
183
                            [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxissueqty' ) %]
140
                                [% IF rule_value  %]
184
                            [% IF rule_value  %]
141
                                    [% rule_value | html %]
185
                                [% rule_value | html %]
142
                                [% ELSE %]
186
                            [% ELSE %]
143
                                    <span>Unlimited</span>
187
                                <span>Unlimited</span>
144
                                [% END %]
188
                            [% END %]
145
                            </td>
189
                        </td>
146
                            <td>
190
                        <td>
147
                                [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxonsiteissueqty' ) %]
191
                            [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxonsiteissueqty' ) %]
148
                                [% IF rule_value  %]
192
                            [% IF rule_value  %]
149
                                    [% rule_value | html %]
193
                                [% rule_value | html %]
150
                                [% ELSE %]
194
                            [% ELSE %]
151
                                    <span>Unlimited</span>
195
                                <span>Unlimited</span>
152
                                [% END %]
196
                            [% END %]
153
                            </td>
197
                        </td>
154
                            <td>[% rule.issuelength | html %]</td>
198
                        <td>[% rule.issuelength | html %]</td>
155
                            <td>
199
                        <td>
156
                                [% rule.lengthunit | html %]
200
                            [% rule.lengthunit | html %]
157
                            </td>
201
                        </td>
158
                            <td>
202
                        <td>
159
                              [% IF ( rule.hardduedate ) %]
203
                          [% IF ( rule.hardduedate ) %]
160
                                [% IF ( rule.hardduedatebefore ) %]
204
                            [% IF ( rule.hardduedatecompare < 0 ) %]
161
                                  before [% rule.hardduedate | html %]
205
                              before [% rule.hardduedate | $KohaDates %]
162
                                  <input type="hidden" name="hardduedatecomparebackup" value="-1" />
206
                              <input type="hidden" name="hardduedatecomparebackup" value="-1" />
163
                                [% ELSIF ( rule.hardduedateexact ) %]
207
                            [% ELSIF ( rule.hardduedatecompare == 0 ) %]
164
                                  on [% rule.hardduedate | html %]
208
                              on [% rule.hardduedate | $KohaDates %]
165
                                  <input type="hidden" name="hardduedatecomparebackup" value="0" />
209
                              <input type="hidden" name="hardduedatecomparebackup" value="0" />
166
                                [% ELSIF ( rule.hardduedateafter ) %]
210
                            [% ELSIF ( rule.hardduedatecompare > 1 ) %]
167
                                  after [% rule.hardduedate | html %]
211
                              after [% rule.hardduedate | $KohaDates %]
168
                                  <input type="hidden" name="hardduedatecomparebackup" value="1" />
212
                              <input type="hidden" name="hardduedatecomparebackup" value="1" />
169
                                [% END %]
213
                            [% END %]
170
                              [% ELSE %]
214
                          [% ELSE %]
171
                                <span>None defined</span>
215
                            <span>None defined</span>
172
                              [% END %]
216
                          [% END %]
173
                            </td>
217
                        </td>
174
							<td>[% rule.fine | html %]</td>
218
                        <td>[% rule.fine FILTER format("%.2f") %]</td>
175
							<td>[% rule.chargeperiod | html %]</td>
219
                        <td>[% rule.chargeperiod | html %]</td>
176
                            <td>
220
                        <td>
177
                                [% IF rule.chargeperiod_charge_at %]
221
                            [% IF rule.chargeperiod_charge_at %]
178
                                    <span>Start of interval</span>
222
                                <span>Start of interval</span>
179
                                [% ELSE %]
223
                            [% ELSE %]
180
                                    <span>End of interval</span>
224
                                <span>End of interval</span>
181
                                [% END %]
225
                            [% END %]
182
                            </td>
226
                        </td>
183
							<td>[% rule.firstremind | html %]</td>
227
                        <td>[% rule.firstremind | html %]</td>
184
                            <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
228
                        <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
185
                            <td>
229
                        <td>
186
                                [% IF rule.cap_fine_to_replacement_price %]
230
                            [% IF rule.cap_fine_to_replacement_price %]
187
                                    <input type="checkbox" checked="checked" disabled="disabled" />
231
                                <input type="checkbox" checked="checked" disabled="disabled" />
188
                                [% ELSE %]
232
                            [% ELSE %]
189
                                    <input type="checkbox" disabled="disabled" />
233
                                <input type="checkbox" disabled="disabled" />
190
                                [% END %]
234
                            [% END %]
191
                            </td>
235
                        </td>
192
							<td>[% rule.finedays | html %]</td>
236
                        <td>[% rule.finedays | html %]</td>
193
                            <td>[% rule.maxsuspensiondays | html %]</td>
237
                        <td>[% rule.maxsuspensiondays | html %]</td>
194
                            <td>[% rule.suspension_chargeperiod | html %]</td>
238
                        <td>[% rule.suspension_chargeperiod | html %]</td>
195
							<td>[% rule.renewalsallowed | html %]</td>
239
                        <td>[% rule.renewalsallowed | html %]</td>
196
                            <td>[% rule.renewalperiod | html %]</td>
240
                        <td>[% rule.renewalperiod | html %]</td>
197
                            <td>[% rule.norenewalbefore | html %]</td>
241
                        <td>[% rule.norenewalbefore | html %]</td>
198
                            <td>
242
                        <td>
199
                                [% IF ( rule.auto_renew ) %]
243
                            [% IF ( rule.auto_renew ) %]
200
                                    <span>Yes</span>
244
                                <span>Yes</span>
201
                                [% ELSE %]
245
                            [% ELSE %]
202
                                    <span>No</span>
246
                                <span>No</span>
203
                                [% END %]
247
                            [% END %]
204
                            </td>
248
                        </td>
205
                            <td>[% rule.no_auto_renewal_after | html %]</td>
249
                        <td>[% rule.no_auto_renewal_after | html %]</td>
206
                            <td>[% rule.no_auto_renewal_after_hard_limit | html %]</td>
250
                        <td>[% rule.no_auto_renewal_after_hard_limit | $KohaDates %]</td>
207
							<td>[% rule.reservesallowed | html %]</td>
251
                        <td>[% rule.reservesallowed | html %]</td>
208
                            <td>[% IF rule.unlimited_holds_per_day %]
252
                        <td>[% IF NOT rule.holds_per_day.defined %]
209
                                    <span>Unlimited</span>
253
                                <span>Unlimited</span>
210
                                [% ELSE %]
254
                            [% ELSE %]
211
                                    [% rule.holds_per_day | html %]
255
                                [% rule.holds_per_day | html %]
212
                                [% END %]
256
                            [% END %]
213
                            </td>
257
                        </td>
214
                            <td>[% rule.holds_per_record | html %]</td>
258
                        <td>[% rule.holds_per_record | html %]</td>
215
                                                        <td>
259
                        <td>
216
                                                            [% IF rule.onshelfholds == 1 %]
260
                            [% IF rule.onshelfholds == 1 %]
217
                                                                <span>Yes</span>
261
                                <span>Yes</span>
218
                                                            [% ELSIF rule.onshelfholds == 2 %]
262
                            [% ELSIF rule.onshelfholds == 2 %]
219
                                                                <span>If all unavailable</span>
263
                                <span>If all unavailable</span>
220
                                                            [% ELSE %]
264
                            [% ELSE %]
221
                                                                <span>If any unavailable</span>
265
                                <span>If any unavailable</span>
222
                                                            [% END %]
266
                            [% END %]
223
                                                        </td>
267
                        </td>
224
                                                        <td>
268
                        <td>
225
                                                            [% IF rule.opacitemholds == 'F'%]
269
                            [% IF rule.opacitemholds == 'F'%]
226
                                                                <span>Force</span>
270
                                <span>Force</span>
227
                                                            [% ELSIF rule.opacitemholds == 'Y'%]
271
                            [% ELSIF rule.opacitemholds == 'Y'%]
228
                                                                <span>Allow</span>
272
                                <span>Allow</span>
229
                                                            [% ELSE %]
273
                            [% ELSE %]
230
                                                                <span>Don't allow</span>
274
                                <span>Don't allow</span>
231
                                                            [% END %]
275
                            [% END %]
232
                                                        </td>
276
                        </td>
233
                                                        <td>
277
                        <td>
234
                                                            [% IF rule.article_requests == 'no' %]
278
                            [% IF rule.article_requests == 'no' %]
235
                                                                <span>No</span>
279
                                <span>No</span>
236
                                                            [% ELSIF rule.article_requests == 'yes' %]
280
                            [% ELSIF rule.article_requests == 'yes' %]
237
                                                                <span>Yes</span>
281
                                <span>Yes</span>
238
                                                            [% ELSIF rule.article_requests == 'bib_only' %]
282
                            [% ELSIF rule.article_requests == 'bib_only' %]
239
                                                                <span>Record only</span>
283
                                <span>Record only</span>
240
                                                            [% ELSIF rule.article_requests == 'item_only' %]
284
                            [% ELSIF rule.article_requests == 'item_only' %]
241
                                                                <span>Item only</span>
285
                                <span>Item only</span>
242
                                                            [% END %]
286
                            [% END %]
243
                                                        </td>
287
                        </td>
244
                                                        <td>[% rule.rentaldiscount | html %]</td>
288
                        <td>[% rule.rentaldiscount | html %]</td>
245
                                                        <td class="actions">
289
                        <td class="actions">
246
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
290
                            <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
247
                                                          <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype | html %]&amp;categorycode=[% rule.categorycode | html %]&amp;branch=[% rule.current_branch | html %]"><i class="fa fa-trash"></i> Delete</a>
291
                            <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype | html %]&amp;categorycode=[% rule.categorycode | html %]&amp;branch=[% rule.branchcode | html %]"><i class="fa fa-trash"></i> Delete</a>
248
                                                        </td>
292
                        </td>
249
293
250
                	</tr>
294
                    </tr>
251
            	[% END %]
295
                [% END %]
252
                <tr id="edit_row">
296
                <tr id="edit_row">
297
                    <td>2</td>
253
                    <td>
298
                    <td>
254
                        <select name="categorycode" id="categorycode">
299
                        <select name="categorycode" id="categorycode">
255
                            <option value="*">All</option>
300
                            <option value="*">All</option>
Lines 258-263 Link Here
258
                        [% END %]
303
                        [% END %]
259
                        </select>
304
                        </select>
260
                    </td>
305
                    </td>
306
                    <td>0</td>
261
                    <td>
307
                    <td>
262
                        <select name="itemtype" id="matrixitemtype" style="width:13em;">
308
                        <select name="itemtype" id="matrixitemtype" style="width:13em;">
263
                            <option value="*">All</option>
309
                            <option value="*">All</option>
Lines 350-391 Link Here
350
                        <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
396
                        <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
351
                    </td>
397
                    </td>
352
                </tr>
398
                </tr>
353
                <tfoot>
354
                    <tr>
355
                      <th>Patron category</th>
356
                      <th>Item type</th>
357
                      <th>&nbsp;</th>
358
                      <th>Note</th>
359
                      <th>Current checkouts allowed</th>
360
                      <th>Current on-site checkouts allowed</th>
361
                      <th>Loan period</th>
362
                      <th>Unit</th>
363
                      <th>Hard due date</th>
364
                      <th>Fine amount</th>
365
                      <th>Fine charging interval</th>
366
                      <th>Charge when?</th>
367
                      <th>Fine grace period</th>
368
                      <th>Overdue fines cap (amount)</th>
369
                      <th>Cap fine at replacement price</th>
370
                      <th>Suspension in days (day)</th>
371
                      <th>Max. suspension duration (day)</th>
372
                      <th>Suspension charging interval</th>
373
                      <th>Renewals allowed (count)</th>
374
                      <th>Renewal period</th>
375
                      <th>No renewal before</th>
376
                      <th>Automatic renewal</th>
377
                      <th>No automatic renewal after</th>
378
                      <th>No automatic renewal after (hard limit)</th>
379
                      <th>Holds allowed (total)</th>
380
                      <th>Holds allowed (daily)</th>
381
                      <th>Holds per record (count)</th>
382
                      <th>On shelf holds allowed</th>
383
                      <th>Item level holds</th>
384
                      <th>Article requests</th>
385
                      <th>Rental discount (%)</th>
386
                      <th>&nbsp;</th>
387
                    </tr>
388
                  </tfoot>
389
                </tbody>
399
                </tbody>
390
            </table>
400
            </table>
391
        </form>
401
        </form>
Lines 798-805 Link Here
798
808
799
[% MACRO jsinclude BLOCK %]
809
[% MACRO jsinclude BLOCK %]
800
    [% Asset.js("js/admin-menu.js") | $raw %]
810
    [% Asset.js("js/admin-menu.js") | $raw %]
811
    [% INCLUDE 'datatables.inc' %]
801
    [% INCLUDE 'calendar.inc' %]
812
    [% INCLUDE 'calendar.inc' %]
802
    <script>
813
    <script>
814
        $(document).ready(function() {
815
            $("#default-circulation-rules").dataTable($.extend(true,{},dataTablesDefaults, {
816
                "aoColumnDefs": [
817
                      { "bVisible": false, "aTargets": [ 0,2 ] },
818
                      { "bSortable": false, "aTargets": ["_all"] }
819
                ],
820
                "aaSortingFixed": [ [0,'asc'], [1,'asc'], [2,'asc'], [3,'asc'] ],
821
                "bPaginate": false,
822
                "bAutoWidth": false
823
            }));
824
        });
803
825
804
        function clear_edit(){
826
        function clear_edit(){
805
            var cancel = confirm(_("Are you sure you want to cancel your changes?"));
827
            var cancel = confirm(_("Are you sure you want to cancel your changes?"));
806
- 

Return to bug 21946