From e3af7c7aa5e14edd323a1a5b9b281f0044323714 Mon Sep 17 00:00:00 2001 From: Niek Rabelink Date: Tue, 15 Sep 2026 12:30:58 +0200 Subject: [PATCH] Jira en admin aanpassingen --- admin.php | 528 ++++++++++++++++++++++----------------------- jira.php | 636 +++++++++++++++++++++++++++++++++--------------------- 2 files changed, 652 insertions(+), 512 deletions(-) diff --git a/admin.php b/admin.php index 3c85d83..2173752 100644 --- a/admin.php +++ b/admin.php @@ -17,8 +17,10 @@ $db = get_db_connection(); $message = null; $messageType = 'success'; -$validTabs = ['users', 'calendar', 'microsoft', 'jira', 'ai', 'security', 'system']; +$validTabs = ['users', 'calendar', 'microsoft', 'projects', 'security', 'system']; $activeTab = $_GET['tab'] ?? 'users'; +if ($activeTab === 'jira') $activeTab = 'projects'; +if ($activeTab === 'ai') $activeTab = 'system'; if (!in_array($activeTab, $validTabs, true)) { $activeTab = 'users'; } @@ -33,8 +35,11 @@ if (!empty($_GET['success'])) { // POST Verwerking VÓÓR header output zodat redirects en opslaan vlekkeloos werken if ($_SERVER['REQUEST_METHOD'] === 'POST') { - if (!empty($_POST['active_tab']) && in_array($_POST['active_tab'], $validTabs, true)) { - $activeTab = $_POST['active_tab']; + $postedTab = $_POST['active_tab'] ?? ''; + if ($postedTab === 'jira') $postedTab = 'projects'; + if ($postedTab === 'ai') $postedTab = 'system'; + if (!empty($postedTab) && in_array($postedTab, $validTabs, true)) { + $activeTab = $postedTab; } if (!verify_csrf_token($_POST['csrf_token'] ?? null)) { @@ -87,7 +92,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { // 2. Centraal Jira Bedrijfsdomein opslaan elseif ($action === 'save_jira_domain') { - $activeTab = 'jira'; + $activeTab = 'projects'; $rawDomain = trim($_POST['jira_domain'] ?? ''); $companyDomain = !empty($rawDomain) ? jira_normalize_domain($rawDomain) : ''; @@ -115,7 +120,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { // 2b. Jira Wachtrijfilter toevoegen of bewerken elseif ($action === 'save_jira_queue_filter') { - $activeTab = 'jira'; + $activeTab = 'projects'; $filterId = (int)($_POST['filter_id'] ?? 0); $filterCode = strtoupper(trim($_POST['filter_code'] ?? '')); $filterName = trim($_POST['filter_name'] ?? ''); @@ -142,13 +147,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { INSERT INTO jira_queue_filters (filter_code, filter_name, project_key, jql_clause, description, is_active, sort_order) VALUES (?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE - filter_name = VALUES(filter_name), - project_key = VALUES(project_key), - jql_clause = VALUES(jql_clause), - description = VALUES(description), - is_active = VALUES(is_active), - sort_order = VALUES(sort_order), - updated_at = NOW() + filter_name = VALUES(filter_name), + project_key = VALUES(project_key), + jql_clause = VALUES(jql_clause), + description = VALUES(description), + is_active = VALUES(is_active), + sort_order = VALUES(sort_order), + updated_at = NOW() "); $stmt->execute([$filterCode, $filterName, $projectKey ?: null, $jqlClause, $description, $isActive, $sortOrder]); $message = "Nieuw wachtrijfilter '{$filterName}' is succesvol toegevoegd."; @@ -160,7 +165,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { // 2c. Jira Wachtrijfilter verwijderen elseif ($action === 'delete_jira_queue_filter') { - $activeTab = 'jira'; + $activeTab = 'projects'; $filterId = (int)($_POST['filter_id'] ?? 0); if ($filterId > 0) { $stmt = $db->prepare("DELETE FROM jira_queue_filters WHERE id = ?"); @@ -173,7 +178,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { // 2d. Teamleden toewijzen aan Jira Wachtrijfilters (meervoudig) elseif ($action === 'save_user_jira_assignments') { - $activeTab = 'jira'; + $activeTab = 'projects'; $assignments = $_POST['user_filters'] ?? []; $submittedUserIds = isset($_POST['user_ids']) && is_array($_POST['user_ids']) ? array_map('intval', $_POST['user_ids']) : []; @@ -372,12 +377,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $message = "Brainstorm categorieën zijn succesvol opgeslagen."; $messageType = 'success'; - $activeTab = 'system'; + $activeTab = 'projects'; } // 4. AI Co-Pilot instellingen opslaan (Release v1.5) elseif ($action === 'save_ai_settings') { - $activeTab = 'ai'; + $activeTab = 'system'; try { $aiEnabled = isset($_POST['ai_enabled']) ? 1 : 0; $aiModel = trim((string)($_POST['ai_model'] ?? 'gemini-1.5-pro')); @@ -631,7 +636,7 @@ require_once __DIR__ . '/includes/header.php'; - +
- -
- -