From b2926230f765685885c6b6052df8936a2ebd3e1c Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 20 Apr 2026 05:55:07 +0000 Subject: [PATCH] update users --- users.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/users.php b/users.php index 81aa052..6a12896 100644 --- a/users.php +++ b/users.php @@ -296,16 +296,7 @@ function openAddModal() { document.getElementById('userAction').value = 'add'; document.getElementById('userId').value = ''; document.getElementById('userForm').reset(); - document.querySelectorAll('.additional-branch').forEach(cb => cb.checked = false); - document.querySelectorAll('.additional-branch').forEach(cb => cb.checked = false); - if (account.allowed_branches) { - let abs = account.allowed_branches.split(','); - abs.forEach(b => { - let cb = document.getElementById('ab_' + b.trim()); - if (cb) cb.checked = true; - }); - } - + document.querySelectorAll('.additional-branch').forEach(cb => cb.checked = false); document.querySelectorAll('.perm-check').forEach(cb => cb.checked = false); document.getElementById('userModalLabel').innerText = ''; document.getElementById('password').required = true; @@ -328,8 +319,15 @@ function openEditModal(account) { document.getElementById('password').value = ''; document.getElementById('passwordHelp').innerText = '()'; - document.querySelectorAll('.perm-check').forEach(cb => cb.checked = false); - + document.querySelectorAll('.additional-branch').forEach(cb => cb.checked = false); + if (account.allowed_branches) { + let abs = account.allowed_branches.split(','); + abs.forEach(b => { + let cb = document.getElementById('ab_' + b.trim()); + if (cb) cb.checked = true; + }); + } + document.querySelectorAll('.perm-check').forEach(cb => cb.checked = false); if (account.permissions) { try {