20170713000002_ticket_zoom_setting2.rb 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. class TicketZoomSetting2 < ActiveRecord::Migration[4.2]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.exists?(name: 'system_init_done')
  5. setting = Setting.find_by(name: 'ui_ticket_zoom_article_new_internal')
  6. if setting
  7. setting.title = 'Note - default visibility'
  8. setting.name = 'ui_ticket_zoom_article_note_new_internal'
  9. setting.description = 'Default visibility for new articles.'
  10. setting.preferences[:prio] = 100
  11. setting.options[:form][0][:name] = 'ui_ticket_zoom_article_note_new_internal'
  12. setting.save!
  13. end
  14. Setting.create_if_not_exists(
  15. title: 'Note - default visibility',
  16. name: 'ui_ticket_zoom_article_note_new_internal',
  17. area: 'UI::TicketZoom',
  18. description: 'Default visibility for new articles.',
  19. options: {
  20. form: [
  21. {
  22. display: '',
  23. null: true,
  24. name: 'ui_ticket_zoom_article_note_new_internal',
  25. tag: 'boolean',
  26. translate: true,
  27. options: {
  28. true => 'internal',
  29. false => 'public',
  30. },
  31. },
  32. ],
  33. },
  34. state: true,
  35. preferences: {
  36. prio: 100,
  37. permission: ['admin.ui'],
  38. },
  39. frontend: true
  40. )
  41. Setting.create_if_not_exists(
  42. title: 'Email - subject field',
  43. name: 'ui_ticket_zoom_article_email_subject',
  44. area: 'UI::TicketZoom',
  45. description: 'Use subject field for emails. If disabled, the ticket title will be used as subject.',
  46. options: {
  47. form: [
  48. {
  49. display: '',
  50. null: true,
  51. name: 'ui_ticket_zoom_article_email_subject',
  52. tag: 'boolean',
  53. translate: true,
  54. options: {
  55. true => 'yes',
  56. false => 'no',
  57. },
  58. },
  59. ],
  60. },
  61. state: false,
  62. preferences: {
  63. prio: 200,
  64. permission: ['admin.ui'],
  65. },
  66. frontend: true
  67. )
  68. Setting.create_if_not_exists(
  69. title: 'Email - full quote',
  70. name: 'ui_ticket_zoom_article_email_full_quote',
  71. area: 'UI::TicketZoom',
  72. description: 'Enable if you want to quote the full email in your answer. The quoted email will be put at the end of your answer. If you just want to quote a certain phrase, just mark the text and press reply (this feature is always available).',
  73. options: {
  74. form: [
  75. {
  76. display: '',
  77. null: true,
  78. name: 'ui_ticket_zoom_article_email_full_quote',
  79. tag: 'boolean',
  80. translate: true,
  81. options: {
  82. true => 'yes',
  83. false => 'no',
  84. },
  85. },
  86. ],
  87. },
  88. state: false,
  89. preferences: {
  90. prio: 220,
  91. permission: ['admin.ui'],
  92. },
  93. frontend: true
  94. )
  95. Setting.create_if_not_exists(
  96. title: 'Twitter - tweet initials',
  97. name: 'ui_ticket_zoom_article_twitter_initials',
  98. area: 'UI::TicketZoom',
  99. description: 'Add sender initials to end of a tweet.',
  100. options: {
  101. form: [
  102. {
  103. display: '',
  104. null: true,
  105. name: 'ui_ticket_zoom_article_twitter_initials',
  106. tag: 'boolean',
  107. translate: true,
  108. options: {
  109. true => 'yes',
  110. false => 'no',
  111. },
  112. },
  113. ],
  114. },
  115. state: true,
  116. preferences: {
  117. prio: 300,
  118. permission: ['admin.ui'],
  119. },
  120. frontend: true
  121. )
  122. end
  123. end