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

This commit is contained in:
caoyanyi
2023-03-08 09:31:53 +08:00
8 changed files with 34 additions and 6 deletions
+1 -1
View File
@@ -251,7 +251,7 @@
<?php if($browserList):?>
<p class='browserContent'>
<?php foreach($browserList as $browser):?>
<?php if($os) echo "<span class='label label-outline'>" . zget($lang->bug->browserList, $browser) . "</span>";?>
<?php if($browser) echo "<span class='label label-outline'>" . zget($lang->bug->browserList, $browser) . "</span>";?>
<?php endforeach;?>
</p>
<?php endif;?>
+8
View File
@@ -3047,6 +3047,14 @@ EOD;
}
if($productsStatus[$object->product] == 'closed') return false;
}
elseif(!empty($object->product) and is_string($object->product) and empty($config->CRProduct))
{
$products = array(0) + explode(',', $object->product);
$products = $app->control->loadModel('product')->getByIdList($products);
$productStatus = array();
foreach($products as $product) $productStatus[$product->status] = 1;
if(!empty($productStatus['closed']) and count($productStatus) == 1) return false;
}
/* Check the execution is closed. */
$productModuleList = array('story', 'bug', 'testtask');
+2
View File
@@ -1703,6 +1703,8 @@ class execution extends control
global $lang;
$lang->executionCommon = $lang->execution->stage;
include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php';
$this->config->execution->create->requiredFields .= ',products0';
}
$this->app->loadLang('program');
+3 -1
View File
@@ -386,6 +386,8 @@ class executionModel extends model
if(($project->model == 'waterfall' or $project->model == 'waterfallplus') and isset($this->config->setPercent) and $this->config->setPercent == 1)
{
$_POST['products'] = array_filter($_POST['products']);
if(empty($_POST['products'])) dao::$errors['products0'] = $this->lang->project->errorNoProducts;
$this->checkWorkload('create', $_POST['percent'], $project);
if(dao::isError()) return false;
}
@@ -1883,7 +1885,7 @@ class executionModel extends model
->page($pager, 't1.id')
->fetchAll('id');
if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchPairs();
if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, GROUP_CONCAT(product) as product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->groupBy('project')->fetchPairs();
$hours = $this->loadModel('project')->computerProgress($executions);
$burns = $this->getBurnData($executions);
+2 -2
View File
@@ -2190,7 +2190,7 @@ class project extends control
}
$oldProducts = $this->product->getProducts($projectID);
if($project->multiple and $project->model != 'waterfall') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product');
if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product');
$this->project->updateProducts($projectID);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
@@ -2216,7 +2216,7 @@ class project extends control
}
}
if($project->multiple and $project->model != 'waterfall')
if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus')
{
$unlinkedProducts = array_diff($oldProductIDs, $newProductIDs);
if(!empty($unlinkedProducts))
+9 -2
View File
@@ -205,7 +205,7 @@ function loadBranches(product)
}
});
(chosenProducts.length > 1 && model == 'waterfall' && model == 'waterfallplus') ? $('.division').removeClass('hide') : $('.division').addClass('hide');
(chosenProducts.length > 1 && (model == 'waterfall' || model == 'waterfallplus')) ? $('.division').removeClass('hide') : $('.division').addClass('hide');
var $tableRow = $(product).closest('.table-row');
var index = $tableRow.find('select:first').attr('id').replace('products' , '');
@@ -301,5 +301,12 @@ function removeLine(obj)
{
$(obj).closest('tr').remove();
disableSelectedProduct();
if($("select[name^='products']").length < 2) $('.division').addClass('hide');
var chosenProducts = 0;
$(".productsBox select[name^='products']").each(function()
{
if($(this).val() > 0) chosenProducts ++;
});
(chosenProducts.length > 1 && (model == 'waterfall' || model == 'waterfallplus')) ? $('.division').removeClass('hide') : $('.division').addClass('hide');
}
+8
View File
@@ -1521,6 +1521,7 @@ class projectModel extends model
->setDefault('team', $this->post->name)
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', helper::now())
->setDefault('days', '0')
->setIF($this->post->delta == 999, 'end', LONG_TIME)
->setIF($this->post->delta == 999, 'days', 0)
->setIF($this->post->begin == '0000-00-00', 'begin', '')
@@ -2502,6 +2503,13 @@ class projectModel extends model
$this->dao->update(TABLE_PROJECT)->set('division')->eq('1')->where('id')->eq((int)$projectID)->exec();
$this->dao->update(TABLE_EXECUTION)->set('division')->eq('1')->where('project')->eq((int)$projectID)->exec();
}
$project = $this->getByID($projectID);
if(!empty($project) and ($project->model == 'waterfall' or $project->model == 'waterfallplus') and empty($project->division) and !empty($executions))
{
$this->loadModel('execution');
foreach($executions as $executionID) $this->execution->updateProducts($executionID);
}
}
$oldProductKeys = array_keys($oldProjectProducts);
+1
View File
@@ -29,6 +29,7 @@ class searchModel extends model
{
$flowModule = $module;
if($module == 'projectStory' || $module == 'executionStory') $flowModule = 'story';
if($module == 'projectBuild' || $module == 'executionBuild') $flowModule = 'build';
if($module == 'projectBug') $flowModule = 'bug';
$buildin = false;