diff --git a/application/modules/admin/views/scripts/profil/menusindex.phtml b/application/modules/admin/views/scripts/profil/menusindex.phtml index 1128ebbb5b46862f0cdb02c20bd6494286b7f712..c4a3a22ba0d96c16b9cc88dfe37e24aec7cf2aac 100644 --- a/application/modules/admin/views/scripts/profil/menusindex.phtml +++ b/application/modules/admin/views/scripts/profil/menusindex.phtml @@ -41,9 +41,9 @@ foreach($this->menus as $id_menu => $menu) echo '<td align="center"><a href="'.$this->url(['module' => 'admin', 'controller' => 'widget', 'action' => 'edit-menu', + 'id' => $id_menu, 'id_profil' => $this->profil->getId(), - 'backUrl' => $this->url(), - 'id' => $id_menu], null, true).'">'. + 'backUrl' => $this->url()], null, true).'">'. $this->boutonIco("type=edit"). '</a></td>'; diff --git a/library/Class/Systeme/ModulesMenu/Catalogue.php b/library/Class/Systeme/ModulesMenu/Catalogue.php index 0599bb35719acb2e4a23707c8fc6d543ced4fcd8..ed3a7ef64f8be203561271473ba5762bb8af1db9 100644 --- a/library/Class/Systeme/ModulesMenu/Catalogue.php +++ b/library/Class/Systeme/ModulesMenu/Catalogue.php @@ -34,11 +34,12 @@ class Class_Systeme_ModulesMenu_Catalogue extends Class_Systeme_ModulesMenu_Null $this->_libelle = $this->_('Résultat de recherche d\'un domaine ou d\'un panier'); $this->_form = 'ZendAfi_Form_Configuration_Menu_SearchResult'; - $this->_defaultValues = ['titre' => $this->_('Résultat de recherche d\'un domaine ou d\'un panier'), + $this->_defaultValues = ['tri' => 1, + 'titre' => $this->_libelle, 'nb_notices' => 20, 'aleatoire' => 1, - 'tri' => 1, - 'nb_analyse' => 50]; + 'nb_analyse' => 50, + 'id_catalogue' => '']; } @@ -52,6 +53,6 @@ class Class_Systeme_ModulesMenu_Catalogue extends Class_Systeme_ModulesMenu_Null return Class_Url::assemble(array_merge(['controller' => 'recherche', 'action' => 'simple', 'tri' => 'alpha_titre'], - $preferences)); + array_filter(array_intersect_key($preferences, $this->_defaultValues)))); } } \ No newline at end of file diff --git a/library/Class/Systeme/ModulesMenu/News.php b/library/Class/Systeme/ModulesMenu/News.php index 16bb435ba6a9677d1d4f443888f0cce10f566946..5bcec41e887077499a227c8c8dfd92b8ddf6af66 100644 --- a/library/Class/Systeme/ModulesMenu/News.php +++ b/library/Class/Systeme/ModulesMenu/News.php @@ -45,6 +45,6 @@ class Class_Systeme_ModulesMenu_News extends Class_Systeme_ModulesMenu_Null { public function getUrl($preferences = []) { return Class_Url::assemble(array_merge(['controller' => 'cms', 'action' => 'articleviewpreferences'], - array_filter($preferences))); - } + array_filter(array_intersect_key($preferences, $this->_defaultValues)))); +} } \ No newline at end of file diff --git a/library/Class/Systeme/ModulesMenu/Register.php b/library/Class/Systeme/ModulesMenu/Register.php index d0ec7f720823464adf76f94ba05e5511aa8515c0..214c9bc6eb4b77ac3c7997a5c1748dbfe5112c54 100644 --- a/library/Class/Systeme/ModulesMenu/Register.php +++ b/library/Class/Systeme/ModulesMenu/Register.php @@ -30,6 +30,6 @@ class Class_Systeme_ModulesMenu_Register extends Class_Systeme_ModulesMenu_Null public function __construct() { - $this->_libelle = $this->_('S\'enregister'); + $this->_libelle = $this->_('S\'enregistrer'); } } \ No newline at end of file diff --git a/library/Class/Systeme/ModulesMenu/Sitotheque.php b/library/Class/Systeme/ModulesMenu/Sitotheque.php index 338a0774dadd1e046c8892642c35dc0689153fec..9c39ce71347b5c8d092d867160568418f57bb4f6 100644 --- a/library/Class/Systeme/ModulesMenu/Sitotheque.php +++ b/library/Class/Systeme/ModulesMenu/Sitotheque.php @@ -41,6 +41,6 @@ class Class_Systeme_ModulesMenu_Sitotheque extends Class_Systeme_ModulesMenu_Nul public function getUrl($preferences = []) { return Class_Url::assemble(array_merge(['controller' => 'sito', 'action' => 'sitoview'], - array_filter($preferences))); + array_filter(array_intersect_key($preferences, $this->_defaultValues)))); } } \ No newline at end of file diff --git a/library/Class/Systeme/ModulesMenu/Url.php b/library/Class/Systeme/ModulesMenu/Url.php index d33082dc200de35706e60ad57a38a324dbac9ebc..f7d01a61b3eb0225bf95fe58cf80155b4960b096 100644 --- a/library/Class/Systeme/ModulesMenu/Url.php +++ b/library/Class/Systeme/ModulesMenu/Url.php @@ -29,7 +29,7 @@ class Class_Systeme_ModulesMenu_Url extends Class_Systeme_ModulesMenu_Null { $_isPhone = false, $_action = 'liensite', $_defaultValues = ['target' => 1, - 'url' => 'https://www.bokeh-library-portal.org/']; + 'url' => '']; public function __construct() { diff --git a/library/ZendAfi/Form/Configuration/Menu/Link.php b/library/ZendAfi/Form/Configuration/Menu/Link.php index 20d02f597fe1f3c299fff50f95b13897c684a857..7f3558993d2e5957a010c4e7a60df6d6bc9dc445 100644 --- a/library/ZendAfi/Form/Configuration/Menu/Link.php +++ b/library/ZendAfi/Form/Configuration/Menu/Link.php @@ -25,9 +25,10 @@ class ZendAfi_Form_Configuration_Menu_Link extends ZendAfi_Form_Configuration_Me $this ->addElement('url', 'url', - ['value' => 'https://www.bokeh-library-portal.org/', - 'placeholder' => 'https://www.bokeh-library-portal.org/', - 'label' => $this->_('Adresse web')]) + ['placeholder' => 'https://www.bokeh-library-portal.org/', + 'label' => $this->_('Adresse web'), + 'allowEmpty' => false, + 'required' => true]) ->addElement('select', 'target', diff --git a/library/ZendAfi/View/Helper/Accueil/MenuVertical.php b/library/ZendAfi/View/Helper/Accueil/MenuVertical.php index 81724ea790e7332d7ceb7d449beff3da465d27f4..ba96c890d294e7a1f43dd65dabb1f786abff55d7 100644 --- a/library/ZendAfi/View/Helper/Accueil/MenuVertical.php +++ b/library/ZendAfi/View/Helper/Accueil/MenuVertical.php @@ -128,7 +128,7 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue */ private function _getLigne($entree) { $builder = $this->_getBuilderMethod($entree); - return $this->_editEntry($entree) . $this->$builder($entree); + return $this->$builder($entree); } @@ -249,9 +249,10 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue ? $this->afficherSousMenu($url) : []; - return $this->view->tagAnchor($url, - $this->getMenuPicto($item) . htmlspecialchars($item['libelle']), - array_merge($target, $sub_menu)); + return $this->_editEntry($item) + . $this->view->tagAnchor($url, + $this->getMenuPicto($item) . htmlspecialchars($item['libelle']), + array_merge($target, $sub_menu)); } @@ -354,6 +355,7 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue $profil_key = isset($menuitem["preferences"]["clef_profil"]) ? (int) $menuitem["preferences"]['clef_profil'] : '0'; + $class[] = $this->_getContextClass($profil_key); $class[] = $this->_getContextClassByUrl($url); @@ -386,7 +388,6 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue $param_url = $this->_cls_menu->getUrl($menuitem["type_menu"], $preferences); $url = $param_url["url"]; $target = ($param_url["target"] > "") ? $param_url["target"] : null; - return $this->_renderListItem($menuitem, $param_url["url"], $target); } @@ -410,9 +411,10 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue $contenu .= $this->_getLigne($entree); if (array_isset('sous_menus', $entree)) { $contenu .= sprintf('<li class="menuGauche" %s><ul>', $this->_li_style); - foreach ($entree["sous_menus"] as $sub_key => $sous_menu) + foreach ($entree["sous_menus"] as $sub_key => $sous_menu) { $sous_menu['id_module'] = $sub_key; $contenu .= $this->_getLigne($sous_menu); + } $contenu .= '</ul></li>'; } } diff --git a/tests/application/modules/admin/controllers/ProfilControllerTest.php b/tests/application/modules/admin/controllers/ProfilControllerTest.php index 96135a08e35d19040837b8fdc30d243106acd770..97042488dda8a729b1a2c556c7a61f128b0ed6b5 100644 --- a/tests/application/modules/admin/controllers/ProfilControllerTest.php +++ b/tests/application/modules/admin/controllers/ProfilControllerTest.php @@ -710,7 +710,7 @@ class Admin_ProfilControllerProfilJeunesseTestMenusIndex extends Admin_ProfilCon /** @test */ public function editMenuHorizontalLink() { - $this->assertXPath("//tr[@class='second']//td//a[contains(@href, 'menusmaj/id_profil/5/id_menu/H/mode/edit')]"); + $this->assertXPath("//tr[@class='second']//td//a[contains(@href, 'admin/widget/edit-menu/id/H/id_profil/5')]"); } @@ -726,7 +726,7 @@ class Admin_ProfilControllerProfilJeunesseTestMenusIndex extends Admin_ProfilCon /** @test */ public function editMenuVerticalLink() { - $this->assertXPath("//tr[@class='first']//td//a[contains(@href, 'menusmaj/id_profil/5/id_menu/V/mode/edit')]"); + $this->assertXPath("//tr[@class='first']//td//a[contains(@href, 'admin/widget/edit-menu/id/V/id_profil/5/backUrl')]"); } @@ -738,7 +738,7 @@ class Admin_ProfilControllerProfilJeunesseTestMenusIndex extends Admin_ProfilCon /** @test */ public function addMenuLink() { - $this->assertXPath("//div[contains(@onclick, 'menusmaj/id_profil/5/mode/add')]"); + $this->assertXPath("//button[contains(@onclick, 'admin/widget/add-menu')]"); } } diff --git a/tests/application/modules/opac/controllers/AbonneControllerAvisTest.php b/tests/application/modules/opac/controllers/AbonneControllerAvisTest.php index 87fa641e70431165bd4a866e3c5d0bb82f0e16d9..8e43f6a2ad6e79eeeab64b696b2fe5081fc5bb13 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerAvisTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerAvisTest.php @@ -780,7 +780,7 @@ class AbonneControllerAvisBlogControllerViewCritiquesWithoutModuleTest extends M /** @test */ public function titleShouldBeDernieresCritiques() { $this->dispatch('/opac/blog/viewcritiques'); - $this->assertXPathContentContains('//h1', 'Dernières critiques'); + $this->assertXPathContentContains('//h1', 'Critiques'); } } diff --git a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php index 3738c3b4a57847475c2645a08c362415c834b9b6..c0269a895e743db6ba6f5b492bf535d01c517ea7 100644 --- a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php +++ b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php @@ -680,8 +680,7 @@ class ProfilOptionsControllerViewProfilAdulteTest extends ProfilOptionsControlle /** @test */ public function menuHorizontalShouldDisplaySitothequeWithUrl() { - $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="menu"]//a[contains(@href, "/sito/sitoview/id_items/10-1-2/nb/10/picto/vide.gif/libelle/Sitoth%C3%A8que")]', - $this->_response->getBody()); + $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="menu"]//a[contains(@href, "/sito/sitoview/id_items/10-1-2/nb/10")]'); } @@ -693,8 +692,7 @@ class ProfilOptionsControllerViewProfilAdulteTest extends ProfilOptionsControlle /** @test */ public function menuHorizontalShouldDisplayCatalogueWithUrl() { - $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="menu"]//a[contains(@href, "/recherche/simple/tri/date_creation+desc/titre/mon+catalogue/nb_notices/20/aleatoire/1/nb_analyse/50/id_catalogue/2/picto/vide.gif/libelle/mon+catalogue")]', - $this->_response->getBody()); + $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="menu"]//a[contains(@href, "/recherche/simple/tri/date_creation+desc/titre/mon+catalogue/nb_notices/20/aleatoire/1/nb_analyse/50/id_catalogue/2")]'); } @@ -709,7 +707,7 @@ class ProfilOptionsControllerViewProfilAdulteTest extends ProfilOptionsControlle /** @test */ public function menuHorizontalForMenuPratiqueShouldHaveClassProfilSelected() { $this->assertXPathContentContains('//ul/li[contains(@class, "selected_profil")]', - 'Pratique',$this->_response->getBody()); + 'Pratique'); } @@ -809,19 +807,19 @@ class ProfilOptionsControllerViewProfilAdulteAsAdminTest extends ProfilOptionsCo /** @test */ public function menuHorizontalCalendrierConfigShouldContainsConfigTypeMenu() { - $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="menu boite"]//div[@class="boite calendar"]//a[contains(@href, "menus/calendrier/config/menu/id_profil/22/id_module/18/type_menu/MODULE_ACCUEIL_CALENDAR/preferences/nb_events%3D5")]'); + $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="menu boite"]//div[@class="boite calendar"]/following-sibling::a[contains(@href, "/widget/edit-menu/id/19/id_profil/22/parent/H")]'); } /** @test */ public function menuHorizontalCritiquesConfigShouldContainsConfigTypeMenu() { - $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="boite"]//div[@class="boite critiques"]//a[contains(@href, "menus/critiques/config/menu/id_profil/22/id_module/2/type_menu/MODULE_ACCUEIL_CRITIQUES/preferences/rss_avis%3D1%7Cid_panier%3D3")]'); + $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="boite"]//div[@class="boite critiques"]/following-sibling::a[contains(@href, "admin/widget/edit-menu/id/2/id_profil/22/parent/H")]'); } /** @test */ public function menuHorizontalKiosqueConfigShouldContainsConfigTypeMenu() { - $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="menu boite"]//div[@class="boite kiosque"]//a[contains(@href, "menus/kiosque/config/menu/id_profil/22/id_module/19/type_menu/MODULE_ACCUEIL_KIOSQUE/preferences/id_panier%3D1%7Cstyle_liste%3Dmur")]'); + $this->assertXPath('//div[@id="menu_horizontal"]//li[@class="menu boite"]//div[@class="boite kiosque"]/following-sibling::a[contains(@href, "admin/widget/edit-menu/id/20/id_profil/22/parent/H")]'); } } @@ -1146,7 +1144,7 @@ class ProfilOptionsControllerPageJeuxViewModuleCritiquesTest extends ProfilOptio /** @test */ public function iframeKiosqueUrlShouldHaveIdModuleSeven() { - $this->assertXPath('//iframe[contains(@src, "/id_module/7/id_profil/12/vue/cube")][@title="Kiosque"]'); + $this->assertXPath('//iframe[contains(@src, "/id_module/7/id_profil/12/vue/cube")][@title="Kiosque de documents"]'); } @@ -1325,8 +1323,7 @@ class ProfilOptionsControllerProfilJeunesseViewPageJeuxTest extends ProfilOption /** @test */ public function boiteKiosqueTitleShouldLinkToMenuCatalogue() { - $this->assertXPath("//div[@class='boite kiosque']//div//a[contains(@href, '/recherche/simple/titre/Kiosque/style_liste/cube/nb_notices/20/only_img/1/aleatoire/1/tri/date_creation+desc/nb_analyse/50/op_hauteur_img/90/op_transition//op_largeur_img/0/op_hauteur_boite/0/op_captions/0/op_autoplay/0/op_visible/0/op_speed/0/op_auto/0/op_scroll/1/rss_avis/1/id_catalogue/0/id_panier/0/profil_redirect//boite/boite_de_la_division_gauche')]", - $this->_response->getBody()); + $this->assertXPath("//div[@class='boite kiosque']//div//a[contains(@href, '/recherche/simple/titre/Kiosque+de+documents/style_liste/cube/nb_notices/20/only_img/1/aleatoire/1/tri/date_creation+desc/nb_analyse/50/op_hauteur_img/90/op_transition//op_largeur_img/0/op_hauteur_boite/0/op_captions/0/op_autoplay/0/op_visible/0/op_speed/0/op_auto/0/op_scroll/1/rss_avis/1/id_catalogue/0/id_panier/0/profil_redirect//boite/boite_de_la_division_gauche')]"); } diff --git a/tests/application/modules/telephone/controllers/IndexControllerTest.php b/tests/application/modules/telephone/controllers/IndexControllerTest.php index 68d9d37c19a13d6adc9d84bd994a656ff2655eec..61a07804eecabd1da35400c1f34e93f9f9a7db92 100644 --- a/tests/application/modules/telephone/controllers/IndexControllerTest.php +++ b/tests/application/modules/telephone/controllers/IndexControllerTest.php @@ -22,6 +22,8 @@ require_once 'TelephoneAbstractControllerTestCase.php'; abstract class AbstractIndexControllerTelephoneWithModulesTest extends TelephoneAbstractControllerTestCase { + protected $_storm_default_to_volatile = true; + protected function _loginHook($account) { $account->ROLE = ""; $account->ROLE_LEVEL = 0; @@ -357,7 +359,7 @@ class IndexControllerTelephoneSimulationWithModulesTest extends AbstractIndexCon /** @test */ public function critiqueOnPotterTitleShouldBeBien() { - $this->assertXPathContentContains('//li//a//h3', 'bien'); + $this->assertXPathContentContains('//li//a//h3', 'bien', $this->_response->getBody()); }