diff --git a/module/programplan/control.php b/module/programplan/control.php index f2b069761a..cfe5086497 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -23,9 +23,11 @@ class programplan extends control */ public function commonAction(int $projectID, int $productID = 0) { - $products = $this->loadModel('product')->getProductPairsByProject($projectID); - $productID = $this->loadModel('product')->saveVisitState($productID, $products); - $project = $this->loadModel('project')->getByID($projectID); + $this->loadModel('product'); + $this->loadModel('project'); + $products = $this->product->getProductPairsByProject($projectID); + $productID = $this->product->saveVisitState($productID, $products); + $project = $this->project->getByID($projectID); $this->session->set('hasProduct', $project->hasProduct); $this->project->setMenu($projectID); @@ -59,7 +61,7 @@ class programplan extends control if($this->session->hasProduct) $this->lang->modulePageNav = $this->product->select($products, $productID, 'programplan', 'browse', $type, 0, false); /* 生成阶段列表页阶段数据。 */ - $stages = $this->programplanZen->buildBrowseStages($projectID, $productID, $baselineID, $type, $orderBy); + $stages = $this->programplanZen->buildStages($projectID, $productID, $baselineID, $type, $orderBy); $this->programplanZen->buildBrowseView($projectID, $productID, $stages, $type, $orderBy); } @@ -216,10 +218,10 @@ class programplan extends control */ public function ajaxResponseGanttDragEvent() { - if(empty($_POST['id']) || empty($_POST['type'])) return $this->send(array('result' => 'fail', 'message' => '')); + if(!$this->post->id || !$this->post->type) return $this->send(array('result' => 'fail', 'message' => '')); - $objectID = $_POST['id']; - $objectType = $_POST['type']; + $objectID = $this->post->id; + $objectType = $this->post->type; $this->loadModel('task')->updateEsDateByGantt($objectID, $objectType); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); @@ -234,9 +236,9 @@ class programplan extends control */ public function ajaxResponseGanttMoveEvent() { - if(empty($_POST['id'])) return $this->send(array('result' => 'fail', 'message' => '')); + if(!$this->post->id) return $this->send(array('result' => 'fail', 'message' => '')); - $idList = explode('-', $_POST['id']); + $idList = explode('-', $this->post->id); $taskID = !empty($idList[1]) ? $idList[1] : 0; if(empty($taskID)) return $this->send(array('result' => 'fail', 'message' => '')); diff --git a/module/programplan/model.php b/module/programplan/model.php index e11f2967d8..0c12b5d1ab 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -155,7 +155,7 @@ class programplanModel extends model $plans = $this->getStage($executionID, $productID, 'all', 'order'); - if($baselineID) $plans = $this->getBaselineData($baselineID, $plans); + if($baselineID) $plans = $this->setBaseline($baselineID, $plans); $today = helper::today(); $datas = array(); @@ -364,7 +364,7 @@ class programplanModel extends model * @access private * @return array */ - private function getBaselineData(int $baselineID, array $plans): array + private function setBaseline(int $baselineID, array $plans): array { $baseline = $this->loadModel('cm')->getByID($baselineID); $oldData = json_decode($baseline->data); diff --git a/module/programplan/zen.php b/module/programplan/zen.php index b86a5baa23..8f9e4d579e 100644 --- a/module/programplan/zen.php +++ b/module/programplan/zen.php @@ -169,12 +169,12 @@ class programplanZen extends programplan * @param int $projectID * @param int $productID * @param array $plans - * @param string $projectID - * @param string $projectID + * @param string $type + * @param string $orderBy * @access protected * @return array */ - protected function buildBrowseStages($projectID, $productID, $baselineID, $type, $orderBy): array + protected function buildStages(int $projectID, int $productID, array $baselineID, string $type, string $orderBy): array { $stages = array(); $selectCustom = 0; // Display date and task settings. @@ -215,8 +215,8 @@ class programplanZen extends programplan * @param int $projectID * @param int $productID * @param array $stages - * @param string $projectID - * @param string $projectID + * @param string $type + * @param string $orderBy * @access protected * @return void */ diff --git a/module/todo/control.php b/module/todo/control.php index f50ded9f63..cfc5bc7a33 100755 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -12,7 +12,7 @@ declare(strict_types=1); class todo extends control { /** - * Construct function + * Construct function, load class of date, lang of my. * * @access public * @return void diff --git a/module/todo/model.php b/module/todo/model.php index 709eaa6c45..1b37a4f5fd 100755 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -304,11 +304,11 @@ class todoModel extends model * Get a array with todos which todoID as key, todo object as value by todo id list. * Return all todos if the todo id list is empty. * - * @param array $todoIdList + * @param array|string $todoIdList * @access public * @return array */ - public function getByList($todoIdList = 0): array + public function getByList(array|string $todoIdList = ''): array { return $this->dao->select('*')->from(TABLE_TODO) ->beginIF($todoIdList)->where('id')->in($todoIdList)->fi() diff --git a/module/todo/test/model/yaml/batchupdate/batchupdate.yaml b/module/todo/test/model/yaml/batchupdate/batchupdate.yaml index 309bf7528b..803757524e 100644 --- a/module/todo/test/model/yaml/batchupdate/batchupdate.yaml +++ b/module/todo/test/model/yaml/batchupdate/batchupdate.yaml @@ -26,8 +26,4 @@ fields: range: 1-5 prefix: '这是待办描述' - field: status - range: 'wait' - - - - + range: 'wait' \ No newline at end of file diff --git a/module/todo/test/model/yaml/update/update.yaml b/module/todo/test/model/yaml/update/update.yaml index 3c840d402a..42f94c6b20 100644 --- a/module/todo/test/model/yaml/update/update.yaml +++ b/module/todo/test/model/yaml/update/update.yaml @@ -28,8 +28,4 @@ fields: range: 1-5 prefix: '这是待办描述' - field: status - range: 'wait' - - - - + range: 'wait' \ No newline at end of file diff --git a/module/todo/test/tao/insert.php b/module/todo/test/tao/insert.php index 9229ef8bcf..0ae18c6069 100755 --- a/module/todo/test/tao/insert.php +++ b/module/todo/test/tao/insert.php @@ -56,7 +56,7 @@ $todoTask->type = 'task'; $todoTask->name = 'TASK待办'; $todoTask->objectID = 1; -r($tester->todo->insert($todo)) && p() && e(2); // 正常插入待办数据 -r($tester->todo->insert($todoTask)) && p() && e(3); // 正常插入task类型待办数据 -r($tester->todo->insert($todoNoName)) && p() && e(0); // 插入没有名称的待办数据 -r($tester->todo->insert($todoBug)) && p() && e(0); // 插入bug类型待办,没有bugID的情况 \ No newline at end of file +r($tester->todo->insert($todo)) && p() && e(2); // 正常插入待办数据 +r($tester->todo->insert($todoTask)) && p() && e(3); // 正常插入task类型待办数据 +r($tester->todo->insert($todoNoName)) && p() && e(0); // 插入没有名称的待办数据 +r($tester->todo->insert($todoBug)) && p() && e(0); // 插入bug类型待办,没有bugID的情况 \ No newline at end of file diff --git a/module/todo/test/tao/updaterow.php b/module/todo/test/tao/updaterow.php index 1061cd71bc..7826ea7afa 100755 --- a/module/todo/test/tao/updaterow.php +++ b/module/todo/test/tao/updaterow.php @@ -52,7 +52,7 @@ $todoTask->type = 'task'; $todoTask->name = 'TASK待办'; $todoTask->objectID = 1; -r($tester->todo->updateRow(1, $todo)) && p() && e('1'); // 正常更新待办数据 -r($tester->todo->updateRow(2, $todoTask)) && p() && e('1'); // 正常更新task类型待办数据 -r($tester->todo->updateRow(3, $todoNoName)) && p() && e('0'); // 更新没有名称的待办数据 -r($tester->todo->updateRow(4, $todoBug)) && p() && e('0'); // 更新bug类型待办,没有bugID的情况 +r($tester->todo->updateRow(1, $todo)) && p() && e('1'); // 正常更新待办数据 +r($tester->todo->updateRow(2, $todoTask)) && p() && e('1'); // 正常更新task类型待办数据 +r($tester->todo->updateRow(3, $todoNoName)) && p() && e('0'); // 更新没有名称的待办数据 +r($tester->todo->updateRow(4, $todoBug)) && p() && e('0'); // 更新bug类型待办,没有bugID的情况 \ No newline at end of file