diff --git a/module/testtask/model.php b/module/testtask/model.php index 9564cc7079..aa7c293c6f 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -34,7 +34,7 @@ class testtaskModel extends model ->stripTags($this->config->testtask->editor->create['id'], $this->config->allowedTags) ->join('mailto', ',') ->join('type', ',') - ->remove('uid,contactListMenu') + ->remove('files,labels,uid,contactListMenu') ->get(); $task = $this->loadModel('file')->processImgURL($task, $this->config->testtask->editor->create['id'], $this->post->uid); @@ -50,6 +50,7 @@ class testtaskModel extends model { $taskID = $this->dao->lastInsertID(); $this->file->updateObjectID($this->post->uid, $taskID, 'testtask'); + $this->file->saveUpload('testtask', $taskID); return $taskID; } } @@ -268,6 +269,7 @@ class testtaskModel extends model $task = $this->loadModel('file')->replaceImgURL($task, 'desc'); if($setImgSize) $task->desc = $this->loadModel('file')->setImgSize($task->desc); + $task->files = $this->loadModel('file')->getByObject('testtask', $task->id); return $task; } @@ -731,7 +733,7 @@ class testtaskModel extends model public function update($taskID) { $oldTask = $this->dao->select("*")->from(TABLE_TESTTASK)->where('id')->eq((int)$taskID)->fetch(); - $task = fixer::input('post')->stripTags($this->config->testtask->editor->edit['id'], $this->config->allowedTags)->join('mailto', ',')->join('type', ',')->remove('uid,comment,contactListMenu')->get(); + $task = fixer::input('post')->stripTags($this->config->testtask->editor->edit['id'], $this->config->allowedTags)->join('mailto', ',')->join('type', ',')->remove('files,labels,uid,comment,contactListMenu')->get(); $task = $this->loadModel('file')->processImgURL($task, $this->config->testtask->editor->edit['id'], $this->post->uid); $this->dao->update(TABLE_TESTTASK)->data($task) ->autoCheck() @@ -742,6 +744,7 @@ class testtaskModel extends model if(!dao::isError()) { $this->file->updateObjectID($this->post->uid, $taskID, 'testtask'); + $this->file->saveUpload('testtask', $taskID); return common::createChanges($oldTask, $task); } } diff --git a/module/testtask/view/create.html.php b/module/testtask/view/create.html.php index c33e286a64..0820726f43 100644 --- a/module/testtask/view/create.html.php +++ b/module/testtask/view/create.html.php @@ -86,6 +86,10 @@