|
+-----------------------------------------------------------------------+
$Id$
*/
if (($cid = get_input_value('_cid', RCUBE_INPUT_GPC)) && ($record = $CONTACTS->get_record($cid, true)))
$OUTPUT->set_env('cid', $record['ID']);
// adding not allowed here
if ($CONTACTS->readonly)
{
$OUTPUT->show_message('sourceisreadonly');
rcmail_overwrite_action('show');
return;
}
function rcmail_contact_editform($attrib)
{
global $RCMAIL, $CONTACTS, $OUTPUT;
// check if we have a valid result
if ($RCMAIL->action != 'add' && !(($result = $CONTACTS->get_result()) && ($record = $result->first())))
{
$OUTPUT->show_message('contactnotfound');
return false;
}
// add some labels to client
rcube_add_label('noemailwarning');
rcube_add_label('nonamewarning');
list($form_start, $form_end) = get_form_tags($attrib);
unset($attrib['form']);
// a specific part is requested
if ($attrib['part'])
{
$out = $form_start;
$out .= rcmail_get_edit_field($attrib['part'], $record[$attrib['part']], $attrib);
return $out;
}
// return the complete address edit form as table
$out = "$form_start