some fixes for the contactform: customfields, not working mail-subject, ...

This commit is contained in:
Ralf Becker 2007-06-13 16:29:06 +00:00
parent e54535cfc8
commit 1557afe792
2 changed files with 16 additions and 2 deletions

View File

@ -54,6 +54,8 @@ class addressbook_contactform
} }
if ($contact->save($content)) if ($contact->save($content))
{ {
unset($content['modified']); unset($content['modifier']); // not interesting for new entries
$tracking->do_notifications($content,null); // only necessary as long addressbook is not doing this itself $tracking->do_notifications($content,null); // only necessary as long addressbook is not doing this itself
return '<p align="center">'.$content['msg'].'</p>'; return '<p align="center">'.$content['msg'].'</p>';

View File

@ -142,7 +142,7 @@ class addressbook_tracking extends bo_tracking
{ {
$prefix = ($data['subject_contactform'] ? $data['subject_contactform'] : lang('Contactform')).': '; $prefix = ($data['subject_contactform'] ? $data['subject_contactform'] : lang('Contactform')).': ';
} }
return $prefix.parent::get_subject($data,$old); return $prefix.$this->contacts->link_title($data);
} }
/** /**
@ -162,7 +162,7 @@ class addressbook_tracking extends bo_tracking
switch($name) switch($name)
{ {
case 'n_prefix': case 'n_given': case 'n_middle': case 'n_family': case 'n_suffix': // already in n_fn case 'n_prefix': case 'n_given': case 'n_middle': case 'n_family': case 'n_suffix': // already in n_fn
case 'tid': case 'n_fileas': case 'id': case 'tid':
break; break;
case 'created': case 'modified': case 'created': case 'modified':
$details[$name] = array( $details[$name] = array(
@ -214,6 +214,18 @@ class addressbook_tracking extends bo_tracking
break; break;
} }
} }
if ($this->contacts->customfields)
{
foreach($this->contacts->customfields as $name => $custom)
{
if (!$data['#'.$name]) continue;
$details['#'.$name] = array(
'label' => $custom['label'],
'value' => $data['#'.$name],
);
}
}
return $details; return $details;
} }
} }