From 2314f318ff71c5c93f4071c6827e0e2c3b8c3b03 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 26 Sep 2015 17:31:53 +0200 Subject: [PATCH] Merged migrations. --- db/migrate/20120101000010_create_ticket.rb | 3 +- .../20140831000001_create_object_manager.rb | 780 +++++++++++++++++ .../20141217000001_update_object_manager2.rb | 789 ------------------ ...000001_update_overview_and_ticket_state.rb | 128 --- db/migrate/20150716000001_update_settings.rb | 69 -- ...150716000003_add_setting_online_service.rb | 265 ------ 6 files changed, 782 insertions(+), 1252 deletions(-) delete mode 100644 db/migrate/20141217000001_update_object_manager2.rb delete mode 100644 db/migrate/20150112000001_update_overview_and_ticket_state.rb delete mode 100644 db/migrate/20150716000001_update_settings.rb delete mode 100644 db/migrate/20150716000003_add_setting_online_service.rb diff --git a/db/migrate/20120101000010_create_ticket.rb b/db/migrate/20120101000010_create_ticket.rb index 571b1be65..bff379f57 100644 --- a/db/migrate/20120101000010_create_ticket.rb +++ b/db/migrate/20120101000010_create_ticket.rb @@ -11,7 +11,8 @@ class CreateTicket < ActiveRecord::Migration create_table :ticket_states do |t| t.references :state_type, null: false - t.column :name, :string, limit: 250, null: false + t.column :name, :string, limit: 250, null: false + t.column :next_state_id, :integer, null: true t.column :note, :string, limit: 250, null: true t.column :active, :boolean, null: false, default: true t.column :updated_by_id, :integer, null: false diff --git a/db/migrate/20140831000001_create_object_manager.rb b/db/migrate/20140831000001_create_object_manager.rb index b06f78dee..cddfa784a 100644 --- a/db/migrate/20140831000001_create_object_manager.rb +++ b/db/migrate/20140831000001_create_object_manager.rb @@ -478,6 +478,786 @@ class CreateObjectManager < ActiveRecord::Migration updated_by_id: 1, ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'login', + display: 'Login', + data_type: 'input', + data_option: { + type: 'text', + maxlength: 100, + null: true, + autocapitalize: false, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: {}, + view: { + '-all-' => { + shown: false, + }, + }, + }, + pending_migration: false, + position: 100, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'firstname', + display: 'Firstname', + data_type: 'input', + data_option: { + type: 'text', + maxlength: 150, + null: false, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: { + '-all-' => { + null: false, + }, + }, + invite_agent: { + '-all-' => { + null: false, + }, + }, + edit: { + '-all-' => { + null: false, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 200, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'lastname', + display: 'Lastname', + data_type: 'input', + data_option: { + type: 'text', + maxlength: 150, + null: false, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: { + '-all-' => { + null: false, + }, + }, + invite_agent: { + '-all-' => { + null: false, + }, + }, + edit: { + '-all-' => { + null: false, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 300, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'email', + display: 'Email', + data_type: 'input', + data_option: { + type: 'email', + maxlength: 150, + null: false, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: { + '-all-' => { + null: false, + }, + }, + invite_agent: { + '-all-' => { + null: false, + }, + }, + edit: { + '-all-' => { + null: false, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 400, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'web', + display: 'Web', + data_type: 'input', + data_option: { + type: 'url', + maxlength: 250, + null: true, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 500, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'phone', + display: 'Phone', + data_type: 'input', + data_option: { + type: 'phone', + maxlength: 100, + null: true, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 600, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'mobile', + display: 'Mobile', + data_type: 'input', + data_option: { + type: 'phone', + maxlength: 100, + null: true, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 700, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'fax', + display: 'Fax', + data_type: 'input', + data_option: { + type: 'phone', + maxlength: 100, + null: true, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 800, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'organization_id', + display: 'Organization', + data_type: 'autocompletion_ajax', + data_option: { + multiple: false, + nulloption: true, + null: true, + relation: 'Organization', + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 900, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'department', + display: 'Department', + data_type: 'input', + data_option: { + type: 'text', + maxlength: 200, + null: true, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 1000, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'street', + display: 'Street', + data_type: 'input', + data_option: { + type: 'text', + maxlength: 100, + null: true, + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 1100, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'zip', + display: 'Zip', + data_type: 'input', + data_option: { + type: 'text', + maxlength: 100, + null: true, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 1200, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'city', + display: 'City', + data_type: 'input', + data_option: { + type: 'text', + maxlength: 100, + null: true, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 1300, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'password', + display: 'Password', + data_type: 'input', + data_option: { + type: 'password', + maxlength: 100, + null: true, + autocomplete: 'off', + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + signup: { + '-all-' => { + null: false, + }, + }, + invite_agent: {}, + edit: { + Admin: { + null: true, + }, + }, + view: {} + }, + pending_migration: false, + position: 1400, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'vip', + display: 'VIP', + data_type: 'boolean', + data_option: { + null: true, + default: false, + item_class: 'formGroup--halfSize', + options: { + false: 'no', + true: 'yes', + }, + translate: true, + }, + editable: false, + active: true, + screens: { + edit: { + Admin: { + null: true, + }, + Agent: { + null: true, + }, + }, + view: { + '-all-' => { + shown: false, + }, + }, + }, + pending_migration: false, + position: 1490, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'note', + display: 'Note', + data_type: 'richtext', + data_option: { + type: 'text', + maxlength: 250, + null: true, + note: 'Notes are visible to agents only, never to customers.', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 1500, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'role_ids', + display: 'Roles', + data_type: 'checkbox', + data_option: { + multiple: true, + null: false, + relation: 'Role', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + Admin: { + null: false, + }, + }, + view: { + '-all-' => { + shown: false, + }, + }, + }, + pending_migration: false, + position: 1600, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'group_ids', + display: 'Groups', + data_type: 'checkbox', + data_option: { + multiple: true, + null: true, + relation: 'Group', + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: { + '-all-' => { + null: false, + }, + }, + edit: { + Admin: { + null: true, + }, + }, + view: { + '-all-' => { + shown: false, + }, + }, + }, + pending_migration: false, + position: 1700, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'User', + name: 'active', + display: 'Active', + data_type: 'active', + data_option: { + default: true, + }, + editable: false, + active: true, + screens: { + signup: {}, + invite_agent: {}, + edit: { + Admin: { + null: false, + }, + }, + view: { + '-all-' => { + shown: false, + }, + }, + }, + pending_migration: false, + position: 1800, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'Organization', + name: 'name', + display: 'Name', + data_type: 'input', + data_option: { + type: 'text', + maxlength: 150, + null: false, + item_class: 'formGroup--halfSize', + }, + editable: false, + active: true, + screens: { + edit: { + '-all-' => { + null: false, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 200, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'Organization', + name: 'shared', + display: 'Shared organization', + data_type: 'boolean', + data_option: { + maxlength: 250, + null: true, + default: true, + note: 'Customers in the organization can view each other items.', + item_class: 'formGroup--halfSize', + options: { + true: 'Yes', + false: 'No', + } + }, + editable: false, + active: true, + screens: { + edit: { + Admin: { + null: false, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 1400, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'Organization', + name: 'note', + display: 'Note', + data_type: 'richtext', + data_option: { + type: 'text', + maxlength: 250, + null: true, + note: 'Notes are visible to agents only, never to customers.', + }, + editable: false, + active: true, + screens: { + edit: { + '-all-' => { + null: true, + }, + }, + view: { + '-all-' => { + shown: true, + }, + }, + }, + pending_migration: false, + position: 1500, + created_by_id: 1, + updated_by_id: 1, + ) + + ObjectManager::Attribute.add( + object: 'Organization', + name: 'active', + display: 'Active', + data_type: 'active', + data_option: { + default: true, + }, + editable: false, + active: true, + screens: { + edit: { + Admin: { + null: false, + }, + }, + view: { + '-all-' => { + shown: false, + }, + }, + }, + pending_migration: false, + position: 1800, + created_by_id: 1, + updated_by_id: 1, + ) + end def down diff --git a/db/migrate/20141217000001_update_object_manager2.rb b/db/migrate/20141217000001_update_object_manager2.rb deleted file mode 100644 index 5e3ba806e..000000000 --- a/db/migrate/20141217000001_update_object_manager2.rb +++ /dev/null @@ -1,789 +0,0 @@ -class UpdateObjectManager2 < ActiveRecord::Migration - def up - - #remove_index :object_manager_attributes, [:name] - - ObjectManager::Attribute.add( - object: 'User', - name: 'login', - display: 'Login', - data_type: 'input', - data_option: { - type: 'text', - maxlength: 100, - null: true, - autocapitalize: false, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: {}, - view: { - '-all-' => { - shown: false, - }, - }, - }, - pending_migration: false, - position: 100, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'firstname', - display: 'Firstname', - data_type: 'input', - data_option: { - type: 'text', - maxlength: 150, - null: false, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: { - '-all-' => { - null: false, - }, - }, - invite_agent: { - '-all-' => { - null: false, - }, - }, - edit: { - '-all-' => { - null: false, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 200, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'lastname', - display: 'Lastname', - data_type: 'input', - data_option: { - type: 'text', - maxlength: 150, - null: false, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: { - '-all-' => { - null: false, - }, - }, - invite_agent: { - '-all-' => { - null: false, - }, - }, - edit: { - '-all-' => { - null: false, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 300, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'email', - display: 'Email', - data_type: 'input', - data_option: { - type: 'email', - maxlength: 150, - null: false, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: { - '-all-' => { - null: false, - }, - }, - invite_agent: { - '-all-' => { - null: false, - }, - }, - edit: { - '-all-' => { - null: false, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 400, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'web', - display: 'Web', - data_type: 'input', - data_option: { - type: 'url', - maxlength: 250, - null: true, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 500, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'phone', - display: 'Phone', - data_type: 'input', - data_option: { - type: 'phone', - maxlength: 100, - null: true, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 600, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'mobile', - display: 'Mobile', - data_type: 'input', - data_option: { - type: 'phone', - maxlength: 100, - null: true, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 700, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'fax', - display: 'Fax', - data_type: 'input', - data_option: { - type: 'phone', - maxlength: 100, - null: true, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 800, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'organization_id', - display: 'Organization', - data_type: 'autocompletion_ajax', - data_option: { - multiple: false, - nulloption: true, - null: true, - relation: 'Organization', - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 900, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'department', - display: 'Department', - data_type: 'input', - data_option: { - type: 'text', - maxlength: 200, - null: true, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 1000, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'street', - display: 'Street', - data_type: 'input', - data_option: { - type: 'text', - maxlength: 100, - null: true, - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 1100, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'zip', - display: 'Zip', - data_type: 'input', - data_option: { - type: 'text', - maxlength: 100, - null: true, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 1200, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'city', - display: 'City', - data_type: 'input', - data_option: { - type: 'text', - maxlength: 100, - null: true, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 1300, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'password', - display: 'Password', - data_type: 'input', - data_option: { - type: 'password', - maxlength: 100, - null: true, - autocomplete: 'off', - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - signup: { - '-all-' => { - null: false, - }, - }, - invite_agent: {}, - edit: { - Admin: { - null: true, - }, - }, - view: {} - }, - pending_migration: false, - position: 1400, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'vip', - display: 'VIP', - data_type: 'boolean', - data_option: { - null: true, - default: false, - item_class: 'formGroup--halfSize', - options: { - false: 'no', - true: 'yes', - }, - translate: true, - }, - editable: false, - active: true, - screens: { - edit: { - Admin: { - null: true, - }, - Agent: { - null: true, - }, - }, - view: { - '-all-' => { - shown: false, - }, - }, - }, - pending_migration: false, - position: 1490, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'note', - display: 'Note', - data_type: 'richtext', - data_option: { - type: 'text', - maxlength: 250, - null: true, - note: 'Notes are visible to agents only, never to customers.', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 1500, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'role_ids', - display: 'Roles', - data_type: 'checkbox', - data_option: { - multiple: true, - null: false, - relation: 'Role', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - Admin: { - null: false, - }, - }, - view: { - '-all-' => { - shown: false, - }, - }, - }, - pending_migration: false, - position: 1600, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'group_ids', - display: 'Groups', - data_type: 'checkbox', - data_option: { - multiple: true, - null: true, - relation: 'Group', - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: { - '-all-' => { - null: false, - }, - }, - edit: { - Admin: { - null: true, - }, - }, - view: { - '-all-' => { - shown: false, - }, - }, - }, - pending_migration: false, - position: 1700, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'User', - name: 'active', - display: 'Active', - data_type: 'active', - data_option: { - default: true, - }, - editable: false, - active: true, - screens: { - signup: {}, - invite_agent: {}, - edit: { - Admin: { - null: false, - }, - }, - view: { - '-all-' => { - shown: false, - }, - }, - }, - pending_migration: false, - position: 1800, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'Organization', - name: 'name', - display: 'Name', - data_type: 'input', - data_option: { - type: 'text', - maxlength: 150, - null: false, - item_class: 'formGroup--halfSize', - }, - editable: false, - active: true, - screens: { - edit: { - '-all-' => { - null: false, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 200, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'Organization', - name: 'shared', - display: 'Shared organization', - data_type: 'boolean', - data_option: { - maxlength: 250, - null: true, - default: true, - note: 'Customers in the organization can view each other items.', - item_class: 'formGroup--halfSize', - options: { - true: 'Yes', - false: 'No', - } - }, - editable: false, - active: true, - screens: { - edit: { - Admin: { - null: false, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 1400, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'Organization', - name: 'note', - display: 'Note', - data_type: 'richtext', - data_option: { - type: 'text', - maxlength: 250, - null: true, - note: 'Notes are visible to agents only, never to customers.', - }, - editable: false, - active: true, - screens: { - edit: { - '-all-' => { - null: true, - }, - }, - view: { - '-all-' => { - shown: true, - }, - }, - }, - pending_migration: false, - position: 1500, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'Organization', - name: 'active', - display: 'Active', - data_type: 'active', - data_option: { - default: true, - }, - editable: false, - active: true, - screens: { - edit: { - Admin: { - null: false, - }, - }, - view: { - '-all-' => { - shown: false, - }, - }, - }, - pending_migration: false, - position: 1800, - created_by_id: 1, - updated_by_id: 1, - ) - - end - - def down - end -end diff --git a/db/migrate/20150112000001_update_overview_and_ticket_state.rb b/db/migrate/20150112000001_update_overview_and_ticket_state.rb deleted file mode 100644 index 80bbe28d2..000000000 --- a/db/migrate/20150112000001_update_overview_and_ticket_state.rb +++ /dev/null @@ -1,128 +0,0 @@ -class UpdateOverviewAndTicketState < ActiveRecord::Migration - def up - - # if we are on upgrade mode - overview_role = Role.where( name: 'Agent' ).first - add_column :ticket_states, :next_state_id, :integer, null: true - UserInfo.current_user_id = 1 - - return true if !overview_role - - Overview.create_or_update( - name: 'My pending reached Tickets', - link: 'my_pending_reached', - prio: 1010, - role_id: overview_role.id, - condition: { - 'tickets.state_id' => [3], - 'tickets.owner_id' => 'current_user.id', - 'tickets.pending_time' => { 'direction' => 'before', 'count' => 1, 'area' => 'minute' }, - }, - order: { - by: 'created_at', - direction: 'ASC', - }, - view: { - d: %w(title customer group created_at), - s: %w(title customer group created_at), - m: %w(number title customer group created_at), - view_mode_default: 's', - }, - ) - Ticket::State.create_or_update( id: 3, name: 'pending reminder', state_type_id: Ticket::StateType.where(name: 'pending reminder').first.id ) - Ticket::State.create_or_update( id: 6, name: 'removed', state_type_id: Ticket::StateType.where(name: 'removed').first.id, active: false ) - Ticket::State.create_or_update( id: 7, name: 'pending close', state_type_id: Ticket::StateType.where(name: 'pending action').first.id ) - - ObjectManager::Attribute.add( - object: 'Ticket', - name: 'state_id', - display: 'State', - data_type: 'select', - data_option: { - relation: 'TicketState', - nulloption: true, - multiple: false, - null: false, - default: 2, - translate: true, - filter: [1, 2, 3, 4, 7], - }, - editable: false, - active: true, - screens: { - create_middle: { - Agent: { - null: false, - item_class: 'column', - }, - Customer: { - item_class: 'column', - nulloption: false, - null: true, - filter: [1, 4], - default: 1, - }, - }, - edit: { - Agent: { - nulloption: false, - null: false, - filter: [2, 3, 4, 7], - }, - Customer: { - nulloption: false, - null: true, - filter: [2, 4], - default: 2, - }, - }, - }, - pending_migration: false, - position: 40, - created_by_id: 1, - updated_by_id: 1, - ) - - ObjectManager::Attribute.add( - object: 'Ticket', - name: 'pending_time', - display: 'Pending till', - data_type: 'datetime', - data_option: { - future: true, - past: false, - diff: 24, - null: true, - translate: true, - required_if: { - state_id: [3, 7] - }, - shown_if: { - state_id: [3, 7] - }, - }, - editable: false, - active: true, - screens: { - create_middle: { - '-all-' => { - null: false, - item_class: 'column', - }, - }, - edit: { - Agent: { - null: false, - }, - }, - }, - pending_migration: false, - position: 41, - created_by_id: 1, - updated_by_id: 1, - ) - end - - def down - end -end diff --git a/db/migrate/20150716000001_update_settings.rb b/db/migrate/20150716000001_update_settings.rb deleted file mode 100644 index 685412b9e..000000000 --- a/db/migrate/20150716000001_update_settings.rb +++ /dev/null @@ -1,69 +0,0 @@ -class UpdateSettings < ActiveRecord::Migration - def up - Setting.create_or_update( - title: 'Organization', - name: 'organization', - area: 'System::Branding', - description: 'Will be shown in the app and is included in email footers.', - options: { - form: [ - { - display: '', - null: false, - name: 'organization', - tag: 'input', - }, - ], - }, - state: '', - preferences: { prio: 2 }, - frontend: true - ) - Setting.create_or_update( - title: 'Send client stats', - name: 'ui_send_client_stats', - area: 'System::UI', - description: 'Send client stats/error message to central server to improve the usability.', - options: { - form: [ - { - display: '', - null: true, - name: 'ui_send_client_stats', - tag: 'boolean', - options: { - true => 'yes', - false => 'no', - }, - }, - ], - }, - state: true, - preferences: { prio: 1 }, - frontend: true - ) - Setting.create_or_update( - title: 'Client storage', - name: 'ui_client_storage', - area: 'System::UI', - description: 'Use client storage to cache data to perform speed of application.', - options: { - form: [ - { - display: '', - null: true, - name: 'ui_client_storage', - tag: 'boolean', - options: { - true => 'yes', - false => 'no', - }, - }, - ], - }, - state: false, - preferences: { prio: 2 }, - frontend: true - ) - end -end diff --git a/db/migrate/20150716000003_add_setting_online_service.rb b/db/migrate/20150716000003_add_setting_online_service.rb deleted file mode 100644 index 7c78ca3a5..000000000 --- a/db/migrate/20150716000003_add_setting_online_service.rb +++ /dev/null @@ -1,265 +0,0 @@ -class AddSettingOnlineService < ActiveRecord::Migration - def up - - # return if it's a new setup - return if !Setting.find_by(name: 'system_init_done') - - Setting.create_or_update( - title: 'System Init Done', - name: 'system_init_done', - area: 'Core', - description: 'Defines if application is in init mode.', - options: {}, - state: Setting.get('system_init_done'), - preferences: { online_service_disable: true }, - frontend: true - ) - Setting.create_or_update( - title: 'Developer System', - name: 'developer_mode', - area: 'Core::Develop', - description: 'Defines if application is in developer mode (useful for developer, all users have the same password, password reset will work without email delivery).', - options: {}, - state: Setting.get('developer_mode'), - preferences: { online_service_disable: true }, - frontend: true - ) - Setting.create_or_update( - title: 'Online Service', - name: 'system_online_service', - area: 'Core', - description: 'Defines if application is used as online service.', - options: {}, - state: Setting.get('system_online_service'), - preferences: { online_service_disable: true }, - frontend: true - ) - Setting.create_or_update( - title: 'SystemID', - name: 'system_id', - area: 'System::Base', - description: 'Defines the system identifier. Every ticket number contains this ID. This ensures that only tickets which belong to your system will be processed as follow-ups (useful when communicating between two instances of Zammad).', - options: { - form: [ - { - display: '', - null: true, - name: 'system_id', - tag: 'select', - options: { - '10' => '10', - '11' => '11', - '12' => '12', - '13' => '13', - }, - }, - ], - }, - state: '10', - preferences: { online_service_disable: true }, - frontend: true - ) - Setting.create_or_update( - title: 'Fully Qualified Domain Name', - name: 'fqdn', - area: 'System::Base', - description: 'Defines the fully qualified domain name of the system. This setting is used as a variable, #{setting.fqdn} which is found in all forms of messaging used by the application, to build links to the tickets within your system.', - options: { - form: [ - { - display: '', - null: false, - name: 'fqdn', - tag: 'input', - }, - ], - }, - state: Setting.get('fqdn'), - preferences: { online_service_disable: true }, - frontend: true - ) - Setting.create_or_update( - title: 'websocket port', - name: 'websocket_port', - area: 'System::WebSocket', - description: 'Defines the port of the websocket server.', - options: { - form: [ - { - display: '', - null: false, - name: 'websocket_port', - tag: 'input', - }, - ], - }, - state: Setting.get('websocket_port'), - preferences: { online_service_disable: true }, - frontend: true - ) - Setting.create_or_update( - title: 'http type', - name: 'http_type', - area: 'System::Base', - description: 'Defines the type of protocol, used by the web server, to serve the application. If https protocol will be used instead of plain http, it must be specified in here. Since this has no affect on the web server\'s settings or behavior, it will not change the method of access to the application and, if it is wrong, it will not prevent you from logging into the application. This setting is used as a variable, #{setting.http_type} which is found in all forms of messaging used by the application, to build links to the tickets within your system.', - options: { - form: [ - { - display: '', - null: true, - name: 'http_type', - tag: 'select', - options: { - 'https' => 'https', - 'http' => 'http', - }, - }, - ], - }, - state: Setting.get('http_type'), - preferences: { online_service_disable: true }, - frontend: true - ) - - Setting.create_or_update( - title: 'Storage Mechanism', - name: 'storage', - area: 'System::Storage', - description: '"Database" stores all attachments in the database (not recommended for storing large amounts of data). "Filesystem" stores the data on the filesystem. You can switch between the modules even on a system that is already in production without any loss of data.', - options: { - form: [ - { - display: '', - null: true, - name: 'storage', - tag: 'select', - options: { - 'DB' => 'Database', - 'FS' => 'Filesystem', - }, - }, - ], - }, - state: Setting.get('storage'), - preferences: { online_service_disable: true }, - frontend: false - ) - Setting.create_or_update( - title: 'Max. Email Size', - name: 'postmaster_max_size', - area: 'Email::Base', - description: 'Maximal size in MB of emails.', - options: { - form: [ - { - display: '', - null: true, - name: 'postmaster_max_size', - tag: 'select', - options: { - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - 12 => 12, - 13 => 13, - 14 => 14, - 15 => 15, - 16 => 16, - 17 => 17, - 18 => 18, - 19 => 19, - 20 => 20, - }, - }, - ], - }, - state: Setting.get('postmaster_max_size'), - preferences: { online_service_disable: true }, - frontend: false - ) - Setting.create_or_update( - title: 'Notification Sender', - name: 'notification_sender', - area: 'Email::Base', - description: 'Defines the sender of email notifications.', - options: { - form: [ - { - display: '', - null: false, - name: 'notification_sender', - tag: 'input', - }, - ], - }, - state: Setting.get('notification_sender'), - preferences: { online_service_disable: true }, - frontend: false - ) - - Setting.create_or_update( - title: 'Elasticsearch Endpoint URL', - name: 'es_url', - area: 'SearchIndex::Elasticsearch', - description: 'Define endpoint of Elastic Search.', - state: Setting.get('es_url'), - preferences: { online_service_disable: true }, - frontend: false - ) - Setting.create_or_update( - title: 'Elasticsearch Endpoint User', - name: 'es_user', - area: 'SearchIndex::Elasticsearch', - description: 'Define http basic auth user of Elasticsearch.', - state: Setting.get('es_user'), - preferences: { online_service_disable: true }, - frontend: false - ) - Setting.create_or_update( - title: 'Elastic Search Endpoint Password', - name: 'es_password', - area: 'SearchIndex::Elasticsearch', - description: 'Define http basic auth password of Elasticsearch.', - state: Setting.get('es_password'), - preferences: { online_service_disable: true }, - frontend: false - ) - Setting.create_or_update( - title: 'Elastic Search Endpoint Index', - name: 'es_index', - area: 'SearchIndex::Elasticsearch', - description: 'Define Elasticsearch index name.', - state: Setting.get('es_index'), - preferences: { online_service_disable: true }, - frontend: false - ) - Setting.create_or_update( - title: 'Elastic Search Attachment Extentions', - name: 'es_attachment_ignore', - area: 'SearchIndex::Elasticsearch', - description: 'Define attachment extentions which are ignored for Elasticsearch.', - state: Setting.get('es_attachment_ignore'), - preferences: { online_service_disable: true }, - frontend: false - ) - Setting.create_or_update( - title: 'Elastic Search Attachment Size', - name: 'es_attachment_max_size_in_mb', - area: 'SearchIndex::Elasticsearch', - description: 'Define max. attachment size for Elasticsearch.', - state: Setting.get('es_attachment_max_size_in_mb'), - preferences: { online_service_disable: true }, - frontend: false - ) - - end - -end