for new contacts created eg. through eMail app, check email attribute first, before checking for other less significant attributes

This commit is contained in:
Ralf Becker 2012-10-24 14:22:24 +00:00
parent 5b295573dd
commit c733797fe0

View File

@ -1731,13 +1731,16 @@ class addressbook_ui extends addressbook_bo
$content['tid'] = $_GET['typeid'] ? $_GET['typeid'] : ($active_tid?$active_tid:$new_type[0]);
foreach($this->get_contact_columns() as $field)
{
if ($_GET['presets'][$field])
if ($_GET['presets'][$field]) $content[$field] = $_GET['presets'][$field];
}
if (isset($_GET['presets']))
{
$content[$field] = $_GET['presets'][$field];
if (substr($field, 0, 2) == 'n_' && !isset($onload_check_value))
foreach(array('email','email_home','n_family','n_given','org_name') as $field)
{
egw_framework::set_onload("check_value(document.getElementById('exec[$field]'), 'exec[$field]');");
$onload_check_value = true;
if (!empty($content[$field]))
{
egw_framework::set_onload("check_value(document.getElementById('exec[$field]'),0);");
break;
}
}
}