browse.html.php 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * The select template view file of doc module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2026 禅道软件(青岛)有限公司(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 Yue Liu<liuyue@chandao.com>
  7. * @package gapanalysis
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. featureBar
  12. (
  13. set::current($browseType),
  14. set::linkParams("projectID={$projectID}&status={key}&param={$param}&orderBy={$orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"),
  15. li(searchToggle
  16. (
  17. set::module('gapanalysis'),
  18. set::open($browseType == 'bysearch')
  19. ))
  20. );
  21. $canCreate = common::canModify('project', $project) && hasPriv('gapanalysis', 'create');
  22. $canBatchCreate = common::canModify('project', $project) && hasPriv('gapanalysis', 'batchCreate');
  23. $createLink = $this->createLink('gapanalysis', 'create', "projectID=$projectID");
  24. $batchCreateLink = $this->createLink('gapanalysis', 'batchCreate', "project=$projectID");
  25. $createItem = array('text' => $lang->gapanalysis->create, 'url' => $createLink);
  26. $batchCreateItem = array('text' => $lang->gapanalysis->batchCreate, 'url' => $batchCreateLink);
  27. toolbar
  28. (
  29. $canCreate && $canBatchCreate ? btngroup
  30. (
  31. btn(setClass('btn primary createTask-btn'), set::icon('plus'), set::url($createLink), $lang->gapanalysis->create),
  32. dropdown
  33. (
  34. btn(setClass('btn primary dropdown-toggle'),
  35. setStyle(array('padding' => '6px', 'border-radius' => '0 2px 2px 0'))),
  36. set::items(array_filter(array($createItem, $batchCreateItem))),
  37. set::placement('bottom-end')
  38. )
  39. ) : null,
  40. $canCreate && !$canBatchCreate ? item(set($createItem + array('class' => 'btn primary createTask-btn', 'icon' => 'plus'))) : null,
  41. $canBatchCreate && !$canCreate ? item(set($batchCreateItem + array('class' => 'btn primary', 'icon' => 'plus'))) : null
  42. );
  43. $cols = $this->loadModel('datatable')->getSetting('gapanalysis');
  44. $tableData = initTableData($gapanalysises, $cols, $this->gapanalysis);
  45. $footToolbar = array();
  46. $createGapanalysisLink = $canCreate ? $createLink : '';
  47. $canBatchEdit = common::hasPriv('gapanalysis', 'batchEdit');
  48. if($canBatchEdit)
  49. {
  50. $footToolbar['items'][] = array('text' => $lang->edit, 'className' => 'primary batch-btn', 'data-url' => createLink('gapanalysis', 'batchEdit', "projectID={$projectID}"));
  51. }
  52. dtable
  53. (
  54. set::id('gapanalysisList'),
  55. set::groupDivider(true),
  56. set::userMap($users),
  57. set::cols($cols),
  58. set::data($tableData),
  59. set::checkable($canBatchEdit),
  60. set::orderBy($orderBy),
  61. set::footToolbar($footToolbar),
  62. set::footPager(usePager(array
  63. (
  64. 'recPerPage' => $pager->recPerPage,
  65. 'recTotal' => $pager->recTotal,
  66. 'linkCreator' => helper::createLink('gapanalysis', 'browse', "projectID=$projectID&browseType=$browseType&param={$param}&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={recPerPage}&page={page}") . "#app={$app->tab}"
  67. ))),
  68. set::sortLink(createLink('gapanalysis', 'browse', "projectID=$projectID&browseType=$browseType&param={$param}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}")),
  69. set::createTip($lang->gapanalysis->create),
  70. set::createLink($createGapanalysisLink),
  71. set::emptyTip($lang->noData)
  72. );