From 725e43609ace15138bc7765d2ecac96ccdf178c4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 9 Sep 2014 08:54:05 +0000 Subject: [PATCH] * InfoLog: keep pm link when changing contact --- infolog/inc/class.infolog_ui.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 40e39e0815..a56897db7c 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -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)); } - 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'])) {