* Finish task #8194.

This commit is contained in:
holan20180123
2020-11-11 15:40:26 +08:00
parent 30637fbca1
commit 2d0ffc2b4a
7 changed files with 63 additions and 46 deletions
+17 -13
View File
@@ -249,6 +249,9 @@ class productplan extends control
$this->session->set('storyList', $this->app->getURI(true) . '&type=' . 'story');
$this->session->set('bugList', $this->app->getURI(true) . '&type=' . 'bug');
/* Determines whether an object is editable. */
$changeAllowed = !common::checkParentObjectClosed('plan', $plan);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
if($this->app->getViewType() == 'mhtml') $recPerPage = 10;
@@ -276,19 +279,20 @@ class productplan extends control
$this->view->position[] = $this->lang->productplan->view;
$this->view->planStories = $planStories;
$this->view->planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all', $type == 'bug' ? $sort : 'id_desc', $bugPager);
$this->view->products = $products;
$this->view->summary = $this->product->summary($this->view->planStories);
$this->view->plan = $plan;
$this->view->actions = $this->loadModel('action')->getList('productplan', $planID);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->plans = $this->productplan->getPairs($plan->product, $plan->branch);
$this->view->modules = $this->loadModel('tree')->getOptionMenu($plan->product);
$this->view->type = $type;
$this->view->orderBy = $orderBy;
$this->view->link = $link;
$this->view->param = $param;
$this->view->storyPager = $storyPager;
$this->view->bugPager = $bugPager;
$this->view->products = $products;
$this->view->summary = $this->product->summary($this->view->planStories);
$this->view->plan = $plan;
$this->view->actions = $this->loadModel('action')->getList('productplan', $planID);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->plans = $this->productplan->getPairs($plan->product, $plan->branch);
$this->view->modules = $this->loadModel('tree')->getOptionMenu($plan->product);
$this->view->type = $type;
$this->view->orderBy = $orderBy;
$this->view->link = $link;
$this->view->param = $param;
$this->view->storyPager = $storyPager;
$this->view->bugPager = $bugPager;
$this->view->changeAllowed = $changeAllowed;
$this->display();
}
+5 -5
View File
@@ -62,7 +62,7 @@
<div id='stories' class='tab-pane <?php if($type == 'story') echo 'active'?>'>
<?php $canOrder = common::hasPriv('project', 'storySort');?>
<div class='actions'>
<?php if(!$plan->deleted and $plan->parent >= 0 and !common::checkParentObjectClosed('plan', $plan)):?>
<?php if(!$plan->deleted and $plan->parent >= 0 and $changeAllowed):?>
<div class="btn-group">
<div class='drop-down dropdown-hover'>
<?php
@@ -101,7 +101,7 @@
$canBatchChangeStage = common::hasPriv('story', 'batchChangeStage');
$canBatchAssignTo = common::hasPriv('story', 'batchAssignTo');
$canBatchAction = ($canBatchUnlink or $canBatchClose or $canBatchEdit or $canBatchReview or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchChangeStage or $canBatchAssignTo);
$canBatchAction = ($changeAllowed and ($canBatchUnlink or $canBatchClose or $canBatchEdit or $canBatchReview or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchChangeStage or $canBatchAssignTo));
$vars = "planID={$plan->id}&type=story&orderBy=%s&link=$link&param=$param";
?>
<thead>
@@ -165,7 +165,7 @@
<td><?php echo $lang->story->stageList[$story->stage];?></td>
<td class='c-actions'>
<?php
if(common::hasPriv('productplan', 'unlinkStory'))
if($changeAllowed and common::hasPriv('productplan', 'unlinkStory'))
{
$unlinkURL = $this->createLink('productplan', 'unlinkStory', "story=$story->id&plan=$plan->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '<i class="icon-unlink"></i>', '', "class='btn' title='{$lang->productplan->unlinkStory}'");
@@ -363,7 +363,7 @@
<?php endif;?>
<form class='main-table table-bug' data-ride='table' method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkBug', "planID=$plan->id&orderBy=$orderBy");?>">
<table class='table has-sort-head' id='bugList'>
<?php $canBatchUnlink = common::hasPriv('productplan', 'batchUnlinkBug');?>
<?php $canBatchUnlink = $changeAllowed and common::hasPriv('productplan', 'batchUnlinkBug');?>
<?php $vars = "planID={$plan->id}&type=bug&orderBy=%s&link=$link&param=$param"; ?>
<thead>
<tr class='text-center'>
@@ -404,7 +404,7 @@
</td>
<td class='c-actions'>
<?php
if(common::hasPriv('productplan', 'unlinkBug'))
if($changeAllowed and common::hasPriv('productplan', 'unlinkBug'))
{
$unlinkURL = $this->createLink('productplan', 'unlinkBug', "story=$bug->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"bugList\", confirmUnlinkBug)", '<i class="icon-unlink"></i>', '', "class='btn' title='{$lang->productplan->unlinkBug}'");
+13 -8
View File
@@ -1835,19 +1835,24 @@ class project extends control
$stories = $this->loadModel('story')->getProjectStories($projectID);
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false);
/* Determines whether an object is editable. */
$changeAllowed = true;
if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false;
/* Get project's product. */
$productID = 0;
$productPairs = $this->loadModel('product')->getProductsByProject($projectID);
if($productPairs) $productID = key($productPairs);
$this->view->title = $this->lang->project->storyKanban;
$this->view->position[] = html::a($this->createLink('project', 'story', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->project->storyKanban;
$this->view->stories = $this->story->getKanbanGroupData($stories);
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->projectID = $projectID;
$this->view->project = $project;
$this->view->productID = $productID;
$this->view->title = $this->lang->project->storyKanban;
$this->view->position[] = html::a($this->createLink('project', 'story', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->project->storyKanban;
$this->view->stories = $this->story->getKanbanGroupData($stories);
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->projectID = $projectID;
$this->view->project = $project;
$this->view->productID = $productID;
$this->view->changeAllowed = $changeAllowed;
$this->display();
}
+13 -9
View File
@@ -4,17 +4,21 @@ $(function()
$.cookie('selfClose', 0, {expires:config.cookieLife, path:config.webRoot});
var $kanban = $('#kanban');
var stageMap =
var stageMap = new Object();
if(changeAllowed)
{
story:
stageMap =
{
projected : {verified: 'batchChangeStage'},
developing : {verified: 'batchChangeStage'},
developed : {verified: 'batchChangeStage'},
testing : {verified: 'batchChangeStage'},
tested : {verified: 'batchChangeStage'},
}
};
story:
{
projected : {verified: 'batchChangeStage'},
developing : {verified: 'batchChangeStage'},
developed : {verified: 'batchChangeStage'},
testing : {verified: 'batchChangeStage'},
tested : {verified: 'batchChangeStage'},
}
};
}
var fixBoardWidth = function()
{
+1 -1
View File
@@ -67,7 +67,7 @@
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->task->noTask;?></span>
<?php if(common::hasPriv('task', 'create', $checkObject)):?>
<?php if($changeAllowed and common::hasPriv('task', 'create')):?>
<?php echo html::a($this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : '')), "<i class='icon icon-plus'></i> " . $lang->task->create, '', "class='btn btn-info'");?>
<?php endif;?>
</p>
+1 -1
View File
@@ -98,7 +98,7 @@
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->story->noStory;?></span>
<?php if(common::hasPriv('project', 'linkStory')):?>
<?php if((empty($this->config->global->closedProjectStatus) or $project->status != 'closed') and common::hasPriv('project', 'linkStory')):?>
<?php echo html::a($this->createLink('project', 'linkStory', "project=$project->id"), "<i class='icon icon-link'></i> " . $lang->project->linkStory, '', "class='btn btn-info'");?>
<?php endif;?>
</p>
+13 -9
View File
@@ -10,6 +10,7 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmUnlinkStory', $lang->project->confirmUnlinkStory)?>
<?php js::set('changeAllowed', $changeAllowed)?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php $total = 0;?>
@@ -22,18 +23,21 @@
<?php
common::printIcon('story', 'export', "productID=$productID&orderBy=id_desc", '', 'button', '', '', 'export');
if(commonModel::isTutorialMode())
if($changeAllowed)
{
$wizardParams = helper::safe64Encode("project=$project->id");
echo html::a($this->createLink('tutorial', 'wizard', "module=project&method=linkStory&params=$wizardParams"), "<i class='icon-link'></i> {$lang->project->linkStory}",'', "class='btn btn-link link-story-btn'");
}
else
{
common::printIcon('project', 'linkStory', "project=$project->id", '', 'button', 'link', '', 'btn-link link-story-btn');
if(commonModel::isTutorialMode())
{
$wizardParams = helper::safe64Encode("project=$project->id");
echo html::a($this->createLink('tutorial', 'wizard', "module=project&method=linkStory&params=$wizardParams"), "<i class='icon-link'></i> {$lang->project->linkStory}",'', "class='btn btn-link link-story-btn'");
}
else
{
common::printIcon('project', 'linkStory', "project=$project->id", '', 'button', 'link', '', 'btn-link link-story-btn');
}
}
?>
</div>
<?php if($productID and !$this->loadModel('story')->checkForceReview()) common::printLink('story', 'create', "productID=$productID&branch=&moduleID=0&story=0&project=$project->id", "<i class='icon icon-plus'></i> " . $lang->project->createStory, '', "class='btn btn-primary'");?>
<?php if($changeAllowed and $productID and !$this->loadModel('story')->checkForceReview()) common::printLink('story', 'create', "productID=$productID&branch=&moduleID=0&story=0&project=$project->id", "<i class='icon icon-plus'></i> " . $lang->project->createStory, '', "class='btn btn-primary'");?>
</div>
</div>
<?php
@@ -73,7 +77,7 @@ $account = $this->app->user->account;
<div class='info'>
<span class='label-pri label-pri-<?php echo $story->pri?>' title='<?php echo $lang->story->pri?>'><?php echo zget($lang->story->priList, $story->pri);?></span>
<span class='status status-story status-<?php echo $story->status;?>' title='<?php echo $lang->story->status?>'><span class="label label-dot"></span> <?php echo $lang->story->statusList[$story->status];?></span>
<?php if(common::hasPriv('project', 'unlinkStory')):?>
<?php if($changeAllowed and common::hasPriv('project', 'unlinkStory')):?>
<div class='pull-right'><?php echo html::a($this->createLink('project', 'unlinkStory', "projectID=$projectID&story=$story->id"), "<i class='icon icon-unlink icon-sm'></i>", 'hiddenwin', "title='{$lang->project->unlinkStory}'");?></div>
<?php endif;?>
<div class='pull-right text-muted story-estimate' title='<?php echo $lang->story->estimate?>'><?php echo $story->estimate . 'h ';?></div>