Bugzilla – Attachment 164779 Details for
Bug 36527
Patron category or item type not changing when editing another circulation rule
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36527: Patron category or item type not changing when editing another circulation rule
Bug-36527-Patron-category-or-item-type-not-changin.patch (text/plain), 3.07 KB, created by
Phan Tung Bui
on 2024-04-11 20:11:23 UTC
(
hide
)
Description:
Bug 36527: Patron category or item type not changing when editing another circulation rule
Filename:
MIME Type:
Creator:
Phan Tung Bui
Created:
2024-04-11 20:11:23 UTC
Size:
3.07 KB
patch
obsolete
>From e423992cead3b442e8215951d223eeabe322e528 Mon Sep 17 00:00:00 2001 >From: Phan Tung Bui <phan-tung.bui@inlibro.com> >Date: Thu, 11 Apr 2024 16:02:27 -0400 >Subject: [PATCH] Bug 36527: Patron category or item type not changing when > editing another circulation rule > >Plan test : >1. Go to Administration > Circulation and fine rules >2. Add a couple of rules with various patron category/item type combinations >3. Click on "Edit" next to one of the rules > --> The line should become highlighted in yellow and the values should be copied in the very last row >4. Click on "Edit" next to another rule >5. Click OK in the browser dialog box to confirm you want to edit another rule > --> Depending on the rules, the values for the patron category and/or item type might not change in the editing row >6. Repeat steps 4 and 5 > --> The patron category and item type do not always change >7. Apply the batch >8. Redo step from 3 to 6 >9. Observe that category and item type change accordingly >--- > .../prog/en/modules/admin/smart-rules.tt | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index 1109b0e99c..afad8d9c7d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -1498,6 +1498,7 @@ > } > $('#default-circulation-rules td').removeClass('highlighted-row'); > $(this).parent().parent().find("td").each(function (i) { >+ > $(this).addClass('highlighted-row'); > itm_code = $(this).data('code'); > itm_text = $(this).text(); >@@ -1537,11 +1538,20 @@ > }); > // select the corresponding option > $(current_column).find("select option").each(function(){ >- opt = $(this).attr('value'); >- if ( opt == itm_code ) { >- $(this).attr('selected', 'selected'); >+ // Reset selection status for all options >+ $(this).prop('selected', false); >+ >+ // Declare opt here to ensure it is scoped correctly within the loop >+ let opt = $(this).val(); >+ >+ // Select the matching option >+ if (opt == itm_code) { >+ $(this).prop('selected', true); > } > }); >+ >+ // After setting the correct option, update the select to reflect the change >+ $(current_column).find('select').trigger('change'); > var current_input_id = $(current_column).children('input').first().attr('id'); > if ( i == 0 || i == 1 ) { > // Disable the 2 first columns, we cannot update them. >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36527
:
164779
|
164781
|
164855
|
168144