|
@ -21,14 +21,19 @@ openerp.base_phone = function (instance) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
var phone_num = this.get('value'); |
|
|
var phone_num = this.get('value'); |
|
|
//console.log('BASE_PHONE phone_num = %s', phone_num);
|
|
|
//console.log('BASE_PHONE phone_num = %s', phone_num);
|
|
|
|
|
|
var href = '#'; |
|
|
|
|
|
var href_text = ''; |
|
|
if (phone_num) { |
|
|
if (phone_num) { |
|
|
this.$el.find('a.oe_form_uri') |
|
|
|
|
|
.attr('href', 'tel:' + phone_num) |
|
|
|
|
|
.text(formatInternational('', phone_num) || ''); |
|
|
|
|
|
|
|
|
href = 'tel:' + phone_num; |
|
|
|
|
|
href_text = formatInternational('', phone_num) || ''; |
|
|
} |
|
|
} |
|
|
|
|
|
this.$el.find('a.oe_form_uri').attr('href', href).text(href_text); |
|
|
|
|
|
var click2dial_text = ''; |
|
|
if (phone_num && !this.options.dial_button_invisible) { |
|
|
if (phone_num && !this.options.dial_button_invisible) { |
|
|
|
|
|
click2dial_text = _t('Dial'); |
|
|
|
|
|
} |
|
|
this.$el.find('#click2dial') |
|
|
this.$el.find('#click2dial') |
|
|
.text(phone_num && _t('Dial') || '') |
|
|
|
|
|
|
|
|
.text(click2dial_text) |
|
|
.on('click', function(ev) { |
|
|
.on('click', function(ev) { |
|
|
self.do_notify( |
|
|
self.do_notify( |
|
|
_t('Click2dial started'), |
|
|
_t('Click2dial started'), |
|
@ -66,7 +71,6 @@ openerp.base_phone = function (instance) { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
on_button_clicked: function() { |
|
|
on_button_clicked: function() { |
|
|
location.href = 'tel:' + this.get('value'); |
|
|
location.href = 'tel:' + this.get('value'); |
|
@ -113,4 +117,4 @@ openerp.base_phone = function (instance) { |
|
|
return res; |
|
|
return res; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}; |