zentaomax.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * @return int|false
  4. * @param object $testtask
  5. */
  6. public function create($testtask)
  7. {
  8. return $this->loadExtension('zentaomax')->create($testtask);
  9. }
  10. /**
  11. * @return mixed[]|bool
  12. * @param object $task
  13. * @param object $oldTask
  14. */
  15. public function update($task, $oldTask)
  16. {
  17. return $this->loadExtension('zentaomax')->update($task, $oldTask);
  18. }
  19. /**
  20. * @param int $productID
  21. * @param string $branch
  22. * @param string $type
  23. * @param string $begin
  24. * @param string $end
  25. * @param string $orderBy
  26. */
  27. public function getProductTasks($productID, $branch = 'all', $type = '', $begin = '', $end = '', $orderBy = 'id_desc', $pager = null)
  28. {
  29. return $this->loadExtension('zentaomax')->getProductTasks($productID, $branch, $type, $begin, $end, $orderBy, $pager);
  30. }
  31. /**
  32. * @param int $projectID
  33. * @param int $productID
  34. * @param string $orderBy
  35. * @param string $status
  36. */
  37. public function getProjectTasks($projectID, $productID = 0, $orderBy = 'id_desc', $pager = null, $status = '')
  38. {
  39. return $this->loadExtension('zentaomax')->getProjectTasks($projectID, $productID, $orderBy, $pager, $status);
  40. }
  41. /**
  42. * @param int $executionID
  43. * @param int $productID
  44. * @param string $objectType
  45. * @param string $orderBy
  46. */
  47. public function getExecutionTasks($executionID, $productID = 0, $objectType = 'execution', $orderBy = 'id_desc', $pager = null)
  48. {
  49. return $this->loadExtension('zentaomax')->getExecutionTasks($executionID, $productID, $objectType, $orderBy, $pager);
  50. }
  51. /**
  52. * @param string $account
  53. * @param string $orderBy
  54. * @param string $type
  55. */
  56. public function getByUser($account, $pager = null, $orderBy = 'id_desc', $type = '')
  57. {
  58. return $this->loadExtension('zentaomax')->getByUser($account, $pager, $orderBy, $type);
  59. }
  60. /**
  61. * @param object $task
  62. * @param int $productID
  63. * @param string $type
  64. * @param int $param
  65. */
  66. public function getLinkableCases($productID, $task, $type = 'all', $param = 0, $pager = null)
  67. {
  68. return $this->loadExtension('zentaomax')->getLinkableCases($productID, $task, $type, $param, $pager);
  69. }
  70. /**
  71. * @param int $taskID
  72. */
  73. public function getTaskProducts($taskID)
  74. {
  75. return $this->loadExtension('zentaomax')->getTaskProducts($taskID);
  76. }
  77. /**
  78. * @param mixed[] $tasks
  79. */
  80. public function appendProductGroup($tasks)
  81. {
  82. return $this->loadExtension('zentaomax')->appendProductGroup($tasks);
  83. }
  84. /**
  85. * @return object|false
  86. */
  87. public static function createTestTaskLink($type, $module, $parent, $extra)
  88. {
  89. $taskID = $extra['taskID'];
  90. $data = new stdclass();
  91. $data->id = $module->id;
  92. $data->parent = $module->parent ? $module->parent : $parent;
  93. $data->name = $module->name;
  94. $data->url = helper::createLink('testtask', 'cases', "taskID=$taskID&type=byModule&module={$module->id}");
  95. return $data;
  96. }