browse.html.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?php
  2. /**
  3. * The browse view file of reporttemplate module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2025 禅道软件(青岛)有限公司(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 Shujie Tian <tianshujie@chandao.com>
  7. * @package reporttemplate
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $privs = array();
  12. $privs['create'] = hasPriv('reporttemplate', 'create');
  13. $privs['edit'] = hasPriv('reporttemplate', 'edit');
  14. $privs['view'] = hasPriv('reporttemplate', 'view');
  15. $privs['delete'] = hasPriv('reporttemplate', 'delete');
  16. $privs['pause'] = hasPriv('reporttemplate', 'pause');
  17. $privs['cron'] = hasPriv('reporttemplate', 'cron');
  18. $privs['addCategory'] = hasPriv('reporttemplate', 'addCategory');
  19. $privs['editCategory'] = hasPriv('reporttemplate', 'editCategory');
  20. $privs['deleteCategory'] = hasPriv('reporttemplate', 'deleteCategory');
  21. $privs['collect'] = 'no';
  22. $privs['restoreDoc'] = false;
  23. $tableCols = array();
  24. $tableCols['id'] = $lang->idAB;
  25. $tableCols['title'] = $lang->reporttemplate->title;
  26. $tableCols['cycle'] = $lang->reporttemplate->cycle;
  27. $tableCols['module'] = $lang->reporttemplate->module;
  28. $tableCols['objects'] = $lang->reporttemplate->objects;
  29. $tableCols['desc'] = $lang->reporttemplate->desc;
  30. $tableCols['actions'] = $lang->actions;
  31. $langData = array();
  32. $langData['filterTypes'] = $lang->reporttemplate->filterTypes;
  33. $langData['basic'] = $lang->reporttemplate->basic;
  34. $langData['tableCols'] = $tableCols;
  35. $langData['create'] = $lang->reporttemplate->create;
  36. $langData['edit'] = $lang->reporttemplate->editAction;
  37. $langData['delete'] = $lang->reporttemplate->delete;
  38. $langData['addCategory'] = $lang->reporttemplate->addCategory;
  39. $langData['confirmPause'] = $lang->reporttemplate->confirmPause;
  40. $langData['confirmDelete'] = $lang->reporttemplate->confirmDelete;
  41. $langData['confirmDeleteCategory'] = $lang->reporttemplate->confirmDeleteCategory;
  42. $langData['leaveEditingConfirm'] = $lang->reporttemplate->leaveEditingConfirm;
  43. $langData['searchModulePlaceholder'] = $lang->reporttemplate->searchModulePlaceholder;
  44. $langData['searchLibPlaceholder'] = $lang->reporttemplate->searchScopePlaceholder;
  45. $langData['noDocs'] = $lang->reporttemplate->noTemplate;
  46. $langData['noModules'] = $lang->reporttemplate->noCategory;
  47. $langData['insertSystemData'] = $lang->reporttemplate->insertSystemData;
  48. $langData['errorDeleteCategory'] = $lang->reporttemplate->error->deleteCategory;
  49. $langData['docOutline'] = $lang->reporttemplate->outline;
  50. $langData['pauseText'] = $lang->reporttemplate->pause;
  51. $langData['disabledPauseHint'] = $lang->reporttemplate->disabledHint->pause;
  52. $langData['disabledDeleteHint'] = $lang->reporttemplate->disabledHint->delete;
  53. $langData['cron'] = $lang->reporttemplate->cron;
  54. $langData['pause'] = $lang->reporttemplate->statusList['pause'];
  55. $langData['actions'] = array();
  56. $langData['actions']['editCategory'] = $lang->reporttemplate->editCategory;
  57. $langData['actions']['deleteCategory'] = $lang->reporttemplate->deleteCategory;
  58. $langData['actions']['editTemplate'] = $lang->reporttemplate->edit;
  59. $langData['actions']['pauseTemplate'] = $lang->reporttemplate->pause;
  60. $langData['actions']['cron'] = $lang->reporttemplate->cron;
  61. $langData['actions']['deleteTemplate'] = $lang->reporttemplate->deleteAbbr;
  62. /* 定义编辑文档时右侧的快捷菜单标签: */
  63. $quickEditMenuTabs = array();
  64. foreach($lang->reporttemplate->quickEditMenuList as $menuKey => $menuName) $quickEditMenuTabs[$menuKey] = array('key' => $menuKey, 'text' => $menuName, 'items' => array());
  65. foreach($fields as $fieldKey => $fieldName)
  66. {
  67. if(strpos($config->reporttemplate->skipProjectFields, ",{$fieldKey},") !== false) continue;
  68. $quickEditMenuTabs['properties']['items'][] = array('id' => "property_{$fieldKey}", 'text' => $fieldName, 'holder' => array('name' => "property_{$fieldKey}", 'text' => $fieldName));
  69. }
  70. foreach($lang->reporttemplate->filterList as $filterKey => $filterName) $quickEditMenuTabs['lists']['items'][] = array('id' => "list_{$filterKey}", 'text' => $filterName, 'url' => '###', 'data-toggle' => 'modal', 'data-size' => 'sm', 'data-url' => $this->createLink('reporttemplate', 'ajaxBuildZentaoListConfig', "type={$filterKey}"));
  71. foreach($lang->reporttemplate->measurementList as $groupKey => $measurements)
  72. {
  73. $items = array();
  74. foreach($measurements as $measurementKey => $measurementName)
  75. {
  76. if($groupKey == 'execution')
  77. {
  78. $items[] = array('id' => "measurement_{$groupKey}_{$measurementKey}", 'text' => $measurementName, 'url' => '###', 'onClick' => jsRaw('window.insertExecutionMeasurement'), 'data-type' => "{$groupKey}_{$measurementKey}", 'hint' => $this->lang->reporttemplate->notice->filter . $this->lang->colon . $lang->reporttemplate->executionDataTips);
  79. }
  80. else
  81. {
  82. $items[] = array('id' => "measurement_{$groupKey}_{$measurementKey}", 'text' => $measurementName, 'url' => '###', 'data-toggle' => 'modal', 'data-url' => $this->createLink('reporttemplate', 'ajaxBuildZentaoMeasurementConfig', "type={$groupKey}_{$measurementKey}"));
  83. }
  84. }
  85. $quickEditMenuTabs['measurements']['items'][] = array
  86. (
  87. 'id' => $groupKey,
  88. 'text' => $lang->reporttemplate->{$groupKey},
  89. 'items' => $items
  90. );
  91. }
  92. foreach($lang->reporttemplate->chartList as $groupKey => $chartList)
  93. {
  94. $groupItems = array();
  95. foreach($chartList as $classKey => $charts)
  96. {
  97. $classItems = array();
  98. foreach($charts as $chartKey => $chartName)
  99. {
  100. $noCondition = false;
  101. if(in_array($groupKey, array('project', 'execution'))) $noCondition = true;
  102. if($groupKey == 'project' && $chartKey == 'summary') $noCondition = false;
  103. if($noCondition)
  104. {
  105. $classItems[] = array('id' => "chart_{$groupKey}_{$chartKey}", 'text' => $chartName, 'url' => '###', 'onClick' => jsRaw('window.insertExecutionChart'), 'data-type' => "{$groupKey}_{$classKey}_{$chartKey}");
  106. }
  107. else
  108. {
  109. $classItems[] = array('id' => "chart_{$groupKey}_{$chartKey}", 'text' => $chartName, 'url' => '###', 'data-toggle' => 'modal', 'data-url' => $this->createLink('reporttemplate', 'ajaxBuildZentaoChartConfig', "type={$groupKey}_{$classKey}_{$chartKey}"));
  110. }
  111. }
  112. $groupItems[] = array
  113. (
  114. 'id' => $classKey,
  115. 'text' => $lang->reporttemplate->{$classKey},
  116. 'items' => $classItems
  117. );
  118. }
  119. $quickEditMenuTabs['charts']['items'][] = array
  120. (
  121. 'id' => $groupKey,
  122. 'text' => $lang->reporttemplate->{$groupKey},
  123. 'items' => $groupItems
  124. );
  125. }
  126. docApp
  127. (
  128. set::spaceID(1),
  129. set::libID($libID),
  130. set::docID((int)$docID),
  131. set::moduleID((int)$moduleID),
  132. set::mode($mode),
  133. set::docFetcher(createLink('reporttemplate', 'ajaxGetDoc', 'docID={docID}&version={version}')),
  134. set::fetcher(createLink('reporttemplate', 'ajaxGetData', 'spaceID={spaceID}')),
  135. set::historyFetcher(createLink('action', 'ajaxGetList', 'objectType=reportTemplate&objectID={objectID}')),
  136. set::historyPanel(array('objectType' => 'reporttemplate')),
  137. set::noSpace('hidden'),
  138. set::docIcon('file-archive'),
  139. set::langData($langData),
  140. set::userMap($userList),
  141. set::privs($privs),
  142. set::pager(array('recPerPage' => $recPerPage, 'page' => $pageID)),
  143. set::homeName(false),
  144. set::quickEditMenu(array_values($quickEditMenuTabs)),
  145. set::openViewSidebar('quick-edit-menu'),
  146. set::editorProps(array('onClickHolder' => jsRaw('window.clickHolder'))),
  147. set::hasZentaoSlashMenu(false),
  148. set::docFilterProps(array('title', 'objectsName', 'templateDesc'))
  149. );