Hello, i have modified the show.inc file for append the support for tel://url in addressbook. If you want add the modification to your code, it's ok for me.
Cheers,
--- old/program/steps/addressbook/show.inc +++ new/program/steps/addressbook/show.inc
@@ -137,7 +137,7 @@ 'name' => rcube_label('properties'), 'content' => array( 'email' => array('size' => $i_size, 'render_func' => 'rcmail_render_email_value'),
'phone' => array('size' => $i_size),
'phone' => array('size' => $i_size, 'render_func' =>
'rcmail_render_tel_value'), 'address' => array(), 'website' => array('size' => $i_size, 'render_func' => 'rcmail_render_url_value'), 'im' => array('size' => $i_size), @@ -187,6 +187,14 @@ ), Q($email)); }
+function rcmail_render_tel_value($tel, $col) +{
'href' => 'tel:' . $tel,
'class' => 'tel',
+}
function rcmail_render_url_value($url, $col) {
+1
Please add it to Roundcube 1.0-RC/stable. It is really useful for mobile devices or VOIP calls on desktop computers. IMO all non-numeric characters except the leading + should be stripped off to receive urls like ...
<a href="tel:+31123456789">[Unformatted as it is in the addressbook]</a>
Also leading '00' should be replaced by '+' in the formatting function.
Hello, i have modified the show.inc file for append the support for tel://url in addressbook. If you want add the modification to your code, it's ok for me.
Cheers,
--- old/program/steps/addressbook/show.inc +++ new/program/steps/addressbook/show.inc
@@ -137,7 +137,7 @@ 'name' => rcube_label('properties'), 'content' => array( 'email' => array('size' => $i_size, 'render_func' => 'rcmail_render_email_value'),
'phone' => array('size' => $i_size),
'phone' => array('size' => $i_size, 'render_func' =>
'rcmail_render_tel_value'), 'address' => array(), 'website' => array('size' => $i_size, 'render_func' => 'rcmail_render_url_value'), 'im' => array('size' => $i_size), @@ -187,6 +187,14 @@ ), Q($email)); }
+function rcmail_render_tel_value($tel, $col) +{
- return html::a(array(
'href' => 'tel:' . $tel,
'class' => 'tel',
- ), Q($tel));
+}
function rcmail_render_url_value($url, $col) {
And except a # and * too.
Le 2013-12-13 8:18, Rosali a écrit :
+1
Please add it to Roundcube 1.0-RC/stable. It is really useful for mobile devices or VOIP calls on desktop computers. IMO all non-numeric characters except the leading + should be stripped off to receive urls like ...
<a href="tel:+31123456789">[Unformatted as it is in the addressbook]</a>
Also leading '00' should be replaced by '+' in the formatting function.
Hello, i have modified the show.inc file for append the support for tel://url in addressbook. If you want add the modification to your code, it's ok for me. Cheers, --- old/program/steps/addressbook/show.inc +++ new/program/steps/addressbook/show.inc @@ -137,7 +137,7 @@ 'name' => rcube_label('properties'), 'content' => array( 'email' => array('size' => $i_size, 'render_func' => 'rcmail_render_email_value'),
'phone' => array('size' => $i_size),
'phone' => array('size' => $i_size, 'render_func' =>
'rcmail_render_tel_value'), 'address' => array(), 'website' => array('size' => $i_size, 'render_func' => 'rcmail_render_url_value'), 'im' => array('size' => $i_size), @@ -187,6 +187,14 @@ ), Q($email)); } +function rcmail_render_tel_value($tel, $col) +{
- return html::a(array(
'href' => 'tel:' . $tel,
'class' => 'tel',
- ), Q($tel));
+}
function rcmail_render_url_value($url, $col) {
Roundcube Development discussion mailing list dev@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/dev
On 12/15/2013 05:40 AM, nyx-network wrote:
And except a # and * too.
RFC 3966 specifies the format.
Am 15.12.2013 08:58, schrieb A.L.E.C:
On 12/15/2013 05:40 AM, nyx-network wrote:
And except a # and * too.
RFC 3966 specifies the format.
This is my function to format tel urls. It should be RFC 3966 compliant:
function rcmail_render_tel_value($tel, $col) { $tel_formatted = $tel; $tel_formatted = str_replace('(0)', '', $tel_formatted); if(substr($tel, 0, 1) == '+'){ $tel_formatted = '00' . substr($tel_formatted, 1); } else{ $tel_formatted = $tel; } $tel_formatted = preg_replace('/[^0-9 -/]+/', '', $tel_formatted); if(substr($tel_formatted, 0, 2) == '00'){ $tel_formatted = '+' . substr($tel_formatted, 2); } $tel_formatted = str_replace(array('-', '/', ' '), array('-', '-', '-'), $tel_formatted); return html::a(array( 'href' => 'tel:' . $tel_formatted, 'class' => 'tel', ), Q($tel)); }