* Merge programplan into stage.

This commit is contained in:
tanghucheng
2021-12-03 13:57:08 +08:00
parent 499605d81e
commit 30d1e22dca
5 changed files with 30 additions and 12 deletions
+4 -2
View File
@@ -3056,11 +3056,13 @@ class execution extends control
$from = $this->app->tab;
if($from == 'execution') $this->session->set('executionList', $this->app->getURI(true), 'execution');
if($from == 'project')
{
$projects = $this->project->getPairsByProgram();
$projectID = $this->project->saveState($projectID, $projects);
$this->view->project = $this->loadModel('project')->getByID($projectID);
$project = $this->loadModel('project')->getByID($projectID);
$this->view->project = $project;
$this->project->setMenu($projectID);
}
@@ -3096,7 +3098,7 @@ class execution extends control
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->status = $status;
$this->view->from = $from;
$this->view->isStage = (isset($project->model) and $project->model == 'waterfall') ? true : false;
$this->display();
}
+11 -10
View File
@@ -15,7 +15,7 @@
<div class='btn-toolbar pull-left'>
<?php if($from == 'project'):?>
<div class='btn-group'>
<?php $viewName = $productID != 0 ? zget($productList,$productID) : $lang->product->all;?>
<?php $viewName = $productID != 0 ? zget($productList,$productID) : $lang->product->allProduct;?>
<a href='javascript:;' class='btn btn-link btn-limit' data-toggle='dropdown'><span class='text' title='<?php echo $viewName;?>'><?php echo $viewName;?></span> <span class='caret'></span></a>
<ul class='dropdown-menu' style='max-height:240px; max-width: 300px; overflow-y:auto'>
<?php
@@ -39,7 +39,7 @@
</div>
<div class='btn-toolbar pull-right'>
<?php common::printLink('execution', 'export', "status=$status&productID=$productID&orderBy=$orderBy&from=$from", "<i class='icon-export muted'> </i> " . $lang->export, '', "class='btn btn-link export'")?>
<?php if(common::hasPriv('programplan', 'create') && isset($project) and $project->model == 'waterfall'):?>
<?php if(common::hasPriv('programplan', 'create') and $isStage):?>
<?php echo html::a($this->createLink('programplan', 'create', "projectID=$projectID&productID=$productID"), "<i class='icon icon-plus'></i> " . $lang->programplan->create, '', "class='btn btn-primary'");?>
<?php else: ?>
<?php if(common::hasPriv('execution', 'create')) echo html::a($this->createLink('execution', 'create', "projectID=$projectID"), "<i class='icon icon-sm icon-plus'></i> " . ((($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-primary create-execution-btn' data-app='$from'");?>
@@ -75,7 +75,7 @@
<th class='c-pm'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->execution->owner);?></th>
<th class='c-status'><?php common::printOrderLink('status', $orderBy, $vars, $from == 'execution' ? $lang->execution->execStatus : $lang->execution->status);?></th>
<th class='c-progress'><?php echo $lang->execution->progress;?></th>
<?php if(isset($project) and $project->model == 'waterfall'):?>
<?php if($isStage):?>
<th class='c-percent'><?php common::printOrderLink('percent', $orderBy, $vars, $lang->programplan->percent);?></th>
<th class='c-attribute'><?php common::printOrderLink('attribute', $orderBy, $vars, $lang->programplan->attribute);?></th>
<th class='c-begin'><?php common::printOrderLink('begin', $orderBy, $vars, $lang->execution->begin);?></th>
@@ -89,7 +89,7 @@
<th class='c-left text-right hours'><?php echo $lang->execution->totalLeft;?></th>
<?php endif;?>
<?php if(isset($project) and $project->model == 'scrum'):?>
<?php if(!$isStage):?>
<th class='c-burn'><?php echo $lang->execution->burn;?></th>
<?php endif;?>
<?php
@@ -132,7 +132,7 @@
<div class='progress-info'><?php echo round($execution->hours->progress);?></div>
</div>
</td>
<?php if(isset($project) and $execution->type == 'stage'):?>
<?php if($isStage):?>
<td><?php echo $execution->percent . '%';?></td>
<td><?php echo zget($lang->stage->typeList, $execution->attribute, '');?></td>
<td><?php echo $execution->begin;?></td>
@@ -169,7 +169,7 @@
<td class='hours' title='<?php echo $execution->hours->totalLeft . ' ' . $this->lang->execution->workHour;?>'><?php echo $execution->hours->totalLeft . $this->lang->execution->workHourUnit;?></td>
<?php endif;?>
<?php if(isset($project) and $project->model == 'scrum'):?>
<?php if(!$isStage):?>
<td id='spark-<?php echo $execution->id?>' class='sparkline text-left no-padding' values='<?php echo join(',', $execution->burns);?>'></td>
<?php endif;?>
<?php foreach($extendFields as $extendField) echo "<td>" . $this->loadModel('flow')->getFieldValue($extendField, $execution) . "</td>";?>
@@ -206,7 +206,7 @@
<div class='progress-info'><?php echo round($child->hours->progress);?></div>
</div>
</td>
<?php if(isset($project) and $execution->type == 'stage'):?>
<?php if($isStage):?>
<td><?php echo $child->percent . '%';?></td>
<td><?php echo zget($lang->stage->typeList, $child->attribute, '');?></td>
<td><?php echo $child->begin;?></td>
@@ -214,7 +214,7 @@
<td><?php echo $child->realBegan;?></td>
<td><?php echo $child->realEnd;?></td>
<td class="c-actions text-center c-actions">
<?php
<?php
common::printIcon('execution', 'start', "executionID={$child->id}", $child, 'list', '', '', 'iframe', true);
$class = !empty($child->children) ? 'disabled' : '';
common::printIcon('task', 'create', "executionID={$child->id}", $child, 'list', '', '', $class, false, "data-app='execution'");
@@ -235,14 +235,15 @@
if(common::hasPriv('execution', 'delete', $child))
{
common::printIcon('execution', 'delete', "planID=$child->id&confirm=no", $child, 'list', 'trash', 'hiddenwin' , $disabled, '', '', $this->lang->programplan->delete);
}?>
}
?>
</td>
<?php else:?>
<td class='hours' title='<?php echo $child->hours->totalEstimate . ' ' . $this->lang->execution->workHour;?>'><?php echo $child->hours->totalEstimate . ' ' . $this->lang->execution->workHourUnit;?></td>
<td class='hours' title='<?php echo $child->hours->totalConsumed . ' ' . $this->lang->execution->workHour;?>'><?php echo $child->hours->totalConsumed . ' ' . $this->lang->execution->workHourUnit;?></td>
<td class='hours' title='<?php echo $child->hours->totalLeft . ' ' . $this->lang->execution->workHour;?>'><?php echo $child->hours->totalLeft . ' ' . $this->lang->execution->workHourUnit;?></td>
<?php endif;?>
<?php if(isset($project) and $project->model == 'scrum'):?>
<?php if(!$isStage):?>
<td id='spark-<?php echo $child->id?>' class='sparkline text-left no-padding' values='<?php echo join(',', $child->burns);?>'></td>
<?php endif;?>
<?php foreach($extendFields as $extendField) echo "<td>" . $this->loadModel('flow')->getFieldValue($extendField, $child) . "</td>";?>
+2
View File
@@ -130,7 +130,9 @@ class programplan extends control
$this->view->position[] = html::a($this->createLink('programplan', 'browse', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->programplan->create;
$this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID);
$this->view->project = $project;
$this->view->productID = $productID;
$this->view->stages = empty($planID) ? $this->loadModel('stage')->getStages('id_asc') : array();
$this->view->programPlan = $this->project->getById($planID, 'stage');
$this->view->plans = $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent');
+1
View File
@@ -57,6 +57,7 @@ class programplanModel extends model
$plans = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t2.type')->eq('stage')
->andWhere('t1.product')->eq($productID)
->beginIF($browseType == 'all')->andWhere('t2.project')->eq($executionID)->fi()
->beginIF($browseType == 'parent')->andWhere('t2.parent')->eq($executionID)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
+12
View File
@@ -22,6 +22,18 @@
echo "<span class='text'>{$title}</span>";
?>
</span>
<div class='btn-group'>
<?php $viewName = $productID != 0 ? zget($productList,$productID) : current($productList);?>
<a href='javascript:;' class='btn btn-link btn-limit' data-toggle='dropdown'><span class='text' title='<?php echo $viewName;?>'><?php echo $viewName;?></span> <span class='caret'></span></a>
<ul class='dropdown-menu' style='max-height:240px; max-width: 300px; overflow-y:auto'>
<?php
foreach($productList as $key => $product)
{
echo "<li>" . html::a($this->createLink('programplan', 'create', "projectID=$project->id&productID=$key"), $product) . "</li>";
}
?>
</ul>
</div>
</div>
</div>
<?php $hideAttribute = $planID == 0 ? '' : ' hidden'?>