feat(planner): add widget layout saving and scratchpad note functionality
feat(notifications): implement real-time live sync for mail, Jira, and calendar updates fix(database): add new columns for widget layout and last check timestamps fix(schema): update users table schema to include new fields for widget layout and last checks feat(microsoft): enhance Microsoft integration with demo email data and inbox fetching feat(jira): add listener for live updates on Jira tickets
This commit is contained in:
@@ -32,6 +32,40 @@ try {
|
||||
exit;
|
||||
}
|
||||
|
||||
// 1b. Widget layout opslaan
|
||||
if ($action === 'save_widget_layout') {
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
$layout = $data['layout'] ?? null;
|
||||
|
||||
if (!is_array($layout)) {
|
||||
echo json_encode(['success' => false, 'error' => 'Ongeldig layout formaat']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("UPDATE users SET fociz_widget_layout = ? WHERE id = ?");
|
||||
$stmt->execute([json_encode($layout), $user['id']]);
|
||||
|
||||
echo json_encode(['success' => true, 'message' => 'Widget indeling succesvol opgeslagen']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// 1c. Scratchpad snelle notities opslaan
|
||||
if ($action === 'save_scratchpad') {
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
$date = $data['date'] ?? $today;
|
||||
$notes = $data['notes'] ?? '';
|
||||
|
||||
$stmt = $db->prepare("
|
||||
INSERT INTO daily_plans (user_id, plan_date, notes)
|
||||
VALUES (?, ?, ?)
|
||||
ON DUPLICATE KEY UPDATE notes = VALUES(notes)
|
||||
");
|
||||
$stmt->execute([$user['id'], $date, $notes]);
|
||||
|
||||
echo json_encode(['success' => true]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// 2. Taak toevoegen
|
||||
if ($action === 'add_task') {
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
Reference in New Issue
Block a user