diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 9435de422c..14d85ecfa9 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -53,7 +53,7 @@ } //get http post variables and set them to php variables - if (is_array($_POST)) { + if (is_array($_POST) && count($_POST) > 0) { $contact_organization = $_POST["contact_organization"]; $contact_name_prefix = $_POST["contact_name_prefix"]; $contact_name_given = $_POST["contact_name_given"]; @@ -77,7 +77,6 @@ $contact_user_uuid = $_POST["contact_user_uuid"]; $contact_group_uuid = $_POST["contact_group_uuid"]; - $contact_phones = $_POST["contact_phones"]; $contact_addresses = $_POST["contact_addresses"]; $contact_emails = $_POST["contact_emails"]; @@ -896,6 +895,42 @@ $document['title'] = $text['title-contact-edit']; require_once "resources/header.php"; +?> + + + + :contact_uuid "; $sql .= "order by contact_organization desc, contact_name_given asc, contact_name_family asc "; @@ -2196,6 +2233,19 @@ if (permission_exists('contact_relation_view')) { $parameters['contact_uuid'] = $row['contact_uuid']; $database = new database; $contacts = $database->select($sql, $parameters, 'all'); + if (is_array($contacts) && is_uuid($row['relation_contact_uuid'])) { + foreach($contacts as $field) { + if ($field['contact_uuid'] == $row['relation_contact_uuid']) { + $name = array(); + if ($field['contact_organization'] != '') { $name[] = $field['contact_organization']; } + if ($field['contact_name_family'] != '') { $name[] = $field['contact_name_family']; } + if ($field['contact_name_given'] != '') { $name[] = $field['contact_name_given']; } + if ($field['contact_name_family'] == '' && $field['contact_name_given'] == '' && $field['contact_nickname'] != '') { $name[] = $field['contact_nickname']; } + $contact_name = implode(', ', $name); + break; + } + } + } echo "
\n"; echo "
\n"; @@ -2208,6 +2258,11 @@ if (permission_exists('contact_relation_view')) { echo " \n"; echo "
\n"; } + echo " \n"; echo "
\n"; echo "
\n"; @@ -2248,25 +2303,12 @@ if (permission_exists('contact_relation_view')) { echo " ".$text['label-contact_relation_contact']."\n"; echo " \n"; echo "
\n"; - - echo " \n"; + echo "
\n"; + echo " \n"; + echo " \n"; + echo "
\n"; echo "
\n"; echo "
\n";