20180220000001_setting_attachment_preview.rb 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class SettingAttachmentPreview < ActiveRecord::Migration[5.1]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.create_if_not_exists(
  7. title: 'Sidebar Attachments',
  8. name: 'ui_ticket_zoom_attachments_preview',
  9. area: 'UI::TicketZoom::Preview',
  10. description: 'Enables preview of attachments.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: true,
  16. name: 'ui_ticket_zoom_attachments_preview',
  17. tag: 'boolean',
  18. translate: true,
  19. options: {
  20. true => 'yes',
  21. false => 'no',
  22. },
  23. },
  24. ],
  25. },
  26. state: false,
  27. preferences: {
  28. prio: 400,
  29. permission: ['admin.ui'],
  30. },
  31. frontend: true
  32. )
  33. Setting.create_if_not_exists(
  34. title: 'Sidebar Attachments',
  35. name: 'ui_ticket_zoom_sidebar_article_attachments',
  36. area: 'UI::TicketZoom::Preview',
  37. description: 'Enables a sidebar to show an overview of all attachments.',
  38. options: {
  39. form: [
  40. {
  41. display: '',
  42. null: true,
  43. name: 'ui_ticket_zoom_sidebar_article_attachments',
  44. tag: 'boolean',
  45. translate: true,
  46. options: {
  47. true => 'yes',
  48. false => 'no',
  49. },
  50. },
  51. ],
  52. },
  53. state: false,
  54. preferences: {
  55. prio: 500,
  56. permission: ['admin.ui'],
  57. },
  58. frontend: true
  59. )
  60. end
  61. end