* Adjust code for task #79667.

This commit is contained in:
liuhong
2022-12-14 04:40:20 +00:00
parent 95056fd6cd
commit 33d35425cc
2 changed files with 16 additions and 42 deletions
+16 -14
View File
@@ -1,22 +1,24 @@
<?php
$twinsCount = !empty($story->twins) ? count(explode( ',', trim($story->twins, ','))) + 1 : 0;
$lang->story->currentBranch = sprintf($this->lang->story->currentBranch, $this->lang->product->branchName[$product->type]);
js::set('relieveURL', inlink('ajaxRelieveTwins'));
js::set('storyID', $story->id);
js::set('relieved', $lang->story->relieved);
js::set('relievedTip', $lang->story->relievedTip);
js::set('cancel', $lang->cancel);
$canViewLinkStory = common::hasPriv('story', 'view');
$canRelieved = common::hasPriv('story', 'relieved');
array_unshift($twins, $story);
$twinsClass = isonlybody() ? 'showinonlybody' : 'iframe';
?>
if(isset($twins))
{
$twinsCount = !empty($story->twins) ? count(explode( ',', trim($story->twins, ','))) + 1 : 0;
$lang->story->currentBranch = sprintf($this->lang->story->currentBranch, $this->lang->product->branchName[$product->type]);
js::set('relieveURL', inlink('ajaxRelieveTwins'));
js::set('storyID', $story->id);
js::set('relieved', $lang->story->relieved);
js::set('relievedTip', $lang->story->relievedTip);
js::set('cancel', $lang->cancel);
$canViewLinkStory = common::hasPriv('story', 'view');
$canRelieved = common::hasPriv('story', 'relieved');
array_unshift($twins, $story);
$twinsClass = isonlybody() ? 'showinonlybody' : 'iframe';
}?>
<div class='tabs'>
<ul class='nav nav-tabs'>
<li class='active'><a data-toggle='tab' href='#affectedProjects'><?php echo $lang->story->affectedProjects;?> <?php $count = count($story->executions); if($count > 0) echo "<span class='label label-danger label-badge label-circle'>" . $count . "</span>" ?></a></li>
<li><a data-toggle='tab' href='#affectedBugs'><?php echo $lang->story->affectedBugs;?> <?php $count = count($story->bugs); if($count > 0) echo "<span class='label label-danger label-badge label-circle'>" . $count . "</span>" ?></a></li>
<li><a data-toggle='tab' href='#affectedCases'><?php echo $lang->story->affectedCases;?> <?php $count = count($story->cases); if($count > 0) echo "<span class='label label-danger label-badge label-circle'>" . $count . "</span>" ?></a></li>
<li><a data-toggle='tab' href='#affectedTwins'><?php if(count($twins) != 1) echo $lang->story->affectedTwins;?> <?php if($twinsCount > 0) echo "<span class='label label-danger label-badge label-circle'>" . $twinsCount . "</span>" ?></a></li>
<li><a data-toggle='tab' href='#affectedTwins'><?php if(isset($twins) and count($twins) != 1) echo $lang->story->affectedTwins;?> <?php if(isset($twins) and $twinsCount > 0) echo "<span class='label label-danger label-badge label-circle'>" . $twinsCount . "</span>" ?></a></li>
</ul>
<div class='tab-content'>
<div class='tab-pane active' id='affectedProjects'>
@@ -112,7 +114,7 @@ $twinsClass = isonlybody() ? 'showinonlybody' : 'iframe';
</tbody>
</table>
</div>
<?php if(count($twins) != 1):?>
<?php if(isset($twins) and count($twins) != 1):?>
<div class='tab-pane' id='affectedTwins'>
<table class='table'>
<thead>
-28
View File
@@ -1,28 +0,0 @@
<?php
$lang->story->currentBranch = sprintf($this->lang->story->currentBranch, $this->lang->product->branchName[$product->type]);
js::set('relieveURL', inlink('ajaxRelieveTwins'));
js::set('storyID', $story->id);
js::set('relieved', $lang->story->relieved);
js::set('relievedTip', $lang->story->relievedTip);
js::set('cancel', $lang->cancel);
$canViewLinkStory = common::hasPriv('story', 'view');
$canRelieved = common::hasPriv('story', 'relieved');
array_unshift($twins, $story);
$class = isonlybody() ? 'showinonlybody' : 'iframe';
foreach($twins as $twin)
{
$id = $twin->id;
$title = '#' . $id . ' '. $twin->title;
$branch = isset($branches[$twin->branch]) ? $branches[$twin->branch] : '';
$stage = $lang->story->stageList[$twin->stage];
$labelClass = $story->branch == $twin->branch ? 'label-primary' : '';
echo "<li title='$title' class='twins'>";
echo "<span class='label {$labelClass} label-outline label-badge' title='$branch'>{$branch}</span> ";
echo "<span class='label label-outline' title='{$stage}'>{$stage}</span> ";
echo ($canViewLinkStory ? html::a($this->createLink('story', 'view', "id=$id", '', true), "$title", '', "class='$class viewlink' data-width='80%'") : "$title");
if($canRelieved) echo "<a class='unlink hide' data-id='$id' data-toggle='popover'><i class='icon icon-unlink btn-info'></i></a>";
echo "</li>";
}
?>