config.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. global $lang, $app;
  3. $module = $app->rawModule;
  4. if($module != 'mr' && $module != 'pullreq') $module = 'mr';
  5. $config->mr = new stdclass();
  6. $config->mr->create = new stdclass();
  7. $config->mr->create->skippedFields = 'projectID,compile';
  8. $config->mr->create->requiredFields = 'hostID,sourceProject,sourceBranch,targetProject,targetBranch,title,repoID';
  9. $config->mr->edit = new stdclass;
  10. $config->mr->edit->skippedFields = 'projectID,compile';
  11. $config->mr->edit->requiredFields = 'hostID,sourceProject,sourceBranch,targetProject,targetBranch,title,repoID';
  12. $config->mr->editor = new stdclass();
  13. $config->mr->editor->diff = array('id' => 'commentText', 'tools' => 'simpleTools');
  14. $config->mr->apicreate = new stdclass();
  15. $config->mr->apicreate->requiredFields = 'repoID,sourceBranch,targetBranch,mergeStatus,jobID';
  16. $config->mr->maps = new stdclass;
  17. $config->mr->maps->sync = array();
  18. $config->mr->maps->sync['title'] = 'title|field|';
  19. $config->mr->maps->sync['description'] = 'description|field|';
  20. $config->mr->maps->sync['assignee'] = 'assignees|userPairs|id';
  21. $config->mr->maps->sync['reviewer'] = 'reviewers|userPairs|id';
  22. $config->mr->maps->sync['targetBranch'] = 'target_branch|field|';
  23. $config->mr->maps->sync['sourceBranch'] = 'source_branch|field|';
  24. $config->mr->maps->sync['sourceProject'] = 'source_project_id|field|';
  25. $config->mr->maps->sync['targetProject'] = 'target_project_id|field|';
  26. $config->mr->maps->sync['status'] = 'state|field|';
  27. $config->mr->maps->sync['mergeStatus'] = 'merge_status|field|';
  28. $config->mr->maps->sync['isFlow'] = 'flow|field|';
  29. $config->mrapproval = new stdclass();
  30. $config->mrapproval->create = new stdclass();
  31. $config->mrapproval->create->skippedFields = '';
  32. $config->mrapproval->create->requiredFields = 'mrID,account,date,action';
  33. $config->mr->gitServiceList = array('gitlab', 'gitea', 'gogs');
  34. $config->mr->actionList = array();
  35. $config->mr->actionList['view'] = array();
  36. $config->mr->actionList['view']['icon'] = 'eye';
  37. $config->mr->actionList['view']['hint'] = $lang->mr->view;
  38. $config->mr->actionList['view']['url'] = helper::createLink($module, 'view', "MRID={id}");
  39. $config->mr->actionList['view']['data-app'] = $app->tab;
  40. $config->mr->actionList['edit'] = array();
  41. $config->mr->actionList['edit']['icon'] = 'edit';
  42. $config->mr->actionList['edit']['hint'] = $lang->mr->edit;
  43. $config->mr->actionList['edit']['url'] = helper::createLink($module, 'edit', "MRID={id}");
  44. $config->mr->actionList['edit']['data-app'] = $app->tab;
  45. $config->mr->actionList['diff'] = array();
  46. $config->mr->actionList['diff']['icon'] = 'diff';
  47. $config->mr->actionList['diff']['hint'] = $lang->mr->diff;
  48. $config->mr->actionList['diff']['url'] = helper::createLink($module, 'diff', "MRID={id}");
  49. $config->mr->actionList['diff']['data-app'] = $app->tab;
  50. $config->mr->actionList['link'] = array();
  51. $config->mr->actionList['link']['icon'] = 'link';
  52. $config->mr->actionList['link']['hint'] = $lang->mr->link;
  53. $config->mr->actionList['link']['url'] = helper::createLink($module, 'link', "MRID={id}");
  54. $config->mr->actionList['link']['data-app'] = $app->tab;
  55. $config->mr->actionList['delete'] = array();
  56. $config->mr->actionList['delete']['icon'] = 'trash';
  57. $config->mr->actionList['delete']['hint'] = $lang->mr->delete;
  58. $config->mr->actionList['delete']['url'] = helper::createLink($module, 'delete', "MRID={id}");
  59. $config->mr->actionList['delete']['data-confirm'] = array('message' => $lang->mr->confirmDelete, 'icon' => 'icon-exclamation-sign', 'iconClass' => 'warning-pale rounded-full icon-2x');
  60. $config->mr->actionList['delete']['className'] = 'ajax-submit';
  61. $config->mr->actionList['delete']['data-app'] = $app->tab;
  62. $config->mr->actionList['accept'] = array();
  63. $config->mr->actionList['accept']['icon'] = 'flow';
  64. $config->mr->actionList['accept']['text'] = $lang->{$module}->acceptMR;
  65. $config->mr->actionList['accept']['url'] = helper::createLink($module, 'accept', "MRID={id}");
  66. $config->mr->actionList['accept']['data-app'] = $app->tab;
  67. $config->mr->actionList['accept']['className'] = 'ajax-submit';
  68. $config->mr->actionList['approval'] = array();
  69. $config->mr->actionList['approval']['icon'] = 'ok';
  70. $config->mr->actionList['approval']['text'] = $lang->mr->approve;
  71. $config->mr->actionList['approval']['url'] = helper::createLink($module, 'approval', "MRID={id}&action=approve");
  72. $config->mr->actionList['approval']['data-toggle'] = 'modal';
  73. $config->mr->actionList['approval']['data-app'] = $app->tab;
  74. $config->mr->actionList['reject'] = array();
  75. $config->mr->actionList['reject']['icon'] = 'bug';
  76. $config->mr->actionList['reject']['text'] = $lang->mr->reject;
  77. $config->mr->actionList['reject']['url'] = helper::createLink($module, 'approval', "MRID={id}&action=reject");
  78. $config->mr->actionList['reject']['data-toggle'] = 'modal';
  79. $config->mr->actionList['reject']['data-app'] = $app->tab;
  80. $config->mr->actionList['close'] = array();
  81. $config->mr->actionList['close']['icon'] = 'off';
  82. $config->mr->actionList['close']['text'] = $lang->mr->close;
  83. $config->mr->actionList['close']['url'] = helper::createLink($module, 'close', "MRID={id}");
  84. $config->mr->actionList['close']['className'] = 'ajax-submit';
  85. $config->mr->actionList['close']['data-app'] = $app->tab;
  86. $config->mr->actionList['reopen'] = array();
  87. $config->mr->actionList['reopen']['icon'] = 'restart';
  88. $config->mr->actionList['reopen']['text'] = $lang->mr->reopen;
  89. $config->mr->actionList['reopen']['url'] = helper::createLink($module, 'reopen', "MRID={id}");
  90. $config->mr->actionList['reopen']['className'] = 'ajax-submit';
  91. $config->mr->actionList['reopen']['data-app'] = $app->tab;
  92. $app->loadLang('release');
  93. $app->loadLang('story');
  94. $app->loadLang('bug');
  95. $app->loadLang('build');
  96. $app->loadLang('task');
  97. $config->mr->actionList['unlinkStory'] = array();
  98. $config->mr->actionList['unlinkStory']['icon'] = 'unlink';
  99. $config->mr->actionList['unlinkStory']['hint'] = $lang->release->unlinkStory;
  100. $config->mr->actionList['unlinkStory']['url'] = 'javascript: unlinkObject("story", "{id}")';
  101. $config->mr->actionList['unlinkBug'] = array();
  102. $config->mr->actionList['unlinkBug']['icon'] = 'unlink';
  103. $config->mr->actionList['unlinkBug']['hint'] = $lang->release->unlinkBug;
  104. $config->mr->actionList['unlinkBug']['url'] = 'javascript: unlinkObject("bug", "{id}")';
  105. $config->mr->view = new stdclass();
  106. $config->mr->view->operateList = array('accept', 'approval', 'reject', 'close', 'edit', 'reopen', 'delete');
  107. $config->mr->groupPrivs = array();
  108. $config->mr->groupPrivs['commitlogs'] = 'view';
  109. $config->mr->groupPrivs['diff'] = 'view';
  110. $config->mr->groupPrivs['link'] = 'view';