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

(-)a/admin/smart-rules.pl (+3 lines)
Lines 96-101 if ($op eq 'delete') { Link Here
96
                chargeperiod                     => undef,
96
                chargeperiod                     => undef,
97
                chargeperiod_charge_at           => undef,
97
                chargeperiod_charge_at           => undef,
98
                issuelength                      => undef,
98
                issuelength                      => undef,
99
                useDaysMode                      => undef,
99
                lengthunit                       => undef,
100
                lengthunit                       => undef,
100
                hardduedate                      => undef,
101
                hardduedate                      => undef,
101
                hardduedatecompare               => undef,
102
                hardduedatecompare               => undef,
Lines 279-284 elsif ($op eq 'add') { Link Here
279
    my $onshelfholds     = $input->param('onshelfholds') || 0;
280
    my $onshelfholds     = $input->param('onshelfholds') || 0;
280
    my $issuelength  = $input->param('issuelength');
281
    my $issuelength  = $input->param('issuelength');
281
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
282
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
283
    my $useDaysMode = $input->param('useDaysMode');
282
    my $lengthunit  = $input->param('lengthunit');
284
    my $lengthunit  = $input->param('lengthunit');
283
    my $hardduedate = $input->param('hardduedate') || undef;
285
    my $hardduedate = $input->param('hardduedate') || undef;
284
    $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) } if ( $hardduedate );
286
    $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) } if ( $hardduedate );
Lines 304-309 elsif ($op eq 'add') { Link Here
304
        chargeperiod                  => $chargeperiod,
306
        chargeperiod                  => $chargeperiod,
305
        chargeperiod_charge_at        => $chargeperiod_charge_at,
307
        chargeperiod_charge_at        => $chargeperiod_charge_at,
306
        issuelength                   => $issuelength,
308
        issuelength                   => $issuelength,
309
        useDaysMode                   => $useDaysMode,
307
        lengthunit                    => $lengthunit,
310
        lengthunit                    => $lengthunit,
308
        hardduedate                   => $hardduedate,
311
        hardduedate                   => $hardduedate,
309
        hardduedatecompare            => $hardduedatecompare,
312
        hardduedatecompare            => $hardduedatecompare,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-5 / +23 lines)
Lines 130-135 Link Here
130
                        [% SET maxissueqty = all_rules.$c.$i.maxissueqty %]
130
                        [% SET maxissueqty = all_rules.$c.$i.maxissueqty %]
131
                        [% SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %]
131
                        [% SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %]
132
                        [% SET issuelength = all_rules.$c.$i.issuelength %]
132
                        [% SET issuelength = all_rules.$c.$i.issuelength %]
133
                        [% SET useDaysMode = all_rules.$c.$i.useDaysMode %]
133
                        [% SET lengthunit = all_rules.$c.$i.lengthunit %]
134
                        [% SET lengthunit = all_rules.$c.$i.lengthunit %]
134
                        [% SET hardduedate = all_rules.$c.$i.hardduedate %]
135
                        [% SET hardduedate = all_rules.$c.$i.hardduedate %]
135
                        [% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %]
136
                        [% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %]
Lines 156-162 Link Here
156
                        [% SET article_requests = all_rules.$c.$i.article_requests %]
157
                        [% SET article_requests = all_rules.$c.$i.article_requests %]
157
                        [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %]
158
                        [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %]
158
159
159
                        [% SET show_rule = maxissueqty || maxonsiteissueqty || issuelength || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %]
160
                        [% SET show_rule = maxissueqty || maxonsiteissueqty || issuelength || useDaysMode || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %]
160
                        [% IF show_rule %]
161
                        [% IF show_rule %]
161
                            [% SET row_count = row_count + 1 %]
162
                            [% SET row_count = row_count + 1 %]
162
                            <tr row_countd="row_[% row_count | html %]">
163
                            <tr row_countd="row_[% row_count | html %]">
Lines 198-203 Link Here
198
                                        [% END %]
199
                                        [% END %]
199
                                    </td>
200
                                    </td>
200
                                    <td>[% issuelength | html %]</td>
201
                                    <td>[% issuelength | html %]</td>
202
                                    <td>
203
                                        [% SWITCH useDaysMode %]
