browse.html.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /**
  3. * The browse view file of process module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Guangming Sun <sunguangming@easycorp.ltd>
  7. * @package process
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. if(!$hasProcess)
  12. {
  13. $currentModuleName = $lang->process->common;
  14. include('../../common/ext/ui/closefeaturenotice.html.php');
  15. return;
  16. }
  17. jsVar('groupID', $groupID);
  18. jsVar('browseType', $browseType);
  19. jsVar('param', $param);
  20. jsVar('orderBy', $orderBy);
  21. foreach($processList as $process)
  22. {
  23. $process->desc = str_replace('&nbsp;', ' ', strip_tags($process->desc));
  24. if($process->module == 0) $process->module = '';
  25. }
  26. $cols = $this->loadModel('datatable')->getSetting('process');
  27. $tableData = initTableData($processList, $cols, $this->process);
  28. if(isset($cols['module'])) $cols['module']['map'] = $modules;
  29. featureBar
  30. (
  31. set::current($browseType == 'bysearch' ? $param : 'all'),
  32. set::linkParams("groupID={$groupID}&browseType={key}&param={$param}&orderBy={$orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"),
  33. li(searchToggle(set::open($browseType == 'bysearch')))
  34. );
  35. $canCreate = hasPriv('process', 'create');
  36. $canBatchCreate = hasPriv('process', 'batchCreate');
  37. $createLink = createLink('process', 'create', "groupID=$groupID&moduleID=$moduleID");
  38. $batchCreateLink = createLink('process', 'batchCreate', "groupID=$groupID&moduleID=$moduleID");
  39. $createItem = array('text' => $lang->process->create, 'url' => $createLink, 'data-toggle' => 'modal');
  40. $batchCreateItem = array('text' => $lang->process->batchCreate, 'url' => $batchCreateLink);
  41. toolbar
  42. (
  43. $canCreate && $canBatchCreate ? btngroup
  44. (
  45. btn(setClass('btn primary create-process-btn'), set::icon('plus'), set::url($createLink), $lang->process->create, setData(array('toggle' => 'modal'))),
  46. dropdown
  47. (
  48. btn(setClass('btn primary dropdown-toggle'), setStyle(array('padding' => '6px', 'border-radius' => '0 2px 2px 0'))),
  49. set::items(array($createItem, $batchCreateItem)),
  50. set::placement('bottom-end')
  51. )
  52. ) : null,
  53. $canCreate && !$canBatchCreate ? item(set($createItem + array('class' => 'btn primary', 'icon' => 'plus'))) : null,
  54. $canBatchCreate && !$canCreate ? item(set($batchCreateItem + array('class' => 'btn primary', 'icon' => 'plus'))) : null
  55. );
  56. $settingLink = hasPriv('process', 'manageModule') ? createLink('process', 'manageModule', "rootID=$groupID") : '';
  57. sidebar
  58. (
  59. moduleMenu
  60. (
  61. set::modules($moduleTree),
  62. set::activeKey($moduleID),
  63. set::allText($lang->process->allModule),
  64. set::settingLink($settingLink),
  65. set::settingText($lang->process->manageModule),
  66. set::isInModal(true),
  67. set::showDisplay(false),
  68. set::closeLink(createLink('process', 'browse', "groupID={$groupID}")),
  69. set::app($app->tab)
  70. )
  71. );
  72. $canBatchEdit = hasPriv('process', 'batchEdit');
  73. $footToolbar = array
  74. (
  75. array
  76. (
  77. 'type' => 'btn-group',
  78. 'items' => array
  79. (
  80. array
  81. (
  82. 'text' => $lang->edit,
  83. 'className' => 'secondary batch-btn',
  84. 'data-page' => 'batch',
  85. 'data-formaction' => createLink('process', 'batchEdit', "groupID=$groupID"),
  86. )
  87. )
  88. )
  89. );
  90. dtable
  91. (
  92. set::id('processTable'),
  93. set::groupDivider(true),
  94. set::checkable($canBatchEdit),
  95. set::plugins(array('sortable')),
  96. set::sortHandler('.move-process'),
  97. set::onSortEnd(jsRaw('window.onSortEnd')),
  98. set::cols($cols),
  99. set::data($tableData),
  100. set::orderBy($orderBy),
  101. set::sortLink(createLink('process', 'browse', "groupID=$groupID&browseType=$browseType&param=$param&orderBy={name}_{sortType}")),
  102. set::userMap($users),
  103. set::onRenderCell(jsRaw('window.renderProcessCell')),
  104. set::footPager(usePager()),
  105. set::footToolbar($footToolbar),
  106. set::emptyTip($lang->noData)
  107. );