importtask.html.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. /**
  3. * The task view file of execution module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  6. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Yanyi Cao<caoyanyi@easycorp.ltd>
  8. * @package execution
  9. * @link https://www.zentao.net
  10. */
  11. namespace zin;
  12. $executions = array(0 => $lang->execution->allExecutions) + $executions;
  13. featureBar
  14. (
  15. set::current('all'),
  16. set::linkParams("toExecution={$execution->id}"),
  17. inputGroup
  18. (
  19. setClass('ml-6'),
  20. $lang->execution->selectExecution,
  21. picker
  22. (
  23. set::width(200),
  24. set::name('execution'),
  25. set::items($executions),
  26. set::value($fromExecution),
  27. set::required(true),
  28. on::change('changeExecution')
  29. )
  30. )
  31. );
  32. $viewType = $this->cookie->taskViewType ? $this->cookie->taskViewType : 'tree';
  33. toolbar
  34. (
  35. item(set(array
  36. (
  37. 'type' => 'btnGroup',
  38. 'items' => array(array
  39. (
  40. 'icon' => 'list',
  41. 'class' => 'btn-icon switchButton' . ($viewType == 'tiled' ? ' text-primary' : ''),
  42. 'data-type' => 'tiled',
  43. 'hint' => $lang->task->viewTypeList['tiled']
  44. ), array
  45. (
  46. 'icon' => 'treeview',
  47. 'class' => 'switchButton btn-icon' . ($viewType == 'tree' ? ' text-primary' : ''),
  48. 'data-type' => 'tree',
  49. 'hint' => $lang->task->viewTypeList['tree']
  50. ))
  51. )))
  52. );
  53. $config->task->dtable->importTask->fieldList['execution']['map'] = $executions;
  54. if($execution->lifetime == 'ops' || in_array($execution->attribute, array('request', 'review'))) unset($config->task->dtable->importTask->fieldList['story']);
  55. $footToolbar['items'][] = array(
  56. 'text' => $lang->execution->importTask,
  57. 'className' => 'btn secondary toolbar-item batch-btn size-sm',
  58. 'data-url' => createLink('execution', 'importtask', "executionID={$execution->id}&fromExecution={$fromExecution}")
  59. );
  60. if(!isInModal())
  61. {
  62. $footToolbar['items'][] = array(
  63. 'text' => $lang->goback,
  64. 'btnType' => 'info',
  65. 'className' => 'btn-info toolbar-item size-sm text-gray',
  66. 'url' => createLink('execution', 'task', "executionID={$execution->id}")
  67. );
  68. }
  69. jsVar('executionID', $execution->id);
  70. jsVar('childrenAB', $lang->task->childrenAB);
  71. jsVar('parentAB', $lang->task->parentAB);
  72. if($viewType == 'tiled') $config->task->dtable->importTask->fieldList['name']['nestedToggle'] = false;
  73. $cols = array_values($config->task->dtable->importTask->fieldList);
  74. dtable
  75. (
  76. set::userMap($memberPairs),
  77. set::cols($cols),
  78. set::data($tasks2Imported),
  79. set::showToolbarOnChecked(false),
  80. set::orderBy($orderBy),
  81. set::sortLink(createLink('execution', 'importTask', "executionID={$execution->id}&fromExecution={$fromExecution}&orderBy={name}_{sortType}&recPerPage={$pager->recPerPage}")),
  82. set::footToolbar($footToolbar),
  83. set::onRenderCell(jsRaw('window.renderCell')),
  84. set::footPager(
  85. usePager
  86. (
  87. array('linkCreator' => helper::createLink('execution', 'importTask', "executionID={$execution->id}&fromExecution={$fromExecution}&orderBy=$orderBy&recPerPage={recPerPage}&page={page}"))
  88. )
  89. )
  90. );
  91. render();