mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 05:53:13 +00:00
Fix #150 : missing notifications when receiving a validation
This commit is contained in:
@@ -151,9 +151,8 @@ class basketCollection
|
||||
$appbox = appbox::get_instance();
|
||||
$conn = $appbox->get_connection();
|
||||
$session = $appbox->get_session();
|
||||
$sql = 'SELECT n.ssel_id FROM sselnew n, ssel s
|
||||
WHERE s.ssel_id = n.ssel_id AND n.usr_id = :usr_id
|
||||
AND n.usr_id = s.usr_id';
|
||||
$sql = 'SELECT n.ssel_id FROM sselnew n
|
||||
WHERE n.usr_id = :usr_id ';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute(array(':usr_id' => $session->get_usr_id()));
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
@@ -161,9 +160,19 @@ class basketCollection
|
||||
|
||||
$baskets = array();
|
||||
foreach($rs as $row)
|
||||
{
|
||||
try
|
||||
{
|
||||
$baskets[] = basket_adapter::getInstance($appbox, $row['ssel_id'], $session->get_usr_id());
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
$sql = 'DELETE FROM sselnew WHERE ssel_id = :ssel_id AND usr_id = :usr_id';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute(array(':usr_id' => $session->get_usr_id(), ':ssel_id' => $row['ssel_id']));
|
||||
$stmt->closeCursor();
|
||||
}
|
||||
}
|
||||
|
||||
return $baskets;
|
||||
}
|
||||
|
@@ -366,7 +366,7 @@ function manageSession(data, showMessages)
|
||||
if($('.notification.unread',box).length > 0)
|
||||
{
|
||||
var trigger = $('#notification_trigger') ;
|
||||
$('.counter div',trigger)
|
||||
$('.counter',trigger)
|
||||
.empty()
|
||||
.append($('.notification.unread',box).length);
|
||||
$('.counter',trigger).css('visibility','visible');
|
||||
|
Reference in New Issue
Block a user