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 3-8 Link Here
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE Categories %]
5
[% USE Categories %]
6
[% USE KohaDates %]
7
[% USE ItemTypes %]
6
[% USE CirculationRules %]
8
[% USE CirculationRules %]
7
[% SET footerjs = 1 %]
9
[% SET footerjs = 1 %]
8
10
Lines 59-65 Link Here
59
                    [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch, unfiltered => 1 ) %]
61
                    [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch, unfiltered => 1 ) %]
60
                </select>
62
                </select>
61
            </form>
63
            </form>
62
            [% IF ( definedbranch ) %]
64
            [% IF ( rules.count ) %]
63
                <form action="/cgi-bin/koha/admin/clone-rules.pl" method="post">
65
                <form action="/cgi-bin/koha/admin/clone-rules.pl" method="post">
64
                    <label for="tobranch"><strong>Clone these rules to:</strong></label>
66
                    <label for="tobranch"><strong>Clone these rules to:</strong></label>
65
                    <input type="hidden" name="frombranch" value="[% current_branch | html %]" />
67
                    <input type="hidden" name="frombranch" value="[% current_branch | html %]" />
Lines 76-256 Link Here
76
            <input type="hidden" name="branch" value="[% current_branch | html %]"/>
78
            <input type="hidden" name="branch" value="[% current_branch | html %]"/>
77
            <table id="default-circulation-rules">
79
            <table id="default-circulation-rules">
78
            <thead>
80
            <thead>
79
            <tr>
81
                <tr>
80
                <th>Patron category</th>
82
                    <th>&nbsp;</th>
81
                <th>Item type</th>
83
                    <th>Patron category</th>
82
                <th>Actions</th>
84
                    <th>&nbsp;</th>
83
                <th>Note</th>
85
                    <th>Item type</th>
84
                <th>Current checkouts allowed</th>
86
                    <th>Actions</th>
85
                <th>Current on-site checkouts allowed</th>
87
                    <th>Note</th>
86
                <th>Loan period</th>
88
                    <th>Current checkouts allowed</th>
87
                <th>Unit</th>
89
                    <th>Current on-site checkouts allowed</th>
88
                <th>Hard due date</th>
90
                    <th>Loan period</th>
89
                <th>Fine amount</th>
91
                    <th>Unit</th>
90
                <th>Fine charging interval</th>
92
                    <th>Hard due date</th>
91
                <th>When to charge</th>
93
                    <th>Fine amount</th>
92
                <th>Fine grace period</th>
94
                    <th>Fine charging interval</th>
93
                <th>Overdue fines cap (amount)</th>
95
                    <th>When to charge</th>
94
                <th>Cap fine at replacement price</th>
96
                    <th>Fine grace period</th>
95
                <th>Suspension in days (day)</th>
97
                    <th>Overdue fines cap (amount)</th>
96
                <th>Max. suspension duration (day)</th>
98
                    <th>Cap fine at replacement price</th>
97
                <th>Suspension charging interval</th>
99
                    <th>Suspension in days (day)</th>
98
                <th>Renewals allowed (count)</th>
100
                    <th>Max. suspension duration (day)</th>
99
                <th>Renewal period</th>
101
                    <th>Suspension charging interval</th>
100
                <th>No renewal before</th>
102
                    <th>Renewals allowed (count)</th>
101
                <th>Automatic renewal</th>
103
                    <th>Renewal period</th>
102
                <th>No automatic renewal after</th>
104
                    <th>No renewal before</th>
103
                <th>No automatic renewal after (hard limit)</th>
105
                    <th>Automatic renewal</th>
104
                <th>Holds allowed (total)</th>
106
                    <th>No automatic renewal after</th>
105
                <th>Holds allowed (daily)</th>
107
                    <th>No automatic renewal after (hard limit)</th>
106
                <th>Holds per record (count)</th>
108
                    <th>Holds allowed (total)</th>
107
                <th>On shelf holds allowed</th>
109
                    <th>Holds allowed (daily)</th>
108
                <th>Item level holds</th>
110
                    <th>Holds per record (count)</th>
109
                <th>Article requests</th>
111
                    <th>On shelf holds allowed</th>
110
                <th>Rental discount (%)</th>
112
                    <th>Item level holds</th>
111
                <th>Actions</th>
113
                    <th>Article requests</th>
112
            </tr>
114
                    <th>Rental discount (%)</th>
115
                    <th>Actions</th>
