This commit is contained in:
tianshujie98
2021-04-22 11:38:54 +08:00
parent 89ec9cec9c
commit 64406fe023
6 changed files with 20 additions and 63 deletions
+5 -24
View File
@@ -1231,12 +1231,6 @@ class execution extends control
}
}
$project = $this->project->getByID($projectID);
if(!empty($project->model) and $project->model == 'waterfall')
{
$this->lang->execution->afterInfo = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->execution->afterInfo);
}
$this->view->title = $this->lang->execution->tips;
$this->view->tips = $this->fetch('execution', 'tips', "executionID=$executionID");
$this->view->executionID = $executionID;
@@ -1317,6 +1311,11 @@ class execution extends control
}
}
if(!empty($project->model) and $project->model == 'waterfall')
{
$this->lang->execution->type = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->execution->type);
}
$this->view->title = (($this->app->openApp == 'execution') and ($this->config->systemMode == 'new')) ? $this->lang->execution->createExec : $this->lang->execution->create;
$this->view->position[] = $this->view->title;
$this->view->executions = array('' => '') + $this->execution->getList($projectID);
@@ -1433,23 +1432,6 @@ class execution extends control
$productPlans[$product->id] = $this->productplan->getPairs($product->id);
}
$isSprint = true;
if($this->config->systemMode == 'new')
{
$project = $this->project->getById($execution->project);
if($project->model == 'scrum')
{
unset($this->lang->execution->endList[62]);
unset($this->lang->execution->endList[93]);
unset($this->lang->execution->endList[186]);
unset($this->lang->execution->endList[365]);
}
else
{
$isSprint = false;
}
}
$this->loadModel('user');
$poUsers = $this->user->getPairs('noclosed|nodeleted|pofirst', $execution->PO, $this->config->maxCount);
if(!empty($this->config->user->moreLink)) $this->config->moreLinks["PM"] = $this->config->user->moreLink;
@@ -1478,7 +1460,6 @@ class execution extends control
$this->view->unmodifiableProducts = $unmodifiableProducts;
$this->view->productPlans = $productPlans;
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), '', $linkedBranches);
$this->view->isSprint = $isSprint;
$this->display();
}
+1 -1
View File
@@ -38,7 +38,7 @@ $(function()
var adjustMainCol = function()
{
$('.main-form .col-main').css('width', Math.max(250, Math.floor(($('#productsBox').outerWidth() - 50)/3) + 10));
if(!isStage) $('.main-form .col-main').css('width', Math.max(250, Math.floor(($('#productsBox').outerWidth() - 50)/3) + 10));
};
adjustMainCol();
$(window).on('resize', adjustMainCol);
+8 -8
View File
@@ -274,7 +274,7 @@ class executionModel extends model
*/
public function create($copyExecutionID = '')
{
$sprintType = 'sprint';
$type = 'sprint';
$this->lang->execution->team = $this->lang->execution->teamname;
if($this->config->systemMode == 'new')
@@ -286,14 +286,14 @@ class executionModel extends model
}
/* Determine whether to add a sprint or a stage according to the model of the execution. */
$project = $this->getByID($_POST['project']);
$sprintType = zget($this->config->execution->modelList, $project->model, 'sprint');
$project = $this->loadModel('project')->getByID($_POST['project']);
$type = zget($this->config->execution->modelList, $project->model, 'sprint');
$this->config->execution->create->requiredFields .= ',project';
}
/* If the execution model is a stage, determine whether the product is linked. */
if($sprintType == 'stage' and empty($this->post->products[0]))
if($type == 'stage' and empty($this->post->products[0]))
{
dao::$errors['message'][] = $this->lang->execution->noLinkProduct;
return false;
@@ -311,7 +311,7 @@ class executionModel extends model
->setIF($this->config->systemMode == 'new', 'parent', $this->post->project)
->setIF($this->post->acl == 'open', 'whitelist', '')
->join('whitelist', ',')
->add('type', $sprintType)
->add('type', $type)
->stripTags($this->config->execution->editor->create['id'], $this->config->allowedTags)
->remove('products, workDays, delta, branch, uid, plans')
->get();
@@ -360,7 +360,7 @@ class executionModel extends model
$member->root = $executionID;
$member->join = $today;
$member->days = $sprint->days;
$member->type = $sprintType;
$member->type = $type;
$this->dao->insert(TABLE_TEAM)->data($member)->exec();
if($member->account == $this->app->user->account) $creatorExists = true;
}
@@ -375,7 +375,7 @@ class executionModel extends model
$member->account = $this->app->user->account;
$member->role = zget($this->lang->user->roleList, $this->app->user->role, '');
$member->join = $today;
$member->type = $sprintType;
$member->type = $type;
$member->days = $sprint->days;
$member->hours = $this->config->execution->defaultWorkhours;
$this->dao->insert(TABLE_TEAM)->data($member)->exec();
@@ -840,7 +840,7 @@ class executionModel extends model
*/
public function getSwitcher($executionID, $currentModule, $currentMethod)
{
if(in_array($currentMethod, array('index', 'all', 'batchedit'))) return;
if(in_array($currentMethod, array('index', 'all', 'batchedit', 'create'))) return;
$currentExecutionName = $this->lang->execution->common;
if($executionID)
+4
View File
@@ -10,9 +10,13 @@
* @link http://www.zentao.net
*/
?>
<?php if($app->openApp == 'execution'): ?>
<style>#heading {padding: 8px 0;}</style>
<?php endif;?>
<?php if(isset($tips)):?>
<?php $defaultURL = $config->systemMode == 'new' ? $this->createLink('project', 'execution', "status=all&projectID=$projectID") : $this->createLink('execution', 'task', 'executionID=' . $executionID);?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('isStage', false);?>
<body>
<div class='modal-dialog mw-500px' id='tipsModal'>
<div class='modal-header'>
+1 -21
View File
@@ -63,16 +63,7 @@
<tr>
<th><?php echo $lang->execution->type;?></th>
<td>
<?php
if($isSprint)
{
echo html::select('lifetime', $lang->execution->lifeTimeList, $execution->lifetime, "class='form-control' onchange='showLifeTimeTips()'");
}
else
{
echo html::select('attribute', $lang->stage->typeList, $execution->attribute, "class='form-control'");
}
?>
<?php echo html::select('lifetime', $lang->execution->lifeTimeList, $execution->lifetime, "class='form-control' onchange='showLifeTimeTips()'");?>
</td>
</tr>
<tr>
@@ -112,17 +103,6 @@
</div>
</td>
</tr>
<?php if(!$isSprint):?>
<tr>
<th><?php echo $lang->programplan->percent;?></th>
<td>
<div class='input-group'>
<?php echo html::input('percent', $execution->percent, "class='form-control'");?>
<span class='input-group-addon'>%</span>
</div>
</td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->execution->manageProducts;?></th>
<td class='text-left' id='productsBox' colspan="2">
+1 -9
View File
@@ -1644,19 +1644,11 @@ class projectModel extends model
{
global $lang;
$project = $this->getByID($objectID);
$lang->project->menu = $lang->{$project->model}->menu;
$lang->project->menuOrder = $lang->{$project->model}->menuOrder;
$lang->project->dividerMenu = $lang->{$project->model}->dividerMenu;
/* Replace waterfall lang. */
if($project->model == 'waterfall')
{
$this->loadModel('execution');
$lang->execution->create = str_replace($lang->executionCommon, $lang->project->stage, $lang->execution->create);
$lang->execution->name = str_replace($lang->executionCommon, $lang->project->stage, $lang->execution->name);
$lang->execution->status = str_replace($lang->executionCommon, $lang->project->stage, $lang->execution->status);
$lang->execution->copy = str_replace($lang->executionCommon, $lang->project->stage, $lang->execution->copy);
}
$this->lang->switcherMenu = $this->getSwitcher($objectID, $this->app->rawModule, $this->app->rawMethod);
common::setMenuVars('project', $objectID);