User Edit: Only list Contacts not already assigned to a User. Contact Edit: Display button to User the Contact is assigned to (if any).

This commit is contained in:
Nate
2019-03-06 19:54:12 -07:00
parent e30443e290
commit 06a0fa7235
3 changed files with 41 additions and 4 deletions

View File

@@ -730,9 +730,13 @@
echo " <tr>";
echo " <td class='vncell' valign='top'>".$text['label-contact']."</td>";
echo " <td class='vtable'>\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);