Resolve merge conflicts in multiple files and clean up integration logic

This commit is contained in:
2026-09-09 16:22:59 +02:00
parent 8f191f5123
commit 4cb94d3897
6 changed files with 5 additions and 100 deletions
-4
View File
@@ -542,13 +542,9 @@ require_once __DIR__ . '/includes/header.php';
<div> <div>
<label class="block text-[11px] font-medium text-slate-600 dark:text-slate-400 mb-1">Standaard tijdslot</label> <label class="block text-[11px] font-medium text-slate-600 dark:text-slate-400 mb-1">Standaard tijdslot</label>
<select name="default_task_duration" class="w-full bg-white dark:bg-[#111622] border border-slate-300 dark:border-slate-700 rounded-xl px-3 py-1.5 text-xs text-slate-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-indigo-500"> <select name="default_task_duration" class="w-full bg-white dark:bg-[#111622] border border-slate-300 dark:border-slate-700 rounded-xl px-3 py-1.5 text-xs text-slate-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-indigo-500">
<<<<<<< HEAD
<option value="10" <?= $workdaySettings['default_task_duration'] == 10 ? 'selected' : '' ?>>10 minuten</option> <option value="10" <?= $workdaySettings['default_task_duration'] == 10 ? 'selected' : '' ?>>10 minuten</option>
<option value="15" <?= $workdaySettings['default_task_duration'] == 15 ? 'selected' : '' ?>>15 minuten</option> <option value="15" <?= $workdaySettings['default_task_duration'] == 15 ? 'selected' : '' ?>>15 minuten</option>
<option value="20" <?= $workdaySettings['default_task_duration'] == 20 ? 'selected' : '' ?>>20 minuten</option> <option value="20" <?= $workdaySettings['default_task_duration'] == 20 ? 'selected' : '' ?>>20 minuten</option>
=======
<option value="15" <?= $workdaySettings['default_task_duration'] == 15 ? 'selected' : '' ?>>15 minuten</option>
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
<option value="30" <?= $workdaySettings['default_task_duration'] == 30 ? 'selected' : '' ?>>30 minuten (Standaard)</option> <option value="30" <?= $workdaySettings['default_task_duration'] == 30 ? 'selected' : '' ?>>30 minuten (Standaard)</option>
<option value="45" <?= $workdaySettings['default_task_duration'] == 45 ? 'selected' : '' ?>>45 minuten</option> <option value="45" <?= $workdaySettings['default_task_duration'] == 45 ? 'selected' : '' ?>>45 minuten</option>
<option value="60" <?= $workdaySettings['default_task_duration'] == 60 ? 'selected' : '' ?>>60 minuten (1 uur)</option> <option value="60" <?= $workdaySettings['default_task_duration'] == 60 ? 'selected' : '' ?>>60 minuten (1 uur)</option>
+4 -57
View File
@@ -38,13 +38,8 @@ try {
$title = trim($data['title'] ?? ''); $title = trim($data['title'] ?? '');
$priority = in_array($data['priority'] ?? '', ['P1', 'P2', 'P3']) ? $data['priority'] : 'P2'; $priority = in_array($data['priority'] ?? '', ['P1', 'P2', 'P3']) ? $data['priority'] : 'P2';
$timeBlockStart = !empty($data['time_block_start']) ? trim($data['time_block_start']) : null; $timeBlockStart = !empty($data['time_block_start']) ? trim($data['time_block_start']) : null;
<<<<<<< HEAD
$timeBlockEnd = !empty($data['time_block_end']) ? trim($data['time_block_end']) : null; $timeBlockEnd = !empty($data['time_block_end']) ? trim($data['time_block_end']) : null;
$durationMinutes = (int)($data['duration_minutes'] ?? 0); $durationMinutes = (int)($data['duration_minutes'] ?? 0);
=======
$durationMinutes = (int)($data['duration_minutes'] ?? 30);
if ($durationMinutes <= 0) $durationMinutes = 30;
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
$date = !empty($data['date']) ? trim($data['date']) : $today; $date = !empty($data['date']) ? trim($data['date']) : $today;
$syncOutlook = !empty($data['sync_to_outlook']); $syncOutlook = !empty($data['sync_to_outlook']);
@@ -53,7 +48,6 @@ try {
exit; exit;
} }
<<<<<<< HEAD
// Als zowel start- als eindtijd zijn opgegeven, bereken exact de minuten // Als zowel start- als eindtijd zijn opgegeven, bereken exact de minuten
if (!empty($timeBlockStart) && !empty($timeBlockEnd)) { if (!empty($timeBlockStart) && !empty($timeBlockEnd)) {
$t1 = strtotime("2000-01-01 {$timeBlockStart}"); $t1 = strtotime("2000-01-01 {$timeBlockStart}");
@@ -77,9 +71,6 @@ try {
// negeer // negeer
} }
} }
=======
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
// Haal of maak daily plan op // Haal of maak daily plan op
$stmtPlan = $db->prepare(" $stmtPlan = $db->prepare("
INSERT INTO daily_plans (user_id, plan_date) INSERT INTO daily_plans (user_id, plan_date)
@@ -92,10 +83,6 @@ try {
$source = !empty($data['source']) ? substr(trim($data['source']), 0, 50) : 'FOCIZ'; $source = !empty($data['source']) ? substr(trim($data['source']), 0, 50) : 'FOCIZ';
$externalId = !empty($data['external_id']) ? substr(trim($data['external_id']), 0, 255) : null; $externalId = !empty($data['external_id']) ? substr(trim($data['external_id']), 0, 255) : null;
$externalUrl = !empty($data['external_url']) ? trim($data['external_url']) : null; $externalUrl = !empty($data['external_url']) ? trim($data['external_url']) : null;
<<<<<<< HEAD
=======
$timeBlockEnd = null;
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
$outlookSyncError = null; $outlookSyncError = null;
// Als synchronisatie naar Outlook gewenst is (of source is OUTLOOK) en nog geen extern ID heeft // Als synchronisatie naar Outlook gewenst is (of source is OUTLOOK) en nog geen extern ID heeft
@@ -110,10 +97,7 @@ try {
'description' => "Gepland via Fociz Dagplanning ({$priority})", 'description' => "Gepland via Fociz Dagplanning ({$priority})",
'date' => $date, 'date' => $date,
'start_time' => $timeBlockStart, 'start_time' => $timeBlockStart,
<<<<<<< HEAD
'end_time' => $timeBlockEnd, 'end_time' => $timeBlockEnd,
=======
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
'duration_minutes' => $durationMinutes, 'duration_minutes' => $durationMinutes,
]); ]);
@@ -122,30 +106,11 @@ try {
$externalId = $msResult['event_id']; $externalId = $msResult['event_id'];
$externalUrl = $msResult['web_link'] ?? 'https://outlook.office.com'; $externalUrl = $msResult['web_link'] ?? 'https://outlook.office.com';
$timeBlockStart = $msResult['start_time'] ?? $timeBlockStart; $timeBlockStart = $msResult['start_time'] ?? $timeBlockStart;
<<<<<<< HEAD
$timeBlockEnd = $msResult['end_time'] ?? $timeBlockEnd; $timeBlockEnd = $msResult['end_time'] ?? $timeBlockEnd;
=======
$timeBlockEnd = $msResult['end_time'] ?? null;
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
} else { } else {
$outlookSyncError = $msResult['error'] ?? 'Kon afspraak niet aanmaken in Microsoft Outlook'; $outlookSyncError = $msResult['error'] ?? 'Kon afspraak niet aanmaken in Microsoft Outlook';
} }
} }
<<<<<<< HEAD
=======
// Bereken timeBlockEnd indien nog niet gezet maar wel starttijd bekend
if (!empty($timeBlockStart) && empty($timeBlockEnd)) {
try {
$dtEnd = new DateTime("{$date} {$timeBlockStart}:00", new DateTimeZone('Europe/Amsterdam'));
$dtEnd->modify("+{$durationMinutes} minutes");
$timeBlockEnd = $dtEnd->format('H:i');
} catch (Throwable $e) {
// negeer
}
}
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
$stmt = $db->prepare(" $stmt = $db->prepare("
INSERT INTO tasks (user_id, daily_plan_id, title, priority, time_block_start, time_block_end, duration_minutes, status, source, external_id, external_url) INSERT INTO tasks (user_id, daily_plan_id, title, priority, time_block_start, time_block_end, duration_minutes, status, source, external_id, external_url)
VALUES (?, ?, ?, ?, ?, ?, ?, 'TODO', ?, ?, ?) VALUES (?, ?, ?, ?, ?, ?, ?, 'TODO', ?, ?, ?)
@@ -162,13 +127,14 @@ try {
'time_block_start' => $timeBlockStart, 'time_block_start' => $timeBlockStart,
'time_block_end' => $timeBlockEnd, 'time_block_end' => $timeBlockEnd,
'duration_minutes' => $durationMinutes, 'duration_minutes' => $durationMinutes,
<<<<<<< HEAD 'is_completed' => 0,
'status' => 'TODO',
'source' => $source, 'source' => $source,
'external_id' => $externalId, 'external_id' => $externalId,
'external_url' => $externalUrl 'external_url' => $externalUrl,
], ],
'outlook_synced' => ($source === 'OUTLOOK' && !empty($externalId)), 'outlook_synced' => ($source === 'OUTLOOK' && !empty($externalId)),
'outlook_error' => $outlookSyncError 'outlook_error' => $outlookSyncError,
]); ]);
exit; exit;
} }
@@ -248,16 +214,6 @@ try {
'time_block_start' => $timeBlockStart, 'time_block_start' => $timeBlockStart,
'time_block_end' => $timeBlockEnd, 'time_block_end' => $timeBlockEnd,
'duration_minutes' => $durationMinutes 'duration_minutes' => $durationMinutes
=======
'is_completed' => 0,
'status' => 'TODO',
'source' => $source,
'external_id' => $externalId,
'external_url' => $externalUrl,
],
'outlook_synced' => ($source === 'OUTLOOK' && !empty($externalId)),
'outlook_error' => $outlookSyncError,
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
]); ]);
exit; exit;
} }
@@ -300,10 +256,7 @@ try {
$planDate = $task['plan_date'] ?: $today; $planDate = $task['plan_date'] ?: $today;
$startTime = !empty($task['time_block_start']) ? $task['time_block_start'] : ($data['time_block_start'] ?? '09:00'); $startTime = !empty($task['time_block_start']) ? $task['time_block_start'] : ($data['time_block_start'] ?? '09:00');
<<<<<<< HEAD
$endTime = !empty($task['time_block_end']) ? $task['time_block_end'] : null; $endTime = !empty($task['time_block_end']) ? $task['time_block_end'] : null;
=======
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
$duration = (int)($task['duration_minutes'] ?: 30); $duration = (int)($task['duration_minutes'] ?: 30);
$msResult = microsoft_create_event($user['id'], [ $msResult = microsoft_create_event($user['id'], [
@@ -311,10 +264,7 @@ try {
'description' => "Gepland via Fociz Dagplanning (" . $task['priority'] . ")", 'description' => "Gepland via Fociz Dagplanning (" . $task['priority'] . ")",
'date' => $planDate, 'date' => $planDate,
'start_time' => $startTime, 'start_time' => $startTime,
<<<<<<< HEAD
'end_time' => $endTime, 'end_time' => $endTime,
=======
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
'duration_minutes' => $duration, 'duration_minutes' => $duration,
]); ]);
@@ -394,7 +344,6 @@ try {
exit; exit;
} }
<<<<<<< HEAD
// 6. Realtime Outlook synchronisatie & controle op gewijzigde/gewiste items // 6. Realtime Outlook synchronisatie & controle op gewijzigde/gewiste items
if ($action === 'check_outlook_sync') { if ($action === 'check_outlook_sync') {
$rawInput = file_get_contents('php://input'); $rawInput = file_get_contents('php://input');
@@ -503,8 +452,6 @@ try {
exit; exit;
} }
=======
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
echo json_encode(['error' => 'Onbekende actie']); echo json_encode(['error' => 'Onbekende actie']);
} catch (Exception $e) { } catch (Exception $e) {
http_response_code(500); http_response_code(500);
-12
View File
@@ -1,7 +1,6 @@
# MariaDB Verbinding # MariaDB Verbinding
DB_HOST="192.168.2.33" DB_HOST="192.168.2.33"
DB_PORT="3306" DB_PORT="3306"
<<<<<<< HEAD
DB_NAME="focizdev" DB_NAME="focizdev"
DB_USER="focizdev_user" DB_USER="focizdev_user"
DB_PASS="F0c1z_Dev_Secure_2026!" DB_PASS="F0c1z_Dev_Secure_2026!"
@@ -11,17 +10,6 @@ APP_ENV="development"
# Applicatie URL (voor uitnodigingslinks en OAuth redirects: https://dev.fociz.nl of https://fociz.nl) # Applicatie URL (voor uitnodigingslinks en OAuth redirects: https://dev.fociz.nl of https://fociz.nl)
APP_URL="https://dev.fociz.nl" APP_URL="https://dev.fociz.nl"
=======
DB_NAME="fociz"
DB_USER="focizlive_user"
DB_PASS="F0c1z_Live_Secure_2026!"
# Omgeving: 'development' (knippert rood) of 'live' (knippert groen)
APP_ENV="live"
# Applicatie URL (voor uitnodigingslinks en OAuth redirects: https://dev.fociz.nl of https://fociz.nl)
APP_URL="https://www.fociz.nl"
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
# Applicatie Geheime Sleutel (willekeurige tekenreeks) # Applicatie Geheime Sleutel (willekeurige tekenreeks)
APP_SECRET="fociz-maria-db-super-secret-key-998877" APP_SECRET="fociz-maria-db-super-secret-key-998877"
+1 -11
View File
@@ -68,26 +68,16 @@ if (!function_exists('fociz_env')) {
// MariaDB Verbindingsgegevens (uit .env of .env.example) // MariaDB Verbindingsgegevens (uit .env of .env.example)
define('DB_HOST', fociz_env('DB_HOST', '192.168.2.33')); define('DB_HOST', fociz_env('DB_HOST', '192.168.2.33'));
define('DB_PORT', fociz_env('DB_PORT', '3306')); define('DB_PORT', fociz_env('DB_PORT', '3306'));
<<<<<<< HEAD
define('DB_NAME', fociz_env('DB_NAME', 'focizdev')); define('DB_NAME', fociz_env('DB_NAME', 'focizdev'));
define('DB_USER', fociz_env('DB_USER', 'focizdev_user')); define('DB_USER', fociz_env('DB_USER', 'focizdev_user'));
define('DB_PASS', fociz_env('DB_PASS', 'F0c1z_Dev_Secure_2026!')); define('DB_PASS', fociz_env('DB_PASS', 'F0c1z_Dev_Secure_2026!'));
=======
define('DB_NAME', fociz_env('DB_NAME', 'fociz'));
define('DB_USER', fociz_env('DB_USER', 'focizlive_user'));
define('DB_PASS', fociz_env('DB_PASS', 'F0c1z_Live_Secure_2026!'));
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
define('DB_CHARSET', 'utf8mb4'); define('DB_CHARSET', 'utf8mb4');
// Bepaal de dynamische of geconfigureerde applicatie URL // Bepaal de dynamische of geconfigureerde applicatie URL
if (!function_exists('fociz_detect_app_url')) { if (!function_exists('fociz_detect_app_url')) {
function fociz_detect_app_url(): string { function fociz_detect_app_url(): string {
$envUrl = fociz_env('APP_URL'); $envUrl = fociz_env('APP_URL');
<<<<<<< HEAD if (!empty($envUrl) && !str_contains($envUrl, 'uw-domein.nl') && !str_contains($envUrl, 'www.fociz.nl')) {
if (!empty($envUrl) && !str_contains($envUrl, 'uw-domein.nl')) {
=======
if (!empty($envUrl) && !str_contains($envUrl, 'www.fociz.nl')) {
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
return rtrim($envUrl, '/'); return rtrim($envUrl, '/');
} }
-8
View File
@@ -563,7 +563,6 @@ function microsoft_delete_event(int $userId, string $eventId): bool {
} }
/** /**
<<<<<<< HEAD
* Werkt een bestaande afspraak bij in Microsoft Outlook via Graph API (PATCH) * Werkt een bestaande afspraak bij in Microsoft Outlook via Graph API (PATCH)
*/ */
function microsoft_update_event(int $userId, string $eventId, array $eventData): bool { function microsoft_update_event(int $userId, string $eventId, array $eventData): bool {
@@ -633,8 +632,6 @@ function microsoft_update_event(int $userId, string $eventId, array $eventData):
} }
/** /**
=======
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
* Ontkoppelt Microsoft integratie voor een gebruiker * Ontkoppelt Microsoft integratie voor een gebruiker
* Wist uitsluitend de persoonlijke tokens; behoudt de centrale Azure App gegevens indien aanwezig. * Wist uitsluitend de persoonlijke tokens; behoudt de centrale Azure App gegevens indien aanwezig.
*/ */
@@ -666,7 +663,6 @@ function microsoft_disconnect(int $userId): bool {
} }
} }
<<<<<<< HEAD
/** /**
* Haalt één specifieke afspraak op uit Microsoft Outlook via Graph API. * Haalt één specifieke afspraak op uit Microsoft Outlook via Graph API.
* Retourneert: * Retourneert:
@@ -885,7 +881,3 @@ function microsoft_reconcile_tasks_with_outlook(int $userId, string $startDate,
'updated' => $updatedCount, 'updated' => $updatedCount,
]; ];
} }
=======
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
-8
View File
@@ -48,7 +48,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
exit; exit;
} }
<<<<<<< HEAD
// 2b. Outlook synchronisatievoorkeuren opslaan // 2b. Outlook synchronisatievoorkeuren opslaan
elseif ($action === 'save_outlook_settings') { elseif ($action === 'save_outlook_settings') {
$syncInterval = (int)($_POST['sync_interval_seconds'] ?? 30); $syncInterval = (int)($_POST['sync_interval_seconds'] ?? 30);
@@ -65,9 +64,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$message = "Uw Microsoft Outlook synchronisatievoorkeur is succesvol opgeslagen."; $message = "Uw Microsoft Outlook synchronisatievoorkeur is succesvol opgeslagen.";
$messageType = 'success'; $messageType = 'success';
} }
=======
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
// 3. Jira Opslaan & Testen // 3. Jira Opslaan & Testen
elseif ($action === 'save_jira') { elseif ($action === 'save_jira') {
$companyDomain = jira_get_company_domain(); $companyDomain = jira_get_company_domain();
@@ -482,7 +478,6 @@ require_once __DIR__ . '/includes/header.php';
</div> </div>
</div> </div>
<<<<<<< HEAD
<form method="POST" class="mt-4 p-4 rounded-xl bg-slate-50/70 dark:bg-slate-900/60 border border-slate-200/80 dark:border-slate-800 flex flex-col sm:flex-row sm:items-center justify-between gap-4"> <form method="POST" class="mt-4 p-4 rounded-xl bg-slate-50/70 dark:bg-slate-900/60 border border-slate-200/80 dark:border-slate-800 flex flex-col sm:flex-row sm:items-center justify-between gap-4">
<input type="hidden" name="action" value="save_outlook_settings"> <input type="hidden" name="action" value="save_outlook_settings">
<div class="space-y-1"> <div class="space-y-1">
@@ -508,9 +503,6 @@ require_once __DIR__ . '/includes/header.php';
</button> </button>
</div> </div>
</form> </form>
=======
>>>>>>> dd738e670b78819c11e329da93db1b472808f195
<div class="mt-4 p-3.5 rounded-xl bg-teal-50 dark:bg-teal-500/10 border border-teal-200 dark:border-teal-500/20 text-teal-800 dark:text-teal-300 text-xs flex items-center justify-between"> <div class="mt-4 p-3.5 rounded-xl bg-teal-50 dark:bg-teal-500/10 border border-teal-200 dark:border-teal-500/20 text-teal-800 dark:text-teal-300 text-xs flex items-center justify-between">
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<i data-lucide="check-circle" class="w-4 h-4 text-teal-600 dark:text-teal-400 flex-shrink-0"></i> <i data-lucide="check-circle" class="w-4 h-4 text-teal-600 dark:text-teal-400 flex-shrink-0"></i>