+
-
-
-
Laat leeg voor handmatig inplannen op de tijdlijn
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Laat leeg voor handmatig inplannen
+
+
+
+
+
+
@@ -1802,8 +1851,10 @@ if ($isAjaxRequest) {
+
+
-
+
+
@@ -2970,6 +3021,9 @@ const plannerTicketStore = new Map();
plannerJiraAll.forEach(iss => {
if (iss && iss.key) plannerTicketStore.set(iss.key, iss);
});
+plannerJiraAssigned.forEach(iss => {
+ if (iss && iss.key && !plannerTicketStore.has(iss.key)) plannerTicketStore.set(iss.key, iss);
+});
let activePlannerJiraQueue = ''; // '': Alle, 'my': Mijn, 'DX': DX Queue, 'SD': SD Queue
@@ -3191,9 +3245,35 @@ function openJiraPlanFromDetail() {
}
}
-// --- Jira Plan Modal (met tijdsuggestie) ---
+// --- Jira Plan Modal (met datum, tijdsuggestie & aanpasbare titel) ---
let _jiraPlanCurrentIssue = null;
+function clearJiraPlanStartTime() {
+ const input = document.getElementById('jiraPlanStartTime');
+ if (input) {
+ input.value = '';
+ input.focus();
+ }
+}
+
+function toggleJiraPlanDescription() {
+ const wrapper = document.getElementById('jiraPlanDescWrapper');
+ const chevron = document.getElementById('jiraPlanDescChevron');
+ const label = document.getElementById('jiraPlanDescToggleLabel');
+ if (!wrapper) return;
+ const isHidden = wrapper.classList.contains('hidden');
+ if (isHidden) {
+ wrapper.classList.remove('hidden');
+ if (chevron) chevron.classList.add('rotate-180');
+ if (label) label.textContent = 'Inhoud inklappen';
+ } else {
+ wrapper.classList.add('hidden');
+ if (chevron) chevron.classList.remove('rotate-180');
+ if (label) label.textContent = 'Inhoud van het item bekijken';
+ }
+ if (typeof lucide !== 'undefined') lucide.createIcons();
+}
+
function openJiraPlanModal(issueKey) {
const issue = plannerTicketStore.get(issueKey);
if (!issue) return;
@@ -3214,6 +3294,32 @@ function openJiraPlanModal(issueKey) {
spBadge.classList.add('hidden');
}
+ // Vul beschrijving (10 regels scrollbaar venstertje) en reset naar ingeklapt
+ const descEl = document.getElementById('jiraPlanModalDescription');
+ if (descEl) {
+ const descText = (issue.description && issue.description.trim()) ? issue.description.trim() : 'Geen beschrijving beschikbaar voor dit ticket.';
+ descEl.textContent = descText;
+ }
+ const descWrapper = document.getElementById('jiraPlanDescWrapper');
+ const descChevron = document.getElementById('jiraPlanDescChevron');
+ const descLabel = document.getElementById('jiraPlanDescToggleLabel');
+ if (descWrapper) descWrapper.classList.add('hidden');
+ if (descChevron) descChevron.classList.remove('rotate-180');
+ if (descLabel) descLabel.textContent = 'Inhoud van het item bekijken';
+
+ // Titel hoe het in de agenda komt: standaard "Oppakken Jira item "
+ const titleInput = document.getElementById('jiraPlanCustomTitle');
+ if (titleInput) {
+ titleInput.value = `Oppakken Jira item ${issue.key}`;
+ }
+
+ // Datum: standaard de actieve planner datum of vandaag
+ const dateInput = document.getElementById('jiraPlanDate');
+ const targetDate = (typeof activePlannerDate !== 'undefined' && activePlannerDate) ? activePlannerDate : new Date().toISOString().slice(0, 10);
+ if (dateInput) {
+ dateInput.value = targetDate;
+ }
+
// Standaard duur: 15 min (of op basis van SP: 1 SP = 30 min)
let defaultDuration = 15;
if (issue.story_points && issue.story_points > 0) {
@@ -3233,9 +3339,8 @@ function openJiraPlanModal(issueKey) {
// Slimme starttijd: stel het volgende vrije kwartier voor
const now = new Date();
- const suggestTime = activePlannerDate === now.toISOString().slice(0,10)
- ? suggestNextFreeSlot()
- : '09:00';
+ const todayStr = now.toISOString().slice(0, 10);
+ const suggestTime = targetDate === todayStr ? suggestNextFreeSlot() : '09:00';
document.getElementById('jiraPlanStartTime').value = suggestTime;
const modal = document.getElementById('jiraPlanModal');
@@ -3281,6 +3386,13 @@ async function submitJiraPlanModal() {
if (!_jiraPlanCurrentIssue) return;
const issue = _jiraPlanCurrentIssue;
+ const titleInput = document.getElementById('jiraPlanCustomTitle');
+ const customTitle = titleInput ? titleInput.value.trim() : '';
+ const finalTitle = customTitle || `Oppakken Jira item ${issue.key}`;
+
+ const dateInput = document.getElementById('jiraPlanDate');
+ const planDate = (dateInput && dateInput.value) ? dateInput.value : ((typeof activePlannerDate !== 'undefined' && activePlannerDate) ? activePlannerDate : new Date().toISOString().slice(0, 10));
+
const duration = parseInt(document.getElementById('jiraPlanDuration').value, 10) || 15;
const startTime = document.getElementById('jiraPlanStartTime').value.trim();
const priority = document.getElementById('jiraPlanPriority').value;
@@ -3292,13 +3404,13 @@ async function submitJiraPlanModal() {
try {
const payload = {
- title: `[${issue.key}] ${issue.summary || issue.key}`,
+ title: finalTitle,
priority: priority,
source: 'JIRA',
external_id: issue.key,
external_url: issue.url || '',
duration_minutes: duration,
- date: activePlannerDate
+ date: planDate
};
if (startTime) {
payload.time_block_start = startTime;
@@ -3318,7 +3430,9 @@ async function submitJiraPlanModal() {
if (data.success) {
closeJiraPlanModal();
showWidgetToast(`${escapeHtml(issue.key)} ingepland als dagtaak`, 'success');
- switchPlannerDate(activePlannerDate, null, false);
+ if (typeof switchPlannerDate === 'function') {
+ switchPlannerDate(planDate, null, false);
+ }
} else {
alert(data.error || 'Kon ticket niet inplannen');
btn.innerHTML = origHtml;