20211026000001_object_manager_ticket_object_update.rb 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class ObjectManagerTicketObjectUpdate < 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. UserInfo.current_user_id = 1
  7. ObjectManager::Attribute.add(
  8. force: true,
  9. object: 'Ticket',
  10. name: 'number',
  11. display: '#',
  12. data_type: 'input',
  13. data_option: {
  14. type: 'text',
  15. readonly: 1,
  16. null: true,
  17. maxlength: 60,
  18. width: '68px',
  19. },
  20. editable: false,
  21. active: true,
  22. screens: {
  23. create_top: {},
  24. edit: {},
  25. },
  26. to_create: false,
  27. to_migrate: false,
  28. to_delete: false,
  29. position: 5,
  30. )
  31. ObjectManager::Attribute.add(
  32. force: true,
  33. object: 'Ticket',
  34. name: 'title',
  35. display: 'Title',
  36. data_type: 'input',
  37. data_option: {
  38. type: 'text',
  39. maxlength: 200,
  40. null: false,
  41. translate: false,
  42. },
  43. editable: false,
  44. active: true,
  45. screens: {
  46. create_top: {
  47. '-all-' => {
  48. null: false,
  49. },
  50. },
  51. edit: {},
  52. },
  53. to_create: false,
  54. to_migrate: false,
  55. to_delete: false,
  56. position: 8,
  57. )
  58. ObjectManager::Attribute.add(
  59. force: true,
  60. object: 'Ticket',
  61. name: 'organization_id',
  62. display: 'Organization',
  63. data_type: 'autocompletion_ajax',
  64. data_option: {
  65. relation: 'Organization',
  66. autocapitalize: false,
  67. multiple: false,
  68. null: true,
  69. translate: false,
  70. permission: ['ticket.agent'],
  71. readonly: 1,
  72. },
  73. editable: false,
  74. active: true,
  75. screens: {
  76. create_top: {
  77. '-all-' => {
  78. null: false,
  79. },
  80. },
  81. edit: {},
  82. },
  83. to_create: false,
  84. to_migrate: false,
  85. to_delete: false,
  86. position: 12,
  87. )
  88. end
  89. end