2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2017-09-08 08:28:34 +00:00
|
|
|
class ObjectManagerUserEmailOptional < ActiveRecord::Migration[4.2]
|
2017-07-14 09:57:34 +00:00
|
|
|
def up
|
|
|
|
|
|
|
|
# return if it's a new setup
|
2020-08-03 08:35:43 +00:00
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
2017-07-14 09:57:34 +00:00
|
|
|
|
|
|
|
ObjectManager::Attribute.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
force: true,
|
|
|
|
object: 'User',
|
|
|
|
name: 'email',
|
|
|
|
display: 'Email',
|
|
|
|
data_type: 'input',
|
2017-07-14 09:57:34 +00:00
|
|
|
data_option: {
|
2018-12-19 17:31:51 +00:00
|
|
|
type: 'email',
|
|
|
|
maxlength: 150,
|
|
|
|
null: true,
|
2017-07-14 09:57:34 +00:00
|
|
|
item_class: 'formGroup--halfSize',
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
editable: false,
|
|
|
|
active: true,
|
|
|
|
screens: {
|
|
|
|
signup: {
|
2017-07-14 09:57:34 +00:00
|
|
|
'-all-' => {
|
|
|
|
null: false,
|
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
invite_agent: {
|
2017-07-14 09:57:34 +00:00
|
|
|
'-all-' => {
|
|
|
|
null: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
invite_customer: {
|
|
|
|
'-all-' => {
|
|
|
|
null: false,
|
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
edit: {
|
2017-07-14 09:57:34 +00:00
|
|
|
'-all-' => {
|
|
|
|
null: true,
|
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
view: {
|
2017-07-14 09:57:34 +00:00
|
|
|
'-all-' => {
|
|
|
|
shown: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2018-12-19 17:31:51 +00:00
|
|
|
to_create: false,
|
|
|
|
to_migrate: false,
|
|
|
|
to_delete: false,
|
|
|
|
position: 400,
|
2017-07-14 09:57:34 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|