update users
This commit is contained in:
parent
7c04f1dfef
commit
b2926230f7
22
users.php
22
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 = '<?= h(tr('إضافة مستخدم جديد', 'Add New User')) ?>';
|
||||
document.getElementById('password').required = true;
|
||||
@ -328,8 +319,15 @@ function openEditModal(account) {
|
||||
document.getElementById('password').value = '';
|
||||
document.getElementById('passwordHelp').innerText = '(<?= h(tr('اتركه فارغاً لعدم التغيير', 'Leave blank to keep unchanged')) ?>)';
|
||||
|
||||
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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user