2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-04-26 11:28:32 +00:00
|
|
|
org_community = Organization.create_if_not_exists(
|
2018-12-19 17:31:51 +00:00
|
|
|
id: 1,
|
2021-11-15 15:58:19 +00:00
|
|
|
name: __('Zammad Foundation'),
|
2017-04-26 11:28:32 +00:00
|
|
|
)
|
|
|
|
user_community = User.create_or_update(
|
2018-12-19 17:31:51 +00:00
|
|
|
id: 2,
|
|
|
|
login: 'nicole.braun@zammad.org',
|
|
|
|
firstname: 'Nicole',
|
|
|
|
lastname: 'Braun',
|
|
|
|
email: 'nicole.braun@zammad.org',
|
|
|
|
password: '',
|
|
|
|
active: true,
|
|
|
|
roles: [ Role.find_by(name: 'Customer') ],
|
2017-04-26 11:28:32 +00:00
|
|
|
organization_id: org_community.id,
|
|
|
|
)
|
|
|
|
|
|
|
|
UserInfo.current_user_id = user_community.id
|
|
|
|
|
2017-12-14 13:19:24 +00:00
|
|
|
if Ticket.count.zero?
|
|
|
|
ticket = Ticket.create!(
|
2018-12-19 17:31:51 +00:00
|
|
|
group_id: Group.find_by(name: 'Users').id,
|
2017-12-14 13:19:24 +00:00
|
|
|
customer_id: User.find_by(login: 'nicole.braun@zammad.org').id,
|
2021-11-15 15:58:19 +00:00
|
|
|
title: __('Welcome to Zammad!'),
|
2017-12-14 13:19:24 +00:00
|
|
|
)
|
|
|
|
Ticket::Article.create!(
|
|
|
|
ticket_id: ticket.id,
|
2018-12-19 17:31:51 +00:00
|
|
|
type_id: Ticket::Article::Type.find_by(name: 'phone').id,
|
2017-12-14 13:19:24 +00:00
|
|
|
sender_id: Ticket::Article::Sender.find_by(name: 'Customer').id,
|
2018-12-19 17:31:51 +00:00
|
|
|
from: 'Zammad Feedback <feedback@zammad.org>',
|
|
|
|
body: 'Welcome!
|
2017-04-26 11:28:32 +00:00
|
|
|
|
2017-12-14 13:19:24 +00:00
|
|
|
Thank you for choosing Zammad.
|
2017-04-26 11:28:32 +00:00
|
|
|
|
2017-12-14 13:19:24 +00:00
|
|
|
You will find updates and patches at https://zammad.org/. Online
|
|
|
|
documentation is available at https://zammad.org/documentation. Get
|
|
|
|
involved (discussions, contributing, ...) at https://zammad.org/participate.
|
2017-04-26 11:28:32 +00:00
|
|
|
|
2017-12-14 13:19:24 +00:00
|
|
|
Regards,
|
2017-04-26 11:28:32 +00:00
|
|
|
|
2017-12-14 13:19:24 +00:00
|
|
|
Your Zammad Team
|
|
|
|
',
|
2018-12-19 17:31:51 +00:00
|
|
|
internal: false,
|
2017-12-14 13:19:24 +00:00
|
|
|
)
|
|
|
|
end
|
2017-04-26 11:28:32 +00:00
|
|
|
|
|
|
|
UserInfo.current_user_id = 1
|