From bdd45ee90978f6dc54daa710488bb70a0d15d483 Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 15 Dec 2016 10:24:14 -0700 Subject: [PATCH] Fix bug in linking infologs copied by projectmanager causing doubles --- infolog/inc/class.infolog_bo.inc.php | 6 +++++- infolog/inc/class.infolog_datasource.inc.php | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/infolog/inc/class.infolog_bo.inc.php b/infolog/inc/class.infolog_bo.inc.php index cc525410e1..2657b195e3 100644 --- a/infolog/inc/class.infolog_bo.inc.php +++ b/infolog/inc/class.infolog_bo.inc.php @@ -1050,6 +1050,10 @@ class infolog_bo $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']) { @@ -1493,7 +1497,7 @@ class infolog_bo $query = array( 'col_filter' => array('info_id' => $args['infolog']), 'subs' => true, - 'cols' => 'info_id,info_type,info_status,info_percent,info_id_parent', + 'cols' => 'egw_infolog.info_id,info_type,info_status,info_percent,info_id_parent', ); $infos = array(); foreach($this->search($query) as $row) diff --git a/infolog/inc/class.infolog_datasource.inc.php b/infolog/inc/class.infolog_datasource.inc.php index 81ea0ec15a..8f3b890f0c 100644 --- a/infolog/inc/class.infolog_datasource.inc.php +++ b/infolog/inc/class.infolog_datasource.inc.php @@ -115,6 +115,7 @@ class infolog_datasource extends datasource { $this->infolog_bo->link_id2from($info); // unsets info_from and sets info_link_target unset($info['info_link_id']); + unset($info['info_contact']); } // we need to unset a view fields, to get a new entry foreach(array('info_id','info_owner','info_modified','info_modifierer') as $key) @@ -158,7 +159,7 @@ class infolog_datasource extends datasource if(!($info['info_id'] = $this->infolog_bo->write($info))) return false; // link the new infolog against the project and setting info_link_id and evtl. info_from - $old_link = $info['info_link_id'] ? Link::get_link($info['info_link']) : $info['info_link']; + $old_link = $info['info_link_id'] ? Link::get_link($info['info_link_id']) : $info['info_link']; $info['info_link_id'] = Link::link('projectmanager',$target,'infolog',$info['info_id'],$element['pe_remark'],0,0,1); if (!$info['info_from'] || $old_link && $info['info_from'] == $old_link['title']) {