ajaxgetmultiplemetricbox.html.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. $metricID = $metric->id;
  12. $current = $metric;
  13. $viewType = 'multiple';
  14. include 'component/queryform.html.php';
  15. include 'component/tableandcharts.html.php';
  16. jsVar('updateTimeTip', $lang->metric->updateTimeTip);
  17. jsVar('calcTitleList', $lang->metric->calcTitleList);
  18. $star = (!empty($metric->collector) and strpos($metric->collector, ',' . $app->user->account . ',') !== false) ? 'star' : 'star-empty';
  19. div
  20. (
  21. setClass('metric-name metric-name-notfirst flex flex-between items-center'),
  22. div
  23. (
  24. span
  25. (
  26. setClass('metric-name-weight'),
  27. $metric->name
  28. ),
  29. btn
  30. (
  31. setClass('metric-collect metric-collect-' . $metricID),
  32. set::type('link'),
  33. set::icon($star),
  34. set::iconClass($star),
  35. set::square(true),
  36. set::size('sm'),
  37. set::title($lang->metric->collectStar),
  38. on::click('.metric-collect', "window.collectMetric({$metricID})")
  39. )
  40. ),
  41. div
  42. (
  43. setClass('flex-start'),
  44. toolbar
  45. (
  46. haspriv('metric', 'details') ? item(set(array
  47. (
  48. 'text' => $this->lang->metric->details,
  49. 'class' => 'ghost details',
  50. 'url' => helper::createLink('metric', 'details', "metricID=$metricID"),
  51. 'data-toggle' => 'modal'
  52. ))) : null,
  53. item(set(array
  54. (
  55. 'text' => $this->lang->metric->remove,
  56. 'class' => 'ghost metric-remove',
  57. 'onclick' => "window.handleRemoveLabel($metricID)"
  58. ))),
  59. haspriv('metric', 'filters') ? item(set(array
  60. (
  61. 'icon' => 'menu-backend',
  62. 'text' => $this->lang->metric->filters,
  63. 'class' => 'ghost hidden',
  64. 'url' => '#'
  65. ))) : null,
  66. haspriv('metric', 'zAnalysis') ? item(set(array
  67. (
  68. 'icon' => 'chart-line',
  69. 'text' => $this->lang->metric->zAnalysis,
  70. 'class' => 'ghost chart-line-margin hidden',
  71. 'url' => '#'
  72. ))) : null
  73. )
  74. )
  75. );
  76. $fnGenerateQueryForm($viewType);
  77. $fnGenerateTableAndCharts($metric);