Keep pm link when changing contact

This commit is contained in:
Nathan Gray 2014-09-08 21:24:25 +00:00
parent 4031e2b5a1
commit 1b0cefe5f2

View File

@ -1680,7 +1680,15 @@ class infolog_ui
} }
$content['info_link_id'] = (int)($info_link_id = egw_link::link('infolog',$content['link_to']['to_id'],$app,$id)); $content['info_link_id'] = (int)($info_link_id = egw_link::link('infolog',$content['link_to']['to_id'],$app,$id));
} }
if ($old_link_id && $old_link_id != $content['info_link_id']) egw_link::unlink($old_link_id); if ($old_link_id && $old_link_id != $content['info_link_id'])
{
$link = egw_link::get_link($old_link_id);
// Keep projectmanager link if it's the same project as before
if(!($link['link_app2'] == 'projectmanager' && $link['link_id2'] == $content['old_pm_id']))
{
egw_link::unlink($old_link_id);
}
}
} }
if (is_array($content['link_to']['to_id']) && count($content['link_to']['to_id'])) if (is_array($content['link_to']['to_id']) && count($content['link_to']['to_id']))
{ {