20130815000002_update_ticket_number.rb 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. class UpdateTicketNumber < ActiveRecord::Migration
  2. def up
  3. Setting.create_or_update(
  4. :title => 'Ticket Number Format',
  5. :name => 'ticket_number',
  6. :area => 'Ticket::Number',
  7. :description => 'Selects the ticket number generator module. "Increment" increments the ticket
  8. number, the SystemID and the counter are used with SystemID.Counter format (e.g. 1010138, 1010139).
  9. With "Date" the ticket numbers will be generated by the current date, the SystemID and the counter.
  10. The format looks like Year.Month.Day.SystemID.counter (e.g. 201206231010138, 201206231010139).
  11. With param "Checksum => true" the counter will be appended as checksum to the string. The format
  12. looks like SystemID.Counter.CheckSum (e. g. 10101384, 10101392) or Year.Month.Day.SystemID.Counter.CheckSum (e.g. 2012070110101520, 2012070110101535).',
  13. :options => {
  14. :form => [
  15. {
  16. :display => '',
  17. :null => true,
  18. :name => 'ticket_number',
  19. :tag => 'select',
  20. :options => {
  21. 'Ticket::Number::Increment' => 'Increment (SystemID.Counter)',
  22. 'Ticket::Number::Date' => 'Date (Year.Month.Day.SystemID.Counter)',
  23. },
  24. },
  25. ],
  26. },
  27. :state => 'Ticket::Number::Increment',
  28. :frontend => false
  29. )
  30. end
  31. def down
  32. end
  33. end