summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-02-19 09:30:47 +0100
committerspag <spag@golwen.net>2013-02-19 09:30:47 +0100
commitde845aa642e22b0ae08c5ce991bcdef9b656e079 (patch)
tree170279abe05208997a7105d8da2f059921baee24 /app
parent5a0f267435fe3c11414d4aee9f896723a61a0fc2 (diff)
phone number name tag
Diffstat (limited to 'app')
-rw-r--r--app/models/phone_book_entry.rb2
-rw-r--r--app/views/phone_numbers/_form_core.html.haml2
2 files changed, 3 insertions, 1 deletions
diff --git a/app/models/phone_book_entry.rb b/app/models/phone_book_entry.rb
index 275c7b6..96c8468 100644
--- a/app/models/phone_book_entry.rb
+++ b/app/models/phone_book_entry.rb
@@ -1,6 +1,8 @@
# encoding: UTF-8
class PhoneBookEntry < ActiveRecord::Base
+ PHONE_NUMBER_NAMES = ['Phone', 'Office', 'Home', 'Mobile', 'Fax']
+
before_save :run_phonetic_algorithm
before_save :save_value_of_to_s
diff --git a/app/views/phone_numbers/_form_core.html.haml b/app/views/phone_numbers/_form_core.html.haml
index a0a69db..1589e7e 100644
--- a/app/views/phone_numbers/_form_core.html.haml
+++ b/app/views/phone_numbers/_form_core.html.haml
@@ -1,7 +1,7 @@
.inputs
- if @phone_book_entry
- = f.input :name, :collection => ['Office', 'Home', 'Mobile', 'Fax'], :include_blank => false, :label => t('phone_numbers.form.name.label'), :hint => conditional_hint('phone_numbers.form.name.hint')
+ = f.input :name, :collection => PhoneBookEntry::PHONE_NUMBER_NAMES, :include_blank => false, :label => t('phone_numbers.form.name.label'), :hint => conditional_hint('phone_numbers.form.name.hint')
= f.input :number, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint'), :autofocus => true
- else
- if @callthrough || @hunt_group_member || @access_authorization || current_user.current_tenant.array_of_available_internal_extensions_and_dids.count == 0 || current_user.current_tenant.array_of_available_internal_extensions_and_dids.count > 250