diff --git a/infolog/inc/class.boinfolog.inc.php b/infolog/inc/class.boinfolog.inc.php index 0ae8bda44f..2dbb83b35b 100644 --- a/infolog/inc/class.boinfolog.inc.php +++ b/infolog/inc/class.boinfolog.inc.php @@ -37,7 +37,7 @@ 'attached_local' => True, 'link_title' => True, 'link_query' => True, - 'link_id2title' => True + 'link_id2from' => True ); var $enums; var $so; @@ -129,8 +129,9 @@ $this->so->init(); } - function link_id2title(&$info,$not_app='',$not_id='') + function link_id2from(&$info,$not_app='',$not_id='') { + //echo "
boinfolog::link_id2title(subject='$info[info_subject]', link_id='$info[info_link_id], from='$info[info_from]')"; if ($info['info_link_id'] > 0 && ($link = $this->link->get_link($info['info_link_id'])) !== False) { @@ -149,6 +150,7 @@ $info['info_link_view'] = $this->link->view($link['link_app'.$nr],$link['link_id'.$nr]); $info['info_from'] = $info['info_link_title'] = $title; } + //echo " title='$title'
\n"; return $title; } return False; diff --git a/infolog/inc/class.uiinfolog.inc.php b/infolog/inc/class.uiinfolog.inc.php index c8b9fa6a41..d3db4b2fae 100644 --- a/infolog/inc/class.uiinfolog.inc.php +++ b/infolog/inc/class.uiinfolog.inc.php @@ -96,7 +96,7 @@ } $info['info_des'] = nl2br($info['info_des']); $info['info_anz_subs'] = $this->bo->anzSubs($id); - $this->bo->link_id2title(&$info,$action,$action_id); + $this->bo->link_id2from($info,$action,$action_id); $readonlys["edit[$id]"] = !$this->bo->check_access($id,PHPGW_ACL_EDIT); $readonlys["delete[$id]"] = !$this->bo->check_access($id,PHPGW_ACL_DELETE); @@ -281,21 +281,30 @@ { if ($content['save'] && (!$info_id || $this->bo->check_access($info_id,PHPGW_ACL_EDIT))) { + if (strstr($content['info_link_id'],':') !== False) + { + $info_link_id = $content['info_link_id']; + $content['info_link_id'] = 0; // as field has to be int + } + if ($content['info_link_id'] && empty($content['info_from'])) + { + $this->bo->link_id2from($content); + } $this->bo->write($content); if (!$info_id && is_array($content['link_to']['to_id'])) // writing link for new entry { $content['info_id'] = $this->bo->so->data['info_id']; $this->link->link('infolog',$content['info_id'],$content['link_to']['to_id']); - if (strstr($content['info_link_id'],':') !== False) + if ($info_link_id) { - list($app,$id) = explode(':',$content['info_link_id']); + list($app,$id) = explode(':',$info_link_id); $link = $this->link->get_link('infolog',$content['info_id'],$app,$id); $content['info_link_id'] = $link['link_id']; - if ($content['info_from'] == '') + if (empty($content['info_from'])) { - $content['info_from'] = $this->bo->link_id2title($content); + $this->bo->link_id2from($content); } $this->bo->write(array( 'info_id' => $content['info_id'],