diff --git a/module/programplan/control.php b/module/programplan/control.php index 1a676c8bfe..963531db37 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -240,7 +240,7 @@ class programplan extends control * @access public * @return void */ - public function edit(string $planID = 0, string $projectID = 0) + public function edit(string $planID = '0', string $projectID = '0') { $planID = (int)$planID; $projectID = (int)$projectID; @@ -290,7 +290,7 @@ class programplan extends control /* Set Custom. */ foreach(explode(',', $this->config->programplan->custom->customGanttFields) as $field) $customFields[$field] = $this->lang->programplan->ganttCustom[$field]; - + $this->programplanZen->buildAjaxCustomView($owner, $module, $customFields); } diff --git a/module/todo/test/tao/fetch.php b/module/todo/test/tao/fetch.php new file mode 100755 index 0000000000..39f3db893b --- /dev/null +++ b/module/todo/test/tao/fetch.php @@ -0,0 +1,34 @@ +#!/usr/bin/env php +config('fetch')->gen(10); +} + +/** + +title=测试完成待办 todoModel->finish(); +timeout=0 +cid=1 + +- 查询id=1的todo并且验证状态 + - 属性id @1 + - 属性status @wait + +- 查询id=9的todo并且验证状态 + - 属性id @9 + - 属性status @done + +*/ + +initData(); + +global $tester; +$tester->loadModel('todo')->todoTao; + +r($tester->todo->fetch(1)) && p('id,status') && e('1,wait'); // 查询id=1的todo并且验证状态 +r($tester->todo->fetch(9)) && p('id,status') && e('9,done'); // 查询id=9的todo并且验证状态 \ No newline at end of file diff --git a/module/todo/test/tao/getcountbyaccount.php b/module/todo/test/tao/getcountbyaccount.php new file mode 100755 index 0000000000..7a0e1fb3ec --- /dev/null +++ b/module/todo/test/tao/getcountbyaccount.php @@ -0,0 +1,40 @@ +#!/usr/bin/env php +config('getcountbyaccount')->gen(20); +} + +/** + +title=测试 todoModel->getCount(); +timeout=0 +cid=1 + +- 获取用户admin的所有待办个数 @4 + +- 获取用户user1的所有待办个数 @3 + +- 获取用户user2的所有待办个数 @3 + +- 获取不存在的用户所有待办个数 @0 + +- 获取用户admin的vision=>rand所有待办个数 @4 + +*/ + +initData(); + +global $tester; +$tester->loadModel('todo')->todoTao; + +$accountList = array('admin', 'user1', 'user2', 'user10001'); + +r($tester->todo->getCountByAccount($accountList[0])) && p() && e('4'); // 获取用户admin的所有待办个数 +r($tester->todo->getCountByAccount($accountList[1])) && p() && e('3'); // 获取用户user1的所有待办个数 +r($tester->todo->getCountByAccount($accountList[2])) && p() && e('3'); // 获取用户user2的所有待办个数 +r($tester->todo->getCountByAccount($accountList[3])) && p() && e('0'); // 获取不存在的用户所有待办个数 +r($tester->todo->getCountByAccount($accountList[0],'rnd')) && p() && e('4'); // 获取用户admin的vision=>rand所有待办个数 \ No newline at end of file diff --git a/module/todo/test/tao/getprojectlist.php b/module/todo/test/tao/getprojectlist.php new file mode 100755 index 0000000000..2b6bc16188 --- /dev/null +++ b/module/todo/test/tao/getprojectlist.php @@ -0,0 +1,45 @@ +#!/usr/bin/env php +config('getprojectlist')->gen(10); +} + +/** + +title=测试 todoModel->getCount(); +timeout=0 +cid=1 + +- 验证task获得的键值对的个数 @4 + +*/ + +initData(); + +global $tester; +$tester->loadModel('todo'); + +$taskData1 = array('id' => 10, 'name' => '开发任务一', 'type' => 'devel'); +$taskData2 = array('id' => 11, 'name' => '开发任务二', 'type' => 'devel'); +$taskData3 = array('id' => 12, 'name' => '开发任务三', 'type' => 'devel'); +$taskData4 = array('id' => 13, 'name' => '开发任务四', 'type' => 'devel'); + +$task = new taskTest(); +$task->createObject($taskData1,101); +$task->createObject($taskData2,102); +$task->createObject($taskData3,103); +$task->createObject($taskData4,104); + +$ids = range(1,10); +$list = $tester->todo->getByList($ids); +$projectIDList = array_column($list, 'objectID'); + +$tester->loadModel('todo')->todoTao; +$projectList = $tester->todo->getProjectList('zt_task', $projectIDList); + +r(count($projectList)) && p() && e('4'); //验证task获得的键值对的个数 \ No newline at end of file diff --git a/module/todo/test/tao/yaml/fetch/fetch.yaml b/module/todo/test/tao/yaml/fetch/fetch.yaml new file mode 100644 index 0000000000..808926b3de --- /dev/null +++ b/module/todo/test/tao/yaml/fetch/fetch.yaml @@ -0,0 +1,35 @@ +title: zt_fetch +author: liuchenglong +version: "1.0" +fields: + - field: id + range: 1-100 + - field: account + range: 'admin' + - field: date + range: 1-9 + prefix: '2023-04-2' + - field: begin + range: 1000-1100 + - field: end + range: 1200-1300 + - field: type + range: 'custom' + - field: cycle + range: 0 + - field: pri + range: 3 + - field: name + range: 1-5 + prefix: '我的待办' + - field: desc + range: 1-5 + prefix: '这是待办描述' + - field: status + range: 'wait,doing,done' + - field: finishedDate + range: 1-9 + prefix: '2023-04-2' + - field: closedDate + range: 1-9 + prefix: '2023-04-2' diff --git a/module/todo/test/tao/yaml/getcountbyaccount/getcountbyaccount.yaml b/module/todo/test/tao/yaml/getcountbyaccount/getcountbyaccount.yaml new file mode 100644 index 0000000000..9cfb79f172 --- /dev/null +++ b/module/todo/test/tao/yaml/getcountbyaccount/getcountbyaccount.yaml @@ -0,0 +1,38 @@ +title: zt_getcountbyaccount +author: liuchenglong +version: "1.0" +fields: + - field: id + range: 1-100 + - field: account + range: 'admin,user1,user2' + - field: date + range: 1-9 + prefix: '2023-04-2' + - field: begin + range: 1000-1100 + - field: end + range: 1200-1300 + - field: type + range: 'custom' + - field: cycle + range: 0 + - field: pri + range: 3 + - field: name + range: 1-5 + prefix: '我的待办' + - field: desc + range: 1-5 + prefix: '这是待办描述' + - field: status + range: 'wait,doing,done' + - field: vision + range: 'rnd,litle' + - field: finishedDate + range: 1-9 + prefix: '2023-04-2' + - field: closedDate + range: 1-9 + prefix: '2023-04-2' + diff --git a/module/todo/test/tao/yaml/getprojectlist/getprojectlist.yaml b/module/todo/test/tao/yaml/getprojectlist/getprojectlist.yaml new file mode 100644 index 0000000000..916cb2e2c1 --- /dev/null +++ b/module/todo/test/tao/yaml/getprojectlist/getprojectlist.yaml @@ -0,0 +1,42 @@ +title: zt_getprojectlist +author: liuchenglong +version: "1.0" +fields: + - field: id + range: 1-100 + - field: account + range: 'admin,user1,user2' + - field: objectID + range: 10-20 + - field: date + range: 1-9 + prefix: '2023-04-2' + - field: begin + range: 1000-1100 + - field: end + range: 1200-1300 + - field: type + range: 'task' + - field: cycle + range: 0 + - field: pri + range: 3 + - field: name + range: 1-5 + prefix: '我的待办' + - field: desc + range: 1-5 + prefix: '这是待办描述' + - field: status + range: 'wait,doing,done' + - field: vision + range: 'rnd,litle' + - field: finishedDate + range: 1-9 + prefix: '2023-04-2' + - field: closedDate + range: 1-9 + prefix: '2023-04-2' + + +