* add story files and comments for task view.
This commit is contained in:
@@ -455,7 +455,9 @@ class task extends control
|
||||
else
|
||||
{
|
||||
$story = $this->story->getById($task->story);
|
||||
$task->storySpec = empty($story) ? '' : $story->spec;
|
||||
$task->storySpec = empty($story) ? '' : $story->spec;
|
||||
$task->storyComments = empty($story) ? array() : $this->task->getStoryComments($task->story);
|
||||
$task->storyFiles = $this->loadModel('file')->getByObject('story', $task->story);
|
||||
}
|
||||
|
||||
/* Update action. */
|
||||
|
||||
@@ -40,8 +40,11 @@ $lang->task->module = 'Module';
|
||||
$lang->task->story = 'Story';
|
||||
$lang->task->storySpec = 'Story desc';
|
||||
$lang->task->storyVersion = 'Version';
|
||||
$lang->task->storyFiles = 'Story Files';
|
||||
$lang->task->storyComment = 'Story comment';
|
||||
$lang->task->name = 'Name';
|
||||
$lang->task->type = 'Type';
|
||||
$lang->task->taskFiles = 'Task files';
|
||||
$lang->task->pri = 'Pri';
|
||||
$lang->task->mailto = 'Mailto';
|
||||
$lang->task->estimate = 'Estimate';
|
||||
@@ -150,6 +153,7 @@ $lang->task->remindBug = "This task from Bug, update the Bug:%s or n
|
||||
$lang->task->confirmChangeProject = "Change {$lang->projectCommon} will change module, story and assignedTo also, are you sure?";
|
||||
$lang->task->confirmFinish = '"Left" is zero, this task will be done. Are you sure?';
|
||||
$lang->task->confirmRecord = '"Left" is zero, this task will be done. Are you sure?';
|
||||
$lang->task->commentActions = '%s. %s, commented by<strong>%s</strong>.';
|
||||
|
||||
$lang->task->error = new stdclass();
|
||||
$lang->task->error->consumedNumber = '"Consumed" must be number';
|
||||
|
||||
@@ -40,8 +40,11 @@ $lang->task->module = '所属模块';
|
||||
$lang->task->story = '相关需求';
|
||||
$lang->task->storySpec = '需求描述';
|
||||
$lang->task->storyVersion = '需求版本';
|
||||
$lang->task->storyFiles = '需求附件';
|
||||
$lang->task->storyComment = '需求备注';
|
||||
$lang->task->name = '任务名称';
|
||||
$lang->task->type = '任务类型';
|
||||
$lang->task->taskFiles = '任务附件';
|
||||
$lang->task->pri = '优先级';
|
||||
$lang->task->mailto = '抄送给';
|
||||
$lang->task->estimate = '最初预计';
|
||||
@@ -150,6 +153,7 @@ $lang->task->remindBug = "该任务为Bug转化得到,是否更新
|
||||
$lang->task->confirmChangeProject = "修改{$lang->projectCommon}会导致相应的所属模块、相关需求和指派人发生变化,确定吗?";
|
||||
$lang->task->confirmFinish = '"预计剩余"为0,确认将任务状态改为"已完成"吗?';
|
||||
$lang->task->confirmRecord = '"剩余"为0,任务将标记为"已完成",您确定吗?';
|
||||
$lang->task->commentActions = '%s. %s, 由 <strong>%s</strong> 添加备注。';
|
||||
|
||||
$lang->task->error = new stdclass();
|
||||
$lang->task->error->consumedNumber = '"已经消耗"必须为数字';
|
||||
|
||||
@@ -1112,6 +1112,22 @@ class taskModel extends model
|
||||
return $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get story comments.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getStoryComments($storyID)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq('story')
|
||||
->andWhere('objectID')->eq($storyID)
|
||||
->andWhere('comment')->ne('')
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the default chart settings and the settings of current chart.
|
||||
*
|
||||
|
||||
@@ -71,6 +71,10 @@
|
||||
<legend><?php echo $lang->task->legendDesc;?></legend>
|
||||
<div class='article-content'><?php echo $task->desc;?></div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->task->taskFiles;?></legend>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'false'));?>
|
||||
</fieldset>
|
||||
<?php if($task->fromBug != 0):?>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->steps;?></legend>
|
||||
@@ -81,8 +85,26 @@
|
||||
<legend><?php echo $lang->task->storySpec;?></legend>
|
||||
<div class='article-content'><?php echo $task->storySpec;?></div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->task->storyFiles;?></legend>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $task->storyFiles, 'fieldset' => 'false'));?>
|
||||
</fieldset>
|
||||
<fieldset class='actionbox'>
|
||||
<legend><?php echo $lang->task->storyComment;?></legend>
|
||||
<?php
|
||||
foreach($task->storyComments as $item => $commentAction)
|
||||
{
|
||||
if(isset($users[$commentAction->actor])) $commentAction->actor = $users[$commentAction->actor];
|
||||
if(strpos($commentAction->actor, ':') !== false) $commentAction->actor = substr($commentAction->actor, strpos($commentAction->actor, ':') + 1);
|
||||
printf($lang->task->commentActions, $item + 1, $commentAction->date, $commentAction->actor);
|
||||
|
||||
echo "<div class='history article-content'>";
|
||||
echo strip_tags($commentAction->comment) == $commentAction->comment ? nl2br($commentAction->comment) : $commentAction->comment;
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
</fieldset>
|
||||
<?php endif;?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true'));?>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
<div class='actions'> <?php if(!$task->deleted) echo $actionLinks;?></div>
|
||||
<fieldset id='commentBox' class='hide'>
|
||||
|
||||
Reference in New Issue
Block a user