- incorrect date of completion on complete task

This commit is contained in:
Max Pozdeev 2010-11-13 17:37:24 +03:00
parent c7039ee175
commit 5b7440680a
2 changed files with 6 additions and 6 deletions

View file

@ -206,7 +206,8 @@ elseif(isset($_GET['completeTask']))
array($dateCompleted, time()) );
$t = array();
$t['total'] = 1;
$t['list'][] = array('id'=>$id, 'compl'=>$compl, 'ow'=>$ow, 'dateCompleted'=>$dateCompleted?htmlarray(timestampToDatetime($dateCompleted)):'');
$r = $db->sqa("SELECT * FROM {$db->prefix}todolist WHERE id=$id");
$t['list'][] = prepareTaskRow($r);
echo json_encode($t);
exit;
}

View file

@ -1149,9 +1149,7 @@ function completeTask(id, ch)
var item = json.list[0];
if(item.compl) $('#taskrow_'+id).addClass('task-completed');
else $('#taskrow_'+id).removeClass('task-completed');
taskList[id].ow = item.ow;
taskList[id].compl = item.compl;
taskList[id].dateCompleted = item.dateCompleted;
taskList[id] = item;
changeTaskCnt(taskList[id], 0);
if(item.compl && !curList.showCompl) {
delete taskList[id];
@ -1159,8 +1157,9 @@ function completeTask(id, ch)
$('#taskrow_'+id).fadeOut('normal', function(){ $(this).remove() });
}
else if(curList.showCompl) {
$('#taskrow_'+id).fadeOut('fast', function(){
changeTaskOrder(id);
$('#taskrow_'+item.id).replaceWith(prepareTaskStr(taskList[id]));
$('#taskrow_'+id).fadeOut('fast', function(){
changeTaskOrder(id);
$(this).effect("highlight", {color:_mtt.theme.editTaskFlashColor}, 'normal', function(){$(this).css('display','')});
});
}