diff --git a/app/contacts/app_languages.php b/app/contacts/app_languages.php index 032978535f..6656275725 100644 --- a/app/contacts/app_languages.php +++ b/app/contacts/app_languages.php @@ -5381,4 +5381,24 @@ $text['button-add']['ru-ru'] = "Добавить"; $text['button-add']['sv-se'] = "Lägg Till"; $text['button-add']['uk-ua'] = "Додати"; -?> +$text['button-user']['en-us'] = "User"; +$text['button-user']['ar-eg'] = ""; +$text['button-user']['de-at'] = "Benutzer"; //copied from de-de +$text['button-user']['de-ch'] = "Benutzer"; //copied from de-de +$text['button-user']['de-de'] = "Benutzer"; +$text['button-user']['es-cl'] = "Usuario"; +$text['button-user']['es-mx'] = "Usuario"; //copied from es-cl +$text['button-user']['fr-ca'] = "Utilisateurs"; //copied from fr-fr +$text['button-user']['fr-fr'] = "Utilisateurs"; +$text['button-user']['he-il'] = ""; +$text['button-user']['it-it'] = "Utente"; +$text['button-user']['nl-nl'] = ""; +$text['button-user']['pl-pl'] = "Użytkownik"; +$text['button-user']['pt-br'] = "Usuário"; +$text['button-user']['pt-pt'] = "Utilizador"; +$text['button-user']['ro-ro'] = ""; +$text['button-user']['ru-ru'] = "Пользователь"; +$text['button-user']['sv-se'] = "Användare"; +$text['button-user']['uk-ua'] = "Користувач"; + +?> \ No newline at end of file diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 5e2f188645..0cc96de44b 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -285,6 +285,16 @@ $users = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset($prep_statement, $sql); +//determine if contact assigned to a user + if (is_array($users) && sizeof($users) != 0) { + foreach($users as $user) { + if ($user['contact_uuid'] == $contact_uuid) { + $contact_user_uuid = $user['user_uuid']; + break; + } + } + } + //get the users assigned to this contact $sql = "SELECT u.username, u.user_uuid, a.contact_user_uuid FROM v_contacts as c, v_users as u, v_contact_users as a "; $sql .= "where c.contact_uuid = '".$contact_uuid."' "; @@ -416,6 +426,9 @@ if ($action == "update" && is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/certificates')) { echo " \n"; } + if ($action == "update" && permission_exists('user_edit') && is_uuid($contact_user_uuid)) { + echo " \n"; + } echo " \n"; echo "\n"; echo "\n"; diff --git a/core/users/user_edit.php b/core/users/user_edit.php index 05b5d80555..bbee5b0db2 100644 --- a/core/users/user_edit.php +++ b/core/users/user_edit.php @@ -730,9 +730,13 @@ echo " "; echo " ".$text['label-contact'].""; echo " \n"; - $sql = " select contact_uuid, contact_organization, contact_name_given, contact_name_family, contact_nickname from v_contacts "; - $sql .= " where domain_uuid = '".escape($domain_uuid)."' "; - $sql .= " order by contact_organization desc, contact_name_family asc, contact_name_given asc, contact_nickname asc "; + $sql = "select contact_uuid, contact_organization, contact_name_given, contact_name_family, contact_nickname from v_contacts "; + $sql .= "where domain_uuid = '".escape($domain_uuid)."' "; + $sql .= "and ( "; + $sql .= " contact_uuid = '".escape($contact_uuid)."' or "; + $sql .= " contact_uuid not in (select contact_uuid from v_users where domain_uuid = '".escape($domain_uuid)."') "; + $sql .= ") "; + $sql .= "order by contact_organization desc, contact_name_family asc, contact_name_given asc, contact_nickname asc "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);