* Fix a bug.

This commit is contained in:
hufangzhou
2021-01-21 11:00:14 +08:00
parent 420e374bf5
commit d3af747bd9
4 changed files with 39 additions and 10 deletions
+12
View File
@@ -115,6 +115,18 @@ class projectStory extends control
echo $this->fetch('story', 'track', "productID=$productID&branch=$branch&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
}
/**
* View a story.
*
* @param int $storyID
* @access public
* @return void
*/
public function view($storyID)
{
echo $this->fetch('story', 'view', "storyID=$storyID");
}
/**
* Link stories to a project.
*
+5
View File
@@ -833,6 +833,11 @@ class story extends control
$this->lang->product->switcherMenu = $this->product->getSwitcher($product->id);
$this->lang->product->mainMenuAction = $this->product->getProductMainAction();
$this->product->setMenu($this->product->getPairs(), $product->id, $story->branch);
if($this->app->rawModule == 'projectstory')
{
$project = $this->dao->findById((int)$this->session->PRJ)->from(TABLE_PROJECT)->fetch();
$this->lang->product->menu = $this->lang->menu->{$project->model};
}
if($from == 'project')
{
+9 -7
View File
@@ -3278,10 +3278,12 @@ class storyModel extends model
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo or $canBatchUnlinkStory);
$canView = common::hasPriv('story', 'view');
$storyLink = helper::createLink('story', 'view', "storyID=$story->id");
$account = $this->app->user->account;
$id = $col->id;
$canView = common::hasPriv('story', 'view');
$module = $this->app->rawModule == 'projectstory' ? 'projectstory' : 'story';
$openModule = $this->app->rawModule == 'projectstory' ? 'project' : 'product';
$storyLink = helper::createLink($module, 'view', "storyID=$story->id");
$account = $this->app->user->account;
$id = $col->id;
if($col->show)
{
$class = "c-{$id}";
@@ -3331,7 +3333,7 @@ class storyModel extends model
if(isset($storyStages[$story->id]))
{
foreach($storyStages[$story->id] as $storyBranch => $storyStage)
{
{
if(isset($branches[$storyBranch])) $title .= $branches[$storyBranch] . ": " . $this->lang->story->stageList[$storyStage->stage] . "\n";
}
}
@@ -3344,7 +3346,7 @@ class storyModel extends model
case 'id':
if($canBatchAction)
{
echo html::checkbox('storyIdList', array($story->id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));
echo html::checkbox('storyIdList', array($story->id => '')) . html::a($storyLink, sprintf('%03d', $story->id), '', "data-group='$openModule'");
}
else
{
@@ -3362,7 +3364,7 @@ class storyModel extends model
if($story->branch and isset($branches[$story->branch])) echo "<span class='label label-outline label-badge'>{$branches[$story->branch]}</span> ";
if($story->module and isset($modulePairs[$story->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$story->module]}</span> ";
if($story->parent > 0) echo '<span class="label label-badge label-light" title="' . $this->lang->story->children . '">' . $this->lang->story->childrenAB . '</span> ';
echo $canView ? html::a($storyLink, $story->title, '', "style='color: $story->color'") : "<span style='color: $story->color'>{$story->title}</span>";
echo $canView ? html::a($storyLink, $story->title, '', "style='color: $story->color' data-group='$openModule'") : "<span style='color: $story->color'>{$story->title}</span>";
if(!empty($story->children)) echo '<a class="story-toggle" data-id="' . $story->id . '"><i class="icon icon-angle-double-right"></i></a>';
break;
case 'plan':
+13 -3
View File
@@ -33,8 +33,8 @@
<?php
for($i = $story->version; $i >= 1; $i --)
{
$class = $i == $version ? " class='active'" : '';
echo '<li' . $class .'>' . html::a(inlink('view', "storyID=$story->id&version=$i"), '#' . $i) . '</li>';
$class = $i == $version ? " class='active'" : '';
echo '<li' . $class .'>' . html::a(inlink('view', "storyID=$story->id&version=$i"), '#' . $i) . '</li>';
}
?>
</ul>
@@ -48,7 +48,16 @@
<?php if(!isonlybody()):?>
<div class="btn-toolbar pull-right">
<?php if(common::canModify('product', $product)): ?>
<?php common::printLink('story', 'create', "productID={$story->product}&branch={$story->branch}&moduleID={$story->module}", "<i class='icon icon-plus'></i>" . $lang->story->create, '', "class='btn btn-primary'"); ?>
<?php
$otherParam = '';
$openModule = 'product';
if($this->app->rawModule == 'projectstory')
{
$otherParam = "storyID=&projectID={$this->session->PRJ}";
$openModule = 'project';
}
?>
<?php common::printLink('story', 'create', "productID={$story->product}&branch={$story->branch}&moduleID={$story->module}&$otherParam", "<i class='icon icon-plus'></i>" . $lang->story->create, '', "class='btn btn-primary' data-group='$openModule'"); ?>
<?php endif;?>
</div>
<?php endif;?>
@@ -523,6 +532,7 @@ js::set('moduleID', $story->module);
js::set('storyType', $story->type);
js::set('unlink', $lang->story->unlink);
js::set('cancel', $lang->cancel);
js::set('rawModule', $this->app->rawModule);
?>
<?php include '../../common/view/syntaxhighlighter.html.php';?>
<?php include '../../common/view/footer.html.php';?>