summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMario "Kuroir" Ricalde <kuroir@gmail.com>2013-02-13 05:39:43 -0600
committerMario "Kuroir" Ricalde <kuroir@gmail.com>2013-02-13 05:39:43 -0600
commitc2aad881ff34ce544b24847279472448917f38e1 (patch)
tree4b42aa65165f9adcc8e113a20cd141866cb09758 /app
parent791bf973b02b626f876b7e5819e2037dcff90f84 (diff)
parent1776a5b243aa7b62eff09319e2f766426307e220 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app')
-rw-r--r--app/controllers/config_snom_controller.rb47
-rw-r--r--app/models/fax_document.rb4
-rw-r--r--app/models/sip_account.rb4
-rw-r--r--app/models/softkey.rb8
-rw-r--r--app/views/config_snom/show.xml.haml4
5 files changed, 35 insertions, 32 deletions
diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb
index 58cced2..d36f990 100644
--- a/app/controllers/config_snom_controller.rb
+++ b/app/controllers/config_snom_controller.rb
@@ -282,28 +282,31 @@ class ConfigSnomController < ApplicationController
@softkeys.push({:context => sip_account_index, :label => softkey.label, :data => "speed f-li-#{softkey.number}"})
when 'conference'
@softkeys.push({:context => sip_account_index, :label => softkey.label, :data => "blf <sip:#{softkey.number}@#{sip_account.host}>|f-ta-"})
- when 'call_parking'
- @softkeys.push({
- :context => sip_account_index,
- :function => softkey.softkey_function.name,
- :label => softkey.label,
- :softkey => softkey,
- :general_type => t("softkeys.functions.#{softkey.softkey_function.name}"),
- :subscription => {
- :to => "park+#{@softkeys.softkeyable_id}@#{sip_account.host}",
- :for => "#{sip_account.auth_name}@#{sip_account.host}"
- },
- :actions => [{
- :type => :dial,
- :target => "f-tpark-#{@softkeys.softkeyable_id}",
- :when => 'on press',
- :states => 'connected,holding',
- },{
- :type => :dial,
- :target => "f-park-#{@softkeys.softkeyable_id}",
- :when => 'on press',
- }],
- })
+ when 'parking_stall'
+ parking_stall = softkey.softkeyable
+ if parking_stall.class == ParkingStall
+ @softkeys.push({
+ :context => sip_account_index,
+ :function => softkey.softkey_function.name,
+ :label => softkey.label,
+ :softkey => softkey,
+ :general_type => t("softkeys.functions.#{softkey.softkey_function.name}"),
+ :subscription => {
+ :to => "park+#{parking_stall.name}@#{sip_account.host}",
+ :for => "#{sip_account.auth_name}@#{sip_account.host}"
+ },
+ :actions => [{
+ :type => :dial,
+ :target => "f-cpa-#{parking_stall.name}",
+ :when => 'on press',
+ :states => 'connected,holding',
+ },{
+ :type => :dial,
+ :target => "f-cpa-#{parking_stall.name}",
+ :when => 'on press',
+ }],
+ })
+ end
when 'call_forwarding'
if softkey.softkeyable.class == CallForward then
@softkeys.push({
diff --git a/app/models/fax_document.rb b/app/models/fax_document.rb
index be689e2..16fdc70 100644
--- a/app/models/fax_document.rb
+++ b/app/models/fax_document.rb
@@ -48,10 +48,6 @@ class FaxDocument < ActiveRecord::Base
end
end
- def to_s
- name
- end
-
def render_thumbnails
directory = "/tmp/GS-#{GsParameter.get('GEMEINSCHAFT_VERSION')}/fax_thumbnails/#{self.id}"
system('mkdir -p ' + directory)
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 9ba1f8b..7df8e3b 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -6,7 +6,7 @@ class SipAccount < ActiveRecord::Base
attr_accessible :auth_name, :caller_name, :password, :voicemail_pin,
:tenant_id, :call_waiting, :clir, :clip_no_screening,
:clip, :description, :callforward_rules_act_per_sip_account,
- :hotdeskable, :gs_node_id
+ :hotdeskable, :gs_node_id, :language_code
# Associations:
#
@@ -31,6 +31,8 @@ class SipAccount < ActiveRecord::Base
belongs_to :gs_node
+ belongs_to :language, :foreign_key => 'language_code', :primary_key => 'code'
+
# Delegations:
#
delegate :host, :to => :sip_domain, :allow_nil => true
diff --git a/app/models/softkey.rb b/app/models/softkey.rb
index 83c88ab..4b758e0 100644
--- a/app/models/softkey.rb
+++ b/app/models/softkey.rb
@@ -48,14 +48,14 @@ class Softkey < ActiveRecord::Base
end
def to_s
- if (['call_forwarding'].include?(self.softkey_function.name))
- "#{self.softkeyable}"
- else
+ if self.softkeyable.blank?
if ['log_out', 'log_in'].include?(self.softkey_function.name)
I18n.t("softkeys.functions.#{self.softkey_function.name}")
else
- "#{self.softkey_function.name} : #{self.number.to_s}"
+ "#{self.softkey_function.name} : #{self.number.to_s}"
end
+ else
+ "#{self.softkeyable}"
end
end
diff --git a/app/views/config_snom/show.xml.haml b/app/views/config_snom/show.xml.haml
index 33204dc..1102ad1 100644
--- a/app/views/config_snom/show.xml.haml
+++ b/app/views/config_snom/show.xml.haml
@@ -176,7 +176,9 @@
%action
- softkey[:actions].each do |action|
- if action[:type] == :url
- %url{:target => action[:target], :when => action[:when]}
+ %url{:target => action[:target], :when => action[:when], :states => action[:states]}
+ - elsif action[:type] == :dial
+ %dial{:target => action[:target], :when => action[:when], :states => action[:states], :request_uri => '$(remote_uri)'}
%uploads
- if @state_settings_url