table.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <?php
  2. global $lang, $app;
  3. $isEn = $app->getClientLang() == 'en';
  4. $config->bug->dtable = new stdclass();
  5. $config->bug->dtable->defaultField = array('id', 'title', 'severity', 'pri', 'status', 'openedBy', 'openedDate', 'confirmed', 'assignedTo', 'resolution', 'actions');
  6. $config->bug->dtable->fieldList['id']['title'] = $lang->idAB;
  7. $config->bug->dtable->fieldList['id']['type'] = 'checkID';
  8. $config->bug->dtable->fieldList['id']['fixed'] = 'left';
  9. $config->bug->dtable->fieldList['id']['sortType'] = true;
  10. $config->bug->dtable->fieldList['id']['required'] = true;
  11. $config->bug->dtable->fieldList['id']['group'] = 1;
  12. $config->bug->dtable->fieldList['product']['title'] = $lang->bug->product;
  13. $config->bug->dtable->fieldList['product']['display'] = false;
  14. $config->bug->dtable->fieldList['product']['dataSource'] = array('module' => 'product', 'method' => 'getPairs', 'params' => ['mode' => '', 'programID' => 0, 'append' => '', 'shadow' => 'all']);
  15. $config->bug->dtable->fieldList['module']['display'] = false;
  16. $config->bug->dtable->fieldList['module']['dataSource'] = array('module' => 'bug', 'method' => 'getDatatableModules', 'params' => ['productID' => '$productID']);
  17. $config->bug->dtable->fieldList['title']['title'] = $lang->bug->title;
  18. $config->bug->dtable->fieldList['title']['type'] = 'title';
  19. $config->bug->dtable->fieldList['title']['fixed'] = 'left';
  20. $config->bug->dtable->fieldList['title']['link'] = array('module' => 'bug', 'method' => 'view', 'params' => "bugID={id}");
  21. $config->bug->dtable->fieldList['title']['required'] = true;
  22. $config->bug->dtable->fieldList['title']['group'] = 1;
  23. $config->bug->dtable->fieldList['title']['data-app'] = $app->tab;
  24. $config->bug->dtable->fieldList['title']['sortType'] = true;
  25. $config->bug->dtable->fieldList['severity']['title'] = $lang->bug->severity;
  26. $config->bug->dtable->fieldList['severity']['type'] = 'severity';
  27. $config->bug->dtable->fieldList['severity']['show'] = true;
  28. $config->bug->dtable->fieldList['severity']['group'] = 2;
  29. $config->bug->dtable->fieldList['severity']['sortType'] = true;
  30. $config->bug->dtable->fieldList['severity']['severityList'] = $lang->bug->severityList;
  31. $config->bug->dtable->fieldList['pri']['title'] = $lang->bug->pri;
  32. $config->bug->dtable->fieldList['pri']['type'] = 'pri';
  33. $config->bug->dtable->fieldList['pri']['show'] = true;
  34. $config->bug->dtable->fieldList['pri']['group'] = 2;
  35. $config->bug->dtable->fieldList['pri']['sortType'] = true;
  36. $config->bug->dtable->fieldList['pri']['priList'] = $lang->bug->priList;
  37. $config->bug->dtable->fieldList['status']['title'] = $lang->bug->abbr->status;
  38. $config->bug->dtable->fieldList['status']['type'] = 'status';
  39. $config->bug->dtable->fieldList['status']['statusMap'] = $lang->bug->statusList;
  40. $config->bug->dtable->fieldList['status']['show'] = true;
  41. $config->bug->dtable->fieldList['status']['group'] = 2;
  42. $config->bug->dtable->fieldList['status']['sortType'] = true;
  43. $config->bug->dtable->fieldList['type']['title'] = $lang->bug->type;
  44. $config->bug->dtable->fieldList['type']['type'] = 'category';
  45. $config->bug->dtable->fieldList['type']['map'] = $lang->bug->typeList;
  46. $config->bug->dtable->fieldList['type']['flex'] = false;
  47. $config->bug->dtable->fieldList['type']['group'] = 2;
  48. $config->bug->dtable->fieldList['type']['sortType'] = true;
  49. $config->bug->dtable->fieldList['branch']['title'] = $lang->bug->branch;
  50. $config->bug->dtable->fieldList['branch']['type'] = 'text';
  51. $config->bug->dtable->fieldList['branch']['group'] = 3;
  52. $config->bug->dtable->fieldList['branch']['dataSource'] = array('module' => 'branch', 'method' => 'getPairs', 'params' => ['productID' => (int)'$productID']);
  53. $config->bug->dtable->fieldList['branch']['sortType'] = true;
  54. $config->bug->dtable->fieldList['project']['title'] = $lang->bug->project;
  55. $config->bug->dtable->fieldList['project']['type'] = 'text';
  56. $config->bug->dtable->fieldList['project']['group'] = 3;
  57. $config->bug->dtable->fieldList['project']['dataSource'] = array('module' => 'project', 'method' => 'getPairs', 'params' => ['ignoreVision' => false]);
  58. $config->bug->dtable->fieldList['project']['sortType'] = true;
  59. $config->bug->dtable->fieldList['execution']['title'] = $lang->bug->execution;
  60. $config->bug->dtable->fieldList['execution']['type'] = 'text';
  61. $config->bug->dtable->fieldList['execution']['group'] = 3;
  62. $config->bug->dtable->fieldList['execution']['dataSource'] = array('module' => 'execution', 'method' =>'getPairs', 'params' => ['projectID' => 0]);
  63. $config->bug->dtable->fieldList['execution']['sortType'] = true;
  64. $config->bug->dtable->fieldList['plan']['title'] = $lang->bug->plan;
  65. $config->bug->dtable->fieldList['plan']['width'] = 120;
  66. $config->bug->dtable->fieldList['plan']['group'] = 3;
  67. $config->bug->dtable->fieldList['plan']['sortType'] = true;
  68. $config->bug->dtable->fieldList['plan']['hint'] = true;
  69. $config->bug->dtable->fieldList['plan']['dataSource'] = array('module' => 'productplan', 'method' =>'getPairs', 'params' => ['productIdList' => '$productIdList', 'branch' => '$branch']);
  70. $config->bug->dtable->fieldList['openedBuild']['title'] = $lang->bug->openedBuild;
  71. $config->bug->dtable->fieldList['openedBuild']['type'] = 'text';
  72. $config->bug->dtable->fieldList['openedBuild']['group'] = 3;
  73. $config->bug->dtable->fieldList['openedBuild']['control'] = 'multiple';
  74. $config->bug->dtable->fieldList['openedBuild']['dataSource'] = array('module' => 'build', 'method' =>'getBuildPairs', 'params' => ['productIdList' => (int)'$productID', 'branch' => '$branch', 'params' => 'noempty,noterminate,nodone,withbranch']);
  75. $config->bug->dtable->fieldList['openedBuild']['sortType'] = true;
  76. $config->bug->dtable->fieldList['openedBy']['title'] = $lang->bug->abbr->openedBy;
  77. $config->bug->dtable->fieldList['openedBy']['type'] = 'user';
  78. $config->bug->dtable->fieldList['openedBy']['show'] = true;
  79. $config->bug->dtable->fieldList['openedBy']['group'] = 4;
  80. $config->bug->dtable->fieldList['openedBy']['sortType'] = true;
  81. $config->bug->dtable->fieldList['openedDate']['title'] = $lang->bug->abbr->openedDate;
  82. $config->bug->dtable->fieldList['openedDate']['type'] = 'date';
  83. $config->bug->dtable->fieldList['openedDate']['show'] = true;
  84. $config->bug->dtable->fieldList['openedDate']['group'] = 4;
  85. $config->bug->dtable->fieldList['openedDate']['sortType'] = 'date';
  86. if($isEn) $config->bug->dtable->fieldList['openedDate']['width'] = '120';
  87. $config->bug->dtable->fieldList['confirmed']['title'] = $lang->bug->confirmed;
  88. $config->bug->dtable->fieldList['confirmed']['type'] = 'category';
  89. $config->bug->dtable->fieldList['confirmed']['map'] = $lang->bug->confirmedList;
  90. $config->bug->dtable->fieldList['confirmed']['show'] = true;
  91. $config->bug->dtable->fieldList['confirmed']['flex'] = false;
  92. $config->bug->dtable->fieldList['confirmed']['group'] = 5;
  93. $config->bug->dtable->fieldList['confirmed']['sortType'] = true;
  94. if($isEn) $config->bug->dtable->fieldList['confirmed']['width'] = '150';
  95. $config->bug->dtable->fieldList['assignedTo']['title'] = $lang->bug->assignedTo;
  96. $config->bug->dtable->fieldList['assignedTo']['type'] = 'assign';
  97. $config->bug->dtable->fieldList['assignedTo']['assignLink'] = array('module' => 'bug', 'method' => 'assignTo', 'params' => 'bugID={id}');
  98. $config->bug->dtable->fieldList['assignedTo']['show'] = true;
  99. $config->bug->dtable->fieldList['assignedTo']['group'] = 5;
  100. $config->bug->dtable->fieldList['assignedTo']['sortType'] = true;
  101. if($isEn) $config->bug->dtable->fieldList['assignedTo']['width'] = '120';
  102. $config->bug->dtable->fieldList['assignedDate']['title'] = $lang->bug->assignedDate;
  103. $config->bug->dtable->fieldList['assignedDate']['type'] = 'date';
  104. $config->bug->dtable->fieldList['assignedDate']['group'] = 5;
  105. $config->bug->dtable->fieldList['assignedDate']['sortType'] = 'date';
  106. $config->bug->dtable->fieldList['deadline']['title'] = $lang->bug->deadline;
  107. $config->bug->dtable->fieldList['deadline']['type'] = 'date';
  108. $config->bug->dtable->fieldList['deadline']['group'] = 5;
  109. $config->bug->dtable->fieldList['deadline']['sortType'] = true;
  110. $config->bug->dtable->fieldList['resolvedBy']['title'] = $lang->bug->resolvedBy;
  111. $config->bug->dtable->fieldList['resolvedBy']['type'] = 'user';
  112. $config->bug->dtable->fieldList['resolvedBy']['group'] = 6;
  113. $config->bug->dtable->fieldList['resolvedBy']['sortType'] = true;
  114. $config->bug->dtable->fieldList['resolution']['title'] = $lang->bug->resolution;
  115. $config->bug->dtable->fieldList['resolution']['type'] = 'category';
  116. $config->bug->dtable->fieldList['resolution']['map'] = $lang->bug->resolutionList;
  117. $config->bug->dtable->fieldList['resolution']['show'] = true;
  118. $config->bug->dtable->fieldList['resolution']['group'] = 6;
  119. $config->bug->dtable->fieldList['resolution']['sortType'] = true;
  120. if($isEn) $config->bug->dtable->fieldList['resolution']['width'] = '100';
  121. $config->bug->dtable->fieldList['toTask']['title'] = $lang->bug->toTask;
  122. $config->bug->dtable->fieldList['toTask']['type'] = 'text';
  123. $config->bug->dtable->fieldList['toTask']['link'] = array('module' => 'task', 'method' => 'view', 'params' => 'taskID={toTask}');
  124. $config->bug->dtable->fieldList['toTask']['group'] = 6;
  125. $config->bug->dtable->fieldList['toTask']['sortType'] = true;
  126. $config->bug->dtable->fieldList['resolvedDate']['title'] = $lang->bug->abbr->resolvedDate;
  127. $config->bug->dtable->fieldList['resolvedDate']['type'] = 'date';
  128. $config->bug->dtable->fieldList['resolvedDate']['group'] = 6;
  129. $config->bug->dtable->fieldList['resolvedDate']['sortType'] = 'date';
  130. $config->bug->dtable->fieldList['resolvedBuild']['title'] = $lang->bug->resolvedBuild;
  131. $config->bug->dtable->fieldList['resolvedBuild']['type'] = 'text';
  132. $config->bug->dtable->fieldList['resolvedBuild']['group'] = 6;
  133. $config->bug->dtable->fieldList['resolvedBuild']['dataSource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'resolvedBuild&id,name');
  134. $config->bug->dtable->fieldList['resolvedBuild']['sortType'] = true;
  135. $config->bug->dtable->fieldList['os']['title'] = $lang->bug->os;
  136. $config->bug->dtable->fieldList['os']['type'] = 'category';
  137. $config->bug->dtable->fieldList['os']['map'] = $lang->bug->osList;
  138. $config->bug->dtable->fieldList['os']['group'] = 7;
  139. $config->bug->dtable->fieldList['os']['control'] = 'multiple';
  140. $config->bug->dtable->fieldList['os']['sortType'] = true;
  141. $config->bug->dtable->fieldList['browser']['title'] = $lang->bug->browser;
  142. $config->bug->dtable->fieldList['browser']['type'] = 'category';
  143. $config->bug->dtable->fieldList['browser']['map'] = $lang->bug->browserList;
  144. $config->bug->dtable->fieldList['browser']['group'] = 7;
  145. $config->bug->dtable->fieldList['browser']['control'] = 'multiple';
  146. $config->bug->dtable->fieldList['browser']['sortType'] = true;
  147. $config->bug->dtable->fieldList['activatedCount']['title'] = $lang->bug->abbr->activatedCount;
  148. $config->bug->dtable->fieldList['activatedCount']['type'] = 'count';
  149. $config->bug->dtable->fieldList['activatedCount']['group'] = 8;
  150. $config->bug->dtable->fieldList['activatedCount']['sortType'] = true;
  151. if($config->edition != 'open')
  152. {
  153. $app->loadLang('custom');
  154. $config->bug->dtable->fieldList['relatedObject']['name'] = 'relatedObject';
  155. $config->bug->dtable->fieldList['relatedObject']['title'] = $lang->custom->relateObject;
  156. $config->bug->dtable->fieldList['relatedObject']['sortType'] = false;
  157. $config->bug->dtable->fieldList['relatedObject']['width'] = '70';
  158. $config->bug->dtable->fieldList['relatedObject']['type'] = 'text';
  159. $config->bug->dtable->fieldList['relatedObject']['link'] = common::hasPriv('custom', 'showRelationGraph') ? "RAWJS<function(info){ if(info.row.data.relatedObject == 0) return 0; else return '" . helper::createLink('custom', 'showRelationGraph', 'objectID={id}&objectType=bug') . "'; }>RAWJS" : null;
  160. $config->bug->dtable->fieldList['relatedObject']['data-toggle'] = 'modal';
  161. $config->bug->dtable->fieldList['relatedObject']['data-size'] = 'lg';
  162. $config->bug->dtable->fieldList['relatedObject']['show'] = true;
  163. $config->bug->dtable->fieldList['relatedObject']['group'] = 8;
  164. $config->bug->dtable->fieldList['relatedObject']['flex'] = false;
  165. $config->bug->dtable->fieldList['relatedObject']['align'] = 'center';
  166. if($isEn) $config->bug->dtable->fieldList['relatedObject']['width'] = '120';
  167. }
  168. $config->bug->dtable->fieldList['activatedDate']['title'] = $lang->bug->activatedDate;
  169. $config->bug->dtable->fieldList['activatedDate']['type'] = 'date';
  170. $config->bug->dtable->fieldList['activatedDate']['group'] = 8;
  171. $config->bug->dtable->fieldList['activatedDate']['sortType'] = 'date';
  172. $config->bug->dtable->fieldList['story']['title'] = $lang->bug->story;
  173. $config->bug->dtable->fieldList['story']['type'] = 'text';
  174. $config->bug->dtable->fieldList['story']['link'] = array('module' => 'story', 'method' => 'view', 'params' => 'storyID={story}');
  175. $config->bug->dtable->fieldList['story']['group'] = 8;
  176. $config->bug->dtable->fieldList['story']['dataSource'] = array('module' => 'story', 'method' =>'getProductStoryPairs', 'params' => ['productIdList' => (int)'$productID']);
  177. $config->bug->dtable->fieldList['story']['sortType'] = true;
  178. $config->bug->dtable->fieldList['task']['title'] = $lang->bug->task;
  179. $config->bug->dtable->fieldList['task']['type'] = 'text';
  180. $config->bug->dtable->fieldList['task']['link'] = array('module' => 'task', 'method' => 'view', 'params' => 'taskID={task}');
  181. $config->bug->dtable->fieldList['task']['group'] = 8;
  182. $config->bug->dtable->fieldList['task']['dataSource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'task&id,name');
  183. $config->bug->dtable->fieldList['task']['sortType'] = true;
  184. $config->bug->dtable->fieldList['mailto']['title'] = $lang->bug->mailto;
  185. $config->bug->dtable->fieldList['mailto']['type'] = 'text';
  186. $config->bug->dtable->fieldList['mailto']['group'] = 9;
  187. $config->bug->dtable->fieldList['mailto']['sortType'] = true;
  188. $config->bug->dtable->fieldList['mailto']['delimiter'] = ',';
  189. if(in_array($config->edition, array('max', 'ipd')))
  190. {
  191. $config->bug->dtable->fieldList['injection']['title'] = $lang->bug->injection;
  192. $config->bug->dtable->fieldList['injection']['control'] = 'picker';
  193. $config->bug->dtable->fieldList['injection']['type'] = 'text';
  194. $config->bug->dtable->fieldList['injection']['map'] = $lang->bug->injectionList;
  195. $config->bug->dtable->fieldList['identify']['title'] = $lang->bug->identify;
  196. $config->bug->dtable->fieldList['identify']['control'] = 'picker';
  197. $config->bug->dtable->fieldList['identify']['type'] = 'text';
  198. $config->bug->dtable->fieldList['identify']['map'] = $lang->bug->identifyList;
  199. }
  200. $config->bug->dtable->fieldList['keywords']['title'] = $lang->bug->keywords;
  201. $config->bug->dtable->fieldList['keywords']['type'] = 'text';
  202. $config->bug->dtable->fieldList['keywords']['group'] = 9;
  203. $config->bug->dtable->fieldList['keywords']['sortType'] = true;
  204. $config->bug->dtable->fieldList['lastEditedBy']['title'] = $lang->bug->lastEditedBy;
  205. $config->bug->dtable->fieldList['lastEditedBy']['type'] = 'user';
  206. $config->bug->dtable->fieldList['lastEditedBy']['group'] = 10;
  207. $config->bug->dtable->fieldList['lastEditedBy']['sortType'] = true;
  208. $config->bug->dtable->fieldList['lastEditedBy']['width'] = '90px';
  209. $config->bug->dtable->fieldList['lastEditedDate']['title'] = $lang->bug->abbr->lastEditedDate;
  210. $config->bug->dtable->fieldList['lastEditedDate']['type'] = 'date';
  211. $config->bug->dtable->fieldList['lastEditedDate']['group'] = 10;
  212. $config->bug->dtable->fieldList['lastEditedDate']['sortType'] = 'date';
  213. $config->bug->dtable->fieldList['closedBy']['title'] = $lang->bug->closedBy;
  214. $config->bug->dtable->fieldList['closedBy']['type'] = 'user';
  215. $config->bug->dtable->fieldList['closedBy']['group'] = 10;
  216. $config->bug->dtable->fieldList['closedBy']['sortType'] = true;
  217. $config->bug->dtable->fieldList['closedDate']['title'] = $lang->bug->closedDate;
  218. $config->bug->dtable->fieldList['closedDate']['type'] = 'date';
  219. $config->bug->dtable->fieldList['closedDate']['group'] = 10;
  220. $config->bug->dtable->fieldList['closedDate']['sortType'] = 'date';
  221. $config->bug->dtable->fieldList['steps']['title'] = 'steps';
  222. $config->bug->dtable->fieldList['steps']['control'] = 'textarea';
  223. $config->bug->dtable->fieldList['steps']['display'] = false;
  224. $config->bug->dtable->fieldList['case']['title'] = 'case';
  225. $config->bug->dtable->fieldList['case']['dataSource'] = array('module' => 'bug', 'method' =>'getRelatedObjects', 'params' => 'case&id,title');
  226. $config->bug->dtable->fieldList['case']['display'] = false;
  227. $config->bug->dtable->fieldList['actions']['title'] = $lang->actions;
  228. $config->bug->dtable->fieldList['actions']['type'] = 'actions';
  229. $config->bug->dtable->fieldList['actions']['width'] = '140';
  230. $config->bug->dtable->fieldList['actions']['sortType'] = false;
  231. $config->bug->dtable->fieldList['actions']['fixed'] = 'right';
  232. $config->bug->dtable->fieldList['actions']['list'] = $config->bug->actionList;
  233. $config->bug->dtable->fieldList['actions']['menu'] = array('confirm', 'resolve', 'close|activate', 'edit', 'copy');
  234. $config->bug->linkBugs = new stdclass();
  235. $config->bug->linkBugs->dtable = new stdclass();
  236. $config->bug->linkBugs->dtable->fieldList['id']['title'] = $lang->idAB;
  237. $config->bug->linkBugs->dtable->fieldList['id']['type'] = 'checkID';
  238. $config->bug->linkBugs->dtable->fieldList['id']['checkbox'] = true;
  239. $config->bug->linkBugs->dtable->fieldList['id']['align'] = 'left';
  240. $config->bug->linkBugs->dtable->fieldList['id']['fixed'] = 'left';
  241. $config->bug->linkBugs->dtable->fieldList['pri']['title'] = $lang->bug->pri;
  242. $config->bug->linkBugs->dtable->fieldList['pri']['type'] = 'pri';
  243. $config->bug->linkBugs->dtable->fieldList['product']['title'] = $lang->bug->product;
  244. $config->bug->linkBugs->dtable->fieldList['product']['type'] = 'text';
  245. $config->bug->linkBugs->dtable->fieldList['product']['link'] = array('module' => 'product', 'method' => 'view', 'params' => 'productID={product}');
  246. $config->bug->linkBugs->dtable->fieldList['title']['title'] = $lang->bug->title;
  247. $config->bug->linkBugs->dtable->fieldList['title']['type'] = 'title';
  248. $config->bug->linkBugs->dtable->fieldList['title']['link'] = array('module' => 'bug', 'method' => 'view', 'params' => 'bugID={id}');
  249. $config->bug->linkBugs->dtable->fieldList['status']['title'] = $lang->bug->abbr->status;
  250. $config->bug->linkBugs->dtable->fieldList['status']['type'] = 'status';
  251. $config->bug->linkBugs->dtable->fieldList['status']['statusMap'] = $lang->bug->statusList;
  252. $config->bug->linkBugs->dtable->fieldList['openedBy']['title'] = $lang->bug->abbr->openedBy;
  253. $config->bug->linkBugs->dtable->fieldList['openedBy']['type'] = 'user';
  254. $config->bug->linkBugs->dtable->fieldList['assignedTo']['title'] = $lang->bug->assignedTo;
  255. $config->bug->linkBugs->dtable->fieldList['assignedTo']['type'] = 'user';