mirror of https://github.com/itflow-org/itflow
More Work on Client Users section, added User Icon Indicator in contact if a user account exists
This commit is contained in:
parent
28c8b1a6da
commit
4921d1eb19
|
|
@ -21,6 +21,7 @@ $sql = mysqli_query(
|
|||
LEFT JOIN user_roles ON user_role_id = role_id
|
||||
LEFT JOIN user_settings ON users.user_id = user_settings.user_id
|
||||
LEFT JOIN contacts ON users.user_id = contact_user_id
|
||||
LEFT JOIN clients ON contact_client_id = client_id
|
||||
WHERE (user_name LIKE '%$q%' OR user_email LIKE '%$q%')
|
||||
AND user_archived_at IS NULL
|
||||
$type_query
|
||||
|
|
@ -101,6 +102,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<th>
|
||||
Last Login
|
||||
</th>
|
||||
<?php if ($type_filter === "client") { ?>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -127,10 +135,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$mfa_status_display = "<i class='fas fa-fw fa-lock text-success'></i>";
|
||||
}
|
||||
$user_config_force_mfa = intval($row['user_config_force_mfa']);
|
||||
$user_role = $row['user_role_id'];
|
||||
$user_role = intval($row['user_role_id']);
|
||||
$user_role_display = nullable_htmlentities($row['role_name']);
|
||||
$user_initials = nullable_htmlentities(initials($user_name));
|
||||
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
|
||||
$sql_last_login = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM logs
|
||||
|
|
@ -189,6 +201,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<td><?php echo $user_status_display; ?></td>
|
||||
<td class="text-center"><?php echo $mfa_status_display; ?></td>
|
||||
<td><?php echo $last_login; ?></td>
|
||||
<?php if ($type_filter === "client") { ?>
|
||||
<td><?php echo $client_name; ?></td>
|
||||
<?php } ?>
|
||||
<td>
|
||||
<?php if ($user_id !== $session_user_id) { // Prevent modifying self ?>
|
||||
<div class="dropdown dropleft text-center">
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@ require_once '../includes/ajax_header.php';
|
|||
|
||||
$user_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM users, user_settings WHERE users.user_id = user_settings.user_id AND users.user_id = $user_id LIMIT 1");
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM users
|
||||
LEFT JOIN user_settings ON users.user_id = user_settings.user_id
|
||||
WHERE users.user_id = $user_id LIMIT 1"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$user_name = nullable_htmlentities($row['user_name']);
|
||||
|
|
|
|||
|
|
@ -351,6 +351,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
}
|
||||
$auth_method = nullable_htmlentities($row['user_auth_method']);
|
||||
$contact_user_id = intval($row['contact_user_id']);
|
||||
if ($contact_user_id) {
|
||||
$user_exists_display = "<span class='badge badge-pill badge-dark p-1' title='User: $auth_method'><i class='fas fa-fw fa-user'></i></span>";
|
||||
} else {
|
||||
$user_exists_display = "";
|
||||
}
|
||||
|
||||
// Related Assets Query
|
||||
$sql_related_assets = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_contact_id = $contact_id ORDER BY asset_id DESC");
|
||||
|
|
@ -445,7 +450,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php } ?>
|
||||
|
||||
<div class="media-body">
|
||||
<div class="<?php if($contact_important) { echo "text-bold"; } ?>"><?php echo $contact_name; ?></div>
|
||||
<div class="<?php if($contact_important) { echo "text-bold"; } ?>"><?php echo $contact_name; ?> <?php echo $user_exists_display; ?></div>
|
||||
<?php echo $contact_title_display; ?>
|
||||
<div><?php echo $contact_primary_display; ?></div>
|
||||
<?php
|
||||
|
|
|
|||
Loading…
Reference in New Issue