Merge branch 'zentaopms_277'

This commit is contained in:
孙广明
2022-12-30 08:45:34 +08:00
53 changed files with 7295 additions and 243 deletions
+7 -6
View File
@@ -64,7 +64,7 @@ class programplan extends control
if(!defined('RUN_MODE') || RUN_MODE != 'api') $projectID = $this->project->saveState((int)$projectID, $this->project->getPairsByProgram());
$products = $this->loadModel('product')->getProducts($projectID);
if($this->session->hasProduct) $this->lang->modulePageNav = $this->product->select($products, $this->productID, 'programplan', 'browse', $type, 0, 0, '', false);
if($this->session->hasProduct) $this->lang->modulePageNav = $this->product->select($products, $productID, 'programplan', 'browse', $type, 0, 0, '', false);
$selectCustom = 0; // Display date and task settings.
$dateDetails = 1; // Gantt chart detail date display.
@@ -81,7 +81,7 @@ class programplan extends control
if(strpos($selectCustom, 'date') !== false) $dateDetails = 0;
$plans = $this->programplan->getDataForGantt($projectID, $this->productID, $baselineID, $selectCustom, false);
$plans = $this->programplan->getDataForGantt($projectID, $productID, $baselineID, $selectCustom, false);
/* Set Custom. */
foreach(explode(',', $this->config->programplan->custom->customGanttFields) as $field) $customFields[$field] = $this->lang->programplan->ganttCustom[$field];
@@ -98,7 +98,7 @@ class programplan extends control
$selectCustom = $this->loadModel('setting')->getItem("owner={$owner}&module={$module}&section={$section}&key={$object}");
if(strpos($selectCustom, 'date') !== false) $dateDetails = 0;
$plans = $this->programplan->getDataForGanttGroupByAssignedTo($projectID, $this->productID, $baselineID, $selectCustom, false);
$plans = $this->programplan->getDataForGanttGroupByAssignedTo($projectID, $productID, $baselineID, $selectCustom, false);
/* Set Custom. */
foreach(explode(',', $this->config->programplan->custom->customGanttFields) as $field) $customFields[$field] = $this->lang->programplan->ganttCustom[$field];
@@ -110,7 +110,7 @@ class programplan extends control
{
$sort = common::appendOrder($orderBy);
$this->loadModel('datatable');
$plans = $this->programplan->getPlans($projectID, $this->productID, $sort);
$plans = $this->programplan->getPlans($projectID, $productID, $sort);
}
$zooming = !empty($this->config->programplan->ganttCustom->zooming) ? $this->config->programplan->ganttCustom->zooming : 'day';
@@ -118,8 +118,9 @@ class programplan extends control
$this->view->position[] = $this->lang->programplan->browse;
$this->view->projectID = $projectID;
$this->view->project = $this->project->getByID($projectID);
$this->view->productID = $this->productID;
$this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID);
$this->view->productID = $productID;
$this->view->product = $this->product->getByID($productID);
$this->view->productList = $this->product->getProductPairsByProject($projectID, 'all', '', false);
$this->view->type = $type;
$this->view->plans = $plans;
$this->view->orderBy = $orderBy;
+2 -2
View File
@@ -52,12 +52,12 @@ class programplanModel extends model
*/
public function getStage($executionID = 0, $productID = 0, $browseType = 'all', $orderBy = 'id_asc')
{
if(empty($executionID) || empty($productID)) return array();
if(empty($executionID)) return array();
$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($productID)->andWhere('t1.product')->eq($productID)->fi()
->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()
+5 -3
View File
@@ -71,6 +71,8 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
.switchBtn > i {padding-left: 7px;}
#mainContent > .pull-left > .btn-group > .text{display: block;margin-top: 7px;}
#mainContent > .pull-left > .btn-group > a > .text{overflow: hidden;display: block;}
#mainContent > .pull-right > .button-group .text{margin-left: 0px;}
.pull-right .icon-plus.icon-sm:before{vertical-align: 4%;}
</style>
<?php js::set('customUrl', $this->createLink('programplan', 'ajaxCustom'));?>
<?php js::set('dateDetails', $dateDetails);?>
@@ -91,10 +93,10 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
<?php
$class = '';
if($productID == 0) $class = 'class="active"';
foreach($productList as $key => $product)
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"), $product) . "</li>";
echo "<li $class>" . html::a($this->createLink('programplan', 'browse', "projectID=$projectID&productID=$key&type=gantt"), $productName) . "</li>";
}
?>
</ul>
@@ -118,7 +120,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
</div>
<?php
echo html::a(helper::createLink('programplan', 'ajaxcustom', '', '', true), '<i class="icon icon-cog-outline"></i> ' . $lang->settings, '', "class='iframe btn btn-link' data-width='45%'");
if(common::hasPriv('programplan', 'create')) echo html::a($this->createLink('programplan', 'create', "projectID=$projectID"), "<i class='icon icon-sm icon-plus'> </i> " . $this->lang->programplan->create, '', "class='btn btn-primary'");
if(common::hasPriv('programplan', 'create') and empty($product->deleted)) echo html::a($this->createLink('programplan', 'create', "projectID=$projectID"), "<i class='icon icon-sm icon-plus'> </i> " . $this->lang->programplan->create, '', "class='btn btn-primary'");
?>
</div>
<?php endif;?>