mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Fix contact can't be cleared
This commit is contained in:
parent
b91560f79c
commit
4d88ec8445
@ -1044,36 +1044,39 @@ class infolog_bo
|
||||
protected function write_check_links(&$values)
|
||||
{
|
||||
$old_link_id = (int)$values['info_link_id'];
|
||||
if(is_array($values['info_contact']))
|
||||
if($values['info_contact'])
|
||||
{
|
||||
// eTemplate2 returns the array all ready
|
||||
$app = $values['info_contact']['app'];
|
||||
$id = $values['info_contact']['id'];
|
||||
}
|
||||
else if ($values['info_contact'])
|
||||
{
|
||||
list($app, $id) = explode(':', $values['info_contact'], 2);
|
||||
}
|
||||
// if project has been removed, but is still info_contact --> also remove it
|
||||
if ($app == 'projectmanager' && $id && $id == $values['old_pm_id'] && !$values['pm_id'])
|
||||
{
|
||||
unset($values['info_link_id'], $id, $values['info_contact']['id']);
|
||||
}
|
||||
elseif ($app && $id)
|
||||
{
|
||||
if(!is_array($values['link_to']))
|
||||
if(is_array($values['info_contact']))
|
||||
{
|
||||
$values['link_to'] = array();
|
||||
// eTemplate2 returns the array all ready
|
||||
$app = $values['info_contact']['app'];
|
||||
$id = $values['info_contact']['id'];
|
||||
}
|
||||
else if ($values['info_contact'])
|
||||
{
|
||||
list($app, $id) = explode(':', $values['info_contact'], 2);
|
||||
}
|
||||
// if project has been removed, but is still info_contact --> also remove it
|
||||
if ($app == 'projectmanager' && $id && $id == $values['old_pm_id'] && !$values['pm_id'])
|
||||
{
|
||||
unset($values['info_link_id'], $id, $values['info_contact']['id']);
|
||||
}
|
||||
elseif ($app && $id)
|
||||
{
|
||||
if(!is_array($values['link_to']))
|
||||
{
|
||||
$values['link_to'] = array();
|
||||
}
|
||||
$values['info_link_id'] = (int)($info_link_id = Link::link(
|
||||
'infolog',
|
||||
$values['info_id'],
|
||||
$app,$id
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($values['info_link_id']);
|
||||
}
|
||||
$values['info_link_id'] = (int)($info_link_id = Link::link(
|
||||
'infolog',
|
||||
$values['info_id'],
|
||||
$app,$id
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($values['info_link_id']);
|
||||
}
|
||||
if ($old_link_id && $old_link_id != $values['info_link_id'])
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user