Merge branch 'zentaopms_239' of https://gitlab.zcorp.cc/easycorp/zentaopms into zentaopms_239
This commit is contained in:
@@ -224,6 +224,7 @@ $lang->action->desc->merged = '$date, merged by <strong>$actor</st
|
||||
$lang->action->desc->submitreview = '$date, submitted for review by <strong>$actor</strong>.' . "\n";
|
||||
$lang->action->desc->ganttmove = '$date, sort by <strong>$actor</strong> .' . "\n";
|
||||
$lang->action->desc->switchtolean = '$date, Switch from new mode to lean mode by <strong>'. $lang->admin->system .'</strong>.' . "\n";
|
||||
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the sprints of the project from the $extra.' . "\n";
|
||||
|
||||
/* Used to describe the history of operations related to parent-child tasks. */
|
||||
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
|
||||
|
||||
@@ -224,6 +224,7 @@ $lang->action->desc->merged = '$date, merged by <strong>$actor</st
|
||||
$lang->action->desc->submitreview = '$date, submitted for review by <strong>$actor</strong>.' . "\n";
|
||||
$lang->action->desc->ganttmove = '$date, sort by <strong>$actor</strong> .' . "\n";
|
||||
$lang->action->desc->switchtolean = '$date, Switch from new mode to lean mode by <strong>'. $lang->admin->system .'</strong>.' . "\n";
|
||||
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the sprints of the project from the $extra.' . "\n";
|
||||
|
||||
/* Used to describe the history of operations related to parent-child tasks. */
|
||||
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
|
||||
|
||||
@@ -224,6 +224,7 @@ $lang->action->desc->merged = '$date, merged by <strong>$actor</st
|
||||
$lang->action->desc->submitreview = '$date, submitted for review by <strong>$actor</strong>.' . "\n";
|
||||
$lang->action->desc->ganttmove = '$date, sort by <strong>$actor</strong> .' . "\n";
|
||||
$lang->action->desc->switchtolean = '$date, Switch from new mode to lean mode by <strong>'. $lang->admin->system .'</strong>.' . "\n";
|
||||
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the sprints of the project from the $extra.' . "\n";
|
||||
|
||||
/* Used to describe the history of operations related to parent-child tasks. */
|
||||
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> a créé un sous-tâche <strong>$extra</strong>。' . "\n";
|
||||
|
||||
@@ -224,6 +224,7 @@ $lang->action->desc->merged = '$date, 由 <strong>$actor</strong>
|
||||
$lang->action->desc->submitreview = '$date, 由 <strong>$actor</strong> 提交评审。' . "\n";
|
||||
$lang->action->desc->ganttmove = '$date, 由 <strong>$actor</strong> 排序。' . "\n";
|
||||
$lang->action->desc->switchtolean = '$date, 由 <strong>'. $lang->admin->system .'</strong> 从综合模式切换为迅捷模式。' . "\n";
|
||||
$lang->action->desc->unlinkproduct = '$date, 系统判断由于迭代所属项目与$extra取消关联,同步将迭代与$extra取消关联。' . "\n";
|
||||
|
||||
/* 用来描述和父子任务相关的操作历史记录。*/
|
||||
$lang->action->desc->createchildren = '$date, 由 <strong>$actor</strong> 创建子任务 <strong>$extra</strong>。' . "\n";
|
||||
|
||||
@@ -176,10 +176,10 @@ class personnel extends control
|
||||
$copyUsers = empty($copyID) ? array() : $this->personnel->getWhitelistAccount($copyID, $copyObjectType);
|
||||
$appendUsers = array_unique($deptUsers + $copyUsers);
|
||||
|
||||
$objectName = $this->lang->projectCommon . $this->lang->execution->or . $objectName;
|
||||
if($objectType == 'program') $objectName = $this->lang->program->common;
|
||||
if($objectType == 'product') $objectName = $this->lang->productCommon;
|
||||
if($objectType == 'project') $objectName = $this->lang->projectCommon;
|
||||
$objectName = $this->lang->projectCommon . $this->lang->execution->or . $this->lang->execution->common;;
|
||||
if($objectType == 'program') $objectName = $this->lang->program->common;
|
||||
if($objectType == 'product') $objectName = $this->lang->productCommon;
|
||||
if($objectType == 'project') $objectName = $this->lang->projectCommon;
|
||||
$this->lang->personnel->selectObjectTips = sprintf($this->lang->personnel->selectObjectTips, $objectName);
|
||||
|
||||
if($objectType == 'sprint' and $module == 'execution')
|
||||
|
||||
@@ -2145,11 +2145,20 @@ class project extends control
|
||||
if($executionID) $this->execution->updateProducts($executionID);
|
||||
}
|
||||
|
||||
$oldProducts = array_keys($oldProducts);
|
||||
$newProducts = $this->product->getProducts($projectID);
|
||||
$newProducts = array_keys($newProducts);
|
||||
$diffProducts = array_merge(array_diff($oldProducts, $newProducts), array_diff($newProducts, $oldProducts));
|
||||
if($diffProducts) $this->loadModel('action')->create('project', $projectID, 'Managed', '', !empty($_POST['products']) ? join(',', $_POST['products']) : '');
|
||||
$newProducts = $this->product->getProducts($projectID);
|
||||
$oldProductIDs = array_keys($oldProducts);
|
||||
$newProductIDs = array_keys($newProducts);
|
||||
$diffProductIDs = array_merge(array_diff($oldProductIDs, $newProductIDs), array_diff($newProductIDs, $oldProductIDs));
|
||||
if($diffProductIDs) $this->loadModel('action')->create('project', $projectID, 'Managed', '', !empty($_POST['products']) ? join(',', $_POST['products']) : '');
|
||||
|
||||
$unlinkedProducts = array_diff($oldProductIDs, $newProductIDs);
|
||||
if(!empty($unlinkedProducts))
|
||||
{
|
||||
$unlinkedProductPairs = array();
|
||||
foreach($unlinkedProducts as $unlinkedProduct) $unlinkedProductPairs[$unlinkedProduct] = $oldProducts[$unlinkedProduct]->name;
|
||||
|
||||
$this->action->create('project', $projectID, 'unlinkproduct', '', implode(',', $unlinkedProductPairs));
|
||||
}
|
||||
|
||||
$locateLink = inLink('manageProducts', "projectID=$projectID");
|
||||
if($from == 'program') $locateLink = $this->session->projectList;
|
||||
|
||||
@@ -931,7 +931,7 @@ class projectModel extends model
|
||||
*/
|
||||
public function getProjectExecutionPairs()
|
||||
{
|
||||
return $this->dao->select('project, id')->from(TABLE_PROJECT)->andWhere('multiple')->eq('0')->andWhere('deleted')->eq('0')->fetchPairs();
|
||||
return $this->dao->select('project, id')->from(TABLE_PROJECT)->where('multiple')->eq('0')->andWhere('deleted')->eq('0')->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1528,7 +1528,7 @@ class projectModel extends model
|
||||
->checkIF($project->begin != '', 'begin', 'date')
|
||||
->checkIF($project->end != '', 'end', 'date')
|
||||
->checkIF($project->end != '', 'end', 'gt', $project->begin)
|
||||
->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type` = 'project' and `parent` = '$project->parent' and `model` = '{$project->model}' and `deleted` = '0'")
|
||||
->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type` = 'project' and `parent` = '$oldProject->parent' and `model` = '{$project->model}' and `deleted` = '0'")
|
||||
->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type` = 'project' and `model` = '{$project->model}' and `deleted` = '0'")
|
||||
->checkFlow()
|
||||
->where('id')->eq($projectID)
|
||||
@@ -1595,10 +1595,18 @@ class projectModel extends model
|
||||
$oldWhitelist = explode(',', $oldProject->whitelist) and $oldWhitelist = array_filter($oldWhitelist);
|
||||
$newWhitelist = explode(',', $project->whitelist) and $newWhitelist = array_filter($newWhitelist);
|
||||
if(count($oldWhitelist) == count($newWhitelist) and count(array_diff($oldWhitelist, $newWhitelist)) == 0) unset($project->whitelist);
|
||||
|
||||
/* Add linkedproducts changes. */
|
||||
$oldProject->linkedProducts = implode(',', $linkedProducts);
|
||||
$project->linkedProducts = implode(',', $_POST['products']);
|
||||
|
||||
$unlinkedProducts = array_diff($linkedProducts, $_POST['products']);
|
||||
if(!empty($unlinkedProducts))
|
||||
{
|
||||
$products = $this->dao->select('name')->from(TABLE_PRODUCT)->where('id')->in($unlinkedProducts)->fetchPairs();
|
||||
$this->loadModel('action')->create('project', $projectID, 'unlinkproduct', '', implode(',', $products));
|
||||
}
|
||||
|
||||
/* Activate or close the shadow product of the project. */
|
||||
if(!$oldProject->hasProduct && $oldProject->status != $project->status && strpos('doing,closed', $project->status) !== false)
|
||||
{
|
||||
@@ -2301,9 +2309,12 @@ class projectModel extends model
|
||||
public function updateProducts($projectID, $products = '')
|
||||
{
|
||||
$this->loadModel('user');
|
||||
|
||||
$products = isset($_POST['products']) ? $_POST['products'] : $products;
|
||||
$oldProjectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq((int)$projectID)->fetchGroup('product', 'branch');
|
||||
|
||||
$this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->eq((int)$projectID)->exec();
|
||||
|
||||
$members = array_keys($this->getTeamMembers($projectID));
|
||||
if(empty($products))
|
||||
{
|
||||
@@ -2344,6 +2355,10 @@ class projectModel extends model
|
||||
$existedProducts[$productID][$branch] = true;
|
||||
}
|
||||
|
||||
/* Delete the execution linked products that is not linked with the execution. */
|
||||
$executions = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq((int)$projectID)->fetchPairs('id');
|
||||
$this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->in($executions)->andWhere('product')->notin($products)->exec();
|
||||
|
||||
$oldProductKeys = array_keys($oldProjectProducts);
|
||||
$needUpdate = array_merge(array_diff($oldProductKeys, $products), array_diff($products, $oldProductKeys));
|
||||
if($needUpdate) $this->user->updateUserView($needUpdate, 'product', $members);
|
||||
|
||||
@@ -2646,6 +2646,7 @@ class story extends control
|
||||
$this->view->storyType = $storyType;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->chartType = $chartType;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->checkedCharts = $this->post->charts ? join(',', $this->post->charts) : '';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,6 @@ $(function()
|
||||
|
||||
function changeChartType(type)
|
||||
{
|
||||
$('form').attr('action', createLink('story', 'report', 'productID=' + productID + '&branchID=' + branchID + '&storyType=' + storyType + '&browseType=' + browseType + '&moduleID=' + moduleID + '&chartType=' + type));
|
||||
$('form').attr('action', createLink('story', 'report', 'productID=' + productID + '&branchID=' + branchID + '&storyType=' + storyType + '&browseType=' + browseType + '&moduleID=' + moduleID + '&chartType=' + type + '&projectID=' + projectID));
|
||||
$('form').find('#submit').click();
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php js::set('productID', $productID);?>
|
||||
<?php js::set('projectID', $projectID);?>
|
||||
<?php js::set('browseType', $browseType);?>
|
||||
<?php js::set('branchID', $branchID);?>
|
||||
<?php js::set('moduleID', $moduleID);?>
|
||||
|
||||
Reference in New Issue
Block a user