116
                </tr>
113
            </thead>
117
            </thead>
118
            <tfoot>
119
                <tr>
120
                    <th>&nbsp;</th>
121
                    <th>Patron category</th>
122
                    <th>&nbsp;</th>
123
                    <th>Item type</th>
124
                    <th>&nbsp;</th>
125
                    <th>Note</th>
126
                    <th>Current checkouts allowed</th>
127
                    <th>Current on-site checkouts allowed</th>
128
                    <th>Loan period</th>
129
                    <th>Unit</th>
130
                    <th>Hard due date</th>
131
                    <th>Fine amount</th>
132
                    <th>Fine charging interval</th>
133
                    <th>Charge when?</th>
134
                    <th>Fine grace period</th>
135
                    <th>Overdue fines cap (amount)</th>
136
                    <th>Cap fine at replacement price</th>
137
                    <th>Suspension in days (day)</th>
138
                    <th>Max. suspension duration (day)</th>
139
                    <th>Suspension charging interval</th>
140
                    <th>Renewals allowed (count)</th>
141
                    <th>Renewal period</th>
142
                    <th>No renewal before</th>
143
                    <th>Automatic renewal</th>
144
                    <th>No automatic renewal after</th>
145
                    <th>No automatic renewal after (hard limit)</th>
146
                    <th>Holds allowed (total)</th>
147
                    <th>Holds allowed (daily)</th>
148
                    <th>Holds per record (count)</th>
149
                    <th>On shelf holds allowed</th>
150
                    <th>Item level holds</th>
151
                    <th>Article requests</th>
152
                    <th>Rental discount (%)</th>
153
                    <th>&nbsp;</th>
154
                </tr>
155
              </tfoot>
114
            <tbody>
156
            <tbody>
115
				[% FOREACH rule IN rules %]
157
				[% FOREACH rule IN rules %]
116
					<tr id="row_[% loop.count | html %]">
158
					<tr id="row_[% loop.count | html %]">
117
							<td>[% IF ( rule.default_humancategorycode ) %]
159
                        <td>[% IF ( rule.categorycode == '*' ) %]1[% ELSE %]0[% END %]</td>
118
									<em>All</em>
160
                        <td>[% IF ( rule.categorycode == '*' ) %]
119
								[% ELSE %]
161
                                <em>All</em>
120
									[% rule.humancategorycode | html %]
162
                            [% ELSE %]
121
								[% END %]
163
                                [% Categories.GetName(rule.categorycode) | html %]
122
							</td>
164
                            [% END %]
123
                            <td>[% IF rule.default_translated_description %]
165
                        </td>
124
									<em>All</em>
166
                        <td>[% IF ( rule.itemtype == '*' ) %]1[% ELSE %]0[% END %]</td>
125
								[% ELSE %]
167
                        <td>[% IF rule.itemtype == '*' %]
126
									[% rule.translated_description | html %]
168
                                <em>All</em>
127
								[% END %]
169
                            [% ELSE %]
128
							</td>
170
                                [% ItemTypes.GetDescription(rule.itemtype) | html %]
129
                                                        <td class="actions">
171
                            [% END %]
130
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
172
                        </td>
131
                                                          <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>
173
                        <td class="actions">
132
                                                        </td>
174
                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
175
                          <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>
176
                        </td>
133
177
134
                                                        <td>
178
                        <td>
135
                                                            [% IF rule.note %]
179
                            [% IF rule.note %]
136
                                                                <a name="viewnote" data-toggle="popover" title="Note" data-content="[% rule.note | html %]" data-placement="top" data-trigger="hover">View note</a>
180
                                <a name="viewnote" data-toggle="popover" title="Note" data-content="[% rule.note | html %]" data-placement="top" data-trigger="hover">View note</a>
137
                                                            [% ELSE %]&nbsp;[% END %]
181
                            [% ELSE %]&nbsp;[% END %]
138
                                                        </td>
182
                        </td>
139
                            <td>
183
                        <td>
