20170117000001_unable_to_enable_time_accounting_633.rb 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class UnableToEnableTimeAccounting633 < 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.create_if_not_exists(
  7. title: 'Time Accounting',
  8. name: 'time_accounting',
  9. area: 'Web::Base',
  10. description: 'Enable time accounting.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: true,
  16. name: 'time_accounting',
  17. tag: 'boolean',
  18. options: {
  19. true => 'yes',
  20. false => 'no',
  21. },
  22. },
  23. ],
  24. },
  25. preferences: {
  26. authentication: true,
  27. permission: ['admin.time_accounting'],
  28. },
  29. state: false,
  30. frontend: true
  31. )
  32. Setting.create_if_not_exists(
  33. title: 'Time Accounting Selector',
  34. name: 'time_accounting_selector',
  35. area: 'Web::Base',
  36. description: 'Enable time accounting for this tickets.',
  37. options: {
  38. form: [
  39. {},
  40. ],
  41. },
  42. preferences: {
  43. authentication: true,
  44. permission: ['admin.time_accounting'],
  45. },
  46. state: {},
  47. frontend: true
  48. )
  49. end
  50. end