From ea76b63de49e44c50f18aeedfcba6584f0b703aa Mon Sep 17 00:00:00 2001 From: Laurent Laffont <llaffont@afi-sa.fr> Date: Mon, 9 Jan 2017 11:43:41 +0100 Subject: [PATCH] dev #41303 search result: do not show 'my bookmark' box when no bookmark configuration available --- library/ZendAfi/Form/Configuration/SearchResult.php | 3 +-- library/ZendAfi/View/Helper/Bookmarks.php | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/library/ZendAfi/Form/Configuration/SearchResult.php b/library/ZendAfi/Form/Configuration/SearchResult.php index 1ababe3f211..98503bd944e 100644 --- a/library/ZendAfi/Form/Configuration/SearchResult.php +++ b/library/ZendAfi/Form/Configuration/SearchResult.php @@ -245,8 +245,7 @@ class ZendAfi_Form_Configuration_SearchResult extends ZendAfi_Form { ->addElement('checkbox', 'bookmarks_enabled', - ['label' => $this->_('Afficher les favoris utilisateur'), - 'title' => $this->_('Attention: nécessite l\'activation de la variable ENABLE_BOOKMARKABLE_LIBRARIES')]) + ['label' => $this->_('Afficher les favoris utilisateur')]) ->addCvsElement() diff --git a/library/ZendAfi/View/Helper/Bookmarks.php b/library/ZendAfi/View/Helper/Bookmarks.php index 94766204af0..f4f4cbb3d8b 100644 --- a/library/ZendAfi/View/Helper/Bookmarks.php +++ b/library/ZendAfi/View/Helper/Bookmarks.php @@ -24,14 +24,11 @@ class ZendAfi_View_Helper_Bookmarks extends ZendAfi_View_Helper_BaseHelper { protected $_bookmarks, $_criteres; public function bookmarks($search_result) { - if (!Class_AdminVar::isModuleEnabled('ENABLE_BOOKMARKABLE_LIBRARIES')) - return ''; - $preferences = $search_result->getSettings(); $bookmarks = $search_result->fetchFacetsAndTags($preferences)['bookmarks']; $criteres = $search_result->getCriteresRecherche(); - if(!$preferences['bookmarks_enabled']) + if (!$preferences['bookmarks_enabled'] || !Class_User_Settings::isBookmarkReady()) return ''; $this->_bookmarks = $bookmarks ? $bookmarks : []; @@ -85,10 +82,10 @@ class ZendAfi_View_Helper_Bookmarks extends ZendAfi_View_Helper_BaseHelper { $this->view->url(['module' => 'opac', 'controller' => 'abonne' , 'action' => 'settings'], null, true), - $this->_('Modifier mes favoris (bibliothèques, domaines, ...)'), + $this->_('Modifier mes favoris'), ['class' => 'bookmarks_edit', 'data-popup' => 'true', - 'title' => $this->_('Modifier mes favoris (bibliothèques, domaines, ...) dans une boîte de dialogue')]); + 'title' => $this->_('Modifier mes favoris dans une boîte de dialogue')]); -- GitLab