Restrict department analytics to Абделазиз
Hide department KPI card, "Загрузка по сотрудникам" card, and the assignee filter for non-director sessions. The tasks table title swaps to "Мои поручения" for employees. Calendar dots and the upcoming-tasks widget now show only the current user's tasks when not director. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f32d156e48
commit
8652214f32
2
app.js
2
app.js
@ -525,6 +525,7 @@ function renderUpcoming() {
|
||||
const today = todayISO();
|
||||
const tasks = getTasks()
|
||||
.filter(t => t.deadline && effectiveStatus(t) !== 'done')
|
||||
.filter(t => isDirector() || t.assignee === state.currentUser)
|
||||
.sort((a, b) => a.deadline.localeCompare(b.deadline))
|
||||
.slice(0, 6);
|
||||
|
||||
@ -588,6 +589,7 @@ function renderCalendar() {
|
||||
const dueByDate = {};
|
||||
tasks.forEach(t => {
|
||||
if (!t.deadline || t.status === 'done') return;
|
||||
if (!isDirector() && t.assignee !== state.currentUser) return;
|
||||
dueByDate[t.deadline] = (dueByDate[t.deadline] || 0) + 1;
|
||||
});
|
||||
|
||||
|
||||
13
index.html
13
index.html
@ -11,7 +11,7 @@
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.css">
|
||||
<link rel="stylesheet" href="styles.css?v=32" />
|
||||
<link rel="stylesheet" href="styles.css?v=33" />
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
@ -204,7 +204,7 @@
|
||||
|
||||
<!-- Аналитика -->
|
||||
<div id="view-analytics" class="view" hidden>
|
||||
<section class="card">
|
||||
<section class="card director-only">
|
||||
<h2>Сводка по департаменту</h2>
|
||||
<div class="kpis">
|
||||
<div class="kpi"><div class="kpi-num" id="kpiActive">0</div><div class="kpi-lbl">Активных задач</div></div>
|
||||
@ -214,16 +214,17 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<section class="card director-only">
|
||||
<h2>Загрузка по сотрудникам</h2>
|
||||
<div class="load" id="loadByAssignee"></div>
|
||||
<p class="hint">Нажмите на сотрудника, чтобы отфильтровать таблицу.</p>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Все поручения</h2>
|
||||
<h2 class="director-only">Все поручения</h2>
|
||||
<h2 class="employee-only">Мои поручения</h2>
|
||||
<div class="filters">
|
||||
<select id="fAssignee"><option value="">Все исполнители</option></select>
|
||||
<select id="fAssignee" class="director-only"><option value="">Все исполнители</option></select>
|
||||
<select id="fStatus">
|
||||
<option value="">Все статусы</option>
|
||||
<option value="new">Новая</option>
|
||||
@ -292,6 +293,6 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/l10n/ru.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
|
||||
<script src="app.js?v=29"></script>
|
||||
<script src="app.js?v=30"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -212,6 +212,8 @@ body {
|
||||
|
||||
.who { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
|
||||
body[data-role="employee"] .director-only { display: none !important; }
|
||||
body[data-role="director"] .employee-only { display: none !important; }
|
||||
body:not([data-role]) .employee-only { display: none !important; }
|
||||
.user-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user