* finish task#1644.

This commit is contained in:
azhi
2013-07-30 16:21:21 +08:00
parent c998424270
commit 736f01df7b
9 changed files with 74 additions and 11 deletions
+14
View File
@@ -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'));
}
}
+16
View File
@@ -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();
}
}
+1 -1
View File
@@ -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');
+32 -2
View File
@@ -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 = "<span onclick='toggleStripTags(this)' class='hidden changeDiff diff-all hand' title='<?php echo $lang->action->original?>'>&nbsp;</span>";
var newBoxID = ''
@@ -114,6 +121,7 @@ $(function(){
<ol id='historyItem'>
<?php $i = 1; ?>
<?php foreach($actions as $action):?>
<?php $canEditComment = (end($actions) == $action and $action->comment and $this->methodName == 'view' and $action->actor == $this->app->user->account);?>
<li value='<?php echo $i ++;?>'>
<?php
if(isset($users[$action->actor])) $action->actor = $users[$action->actor];
@@ -124,13 +132,35 @@ $(function(){
<?php $this->action->printAction($action);?>
<?php if(!empty($action->history)) echo "<span id='switchButton$i' class='hand change-show' onclick=switchChange($i)>&nbsp;</span>";?>
</span>
<?php if($canEditComment):?>
<span class='link-button f-right comment<?php echo $action->id;?>'><?php echo html::a('#lastCommentBox', '&nbsp;', '', "class='icon-green-common-edit' onclick='toggleComment($action->id)'")?></span>
<?php endif;?>
<?php if(!empty($action->comment) or !empty($action->history)):?>
<?php if(!empty($action->comment)) echo "<div class='history'>";?>
<div class='changes hidden' id='changeBox<?php echo $i;?>'>
<?php echo $this->action->printChanges($action->objectType, $action->history);?>
</div>
<?php if($action->comment) echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment; ?>
<?php if(!empty($action->comment)) echo "</div>";?>
<?php
if($action->comment)
{
echo "<div class='comment$action->id'>";
echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment;
echo "</div>";
}
?>
<?php if($canEditComment):?>
<div class='hidden' id='lastCommentBox'>
<form method='post' action='<?php echo $this->createLink('action', 'editComment', "actionID=$action->id")?>'>
<table align='center' class='table-1'>
<tr><td><?php echo html::textarea('lastComment', $action->comment,"rows='5' class='w-p100'");?></td></tr>
<tr><td><?php echo html::submitButton() . html::commonButton($lang->goback, "onclick='toggleComment($action->id)' class='button-s'");?></td></tr>
</table>
</form>
</div>
<?php endif;?>
<?php if(!empty($action->comment)) echo "</div>";?>
<?php endif;?>
</li>
<?php endforeach;?>
+7 -6
View File
@@ -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 = '
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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');
+1
View File
@@ -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');
+1
View File
@@ -11,6 +11,7 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<div id='titlebar'>
<div id='main' <?php if($task->deleted) echo "class='deleted'";?>>TESTTASK #<?php echo $task->id . ' ' . $task->title;?></div>
<div>