browse.html.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * The browse view file of company 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 Mengyi Liu <liumengyi@easycorp.ltd>
  7. * @package company
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. jsVar('confirmDelist', $lang->metric->confirmDelist);
  12. jsVar('confirmDelistInUsed', $lang->metric->confirmDelistInUsed);
  13. jsVar('upgradeTip', $lang->metric->upgradeTip);
  14. jsVar('scope', $scope);
  15. jsVar('metricSql', $lang->metric->oldMetric->sql);
  16. jsVar('metricTip', $lang->metric->oldMetric->tip);
  17. jsVar('implementType', $lang->metric->implementType);
  18. jsVar('confirmRecalculate', $lang->metric->confirmRecalculate);
  19. featureBar
  20. (
  21. set::current($stage),
  22. set::linkParams("scope=$scope&status={key}&param=$param&type=$type"),
  23. li(searchToggle(set::open($type == 'bysearch'), set::module('metric')))
  24. );
  25. toolbar
  26. (
  27. setClass('clear-gap'),
  28. common::hasPriv('metric', 'recalculate') ? btn
  29. (
  30. setClass('btn ghost update-history mr-5'),
  31. set::icon('refresh'),
  32. $lang->metric->recalculate,
  33. bind::click("confirmRecalculate('all')")
  34. ) : null,
  35. btn
  36. (
  37. setClass('btn primary-outline'),
  38. set::url(helper::createLink('metric', 'preview')),
  39. $lang->metric->exitManage
  40. ),
  41. common::hasPriv('metric', 'create') ? div
  42. (
  43. setClass('btn-divider')
  44. ) : null,
  45. common::hasPriv('metric', 'create') ? btn
  46. (
  47. setClass('btn primary'),
  48. set::icon('plus'),
  49. set::url(helper::createLink('metric', 'create', "scope=$scope&period=nodate")),
  50. set('data-toggle', 'modal'),
  51. $lang->metric->create
  52. ) : null
  53. );
  54. sidebar
  55. (
  56. moduleMenu
  57. (
  58. to::header
  59. (
  60. div
  61. (
  62. setClass('bg-canvas'),
  63. dropmenu
  64. (
  65. set::defaultValue($scope),
  66. set::text($scopeText),
  67. set::caret(false),
  68. set::popWidth(128),
  69. set::popClass('popup text-md'),
  70. set::data(array('search' => false, 'checkIcon' => false, 'link' => $this->createLink('metric', 'browse', "scope={key}"), 'data' => $scopeList))
  71. )
  72. )
  73. ),
  74. set::titleShow(false),
  75. set::modules($metricTree),
  76. set::activeKey($type == 'byTree' ? $param : 0),
  77. set::closeLink($closeLink),
  78. set::showDisplay(false)
  79. )
  80. );
  81. $tableData = initTableData($metrics, $this->config->metric->dtable->definition->fieldList, $this->loadModel('metric'));
  82. list($cols, $tableData) = $this->metric->initActionBtn($tableData, $this->config->metric->dtable->definition->fieldList);
  83. dtable
  84. (
  85. setID('metricList'),
  86. set::userMap($users),
  87. set::orderBy($orderBy),
  88. set::sortLink(createLink('metric', 'browse', "scope={$scope}&stage={$stage}&param={$param}&type={$type}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}")),
  89. set::cols($cols),
  90. set::data($tableData),
  91. set::onRenderCell(jsRaw('window.onRenderCell')),
  92. set::footPager(usePager())
  93. );