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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-7 / +6 lines)
Lines 1505-1515 Link Here
1505
                    itm_text = $(this).text();
1505
                    itm_text = $(this).text();
1506
                    itm_text = itm_text.replace(/^\s*|\s*$/g,'');
1506
                    itm_text = itm_text.replace(/^\s*|\s*$/g,'');
1507
                    var current_column = $("#edit_row td:eq("+i+")");
1507
                    var current_column = $("#edit_row td:eq("+i+")");
1508
                    if ( i == 3 ) {
1508
                    var current_input_id = $(current_column).children('input').first().attr('id');
1509
                    if ( current_input_id === "note" ) {
1509
                        // specific processing for the Note column
1510
                        // specific processing for the Note column
1510
                        var note = $(this).find("a[id='viewnote']").data("content");
1511
                        var note = $(this).find("a[id='viewnote']").data("content");
1511
                        $(current_column).find("input[type='text']").val(note);
1512
                        $(current_column).find("input[type='text']").val(note);
1512
                    } else if ( i == 9 ) {
1513
                    } else if ( current_input_id === "hardduedatecompare" ) {
1513
                        // specific processing for Hard due date
1514
                        // specific processing for Hard due date
1514
                        $(current_column).find("select").val(itm_code);
1515
                        $(current_column).find("select").val(itm_code);
1515
                        var hardduedate = $(this).data('duedate');
1516
                        var hardduedate = $(this).data('duedate');
Lines 1518-1524 Link Here
1518
                            hardduedate = fp.parseDate( hardduedate, flatpickr_dateformat_string );
1519
                            hardduedate = fp.parseDate( hardduedate, flatpickr_dateformat_string );
1519
                            if( hardduedate) fp.setDate( hardduedate, 1 );
1520
                            if( hardduedate) fp.setDate( hardduedate, 1 );
1520
                        }
1521
                        }
1521
                    } else if ( i == 25 ) {
1522
                    } else if ( current_input_id === "no_auto_renewal_after_hard_limit" ) {
1522
                        // specific processing for No automatic renewal after (hard limit)
1523
                        // specific processing for No automatic renewal after (hard limit)
1523
                        var renewdate = itm_text;
1524
                        var renewdate = itm_text;
1524
                        if (renewdate) {
1525
                        if (renewdate) {
Lines 1526-1532 Link Here
1526
                            renewdate = fp.parseDate( renewdate, flatpickr_dateformat_string );
1527
                            renewdate = fp.parseDate( renewdate, flatpickr_dateformat_string );
1527
                            if( renewdate) fp.setDate( renewdate, 1 );
1528
                            if( renewdate) fp.setDate( renewdate, 1 );
1528
                        }
1529
                        }
1529
                    } else if ( i == 16 ) {
1530
                    } else if ( current_input_id === "cap_fine_to_replacement_price" ) {
1530
                        // specific processing for cap_fine_to_replacement_price
1531
                        // specific processing for cap_fine_to_replacement_price
1531
                        var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
1532
                        var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
1532
                        $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
1533
                        $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
Lines 1552-1558 Link Here
1552
1553
1553
                        // After setting the correct option, update the select to reflect the change
1554
                        // After setting the correct option, update the select to reflect the change
1554
                        $(current_column).find('select').trigger('change');
1555
                        $(current_column).find('select').trigger('change');
1555
                        var current_input_id = $(current_column).children('input').first().attr('id');
1556
                        if ( i == 0 || i == 1 ) {
1556
                        if ( i == 0 || i == 1 ) {
1557
                            // Disable the 2 first columns, we cannot update them.
1557
                            // Disable the 2 first columns, we cannot update them.
1558
                            var val = $(current_column).find("select option:selected").val();
1558
                            var val = $(current_column).find("select option:selected").val();
Lines 1563-1569 Link Here
1563
                            // Remove potential previous input added
1563
                            // Remove potential previous input added
1564
                            $(current_column).find("input").remove();
1564
                            $(current_column).find("input").remove();
1565
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
1565
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
1566
                        } else if ( i == 5 || i == 6 || i == 26 || i == 27 || i == 28 || current_input_id === "holds_pickup_period" ) {
1566
                        } else if ( current_input_id === "maxissueqty" || current_input_id === "maxonsiteissueqty" || current_input_id === "reservesallowed" || current_input_id === "holds_per_day" || current_input_id === "holds_per_record" || current_input_id === "holds_pickup_period" ) {
1567
                            // If the value is not an integer for
1567
                            // If the value is not an integer for
1568
                            //     - "Current checkouts allowed"
1568
                            //     - "Current checkouts allowed"
1569
                            //     - "Current on-site checkouts allowed"
1569
                            //     - "Current on-site checkouts allowed"
1570
- 

Return to bug 36716