Merge branch 'fixbug_createTask' into 'master'

Fixbug create task

See merge request easycorp/zentaopms!4427
This commit is contained in:
孙广明
2022-07-08 02:43:15 +00:00
3 changed files with 19 additions and 3 deletions
+9 -1
View File
@@ -113,13 +113,21 @@ class deptModel extends model
krsort($deptMenu);
$topMenu = array_pop($deptMenu);
$topMenu = explode("\n", trim((string)$topMenu));
$lastMenu[] = '/' . $this->lang->dept->noDepartment;
if($this->app->tab == 'report')
{
$lastMenu[] = '/' . $this->lang->dept->noDepartment;
}
else
{
$lastMenu[] = '/';
}
foreach($topMenu as $menu)
{
if(!strpos($menu, '|')) continue;
list($label, $deptID) = explode('|', $menu);
$lastMenu[$deptID] = $label;
}
return $lastMenu;
}
+7
View File
@@ -315,6 +315,13 @@ class report extends control
$users[''] = $this->lang->report->annualData->allUser;
$depts = $this->loadModel('dept')->getOptionMenu();
if($this->app->tab == 'report')
{
$noDepartment = $depts[0];
unset($depts[0]);
$depts += array('0' => $noDepartment);
}
$accounts = array();
if($userID)
{
+3 -2
View File
@@ -44,9 +44,10 @@ class task extends control
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
parse_str($extra, $output);
$execution = $this->execution->getById($executionID);
$executions = $this->execution->getPairs(0, 'all', !common::canModify('execution', $execution) ? 'noclosed' : '');
if(!empty($executionID)) $execution = $this->execution->getById($executionID);
$executions = $this->execution->getPairs(0, 'all', isset($execution) ? (!common::canModify('execution', $execution) ? 'noclosed' : '') : 'noclosed');
$executionID = $this->execution->saveState($executionID, $executions);
$execution = $this->execution->getById($executionID);
$this->execution->setMenu($executionID);
$this->execution->getLimitedExecution();