diff --git a/lib/Alchemy/Phrasea/Controller/Root/SessionController.php b/lib/Alchemy/Phrasea/Controller/Root/SessionController.php index ece103e59c..5070ca33ba 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/SessionController.php +++ b/lib/Alchemy/Phrasea/Controller/Root/SessionController.php @@ -86,7 +86,7 @@ class SessionController extends Controller } if ($this->getConf()->get(['registry', 'maintenance', 'enabled'], false)) { - $ret['message'] .= strip_tags($this->getConf()->get(['registry', 'maintenance', 'enabled'])); + $ret['message'] .= strip_tags($this->getConf()->get(['registry', 'maintenance', 'message'])); } } diff --git a/lib/Alchemy/Phrasea/Controller/User/UserPreferenceController.php b/lib/Alchemy/Phrasea/Controller/User/UserPreferenceController.php index c060ca161c..b313982aee 100644 --- a/lib/Alchemy/Phrasea/Controller/User/UserPreferenceController.php +++ b/lib/Alchemy/Phrasea/Controller/User/UserPreferenceController.php @@ -34,7 +34,7 @@ class UserPreferenceController extends Controller $success = false; $msg = $this->app->trans('Error while saving preference'); - if ($prop && $value) { + if (!is_null($prop) && !is_null($value)) { $this->getSession()->set('phraseanet.' . $prop, $value); $success = true; $msg = $this->app->trans('Preference saved !'); diff --git a/resources/www/common/js/jquery.common.js b/resources/www/common/js/jquery.common.js index 30f27ecb9b..c7c70a3529 100644 --- a/resources/www/common/js/jquery.common.js +++ b/resources/www/common/js/jquery.common.js @@ -384,7 +384,7 @@ function manageSession(data, showMessages) { $('body').append('
'); $('#MESSAGE') .empty() - .append(data.message + '
' + language.hideMessage + '
') + .append('

' + data.message + '

') .attr('title', 'Global Message') .dialog({ autoOpen: false, @@ -393,8 +393,20 @@ function manageSession(data, showMessages) { draggable: false, modal: true, close: function () { - if ($('.dialog_remove:checked', $(this)).length > 0) - setTemporaryPref('message', 0); + if ($('.dialog_remove:checked', $(this)).length > 0) { + // setTemporaryPref + $.ajax({ + type: "POST", + url: "/user/preferences/temporary/", + data: { + prop: 'message', + value: 0 + }, + success: function (data) { + return; + } + }); + } } }) .dialog('open');