control.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * The control file of dimension module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL (http://zpl.pub/page/zplv12.html)
  7. * @author Chenxuan Song <1097180981@qq.com>
  8. * @package dimension
  9. * @version $Id: control.php 4157 2022-11-1 10:24:12Z $
  10. * @link https://www.zentao.net
  11. */
  12. class dimension extends control
  13. {
  14. /**
  15. * 显示切换维度的 1.5 级导航的下拉菜单。
  16. * Show the drop menu of 1.5 level navigation for switching dimension.
  17. *
  18. * @param int $dimensionID
  19. * @param string $module
  20. * @param string $method
  21. * @access public
  22. * @return void
  23. * @param string $viewType
  24. */
  25. public function ajaxGetDropMenu($dimensionID, $module, $method, $viewType)
  26. {
  27. $items = array();
  28. $dimensions = $this->dimension->getList();
  29. foreach($dimensions as $dimension)
  30. {
  31. /* 构造 1.5 级导航的数据。*/
  32. /* Build the data of 1.5 level navigation. */
  33. $item = array();
  34. $item['id'] = $dimension->id;
  35. $item['text'] = $dimension->name;
  36. $item['keys'] = zget(common::convert2Pinyin(array($dimension->name)), $dimension->name, '');
  37. $items[] = $item;
  38. }
  39. if($module == 'pivot' && $method == 'design') $method = 'browse';
  40. $params = 'dimensionID={id}';
  41. if($this->app->tab == 'bi' && $module == 'tree' && $method == 'browsegroup')
  42. {
  43. $params = "dimensionID={id}&groupID=0&type={$viewType}";
  44. }
  45. $this->view->link = $this->createLink($module, $method, $params);
  46. $this->view->items = $items;
  47. $this->view->dimensionID = $dimensionID;
  48. $this->display();
  49. }
  50. /**
  51. * Drop menu page, type is used for tree-browsegroup link.
  52. *
  53. * @access public
  54. * @param string currentModule
  55. * @param string currentMethod
  56. * @param int dimensionID
  57. * @param string type screen|pivot|chart
  58. * @return void
  59. */
  60. public function ajaxGetOldDropMenu($currentModule, $currentMethod, $dimensionID, $type = '')
  61. {
  62. $this->view->currentModule = $currentModule;
  63. $this->view->currentMethod = $currentMethod;
  64. $this->view->dimensionID = $dimensionID;
  65. $this->view->type = $type;
  66. $this->view->dimensions = $this->dimension->getList();
  67. $this->display();
  68. }
  69. }