diff --git a/app/assets/javascripts/app/controllers/_channel/email.js.coffee b/app/assets/javascripts/app/controllers/_channel/email.js.coffee index 7764bdb1b..9cc92f9b6 100644 --- a/app/assets/javascripts/app/controllers/_channel/email.js.coffee +++ b/app/assets/javascripts/app/controllers/_channel/email.js.coffee @@ -238,32 +238,35 @@ class App.ChannelEmailAccountOverview extends App.Controller # load assets App.Collection.loadAssets(data.assets) - @render(accounts_fixed: data.accounts_fixed) + @render(data) ) - render: (params = {}) => + render: (data = {}) => # get channels - channels = App.Channel.search( filter: { area: 'Email::Account' } ) - for channel in channels + account_channels = [] + for channel_id in data.account_channel_ids + account_channels.push App.Channel.fullLocal(channel_id) + + for channel in account_channels email_addresses = App.EmailAddress.search( filter: { channel_id: channel.id } ) channel.email_addresses = email_addresses # get all unlinked email addresses - email_addresses_all = App.EmailAddress.all() - email_addresses_not_used = [] - for email_address in email_addresses_all - if !email_address.channel_id || email_address.channel_id is '' - email_addresses_not_used.push email_address + not_used_email_addresses = [] + for email_address_id in data.not_used_email_address_ids + not_used_email_addresses.push App.EmailAddress.find(email_address_id) # get channels - channel = App.Channel.search( filter: { area: 'Email::Notification', active: true } )[0] + notification_channels = [] + for channel_id in data.notification_channel_ids + notification_channels.push App.Channel.find(channel_id) @html App.view('channel/email_account_overview')( - channels: channels - email_addresses_not_used: email_addresses_not_used - channel: channel - accounts_fixed: params.accounts_fixed + account_channels: account_channels + not_used_email_addresses: not_used_email_addresses + notification_channels: notification_channels + accounts_fixed: data.accounts_fixed ) wizard: (e) => diff --git a/app/assets/javascripts/app/models/_application_model.js.coffee b/app/assets/javascripts/app/models/_application_model.js.coffee index a67dd87f4..784ac3e1e 100644 --- a/app/assets/javascripts/app/models/_application_model.js.coffee +++ b/app/assets/javascripts/app/models/_application_model.js.coffee @@ -556,7 +556,8 @@ class App.Model extends Spine.Model item = App[ attribute.relation ]._fillUp(item, classNames.concat(@className)) data[ withoutId ] = item else - console.log("ERROR, cant find #{ attribute.name } App.#{ attribute.relation }.find(#{ data[attribute.name] }) for '#{ data.constructor.className }' #{ data.displayName() }") + if !attribute.do_not_log + console.log("ERROR, cant find #{ attribute.name } App.#{ attribute.relation }.find(#{ data[attribute.name] }) for '#{ data.constructor.className }' #{ data.displayName() }") data ### diff --git a/app/assets/javascripts/app/models/email_address.js.coffee b/app/assets/javascripts/app/models/email_address.js.coffee index 11b114dde..c1d435ed7 100644 --- a/app/assets/javascripts/app/models/email_address.js.coffee +++ b/app/assets/javascripts/app/models/email_address.js.coffee @@ -14,7 +14,7 @@ class App.EmailAddress extends App.Model @configure_attributes = [ { name: 'realname', display: 'Realname', tag: 'input', type: 'text', limit: 250, null: false }, { name: 'email', display: 'Email', tag: 'input', type: 'email', limit: 250, null: false }, - { name: 'channel_id', display: 'Channel', tag: 'select', multiple: false, null: true, relation: 'Channel', nulloption: true, filter: @filterChannel }, + { name: 'channel_id', display: 'Channel', tag: 'select', multiple: false, null: true, relation: 'Channel', nulloption: true, filter: @filterChannel, do_not_log: true }, { name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, null: true }, { name: 'updated_at', display: 'Updated', tag: 'datetime', readonly: 1 }, { name: 'active', display: 'Active', tag: 'active', readonly: 1 }, diff --git a/app/assets/javascripts/app/models/group.js.coffee b/app/assets/javascripts/app/models/group.js.coffee index b7dee1d74..b8690e110 100644 --- a/app/assets/javascripts/app/models/group.js.coffee +++ b/app/assets/javascripts/app/models/group.js.coffee @@ -8,8 +8,8 @@ class App.Group extends App.Model { name: 'assignment_timeout', display: 'Assignment Timeout', tag: 'input', note: 'Assignment timeout in minutes if assigned agent is not working on it. Ticket will be shown as unassigend.', type: 'text', limit: 100, null: true }, { name: 'follow_up_possible', display: 'Follow up possible',tag: 'select', default: 'yes', options: { yes: 'yes', reject: 'reject follow up/do not reopen Ticket', 'new_ticket': 'do not reopen Ticket but create new Ticket' }, null: false, note: 'Follow up for closed ticket possible or not.' }, { name: 'follow_up_assignment', display: 'Assign Follow Ups', tag: 'select', default: 'yes', options: { true: 'yes', false: 'no' }, 'null': false, note: 'Assign follow up to latest agent again.' }, - { name: 'email_address_id', display: 'Email', tag: 'select', multiple: false, null: true, relation: 'EmailAddress', nulloption: true }, - { name: 'signature_id', display: 'Signature', tag: 'select', multiple: false, null: true, relation: 'Signature', nulloption: true }, + { name: 'email_address_id', display: 'Email', tag: 'select', multiple: false, null: true, relation: 'EmailAddress', nulloption: true, do_not_log: true }, + { name: 'signature_id', display: 'Signature', tag: 'select', multiple: false, null: true, relation: 'Signature', nulloption: true, do_not_log: true }, { name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, null: true }, { name: 'updated_at', display: 'Updated', tag: 'datetime', readonly: 1 }, { name: 'active', display: 'Active', tag: 'active', default: true }, diff --git a/app/assets/javascripts/app/views/channel/email_account_overview.jst.eco b/app/assets/javascripts/app/views/channel/email_account_overview.jst.eco index ddd0ff59a..6d80700dd 100644 --- a/app/assets/javascripts/app/views/channel/email_account_overview.jst.eco +++ b/app/assets/javascripts/app/views/channel/email_account_overview.jst.eco @@ -1,6 +1,6 @@
<%- @T('You have no configured account right now.') %>
<% else: %>
<%- @T('State') %>: <%- @T(channel.status_in || 'unknown') %> @@ -82,7 +82,7 @@ <%- @T('New') %> -<% if @channel && !App.Config.get('system_online_service'): %> +<% if !_.isEmpty(@notification_channels) && !App.Config.get('system_online_service'): %> <%- @T('Notification Account') %>
|