* Optimize code after code reviewing.

This commit is contained in:
tianshujie
2023-05-09 17:05:15 +08:00
parent b66dcb0619
commit 0c467b479d
65 changed files with 133 additions and 133 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
zdTable('task')->config('task_computebeginandend')->gen(10);
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
$task = zdTable('task');
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
zdTable('task')->config('task_computeworkinghours')->gen(15);
+8 -8
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -83,15 +83,15 @@ r($taskTester->createTest($errorEstimate, $assignedToList['single']))
r($taskTester->createTest($test, $assignedToList['single'], $notMultiple, array(), $selectTestStory, array(), array(), false, false, $requiredFields)) && p('name,type,status,assignedTo') && e('测试任务一,test,wait,admin'); // 测试创建测试类型的任务
/* Create a multiplayer task when mode is empty. */
r($taskTester->createTest($devel, $assignedToList['single'], $multiple)) && p('mode') && e(''); // 测试多人任务团队数量小于2的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList)) && p('mode') && e(''); // 测试多人任务团队来源为空的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList)) && p('mode') && e(''); // 测试多人任务预计工时为空的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList, $teamEstimateList)) && p('mode') && e(''); // 测试多人任务预计工时为空的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList, $teamEstimateList, $teamConsumedList)) && p('mode') && e(''); // 测试多人任务消耗工时为空的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList, $teamEstimateList, $teamConsumedList, $teamLeftList)) && p('mode') && e(''); // 测试多人任务预计剩余为空的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple)) && p('mode') && e('^$'); // 测试多人任务团队数量小于2的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList)) && p('mode') && e('^$'); // 测试多人任务团队来源为空的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList)) && p('mode') && e('^$'); // 测试多人任务预计工时为空的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList, $teamEstimateList)) && p('mode') && e('^$'); // 测试多人任务预计工时为空的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList, $teamEstimateList, $teamConsumedList)) && p('mode') && e('^$'); // 测试多人任务消耗工时为空的情况
r($taskTester->createTest($devel, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList, $teamEstimateList, $teamConsumedList, $teamLeftList)) && p('mode') && e('^$'); // 测试多人任务预计剩余为空的情况
/* Create a linear task. */
r($taskTester->createTest($linearTask, $assignedToList['single'], $multiple)) && p('assignedTo,estimate,consumed,left') && e(',1,0,0'); // 测试多人任务团队数量小于2的情况
r($taskTester->createTest($linearTask, $assignedToList['single'], $multiple)) && p('assignedTo,estimate,consumed,left') && e('^$,1,0,0'); // 测试多人任务团队数量小于2的情况
r($taskTester->createTest($linearTask, $assignedToList['single'], $multiple, $teamList)) && p('assignedTo,estimate,consumed,left') && e('admin,0,0,0'); // 测试多人任务团队来源为空的情况
r($taskTester->createTest($linearTask, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList)) && p('assignedTo,estimate,consumed,left') && e('admin,0,0,0'); // 测试多人任务预计工时为空的情况
r($taskTester->createTest($linearTask, $assignedToList['single'], $multiple, $teamList, $notSelectTestStory, $teamSourceList, $teamEstimateList)) && p('assignedTo,estimate,consumed,left') && e('admin,6,0,6'); // 测试多人任务预计工时为空的情况
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+2 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -17,4 +17,4 @@ pid=1
$taskID = '51';
$task = new taskTest();
r($task->getByListTest($taskID)) && p('51:name') && e('开发任务61'); //根据taskID查找任务详情
r($task->getByListTest($taskID)) && p('51:name') && e('开发任务61'); //根据taskID查找任务详情
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -15,4 +15,4 @@ pid=1
*/
$task = new taskTest();
r($task->getDataOffinishedTasksPerDayTest()) && p() && e('0'); //统计没有每日完成的任务数量
r($task->getDataOffinishedTasksPerDayTest()) && p() && e('0'); //统计没有每日完成的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -15,4 +15,4 @@ pid=1
*/
$task = new taskTest();
r($task->getDataOfTasksPerAssignedToTest()) && p('po82:name,value') && e('研发主管82,1'); //统计指派给为po82的任务数量
r($task->getDataOfTasksPerAssignedToTest()) && p('po82:name,value') && e('研发主管82,1'); //统计指派给为po82的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -15,4 +15,4 @@ pid=1
*/
$task = new taskTest();
r($task->getDataOfTasksPerClosedReasonTest()) && p() && e('0'); //统计没有完成原因的任务数量
r($task->getDataOfTasksPerClosedReasonTest()) && p() && e('0'); //统计没有完成原因的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -27,4 +27,4 @@ r($task->getDataOfTasksPerConsumedTest()) && p('5:name,value') && e('5,90'); //
r($task->getDataOfTasksPerConsumedTest()) && p('6:name,value') && e('6,91'); //统计消耗工时为6的任务数量
r($task->getDataOfTasksPerConsumedTest()) && p('7:name,value') && e('7,91'); //统计消耗工时为7的任务数量
r($task->getDataOfTasksPerConsumedTest()) && p('8:name,value') && e('8,91'); //统计消耗工时为8的任务数量
r($task->getDataOfTasksPerConsumedTest()) && p('9:name,value') && e('9,91'); //统计消耗工时为9的任务数量
r($task->getDataOfTasksPerConsumedTest()) && p('9:name,value') && e('9,91'); //统计消耗工时为9的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -29,4 +29,4 @@ r($task->getDataOfTasksPerDeadlineTest(3)) && p("3:value") && e("18"); //统计
r($task->getDataOfTasksPerDeadlineTest(4)) && p("4:value") && e("17"); //统计日期为-1days的任务数量
r($task->getDataOfTasksPerDeadlineTest(5)) && p("5:value") && e("17"); //统计日期为-2days的任务数量
r($task->getdataoftasksperdeadlinetest(6)) && p("6:value") && e("17"); //统计日期为-3days的任务数量
r($task->getdataoftasksperdeadlinetest(7)) && p("7:value") && e("17"); //统计日期为-4days的任务数量
r($task->getdataoftasksperdeadlinetest(7)) && p("7:value") && e("17"); //统计日期为-4days的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -29,4 +29,4 @@ r($task->getDataOfTasksPerEstimateTest()) && p('3:name,value') && e('3,83'); //
r($task->getDataOfTasksPerEstimateTest()) && p('4:name,value') && e('4,83'); //统计预计工时为4的任务数量
r($task->getDataOfTasksPerEstimateTest()) && p('5:name,value') && e('5,83'); //统计预计工时为5的任务数量
r($task->getDataOfTasksPerEstimateTest()) && p('6:name,value') && e('6,82'); //统计预计工时为6的任务数量
r($task->getDataOfTasksPerEstimateTest()) && p('7:name,value') && e('7,82'); //统计预计工时为7的任务数量
r($task->getDataOfTasksPerEstimateTest()) && p('7:name,value') && e('7,82'); //统计预计工时为7的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -60,4 +60,4 @@ $tester->session->set('taskOnlyCondition', true);
$task = new taskTest();
r($task->getDataOfTasksPerExecutionTest(2)) && p('2:name,value') && e('/迭代2,1'); //统计executionID为2的执行的任务数量
r($task->getDataOfTasksPerExecutionTest(3)) && p('3:name,value') && e('/迭代3,2'); //统计executionID为3的执行的任务数量
r($task->getDataOfTasksPerExecutionTest(5)) && p('5:name,value') && e('0,0'); //统计executionID为5的执行的任务数量
r($task->getDataOfTasksPerExecutionTest(5)) && p('5:name,value') && e('0,0'); //统计executionID为5的执行的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -15,4 +15,4 @@ pid=1
*/
$task = new taskTest();
r($task->getDataOfTasksPerFinishedByTest()) && p() && e('0'); //统计没有完成者的任务数量
r($task->getDataOfTasksPerFinishedByTest()) && p() && e('0'); //统计没有完成者的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -29,4 +29,4 @@ r($task->getDataOfTasksPerLeftTest()) && p('3:name,value') && e('3,83'); //统
r($task->getDataOfTasksPerLeftTest()) && p('4:name,value') && e('4,83'); //统计剩余工时为4的任务数量
r($task->getDataOfTasksPerLeftTest()) && p('5:name,value') && e('5,83'); //统计剩余工时为5的任务数量
r($task->getDataOfTasksPerLeftTest()) && p('6:name,value') && e('6,82'); //统计剩余工时为6的任务数量
r($task->getDataOfTasksPerLeftTest()) && p('7:name,value') && e('7,82'); //统计剩余工时为7的任务数量
r($task->getDataOfTasksPerLeftTest()) && p('7:name,value') && e('7,82'); //统计剩余工时为7的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -19,4 +19,4 @@ pid=1
$task = new taskTest();
r($task->getDataOfTasksPerModuleTest()) && p('21:name,value') && e('/模块1,12'); //统计moduleID为21的模块的任务数量
r($task->getDataOfTasksPerModuleTest()) && p('615:name,value') && e('/模块595,2'); //统计moduleID为615的模块的任务数量
r($task->getDataOfTasksPerModuleTest()) && p('504:name,value') && e('/模块484,2'); //统计moduleID为504的模块的任务数量
r($task->getDataOfTasksPerModuleTest()) && p('504:name,value') && e('/模块484,2'); //统计moduleID为504的模块的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -21,4 +21,4 @@ $task = new taskTest();
r($task->getDataOfTasksPerPriTest()) && p('1:name,value') && e('1,228'); //统计优先级为1的任务数量
r($task->getDataOfTasksPerPriTest()) && p('2:name,value') && e('2,228'); //统计优先级为2的任务数量
r($task->getDataOfTasksPerPriTest()) && p('3:name,value') && e('3,227'); //统计优先级为3的任务数量
r($task->getDataOfTasksPerPriTest()) && p('4:name,value') && e('4,227'); //统计优先级为4的任务数量
r($task->getDataOfTasksPerPriTest()) && p('4:name,value') && e('4,227'); //统计优先级为4的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -25,4 +25,4 @@ r($task->getDataOfTasksPerStatusTest()) && p('wait:name,value') && e('未开
r($task->getDataOfTasksPerStatusTest()) && p('doing:name,value') && e('进行中,152'); //统计状态为进行中的任务数量
r($task->getDataOfTasksPerStatusTest()) && p('pause:name,value') && e('已暂停,152'); //统计状态为已暂停的任务数量
r($task->getDataOfTasksPerStatusTest()) && p('cancel:name,value') && e('已取消,151'); //统计状态为已取消的任务数量
r($task->getDataOfTasksPerStatusTest()) && p('closed:name,value') && e('已关闭,151'); //统计状态为已关闭的任务数量
r($task->getDataOfTasksPerStatusTest()) && p('closed:name,value') && e('已关闭,151'); //统计状态为已关闭的任务数量
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -21,4 +21,4 @@ $task = new taskTest();
r($task->getDataOfTasksPerTypeTest()) && p('devel:name,value') && e('开发,115'); //统计类型为devel的任务数量
r($task->getDataOfTasksPerTypeTest()) && p('study:name,value') && e('研究,114'); //统计类型为study的任务数量
r($task->getDataOfTasksPerTypeTest()) && p('discuss:name,value') && e('讨论,113'); //统计类型为discuss的任务数量
r($task->getDataOfTasksPerTypeTest()) && p('ui:name,value') && e('界面,113'); //统计类型为ui的任务数量
r($task->getDataOfTasksPerTypeTest()) && p('ui:name,value') && e('界面,113'); //统计类型为ui的任务数量
+2 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -17,4 +17,4 @@ pid=1
$estimateID = '1';
$task = new taskTest();
r($task->getEstimateByIdTest($estimateID)) && p('work') && e('这里是工作内容1'); // 根据estimateID查看预计工时
r($task->getEstimateByIdTest($estimateID)) && p('work') && e('这里是工作内容1'); // 根据estimateID查看预计工时
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -17,4 +17,4 @@ pid=1
$executionID = '102';
$task = new taskTest();
r($task->getExecutionTaskPairsTest($executionID)) && p('2') && e('2::开发任务12'); //根据执行id查出任务id与name
r($task->getExecutionTaskPairsTest($executionID)) && p('2') && e('2::开发任务12'); //根据执行id查出任务id与name
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
$execution = zdTable('project');
+3 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -17,7 +17,7 @@ pid=1
$task = new taskTest();
$taskObject = $task->getByIDTest(1);
$taskObject = $task->getByIDTest(1);
r($task->getFinishedUsersTest()) && p() && e('0'); // 获取空数据
r($task->getFinishedUsersTest($taskObject->id, $taskObject->team)) && p() && e('0'); // 获取完成多人任务ID为1的人员
r($task->getFinishedUsersTest($taskObject->id, $taskObject->team)) && p() && e('0'); // 获取完成多人任务ID为1的人员
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+2 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -25,4 +25,4 @@ r($task->getMemberPairsTest($taskIDList[0])) && p('po82') && e('P:研发主管
r($task->getMemberPairsTest($taskIDList[0])) && p('user92') && e('U:测试92'); //获取taskid为1的团队人员 user92
r($task->getMemberPairsTest($taskIDList[0])) && p('count') && e('3'); //获取taskid为1的团队人员数量
r($task->getMemberPairsTest($taskIDList[1])) && p('count') && e('1'); //获取taskid为601的团队人员数量
r($task->getMemberPairsTest($taskIDList[2])) && p() && e('0'); //获取taskid为不存在的100001的团队人员
r($task->getMemberPairsTest($taskIDList[2])) && p() && e('0'); //获取taskid为不存在的100001的团队人员
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -41,4 +41,4 @@ r($task->getParentTaskPairsTest($executionIDList[0])) && p('603') && e('更多
r($task->getParentTaskPairsTest($executionIDList[1])) && p('2') && e('开发任务12'); // 查找没有父任务的执行下的父任务 普通任务12
r($task->getParentTaskPairsTest($executionIDList[1])) && p('604') && e('更多任务4'); // 查找没有父任务的执行下的父任务 普通任务604
r($task->getParentTaskPairsTest($executionIDList[2])) && p('name') && e('0'); // 查找不是执行的父任务
r($task->getParentTaskPairsTest($executionIDList[3])) && p('name') && e('0'); // 查找不存在的执行下的父任务
r($task->getParentTaskPairsTest($executionIDList[3])) && p('name') && e('0'); // 查找不存在的执行下的父任务
+2 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -17,4 +17,4 @@ pid=1
$executionID = '101';
$task = new taskTest();
r($task->getProjectIDTest($executionID)) && p('project') && e('11'); //根据executionID查找projectID
r($task->getProjectIDTest($executionID)) && p('project') && e('11'); //根据executionID查找projectID
+2 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -19,4 +19,4 @@ $storyIDList = array(2, 1000001);
$task = new taskTest();
r($task->getStoryCommentsTest($storyIDList[0])) && p('0:comment') && e('这是一个系统日志测试备注2'); //根据storyID查找comment
r($task->getStoryCommentsTest($storyIDList[1])) && p('0:comment') && e('0'); //根据不存在的storyID查找comment
r($task->getStoryCommentsTest($storyIDList[1])) && p('0:comment') && e('0'); //根据不存在的storyID查找comment
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('test14');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
zdTable('effort')->config('effort_managetaskteam')->gen(10);
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/task.class.php';
su('admin');
+40 -40
View File
@@ -36,7 +36,7 @@ class taskZen extends task
$oldTask = $this->task->getByID($taskID);
$postData = $postDataFixer->get();
if($postData->estimate < 0 or $postData->left < 0 or $postData->consumed < 0)
if($postData->estimate < 0 || $postData->left < 0 || $postData->consumed < 0)
{
dao::$errors[] = $this->lang->task->error->recordMinus;
return false;
@@ -48,39 +48,39 @@ class taskZen extends task
return !dao::isError();
}
if(!empty($postData->lastEditedDate) and $oldTask->lastEditedDate != $postData->lastEditedDate)
if(!empty($postData->lastEditedDate) && $oldTask->lastEditedDate != $postData->lastEditedDate)
{
dao::$errors[] = $this->lang->error->editedByOther;
return false;
}
$task = $postDataFixer->add('id', $taskID)
->setIF(!$postData->assignedTo and !empty($oldTask->team) and !empty($postDataFixer->rawdata->team), 'assignedTo', $this->task->getAssignedTo4Multi($postDataFixer->rawdata->team, $oldTask))
->setIF(!$oldTask->mode and !$postData->assignedTo and !empty($postDataFixer->rawdata->team), 'assignedTo', $postDataFixer->rawdata->team[0])
->setIF(!$postData->assignedTo && !empty($oldTask->team) && !empty($postDataFixer->rawdata->team), 'assignedTo', $this->task->getAssignedTo4Multi($postDataFixer->rawdata->team, $oldTask))
->setIF(!$oldTask->mode && !$postData->assignedTo && !empty($postDataFixer->rawdata->team), 'assignedTo', $postDataFixer->rawdata->team[0])
->setIF(is_numeric($postData->estimate), 'estimate', (float)$postData->estimate)
->setIF(is_numeric($postData->consumed), 'consumed', (float)$postData->consumed)
->setIF(is_numeric($postData->left), 'left', (float)$postData->left)
->setIF($oldTask->parent == 0 && $postData->parent == '', 'parent', 0)
->setIF($postData->story != false and $postData->story != $oldTask->story, 'storyVersion', $this->loadModel('story')->getVersion($postData->story))
->setIF($postData->story != false && $postData->story != $oldTask->story, 'storyVersion', $this->loadModel('story')->getVersion($postData->story))
->setIF($postData->mode == 'single', 'mode', '')
->setIF($postData->status == 'done', 'left', 0)
->setIF($postData->status == 'done' and !$postData->finishedBy, 'finishedBy', $this->app->user->account)
->setIF($postData->status == 'done' and !$postData->finishedDate, 'finishedDate', $now)
->setIF($postData->status == 'done' && !$postData->finishedBy, 'finishedBy', $this->app->user->account)
->setIF($postData->status == 'done' && !$postData->finishedDate, 'finishedDate', $now)
->setIF($postData->status == 'cancel' and !$postData->canceledBy, 'canceledBy', $this->app->user->account)
->setIF($postData->status == 'cancel' and !$postData->canceledDate, 'canceledDate', $now)
->setIF($postData->status == 'cancel' && !$postData->canceledBy, 'canceledBy', $this->app->user->account)
->setIF($postData->status == 'cancel' && !$postData->canceledDate, 'canceledDate', $now)
->setIF($postData->status == 'cancel', 'assignedTo', $oldTask->openedBy)
->setIF($postData->status == 'cancel', 'assignedDate', $now)
->setIF($postData->status == 'closed' and !$postData->closedBy, 'closedBy', $this->app->user->account)
->setIF($postData->status == 'closed' and !$postData->closedDate, 'closedDate', $now)
->setIF($postData->consumed > 0 and $postData->left > 0 and $postData->status == 'wait', 'status', 'doing')
->setIF($postData->status == 'closed' && !$postData->closedBy, 'closedBy', $this->app->user->account)
->setIF($postData->status == 'closed' && !$postData->closedDate, 'closedDate', $now)
->setIF($postData->consumed > 0 && $postData->left > 0 && $postData->status == 'wait', 'status', 'doing')
->setIF($postData->assignedTo != $oldTask->assignedTo, 'assignedDate', $now)
->setIF($postData->status == 'wait' and $postData->left == $oldTask->left and $postData->consumed == 0 and $postData->estimate, 'left', $postData->estimate)
->setIF($oldTask->parent > 0 and !$postData->parent, 'parent', 0)
->setIF($postData->status == 'wait' && $postData->left == $oldTask->left && $postData->consumed == 0 && $postData->estimate, 'left', $postData->estimate)
->setIF($oldTask->parent > 0 && !$postData->parent, 'parent', 0)
->setIF($oldTask->parent < 0, 'estimate', $oldTask->estimate)
->setIF($oldTask->parent < 0, 'left', $oldTask->left)
@@ -142,7 +142,7 @@ class taskZen extends task
/* Prepare to assign to relevant parameters. */
if(!isset($this->view->members[$task->assignedTo])) $this->view->members[$task->assignedTo] = $task->assignedTo;
if(isset($this->view->members['closed']) or $task->status == 'closed') $this->view->members['closed'] = 'Closed';
if(isset($this->view->members['closed']) || $task->status == 'closed') $this->view->members['closed'] = 'Closed';
/* Get the executions of the task. */
$executions = !empty($task->project) ? $this->execution->getByProject($task->project, 'all', 0, true) : array();
@@ -223,7 +223,7 @@ class taskZen extends task
*/
protected function reponseAfterAssignTo(int $taskID, string $from): array|int
{
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return array('result' => 'success');
if($this->viewType == 'json' || (defined('RUN_MODE') && RUN_MODE == 'api')) return array('result' => 'success');
$task = $this->task->getById($taskID);
if(isonlybody()) return $this->reponseKanban($task, $from);
@@ -247,14 +247,14 @@ class taskZen extends task
$task = $this->task->getByID($taskID);
/* Compute next assignedTo. */
if(!empty($task->team) and strpos('done,cencel,closed', $task->status) === false)
if(!empty($task->team) && strpos('done,cencel,closed', $task->status) === false)
{
$task->nextUser = $this->task->getAssignedTo4Multi($task->team, $task, 'next');
$members = $this->task->getMemberPairs($task);
}
if(!isset($members[$task->assignedTo])) $members[$task->assignedTo] = $task->assignedTo;
if(isset($members['closed']) or $task->status == 'closed') $members['closed'] = 'Closed';
if(isset($members['closed']) || $task->status == 'closed') $members['closed'] = 'Closed';
$this->view->title = $this->view->execution->name . $this->lang->colon . $this->lang->task->assign;
$this->view->position[] = $this->lang->task->assign;
@@ -280,7 +280,7 @@ class taskZen extends task
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
$inLiteKanban = $this->config->vision == 'lite' && $this->app->tab == 'project' && $this->session->kanbanview == 'kanban';
if(($this->app->tab == 'execution' or $inLiteKanban) && $execution->type == 'kanban')
if(($this->app->tab == 'execution' || $inLiteKanban) && $execution->type == 'kanban')
{
$rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : '';
$kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue);
@@ -348,7 +348,7 @@ class taskZen extends task
->setIF($rawData->estimate != false, 'left', $rawData->estimate)
->setIF(isset($rawData->story), 'storyVersion', isset($rawData->story) ? $this->loadModel('story')->getVersion($rawData->story) : 0)
->setIF(empty($rawData->multiple) || count($team) < 1, 'mode', '')
->setIF($execution && ($execution->lifetime == 'ops' or in_array($execution->attribute, array('request', 'review'))), 'story', 0)
->setIF($execution && ($execution->lifetime == 'ops' || in_array($execution->attribute, array('request', 'review'))), 'story', 0)
->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags)
->join('mailto', ',')
->get();
@@ -389,12 +389,12 @@ class taskZen extends task
foreach($formData->name as $i => $name)
{
/* 给同上的变量赋值。 */
$story = (!isset($tasks->story[$i]) or $tasks->story[$i] == 'ditto') ? $story : $tasks->story[$i];
$module = (!isset($tasks->module[$i]) or $tasks->module[$i] == 'ditto') ? $module : $tasks->module[$i];
$type = (!isset($tasks->type[$i]) or $tasks->type[$i] == 'ditto') ? $type : $tasks->type[$i];
$assignedTo = (!isset($tasks->assignedTo[$i]) or $tasks->assignedTo[$i] == 'ditto') ? $assignedTo : $tasks->assignedTo[$i];
$estStarted = (!isset($tasks->estStarted[$i]) or isset($tasks->estStartedDitto[$i])) ? $estStarted : $tasks->estStarted[$i];
$deadline = (!isset($tasks->deadline[$i]) or isset($tasks->deadlineDitto[$i])) ? $deadline : $tasks->deadline[$i];
$story = !isset($tasks->story[$i]) || $tasks->story[$i] == 'ditto' ? $story : $tasks->story[$i];
$module = !isset($tasks->module[$i]) || $tasks->module[$i] == 'ditto' ? $module : $tasks->module[$i];
$type = !isset($tasks->type[$i]) || $tasks->type[$i] == 'ditto' ? $type : $tasks->type[$i];
$assignedTo = !isset($tasks->assignedTo[$i]) || $tasks->assignedTo[$i] == 'ditto' ? $assignedTo : $tasks->assignedTo[$i];
$estStarted = !isset($tasks->estStarted[$i]) || isset($tasks->estStartedDitto[$i]) ? $estStarted : $tasks->estStarted[$i];
$deadline = !isset($tasks->deadline[$i]) || isset($tasks->deadlineDitto[$i]) ? $deadline : $tasks->deadline[$i];
/* 检查任务名称为空的数据。 */
if(empty($tasks->name[$i]))
@@ -435,12 +435,12 @@ class taskZen extends task
/* 过滤事务型和任务名称为空的数据。 */
if(empty($tasks->name[$key])) continue;
if($tasks->type[$key] == 'affair') continue;
if($tasks->type[$key] == 'ditto' and isset($tasks->type[$key - 1]) and $tasks->type[$key - 1] == 'affair') continue;
if($tasks->type[$key] == 'ditto' && isset($tasks->type[$key - 1]) && $tasks->type[$key - 1] == 'affair') continue;
if($storyID == 'ditto') $storyID = $preStory;
$preStory = $storyID;
if(!isset($tasks->story[$key - 1]) and $key > 1 and !empty($tasks->name[$key - 1]))
if(!isset($tasks->story[$key - 1]) && $key > 1 && !empty($tasks->name[$key - 1]))
{
$storyIDs[] = 0;
$taskNames[] = $tasks->name[$key - 1];
@@ -448,7 +448,7 @@ class taskZen extends task
/* 判断Post传过来的任务有没有重复数据。 */
$hasExistsName = in_array($tasks->name[$key], $taskNames);
if($hasExistsName and in_array($storyID, $storyIDs))
if($hasExistsName && in_array($storyID, $storyIDs))
{
dao::$errors['message'][] = sprintf($this->lang->duplicate, $this->lang->task->common) . ' ' . $tasks->name[$key];
return false;
@@ -503,8 +503,8 @@ class taskZen extends task
$task->version = 1;
if($story) $task->storyVersion = (int)$this->dao->findById($task->story)->from(TABLE_STORY)->fetch('version');
if($assignedTo) $task->assignedDate = $now;
if(strpos($this->config->task->create->requiredFields, 'estStarted') !== false and empty($estStarted)) $task->estStarted = '';
if(strpos($this->config->task->create->requiredFields, 'deadline') !== false and empty($deadline)) $task->deadline = '';
if(strpos($this->config->task->create->requiredFields, 'estStarted') !== false && empty($estStarted)) $task->estStarted = '';
if(strpos($this->config->task->create->requiredFields, 'deadline') !== false && empty($deadline)) $task->deadline = '';
if(isset($tasks->lanes[$index])) $task->laneID = $tasks->lanes[$index];
/* 附加工作流字段。 */
@@ -567,7 +567,7 @@ class taskZen extends task
protected function checkDuplicateName($task): int
{
/* Check duplicate task. */
if($task->type == 'affair' or !$task->name) return 0;
if($task->type == 'affair' || !$task->name) return 0;
$result = $this->loadModel('common')->removeDuplicate('task', $task, "execution={$task->execution} and story=" . (int)$task->story . (isset($task->feedback) ? " and feedback=" . (int)$task->feedback : ''));
if($result['stop']) return zget($result, 'duplicate', 0);
return 0;
@@ -643,7 +643,7 @@ class taskZen extends task
if(dao::isError()) return array('result' => 'fail', 'message' => dao::getError());
/* Return task id when call the API. */
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $task->id);
if($this->viewType == 'json' || (defined('RUN_MODE') && RUN_MODE == 'api')) return array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $task->id);
$response['result'] = 'success';
$response['message'] = $this->lang->saveSuccess;
@@ -656,7 +656,7 @@ class taskZen extends task
if(isonlybody())
{
/* If it is Kanban execution, refresh the Kanban statically through callback. */
if($this->app->tab == 'execution' or $this->config->vision == 'lite')
if($this->app->tab == 'execution' || $this->config->vision == 'lite')
{
$kanbanData = $this->getKanbanData($execution);
$response['closeModal'] = true;
@@ -747,7 +747,7 @@ class taskZen extends task
/* Get module information. */
$showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : '';
$moduleOptionMenu = $this->tree->getTaskOptionMenu($executionID, 0, 0, $showAllModule ? 'allModule' : '');
if(!$storyID and !isset($moduleOptionMenu[$task->module])) $task->module = 0;
if(!$storyID && !isset($moduleOptionMenu[$task->module])) $task->module = 0;
/* Display relevant variables. */
$this->assignExecution4Create($execution);
@@ -844,7 +844,7 @@ class taskZen extends task
$projectID = $execution ? $execution->project : 0;
$lifetimeList = array();
$attributeList = array();
if(!empty($projectID))
if($projectID)
{
$executionKey = 0;
$executions = $this->execution->getByProject($projectID, 'all', 0, true);
@@ -896,7 +896,7 @@ class taskZen extends task
$testStories = array();
foreach($stories as $testStoryID => $storyTitle)
{
if(empty($testStoryID) or isset($testStoryIdList[$testStoryID])) continue;
if(empty($testStoryID) || isset($testStoryIdList[$testStoryID])) continue;
$testStories[$testStoryID] = $storyTitle;
}
$this->view->testStories = $testStories;
@@ -1037,13 +1037,13 @@ class taskZen extends task
$customFormField = 'custom' . ucfirst($action). 'Fields';
foreach(explode(',', $this->config->task->{$customFormField}) as $field)
{
if($execution->type == 'stage' and strpos('estStarted,deadline', $field) !== false) continue;
if($execution->type == 'stage' && strpos('estStarted,deadline', $field) !== false) continue;
$customFields[$field] = $this->lang->task->$field;
}
/* 设置已勾选的自定义字段。 */
$showFields = $this->config->task->custom->{$action . 'Fields'};
if($execution->lifetime == 'ops' or $execution->attribute == 'request' or $execution->attribute == 'review')
if($execution->lifetime == 'ops' || $execution->attribute == 'request' || $execution->attribute == 'review')
{
unset($customFields['story']);
$showFields = str_replace(',story,', ',', ",{$showFields},");
@@ -1122,7 +1122,7 @@ class taskZen extends task
{
$link = $this->createLink('my', 'work', 'mode=task');
}
elseif($this->app->tab == 'project' and $execution->multiple)
elseif($this->app->tab == 'project' && $execution->multiple)
{
$link = $this->createLink('project', 'execution', "browseType=all&projectID={$execution->project}");
}