Skip to content

Commit

Permalink
Fixed handling of (un)selecting checkboxes on permissions table for A…
Browse files Browse the repository at this point in the history
…dminCustomerUserGroup.
  • Loading branch information
NiklasSchmitt committed Feb 6, 2024
1 parent ac9c8f0 commit d7d77e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 7.0.16 2024-??-??
- 2024-02-06 Fixed handling of (un)selecting checkboxes on permissions table for AdminCustomerUserGroup.
- 2024-02-05 AdminOAuth2TokenManagement: Added filter for (in)valid entries.
- 2024-02-02 Removed session data from support bundle generator.
- 2024-02-02 Prevent error message 'MissingTicketID' of ArticleList in inbound phone call screen. Thanks to Jannis Kleinrensing (@JannisKleinrensing), maxence. [PR#346](https://github.com/znuny/Znuny/pull/346)
Expand Down
13 changes: 7 additions & 6 deletions var/httpd/htdocs/js/Core.Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,14 @@ Core.Form = (function (TargetNS) {
SelectAllID = $SelectAllCheckbox.attr('id');
$Elements = $('input[type="checkbox"][name="' + Core.App.EscapeSelector(ElementName) + '"]').filter('[id!="' + Core.App.EscapeSelector(SelectAllID) + '"]:visible');
Status = $ClickedBox.prop('checked');
RWMasterSwitch = $('#SelectAllrw');
HeadElements = $('table th input:not([name="rw"]:visible)');
// search for a element start starts with SelectAll and ends with rw
RWMasterSwitch = $('input[id^="SelectAll"][id$="rw"]');
HeadElements = $('table th input:not([name$="rw"]:visible)');
CheckAll = $('input[type="checkbox"]:visible');

if(ElementName === 'rw'){
if (ElementName.endsWith('rw')) {

if($ClickedBox.attr('id') === 'SelectAllrw'){
if ($ClickedBox.attr('id') && $ClickedBox.attr('id') === SelectAllID) {

if(RWMasterSwitch.hasClass('Disabled')){
CheckAll.prop('disabled', false);
Expand All @@ -196,7 +197,7 @@ Core.Form = (function (TargetNS) {
return;
} else {
CheckAll.prop('checked', true);
$('input[type="checkbox"]:visible:not([name="rw"])').not(RWMasterSwitch).prop('disabled', true);
$('input[type="checkbox"]:visible:not([name$="rw"])').not(RWMasterSwitch).prop('disabled', true);
$Elements.addClass('Disabled');
RWMasterSwitch.addClass('Disabled');
return;
Expand Down Expand Up @@ -236,7 +237,7 @@ Core.Form = (function (TargetNS) {
CountSelectedCheckboxes = $Elements.filter(':checked').length;
if (CountCheckboxes === CountSelectedCheckboxes) {
$SelectAllCheckbox.prop('checked', true);
if(ElementName === 'rw'){
if (ElementName.endsWith('rw')) {
CheckAll.prop('checked', true).not(RWMasterSwitch);
RWMasterSwitch.addClass('Disabled');
HeadElements.prop('disabled', true);
Expand Down

0 comments on commit d7d77e5

Please sign in to comment.