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:
@@ -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 " <input type='button' class='btn' name='' alt='".$text['button-certificate']."' onclick=\"window.location='".PROJECT_PATH."/app/certificates/index.php?name=".urlencode(escape($contact_name_given)." ".escape($contact_name_family))."'\" value='".$text['button-certificate']."'>\n";
|
||||
}
|
||||
if ($action == "update" && permission_exists('user_edit') && is_uuid($contact_user_uuid)) {
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-user']."' onclick=\"window.location='".PROJECT_PATH."/core/users/user_edit.php?id=".$contact_user_uuid."'\" value='".$text['button-user']."'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
Reference in New Issue
Block a user