mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
- activating email(_home) and url in view
- using felamimail as default over email
This commit is contained in:
parent
e43a0ddf3f
commit
2ea764e672
@ -548,8 +548,6 @@
|
||||
$myowner = $entries[$i]['owner'];
|
||||
|
||||
/* each entry column */
|
||||
// @reset($columns_to_display);
|
||||
// while($column = @each($columns_to_display))
|
||||
foreach($columns_to_display as $column => $nul)
|
||||
{
|
||||
$ref = $data='';
|
||||
@ -562,32 +560,16 @@
|
||||
{
|
||||
$coldata = 'http://' . $coldata;
|
||||
}
|
||||
$ref='<a href="'.$coldata.'" target="_new">';
|
||||
$ref='<a href="'.$coldata.'" target="_blank">';
|
||||
$data=$coldata.'</a>';
|
||||
}
|
||||
elseif(($column == 'email') || ($column == 'email_home'))
|
||||
elseif(($column == 'email' || $column == 'email_home') && strstr($coldata,'@'))
|
||||
{
|
||||
if($GLOBALS['egw_info']['user']['apps']['email'])
|
||||
{
|
||||
$ref = '<a href="'
|
||||
. $GLOBALS['egw']->link('/email/compose.php','to=' . urlencode($coldata))
|
||||
. '" target="_new">';
|
||||
}
|
||||
elseif($GLOBALS['egw_info']['user']['apps']['felamimail'])
|
||||
{
|
||||
$link_data = array(
|
||||
'menuaction' => 'felamimail.uicompose.compose',
|
||||
'send_to' => base64_encode($coldata)
|
||||
);
|
||||
$ref = '<a href="'
|
||||
. $GLOBALS['egw']->link('/index.php',$link_data)
|
||||
. '" target="_new">';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ref = '<a href="mailto:' . $coldata . '">';
|
||||
}
|
||||
$data = $coldata . '</a>';
|
||||
$link = $this->email2link($coldata);
|
||||
if (is_array($link)) $link = $GLOBALS['egw']->link('/index.php',$link);
|
||||
|
||||
$ref = '<a href="'.htmlspecialchars($link).'" target="_blank">';
|
||||
$data = $coldata.'</a>';
|
||||
}
|
||||
else /* But these do not */
|
||||
{
|
||||
@ -646,6 +628,33 @@
|
||||
/* $GLOBALS['egw']->common->phpgw_footer(); */
|
||||
}
|
||||
|
||||
/**
|
||||
* convert email-address in compose link
|
||||
*
|
||||
* @param string $email email-addresse
|
||||
* @return array/string array with get-params or mailto:$email, or '' or no mail addresse
|
||||
*/
|
||||
function email2link($email)
|
||||
{
|
||||
if (!strstr($email,'@')) return '';
|
||||
|
||||
if($GLOBALS['egw_info']['user']['apps']['felamimail'])
|
||||
{
|
||||
return array(
|
||||
'menuaction' => 'felamimail.uicompose.compose',
|
||||
'send_to' => base64_encode($email)
|
||||
);
|
||||
}
|
||||
if($GLOBALS['egw_info']['user']['apps']['email'])
|
||||
{
|
||||
return array(
|
||||
'menuaction' => 'email.uicompose.compose',
|
||||
'to' => $email,
|
||||
);
|
||||
}
|
||||
return 'mailto:' . $email;
|
||||
}
|
||||
|
||||
function add_email()
|
||||
{
|
||||
$name = $_POST['name'] ? $_POST['name'] : $_GET['name'];
|
||||
|
@ -196,6 +196,24 @@ class uicontacts extends bocontacts
|
||||
$readonlys['button[edit]'] = !$this->check_perms(EGW_ACL_EDIT,$content);
|
||||
|
||||
$this->tmpl->read('addressbook.edit');
|
||||
foreach(array('email','email_home','url') as $name)
|
||||
{
|
||||
if ($content[$name] )
|
||||
{
|
||||
$url = $name == 'url' ? $content[$name] : $this->email2link($content[$name]);
|
||||
if (!is_array($url))
|
||||
{
|
||||
$this->tmpl->set_cell_attribute($name,'size','b,,1');
|
||||
}
|
||||
elseif ($url)
|
||||
{
|
||||
$content[$name.'_link'] = $url;
|
||||
$this->tmpl->set_cell_attribute($name,'size','b,@'.$name.'_link,,,_blank');
|
||||
}
|
||||
$this->tmpl->set_cell_attribute($name,'type','label');
|
||||
$this->tmpl->set_cell_attribute($name,'no_lang',true);
|
||||
}
|
||||
}
|
||||
$this->tmpl->exec('addressbook.uicontacts.view',$content,$sel_options,$readonlys,array('id' => $content['id']));
|
||||
|
||||
$GLOBALS['egw']->hooks->process(array(
|
||||
@ -204,6 +222,33 @@ class uicontacts extends bocontacts
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* convert email-address in compose link
|
||||
*
|
||||
* @param string $email email-addresse
|
||||
* @return array/string array with get-params or mailto:$email, or '' or no mail addresse
|
||||
*/
|
||||
function email2link($email)
|
||||
{
|
||||
if (!strstr($email,'@')) return '';
|
||||
|
||||
if($GLOBALS['egw_info']['user']['apps']['felamimail'])
|
||||
{
|
||||
return array(
|
||||
'menuaction' => 'felamimail.uicompose.compose',
|
||||
'send_to' => base64_encode($email)
|
||||
);
|
||||
}
|
||||
if($GLOBALS['egw_info']['user']['apps']['email'])
|
||||
{
|
||||
return array(
|
||||
'menuaction' => 'email.uicompose.compose',
|
||||
'to' => $email,
|
||||
);
|
||||
}
|
||||
return 'mailto:' . $email;
|
||||
}
|
||||
|
||||
function search($content='')
|
||||
{
|
||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('Addressbook'). ' - '. lang('Advanced search');
|
||||
|
Loading…
Reference in New Issue
Block a user