Merge branch 'sprint/170_package_bug' of https://gitlab.zcorp.cc/easycorp/zentaopms into 170_package_bug
This commit is contained in:
@@ -654,7 +654,7 @@ class executionModel extends model
|
||||
->checkIF($execution->begin != '', 'begin', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'gt', $execution->begin)
|
||||
->checkIF(!empty($execution->name), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $projectID")
|
||||
->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $projectID")
|
||||
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')")
|
||||
->where('id')->eq($executionID)
|
||||
->limit(1)
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
if($canBeChanged)
|
||||
{
|
||||
$vars = "story={$child->id}";
|
||||
common::printIcon('story', 'change', $vars, $child, 'list', 'alter');
|
||||
common::printIcon('story', 'change', $vars, $child, 'list', 'alter', '', 'iframe', true);
|
||||
common::printIcon('story', 'review', $vars, $child, 'list', 'search');
|
||||
common::printIcon('story', 'close', $vars, $child, 'list', '', '', 'iframe', true);
|
||||
common::printIcon('story', 'edit', $vars, $child, 'list', '', '', 'iframe', true, "data-width='95%'");
|
||||
|
||||
@@ -593,10 +593,10 @@ class productModel extends model
|
||||
}
|
||||
|
||||
$product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->create['id'], $this->post->uid);
|
||||
$productProgram = isset($product->program) ? $product->program : '';
|
||||
$programID = isset($product->program) ? $product->program : '';
|
||||
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
|
||||
->batchCheck($this->config->product->create->requiredFields, 'notempty')
|
||||
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $productProgram")
|
||||
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $programID")
|
||||
->checkIF(!empty($product->code), 'code', 'unique')
|
||||
->exec();
|
||||
|
||||
@@ -721,13 +721,13 @@ class productModel extends model
|
||||
foreach($products as $productID => $product)
|
||||
{
|
||||
$oldProduct = $oldProducts[$productID];
|
||||
$programID = !isset($product->program) ? $oldProduct->program : (empty($product->program) ? 0 : $product->program);
|
||||
if($this->config->systemMode == 'new') $programID = !isset($product->program) ? $oldProduct->program : (empty($product->program) ? 0 : $product->program);
|
||||
|
||||
$this->dao->update(TABLE_PRODUCT)
|
||||
->data($product)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->product->edit->requiredFields , 'notempty')
|
||||
->checkIF(!empty($product->name), 'name', 'unique', "id != $productID and `program` = $programID")
|
||||
->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID")
|
||||
->where('id')->eq($productID)
|
||||
->exec();
|
||||
if(dao::isError()) die(js::error('product#' . $productID . dao::getError(true)));
|
||||
|
||||
@@ -182,7 +182,7 @@ class testcase extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createCaseLink'), array('projectID' => $projectID, 'productID' => $productID), $branch);
|
||||
$moduleTree = $this->tree->getTreeMenu($productID, 'case', 0, array('treeModel', 'createCaseLink'), array('projectID' => $projectID, 'productID' => $productID), $projectID ? 0 : $branch);
|
||||
}
|
||||
|
||||
$product = $this->product->getById($productID);
|
||||
|
||||
@@ -1472,7 +1472,8 @@ class testcaseModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->config->testcase->search['fields']['branch'] = $this->lang->product->branch;
|
||||
$productInfo = $this->loadModel('product')->getByID($productID);
|
||||
$this->config->testcase->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productInfo->type]);
|
||||
$this->config->testcase->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, 'noempty') + array('all' => $this->lang->branch->all);
|
||||
}
|
||||
if(!$this->config->testcase->needReview) unset($this->config->testcase->search['params']['status']['values']['wait']);
|
||||
|
||||
@@ -766,7 +766,8 @@ class testtask extends control
|
||||
$productID = $productID ? $productID : key($this->products);
|
||||
$projectID = $this->lang->navGroup->testtask == 'qa' ? 0 : $this->session->project;
|
||||
$executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID);
|
||||
$builds = empty($productID) ? array() : $this->loadModel('build')->getProductBuildPairs($productID, 0, 'notrunk', true);
|
||||
$executionID = $task->execution;
|
||||
$builds = empty($productID) ? array() : $this->loadModel('build')->getExecutionBuildPairs($executionID, $productID, 'all', 'noempty,notrunk');
|
||||
$testreports = $this->testtask->getTestReportPairsByBuild($task->build);
|
||||
|
||||
$this->view->task = $task;
|
||||
|
||||
@@ -382,7 +382,8 @@ class treeModel extends model
|
||||
if($type == 'line') $rootID = 0;
|
||||
|
||||
$this->loadModel('branch');
|
||||
$branches = array($branch => '');
|
||||
$projectID = zget($extra, 'projectID', 0);
|
||||
$branches = array($branch => '');
|
||||
if($branch)
|
||||
{
|
||||
$branchName = $this->branch->getById($branch);
|
||||
@@ -398,7 +399,6 @@ class treeModel extends model
|
||||
}
|
||||
elseif(($type == 'story' and $this->app->rawModule == 'projectstory') or ($type == 'case' and $this->app->tab == 'project'))
|
||||
{
|
||||
$projectID = zget($extra, 'projectID', 0);
|
||||
if($product->type != 'normal' and $projectID)
|
||||
{
|
||||
$projectBranches = $this->dao->select('branch')->from(TABLE_PROJECTPRODUCT)
|
||||
@@ -406,6 +406,7 @@ class treeModel extends model
|
||||
->andWhere('product')->eq($product->id)
|
||||
->fetchPairs();
|
||||
|
||||
$branches = array();
|
||||
if(isset($projectBranches[BRANCH_MAIN])) $branches = array(BRANCH_MAIN => $this->lang->branch->main);
|
||||
$branches += $this->dao->select('id, name')->from(TABLE_BRANCH)
|
||||
->where('id')->in($projectBranches)
|
||||
|
||||
Reference in New Issue
Block a user