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

(-)a/admin/smart-rules.pl (-74 / +2 lines)
Lines 548-639 $template->param( Link Here
548
548
549
my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description'] });
549
my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description'] });
550
550
551
my @row_loop;
552
my $itemtypes = Koha::ItemTypes->search_with_localization;
551
my $itemtypes = Koha::ItemTypes->search_with_localization;
553
552
554
my $sth2 = $dbh->prepare("
553
my $issuing_rules = Koha::IssuingRules->search({ branchcode => $branch });
555
    SELECT  issuingrules.*,
556
            itemtypes.description AS humanitemtype,
557
            categories.description AS humancategorycode,
558
            COALESCE( localization.translation, itemtypes.description ) AS translated_description
559
    FROM issuingrules
560
    LEFT JOIN itemtypes
561
        ON (itemtypes.itemtype = issuingrules.itemtype)
562
    LEFT JOIN categories
563
        ON (categories.categorycode = issuingrules.categorycode)
564
    LEFT JOIN localization ON issuingrules.itemtype = localization.code
565
        AND localization.entity = 'itemtypes'
566
        AND localization.lang = ?
567
    WHERE issuingrules.branchcode = ?
568
");
569
$sth2->execute($language, $branch);
570
571
while (my $row = $sth2->fetchrow_hashref) {
572
    $row->{'current_branch'} ||= $row->{'branchcode'};
573
    $row->{humanitemtype} ||= $row->{itemtype};
574
    $row->{default_translated_description} = 1 if $row->{humanitemtype} eq '*';
575
    $row->{'humancategorycode'} ||= $row->{'categorycode'};
576
    $row->{'default_humancategorycode'} = 1 if $row->{'humancategorycode'} eq '*';
577
    $row->{'fine'} = sprintf('%.2f', $row->{'fine'});
578
    if ($row->{'hardduedate'} && $row->{'hardduedate'} ne '0000-00-00') {
579
       my $harddue_dt = eval { dt_from_string( $row->{'hardduedate'} ) };
580
       $row->{'hardduedate'} = eval { output_pref( { dt => $harddue_dt, dateonly => 1 } ) } if ( $harddue_dt );
581
       $row->{'hardduedatebefore'} = 1 if ($row->{'hardduedatecompare'} == -1);
582
       $row->{'hardduedateexact'} = 1 if ($row->{'hardduedatecompare'} ==  0);
583
       $row->{'hardduedateafter'} = 1 if ($row->{'hardduedatecompare'} ==  1);
584
    } else {
585
       $row->{'hardduedate'} = 0;
586
    }
587
    if ($row->{no_auto_renewal_after_hard_limit}) {
588
       my $dt = eval { dt_from_string( $row->{no_auto_renewal_after_hard_limit} ) };
589
       $row->{no_auto_renewal_after_hard_limit} = eval { output_pref( { dt => $dt, dateonly => 1 } ) } if $dt;
590
    }
591
592
    push @row_loop, $row;
593
}
594
595
my @sorted_row_loop = sort by_category_and_itemtype @row_loop;
596
554
597
$template->param(show_branch_cat_rule_form => 1);
555
$template->param(show_branch_cat_rule_form => 1);
598
556
599
$template->param(
557
$template->param(
600
    patron_categories => $patron_categories,
558
    patron_categories => $patron_categories,
601
                        itemtypeloop => $itemtypes,
559
                        itemtypeloop => $itemtypes,
602
                        rules => \@sorted_row_loop,
560
                        rules => $issuing_rules,
603
                        humanbranch => ($branch ne '*' ? $branch : ''),
561
                        humanbranch => ($branch ne '*' ? $branch : ''),
604
                        current_branch => $branch,
562
                        current_branch => $branch,
605
                        definedbranch => scalar(@sorted_row_loop)>0
606
                        );
563
                        );
607
output_html_with_http_headers $input, $cookie, $template->output;
564
output_html_with_http_headers $input, $cookie, $template->output;
608
565
609
exit 0;
566
exit 0;
610
567
611
# sort by patron category, then item type, putting
612
# default entries at the bottom
613
sub by_category_and_itemtype {
614
    unless (by_category($a, $b)) {
615
        return by_itemtype($a, $b);
616
    }
617
}
618
619
sub by_category {
620
    my ($a, $b) = @_;
621
    if ($a->{'default_humancategorycode'}) {
622
        return ($b->{'default_humancategorycode'} ? 0 : 1);
623
    } elsif ($b->{'default_humancategorycode'}) {
624
        return -1;
625
    } else {
626
        return $a->{'humancategorycode'} cmp $b->{'humancategorycode'};
627
    }
628
}
629
630
sub by_itemtype {
631
    my ($a, $b) = @_;
632
    if ($a->{default_translated_description}) {
633
        return ($b->{'default_translated_description'} ? 0 : 1);
634
    } elsif ($b->{'default_translated_description'}) {
635
        return -1;
636
    } else {
637
        return lc $a->{'translated_description'} cmp lc $b->{'translated_description'};
638
    }
639
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-214 / +235 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-262 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>
133
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>
134
                                                        <td>
176
                        </td>
135
                                                            [% IF rule.note %]
177
136
                                                                <a name="viewnote" data-toggle="popover" title="Note" data-content="[% rule.note | html %]" data-placement="top" data-trigger="hover">View note</a>
178
                        <td>
137
                                                            [% ELSE %]&nbsp;[% END %]
179
                            [% IF rule.note %]
138
                                                        </td>
180
                                <a name="viewnote" data-toggle="popover" title="Note" data-content="[% rule.note | html %]" data-placement="top" data-trigger="hover">View note</a>
139
                            <td>
181
                            [% ELSE %]&nbsp;[% END %]
140
                                [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxissueqty' ) %]
182
                        </td>
141
                                [% IF rule_value || rule_value == "0"  %]
183
                        <td>
142
                                    [% rule_value | html %]
184
                            [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxissueqty' ) %]
143
                                [% ELSE %]
185
                            [% IF rule_value  || rule_value == "0" %]
144
                                    <span>Unlimited</span>
186
                                [% rule_value | html %]
145
                                [% END %]
187
                            [% ELSE %]
146
                            </td>
188
                                <span>Unlimited</span>
147
                            <td>
189
                            [% END %]
148
                                [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxonsiteissueqty' ) %]
190
                        </td>
149
                                [% IF rule_value || rule_value == "0" %]
191
                        <td>
150
                                    [% rule_value | html %]
192
                            [% SET rule_value = CirculationRules.Get( rule.branchcode, rule.categorycode, rule.itemtype, 'maxonsiteissueqty' ) %]
151
                                [% ELSE %]
193
                            [% IF rule_value || rule_value == "0" %]
152
                                    <span>Unlimited</span>
194
                                [% rule_value | html %]
153
                                [% END %]
195
                            [% ELSE %]
154
                            </td>
196
                                <span>Unlimited</span>
155
                            <td>[% rule.issuelength | html %]</td>
197
                            [% END %]
156
                            <td>
198
                        </td>
157
                                [% IF ( rule.lengthunit == 'days' ) %]
199
                        <td>[% rule.issuelength | html %]</td>
158
                                    Days
200
                        <td>
159
                                [% ELSIF ( rule.lengthunit == 'hours') %]
201
                            [% IF ( rule.lengthunit == 'days' ) %]
160
                                    Hours
202
                                Days
161
                                [% ELSE %]
203
                            [% ELSIF ( rule.lengthunit == 'hours') %]
162
                                    Undefined
204
                                Hours
163
                                [% END %]
205
                            [% ELSE %]
164
                            </td>
206
                                Undefined
165
                            <td>
207
                            [% END %]
166
                              [% IF ( rule.hardduedate ) %]
208
                        </td>
167
                                [% IF ( rule.hardduedatebefore ) %]
209
                        <td>
168
                                  before [% rule.hardduedate | html %]
210
                          [% IF ( rule.hardduedate ) %]
169
                                  <input type="hidden" name="hardduedatecomparebackup" value="-1" />
211
                            [% IF ( rule.hardduedatecompare < 0 ) %]
170
                                [% ELSIF ( rule.hardduedateexact ) %]
212
                              before [% rule.hardduedate | $KohaDates %]
171
                                  on [% rule.hardduedate | html %]
213
                              <input type="hidden" name="hardduedatecomparebackup" value="-1" />
172
                                  <input type="hidden" name="hardduedatecomparebackup" value="0" />
214
                            [% ELSIF ( rule.hardduedatecompare == 0 ) %]
173
                                [% ELSIF ( rule.hardduedateafter ) %]
215
                              on [% rule.hardduedate | $KohaDates %]
174
                                  after [% rule.hardduedate | html %]
216
                              <input type="hidden" name="hardduedatecomparebackup" value="0" />
175
                                  <input type="hidden" name="hardduedatecomparebackup" value="1" />
217
                            [% ELSIF ( rule.hardduedatecompare > 1 ) %]
176
                                [% END %]
218
                              after [% rule.hardduedate | $KohaDates %]
177
                              [% ELSE %]
219
                              <input type="hidden" name="hardduedatecomparebackup" value="1" />
178
                                <span>None defined</span>
220
                            [% END %]
179
                              [% END %]
221
                          [% ELSE %]
180
                            </td>
222
                            <span>None defined</span>
181
							<td>[% rule.fine | html %]</td>
223
                          [% END %]
182
							<td>[% rule.chargeperiod | html %]</td>
224
                        </td>
183
                            <td>
225
                        <td>[% rule.fine FILTER format("%.2f") %]</td>
184
                                [% IF rule.chargeperiod_charge_at %]
226
                        <td>[% rule.chargeperiod | html %]</td>
185
                                    <span>Start of interval</span>
227
                        <td>
186
                                [% ELSE %]
228
                            [% IF rule.chargeperiod_charge_at %]
187
                                    <span>End of interval</span>
229
                                <span>Start of interval</span>
188
                                [% END %]
230
                            [% ELSE %]
189
                            </td>
231
                                <span>End of interval</span>
190
							<td>[% rule.firstremind | html %]</td>
232
                            [% END %]
191
                            <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
233
                        </td>
192
                            <td>
234
                        <td>[% rule.firstremind | html %]</td>
193
                                [% IF rule.cap_fine_to_replacement_price %]
235
                        <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
194
                                    <input type="checkbox" checked="checked" disabled="disabled" />
236
                        <td>
195
                                [% ELSE %]
237
                            [% IF rule.cap_fine_to_replacement_price %]
196
                                    <input type="checkbox" disabled="disabled" />
238
                                <input type="checkbox" checked="checked" disabled="disabled" />
197
                                [% END %]
239
                            [% ELSE %]
198
                            </td>
240
                                <input type="checkbox" disabled="disabled" />
199
							<td>[% rule.finedays | html %]</td>
241
                            [% END %]
200
                            <td>[% rule.maxsuspensiondays | html %]</td>
242
                        </td>
201
                            <td>[% rule.suspension_chargeperiod | html %]</td>
243
                        <td>[% rule.finedays | html %]</td>
202
							<td>[% rule.renewalsallowed | html %]</td>
244
                        <td>[% rule.maxsuspensiondays | html %]</td>
203
                            <td>[% rule.renewalperiod | html %]</td>
245
                        <td>[% rule.suspension_chargeperiod | html %]</td>
204
                            <td>[% rule.norenewalbefore | html %]</td>
246
                        <td>[% rule.renewalsallowed | html %]</td>
205
                            <td>
247
                        <td>[% rule.renewalperiod | html %]</td>
206
                                [% IF ( rule.auto_renew ) %]
248
                        <td>[% rule.norenewalbefore | html %]</td>
207
                                    <span>Yes</span>
249
                        <td>
208
                                [% ELSE %]
250
                            [% IF ( rule.auto_renew ) %]
209
                                    <span>No</span>
251
                                <span>Yes</span>
210
                                [% END %]
252
                            [% ELSE %]
211
                            </td>
253
                                <span>No</span>
212
                            <td>[% rule.no_auto_renewal_after | html %]</td>
254
                            [% END %]
213
                            <td>[% rule.no_auto_renewal_after_hard_limit | html %]</td>
255
                        </td>
214
							<td>[% rule.reservesallowed | html %]</td>
256
                        <td>[% rule.no_auto_renewal_after | html %]</td>
215
                            <td>[% IF rule.unlimited_holds_per_day %]
257
                        <td>[% rule.no_auto_renewal_after_hard_limit | $KohaDates %]</td>
216
                                    <span>Unlimited</span>
258
                        <td>[% rule.reservesallowed | html %]</td>
217
                                [% ELSE %]
259
                        <td>[% IF NOT rule.holds_per_day.defined %]
218
                                    [% rule.holds_per_day | html %]
260
                                <span>Unlimited</span>
219
                                [% END %]
261
                            [% ELSE %]
220
                            </td>
262
                                [% rule.holds_per_day | html %]
221
                            <td>[% rule.holds_per_record | html %]</td>
263
                            [% END %]
222
                                                        <td>
264
                        </td>
223
                                                            [% IF rule.onshelfholds == 1 %]
265
                        <td>[% rule.holds_per_record | html %]</td>
224
                                                                <span>Yes</span>
266
                        <td>
225
                                                            [% ELSIF rule.onshelfholds == 2 %]
267
                            [% IF rule.onshelfholds == 1 %]
226
                                                                <span>If all unavailable</span>
268
                                <span>Yes</span>
227
                                                            [% ELSE %]
269
                            [% ELSIF rule.onshelfholds == 2 %]
228
                                                                <span>If any unavailable</span>
270
                                <span>If all unavailable</span>
229
                                                            [% END %]
271
                            [% ELSE %]
230
                                                        </td>
272
                                <span>If any unavailable</span>
231
                                                        <td>
273
                            [% END %]
232
                                                            [% IF rule.opacitemholds == 'F'%]
274
                        </td>
233
                                                                <span>Force</span>
275
                        <td>
234
                                                            [% ELSIF rule.opacitemholds == 'Y'%]
276
                            [% IF rule.opacitemholds == 'F'%]
235
                                                                <span>Allow</span>
277
                                <span>Force</span>
236
                                                            [% ELSE %]
278
                            [% ELSIF rule.opacitemholds == 'Y'%]
237
                                                                <span>Don't allow</span>
279
                                <span>Allow</span>
238
                                                            [% END %]
280
                            [% ELSE %]
239
                                                        </td>
281
                                <span>Don't allow</span>
240
                                                        <td>
282
                            [% END %]
241
                                                            [% IF rule.article_requests == 'no' %]
283
                        </td>
242
                                                                <span>No</span>
284
                        <td>
243
                                                            [% ELSIF rule.article_requests == 'yes' %]
285
                            [% IF rule.article_requests == 'no' %]
244
                                                                <span>Yes</span>
286
                                <span>No</span>
245
                                                            [% ELSIF rule.article_requests == 'bib_only' %]
287
                            [% ELSIF rule.article_requests == 'yes' %]
246
                                                                <span>Record only</span>
288
                                <span>Yes</span>
247
                                                            [% ELSIF rule.article_requests == 'item_only' %]
289
                            [% ELSIF rule.article_requests == 'bib_only' %]
248
                                                                <span>Item only</span>
290
                                <span>Record only</span>
249
                                                            [% END %]
291
                            [% ELSIF rule.article_requests == 'item_only' %]
250
                                                        </td>
292
                                <span>Item only</span>
251
                                                        <td>[% rule.rentaldiscount | html %]</td>
293
                            [% END %]
252
                                                        <td class="actions">
294
                        </td>
253
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
295
                        <td>[% rule.rentaldiscount | html %]</td>
254
                                                          <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>
296
                        <td class="actions">
255
                                                        </td>
297
                            <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
256
298
                            <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>
257
                	</tr>
299
                        </td>
258
            	[% END %]
300
301
                    </tr>
302
                [% END %]
259
                <tr id="edit_row">
303
                <tr id="edit_row">
304
                    <td>2</td>
260
                    <td>
305
                    <td>
261
                        <select name="categorycode" id="categorycode">
306
                        <select name="categorycode" id="categorycode">
262
                            <option value="*">All</option>
307
                            <option value="*">All</option>
Lines 265-270 Link Here
265
                        [% END %]
310
                        [% END %]
266
                        </select>
311
                        </select>
267
                    </td>
312
                    </td>
313
                    <td>0</td>
268
                    <td>
314
                    <td>
269
                        <select name="itemtype" id="matrixitemtype" style="width:13em;">
315
                        <select name="itemtype" id="matrixitemtype" style="width:13em;">
270
                            <option value="*">All</option>
316
                            <option value="*">All</option>
Lines 357-398 Link Here
357
                        <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
403
                        <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button>
358
                    </td>
404
                    </td>
359
                </tr>
405
                </tr>
360
                <tfoot>
361
                    <tr>
362
                      <th>Patron category</th>
363
                      <th>Item type</th>
364
                      <th>&nbsp;</th>
365
                      <th>Note</th>
366
                      <th>Current checkouts allowed</th>
367
                      <th>Current on-site checkouts allowed</th>
368
                      <th>Loan period</th>
369
                      <th>Unit</th>
370
                      <th>Hard due date</th>
371
                      <th>Fine amount</th>
372
                      <th>Fine charging interval</th>
373
                      <th>Charge when?</th>
374
                      <th>Fine grace period</th>
375
                      <th>Overdue fines cap (amount)</th>
376
                      <th>Cap fine at replacement price</th>
377
                      <th>Suspension in days (day)</th>
378
                      <th>Max. suspension duration (day)</th>
379
                      <th>Suspension charging interval</th>
380
                      <th>Renewals allowed (count)</th>
381
                      <th>Renewal period</th>
382
                      <th>No renewal before</th>
383
                      <th>Automatic renewal</th>
384
                      <th>No automatic renewal after</th>
385
                      <th>No automatic renewal after (hard limit)</th>
386
                      <th>Holds allowed (total)</th>
387
                      <th>Holds allowed (daily)</th>
388
                      <th>Holds per record (count)</th>
389
                      <th>On shelf holds allowed</th>
390
                      <th>Item level holds</th>
391
                      <th>Article requests</th>
392
                      <th>Rental discount (%)</th>
393
                      <th>&nbsp;</th>
394
                    </tr>
395
                  </tfoot>
396
                </tbody>
406
                </tbody>
397
            </table>
407
            </table>
398
        </form>
408
        </form>
Lines 824-831 Link Here
824
834
825
[% MACRO jsinclude BLOCK %]
835
[% MACRO jsinclude BLOCK %]
826
    [% Asset.js("js/admin-menu.js") | $raw %]
836
    [% Asset.js("js/admin-menu.js") | $raw %]
837
    [% INCLUDE 'datatables.inc' %]
827
    [% INCLUDE 'calendar.inc' %]
838
    [% INCLUDE 'calendar.inc' %]
828
    <script>
839
    <script>
840
        $(document).ready(function() {
841
            $("#default-circulation-rules").dataTable($.extend(true,{},dataTablesDefaults, {
842
                "aoColumnDefs": [
843
                      { "bVisible": false, "aTargets": [ 0,2 ] },
844
                      { "bSortable": false, "aTargets": ["_all"] }
845
                ],
846
                "aaSortingFixed": [ [0,'asc'], [1,'asc'], [2,'asc'], [3,'asc'] ],
847
                "bPaginate": false,
848
                "bAutoWidth": false
849
            }));
850
        });
829
851
830
        function clear_edit(){
852
        function clear_edit(){
831
            var cancel = confirm(_("Are you sure you want to cancel your changes?"));
853
            var cancel = confirm(_("Are you sure you want to cancel your changes?"));
832
- 

Return to bug 21946