20170123000002_fixed_translation.rb 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class FixedTranslation < ActiveRecord::Migration[4.2]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. settings_update = [
  7. {
  8. 'name' => 'app_version',
  9. 'title' => nil,
  10. 'description' => 'Only used internally to propagate current web app version to clients.',
  11. },
  12. {
  13. 'name' => 'websocket_port',
  14. 'title' => 'Websocket port',
  15. 'description' => nil,
  16. },
  17. {
  18. 'name' => 'http_type',
  19. 'title' => 'HTTP type',
  20. 'description' => 'Define the http protocol of your instance.',
  21. },
  22. {
  23. 'name' => 'storage_provider',
  24. 'title' => nil,
  25. 'description' => '"Database" stores all attachments in the database (not recommended for storing large amounts of data). "Filesystem" stores the data in the filesystem. You can switch between the modules even on a system that is already in production without any loss of data.',
  26. },
  27. {
  28. 'name' => 'geo_ip_backend',
  29. 'title' => nil,
  30. 'description' => 'Defines the backend for geo IP lookups. Shows also location of an IP address if an IP address is shown.',
  31. },
  32. {
  33. 'name' => 'geo_calendar_backend',
  34. 'title' => nil,
  35. 'description' => 'Defines the backend for geo calendar lookups. Used for initial calendar succession.',
  36. },
  37. {
  38. 'name' => 'ui_client_storage',
  39. 'title' => nil,
  40. 'description' => 'Use client storage to cache data to enhance performance of application.',
  41. },
  42. {
  43. 'name' => 'password_min_size',
  44. 'title' => 'Minimum length',
  45. 'description' => 'Password needs to have at least a minimal number of characters.',
  46. },
  47. {
  48. 'name' => 'password_need_digit',
  49. 'title' => nil,
  50. 'description' => 'Password needs to contain at least one digit.',
  51. },
  52. {
  53. 'name' => 'password_max_login_failed',
  54. 'title' => 'Maximum failed logins',
  55. 'description' => 'Number of failed logins after account will be deactivated.',
  56. },
  57. {
  58. 'name' => 'ticket_hook',
  59. 'title' => nil,
  60. 'description' => 'The identifier for a ticket, e.g. Ticket#, Call#, MyTicket#. The default is Ticket#.',
  61. },
  62. {
  63. 'name' => 'ticket_hook_divider',
  64. 'title' => nil,
  65. 'description' => 'The divider between TicketHook and ticket number. E. g. \': \'.',
  66. },
  67. {
  68. 'name' => 'ticket_hook_position',
  69. 'title' => nil,
  70. 'description' => "The format of the subject.
  71. * **Right** means **Some Subject [Ticket#12345]**
  72. * **Left** means **[Ticket#12345] Some Subject**
  73. * **None** means **Some Subject** (without ticket number). In the last case you should enable *postmaster_follow_up_search_in* to recognize follow-ups based on email headers and/or body.",
  74. },
  75. {
  76. 'name' => 'customer_ticket_create_group_ids',
  77. 'title' => nil,
  78. 'description' => 'Defines groups for which a customer can create tickets via web interface. "-" means all groups are available.',
  79. },
  80. {
  81. 'name' => 'form_ticket_create',
  82. 'title' => nil,
  83. 'description' => 'Defines if tickets can be created via web form.',
  84. },
  85. {
  86. 'name' => 'ticket_subject_size',
  87. 'title' => nil,
  88. 'description' => 'Max. length of the subject in an email reply.',
  89. },
  90. {
  91. 'name' => 'ticket_subject_re',
  92. 'title' => nil,
  93. 'description' => 'The text at the beginning of the subject in an email reply, e.g. RE, AW, or AS.',
  94. },
  95. {
  96. 'name' => 'ticket_define_email_from',
  97. 'title' => nil,
  98. 'description' => 'Defines how the From field of emails (sent from answers and email tickets) should look like.',
  99. },
  100. {
  101. 'name' => 'ticket_define_email_from_separator',
  102. 'title' => nil,
  103. 'description' => 'Defines the separator between the agent\'s real name and the given group email address.',
  104. },
  105. {
  106. 'name' => 'postmaster_max_size',
  107. 'title' => 'Maximum Email Size',
  108. 'description' => 'Maximum size in MB of emails.',
  109. },
  110. {
  111. 'name' => 'postmaster_follow_up_search_in',
  112. 'title' => 'Additional follow-up detection',
  113. 'description' => 'By default the follow-up check is done via the subject of an email. With this setting you can add more fields for which the follow-up check will be executed.',
  114. },
  115. {
  116. 'name' => 'send_no_auto_response_reg_exp',
  117. 'title' => nil,
  118. 'description' => 'If this regex matches, no notification will be sent by the sender.',
  119. },
  120. {
  121. 'name' => 'api_token_access',
  122. 'title' => nil,
  123. 'description' => 'Enable REST API using tokens (not username/email address and password). Each user needs to create its own access tokens in user profile.',
  124. },
  125. {
  126. 'name' => 'monitoring_token',
  127. 'title' => nil,
  128. 'description' => 'Token for monitoring.',
  129. },
  130. {
  131. 'name' => 'chat',
  132. 'title' => nil,
  133. 'description' => 'Enable/disable online chat.',
  134. },
  135. {
  136. 'name' => 'chat_agent_idle_timeout',
  137. 'title' => nil,
  138. 'description' => 'Idle timeout in seconds until agent is set offline automatically.',
  139. },
  140. {
  141. 'name' => 'models_searchable',
  142. 'title' => 'Defines searchable models.',
  143. 'description' => 'Defines the searchable models.',
  144. },
  145. {
  146. 'name' => 'default_controller',
  147. 'title' => nil,
  148. 'description' => 'Defines the default screen.',
  149. },
  150. {
  151. 'name' => 'es_url',
  152. 'title' => nil,
  153. 'description' => 'Defines endpoint of Elasticsearch.',
  154. },
  155. {
  156. 'name' => 'es_user',
  157. 'title' => nil,
  158. 'description' => 'Defines HTTP basic auth user of Elasticsearch.',
  159. },
  160. {
  161. 'name' => 'es_password',
  162. 'title' => 'Elasticsearch Endpoint Password',
  163. 'description' => 'Defines HTTP basic auth password of Elasticsearch.',
  164. },
  165. {
  166. 'name' => 'es_index',
  167. 'title' => 'Elasticsearch Endpoint Index',
  168. 'description' => 'Defines Elasticsearch index name.',
  169. },
  170. {
  171. 'name' => 'es_attachment_ignore',
  172. 'title' => 'Elasticsearch Attachment Extensions',
  173. 'description' => 'Defines attachment extensions which will be ignored by Elasticsearch.',
  174. },
  175. {
  176. 'name' => 'es_attachment_max_size_in_mb',
  177. 'title' => 'Elasticsearch Attachment Size',
  178. 'description' => nil,
  179. },
  180. {
  181. 'name' => 'import_mode',
  182. 'title' => nil,
  183. 'description' => 'Puts Zammad into import mode (disables some triggers).',
  184. },
  185. {
  186. 'name' => 'import_backend',
  187. 'title' => nil,
  188. 'description' => 'Set backend which is being used for import.',
  189. },
  190. {
  191. 'name' => 'import_ignore_sla',
  192. 'title' => nil,
  193. 'description' => 'Ignore escalation/SLA information for import.',
  194. },
  195. {
  196. 'name' => 'import_otrs_endpoint',
  197. 'title' => nil,
  198. 'description' => 'Defines OTRS endpoint to import users, tickets, states and articles.',
  199. },
  200. {
  201. 'name' => 'import_otrs_endpoint_key',
  202. 'title' => nil,
  203. 'description' => 'Defines OTRS endpoint authentication key.',
  204. },
  205. {
  206. 'name' => 'import_otrs_user',
  207. 'title' => 'Import User for HTTP basic authentication',
  208. 'description' => 'Defines HTTP basic authentication user (only if OTRS is protected via HTTP basic auth).',
  209. },
  210. {
  211. 'name' => 'import_zendesk_endpoint_key',
  212. 'title' => nil,
  213. 'description' => 'Defines Zendesk endpoint authentication key.',
  214. },
  215. {
  216. 'name' => 'import_zendesk_endpoint_username',
  217. 'title' => nil,
  218. 'description' => 'Defines Zendesk endpoint authentication user.',
  219. },
  220. {
  221. 'name' => 'time_accounting_selector',
  222. 'title' => nil,
  223. 'description' => 'Enable time accounting for these tickets.',
  224. },
  225. {
  226. 'name' => 'tag_new',
  227. 'title' => nil,
  228. 'description' => 'Allow users to create new tags.',
  229. },
  230. {
  231. 'name' => 'defaults_calendar_subscriptions_tickets',
  232. 'title' => nil,
  233. 'description' => 'Defines the default calendar tickets subscription settings.',
  234. },
  235. {
  236. 'name' => 'translator_key',
  237. 'title' => 'Defines translator identifier.',
  238. 'description' => nil,
  239. },
  240. {
  241. 'name' => '0010_postmaster_filter_trusted',
  242. 'title' => 'Defines postmaster filter.',
  243. 'description' => 'Defines postmaster filter to remove X-Zammad headers from not trusted sources.',
  244. },
  245. {
  246. 'name' => '0012_postmaster_filter_sender_is_system_address',
  247. 'title' => 'Defines postmaster filter.',
  248. 'description' => 'Defines postmaster filter to check if email has been created by Zammad itself and will set the article sender.',
  249. },
  250. {
  251. 'name' => '0015_postmaster_filter_identify_sender',
  252. 'title' => 'Defines postmaster filter.',
  253. 'description' => 'Defines postmaster filter to identify sender user.',
  254. },
  255. {
  256. 'name' => '0020_postmaster_filter_auto_response_check',
  257. 'title' => 'Defines postmaster filter.',
  258. 'description' => 'Defines postmaster filter to identify auto responses to prevent auto replies from Zammad.',
  259. },
  260. {
  261. 'name' => '0030_postmaster_filter_out_of_office_check',
  262. 'title' => 'Defines postmaster filter.',
  263. 'description' => 'Defines postmaster filter to identify out-of-office emails for follow-up detection and keeping current ticket state.',
  264. },
  265. {
  266. 'name' => '0100_postmaster_filter_follow_up_check',
  267. 'title' => 'Defines postmaster filter.',
  268. 'description' => 'Defines postmaster filter to identify follow-ups (based on admin settings).',
  269. },
  270. {
  271. 'name' => '0900_postmaster_filter_bounce_check',
  272. 'title' => 'Defines postmaster filter.',
  273. 'description' => 'Defines postmaster filter to identify postmaster bounced - to handle it as follow-up of the original ticket.',
  274. },
  275. {
  276. 'name' => '1000_postmaster_filter_database_check',
  277. 'title' => 'Defines postmaster filter.',
  278. 'description' => 'Defines postmaster filter for filters managed via admin interface.',
  279. },
  280. {
  281. 'name' => '5000_postmaster_filter_icinga',
  282. 'title' => 'Defines postmaster filter.',
  283. 'description' => 'Defines postmaster filter to manage Icinga (http://www.icinga.org) emails.',
  284. },
  285. {
  286. 'name' => '5100_postmaster_filter_nagios',
  287. 'title' => 'Defines postmaster filter.',
  288. 'description' => 'Defines postmaster filter to manage Nagios (http://www.nagios.org) emails.',
  289. },
  290. {
  291. 'name' => 'icinga_integration',
  292. 'title' => nil,
  293. 'description' => 'Defines if Icinga (http://www.icinga.org) is enabled or not.',
  294. },
  295. {
  296. 'name' => 'icinga_sender',
  297. 'title' => nil,
  298. 'description' => 'Defines the sender email address of Icinga emails.',
  299. },
  300. {
  301. 'name' => 'icinga_auto_close',
  302. 'title' => nil,
  303. 'description' => 'Defines if tickets should be closed if service is recovered.',
  304. },
  305. {
  306. 'name' => 'icinga_auto_close_state_id',
  307. 'title' => nil,
  308. 'description' => 'Defines the state of auto closed tickets.',
  309. },
  310. {
  311. 'name' => 'nagios_integration',
  312. 'title' => nil,
  313. 'description' => 'Defines if Nagios (http://www.nagios.org) is enabled or not.',
  314. },
  315. {
  316. 'name' => 'nagios_sender',
  317. 'title' => nil,
  318. 'description' => 'Defines the sender email address of Nagios emails.',
  319. },
  320. {
  321. 'name' => 'nagios_auto_close',
  322. 'title' => nil,
  323. 'description' => 'Defines if tickets should be closed if service is recovered.',
  324. },
  325. {
  326. 'name' => 'nagios_auto_close_state_id',
  327. 'title' => nil,
  328. 'description' => 'Defines the state of auto closed tickets.',
  329. },
  330. {
  331. 'name' => '0100_trigger',
  332. 'title' => 'Defines sync transaction backend.',
  333. 'description' => 'Defines the transaction backend to execute triggers.',
  334. },
  335. {
  336. 'name' => '0100_notification',
  337. 'title' => 'Defines transaction backend.',
  338. 'description' => 'Defines the transaction backend to send agent notifications.',
  339. },
  340. {
  341. 'name' => '1000_signature_detection',
  342. 'title' => 'Defines transaction backend.',
  343. 'description' => 'Defines the transaction backend to detect customer signatures in emails.',
  344. },
  345. {
  346. 'name' => '6000_slack_webhook',
  347. 'title' => 'Defines transaction backend.',
  348. 'description' => 'Defines the transaction backend which posts messages to Slack (http://www.slack.com).',
  349. },
  350. {
  351. 'name' => 'slack_integration',
  352. 'title' => nil,
  353. 'description' => 'Defines if Slack (http://www.slack.org) is enabled or not.',
  354. },
  355. {
  356. 'name' => 'slack_config',
  357. 'title' => nil,
  358. 'description' => 'Defines the slack config.',
  359. },
  360. {
  361. 'name' => 'sipgate_integration',
  362. 'title' => nil,
  363. 'description' => 'Defines if sipgate.io (http://www.sipgate.io) is enabled or not.',
  364. },
  365. {
  366. 'name' => 'sipgate_config',
  367. 'title' => nil,
  368. 'description' => 'Defines the sipgate.io config.',
  369. },
  370. {
  371. 'name' => 'clearbit_integration',
  372. 'title' => nil,
  373. 'description' => 'Defines if Clearbit (http://www.clearbit.com) is enabled or not.',
  374. },
  375. {
  376. 'name' => 'clearbit_config',
  377. 'title' => nil,
  378. 'description' => 'Defines the Clearbit config.',
  379. },
  380. {
  381. 'name' => '9000_clearbit_enrichment',
  382. 'title' => 'Defines transaction backend.',
  383. 'description' => 'Defines the transaction backend which will enrich customer and organization information from Clearbit (http://www.clearbit.com).',
  384. },
  385. {
  386. 'name' => '9100_cti_caller_id_detection',
  387. 'title' => 'Defines transaction backend.',
  388. 'description' => 'Defines the transaction backend which detects caller IDs in objects and store them for CTI lookups.',
  389. },
  390. {
  391. 'name' => '9200_karma',
  392. 'title' => 'Defines transaction backend.',
  393. 'description' => 'Defines the transaction backend which creates the karma score.',
  394. },
  395. {
  396. 'name' => 'karma_levels',
  397. 'title' => 'Defines karma levels.',
  398. 'description' => 'Defines the karma levels.',
  399. },
  400. ]
  401. settings_update.each do |setting|
  402. fetched_setting = Setting.find_by(name: setting['name'])
  403. next if !fetched_setting
  404. if setting['title']
  405. fetched_setting.title = setting['title']
  406. end
  407. if setting['description']
  408. fetched_setting.description = setting['description']
  409. end
  410. fetched_setting.save!
  411. end
  412. Translation.sync
  413. end
  414. end