From 69678126260cd9e07c9f5c25373d3e4b1d3399f9 Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Tue, 15 Dec 2009 22:58:28 +0300 Subject: [PATCH] + In task edit: show dates when the task was created and completed --- src/ajax.js | 7 +++++-- src/ajax.php | 1 + src/index.php | 5 +++++ src/init.php | 2 +- src/style.css | 3 +++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ajax.js b/src/ajax.js index 017b981..fdb6c8e 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -288,6 +288,9 @@ function editTask(id) for(var i=0; ispan').text(item.date); + if(item.compl) $('#taskedit-date .date-completed').show().find('span').text(item.dateCompleted); + else $('#taskedit-date .date-completed').hide(); showEditForm(); return false; } @@ -299,11 +302,11 @@ function showEditForm(isAdd) if(document.selection && document.selection.empty) document.selection.empty(); else if(window.getSelection) window.getSelection().removeAllRanges(); if(isAdd) { - showhide($('#page_taskedit>h3.mtt-inadd'), $('#page_taskedit>h3.mtt-inedit')); + $('#page_taskedit').removeClass('mtt-inedit').addClass('mtt-inadd'); document.edittask.isadd.value = 1; } else { - showhide( $('#page_taskedit>h3.mtt-inedit'), $('#page_taskedit>h3.mtt-inadd')); + $('#page_taskedit').removeClass('mtt-inadd').addClass('mtt-inedit'); document.edittask.isadd.value = 0; } var w = $('#page_taskedit'); diff --git a/src/ajax.php b/src/ajax.php index 7f404b8..9994133 100644 --- a/src/ajax.php +++ b/src/ajax.php @@ -439,6 +439,7 @@ function prepareTaskRow($r, $tz) 'title' => htmlarray($r['title']), 'date' => htmlarray($dCreated), 'dateInline' => htmlarray(sprintf($lang->get('taskdate_inline'), $dCreated)), + 'dateCompleted' => htmlarray(timestampToDatetime($r['d_completed'], $tz)), 'compl' => (int)$r['compl'], 'prio' => $r['prio'], 'note' => nl2br(htmlarray($r['note'])), diff --git a/src/index.php b/src/index.php index 457d67d..abb9a3b 100644 --- a/src/index.php +++ b/src/index.php @@ -141,6 +141,11 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );