20170713000002_ticket_zoom_setting2.rb 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class TicketZoomSetting2 < 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. setting = Setting.find_by(name: 'ui_ticket_zoom_article_new_internal')
  7. if setting
  8. setting.title = 'Note - default visibility'
  9. setting.name = 'ui_ticket_zoom_article_note_new_internal'
  10. setting.description = 'Default visibility for new articles.'
  11. setting.preferences[:prio] = 100
  12. setting.options[:form][0][:name] = 'ui_ticket_zoom_article_note_new_internal'
  13. setting.save!
  14. end
  15. Setting.create_if_not_exists(
  16. title: 'Note - default visibility',
  17. name: 'ui_ticket_zoom_article_note_new_internal',
  18. area: 'UI::TicketZoom',
  19. description: 'Default visibility for new articles.',
  20. options: {
  21. form: [
  22. {
  23. display: '',
  24. null: true,
  25. name: 'ui_ticket_zoom_article_note_new_internal',
  26. tag: 'boolean',
  27. translate: true,
  28. options: {
  29. true => 'internal',
  30. false => 'public',
  31. },
  32. },
  33. ],
  34. },
  35. state: true,
  36. preferences: {
  37. prio: 100,
  38. permission: ['admin.ui'],
  39. },
  40. frontend: true
  41. )
  42. Setting.create_if_not_exists(
  43. title: 'Email - subject field',
  44. name: 'ui_ticket_zoom_article_email_subject',
  45. area: 'UI::TicketZoom',
  46. description: 'Use subject field for emails. If disabled, the ticket title will be used as subject.',
  47. options: {
  48. form: [
  49. {
  50. display: '',
  51. null: true,
  52. name: 'ui_ticket_zoom_article_email_subject',
  53. tag: 'boolean',
  54. translate: true,
  55. options: {
  56. true => 'yes',
  57. false => 'no',
  58. },
  59. },
  60. ],
  61. },
  62. state: false,
  63. preferences: {
  64. prio: 200,
  65. permission: ['admin.ui'],
  66. },
  67. frontend: true
  68. )
  69. Setting.create_if_not_exists(
  70. title: 'Email - full quote',
  71. name: 'ui_ticket_zoom_article_email_full_quote',
  72. area: 'UI::TicketZoom',
  73. 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).',
  74. options: {
  75. form: [
  76. {
  77. display: '',
  78. null: true,
  79. name: 'ui_ticket_zoom_article_email_full_quote',
  80. tag: 'boolean',
  81. translate: true,
  82. options: {
  83. true => 'yes',
  84. false => 'no',
  85. },
  86. },
  87. ],
  88. },
  89. state: false,
  90. preferences: {
  91. prio: 220,
  92. permission: ['admin.ui'],
  93. },
  94. frontend: true
  95. )
  96. Setting.create_if_not_exists(
  97. title: 'Twitter - tweet initials',
  98. name: 'ui_ticket_zoom_article_twitter_initials',
  99. area: 'UI::TicketZoom',
  100. description: 'Add sender initials to end of a tweet.',
  101. options: {
  102. form: [
  103. {
  104. display: '',
  105. null: true,
  106. name: 'ui_ticket_zoom_article_twitter_initials',
  107. tag: 'boolean',
  108. translate: true,
  109. options: {
  110. true => 'yes',
  111. false => 'no',
  112. },
  113. },
  114. ],
  115. },
  116. state: true,
  117. preferences: {
  118. prio: 300,
  119. permission: ['admin.ui'],
  120. },
  121. frontend: true
  122. )
  123. end
  124. end