diff --git a/module/action/control.php b/module/action/control.php index 7382d78409..54752c83c8 100644 --- a/module/action/control.php +++ b/module/action/control.php @@ -100,4 +100,18 @@ class action extends control die(js::reload('parent')); } } + + /** + * Edit comment of a action. + * + * @param int $actionID + * @access public + * @return void + */ + public function editComment($actionID) + { + if(!strip_tags($this->post->lastComment)) die(js::locate($this->server->http_referer, 'parent')); + $this->action->updateComment($actionID); + die(js::locate($this->server->http_referer, 'parent')); + } } diff --git a/module/action/model.php b/module/action/model.php index c604bbdf50..db56467676 100644 --- a/module/action/model.php +++ b/module/action/model.php @@ -669,4 +669,20 @@ class actionModel extends model ->andWhere('extra')->eq(self::CAN_UNDELETED) ->exec(); } + + /** + * Update comment of a action. + * + * @param int $actionID + * @access public + * @return void + */ + public function updateComment($actionID) + { + $this->dao->update(TABLE_ACTION) + ->set('date')->eq(helper::now()) + ->set('comment')->eq($this->post->lastComment) + ->where('id')->eq($actionID) + ->exec(); + } } diff --git a/module/bug/config.php b/module/bug/config.php index 30d551621e..d5217f2307 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -41,7 +41,7 @@ $config->bug->list->exportFields = 'id, product, module, project, story, task, $config->bug->editor = new stdclass(); $config->bug->editor->create = array('id' => 'steps', 'tools' => 'bugTools'); $config->bug->editor->edit = array('id' => 'steps,comment', 'tools' => 'bugTools'); -$config->bug->editor->view = array('id' => 'comment', 'tools' => 'bugTools'); +$config->bug->editor->view = array('id' => 'comment,lastComment', 'tools' => 'bugTools'); $config->bug->editor->confirmbug = array('id' => 'comment', 'tools' => 'bugTools'); $config->bug->editor->assignto = array('id' => 'comment', 'tools' => 'bugTools'); $config->bug->editor->resolve = array('id' => 'comment', 'tools' => 'bugTools'); diff --git a/module/common/view/action.html.php b/module/common/view/action.html.php index 7910a153bd..36500a98bf 100644 --- a/module/common/view/action.html.php +++ b/module/common/view/action.html.php @@ -75,6 +75,13 @@ function toggleOrder(obj) $("#historyItem li").reverseOrder(); } +function toggleComment(actionID) +{ + $('.comment' + actionID).toggle(); + $('#lastCommentBox').toggle(); + $('.ke-container').css('width', '100%'); +} + $(function(){ var diffButton = ""; var newBoxID = '' @@ -114,6 +121,7 @@ $(function(){
    + comment and $this->methodName == 'view' and $action->actor == $this->app->user->account);?>
  1. actor])) $action->actor = $users[$action->actor]; @@ -124,13 +132,35 @@ $(function(){ action->printAction($action);?> history)) echo " ";?> + + id)'")?> + comment) or !empty($action->history)):?> comment)) echo "
    ";?> - comment) echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment; ?> - comment)) echo "
    ";?> + comment) + { + echo "
    "; + echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment; + echo "
    "; + } + ?> + + + + + + comment)) echo "";?>
  2. diff --git a/module/story/config.php b/module/story/config.php index ddd5e0bb91..af4cc83745 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -22,12 +22,13 @@ $config->story->close->requiredFields = 'closedReason'; $config->story->review->requiredFields = 'assignedTo,reviewedBy,result'; $config->story->editor = new stdclass(); -$config->story->editor->create = array('id' => 'spec,verify', 'tools' => 'simpleTools'); -$config->story->editor->change = array('id' => 'spec,verify,comment', 'tools' => 'simpleTools'); -$config->story->editor->edit = array('id' => 'comment', 'tools' => 'simpleTools'); -$config->story->editor->view = array('id' => 'comment', 'tools' => 'simpleTools'); -$config->story->editor->close = array('id' => 'comment', 'tools' => 'simpleTools'); -$config->story->editor->review = array('id' => 'comment', 'tools' => 'simpleTools'); +$config->story->editor->create = array('id' => 'spec,verify', 'tools' => 'simpleTools'); +$config->story->editor->change = array('id' => 'spec,verify,comment', 'tools' => 'simpleTools'); +$config->story->editor->edit = array('id' => 'comment', 'tools' => 'simpleTools'); +$config->story->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools'); +$config->story->editor->close = array('id' => 'comment', 'tools' => 'simpleTools'); +$config->story->editor->review = array('id' => 'comment', 'tools' => 'simpleTools'); +$config->story->editor->activate = array('id' => 'comment', 'tools' => 'simpleTools'); $config->story->list = new stdclass(); $config->story->list->exportFields = ' diff --git a/module/task/config.php b/module/task/config.php index 1bf8a1203d..bc32e2d480 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -20,7 +20,7 @@ $config->task->batchEdit->columns = 13; $config->task->editor = new stdclass(); $config->task->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); $config->task->editor->edit = array('id' => 'desc,comment', 'tools' => 'simpleTools'); -$config->task->editor->view = array('id' => 'comment', 'tools' => 'simpleTools'); +$config->task->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools'); $config->task->editor->assignto = array('id' => 'comment', 'tools' => 'simpleTools'); $config->task->editor->start = array('id' => 'comment', 'tools' => 'simpleTools'); $config->task->editor->finish = array('id' => 'comment', 'tools' => 'simpleTools'); diff --git a/module/testcase/config.php b/module/testcase/config.php index 7aff20f527..8a43ec311e 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -12,7 +12,7 @@ $config->testcase->batchEdit->columns = 7; $config->testcase->editor = new stdclass(); $config->testcase->editor->edit = array('id' => 'comment', 'tools' => 'simpleTools'); -$config->testcase->editor->view = array('id' => 'comment', 'tools' => 'simpleTools'); +$config->testcase->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools'); $config->testcase->export = new stdclass(); $config->testcase->export->listFields = array('type', 'stage', 'pri', 'status'); diff --git a/module/testtask/config.php b/module/testtask/config.php index 7d2a2c7fac..00067b09cc 100644 --- a/module/testtask/config.php +++ b/module/testtask/config.php @@ -8,5 +8,6 @@ $config->testtask->edit->requiredFields = 'project,build,begin,end,name'; $config->testtask->editor = new stdclass(); $config->testtask->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); $config->testtask->editor->edit = array('id' => 'desc,report', 'tools' => 'simpleTools'); +$config->testtask->editor->view = array('id' => 'lastComment', 'tools' => 'simpleTools'); $config->testtask->editor->start = array('id' => 'comment', 'tools' => 'simpleTools'); $config->testtask->editor->close = array('id' => 'report,comment', 'tools' => 'simpleTools'); diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php index e153b4e1c4..31dc19ebaa 100644 --- a/module/testtask/view/view.html.php +++ b/module/testtask/view/view.html.php @@ -11,6 +11,7 @@ */ ?> +
    deleted) echo "class='deleted'";?>>TESTTASK #id . ' ' . $task->title;?>