browse.html.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * The browse view file of artifact 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 Zeng Gang<zenggang@easycorp.ltd>
  7. * @package artifact
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. jsVar('pageLink', $pageLink);
  12. $statusMap = array();
  13. $canCreate = (!$config->inCompose || !empty($hasNexusServer)) && hasPriv('artifactrepo', 'create');
  14. $artifactRepos = initTableData($artifactRepos, $config->artifactrepo->dtable->fieldList, $this->artifactrepo);
  15. foreach($artifactRepos as &$repo)
  16. {
  17. $productNames = array();
  18. $productList = explode(',', str_replace(' ', '', $repo->products));
  19. if($productList)
  20. {
  21. foreach($productList as $productID)
  22. {
  23. if(!isset($products[$productID])) continue;
  24. $productNames[] = zget($products, $productID, $productID);
  25. }
  26. $repo->productNames = implode(',', $productNames);
  27. }
  28. if(isset($repo->actions))
  29. {
  30. array_unshift($repo->actions, array('url' => $repo->url, 'target' => '_blank', 'icon' => 'menu-my', 'hint' => $lang->artifactrepo->visit));
  31. }
  32. }
  33. featureBar();
  34. toolBar
  35. (
  36. $canCreate ? item(set(array
  37. (
  38. 'text' => $lang->artifactrepo->create,
  39. 'icon' => 'plus',
  40. 'class' => 'btn primary',
  41. 'url' => createLink('artifactrepo', 'create'),
  42. ))) : null
  43. );
  44. dtable
  45. (
  46. set::cols($config->artifactrepo->dtable->fieldList),
  47. set::data($artifactRepos),
  48. set::onRenderCell(jsRaw('window.renderList')),
  49. set::sortLink(createLink('artifactrepo', 'browse', "browseType={$browseType}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}")),
  50. set::orderBy($orderBy),
  51. set::footPager(usePager())
  52. );