Bug 42445: Remove event attributes from list creation template

This patch removes a couple of "onChange" event attributes from the
lists template in favor of defining the event handler in the footer JS.

To test, apply the patch and go to Lists -> New list.

- Choose "Private" from the public dropdown.
- In the "Allow changes to contents from" dropdown select "Permitted
  staff only"
  - A note should appear about the setting having no effect.
- You should see a similar note displayed when you select "Staff only"
  or "Anyone seeing this list"

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Amended-by: Jonathan Druart
Tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2026-04-22 11:59:54 -04:00 committed by Lucas Gass
parent 01a1696058
commit 1275a24115
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 7 additions and 2 deletions

View File

@ -39,7 +39,7 @@
<label for="allow_changes_from">Allow changes to contents from: </label>
</div>
<div class="fg-input">
<select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()">
<select name="allow_changes_from" id="allow_changes_from" class="adjust_remark">
[% IF shelf.allow_change_from_owner %]
<option value="0">Nobody</option>
[% ELSE %]
@ -501,7 +501,7 @@
<label for="public">Public: </label>
</div>
<div class="fg-input">
<select id="public" name="public" onchange="AdjustRemark()">
<select id="public" name="public" class="adjust_remark">
[% IF shelf.is_private %]
<option value="0" selected="selected">Private</option>
[% ELSE %]
@ -988,6 +988,11 @@
$("#permitted_staff_remark").hide();
}
}
$(document).ready(function () {
$(".adjust_remark").on("change", function () {
AdjustRemark();
});
});
</script>
[% IF op == 'view' %]
<script nonce="[% Koha.CSPNonce | $raw %]">