* Adjust details about tree page of project.

This commit is contained in:
daitingting
2018-05-22 15:11:11 +08:00
parent a39675dc22
commit 5d27c53fd2
5 changed files with 162 additions and 98 deletions
+8 -1
View File
@@ -11,17 +11,22 @@ $(function()
// 根据列表展开树形列表
var showTreeLevel = function(level)
{
$('.btn-tree-view').removeClass('btn-active-text');
if (level === 'root')
{
$('[data-type=root]').addClass('btn-active-text');
taskTree.collapse();
}
else if (level === 'all')
{
$('[data-type=all]').addClass('btn-active-text');
taskTree.collapse();
taskTree.expand($taskTree.find('li.has-list'), true);
}
else if (level === 'task')
{
$('[data-type=task]').addClass('btn-active-text');
taskTree.collapse();
taskTree.show($taskTree.find('li.item-task').parent().parent(), true);
}
@@ -29,13 +34,15 @@ $(function()
{
taskTree.collapse();
taskTree.show($taskTree.find('li.item-story').parent().parent(), true);
$('[data-type=story]').addClass('btn-active-text');
}
$('#main').toggleClass('tree-show-root', level === 'root');
};
$(document).on('click', '.btn-tree-view', function()
{
showTreeLevel($(this).data('type'));
showTreeLevel($(this).data('type'));
return false;
});
// 第一次访问时,展示所以节点
+4 -4
View File
@@ -2758,23 +2758,23 @@ class projectModel extends model
case 'module':
$this->app->loadLang('tree');
$html .= "<li class='item-module'>";
$html .= '<a class="tree-toggle"><span class="label label-type">' . (empty($tree->parent) ? $this->lang->tree->module : $this->lang->tree->child) . '</span><span class="title">' . $tree->name . '</span></a>';
$html .= '<a class="tree-toggle"><span class="label label-type">' . (empty($tree->parent) ? $this->lang->tree->module : $this->lang->tree->child) . "</span><span class='title' title='{$tree->name}'>" . $tree->name . '</span></a>';
break;
case 'task':
$link = helper::createLink('project', 'treeTask', "taskID={$tree->id}");
$html .= '<li class="item-task">';
$html .= '<a class="tree-link" href="' . $link . '"><span class="label label-id">' . $tree->id . '</span><span class="label label-type">' . (empty($tree->parent) ? $this->lang->task->common : $this->lang->task->children) . '</span><span class="title">' . $tree->title . '</span> <span class="user"><i class="icon icon-person"></i> ' . (empty($tree->assignedTo) ? $tree->openedBy : $tree->assignedTo) . '</span></a>';
$html .= '<a class="tree-link" href="' . $link . '"><span class="label label-id">' . $tree->id . '</span><span class="label label-type">' . (empty($tree->parent) ? $this->lang->task->common : $this->lang->task->children) . "</span><span class='title' title='{$tree->title}'>" . $tree->title . '</span> <span class="user"><i class="icon icon-person"></i> ' . (empty($tree->assignedTo) ? $tree->openedBy : $tree->assignedTo) . '</span></a>';
break;
case 'product':
$this->app->loadLang('product');
$html .= '<li class="item-product">';
$html .= '<a class="tree-toggle"><span class="label label-type">' . $this->lang->productCommon . '</span><span class="title">' . $tree->name . '</span></a>';
$html .= '<a class="tree-toggle"><span class="label label-type">' . $this->lang->productCommon . "</span><span class='title' title='{$tree->name}'>" . $tree->name . '</span></a>';
break;
case 'story':
$this->app->loadLang('story');
$link = helper::createLink('project', 'treeStory', "storyID={$tree->storyId}");
$html .= '<li class="item-story">';
$html .= '<a class="tree-link" href="' . $link . '"><span class="label label-id">' . $tree->storyId . '</span><span class="label label-type">' . $this->lang->story->common . '</span><span class="title">' . $tree->title . '</span> <span class="user"><i class="icon icon-person"></i> ' . (empty($tree->assignedTo) ? $tree->openedBy : $tree->assignedTo) . '</span></a>';
$html .= '<a class="tree-link" href="' . $link . '"><span class="label label-id">' . $tree->storyId . '</span><span class="label label-type">' . $this->lang->story->common . "</span><span class='title' title='{$tree->title}'>" . $tree->title . '</span> <span class="user"><i class="icon icon-person"></i> ' . (empty($tree->assignedTo) ? $tree->openedBy : $tree->assignedTo) . '</span></a>';
break;
}
if(isset($tree->children))
+1 -1
View File
@@ -19,7 +19,7 @@
if($name == 'root') $icon = ' <i class="icon-fold-all"></i>';
if($name == 'all') $icon = ' <i class="icon-unfold-all"></i>';
?>
<button type='button' class='btn btn-link btn-tree-view' data-type='<?php echo $name ?>'><?php echo $btnLevel . $icon;?></button>
<a href='' class='btn btn-link btn-tree-view' data-type='<?php echo $name ?>'><span class='text'><?php echo $btnLevel . $icon;?></span></button>
<?php endforeach; ?>
</div>
<div class="btn-toolbar pull-right">
+146 -89
View File
@@ -3,8 +3,8 @@
<div class="detail-content article-content">
<div class="infos">
<span class="status-draft"><span class="label label-dot"></span> <?php echo $lang->story->statusList[$story->status];?></span>
<span><?php echo $lang->story->stage;?>: <?php echo $lang->story->stageList[$story->stage];?></span>
<span><?php echo $lang->story->estimate;?>: <?php echo $story->estimate;?></span>
<span><?php echo $lang->story->stage;?> <?php echo $lang->story->stageList[$story->stage];?></span>
<span><?php echo $lang->story->estimate;?> <?php echo $story->estimate;?></span>
</div>
<div class="btn-toolbar">
<?php
@@ -21,11 +21,15 @@
</div>
<div class="detail">
<div class="detail-title"><?php echo $lang->story->legendSpec;?></div>
<div class="detail-content article-content"><?php echo $story->spec;?></div>
<div class="detail-content article-content">
<?php echo !empty($story->spec) ? $story->spec : "<div class='text-center text-muted'>" . $lang->noData . '</div>';?>
</div>
</div>
<div class="detail">
<div class="detail-title"><?php echo $lang->story->legendVerify;?></div>
<div class="detail-content article-content"><?php echo $story->verify;?></div>
<div class="detail-content article-content">
<?php echo !empty($story->verify) ? $story->verify : "<div class='text-center text-muted'>" . $lang->noData . '</div>';?>
</div>
</div>
<?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true'));?>
@@ -40,7 +44,7 @@
</tr>
<?php if($product->type != 'normal'):?>
<tr>
<th><?php echo $lang->product->branch;?></th>
<th><?php echo sprintf($lang->product->branch, zget($lang->product->branchName, $product->type));?></th>
<td><?php common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch", $branches[$story->branch]);?></td>
</tr>
<?php endif;?>
@@ -75,25 +79,29 @@
<tr>
<th><?php echo $lang->story->plan;?></th>
<td>
<?php
if(isset($story->planTitle))
{
foreach($story->planTitle as $planID => $planTitle)
{
if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle)) echo $lanTitle;
echo '<br />';
}
}
?>
<?php
if(isset($story->planTitle))
{
foreach($story->planTitle as $planID => $planTitle)
{
if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle)) echo $lanTitle;
echo '<br />';
}
}
else
{
echo $lang->noData;
}
?>
</td>
</tr>
<tr>
<th><?php echo $lang->story->source;?></th>
<td id='source'><?php echo $lang->story->sourceList[$story->source];?></td>
<td id='source'><?php echo $story->source ? $lang->story->sourceList[$story->source] : $lang->noData;?></td>
</tr>
<tr>
<th><?php echo $lang->story->sourceNote;?></th>
<td><?php echo $story->sourceNote;?></td>
<td><?php echo $story->sourceNote ? $story->sourceNote : $lang->noData;?></td>
</tr>
<tr>
<th><?php echo $lang->story->status;?></th>
@@ -116,7 +124,13 @@
</tr>
<tr>
<th><?php echo $lang->story->pri;?></th>
<td><span class='label-pri <?php echo 'label-pri-' . $story->pri;?>' title='<?php echo zget($lang->story->priList, $story->pri)?>'><?php echo zget($lang->story->priList, $story->pri)?></span></td>
<td>
<?php if($story->pri):?>
<span class='label-pri <?php echo 'label-pri-' . $story->pri;?>' title='<?php echo zget($lang->story->priList, $story->pri)?>'><?php echo zget($lang->story->priList, $story->pri)?></span>
<?php else:?>
<?php echo $lang->noData;?>
<?php endif;?>
</td>
</tr>
<tr>
<th><?php echo $lang->story->estimate;?></th>
@@ -124,11 +138,26 @@
</tr>
<tr>
<th><?php echo $lang->story->keywords;?></th>
<td><?php echo $story->keywords;?></td>
<td><?php echo $story->keywords ? $story->keywords : $lang->noData;?></td>
</tr>
<tr>
<th><?php echo $lang->story->legendMailto;?></th>
<td><?php $mailto = explode(',', $story->mailto); foreach($mailto as $account) {if(empty($account)) continue; echo "<span>" . $users[trim($account)] . '</span> &nbsp;'; }?></td>
<td>
<?php
$mailto = explode(',', $story->mailto);
if(empty($mainto))
{
echo $lang->noData;
}
else
{
foreach($mailto as $account)
{
if(empty($account)) continue; echo "<span>" . $users[trim($account)] . '</span> &nbsp;';
}
}
?>
</td>
</tr>
</tbody>
</table>
@@ -139,25 +168,25 @@
<summary class="detail-title"><?php echo $lang->story->legendProjectAndTask;?></summary>
<div class="detail-content">
<ul class="list-unstyled">
<?php
foreach($story->tasks as $projectTasks)
{
foreach($projectTasks as $task)
{
if(!isset($projects[$task->project])) continue;
$projectName = $projects[$task->project];
echo "<li title='$task->name'>" . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), "#$task->id $task->name", '', "class='iframe' data-width='80%'");
echo html::a($this->createLink('project', 'browse', "projectID=$task->project"), $projectName, '', "class='text-muted'") . '</li>';
}
}
if(count($story->tasks) == 0)
{
foreach($story->projects as $projectID => $project)
{
echo "<li title='$project->name'>" . html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name, '', "class='text-muted'") . '</li>';
}
}
?>
<?php
foreach($story->tasks as $projectTasks)
{
foreach($projectTasks as $task)
{
if(!isset($projects[$task->project])) continue;
$projectName = $projects[$task->project];
echo "<li title='$task->name'>" . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), "#$task->id $task->name", '', "class='iframe' data-width='80%'");
echo html::a($this->createLink('project', 'browse', "projectID=$task->project"), $projectName, '', "class='text-muted'") . '</li>';
}
}
if(count($story->tasks) == 0)
{
foreach($story->projects as $projectID => $project)
{
echo "<li title='$project->name'>" . html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name, '', "class='text-muted'") . '</li>';
}
}
?>
</ul>
</div>
</details>
@@ -167,70 +196,86 @@
<div class="detail-content">
<table class="table table-data">
<tbody>
<?php if($config->global->flow != 'onlyStory'):?>
<?php if(!empty($fromBug)):?>
<tr class='text-top'>
<th class='w-70px'><?php echo $lang->story->legendFromBug;?></th>
<td class='pd-0'>
<ul class='list-unstyled'>
<?php echo "<li title='#$fromBug->id $fromBug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$fromBug->id"), "#$fromBug->id $fromBug->title") . '</li>';?>
</ul>
</td>
</tr>
<?php endif;?>
<?php if($config->global->flow != 'onlyStory'):?>
<?php if(!empty($fromBug)):?>
<tr class='text-top'>
<th class='w-70px'><?php echo $lang->story->legendFromBug;?></th>
<td class='pd-0'>
<ul class='list-unstyled'>
<?php echo "<li title='#$fromBug->id $fromBug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$fromBug->id"), "#$fromBug->id $fromBug->title") . '</li>';?>
</ul>
</td>
</tr>
<?php endif;?>
<tr class='text-top'>
<th class='w-70px'><?php echo $lang->story->legendBugs;?></th>
<td class='pd-0'>
<?php if(empty($bugs)):?>
<?php echo $lang->noData;?>
<?php else:?>
<ul class='list-unstyled'>
<?php
foreach($bugs as $bug)
{
echo "<li title='#$bug->id $bug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$bug->id"), "#$bug->id $bug->title") . '</li>';
}
?>
<?php
foreach($bugs as $bug)
{
echo "<li title='#$bug->id $bug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$bug->id"), "#$bug->id $bug->title") . '</li>';
}
?>
</ul>
<?php endif;?>
</td>
</tr>
<tr class='text-top'>
<th><?php echo $lang->story->legendCases;?></th>
<td class='pd-0'>
<?php if(empty($cases)):?>
<?php echo $lang->noData;?>
<?php else:?>
<ul class='list-unstyled'>
<?php
foreach($cases as $case)
{
echo "<li title='#$case->id $case->title'>" . html::a($this->createLink('testcase', 'view', "caseID=$case->id"), "#$case->id $case->title") . '</li>';
}
?>
<?php
foreach($cases as $case)
{
echo "<li title='#$case->id $case->title'>" . html::a($this->createLink('testcase', 'view', "caseID=$case->id"), "#$case->id $case->title") . '</li>';
}
?>
</ul>
<?php endif;?>
</td>
</tr>
<?php endif;?>
<tr class='text-top'>
<th class='w-80px'><?php echo $lang->story->legendLinkStories;?></th>
<th><?php echo $lang->story->legendLinkStories;?></th>
<td class='pd-0'>
<?php $linkStories = explode(',', $story->linkStories);?>
<?php if(count($linkStories) < 2):?>
<?php echo $lang->noData;?>
<?php else:?>
<ul class='list-unstyled'>
<?php
$linkStories = explode(',', $story->linkStories) ;
foreach($linkStories as $linkStoryID)
{
if(isset($story->extraStories[$linkStoryID])) echo '<li>' . html::a(inlink('view', "storyID=$linkStoryID"), "#$linkStoryID " . $story->extraStories[$linkStoryID]) . '</li>';
}
?>
<?php
foreach($linkStories as $linkStoryID)
{
if(isset($story->extraStories[$linkStoryID])) echo '<li>' . html::a($this->createLink('story', 'view', "storyID=$linkStoryID"), "#$linkStoryID " . $story->extraStories[$linkStoryID]) . '</li>';
}
?>
</ul>
<?php endif;?>
</td>
</tr>
<tr class='text-top'>
<th><?php echo $lang->story->legendChildStories;?></th>
<td class='pd-0'>
<?php $childStories = explode(',', $story->childStories);?>
<?php if(count($childStories) < 2):?>
<?php echo $lang->noData;?>
<?php else:?>
<ul class='list-unstyled'>
<?php
$childStories = explode(',', $story->childStories) ;
foreach($childStories as $childStoryID)
{
if(isset($story->extraStories[$childStoryID])) echo '<li>' . html::a(inlink('view', "storyID=$childStoryID"), "#$childStoryID " . $story->extraStories[$childStoryID]) . '</li>';
}
?>
<?php
foreach($childStories as $childStoryID)
{
if(isset($story->extraStories[$childStoryID])) echo '<li>' . html::a($this->createLink('story', 'view', "storyID=$childStoryID"), "#$childStoryID " . $story->extraStories[$childStoryID]) . '</li>';
}
?>
</ul>
<?php endif;?>
</td>
</tr>
</tbody>
@@ -249,35 +294,47 @@
</tr>
<tr>
<th><?php echo $lang->story->assignedTo;?></th>
<td><?php if($story->assignedTo) echo $users[$story->assignedTo] . $lang->at . $story->assignedDate;?></td>
<td><?php echo $story->assignedTo ? $users[$story->assignedTo] . $lang->at . $story->assignedDate : $lang->noData;?></td>
</tr>
<tr>
<th><?php echo $lang->story->reviewedBy;?></th>
<td><?php $reviewedBy = explode(',', $story->reviewedBy); foreach($reviewedBy as $account) echo ' ' . $users[trim($account)]; ?></td>
<td>
<?php
$reviewedBy = explode(',', $story->reviewedBy);
if(count($reviewedBy) < 2)
{
echo $lang->noData;
}
else
{
foreach($reviewedBy as $account) echo ' ' . $users[trim($account)];
}
?>
</td>
</tr>
<tr>
<th><?php echo $lang->story->reviewedDate;?></th>
<td><?php if($story->reviewedBy) echo $story->reviewedDate;?></td>
<td><?php echo $story->reviewedBy ? $story->reviewedDate : $lang->noData;?></td>
</tr>
<tr>
<th><?php echo $lang->story->closedBy;?></th>
<td><?php if($story->closedBy) echo $users[$story->closedBy] . $lang->at . $story->closedDate;?></td>
<td><?php echo $story->closedBy ? $users[$story->closedBy] . $lang->at . $story->closedDate : $lang->noData;?></td>
</tr>
<tr>
<th><?php echo $lang->story->closedReason;?></th>
<td>
<?php
if($story->closedReason) echo $lang->story->reasonList[$story->closedReason];
if(isset($story->extraStories[$story->duplicateStory]))
{
echo html::a(inlink('view', "storyID=$story->duplicateStory"), '#' . $story->duplicateStory . ' ' . $story->extraStories[$story->duplicateStory]);
}
?>
<?php
echo $story->closedReason ? $lang->story->reasonList[$story->closedReason] : $lang->noData;
if(isset($story->extraStories[$story->duplicateStory]))
{
echo html::a(inlink('view', "storyID=$story->duplicateStory"), '#' . $story->duplicateStory . ' ' . $story->extraStories[$story->duplicateStory]);
}
?>
</td>
</tr>
<tr>
<th><?php echo $lang->story->lastEditedBy;?></th>
<td><?php if($story->lastEditedBy) echo $users[$story->lastEditedBy] . $lang->at . $story->lastEditedDate;?></td>
<td><?php echo $story->lastEditedBy ? $users[$story->lastEditedBy] . $lang->at . $story->lastEditedDate : $lang->noData;?></td>
</tr>
</tbody>
</table>
+3 -3
View File
@@ -16,8 +16,8 @@
<span><?php echo $lang->task->left;?> <?php echo $task->left . $lang->workingHour;?></span>
</div>
<div class="infos">
<span><?php echo $lang->task->type;?>: <?php echo $lang->task->typeList[$task->type];?></span>
<span><?php echo $lang->task->deadline;?>: <?php echo $task->deadline; if(isset($task->delay)) printf($lang->task->delayWarning, $task->delay);?></span>
<span><?php echo $lang->task->type;?> <?php echo $lang->task->typeList[$task->type];?></span>
<span><?php echo $lang->task->deadline;?> <?php echo $task->deadline; if(isset($task->delay)) printf($lang->task->delayWarning, $task->delay);?></span>
</div>
<div class="btn-toolbar">
<?php
@@ -79,4 +79,4 @@
<?php endif;?>
<?php echo $this->fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true'));?>
<?php $actionFormLink = $this->createLink('action', 'comment', "objectType=task&objectID=$task->id");?>
<?php include '../../common/view/action.html.php';?>
<?php include '../../common/view/action.html.php';?>