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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-16 / +18 lines)
Lines 279-295 Link Here
279
                                                        <span>Undefined</span>
279
                                                        <span>Undefined</span>
280
                                                    [% END %]
280
                                                    [% END %]
281
                                                </td>
281
                                                </td>
282
                                                <td data-code="[% hardduedatecompare | html %]">
282
                                                <td data-code="[% hardduedatecompare | html %]" data-duedate="[% hardduedate | $KohaDates %]">
283
                                                  [% IF ( hardduedate ) %]
283
                                                  [% IF ( hardduedate ) %]
284
                                                    [% IF ( hardduedatecompare == '-1' ) %]
284
                                                    [% IF ( hardduedatecompare == '-1' ) %]
285
                                                      before [% hardduedate | $KohaDates %]
285
                                                      before [% hardduedate | $KohaDates %]
286
                                                      <input type="hidden" name="hardduedatecomparebackup" value="-1" />
287
                                                    [% ELSIF ( hardduedatecompare == '0' ) %]
286
                                                    [% ELSIF ( hardduedatecompare == '0' ) %]
288
                                                      on [% hardduedate | $KohaDates %]
287
                                                      on [% hardduedate | $KohaDates %]
289
                                                      <input type="hidden" name="hardduedatecomparebackup" value="0" />
290
                                                    [% ELSIF ( hardduedatecompare == '1' ) %]
288
                                                    [% ELSIF ( hardduedatecompare == '1' ) %]
291
                                                      after [% hardduedate | $KohaDates %]
289
                                                      after [% hardduedate | $KohaDates %]
292
                                                      <input type="hidden" name="hardduedatecomparebackup" value="1" />
293
                                                    [% END %]
290
                                                    [% END %]
294
                                                  [% ELSE %]
291
                                                  [% ELSE %]
295
                                                    <span>None defined</span>
292
                                                    <span>None defined</span>
Lines 475-481 Link Here
475
                                       <option value="0">Exactly on</option>
472
                                       <option value="0">Exactly on</option>
476
                                       <option value="1">After</option>
473
                                       <option value="1">After</option>
477
                                    </select>
474
                                    </select>
478
                                    <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate | html %]" class="flatpickr" />
475
                                    <input type="text" size="10" id="hardduedate" name="hardduedate" class="flatpickr" />
479
                                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
476
                                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
480
                                </td>
477
                                </td>
481
                                <td><input type="text" name="decreaseloanholds" id="decreaseloanholds" size="2" /></td>
478
                                <td><input type="text" name="decreaseloanholds" id="decreaseloanholds" size="2" /></td>
Lines 508-514 Link Here
508
                                </td>
505
                                </td>
509
                                <td><input type="text" name="no_auto_renewal_after" id="no_auto_renewal_after" size="3" /></td>
506
                                <td><input type="text" name="no_auto_renewal_after" id="no_auto_renewal_after" size="3" /></td>
510
                                <td>
507
                                <td>
511
                                    <input type="text" size="10" name="no_auto_renewal_after_hard_limit" id="no_auto_renewal_after_hard_limit" value="[% no_auto_renewal_after_hard_limit | html %]" class="flatpickr"/>
508
                                    <input type="text" size="10" name="no_auto_renewal_after_hard_limit" id="no_auto_renewal_after_hard_limit" class="flatpickr"/>
512
                                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
509
                                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
513
                                </td>
510
                                </td>
514
                                <td><input type="text" name="reservesallowed"  id="reservesallowed"  size="2" /></td>
511
                                <td><input type="text" name="reservesallowed"  id="reservesallowed"  size="2" /></td>
Lines 1503-1518 Link Here
1503
                        var note = $(this).find("a[name='viewnote']").data("content");
1500
                        var note = $(this).find("a[name='viewnote']").data("content");
1504
                        $(current_column).find("input[type='text']").val(note);
1501
                        $(current_column).find("input[type='text']").val(note);
1505
                    } else if ( i == 9 ) {
1502
                    } else if ( i == 9 ) {
1506
                        // specific processing for the Hard due date column
1503
                        // specific processing for Hard due date
1507
                        var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
1504
                        $(current_column).find("select").val(itm_code);
1508
                        var input_value = '';
1505
                        var hardduedate = $(this).data('duedate');
1509
                        if (typeof select_value === 'undefined'){
1506
                        if (hardduedate) {
1510
                            select_value = '-1';
1507
                            var fp = document.querySelector("#hardduedate")._flatpickr;
1511
                        }else {
1508
                            hardduedate = fp.parseDate( hardduedate, flatpickr_dateformat_string );
1512
                            input_value = itm_text.split(' ')[1];
1509
                            if( hardduedate) fp.setDate( hardduedate, 1 );
1510
                        }
1511
                    } else if ( i == 26 ) {
1512
                        // specific processing for No automatic renewal after (hard limit)
1513
                        var renewdate = itm_text;
1514
                        if (renewdate) {
1515
                            var fp = document.querySelector("#no_auto_renewal_after_hard_limit")._flatpickr;
1516
                            renewdate = fp.parseDate( renewdate, flatpickr_dateformat_string );
1517
                            if( renewdate) fp.setDate( renewdate, 1 );
1513
                        }
1518
                        }
1514
                        $(current_column).find("input[type='text']").val(input_value);
1515
                        $(current_column).find("select").val(select_value);
1516
                    } else if ( i == 16 ) {
1519
                    } else if ( i == 16 ) {
1517
                        // specific processing for cap_fine_to_replacement_price
1520
                        // specific processing for cap_fine_to_replacement_price
1518
                        var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
1521
                        var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
1519
- 

Return to bug 35341