Merge branch 'sprint/194_liumengyi_55254' into 'master'
* Finish task #55254 and fix bug. See merge request easycorp/zentaopms!3568
This commit is contained in:
+20
-1
@@ -918,6 +918,9 @@ class commonModel extends model
|
||||
public static function getMainNavList($moduleName)
|
||||
{
|
||||
global $lang;
|
||||
global $app;
|
||||
|
||||
$app->loadLang('my');
|
||||
|
||||
$menuOrder = $lang->mainNav->menuOrder;
|
||||
ksort($menuOrder);
|
||||
@@ -963,8 +966,24 @@ class commonModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/* Check whether other preference item under the module have permissions. If yes, point to other methods. */
|
||||
$moduleLinkList = $currentModule . 'LinkList';
|
||||
if(!$display and isset($lang->my->$moduleLinkList))
|
||||
{
|
||||
foreach($lang->my->$moduleLinkList as $key => $linkList)
|
||||
{
|
||||
$method = explode('-', $key)[1];
|
||||
if(common::hasPriv($currentModule, $method))
|
||||
{
|
||||
$display = true;
|
||||
$currentMethod = $method;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check whether other methods under the module have permissions. If yes, point to other methods. */
|
||||
if($display == false and isset($lang->$currentModule->menu))
|
||||
if($display == false and isset($lang->$currentModule->menu) and !in_array($currentModule, array('program', 'product', 'project', 'execution')))
|
||||
{
|
||||
foreach($lang->$currentModule->menu as $menu)
|
||||
{
|
||||
|
||||
@@ -369,12 +369,12 @@ class executionModel extends model
|
||||
$this->lang->project->code = $this->lang->execution->execCode;
|
||||
}
|
||||
|
||||
$sprintProject = isset($sprint->project) ? $sprint->project : '';
|
||||
$sprintProject = isset($sprint->project) ? $sprint->project : '0';
|
||||
$this->dao->insert(TABLE_EXECUTION)->data($sprint)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
->batchcheck($this->config->execution->create->requiredFields, 'notempty')
|
||||
->checkIF((!empty($sprint->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`type` in ('sprint','stage', 'kanban') and `project` = $sprintProject")
|
||||
->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage')")
|
||||
->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage', 'kanban')")
|
||||
->checkIF($sprint->begin != '', 'begin', 'date')
|
||||
->checkIF($sprint->end != '', 'end', 'date')
|
||||
->checkIF($sprint->end != '', 'end', 'ge', $sprint->begin)
|
||||
@@ -511,18 +511,17 @@ class executionModel extends model
|
||||
}
|
||||
|
||||
/* Update data. */
|
||||
$executionProject = isset($execution->project) ? $execution->project : '';
|
||||
$executionProject = isset($execution->project) ? $execution->project : '0';
|
||||
$this->dao->update(TABLE_EXECUTION)->data($execution)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
->batchcheck($this->config->execution->edit->requiredFields, 'notempty')
|
||||
->checkIF($execution->begin != '', 'begin', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'ge', $execution->begin)
|
||||
->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $executionProject")
|
||||
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')")
|
||||
->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = $executionProject")
|
||||
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban')")
|
||||
->checkFlow()
|
||||
->where('id')->eq($executionID)
|
||||
->checkFlow()
|
||||
->limit(1)
|
||||
->exec();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user