mirror of
https://github.com/itflow-org/itflow
synced 2026-03-04 12:54:51 +00:00
Only show notifications belonging to the logged in user and system notifications where notification_user_id = 0
This commit is contained in:
@@ -84,7 +84,7 @@ if ($iPod || $iPhone || $iPad) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Get Notification Count for the badge on the top nav
|
//Get Notification Count for the badge on the top nav
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('notification_id') AS num FROM notifications WHERE notification_dismissed_at IS NULL AND company_id = $session_company_id"));
|
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('notification_id') AS num FROM notifications WHERE (notification_user_id = $session_user_id OR notification_user_id = 0) AND notification_dismissed_at IS NULL AND company_id = $session_company_id"));
|
||||||
$num_notifications = $row['num'];
|
$num_notifications = $row['num'];
|
||||||
|
|
||||||
//Set Currency Format
|
//Set Currency Format
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM notifications LEFT JOIN clients ON notification_client_id = client_id WHERE notification_dismissed_at IS NULL AND notifications.company_id = $session_company_id ORDER BY notification_id DESC");
|
$sql = mysqli_query($mysqli,"SELECT * FROM notifications LEFT JOIN clients ON notification_client_id = client_id WHERE notification_dismissed_at IS NULL AND (notification_user_id = $session_user_id OR notification_user_id = 0) AND notifications.company_id = $session_company_id ORDER BY notification_id DESC");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o
|
|||||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM notifications
|
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM notifications
|
||||||
LEFT JOIN users ON notification_dismissed_by = user_id
|
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%') AND DATE(notification_timestamp) BETWEEN '$dtf' AND '$dtt' AND notifications.company_id = $session_company_id AND notification_dismissed_at IS NOT NULL ORDER BY $sb $o LIMIT $record_from, $record_to");
|
WHERE (notification_type LIKE '%$q%' OR notification LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%') AND DATE(notification_timestamp) BETWEEN '$dtf' AND '$dtt' AND (notification_user_id = $session_user_id OR notification_user_id = 0) AND notifications.company_id = $session_company_id AND notification_dismissed_at IS NOT NULL ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||||
|
|
||||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user