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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-4 / +12 lines)
Lines 1498-1503 Link Here
1498
                }
1498
                }
1499
                $('#default-circulation-rules td').removeClass('highlighted-row');
1499
                $('#default-circulation-rules td').removeClass('highlighted-row');
1500
                $(this).parent().parent().find("td").each(function (i) {
1500
                $(this).parent().parent().find("td").each(function (i) {
1501
1501
                    $(this).addClass('highlighted-row');
1502
                    $(this).addClass('highlighted-row');
1502
                    itm_code = $(this).data('code');
1503
                    itm_code = $(this).data('code');
1503
                    itm_text = $(this).text();
1504
                    itm_text = $(this).text();
Lines 1537-1547 Link Here
1537
                        });
1538
                        });
1538
                        // select the corresponding option
1539
                        // select the corresponding option
1539
                        $(current_column).find("select option").each(function(){
1540
                        $(current_column).find("select option").each(function(){
1540
                            opt = $(this).attr('value');
1541
                            // Reset selection status for all options
1541
                            if ( opt == itm_code ) {
1542
                            $(this).prop('selected', false);
1542
                                $(this).attr('selected', 'selected');
1543
                            // Declare opt here to ensure it is scoped correctly within the loop
1544
                            let opt = $(this).val();
1545
1546
                            // Select the matching option
1547
                            if (opt == itm_code) {
1548
                                $(this).prop('selected', true);
1543
                            }
1549
                            }
1544
                        });
1550
                        });
1551
1552
                        // After setting the correct option, update the select to reflect the change
1553
                        $(current_column).find('select').trigger('change');
1545
                        var current_input_id = $(current_column).children('input').first().attr('id');
1554
                        var current_input_id = $(current_column).children('input').first().attr('id');
1546
                        if ( i == 0 || i == 1 ) {
1555
                        if ( i == 0 || i == 1 ) {
1547
                            // Disable the 2 first columns, we cannot update them.
1556
                            // Disable the 2 first columns, we cannot update them.
1548
- 

Return to bug 36527