Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into zentaopms_284

This commit is contained in:
tianshujie
2023-02-13 14:03:58 +08:00
195 changed files with 6559 additions and 1246 deletions
+32 -17
View File
@@ -163,7 +163,7 @@ class programplanModel extends model
$this->loadModel('stage');
$this->loadModel('execution');
$plans = $this->getStage($executionID, $productID);
$plans = $this->getStage($executionID, $productID, 'all', 'order');
if($baselineID)
{
$baseline = $this->loadModel('cm')->getByID($baselineID);
@@ -335,14 +335,14 @@ class programplanModel extends model
if($stage['planID'] == $task->execution)
{
$stageIndex[$index]['progress']['totalEstimate'] += $task->estimate;
$stageIndex[$index]['progress']['totalConsumed'] += $task->consumed;
$stageIndex[$index]['progress']['totalConsumed'] += $task->parent == '-1' ? 0 : $task->consumed;
$stageIndex[$index]['progress']['totalReal'] += ($task->left + $task->consumed);
$parent = $stage['parent'];
if(isset($stageIndex[$parent]))
{
$stageIndex[$parent]['progress']['totalEstimate'] += $task->estimate;
$stageIndex[$parent]['progress']['totalConsumed'] += $task->consumed;
$stageIndex[$parent]['progress']['totalConsumed'] += $task->parent == '-1' ? 0 : $task->consumed;
$stageIndex[$parent]['progress']['totalReal'] += ($task->left + $task->consumed);
}
}
@@ -751,8 +751,6 @@ class programplanModel extends model
$datas[] = $plan;
}
$project = $this->loadModel('project')->getByID($projectID);
$productList = $this->loadModel('product')->getProductPairsByProject($projectID);
$totalPercent = 0;
$totalDevType = 0;
@@ -940,30 +938,26 @@ class programplanModel extends model
$members = array($this->app->user->account, $data->PM);
$roles = $this->user->getUserRoles(array_values($members));
$team = $this->user->getTeamMemberPairs($stageID, 'execution');
foreach($members as $account)
foreach($members as $teamMember)
{
if(empty($account) or isset($team[$account]) or isset($teamMembers[$account])) continue;
if(empty($teamMember) or isset($team[$teamMember]) or isset($teamMembers[$teamMember])) continue;
$member = new stdclass();
$member->root = $stageID;
$member->account = $account;
$member->role = zget($roles, $account, '');
$member->account = $teamMember;
$member->role = zget($roles, $teamMember, '');
$member->join = $now;
$member->type = 'execution';
$member->days = $data->days;
$member->hours = $this->config->execution->defaultWorkhours;
$this->dao->insert(TABLE_TEAM)->data($member)->exec();
$teamMembers[$account] = $member;
$teamMembers[$teamMember] = $member;
}
$this->execution->addProjectMembers($data->project, $teamMembers);
$this->setTreePath($stageID);
if($data->acl != 'open') $this->user->updateUserView($stageID, 'sprint');
$linkProducts = $project->division ? array(0 => $productID) : array_keys($productList);
$this->post->set('products', $linkProducts);
$this->execution->updateProducts($stageID);
/* Record version change information. */
$spec = new stdclass();
$spec->project = $stageID;
@@ -987,6 +981,23 @@ class programplanModel extends model
}
}
$linkProducts = array();
$linkBranches = array();
$productList = $this->loadModel('product')->getProducts($projectID);
if($project->division)
{
$linkProducts = array(0 => $productID);
$linkBranches = array(0 => $productList[$productID]->branches);
}
else
{
$linkProducts = array_keys($productList);
foreach($linkProducts as $index => $productID) $linkBranches[$index] = $productList[$productID]->branches;
}
$this->post->set('products', $linkProducts);
$this->post->set('branch', $linkBranches);
$this->execution->updateProducts($stageID);
/* If child plans has milestone, update parent plan set milestone eq 0 . */
if($parentID and $milestone) $this->dao->update(TABLE_PROJECT)->set('milestone')->eq(0)->where('id')->eq($parentID)->exec();
@@ -1079,8 +1090,8 @@ class programplanModel extends model
else
{
/* Synchronously update sub-phase permissions. */
$childrenIDList = $this->dao->select('*')->from(TABLE_PROJECT)->where('parent')->eq($oldPlan->id)->fetch('id');
if(!empty($childrenIDList)) $this->dao->update(TABLE_PROJECT)->set('acl')->eq($plan->acl)->where('id')->in($childrenIDList)->exec();
$childrenIDList = $this->dao->select('id')->from(TABLE_PROJECT)->where('parent')->eq($oldPlan->id)->fetchAll('id');
if(!empty($childrenIDList)) $this->dao->update(TABLE_PROJECT)->set('acl')->eq($plan->acl)->where('id')->in(array_keys($childrenIDList))->exec();
/* The workload of the parent plan cannot exceed 100%. */
$oldPlan->parent = $plan->parent;
@@ -1121,7 +1132,11 @@ class programplanModel extends model
if(dao::isError()) return false;
$this->setTreePath($planID);
$this->updateSubStageAttr($planID, $plan->attribute);
if($plan->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'sprint');
if($plan->acl != 'open')
{
$planIdList = $this->dao->select('id')->from(TABLE_EXECUTION)->where('path')->like("%,$planID,%")->andWhere('type')->eq('stage')->fetchAll('id');
$this->loadModel('user')->updateUserView(array_keys($planIdList), 'sprint');
}
if($planChanged)
{
+8 -2
View File
@@ -40,6 +40,7 @@
<?php endif;?>
</div>
</div>
<?php $hideAttribute = $planID == 0 ? '' : ' hidden'?>
<?php $attrAlign = $enableOptionalAttr ? '' : 'text-center';?>
<?php $class = $planID == 0 ? '' : "disabled='disabled'"?>
<?php $name = $planID == 0 ? $lang->programplan->name : $lang->programplan->subStageName;?>
@@ -161,8 +162,8 @@
<span class='input-group-addon'>%</span>
</div>
</td>
<td class='<?php echo zget($visibleFields, 'attribute', ' hidden') . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'><?php echo $enableOptionalAttr ? html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'") : zget($lang->stage->typeList, $programPlan->attribute);?></td>
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->execution->aclList, 'open', "class='form-control' $class");?></td>
<td class='<?php echo $hideAttribute?> <?php echo zget($visibleFields, 'attribute', ' hidden') . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'");?></td>
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->execution->aclList, empty($programPlan) ? 'open' : $programPlan->acl, "class='form-control' $class");?></td>
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td><input type='text' name='begin[<?php echo $i;?>] ' id='begin<?php echo $i;?>' value='' class='form-control form-date' /></td>
<td><input type='text' name='end[<?php echo $i;?>]' id='end<?php echo $i;?>' value='' class='form-control form-date' /></td>
@@ -206,8 +207,13 @@
<span class='input-group-addon'>%</span>
</div>
</td>
<<<<<<< HEAD
<td class='<?php echo zget($visibleFields, 'attribute', ' hidden') . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'><?php echo $enableOptionalAttr ? html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'") : zget($lang->stage->typeList, $programPlan->attribute);?></td>
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->execution->aclList, 'open', "class='form-control' $class");?></td>
=======
<td class='<?php echo $hideAttribute?> <?php echo zget($visibleFields, 'attribute', ' hidden') . zget($requiredFields, 'attribute', '', ' required');?>'><?php echo html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'");?></td>
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->execution->aclList, empty($programPlan) ? 'open' : $programPlan->acl, "class='form-control' $class");?></td>
>>>>>>> 780b9c26b7bc23ea6b64598b9d653b7df64036a6
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
<td><input type='text' name='<?php echo "begin[$i]";?>' id='begin<?php echo $i;?>' class='form-control form-date' /></td>
<td><input type='text' name='<?php echo "end[$i]";?>' id='end<?php echo $i;?>' class='form-control form-date' /></td>
+4
View File
@@ -41,6 +41,10 @@
<td class='required' colspan='2'><?php echo html::input('code', $plan->code, "class='form-control'");?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->programplan->PM;?> </th>
<td colspan='2'><?php echo html::select('PM', $PMUsers, '', "class='form-control picker-select'");?></td>
</tr>
<tr>
<th><?php echo $lang->programplan->percent;?> </th>
<td colspan='2'>
+4 -4
View File
@@ -88,7 +88,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
<div class='btn-group'>
<?php if(!empty($project->division)):?>
<?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>
<a href='javascript:;' class='btn btn-link btn-limit text-ellipsis' data-toggle='dropdown' style="max-width: 120px;"><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
$class = '';
@@ -96,7 +96,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
foreach($productList as $key => $productName)
{
$class = $productID == $key ? 'class="active"' : '';
echo "<li $class>" . html::a($this->createLink('programplan', 'browse', "projectID=$projectID&productID=$key&type=gantt"), $productName) . "</li>";
echo "<li $class>" . html::a($this->createLink('programplan', 'browse', "projectID=$projectID&productID=$key&type=gantt"), $productName, '', "title='{$productName}' class='text-ellipsis'") . "</li>";
}
?>
</ul>
@@ -107,8 +107,8 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
</div>
<div class="pull-right btn-toolbar flax">
<div class="btn-group">
<?php echo html::a($this->createLink('project', 'execution', "status=all&projectID=$projectID"),"<i class='icon-list'></i> &nbsp;", '', "class='btn btn-icon switchBtn' title='{$lang->project->bylist}'");?>
<?php echo html::a('',"<i class='icon-gantt-alt'></i> &nbsp;", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->programplan->gantt}'");?>
<?php echo html::a($this->createLink('project', 'execution', "status=all&projectID=$projectID"),"<i class='icon-list'></i> &nbsp;", '', "class='btn btn-icon switchBtn' title='{$lang->project->bylist}'");?>
</div>
<a href='javascript:fullScreen();' id='fullScreenBtn' class='btn btn-link'><i class='icon icon-fullscreen'></i> <?php echo $lang->programplan->full;?></a>
<div class='button-group'>
@@ -734,7 +734,7 @@ $(function()
gantt.showDate(new Date());
// Show task in modal on click task
var taskModalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '80%'});
var taskModalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '95%'});
gantt.attachEvent('onTaskClick', function(id, e)
{
if($(e.srcElement).hasClass('gantt_close') || $(e.srcElement).hasClass('gantt_open')) return false;