mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Fix contact not saved properly for new entries
This commit is contained in:
parent
88a72fbdc7
commit
81421f8195
@ -423,7 +423,7 @@ class infolog_bo
|
|||||||
*/
|
*/
|
||||||
function link_id2from(&$info,$not_app='',$not_id='')
|
function link_id2from(&$info,$not_app='',$not_id='')
|
||||||
{
|
{
|
||||||
//echo "<p>boinfolog::link_id2from(subject='$info[info_subject]', link_id='$info[info_link_id]', from='$info[info_from]', not_app='$not_app', not_id='$not_id')";
|
//error_log(__METHOD__ . "(subject='{$info['info_subject']}', link_id='{$info['info_link_id']}', from='{$info['info_from']}', not_app='$not_app', not_id='$not_id')");
|
||||||
|
|
||||||
if ($info['info_link_id'] > 0 &&
|
if ($info['info_link_id'] > 0 &&
|
||||||
(isset($info['links']) && ($link = $info['links'][$info['info_link_id']]) || // use supplied links info
|
(isset($info['links']) && ($link = $info['links'][$info['info_link_id']]) || // use supplied links info
|
||||||
@ -955,6 +955,8 @@ class infolog_bo
|
|||||||
$this->write_check_links($to_write);
|
$this->write_check_links($to_write);
|
||||||
if(!$values['info_link_id'] && $to_write['info_link_id'])
|
if(!$values['info_link_id'] && $to_write['info_link_id'])
|
||||||
{
|
{
|
||||||
|
// Just got a link ID, need to save it
|
||||||
|
$this->so->write($to_write);
|
||||||
$values['info_link_id'] = $to_write['info_link_id'];
|
$values['info_link_id'] = $to_write['info_link_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,15 +233,22 @@ class infolog_tracking extends Api\Storage\Tracking
|
|||||||
) as $name => $value)
|
) as $name => $value)
|
||||||
{
|
{
|
||||||
//error_log(__METHOD__.__LINE__.' Key:'.$name.' val:'.array2string($value));
|
//error_log(__METHOD__.__LINE__.' Key:'.$name.' val:'.array2string($value));
|
||||||
if ($name=='info_from' && empty($value) && !empty($data['info_contact']) && is_array($data['link_to']['to_id']))
|
if ($name=='info_from' && empty($value))
|
||||||
{
|
if(!empty($data['info_contact']) && is_array($data['link_to']['to_id']))
|
||||||
$lkeys = array_keys($data['link_to']['to_id']);
|
|
||||||
if (in_array($data['info_contact'],$lkeys))
|
|
||||||
{
|
{
|
||||||
|
$lkeys = array_keys($data['link_to']['to_id']);
|
||||||
|
if (in_array($data['info_contact'],$lkeys))
|
||||||
|
{
|
||||||
|
list($app,$id) = explode(':',$data['info_contact']);
|
||||||
|
if (!empty($app)&&!empty($id)) $value = Link::title($app,$id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($data['info_link_id'])
|
||||||
|
{
|
||||||
|
$this->infolog->link_id2from($data);
|
||||||
list($app,$id) = explode(':',$data['info_contact']);
|
list($app,$id) = explode(':',$data['info_contact']);
|
||||||
if (!empty($app)&&!empty($id)) $value = Link::title($app,$id);
|
if (!empty($app)&&!empty($id)) $value = Link::title($app,$id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$details[$name] = array(
|
$details[$name] = array(
|
||||||
'label' => lang($this->field2label[$name]),
|
'label' => lang($this->field2label[$name]),
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
|
Loading…
Reference in New Issue
Block a user