50 lines
1.1 KiB
Ruby
50 lines
1.1 KiB
Ruby
|
class IdoitSupport < ActiveRecord::Migration
|
||
|
def up
|
||
|
|
||
|
# return if it's a new setup
|
||
|
return if !Setting.find_by(name: 'system_init_done')
|
||
|
|
||
|
Setting.create_if_not_exists(
|
||
|
title: 'i-doit integration',
|
||
|
name: 'idoit_integration',
|
||
|
area: 'Integration::Switch',
|
||
|
description: 'Defines if i-doit (http://www.i-doit) is enabled or not.',
|
||
|
options: {
|
||
|
form: [
|
||
|
{
|
||
|
display: '',
|
||
|
null: true,
|
||
|
name: 'idoit_integration',
|
||
|
tag: 'boolean',
|
||
|
options: {
|
||
|
true => 'yes',
|
||
|
false => 'no',
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
state: false,
|
||
|
preferences: {
|
||
|
prio: 1,
|
||
|
authentication: true,
|
||
|
permission: ['admin.integration'],
|
||
|
},
|
||
|
frontend: true
|
||
|
)
|
||
|
Setting.create_if_not_exists(
|
||
|
title: 'i-doit config',
|
||
|
name: 'idoit_config',
|
||
|
area: 'Integration::Idoit',
|
||
|
description: 'Defines the i-doit config.',
|
||
|
options: {},
|
||
|
state: {},
|
||
|
preferences: {
|
||
|
prio: 2,
|
||
|
permission: ['admin.integration'],
|
||
|
},
|
||
|
frontend: false,
|
||
|
)
|
||
|
end
|
||
|
|
||
|
end
|