ability to activate phonenumbers in the addressbook list (index), configuration has to be done via the source at the moment (beginning of class.uicontact.inc.php)

This commit is contained in:
Ralf Becker 2006-04-30 18:03:06 +00:00
parent c019eda361
commit 374f4eba24
3 changed files with 89 additions and 10 deletions

View File

@ -40,6 +40,8 @@ class uicontacts extends bocontacts
var $private_addressbook = false; var $private_addressbook = false;
var $org_views; var $org_views;
// var $config = array('call_link'=>'skype:%1?call','call_popup'=>''); // popup wxh, eg. 640x480
function uicontacts($contact_app='addressbook') function uicontacts($contact_app='addressbook')
{ {
$this->bocontacts($contact_app); $this->bocontacts($contact_app);
@ -489,12 +491,13 @@ class uicontacts extends bocontacts
static $tel2show = array('tel_work','tel_cell','tel_home'); static $tel2show = array('tel_work','tel_cell','tel_home');
foreach($tel2show as $name) foreach($tel2show as $name)
{ {
$this->call_link($row[$name],$row[$name.'_link']);
$row[$name] .= ' '.($row['tel_prefer'] == $name ? '♥' : ''); // .' ' to NOT remove the field $row[$name] .= ' '.($row['tel_prefer'] == $name ? '♥' : ''); // .' ' to NOT remove the field
} }
// allways show the prefered phone, if not already shown // allways show the prefered phone, if not already shown
if (!in_array($row['tel_prefer'],$tel2show) && $row[$row['tel_prefer']]) if (!in_array($row['tel_prefer'],$tel2show) && $row[$row['tel_prefer']])
{ {
$this->call_link($row[$row['tel_prefer']],$row['tel_prefered_link']);
$row['tel_prefered'] = $row[$row['tel_prefer']].' ♥'; $row['tel_prefered'] = $row[$row['tel_prefer']].' ♥';
} }
foreach(array('email','email_home') as $name) foreach(array('email','email_home') as $name)
@ -541,7 +544,7 @@ class uicontacts extends bocontacts
if ($homeaddress && !$this->prefs['home_column'] || $this->prefs['home_column'] == 'always') $rows['show_home'] = '1'; if ($homeaddress && !$this->prefs['home_column'] || $this->prefs['home_column'] == 'always') $rows['show_home'] = '1';
$rows['order'] = $order; $rows['order'] = $order;
$rows['call_popup'] = $this->config['call_popup'];
$rows['customfields'] = array_values($this->customfields); $rows['customfields'] = array_values($this->customfields);
// full app-header with all search criteria specially for the print // full app-header with all search criteria specially for the print
@ -1147,6 +1150,9 @@ $readonlys['button[vcard]'] = true;
return $this->tmpl->exec('addressbook.uicontacts.search',$content,$sel_options,$readonlys,$preserv); return $this->tmpl->exec('addressbook.uicontacts.search',$content,$sel_options,$readonlys,$preserv);
} }
/**
* download photo of the given ($_GET['contact_id'] or $_GET['account_id']) contact
*/
function photo() function photo()
{ {
ob_start(); ob_start();
@ -1170,6 +1176,20 @@ $readonlys['button[vcard]'] = true;
} }
} }
/**
* returns link to call the given phonenumer
*
* @param string $number phone number
* @param string &$link returns the link
* @return boolean true if we have a link, false if not
*/
function call_link($number,&$link)
{
if (!$number || !$this->config['call_link']) return false;
$link = str_replace('%1',$number,$this->config['call_link']);
}
function js() function js()
{ {
return '<script LANGUAGE="JavaScript"> return '<script LANGUAGE="JavaScript">

File diff suppressed because one or more lines are too long

View File

@ -113,10 +113,10 @@
<description id="${row}[adr_two_street2]" no_lang="1"/> <description id="${row}[adr_two_street2]" no_lang="1"/>
</vbox> </vbox>
<vbox orient=",0,0"> <vbox orient=",0,0">
<description no_lang="1" id="${row}[tel_work]" class="telNumbers"/> <description no_lang="1" id="${row}[tel_work]" class="telNumbers" options=",$row_cont[tel_work_link],,,,$row_cont[call_popup]"/>
<description id="${row}[tel_cell]" no_lang="1" class="telNumbers"/> <description id="${row}[tel_cell]" no_lang="1" class="telNumbers" options=",$row_cont[tel_cell_link],,,,$row_cont[call_popup]"/>
<description id="${row}[tel_home]" no_lang="1" class="telNumbers"/> <description id="${row}[tel_home]" no_lang="1" class="telNumbers" options=",$row_cont[tel_home_link],,,,$row_cont[call_popup]"/>
<description id="${row}[tel_prefered]" no_lang="1"/> <description id="${row}[tel_prefered]" no_lang="1" options=",$row_cont[tel_prefered_link],,,,$row_cont[call_popup]"/>
</vbox> </vbox>
<vbox orient=",0,0"> <vbox orient=",0,0">
<description options=",,1" class="fixedHeight" no_lang="1" id="${row}[url]"/> <description options=",,1" class="fixedHeight" no_lang="1" id="${row}[url]"/>