Fixed issue #662 - Add setting to define internal/external notice default setting.

This commit is contained in:
Rolf Schmidt 2017-01-23 14:54:44 +01:00
parent b935dd3f07
commit 7cd9ccae75
3 changed files with 66 additions and 1 deletions

View file

@ -52,11 +52,13 @@ class App.TicketZoomArticleNew extends App.Controller
@type = @defaults['type'] || 'note' @type = @defaults['type'] || 'note'
@articleTypes = [] @articleTypes = []
if possibleArticleType.note if possibleArticleType.note
internal = @Config.get('ui_ticket_zoom_article_new_internal')
@articleTypes.push { @articleTypes.push {
name: 'note' name: 'note'
icon: 'note' icon: 'note'
attributes: [] attributes: []
internal: true, internal: internal,
features: ['attachment'] features: ['attachment']
} }
if possibleArticleType.email if possibleArticleType.email

View file

@ -0,0 +1,35 @@
class UiTicketZoomArticleNewInternal < 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: 'Define default visibility of new a new article',
name: 'ui_ticket_zoom_article_new_internal',
area: 'UI::TicketZoom',
description: 'Set default visibility of new a new article.',
options: {
form: [
{
display: '',
null: true,
name: 'ui_ticket_zoom_article_new_internal',
tag: 'boolean',
translate: true,
options: {
true => 'internal',
false => 'public',
},
},
],
},
state: true,
preferences: {
prio: 1,
permission: ['admin.ui'],
},
frontend: true
)
end
end

View file

@ -521,6 +521,34 @@ Setting.create_if_not_exists(
frontend: true frontend: true
) )
Setting.create_if_not_exists(
title: 'Define default visibility of new a new article',
name: 'ui_ticket_zoom_article_new_internal',
area: 'UI::TicketZoom',
description: 'Set default visibility of new a new article.',
options: {
form: [
{
display: '',
null: true,
name: 'ui_ticket_zoom_article_new_internal',
tag: 'boolean',
translate: true,
options: {
true => 'internal',
false => 'public',
},
},
],
},
state: true,
preferences: {
prio: 1,
permission: ['admin.ui'],
},
frontend: true
)
Setting.create_if_not_exists( Setting.create_if_not_exists(
title: 'New User Accounts', title: 'New User Accounts',
name: 'user_create_account', name: 'user_create_account',