mirror of
https://github.com/itflow-org/itflow
synced 2026-03-17 03:04:50 +00:00
Only show dismissed notifications pertaining to the logged in user
This commit is contained in:
@@ -6,7 +6,6 @@ $order = "DESC";
|
|||||||
|
|
||||||
require_once "inc_all.php";
|
require_once "inc_all.php";
|
||||||
|
|
||||||
|
|
||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
|
|
||||||
$url_query_strings_sort = http_build_query($get_copy);
|
$url_query_strings_sort = http_build_query($get_copy);
|
||||||
@@ -14,11 +13,10 @@ $url_query_strings_sort = http_build_query($get_copy);
|
|||||||
$sql = mysqli_query(
|
$sql = mysqli_query(
|
||||||
$mysqli,
|
$mysqli,
|
||||||
"SELECT SQL_CALC_FOUND_ROWS * FROM notifications
|
"SELECT SQL_CALC_FOUND_ROWS * FROM notifications
|
||||||
LEFT JOIN users ON notification_dismissed_by = user_id
|
|
||||||
LEFT JOIN clients ON notification_client_id = client_id
|
LEFT JOIN clients ON notification_client_id = client_id
|
||||||
WHERE (notification_type LIKE '%$q%' OR notification LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
WHERE (notification_type LIKE '%$q%' OR notification LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||||
AND DATE(notification_timestamp) BETWEEN '$dtf' AND '$dtt'
|
AND DATE(notification_timestamp) BETWEEN '$dtf' AND '$dtt'
|
||||||
AND (notification_user_id = $session_user_id OR notification_user_id = 0)
|
AND notification_user_id = $session_user_id
|
||||||
AND notification_dismissed_at IS NOT NULL
|
AND notification_dismissed_at IS NOT NULL
|
||||||
ORDER BY $sort $order
|
ORDER BY $sort $order
|
||||||
LIMIT $record_from, $record_to
|
LIMIT $record_from, $record_to
|
||||||
@@ -93,11 +91,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
Dismissed At <?php if ($sort == 'notification_dismissed_at') { echo $order_icon; } ?>
|
Dismissed At <?php if ($sort == 'notification_dismissed_at') { echo $order_icon; } ?>
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
<th>
|
|
||||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=user_name&order=<?php echo $disp; ?>">
|
|
||||||
Dismissed By <?php if ($sort == 'user_name') { echo $order_icon; } ?>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -109,7 +102,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
$notification_type = nullable_htmlentities($row['notification_type']);
|
$notification_type = nullable_htmlentities($row['notification_type']);
|
||||||
$notification = nullable_htmlentities($row['notification']);
|
$notification = nullable_htmlentities($row['notification']);
|
||||||
$notification_dismissed_at = nullable_htmlentities($row['notification_dismissed_at']);
|
$notification_dismissed_at = nullable_htmlentities($row['notification_dismissed_at']);
|
||||||
$user_name = nullable_htmlentities($row['user_name']);
|
|
||||||
$client_name = nullable_htmlentities($row['client_name']);
|
$client_name = nullable_htmlentities($row['client_name']);
|
||||||
$client_id = intval($row['client_id']);
|
$client_id = intval($row['client_id']);
|
||||||
if (empty($client_name)) {
|
if (empty($client_name)) {
|
||||||
@@ -125,19 +117,16 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<td><?php echo $notification; ?></td>
|
<td><?php echo $notification; ?></td>
|
||||||
<td><?php echo $client_name_display; ?></td>
|
<td><?php echo $client_name_display; ?></td>
|
||||||
<td><?php echo $notification_dismissed_at; ?></td>
|
<td><?php echo $notification_dismissed_at; ?></td>
|
||||||
<td><?php echo $user_name; ?></td>
|
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php require_once "pagination.php";
|
<?php require_once "pagination.php"; ?>
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once "footer.php";
|
|
||||||
|
|
||||||
|
require_once "footer.php";
|
||||||
|
|||||||
Reference in New Issue
Block a user