mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +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();
|
$appbox = appbox::get_instance();
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$sql = 'SELECT n.ssel_id FROM sselnew n, ssel s
|
$sql = 'SELECT n.ssel_id FROM sselnew n
|
||||||
WHERE s.ssel_id = n.ssel_id AND n.usr_id = :usr_id
|
WHERE n.usr_id = :usr_id ';
|
||||||
AND n.usr_id = s.usr_id';
|
|
||||||
$stmt = $conn->prepare($sql);
|
$stmt = $conn->prepare($sql);
|
||||||
$stmt->execute(array(':usr_id' => $session->get_usr_id()));
|
$stmt->execute(array(':usr_id' => $session->get_usr_id()));
|
||||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
@@ -162,7 +161,17 @@ class basketCollection
|
|||||||
$baskets = array();
|
$baskets = array();
|
||||||
foreach($rs as $row)
|
foreach($rs as $row)
|
||||||
{
|
{
|
||||||
$baskets[] = basket_adapter::getInstance($appbox, $row['ssel_id'], $session->get_usr_id());
|
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;
|
return $baskets;
|
||||||
|
@@ -366,7 +366,7 @@ function manageSession(data, showMessages)
|
|||||||
if($('.notification.unread',box).length > 0)
|
if($('.notification.unread',box).length > 0)
|
||||||
{
|
{
|
||||||
var trigger = $('#notification_trigger') ;
|
var trigger = $('#notification_trigger') ;
|
||||||
$('.counter div',trigger)
|
$('.counter',trigger)
|
||||||
.empty()
|
.empty()
|
||||||
.append($('.notification.unread',box).length);
|
.append($('.notification.unread',box).length);
|
||||||
$('.counter',trigger).css('visibility','visible');
|
$('.counter',trigger).css('visibility','visible');
|
||||||
|
Reference in New Issue
Block a user