all.html.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * The all 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 Sun Guangming<sunguangming@easycorp.ltd>
  8. * @package execution
  9. * @link https://www.zentao.net
  10. */
  11. namespace zin;
  12. jsVar('typeList', $lang->execution->typeList);
  13. jsVar('delayWarning', $lang->task->delayWarning);
  14. jsVar('confirmBatchCloseExecution', $lang->execution->confirmBatchCloseExecution);
  15. $footToolbar = array();
  16. $canBatchEdit = common::hasPriv('execution', 'batchEdit');
  17. $canBatchChangeStatus = common::hasPriv('execution', 'batchChangeStatus');
  18. $canBatchAction = $canBatchEdit || $canBatchChangeStatus;
  19. if($canBatchAction)
  20. {
  21. if($canBatchEdit)
  22. {
  23. $footToolbar['items'][] = array(
  24. 'type' => 'btn-group',
  25. 'items' => array(
  26. array('text' => $lang->edit, 'className' => "btn secondary size-sm batch-btn", 'data-url' => createLink('execution', 'batchEdit'))
  27. )
  28. );
  29. }
  30. if($canBatchChangeStatus)
  31. {
  32. $statusList = array();
  33. foreach($lang->execution->statusList as $key => $value)
  34. {
  35. $statusList[] = array('text' => $value, 'innerClass' => 'batch-btn ajax-btn' . ($key == 'closed' ? ' batch-close-btn' : ''), 'data-url' => createLink('execution', 'batchChangeStatus', "status=$key"));
  36. }
  37. $footToolbar['items'][] = array('caret' => 'up', 'text' => $lang->statusAB, 'className' => 'btn btn-caret size-sm', 'btnType' => 'secondary', 'items' => $statusList, 'type' => 'dropdown');
  38. }
  39. }
  40. $executions = $this->execution->generateRow($executionStats, $users, $avatarList);
  41. $tableData = initTableData($executions, $config->execution->dtable->fieldList, $this->execution);
  42. /* zin: Define the feature bar on main menu. */
  43. featureBar
  44. (
  45. set::current($status),
  46. set::linkParams("status={key}"),
  47. li(searchToggle(set::open($status == 'bySearch')))
  48. );
  49. /* zin: Define the toolbar on main menu. */
  50. toolbar
  51. (
  52. hasPriv('execution', 'export') ? item(set(array
  53. (
  54. 'icon' => 'export',
  55. 'text' => $lang->programplan->exporting,
  56. 'class' => "ghost export",
  57. 'url' => createLink('execution', 'export', "status=$status&productID=$productID&orderBy=$orderBy&from=$from"),
  58. 'data-toggle' => 'modal'
  59. ))) : null,
  60. hasPriv('execution', 'create') ? item(set(array
  61. (
  62. 'icon' => 'plus',
  63. 'text' => $lang->execution->createExec,
  64. 'class' => "primary create-execution-btn",
  65. 'url' => createLink('execution', 'create')
  66. ))) : null
  67. );
  68. $setting = $this->datatable->getSetting('execution');
  69. dtable
  70. (
  71. set::userMap($users),
  72. set::cols($setting),
  73. set::data($tableData),
  74. set::checkable($canBatchAction),
  75. set::customCols(true),
  76. set::footToolbar($footToolbar),
  77. set::onRenderCell(jsRaw('window.onRenderCell')),
  78. set::orderBy($orderBy),
  79. set::sortLink(createLink('execution', 'all', "status={$status}&orderBy={name}_{sortType}&productID={$productID}&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&page={$pager->pageID}")),
  80. set::footPager(usePager(array
  81. (
  82. 'linkCreator' => helper::createLink('execution', 'all', "status={$status}&orderBy={$orderBy}&productID={$productID}&param=$param&recTotal={recTotal}&recPerPage={recPerPage}&page={page}")
  83. ))),
  84. set::emptyTip($from == 'execution' ? $lang->execution->noExecutions : $lang->execution->noExecution),
  85. set::createTip($from == 'execution' ? $lang->execution->createExec : $lang->execution->create),
  86. set::createLink(hasPriv('execution', 'create') ? createLink('execution', 'create') : '')
  87. );
  88. render();