Действия2
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
function log(...args) {
|
||||
if (LOG_ENABLED) console.log(...args);
|
||||
}
|
||||
|
||||
log('currentUser:', currentUser);
|
||||
log('currentUser.role:', currentUser.role);
|
||||
|
||||
// Сбор доступных действий для конкретной задачи
|
||||
function buildActionsForTask(task) {
|
||||
//log('buildActionsForTask called with task', task);
|
||||
@@ -16,7 +20,6 @@
|
||||
const canEdit = window.canUserEditTask ? window.canUserEditTask(task) : false;
|
||||
|
||||
const actions = [];
|
||||
|
||||
// Действия для активных (не удалённых, не закрытых) задач
|
||||
if (!isDeleted && !isClosed) {
|
||||
if (typeof openTaskChat === 'function') {
|
||||
@@ -32,9 +35,8 @@
|
||||
log('nav-task-actions openAddFileModal not');
|
||||
}
|
||||
}
|
||||
|
||||
// Специальные пользователи
|
||||
if (window.currentUser && window.currentUser.login === 'minicrm') {
|
||||
if (currentUser && currentUser.login === 'minicrm') {
|
||||
if (typeof openEditModal === 'function') {
|
||||
actions.push({ label: '✏️ Редактировать', handler: () => openEditModal(taskId) });
|
||||
log('nav-task-actions openEditModal yes');
|
||||
@@ -42,17 +44,19 @@ if (window.currentUser && window.currentUser.login === 'minicrm') {
|
||||
log('nav-task-actions openEditModal not');
|
||||
}
|
||||
////}
|
||||
//if (window.currentUser && window.currentUser.login === 'kalugin.o') {
|
||||
//if (currentUser && currentUser.login === 'kalugin.o') {
|
||||
if (typeof openManageAssigneesModal === 'function') {
|
||||
actions.push({ label: '👥 Управление исполнителями', handler: () => openManageAssigneesModal(taskId) });
|
||||
log('nav-task-actions openManageAssigneesModal yes');
|
||||
} else {
|
||||
log('nav-task-actions openManageAssigneesModal not');
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
// ${currentUser && currentUser.role === 'tasks' && canEdit || currentUser.role === 'admin'
|
||||
// Администраторы и роль tasks
|
||||
if (currentUser && (currentUser.role === 'admin' || (currentUser.role === 'tasks' && canEdit))) {
|
||||
|
||||
// Администраторы и роль tasks
|
||||
//if (window.currentUser && (window.currentUser.role === 'admin' || (window.currentUser.role === 'tasks' && canEdit))) {
|
||||
if (typeof assignAdd_openModal === 'function') {
|
||||
actions.push({ label: '🧑💼➕ Добавить исполнителя', handler: () => assignAdd_openModal(taskId) });
|
||||
log('nav-task-actions assignAdd_openModal yes');
|
||||
|
||||
Reference in New Issue
Block a user