browse.html.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * The browse view file of stage 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 Shujie Tian<tianshujie@easycorp.ltd>
  7. * @package stage
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. featureBar();
  12. $canCreateStage = hasPriv('stage', 'create');
  13. $canbatchCreateStage = hasPriv('stage', 'batchCreate');
  14. if($canCreateStage) $createItem = array('icon' => 'plus', 'class' => 'primary', 'text' => $lang->stage->create, 'url' => $this->createLink('stage', 'create', "groupID={$groupID}"), 'data-toggle' => 'modal');
  15. if($canbatchCreateStage) $batchCreateItem = array('icon' => 'plus', 'class' => 'primary', 'text' => $lang->stage->batchCreate, 'url' => $this->createLink('stage', 'batchCreate', "groupID={$groupID}"));
  16. toolbar
  17. (
  18. !empty($batchCreateItem) ? item(set($batchCreateItem)) : null,
  19. !empty($createItem) ? item(set($createItem)) : null
  20. );
  21. if($this->config->edition == 'open')
  22. {
  23. if(hasPriv('stage', 'settype'))
  24. {
  25. $menuItems[] = li
  26. (
  27. setClass('menu-item'),
  28. a
  29. (
  30. set::href(createLink('stage', 'settype')),
  31. $lang->stage->setType
  32. )
  33. );
  34. }
  35. $menuItems[] = li
  36. (
  37. setClass('menu-item'),
  38. a
  39. (
  40. setClass('active'),
  41. set::href(createLink('stage', 'browse')),
  42. $lang->stage->browseAB
  43. )
  44. );
  45. sidebar
  46. (
  47. div
  48. (
  49. setClass('cell p-2.5 bg-white'),
  50. menu($menuItems)
  51. )
  52. );
  53. }
  54. $tableData = initTableData($stages, $config->stage->dtable->fieldList, $this->stage);
  55. dtable
  56. (
  57. set::cols($config->stage->dtable->fieldList),
  58. set::data($tableData),
  59. set::orderBy($orderBy),
  60. set::sortLink(createLink('stage', 'browse', "groupID={$groupID}&orderBy={name}_{sortType}")),
  61. set::plugins(array('sortable')),
  62. set::sortHandler('.move-stage'),
  63. set::onSortEnd(jsRaw('window.onSortEnd')),
  64. set::onRenderCell(jsRaw('window.renderCell'))
  65. );