From 7ffb10465ecdbd96fc3c3ba9d8df92485f787e62 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 27 Jun 2013 13:02:28 +0200 Subject: blind and attended transfer can be configured for each switchboard. --- app/controllers/switchboards_controller.rb | 4 +++- app/serializers/switchboard_serializer.rb | 2 +- app/views/switchboards/_form_core.html.haml | 4 +++- app/views/switchboards/show.html.erb | 8 ++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/controllers/switchboards_controller.rb b/app/controllers/switchboards_controller.rb index 3e2f8d6..d162a85 100644 --- a/app/controllers/switchboards_controller.rb +++ b/app/controllers/switchboards_controller.rb @@ -19,6 +19,8 @@ class SwitchboardsController < ApplicationController @switchboard.entry_width = 2 @switchboard.reload_interval = 2000 @switchboard.amount_of_displayed_phone_numbers = 1 + @switchboard.blind_transfer_activated = true + @switchboard.attended_transfer_activated = false spread_breadcrumbs end @@ -56,7 +58,7 @@ class SwitchboardsController < ApplicationController private def switchboard_params - params.require(:switchboard).permit(:name, :reload_interval, :show_avatars, :entry_width, :amount_of_displayed_phone_numbers) + params.require(:switchboard).permit(:name, :reload_interval, :show_avatars, :entry_width, :amount_of_displayed_phone_numbers, :blind_transfer_activated, :attended_transfer_activated) end def spread_breadcrumbs diff --git a/app/serializers/switchboard_serializer.rb b/app/serializers/switchboard_serializer.rb index 7c21f82..c1cc0fe 100644 --- a/app/serializers/switchboard_serializer.rb +++ b/app/serializers/switchboard_serializer.rb @@ -1,7 +1,7 @@ class SwitchboardSerializer < ActiveModel::Serializer embed :ids, :include => true - attributes :id, :name + attributes :id, :name, :blind_transfer_activated, :attended_transfer_activated has_many :switchboard_entries has_many :sip_accounts, :through => :switchboard_entries has_many :phone_numbers diff --git a/app/views/switchboards/_form_core.html.haml b/app/views/switchboards/_form_core.html.haml index 2258640..a4fd15f 100644 --- a/app/views/switchboards/_form_core.html.haml +++ b/app/views/switchboards/_form_core.html.haml @@ -3,4 +3,6 @@ = f.input :reload_interval, :label => t('switchboards.form.reload_interval.label'), :hint => conditional_hint('switchboards.form.reload_interval.hint') = f.input :show_avatars, :label => t('switchboards.form.show_avatars.label'), :hint => conditional_hint('switchboards.form.show_avatars.hint') = f.input :entry_width, :label => t('switchboards.form.entry_width.label'), :hint => conditional_hint('switchboards.form.entry_width.hint') - = f.input :amount_of_displayed_phone_numbers, :label => t('switchboards.form.amount_of_displayed_phone_numbers.label'), :hint => conditional_hint('switchboards.form.amount_of_displayed_phone_numbers.hint') \ No newline at end of file + = f.input :amount_of_displayed_phone_numbers, :label => t('switchboards.form.amount_of_displayed_phone_numbers.label'), :hint => conditional_hint('switchboards.form.amount_of_displayed_phone_numbers.hint') + = f.input :blind_transfer_activated, :label => t('switchboards.form.blind_transfer_activated.label'), :hint => conditional_hint('switchboards.form.blind_transfer_activated.hint') + = f.input :attended_transfer_activated, :label => t('switchboards.form.attended_transfer_activated.label'), :hint => conditional_hint('switchboards.form.attended_transfer_activated.hint') diff --git a/app/views/switchboards/show.html.erb b/app/views/switchboards/show.html.erb index 1952a3c..61adde7 100644 --- a/app/views/switchboards/show.html.erb +++ b/app/views/switchboards/show.html.erb @@ -59,8 +59,12 @@ {{#if dispatchableIncomingCalls.length}}

{{#each dispatchableIncomingCall in dispatchableIncomingCalls}} - - + {{#if switchboardEntry.switchboard.blind_transfer_activated}} + + {{/if}} + {{#if switchboardEntry.switchboard.attended_transfer_activated}} + + {{/if}} {{/each}}

{{/if}} -- cgit v1.2.3