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

(-)a/admin/smart-rules.pl (-74 / +2 lines)
Lines 508-558 $template->param( Link Here
508
508
509
my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description'] });
509
my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description'] });
510
510
511
my @row_loop;
512
my $itemtypes = Koha::ItemTypes->search_with_localization;
511
my $itemtypes = Koha::ItemTypes->search_with_localization;
513
512
514
my $sth2 = $dbh->prepare("
513
my $issuing_rules = Koha::IssuingRules->search({ branchcode => $branch });
515
    SELECT  issuingrules.*,
516
            itemtypes.description AS humanitemtype,
517
            categories.description AS humancategorycode,
518
            COALESCE( localization.translation, itemtypes.description ) AS translated_description
519
    FROM issuingrules
520
    LEFT JOIN itemtypes
521
        ON (itemtypes.itemtype = issuingrules.itemtype)
522
    LEFT JOIN categories
523
        ON (categories.categorycode = issuingrules.categorycode)
524
    LEFT JOIN localization ON issuingrules.itemtype = localization.code
525
        AND localization.entity = 'itemtypes'
526
        AND localization.lang = ?
527
    WHERE issuingrules.branchcode = ?
528
");
529
$sth2->execute($language, $branch);
530
531
while (my $row = $sth2->fetchrow_hashref) {
532
    $row->{'current_branch'} ||= $row->{'branchcode'};
533
    $row->{humanitemtype} ||= $row->{itemtype};
534
    $row->{default_translated_description} = 1 if $row->{humanitemtype} eq '*';
535
    $row->{'humancategorycode'} ||= $row->{'categorycode'};
536
    $row->{'default_humancategorycode'} = 1 if $row->{'humancategorycode'} eq '*';
537
    $row->{'fine'} = sprintf('%.2f', $row->{'fine'});
538
    if ($row->{'hardduedate'} && $row->{'hardduedate'} ne '0000-00-00') {
539
       my $harddue_dt = eval { dt_from_string( $row->{'hardduedate'} ) };
540
       $row->{'hardduedate'} = eval { output_pref( { dt => $harddue_dt, dateonly => 1 } ) } if ( $harddue_dt );
541
       $row->{'hardduedatebefore'} = 1 if ($row->{'hardduedatecompare'} == -1);
542
       $row->{'hardduedateexact'} = 1 if ($row->{'hardduedatecompare'} ==  0);
543
       $row->{'hardduedateafter'} = 1 if ($row->{'hardduedatecompare'} ==  1);
544
    } else {
545
       $row->{'hardduedate'} = 0;
546
    }
547
    if ($row->{no_auto_renewal_after_hard_limit}) {
548
       my $dt = eval { dt_from_string( $row->{no_auto_renewal_after_hard_limit} ) };
549
       $row->{no_auto_renewal_after_hard_limit} = eval { output_pref( { dt => $dt, dateonly => 1 } ) } if $dt;
550
    }
551
552
    push @row_loop, $row;
553
}
554
555
my @sorted_row_loop = sort by_category_and_itemtype @row_loop;
556
514
557
my $sth_branch_item;
515
my $sth_branch_item;
558
if ($branch eq "*") {
516
if ($branch eq "*") {
Lines 628-668 $template->param(default_rules => ($defaults ? 1 : 0)); Link Here
628
$template->param(
586
$template->param(
629
    patron_categories => $patron_categories,
587
    patron_categories => $patron_categories,
630
                        itemtypeloop => $itemtypes,
588
                        itemtypeloop => $itemtypes,
631
                        rules => \@sorted_row_loop,
589
                        rules => $issuing_rules,
632
                        humanbranch => ($branch ne '*' ? $branch : ''),
590
                        humanbranch => ($branch ne '*' ? $branch : ''),
633
                        current_branch => $branch,
591
                        current_branch => $branch,
634
                        definedbranch => scalar(@sorted_row_loop)>0
635
                        );
592
                        );
636
output_html_with_http_headers $input, $cookie, $template->output;
593
output_html_with_http_headers $input, $cookie, $template->output;
637
594
638
exit 0;
595
exit 0;
639
596
640
# sort by patron category, then item type, putting
641
# default entries at the bottom
642
sub by_category_and_itemtype {
643
    unless (by_category($a, $b)) {
644
        return by_itemtype($a, $b);
645
    }
646
}
647
648
sub by_category {
649
    my ($a, $b) = @_;
650
    if ($a->{'default_humancategorycode'}) {
651
        return ($b->{'default_humancategorycode'} ? 0 : 1);
652
    } elsif ($b->{'default_humancategorycode'}) {
653
        return -1;
654
    } else {
655
        return $a->{'humancategorycode'} cmp $b->{'humancategorycode'};
656
    }
657
}
658
659
sub by_itemtype {
660
    my ($a, $b) = @_;
661
    if ($a->{default_translated_description}) {
662
        return ($b->{'default_translated_description'} ? 0 : 1);
663
    } elsif ($b->{'default_translated_description'}) {
664
        return -1;
665
    } else {
666
        return lc $a->{'translated_description'} cmp lc $b->{'translated_description'};
667
    }
668
}
(-)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