должность
This commit is contained in:
@@ -68,6 +68,23 @@ function filterAssignableUsers(allUsers, taskType = 'regular') {
|
||||
return hasSecretaryGroup;
|
||||
});
|
||||
}
|
||||
// Для задач типа "it" - только пользователи из группы "ИТ специалист"
|
||||
if (taskType === 'it') {
|
||||
return allUsers.filter(async (user) => {
|
||||
if (user.id === currentUser.id) return false;
|
||||
|
||||
// Получаем группы пользователя
|
||||
const groups = await getUserGroups(user.id);
|
||||
|
||||
// Проверяем, есть ли группа "Секретарь"
|
||||
const hasSecretaryGroup = groups.some(group =>
|
||||
group.name === 'ИТ специалист' ||
|
||||
(typeof group === 'string' && group.includes('ИТ специалист'))
|
||||
);
|
||||
|
||||
return hasSecretaryGroup;
|
||||
});
|
||||
}
|
||||
|
||||
// Для других типов задач - обычная фильтрация
|
||||
// Администратор видит всех пользователей
|
||||
@@ -256,9 +273,10 @@ function renderUsersChecklist() {
|
||||
<label>
|
||||
<input type="checkbox" name="assignedUsers" value="${user.id}"
|
||||
onchange="toggleUserSelection(this, ${user.id})">
|
||||
${user.name}
|
||||
${document.getElementById('task-type').value === 'document' ?
|
||||
'<small style="color: #666; margin-left: 5px;">(Секретарь)</small>' : ''}
|
||||
${user.name}
|
||||
${document.getElementById('task-type').value === 'document' ? '(Секретарь)' : ''}
|
||||
${document.getElementById('task-type').value === 'it' ? '(Админ)' : ''}
|
||||
${document.getElementById('task-type').value === 'certificate' ? '(Администрация)' : ''}
|
||||
</label>
|
||||
</div>
|
||||
`).join('');
|
||||
|
||||
Reference in New Issue
Block a user