From: Jan Schneider Date: Fri, 12 Feb 2010 10:49:56 +0000 (+0100) Subject: Re-enable inactive task forms. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c97753325f0fd44106f75067929fb28c131bf724;p=horde.git Re-enable inactive task forms. Create task cache when adding a first task. Show "no items" initially when no tasks exist from the start. Catch edge case when to-be-deleted tasks don't exist anymore. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 77510fb75..ac70ce2af 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -1563,9 +1563,11 @@ KronolithCore = { } tasktypes.each(function(type) { + if (Object.isUndefined(this.tcache.get(type))) { + this._storeTasksCache($H(), type, null, true); + } tasklists.each(function(list) { - if (Object.isUndefined(this.tcache.get(type)) || - Object.isUndefined(this.tcache.get(type).get(list))) { + if (Object.isUndefined(this.tcache.get(type).get(list))) { loading = true; this.startLoading('tasks:' + type + list, tasktype); this._storeTasksCache($H(), type, list, true); @@ -1840,6 +1842,8 @@ KronolithCore = { $('kronolithTaskPriority').setValue(3); $('kronolithTaskCompleted').setValue(0); $('kronolithTaskDelete').hide(); + $('kronolithTaskSave').show(); + $('kronolithTaskForm').enable(); RedBox.showHtml($('kronolithTaskDialog').show()); } }, @@ -2284,6 +2288,9 @@ KronolithCore = { return; } } + if (!tasklist) { + return; + } if (!this.tcache.get(tasktype).get(tasklist)) { if (createCache) { this.tcache.get(tasktype).set(tasklist, $H()); @@ -2607,10 +2614,13 @@ KronolithCore = { }).toggle(); } }.bind(this)); - $('kronolithViewTasksBody').select('tr').find(function(el) { + var taskrow = $('kronolithViewTasksBody').select('tr').find(function(el) { return el.retrieve('tasklist') == tasklist && el.retrieve('taskid') == taskid; - }).hide(); + }); + if (taskrow) { + taskrow.hide(); + } this._closeRedBox(); window.history.back(); e.stop(); diff --git a/kronolith/templates/index/tasks.inc b/kronolith/templates/index/tasks.inc index 53cdb375b..00f6bd2aa 100644 --- a/kronolith/templates/index/tasks.inc +++ b/kronolith/templates/index/tasks.inc @@ -21,7 +21,7 @@
- +