mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-16 10:21:23 +01:00
Fix bug in linking infologs copied by projectmanager causing doubles
This commit is contained in:
parent
1e4ac003a2
commit
bdd45ee909
@ -1050,6 +1050,10 @@ class infolog_bo
|
|||||||
$app = $values['info_contact']['app'];
|
$app = $values['info_contact']['app'];
|
||||||
$id = $values['info_contact']['id'];
|
$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 project has been removed, but is still info_contact --> also remove it
|
||||||
if ($app == 'projectmanager' && $id && $id == $values['old_pm_id'] && !$values['pm_id'])
|
if ($app == 'projectmanager' && $id && $id == $values['old_pm_id'] && !$values['pm_id'])
|
||||||
{
|
{
|
||||||
@ -1493,7 +1497,7 @@ class infolog_bo
|
|||||||
$query = array(
|
$query = array(
|
||||||
'col_filter' => array('info_id' => $args['infolog']),
|
'col_filter' => array('info_id' => $args['infolog']),
|
||||||
'subs' => true,
|
'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();
|
$infos = array();
|
||||||
foreach($this->search($query) as $row)
|
foreach($this->search($query) as $row)
|
||||||
|
@ -115,6 +115,7 @@ class infolog_datasource extends datasource
|
|||||||
{
|
{
|
||||||
$this->infolog_bo->link_id2from($info); // unsets info_from and sets info_link_target
|
$this->infolog_bo->link_id2from($info); // unsets info_from and sets info_link_target
|
||||||
unset($info['info_link_id']);
|
unset($info['info_link_id']);
|
||||||
|
unset($info['info_contact']);
|
||||||
}
|
}
|
||||||
// we need to unset a view fields, to get a new entry
|
// we need to unset a view fields, to get a new entry
|
||||||
foreach(array('info_id','info_owner','info_modified','info_modifierer') as $key)
|
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;
|
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
|
// 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);
|
$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'])
|
if (!$info['info_from'] || $old_link && $info['info_from'] == $old_link['title'])
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user