browse.html.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * The browse view file of host 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 Ke Zhao<zhaoke@easycorp.ltd>
  8. * @package host
  9. * @link https://www.zentao.net
  10. */
  11. namespace zin;
  12. jsVar('hostLang', $lang->host);
  13. jsVar('rooms', $rooms);
  14. $config->host->featureBar['all']['active'] = true;
  15. $config->host->featureBar['all']['badge'] = $pager->recTotal != '' ? array('text' => $pager->recTotal, 'class' => 'size-sm rounded-full white') : null;
  16. featureBar
  17. (
  18. set::items($config->host->featureBar),
  19. li(searchToggle(set::open($browseType == 'bySearch')))
  20. );
  21. /* zin: Define the toolbar on main menu. */
  22. $canCreate = hasPriv('host', 'create');
  23. $createLink = $this->createLink('host', 'create');
  24. $createItem = array('text' => $lang->host->create, 'url' => $createLink, 'class' => 'primary', 'icon' => 'plus');
  25. $optionMenu[''] = '/';
  26. $config->host->dtable->fieldList['group']['map'] = $optionMenu;
  27. $config->host->dtable->fieldList['serverRoom']['map'] = $rooms;
  28. $tableData = initTableData($hostList, $config->host->dtable->fieldList, $this->host);
  29. foreach($tableData as $row)
  30. {
  31. if(!$row->admin) $row->admin = '';
  32. }
  33. toolbar(hasPriv('serverroom', 'browse') ? item(set(array('text' => $lang->host->manageRoom, 'url' => createLink('serverroom', 'browse'), 'class' => 'primary'))) : null, $canCreate ? item(set($createItem)) : null);
  34. /* zin: Define the sidebar in main content. */
  35. sidebar
  36. (
  37. moduleMenu(set(array(
  38. 'modules' => $moduleTree,
  39. 'activeKey' => $param,
  40. 'allText' => $lang->host->group,
  41. 'settingText' => $lang->host->groupMaintenance,
  42. 'showDisplay' => false,
  43. 'settingLink' => $this->createLink('tree', 'browse', "productID=0&view=host"),
  44. 'closeLink' => $this->createLink('host', 'browse'),
  45. 'settingApp' => 'devops',
  46. )))
  47. );
  48. $cols = $this->loadModel('datatable')->getSetting('host');
  49. dtable
  50. (
  51. set::customCols(true),
  52. set::cols($cols),
  53. set::data($tableData),
  54. set::sortLink(createLink('host', 'browse', "browseType=$browseType&param=$param&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}")),
  55. set::orderBy($orderBy),
  56. set::onRenderCell(jsRaw('window.renderCell')),
  57. set::footPager(usePager())
  58. );
  59. render();