diff --git a/lib/Alchemy/Phrasea/Controller/User/Notifications.php b/lib/Alchemy/Phrasea/Controller/User/Notifications.php index e958cf3db5..7be6a2d4a1 100644 --- a/lib/Alchemy/Phrasea/Controller/User/Notifications.php +++ b/lib/Alchemy/Phrasea/Controller/User/Notifications.php @@ -103,9 +103,9 @@ class Notifications implements ControllerProviderInterface $app->abort(400); } - $page = (int) $request->query->get('page', 1); + $page = (int) $request->query->get('page', 0); - return $app->json($app['events-manager']->get_json_notifications(($page < 1 ? 1 : $page))); + return $app->json($app['events-manager']->get_notifications_as_array(($page < 0 ? 0 : $page))); } /** diff --git a/lib/classes/eventsmanager/broker.php b/lib/classes/eventsmanager/broker.php index 86aa458b42..0cec21b9af 100644 --- a/lib/classes/eventsmanager/broker.php +++ b/lib/classes/eventsmanager/broker.php @@ -111,7 +111,7 @@ class eventsmanager_broker return true; } - public function get_json_notifications($page = 0) + public function get_notifications_as_array($page = 0) { $unread = 0; $total = 0; @@ -178,7 +178,7 @@ class eventsmanager_broker $data['next'] = '' . _('charger d\'avantages de notifications') . ''; } - return p4string::jsonencode($data); + return $data; } public function get_unread_notifications_number() diff --git a/templates/web/common/menubar.html.twig b/templates/web/common/menubar.html.twig index 54e015210b..9151141498 100644 --- a/templates/web/common/menubar.html.twig +++ b/templates/web/common/menubar.html.twig @@ -135,11 +135,6 @@ - - {% endif %}
  • {% if app['authentication'].isAuthenticated() %} @@ -194,8 +189,12 @@ {% endif %}
  • - - + {% if app['authentication'].isAuthenticated() and (module == "client" or module == "prod") %} + +{% endif %} diff --git a/www/include/jquery.common.js b/www/include/jquery.common.js index 9f8326bb68..8900b3bab6 100644 --- a/www/include/jquery.common.js +++ b/www/include/jquery.common.js @@ -129,7 +129,7 @@ function set_notif_position() if(trigger.length === 0) return; $('#notification_box').css({ - 'left':Math.round(trigger.offset().left) + 'left':Math.round(trigger.offset().left - 1) }); } $(window).bind('resize', function(){ @@ -173,7 +173,7 @@ function print_notifications(page) $.ajax({ - type: "POST", + type: "GET", url: "/user/notifications/", dataType : 'json', data: {