notification on off widget
This commit is contained in:
@@ -9,6 +9,19 @@ if (!isset($pdo)) {
|
|||||||
$pdo = DBHandlerSelect::getInstance()->getConnection();
|
$pdo = DBHandlerSelect::getInstance()->getConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($pdo)) {
|
||||||
|
$pdo = DBHandlerSelect::getInstance()->getConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check user webapp notification preference */
|
||||||
|
$__notifyStmt = $pdo->prepare("SELECT notify_webapp FROM auth_users WHERE id = ? LIMIT 1");
|
||||||
|
$__notifyStmt->execute([(int)$iduserlogin]);
|
||||||
|
if ((int)$__notifyStmt->fetchColumn() !== 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$__trWidgetHr = isset($user)
|
||||||
|
|
||||||
$__trWidgetHr = isset($user)
|
$__trWidgetHr = isset($user)
|
||||||
&& ( $user->hasRole('Admin')
|
&& ( $user->hasRole('Admin')
|
||||||
|| $user->hasRole('Superuser')
|
|| $user->hasRole('Superuser')
|
||||||
|
|||||||
@@ -6,6 +6,12 @@
|
|||||||
* - orange -> approaching deadlines (in scadenza)
|
* - orange -> approaching deadlines (in scadenza)
|
||||||
* Scope: deadlines assigned directly to the user OR to their department.
|
* Scope: deadlines assigned directly to the user OR to their department.
|
||||||
*/
|
*/
|
||||||
|
/* Check user webapp notification preference */
|
||||||
|
$_notifyStmt = $pdo->prepare("SELECT notify_webapp FROM auth_users WHERE id = ? LIMIT 1");
|
||||||
|
$_notifyStmt->execute([(int)$iduserlogin]);
|
||||||
|
if ((int)$_notifyStmt->fetchColumn() !== 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$_empStmt = $pdo->prepare("SELECT id, department FROM employees WHERE auth_user_id = ? LIMIT 1");
|
$_empStmt = $pdo->prepare("SELECT id, department FROM employees WHERE auth_user_id = ? LIMIT 1");
|
||||||
$_empStmt->execute([(int)$iduserlogin]);
|
$_empStmt->execute([(int)$iduserlogin]);
|
||||||
|
|||||||
Reference in New Issue
Block a user