20221019062814_issue4299_calendar_weeks.rb 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue4299CalendarWeeks < ActiveRecord::Migration[6.1]
  3. def change
  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: 'Show calendar weeks in the picker of date/datetime fields',
  8. name: 'datepicker_show_calendar_weeks',
  9. area: 'System::UI',
  10. description: 'Defines if calendar weeks are shown in the picker of date/datetime fields to easily select the correct date.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: true,
  16. name: 'datepicker_show_calendar_weeks',
  17. tag: 'boolean',
  18. options: {
  19. true => 'yes',
  20. false => 'no',
  21. },
  22. },
  23. ],
  24. },
  25. state: false,
  26. preferences: {
  27. render: true,
  28. prio: 4,
  29. permission: ['admin.system'],
  30. },
  31. frontend: true
  32. )
  33. end
  34. end