204
                                        [% CASE 'Calendar' %]<span title="Use the calendar to skip days the library is closed">Calendar</span>
205
                                        [% CASE 'Datedue' %]<span title="Use the calendar to push the due date to the next open day">Datedue</span>
206
                                        [% CASE 'Days' %]<span title="Ignore the calendar">Days</span>
207
                                        [% CASE 'Dayweek' %]<span title="Use the calendar to push the due date to the next open matching weekday for weekly loan periods, or the next open day otherwise">Dayweek</span>
208
                                        [% CASE %]<span title="Use the system preference 'useDaysMode' as a default value">Default</span>
209
                                        [% END %]
201
                                    <td>
210
                                    <td>
202
                                        [% IF ( lengthunit == 'days' ) %]
211
                                        [% IF ( lengthunit == 'days' ) %]
203
                                            Days
212
                                            Days
Lines 335-340 Link Here
335
                    <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
344
                    <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
336
                    <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
345
                    <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
337
                    <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
346
                    <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
347
                    <td>
348
                        <select name="useDaysMode" id="useDaysMode">
349
                            <option value="">Default</option>
350
                            <option value="Calendar">Calendar</option>
351
                            <option value="Datedue">Datedue</option>
352
                            <option value="Days">Days</option>
353
                            <option value="Dayweek">Dayweek</option>
354
                        </select>
355
                    </td>
338
                    <td>
356
                    <td>
339
                      <select name="lengthunit" id="lengthunit">
357
                      <select name="lengthunit" id="lengthunit">
340
                        <option value="days" selected="selected">Days</option>
358
                        <option value="days" selected="selected">Days</option>
Lines 419-424 Link Here
419
                      <th>Current checkouts allowed</th>
437
                      <th>Current checkouts allowed</th>
420
                      <th>Current on-site checkouts allowed</th>
438
                      <th>Current on-site checkouts allowed</th>
421
                      <th>Loan period</th>
439
                      <th>Loan period</th>
440
                      <th>Days mode</th>
422
                      <th>Unit</th>
441
                      <th>Unit</th>
423
                      <th>Hard due date</th>
442
                      <th>Hard due date</th>
424
                      <th>Fine amount</th>
443
                      <th>Fine amount</th>
Lines 988-994 Link Here
988
                        // specific processing for the Note column
1007
                        // specific processing for the Note column
989
                        var note = $(this).find("a[name='viewnote']").data("content");
1008
                        var note = $(this).find("a[name='viewnote']").data("content");
990
                        $(current_column).find("input[type='text']").val(note);
1009
                        $(current_column).find("input[type='text']").val(note);
991
                    } else if ( i == 8 ) {
1010
                    } else if ( i == 9 ) {
992
                        // specific processing for the Hard due date column
1011
                        // specific processing for the Hard due date column
993
                        var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
1012
                        var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
994
                        var input_value = '';
1013
                        var input_value = '';
Lines 999-1005 Link Here
999
                        }
1018
                        }
1000
                        $(current_column).find("input[type='text']").val(input_value);
1019
                        $(current_column).find("input[type='text']").val(input_value);
1001
                        $(current_column).find("select").val(select_value);
1020
                        $(current_column).find("select").val(select_value);
1002
                    } else if ( i == 14 ) {
1021
                    } else if ( i == 15 ) {
1003
                        // specific processing for cap_fine_to_replacement_price
1022
                        // specific processing for cap_fine_to_replacement_price
1004
                        var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
1023
                        var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
1005
                        $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
1024
                        $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
Lines 1024-1030 Link Here
1024
                            // Remove potential previous input added
1043
                            // Remove potential previous input added
1025
                            $(current_column).find("input").remove();
1044
                            $(current_column).find("input").remove();
1026
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
1045
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
1027
                        } else if ( i == 4 || i == 5 || i == 24 || i == 25 || i == 26 ) {
1046
                        } else if ( i == 5 || i == 6 || i == 25 || i == 26 || i == 27 ) {
1028
                            // If the value is not an integer for
1047
                            // If the value is not an integer for
1029
                            //     - "Current checkouts allowed"
1048
                            //     - "Current checkouts allowed"
1030
                            //     - "Current on-site checkouts allowed"
1049
                            //     - "Current on-site checkouts allowed"
1031
- 

Return to bug 24159