diff --git a/library/Class/Profil/Preferences/SearchResult.php b/library/Class/Profil/Preferences/SearchResult.php index a2b34136f74480e9548a1cc178bf86faf9a4ba96..89b71f18d5ebe7ed8fd3883482a1cf65d1aecbda 100644 --- a/library/Class/Profil/Preferences/SearchResult.php +++ b/library/Class/Profil/Preferences/SearchResult.php @@ -23,6 +23,8 @@ class Class_Profil_Preferences_SearchResult { use Trait_Translator; + protected $_settings; + public function getLegacy() { $ret = []; $ret["barre_nav"] = "Résultat"; // Barre de nav @@ -108,10 +110,19 @@ class Class_Profil_Preferences_SearchResult { if(!$profile) return []; - return $this->_getHeaderItems($profile, function($item, $settings) - { - return in_array($item->getId(), $settings); - }); + $selected = []; + foreach($this->_getHeaderCompositionAsArray($profile) as $id) + $selected[] = $this->_getEntity($id); + + return array_filter($selected); + } + + + protected function _getEntity($id) { + foreach($this->_getDefaultHeaderItems() as $instance) + if($id == $instance->getId()) + return $instance; + return null; } @@ -128,7 +139,10 @@ class Class_Profil_Preferences_SearchResult { protected function _getHeaderCompositionAsArray($profile) { - return explode(';', $profile->getCfgModulesPreferences('recherche', 'resultat', 'simple')['header_composition']); + if(!$this->_settings) + $this->_settings = explode(';', $profile->getCfgModulesPreferences('recherche', 'resultat', 'simple')['header_composition']); + + return $this->_settings; } diff --git a/public/opac/css/global.css b/public/opac/css/global.css index 1084a215e161c26319067a7f87f7e2ee23e68052..18996297a375288dc9c8765451ec76b49cf09829 100644 --- a/public/opac/css/global.css +++ b/public/opac/css/global.css @@ -3467,18 +3467,21 @@ th.actions { margin-bottom: 1em; } +.opac .boiteMilieu .contenu { + overflow: visible; +} + .opac.recherche_simple div[class*="_widget"] .widget_wrapper { background: white; box-shadow: 0px 0px 5px black; - left: 1em; margin-top: 1em; max-height: 0; - overflow: auto; + overflow: hidden; position: absolute; transition-duration: .5s; - transition-property: all; - width: 95%; + transition-property: max-height; z-index: 101; + width: 95%; } .opac.recherche_simple div[class*="_widget"].show .widget_wrapper { @@ -3535,10 +3538,9 @@ th.actions { } .opac.recherche_simple .resultats_page .history_search_widget .widget_wrapper { - left: auto; overflow-y: auto; - right: 1em; - width: auto; + position: absolute; + width: 300px; } .admin_tools_lock { diff --git a/tests/scenarios/SearchResult/SearchResultTest.php b/tests/scenarios/SearchResult/SearchResultTest.php index 55c3d0cbb2b4dfe3d05b27d46847685d9e735c5c..9e55213c4c6826d53979a5dae94f1dd03ee5e528 100644 --- a/tests/scenarios/SearchResult/SearchResultTest.php +++ b/tests/scenarios/SearchResult/SearchResultTest.php @@ -47,13 +47,13 @@ class SearchResultTest extends AbstractControllerTestCase { /** @test */ public function numberOfResultsShouldContainsMultipleOptions() { - $this->assertXPath('//div[@class="selector_widget"]//form//select[@name="page_size"]//option[@value="40"]'); + $this->assertXPath('//div[@class="selector_widget"][3]//form//select[@name="page_size"]//option[@value="40"]'); } /** @test */ public function listeFormatShouldContainsMur() { - $this->assertXPath('//div[@class="selector_widget"]//form//select//option[@label="Mur"]'); + $this->assertXPath('//div[@class="selector_widget"][1]//form//select//option[@label="Mur"]'); } @@ -65,13 +65,13 @@ class SearchResultTest extends AbstractControllerTestCase { /** @test */ public function orderShouldContainsTitre() { - $this->assertXPath('//div[@class="selector_widget"]//form//select//option[@label="Titre"]'); + $this->assertXPath('//div[@class="selector_widget"][2]//form//select//option[@label="Titre"]'); } /** @test */ public function adavancedSearchWidgetShouldContainsMatieres() { - $this->assertXPath('//div[@class="advanced_search_widget"]//div//form//input[@name="rech_matieres"]'); + $this->assertXPath('//div[@class="advanced_search_widget"][1]//div//form//input[@name="rech_matieres"]'); }