preview.html.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * The preview view file of chart 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 Chenxuan Song <songchenxuan@easycorp.ltd>
  7. * @package chart
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. include 'charts.html.php';
  12. jsVar('previewUrl', inlink('preview', "dimension={$dimensionID}&group={$groupID}"));
  13. jsVar('maxPreviewCount', $config->chart->chartMaxChecked);
  14. jsVar('maxPreviewTips', sprintf($lang->chart->chartMaxChecked, $config->chart->chartMaxChecked));
  15. $lang->chart->featureBar['preview'] = array();
  16. foreach($groups as $id => $name)
  17. {
  18. if(!helper::hasFeature('devops') && strpos($name, $lang->devops->common) !== false) continue;
  19. $lang->chart->featureBar['preview'][$id] = $name;
  20. }
  21. featureBar(set::current($groupID), set::load(''), set::linkParams("dimension={$dimensionID}&group={key}"));
  22. if($config->edition != 'open')
  23. {
  24. toolbar(hasPriv('chart', 'export') ? item(set(array
  25. (
  26. 'text' => $lang->export,
  27. 'icon' => 'export',
  28. 'class' => 'ghost',
  29. 'url' => inlink('export', "chartID=&mode=preview", '', true),
  30. 'data-toggle' => 'modal',
  31. 'data-type' => 'iframe',
  32. 'data-size' => 'sm'
  33. ))) : null, hasPriv('chart', 'browse') ? item(set(array
  34. (
  35. 'text' => $lang->chart->toDesign,
  36. 'class' => 'primary',
  37. 'url' => inlink('browse'),
  38. ))) : null);
  39. }
  40. $chart = zget($charts, 0, null);
  41. sidebar(set::width(240), moduleMenu
  42. (
  43. to::header
  44. (
  45. div
  46. (
  47. setClass('bg-canvas my-3 mx-5 text-xl font-semibold text-ellipsis'),
  48. $groups[$groupID]
  49. )
  50. ),
  51. set::title($groups[$groupID]),
  52. set::modules($treeMenu),
  53. $charts ? set::activeKey($charts[0]->currentGroup . '_' . $charts[0]->id) : null,
  54. set::closeLink(''),
  55. set::showDisplay(false),
  56. set::titleShow(false),
  57. set::checkbox(true),
  58. set::checkOnClick('any'),
  59. to::footer
  60. ([
  61. $treeMenu ? div
  62. (
  63. setClass('bg-canvas px-4 py-2 module-menu'),
  64. btn($lang->chart->preview, setClass('primary'), set::hint($lang->chart->updateCharts), on::click('previewCharts'))
  65. ) : null,
  66. $config->edition == 'open' ? div
  67. (
  68. setClass('bg-canvas px-4 py-2 module-menu'),
  69. html(empty($config->isINT) ? $lang->bizVersion : $lang->bizVersionINT)
  70. ) : null
  71. ])
  72. ));
  73. div
  74. (
  75. setID('chartPanel'),
  76. $generateCharts()
  77. );