browsebranch.html.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * The browseBranch view file of repo 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 Yang Li <liyang@easycorp.ltd>
  7. * @package repo
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. jsVar('searchUrl', createLink('repo', 'browsebranch', "repoID={$repo->id}&objectID={$objectID}&label={$label}&showArchived={$showArchived}&keyword=%s"));
  12. $module = $app->tab == 'devops' ? 'repo' : $app->tab;
  13. dropmenu
  14. (
  15. set::module($module),
  16. set::tab($module),
  17. set::url(createLink($module, 'ajaxGetDropMenu', "objectID=$objectID&module={$app->rawModule}&method={$app->rawMethod}"))
  18. );
  19. featureBar
  20. (
  21. (in_array($app->tab, array('project', 'execution')) && count($repoPairs) > 1) ? dropmenu
  22. (
  23. set::id('repoDropmenu'),
  24. set::text($repo->name),
  25. set::objectID($repo->id),
  26. set::url(createLink('repo', 'ajaxGetDropMenu', "repoID={$repo->id}&module=repo&method=browsebranch&projectID={$objectID}"))
  27. ) : null,
  28. div
  29. (
  30. setClass('flex branch-search'),
  31. input
  32. (
  33. set::placeholder(sprintf($lang->repo->searchTips, strtolower($lang->repo->branch))),
  34. set::name('keyword'),
  35. set::value(base64_decode($keyword))
  36. ),
  37. btn
  38. (
  39. setClass('primary ml-2'),
  40. $lang->searchAB,
  41. on::click('searchList')
  42. )
  43. )
  44. );
  45. $config->repo->dtable->branch->fieldList['committer']['map'] = $users;
  46. if(!hasPriv('repo', 'revision')) unset($config->repo->dtable->branch->fieldList['commitID']['link']);
  47. $branchList = initTableData($branchList, $config->repo->dtable->branch->fieldList);
  48. $urlParams = array(
  49. 'repoID' => $repo->id,
  50. 'objectID' => $objectID,
  51. 'label' => $label,
  52. 'showArchived' => $showArchived,
  53. 'keyword' => urlencode($keyword),
  54. 'orderBy' => '{name}_{sortType}',
  55. 'recTotal' => $pager->recTotal,
  56. 'recPerPage' => $pager->recPerPage,
  57. 'pageID' => $pager->pageID
  58. );
  59. dtable
  60. (
  61. set::cols($config->repo->dtable->branch->fieldList),
  62. set::data($branchList),
  63. set::orderBy($orderBy),
  64. set::sortLink(createLink('repo', 'browsebranch', $urlParams)),
  65. set::footPager(usePager('pager', 'noTotalCount'))
  66. );