solution for taglist used for info_cc; TODO:replace imap_rfc822_parse_adrlist, as we wanted to get rid of those imap extension functions

This commit is contained in:
Klaus Leithoff 2014-03-25 11:22:34 +00:00
parent efa8c9b567
commit 8de2b22eeb

View File

@ -1639,6 +1639,20 @@ class infolog_ui
$content['info_link_id'] = 0; // as field has to be int
}
$active_tab = $content['tabs'];
//info_cc expects an comma separated string
//error_log(__METHOD__.__LINE__.array2string($content));
if (empty($content['info_cc'])) $content['info_cc'] = "";
if (is_array($content['info_cc']))
{
foreach($content['info_cc'] as $i => $value)
{
//imap_rfc822 should not be used, but it works reliable here, until we have some regex solution or use horde stuff
$addresses = imap_rfc822_parse_adrlist($value, '');
//error_log(__METHOD__.__LINE__.$value.'->'.array2string($addresses[0]));
$content['info_cc'][$i]=$addresses[0]->host ? $addresses[0]->mailbox.'@'.$addresses[0]->host : $addresses[0]->mailbox;
}
$content['info_cc'] = implode(',',$content['info_cc']);
}
if (!($info_id = $this->bo->write($content, true, true, true, $content['no_notifications'])))
{
$content['msg'] = $info_id !== 0 || !$content['info_id'] ? lang('Error: saving the entry') :
@ -2086,6 +2100,7 @@ class infolog_ui
//error_log(substr($content['info_des'],1793,10));
//$content['info_des'] = substr($content['info_des'],0,1793);
//echo "<p>infolog_ui.edit(info_id='$info_id',action='$action',action_id='$action_id') readonlys="; print_r($readonlys); echo ", content = "; _debug_array($content);
if (!empty($content['info_cc'])&&!is_array($content['info_cc']))$content['info_cc'] = explode(',',$content['info_cc']);
$this->tmpl->exec('infolog.infolog_ui.edit',$content,$sel_options,$readonlys,$preserv+array( // preserved values
'info_id' => $info_id,
'action' => $action,