config.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <?php
  2. define('JIRA_USER', '`app_user`');
  3. define('JIRA_USERINFO', '`cwd_user`');
  4. define('JIRA_PROJECT', '`project`');
  5. define('JIRA_ISSUE', '`jiraissue`');
  6. define('JIRA_ISSUETYPE', '`issuetype`');
  7. define('JIRA_ISSUELINK', '`issuelink`');
  8. define('JIRA_ISSUELINKTYPE', '`issuelinktype`');
  9. define('JIRA_ISSUESTATUS', '`issuestatus`');
  10. define('JIRA_RESOLUTION', '`resolution`');
  11. define('JIRA_BUILD', '`projectversion`');
  12. define('JIRA_ACTION', '`jiraaction`');
  13. define('JIRA_NODEASSOCIATION', '`nodeassociation`');
  14. define('JIRA_FILE', '`fileattachment`');
  15. define('JIRA_FIXVERSION', '`fixversion`');
  16. define('JIRA_AFFECTSVERSION', '`affectsversion`');
  17. define('JIRA_PRIORITY', '`priority`');
  18. define('JIRA_WORKFLOW', '`jiraworkflows`');
  19. define('JIRA_WORKFLOWSCHEME', '`workflowscheme`');
  20. define('JIRA_WORKLOG', '`worklog`');
  21. define('JIRA_CHANGEITEM', '`changeitem`');
  22. define('JIRA_CHANGEGROUP', '`changegroup`');
  23. define('JIRA_AUDITLOG', '`audit_log`');
  24. define('JIRA_MEMBERSHIP', '`cwd_membership`');
  25. define('JIRA_PROJECTROLEACTOR', '`projectroleactor`');
  26. define('JIRA_CUSTOMFIELD', '`customfield`');
  27. define('JIRA_CUSTOMFIELDVALUE', '`customfieldvalue`');
  28. define('JIRA_CUSTOMFIELDOPTION', '`customfieldoption`');
  29. define('JIRA_OSPROPERTYENTRY', '`propertyentry`');
  30. define('JIRA_OPTIONCONFIGURATION', '`optionconfiguration`');
  31. define('JIRA_CONFIGURATIONCONTEXT', '`configurationcontext`');
  32. define('JIRA_FIELDSCREENLAYOUTITEM', '`fieldscreenlayoutitem`');
  33. define('JIRA_FIELDCONFIGSCHEME', '`fieldconfigscheme`');
  34. define('JIRA_FIELDCONFIGSCHEMEISSUETYPE', '`fieldconfigschemeissuetype`');
  35. $config->convert = new stdClass();
  36. $config->convert->objectTables = array();
  37. $config->convert->objectTables['user'] = JIRA_USER;
  38. $config->convert->objectTables['project'] = JIRA_PROJECT;
  39. $config->convert->objectTables['issue'] = JIRA_ISSUE;
  40. $config->convert->objectTables['build'] = JIRA_BUILD;
  41. $config->convert->objectTables['issuelink'] = JIRA_ISSUELINK;
  42. $config->convert->objectTables['issuetype'] = JIRA_ISSUETYPE;
  43. $config->convert->objectTables['issuelinktype'] = JIRA_ISSUELINKTYPE;
  44. $config->convert->objectTables['resolution'] = JIRA_RESOLUTION;
  45. $config->convert->objectTables['nodeassociation'] = JIRA_NODEASSOCIATION;
  46. $config->convert->objectTables['workflow'] = JIRA_WORKFLOW;
  47. $config->convert->objectTables['workflowscheme'] = JIRA_WORKFLOWSCHEME;
  48. $config->convert->objectTables['worklog'] = JIRA_WORKLOG;
  49. $config->convert->objectTables['changeitem'] = JIRA_CHANGEITEM;
  50. $config->convert->objectTables['changegroup'] = JIRA_CHANGEGROUP;
  51. $config->convert->objectTables['auditlog'] = JIRA_AUDITLOG;
  52. $config->convert->objectTables['status'] = JIRA_ISSUESTATUS;
  53. $config->convert->objectTables['action'] = JIRA_ACTION;
  54. $config->convert->objectTables['file'] = JIRA_FILE;
  55. $config->convert->objectTables['fixversion'] = JIRA_FIXVERSION;
  56. $config->convert->objectTables['affectsversion'] = JIRA_AFFECTSVERSION;
  57. $config->convert->objectTables['priority'] = JIRA_PRIORITY;
  58. $config->convert->objectTables['membership'] = JIRA_MEMBERSHIP;
  59. $config->convert->objectTables['projectroleactor'] = JIRA_PROJECTROLEACTOR;
  60. $config->convert->objectTables['customfield'] = JIRA_CUSTOMFIELD;
  61. $config->convert->objectTables['customfieldvalue'] = JIRA_CUSTOMFIELDVALUE;
  62. $config->convert->objectTables['customfieldoption'] = JIRA_CUSTOMFIELDOPTION;
  63. $config->convert->objectTables['ospropertyentry'] = JIRA_OSPROPERTYENTRY;
  64. $config->convert->objectTables['optionconfiguration'] = JIRA_OPTIONCONFIGURATION;
  65. $config->convert->objectTables['configurationcontext'] = JIRA_CONFIGURATIONCONTEXT;
  66. $config->convert->objectTables['fieldscreenlayoutitem'] = JIRA_FIELDSCREENLAYOUTITEM;
  67. $config->convert->objectTables['fieldconfigscheme'] = JIRA_FIELDCONFIGSCHEME;
  68. $config->convert->objectTables['fieldconfigschemeissuetype'] = JIRA_FIELDCONFIGSCHEMEISSUETYPE;
  69. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:textfield'] = array('control' => 'input', 'type' => 'varchar', 'length' => '255');
  70. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:labels'] = array('control' => 'input', 'type' => 'varchar', 'length' => '255');
  71. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons'] = array('control' => 'radio', 'type' => 'varchar', 'length' => '255');
  72. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes'] = array('control' => 'checkbox', 'type' => 'text', 'length' => '0');
  73. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:datetime'] = array('control' => 'datetime', 'type' => 'datetime', 'length' => '0');
  74. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:datepicker'] = array('control' => 'date', 'type' => 'date', 'length' => '0');
  75. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:textarea'] = array('control' => 'textarea', 'type' => 'text', 'length' => '0');
  76. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:float'] = array('control' => 'decimal', 'type' => 'decimal', 'length' => '0');
  77. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:multiselect'] = array('control' => 'multi-select', 'type' => 'text', 'length' => '0');
  78. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect'] = array('control' => 'multi-select', 'type' => 'text', 'length' => '0');
  79. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:select'] = array('control' => 'select', 'type' => 'varchar', 'length' => '255');
  80. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:userpicker'] = array('control' => 'select', 'type' => 'varchar', 'length' => '255');
  81. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker'] = array('control' => 'multi-select', 'type' => 'text', 'length' => '0');
  82. $config->convert->jiraFieldControl['com.atlassian.jira.plugin.system.customfieldtypes:people'] = array('control' => 'multi-select', 'type' => 'text', 'length' => '0');
  83. $config->convert->objectFields['epic'] = array('module', 'source', 'sourceNote', 'keywords', 'mailto', 'estimate');
  84. $config->convert->objectFields['requirement'] = $config->convert->objectFields['epic'];
  85. $config->convert->objectFields['story'] = $config->convert->objectFields['epic'];
  86. $config->convert->objectFields['bug'] = array('module', 'keywords', 'type', 'os', 'browser', 'hardware', 'feedbackBy', 'notifyEmail', 'deadline', 'resolvedBy', 'resolvedBuild', 'resolvedDate', 'mailto');
  87. $config->convert->objectFields['task'] = array('module', 'type', 'estStarted', 'finishedBy', 'mailto');
  88. $config->convert->objectFields['testcase'] = array('module', 'precondition', 'type', 'stage', 'scene', 'lastRunner', 'lastRunResult', 'keywords', 'mailto');
  89. $config->convert->objectFields['feedback'] = array('module', 'type', 'solution', 'public', 'notify', 'notifyEmail', 'source', 'likes', 'processedBy', 'processedDate', 'feedbackBy', 'mailto');
  90. $config->convert->objectFields['ticket'] = array('module', 'openedBuild', 'realStarted', 'startedBy', 'startedDate', 'deadline', 'resolvedBy', 'resolvedDate');
  91. $config->convert->importDeafaultValue = array();
  92. $config->convert->importDeafaultValue['zentaoObject']['Epic'] = 'requirement';
  93. $config->convert->importDeafaultValue['zentaoObject']['长篇故事'] = 'requirement';
  94. $config->convert->importDeafaultValue['zentaoObject']['Story'] = 'story';
  95. $config->convert->importDeafaultValue['zentaoObject']['故事'] = 'story';
  96. $config->convert->importDeafaultValue['zentaoObject']['需求'] = 'story';
  97. $config->convert->importDeafaultValue['zentaoObject']['Sub-story'] = 'story';
  98. $config->convert->importDeafaultValue['zentaoObject']['子需求'] = 'story';
  99. $config->convert->importDeafaultValue['zentaoObject']['Task'] = 'task';
  100. $config->convert->importDeafaultValue['zentaoObject']['任务'] = 'task';
  101. $config->convert->importDeafaultValue['zentaoObject']['Sub-task'] = 'task';
  102. $config->convert->importDeafaultValue['zentaoObject']['Subtask'] = 'task';
  103. $config->convert->importDeafaultValue['zentaoObject']['子任务'] = 'task';
  104. $config->convert->importDeafaultValue['zentaoObject']['Bug'] = 'bug';
  105. $config->convert->importDeafaultValue['zentaoObject']['缺陷'] = 'bug';
  106. $config->convert->importDeafaultValue['zentaoObject']['测试'] = 'bug';
  107. $config->convert->importDeafaultValue['zentaoObject']['故障'] = 'bug';
  108. $config->convert->importDeafaultValue['zentaoObject']['Case'] = 'testcase';
  109. $config->convert->importDeafaultValue['zentaoObject']['用例'] = 'testcase';
  110. $config->convert->importDeafaultValue['bug']['status']['Open'] = 'active';
  111. $config->convert->importDeafaultValue['bug']['status']['To Do'] = 'active';
  112. $config->convert->importDeafaultValue['bug']['status']['In Progress'] = 'active';
  113. $config->convert->importDeafaultValue['bug']['status']['Reopened'] = 'active';
  114. $config->convert->importDeafaultValue['bug']['status']['In Review'] = 'active';
  115. $config->convert->importDeafaultValue['bug']['status']['Resolved'] = 'resolved';
  116. $config->convert->importDeafaultValue['bug']['status']['Done'] = 'closed';
  117. $config->convert->importDeafaultValue['bug']['status']['Closed'] = 'closed';
  118. $config->convert->importDeafaultValue['bug']['status']['待办'] = 'active';
  119. $config->convert->importDeafaultValue['bug']['status']['进行中'] = 'active';
  120. $config->convert->importDeafaultValue['bug']['status']['解决'] = 'resolved';
  121. $config->convert->importDeafaultValue['bug']['status']['已完成'] = 'closed';
  122. $config->convert->importDeafaultValue['task']['status']['Open'] = 'wait';
  123. $config->convert->importDeafaultValue['task']['status']['To Do'] = 'wait';
  124. $config->convert->importDeafaultValue['task']['status']['In Progress'] = 'doing';
  125. $config->convert->importDeafaultValue['task']['status']['Reopened'] = 'doing';
  126. $config->convert->importDeafaultValue['task']['status']['In Review'] = 'doing';
  127. $config->convert->importDeafaultValue['task']['status']['Resolved'] = 'done';
  128. $config->convert->importDeafaultValue['task']['status']['Done'] = 'closed';
  129. $config->convert->importDeafaultValue['task']['status']['Closed'] = 'closed';
  130. $config->convert->importDeafaultValue['task']['status']['待办'] = 'wait';
  131. $config->convert->importDeafaultValue['task']['status']['进行中'] = 'doing';
  132. $config->convert->importDeafaultValue['task']['status']['解决'] = 'done';
  133. $config->convert->importDeafaultValue['task']['status']['已完成'] = 'closed';
  134. $config->convert->importDeafaultValue['story']['status']['Open'] = 'draft';
  135. $config->convert->importDeafaultValue['story']['status']['To Do'] = 'active';
  136. $config->convert->importDeafaultValue['story']['status']['In Progress'] = 'active';
  137. $config->convert->importDeafaultValue['story']['status']['Reopened'] = 'active';
  138. $config->convert->importDeafaultValue['story']['status']['In Review'] = 'reviewing';
  139. $config->convert->importDeafaultValue['story']['status']['Resolved'] = 'closed';
  140. $config->convert->importDeafaultValue['story']['status']['Done'] = 'closed';
  141. $config->convert->importDeafaultValue['story']['status']['Closed'] = 'closed';
  142. $config->convert->importDeafaultValue['story']['status']['待办'] = 'draft';
  143. $config->convert->importDeafaultValue['story']['status']['进行中'] = 'active';
  144. $config->convert->importDeafaultValue['story']['status']['解决'] = 'closed';
  145. $config->convert->importDeafaultValue['story']['status']['已完成'] = 'closed';
  146. $config->convert->importDeafaultValue['bug']['action']['Create'] = 'create';
  147. $config->convert->importDeafaultValue['task']['action'] = $config->convert->importDeafaultValue['bug']['action'];
  148. $config->convert->importDeafaultValue['story']['action'] = $config->convert->importDeafaultValue['bug']['action'];
  149. $config->convert->importDeafaultValue['testcase']['action'] = $config->convert->importDeafaultValue['bug']['action'];
  150. $config->convert->importDeafaultValue['feedback']['action'] = $config->convert->importDeafaultValue['bug']['action'];
  151. $config->convert->importDeafaultValue['ticket']['action'] = $config->convert->importDeafaultValue['bug']['action'];
  152. $config->convert->importDeafaultValue['bug']['resolution']['Done'] = 'fixed';
  153. $config->convert->importDeafaultValue['bug']['resolution']["Won't Do"] = 'willnotfix';
  154. $config->convert->importDeafaultValue['bug']['resolution']["Duplicate"] = 'duplicate';
  155. $config->convert->importDeafaultValue['bug']['resolution']["Cannot Reproduce"] = 'notrepro';
  156. $config->convert->importDeafaultValue['bug']['resolution']["Declined"] = 'willnotfix';
  157. $config->convert->importDeafaultValue['bug']['resolution']['完成'] = 'fixed';
  158. $config->convert->importDeafaultValue['bug']['resolution']["被否决"] = 'willnotfix';
  159. $config->convert->importDeafaultValue['bug']['resolution']["重复提交"] = 'duplicate';
  160. $config->convert->importDeafaultValue['bug']['resolution']["无法再次复现"] = 'notrepro';
  161. $config->convert->importDeafaultValue['bug']['resolution']["被拒绝"] = 'willnotfix';
  162. $config->convert->importDeafaultValue['task']['reason']['Done'] = 'done';
  163. $config->convert->importDeafaultValue['task']['reason']["Won't Do"] = 'cancel';
  164. $config->convert->importDeafaultValue['task']['reason']["Duplicate"] = 'cancel';
  165. $config->convert->importDeafaultValue['task']['reason']["Cannot Reproduce"] = 'cancel';
  166. $config->convert->importDeafaultValue['task']['reason']["Declined"] = 'cancel';
  167. $config->convert->importDeafaultValue['task']['reason']['完成'] = 'done';
  168. $config->convert->importDeafaultValue['task']['reason']["被否决"] = 'cancel';
  169. $config->convert->importDeafaultValue['task']['reason']["重复提交"] = 'cancel';
  170. $config->convert->importDeafaultValue['task']['reason']["无法再次复现"] = 'cancel';
  171. $config->convert->importDeafaultValue['task']['reason']["被拒绝"] = 'cancel';
  172. $config->convert->importDeafaultValue['story']['reason']['Done'] = 'done';
  173. $config->convert->importDeafaultValue['story']['reason']["Won't Do"] = 'willnotdo';
  174. $config->convert->importDeafaultValue['story']['reason']["Duplicate"] = 'duplicate';
  175. $config->convert->importDeafaultValue['story']['reason']["Cannot Reproduce"] = 'bydesign';
  176. $config->convert->importDeafaultValue['story']['reason']["Declined"] = 'cancel';
  177. $config->convert->importDeafaultValue['story']['reason']['完成'] = 'done';
  178. $config->convert->importDeafaultValue['story']['reason']["被否决"] = 'willnotdo';
  179. $config->convert->importDeafaultValue['story']['reason']["重复提交"] = 'duplicate';
  180. $config->convert->importDeafaultValue['story']['reason']["无法再次复现"] = 'bydesign';
  181. $config->convert->importDeafaultValue['story']['reason']["被拒绝"] = 'cancel';
  182. $config->convert->importDeafaultValue['feedback']['reason']['Done'] = 'commented';
  183. $config->convert->importDeafaultValue['feedback']['reason']["Won't Do"] = 'refuse';
  184. $config->convert->importDeafaultValue['feedback']['reason']["Duplicate"] = 'repeat';
  185. $config->convert->importDeafaultValue['feedback']['reason']["Cannot Reproduce"] = 'refuse';
  186. $config->convert->importDeafaultValue['feedback']['reason']["Declined"] = 'refuse';
  187. $config->convert->importDeafaultValue['feedback']['reason']['完成'] = 'commented';
  188. $config->convert->importDeafaultValue['feedback']['reason']["被否决"] = 'refuse';
  189. $config->convert->importDeafaultValue['feedback']['reason']["重复提交"] = 'repeat';
  190. $config->convert->importDeafaultValue['feedback']['reason']["无法再次复现"] = 'refuse';
  191. $config->convert->importDeafaultValue['feedback']['reason']["被拒绝"] = 'refuse';
  192. $config->convert->importDeafaultValue['ticket']['reason'] = $config->convert->importDeafaultValue['feedback']['reason'];
  193. $config->convert->importDeafaultValue['requirement'] = $config->convert->importDeafaultValue['story'];
  194. $config->convert->importDeafaultValue['epic'] = $config->convert->importDeafaultValue['story'];