140
                                [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxissueqty' ) %]
184
                            [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxissueqty' ) %]
141
                                [% IF rule_value  %]
185
                            [% IF rule_value  %]
142
                                    [% rule_value | html %]
186
                                [% rule_value | html %]
143
                                [% ELSE %]
187
                            [% ELSE %]
144
                                    <span>Unlimited</span>
188
                                <span>Unlimited</span>
145
                                [% END %]
189
                            [% END %]
146
                            </td>
190
                        </td>
147
                            <td>
191
                        <td>
148
                                [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxonsiteissueqty' ) %]
192
                            [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxonsiteissueqty' ) %]
149
                                [% IF rule_value  %]
193
                            [% IF rule_value  %]
150
                                    [% rule_value | html %]
194
                                [% rule_value | html %]
151
                                [% ELSE %]
195
                            [% ELSE %]
152
                                    <span>Unlimited</span>
196
                                <span>Unlimited</span>
153
                                [% END %]
197
                            [% END %]
154
                            </td>
198
                        </td>
155
                            <td>[% rule.issuelength | html %]</td>
199
                        <td>[% rule.issuelength | html %]</td>
156
                            <td>
200
                        <td>
157
                                [% rule.lengthunit | html %]
201
                            [% rule.lengthunit | html %]
158
                            </td>
202
                        </td>
159
                            <td>
203
                        <td>
160
                              [% IF ( rule.hardduedate ) %]
204
                          [% IF ( rule.hardduedate ) %]
161
                                [% IF ( rule.hardduedatebefore ) %]
205
                            [% IF ( rule.hardduedatecompare < 0 ) %]
162
                                  before [% rule.hardduedate | html %]
206
                              before [% rule.hardduedate | $KohaDates %]
163
                                  <input type="hidden" name="hardduedatecomparebackup" value="-1" />
207
                              <input type="hidden" name="hardduedatecomparebackup" value="-1" />
164
                                [% ELSIF ( rule.hardduedateexact ) %]
208
                            [% ELSIF ( rule.hardduedatecompare == 0 ) %]
165
                                  on [% rule.hardduedate | html %]
209
                              on [% rule.hardduedate | $KohaDates %]
166
                                  <input type="hidden" name="hardduedatecomparebackup" value="0" />
210
                              <input type="hidden" name="hardduedatecomparebackup" value="0" />
167
                                [% ELSIF ( rule.hardduedateafter ) %]
211
                            [% ELSIF ( rule.hardduedatecompare > 1 ) %]
168
                                  after [% rule.hardduedate | html %]
212
                              after [% rule.hardduedate | $KohaDates %]
169
                                  <input type="hidden" name="hardduedatecomparebackup" value="1" />
213
                              <input type="hidden" name="hardduedatecomparebackup" value="1" />
170
                                [% END %]
214
                            [% END %]
171
                              [% ELSE %]
215
                          [% ELSE %]
172
                                <span>None defined</span>
216
                            <span>None defined</span>
173
                              [% END %]
217
                          [% END %]
174
                            </td>
218
                        </td>
175
							<td>[% rule.fine | html %]</td>
219
                        <td>[% rule.fine FILTER format("%.2f") %]</td>
176
							<td>[% rule.chargeperiod | html %]</td>
220
                        <td>[% rule.chargeperiod | html %]</td>
177
                            <td>
221
                        <td>
178
                                [% IF rule.chargeperiod_charge_at %]
222
                            [% IF rule.chargeperiod_charge_at %]
179
                                    <span>Start of interval</span>
223
                                <span>Start of interval</span>
180
                                [% ELSE %]
224
                            [% ELSE %]
181
                                    <span>End of interval</span>
225
                                <span>End of interval</span>
182
                                [% END %]
226
                            [% END %]
183
                            </td>
227
                        </td>
184
							<td>[% rule.firstremind | html %]</td>
228
                        <td>[% rule.firstremind | html %]</td>
185
                            <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
229
                        <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
186
                            <td>
230
                        <td>
187
                                [% IF rule.cap_fine_to_replacement_price %]
231
                            [% IF rule.cap_fine_to_replacement_price %]
188
                                    <input type="checkbox" checked="checked" disabled="disabled" />
232
                                <input type="checkbox" checked="checked" disabled="disabled" />
189
                                [% ELSE %]
233
                            [% ELSE %]
190
                                    <input type="checkbox" disabled="disabled" />
234
                                <input type="checkbox" disabled="disabled" />
191
                                [% END %]
235
                            [% END %]
192
                            </td>
236
                        </td>
193
							<td>[% rule.finedays | html %]</td>
237
                        <td>[% rule.finedays | html %]</td>
194
                            <td>[% rule.maxsuspensiondays | html %]</td>
238
                        <td>[% rule.maxsuspensiondays | html %]</td>
195
                            <td>[% rule.suspension_chargeperiod | html %]</td>
239
                        <td>[% rule.suspension_chargeperiod | html %]</td>
196
							<td>[% rule.renewalsallowed | html %]</td>
240
                        <td>[% rule.renewalsallowed | html %]</td>
197
                            <td>[% rule.renewalperiod | html %]</td>
241
                        <td>[% rule.renewalperiod | html %]</td>
198
                            <td>[% rule.norenewalbefore | html %]</td>
242
                        <td>[% rule.norenewalbefore | html %]</td>
199
                            <td>
243
                        <td>
200
                                [% IF ( rule.auto_renew ) %]
244
                            [% IF ( rule.auto_renew ) %]
201
                                    <span>Yes</span>
245
                                <span>Yes</span>
202
                                [% ELSE %]
246
                            [% ELSE %]
203
                                    <span>No</span>
247
                                <span>No</span>
204
                                [% END %]
248
                            [% END %]
205
                            </td>
249
                        </td>
206
                            <td>[% rule.no_auto_renewal_after | html %]</td>
250
                        <td>[% rule.no_auto_renewal_after | html %]</td>
207
                            <td>[% rule.no_auto_renewal_after_hard_limit | html %]</td>
251
                        <td>[% rule.no_auto_renewal_after_hard_limit | $KohaDates %]</td>
208
							<td>[% rule.reservesallowed | html %]</td>
252
                        <td>[% rule.reservesallowed | html %]</td>
209
                            <td>[% IF rule.unlimited_holds_per_day %]
253
                        <td>[% IF NOT rule.holds_per_day.defined %]
210
                                    <span>Unlimited</span>
254
                                <span>Unlimited</span>
211
                                [% ELSE %]
255
                            [% ELSE %]
212
                                    [% rule.holds_per_day | html %]
256
                                [% rule.holds_per_day | html %]
213
                                [% END %]
257
                            [% END %]
214
                            </td>
258
                        </td>
215
                            <td>[% rule.holds_per_record | html %]</td>
259
                        <td>[% rule.holds_per_record | html %]</td>
216
                                                        <td>
260
                        <td>
217
                                                            [% IF rule.onshelfholds == 1 %]
261
                            [% IF rule.onshelfholds == 1 %]
218
                                                                <span>Yes</span>
262
                                <span>Yes</span>
219
                                                            [% ELSIF rule.onshelfholds == 2 %]
263
                            [% ELSIF rule.onshelfholds == 2 %]
220
                                                                <span>If all unavailable</span>
264
                                <span>If all unavailable</span>
221
                                                            [% ELSE %]
265
                            [% ELSE %]
222
                                                                <span>If any unavailable</span>
266
                                <span>If any unavailable</span>
223
                                                            [% END %]
267
                            [% END %]
224
                                                        </td>
268
                        </td>
225
                                                        <td>
269
                        <td>
226
                                                            [% IF rule.opacitemholds == 'F'%]
270
                            [% IF rule.opacitemholds == 'F'%]
227
                                                                <span>Force</span>
271
                                <span>Force</span>
228
                                                            [% ELSIF rule.opacitemholds == 'Y'%]
272
                            [% ELSIF rule.opacitemholds == 'Y'%]
229
                                                                <span>Allow</span>
273
                                <span>Allow</span>
230
                                                            [% ELSE %]
274
                            [% ELSE %]
231
                                                                <span>Don't allow</span>
275
                                <span>Don't allow</span>
232
                                                            [% END %]
276
                            [% END %]
233
                                                        </td>
277
                        </td>
234
                                                        <td>
278
                        <td>
235
                                                            [% IF rule.article_requests == 'no' %]
279
                            [% IF rule.article_requests == 'no' %]
236
                                                                <span>No</span>
280
                                <span>No</span>
237
                                                            [% ELSIF rule.article_requests == 'yes' %]
281
                            [% ELSIF rule.article_requests == 'yes' %]
238
                                                                <span>Yes</span>
282
                                <span>Yes</span>
239
                                                            [% ELSIF rule.article_requests == 'bib_only' %]
283
                            [% ELSIF rule.article_requests == 'bib_only' %]
240
                                                                <span>Record only</span>
284
                                <span>Record only</span>
241
                                                            [% ELSIF rule.article_requests == 'item_only' %]
285
                            [% ELSIF rule.article_requests == 'item_only' %]
242
                                                                <span>Item only</span>
286
                                <span>Item only</span>
243
                                                            [% END %]
287
                            [% END %]
244
                                                        </td>
288
                        </td>
245
                                                        <td>[% rule.rentaldiscount | html %]</td>
289
                        <td>[% rule.rentaldiscount | html %]</td>
246
                                                        <td class="actions">
290
                        <td class="actions">
247
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
291
                            <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
248
                                                          <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>
292
                            <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>
249
                                                        </td>
293
                        </td>
250
294
251
                	</tr>
295
                    </tr>
252
            	[% END %]
296
                [% END %]
253
                <tr id="edit_row">
297
                <tr id="edit_row">
298
                    <td>2</td>
254
                    <td>
299
                    <td>
255
                        <select name="categorycode" id="categorycode">
300
                        <select name="categorycode" id="categorycode">
256
                            <option value="*">All</option>
301
                            <option value="*">All</option>
Lines 259-264 Link Here
259
                        [% END %]
304
                        [% END %]
260
                        </select>
305
                        </select>
261
                    </td>
306
                    </td>
307
                    <td>0</td>
262
                    <td>
308
                    <td>
263
                        <select name="itemtype" id="matrixitemtype" style="width:13em;">
309
                        <select name="itemtype" id="matrixitemtype" style="width:13em;">
264
                            <option value="*">All</option>
310
                            <option value="*">All</option>
Lines 351-392 Link Here
351
                        <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
397
                        <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
352
                    </td>
398
                    </td>
353
                </tr>
399
                </tr>
354
                <tfoot>
355
                    <tr>
356
                      <th>Patron category</th>
357
                      <th>Item type</th>
358
                      <th>&nbsp;</th>
359
                      <th>Note</th>
360
                      <th>Current checkouts allowed</th>
361
                      <th>Current on-site checkouts allowed</th>
362
                      <th>Loan period</th>
363
                      <th>Unit</th>
364
                      <th>Hard due date</th>
365
                      <th>Fine amount</th>
366
                      <th>Fine charging interval</th>
367
                      <th>Charge when?</th>
368
                      <th>Fine grace period</th>
369
                      <th>Overdue fines cap (amount)</th>
370
                      <th>Cap fine at replacement price</th>
371
                      <th>Suspension in days (day)</th>
372
                      <th>Max. suspension duration (day)</th>
373
                      <th>Suspension charging interval</th>
374
                      <th>Renewals allowed (count)</th>
375
                      <th>Renewal period</th>
376
                      <th>No renewal before</th>
377
                      <th>Automatic renewal</th>
378
                      <th>No automatic renewal after</th>
379
                      <th>No automatic renewal after (hard limit)</th>
380
                      <th>Holds allowed (total)</th>
381
                      <th>Holds allowed (daily)</th>
382
                      <th>Holds per record (count)</th>
383
                      <th>On shelf holds allowed</th>
384
                      <th>Item level holds</th>
385
                      <th>Article requests</th>
386
                      <th>Rental discount (%)</th>
387
                      <th>&nbsp;</th>
388
                    </tr>
389
                  </tfoot>
390
                </tbody>
400
                </tbody>
391
            </table>
401
            </table>
392
        </form>
402
        </form>
Lines 799-806 Link Here
799
809
800
[% MACRO jsinclude BLOCK %]
810
[% MACRO jsinclude BLOCK %]
801
    [% Asset.js("js/admin-menu.js") | $raw %]
811
    [% Asset.js("js/admin-menu.js") | $raw %]
812
    [% INCLUDE 'datatables.inc' %]
802
    [% INCLUDE 'calendar.inc' %]
813
    [% INCLUDE 'calendar.inc' %]
803
    <script>
814
    <script>
815
        $(document).ready(function() {
816
            $("#default-circulation-rules").dataTable($.extend(true,{},dataTablesDefaults, {
817
                "aoColumnDefs": [
818
                      { "bVisible": false, "aTargets": [ 0,2 ] },
819
                      { "bSortable": false, "aTargets": ["_all"] }
820
                ],
821
                "aaSortingFixed": [ [0,'asc'], [1,'asc'], [2,'asc'], [3,'asc'] ],
822
                "bPaginate": false,
823
                "bAutoWidth": false
824
            }));
825
        });
804
826
805
        function clear_edit(){
827
        function clear_edit(){
806
            var cancel = confirm(_("Are you sure you want to cancel your changes?"));
828
            var cancel = confirm(_("Are you sure you want to cancel your changes?"));
807
- 

Return to bug 21946