From f7400480d444efb1ac08c4fbfdef3e808f8e0ddd Mon Sep 17 00:00:00 2001 From: sunjun Date: Fri, 8 Jul 2022 02:02:22 +0000 Subject: [PATCH 1/3] fixbug_createTask --- module/dept/model.php | 7 ++++++- module/task/control.php | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/module/dept/model.php b/module/dept/model.php index 8349d58a4b..1cc5421398 100644 --- a/module/dept/model.php +++ b/module/dept/model.php @@ -113,13 +113,18 @@ class deptModel extends model krsort($deptMenu); $topMenu = array_pop($deptMenu); $topMenu = explode("\n", trim((string)$topMenu)); - $lastMenu[] = '/' . $this->lang->dept->noDepartment; + $lastMenu[] = '/'; foreach($topMenu as $menu) { if(!strpos($menu, '|')) continue; list($label, $deptID) = explode('|', $menu); $lastMenu[$deptID] = $label; } + if($this->app->tab == 'report') + { + unset($lastMenu[0]); + $lastMenu[] = '/' . $this->lang->dept->noDepartment; + } return $lastMenu; } diff --git a/module/task/control.php b/module/task/control.php index f9b4f79327..2a7fdddedb 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -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(); From ed422485ed3fed42dee2fd70342402edfad3c76c Mon Sep 17 00:00:00 2001 From: sunjun Date: Fri, 8 Jul 2022 02:31:37 +0000 Subject: [PATCH 2/3] fixbug_report --- module/dept/model.php | 15 +++++++++------ module/report/control.php | 7 +++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/module/dept/model.php b/module/dept/model.php index 1cc5421398..d50338310a 100644 --- a/module/dept/model.php +++ b/module/dept/model.php @@ -113,18 +113,21 @@ class deptModel extends model krsort($deptMenu); $topMenu = array_pop($deptMenu); $topMenu = explode("\n", trim((string)$topMenu)); - $lastMenu[] = '/'; + 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; } - if($this->app->tab == 'report') - { - unset($lastMenu[0]); - $lastMenu[] = '/' . $this->lang->dept->noDepartment; - } + return $lastMenu; } diff --git a/module/report/control.php b/module/report/control.php index 15d582fa4f..71b38ffc84 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -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) { From d2b201003bb8be400d0efebbfa29fd85b0be4f6b Mon Sep 17 00:00:00 2001 From: sunjun Date: Fri, 8 Jul 2022 02:37:29 +0000 Subject: [PATCH 3/3] fixbug --- module/task/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/control.php b/module/task/control.php index 2a7fdddedb..f0b8fe1ac7 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -47,7 +47,7 @@ class task extends control 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); + $execution = $this->execution->getById($executionID); $this->execution->setMenu($executionID); $this->execution->getLimitedExecution();