From bf7b46cd0e06998b7f2f4b0c97da5a61ce817c97 Mon Sep 17 00:00:00 2001 From: Laurent Laffont <llaffont@afi-sa.fr> Date: Thu, 29 Nov 2018 12:12:51 +0100 Subject: [PATCH] dev #82369 fix RT --- VERSIONS_WIP/82369 | 2 +- .../admin/controllers/CatalogueController.php | 3 +-- .../admin/views/scripts/catalogue/form.phtml | 3 +-- .../views/scripts/catalogue/paniers.phtml | 3 +-- .../views/scripts/catalogue/tester.phtml | 27 ++++++++++++++++--- .../controllers/CatalogueControllerTest.php | 22 +++++++-------- 6 files changed, 38 insertions(+), 22 deletions(-) diff --git a/VERSIONS_WIP/82369 b/VERSIONS_WIP/82369 index d221c40bdfd..dd4c9b57084 100644 --- a/VERSIONS_WIP/82369 +++ b/VERSIONS_WIP/82369 @@ -1 +1 @@ - - ticket #82369 : correction de l'affichage des liens vers les domaines des paniers \ No newline at end of file + - ticket #82369 : correction de l'indexation des notices des paniers reliés à des domaines. Amélioration de l'ergonomie de gestion des paniers collaboratifs. \ No newline at end of file diff --git a/application/modules/admin/controllers/CatalogueController.php b/application/modules/admin/controllers/CatalogueController.php index 60417cd4541..59e586a3a21 100644 --- a/application/modules/admin/controllers/CatalogueController.php +++ b/application/modules/admin/controllers/CatalogueController.php @@ -44,7 +44,7 @@ class Admin_CatalogueController extends ZendAfi_Controller_Action { 'nb_notices' => 0, 'avec_vignettes' => 0, 'notices' => '']; - + $this->getRequest()->setParam('render', null); $ret = array_merge($ret, $catalogue->getTestCatalogue()); if ($catalogue->hasIndexer()) @@ -53,7 +53,6 @@ class Admin_CatalogueController extends ZendAfi_Controller_Action { if (!$catalogue->isIndexable() && ($catalogue->numberOfPanierNotices() == 0)) $this->view->error = $this->_('Le domaine ne peut pas être mis en favori utilisateur sans critères d\'indexation'); - $this->view->requete = $ret["requete"]; $this->view->nb_notices = $ret["nb_notices"]; $this->view->avec_vignettes = $ret["avec_vignettes"]; $this->view->notices = $ret["notices"]; diff --git a/application/modules/admin/views/scripts/catalogue/form.phtml b/application/modules/admin/views/scripts/catalogue/form.phtml index 6de346cf616..f1801d30b51 100644 --- a/application/modules/admin/views/scripts/catalogue/form.phtml +++ b/application/modules/admin/views/scripts/catalogue/form.phtml @@ -9,8 +9,7 @@ if(!$this->catalogue->isNew()) { ['alt' => $this->_('Indexer les notices'), 'class' => 'ico', 'title' => $this->_('Indexer les notices du domaine "%s"', - $this->catalogue->getLibelle())]), - ['data-popup' => 'true']) + $this->catalogue->getLibelle())])) . $this->tagAnchor($this->url(['action' => 'paniers', 'id_catalogue' => $this->catalogue->getId()]), diff --git a/application/modules/admin/views/scripts/catalogue/paniers.phtml b/application/modules/admin/views/scripts/catalogue/paniers.phtml index 7173e03b822..3992de903a8 100644 --- a/application/modules/admin/views/scripts/catalogue/paniers.phtml +++ b/application/modules/admin/views/scripts/catalogue/paniers.phtml @@ -8,8 +8,7 @@ ['alt' => $this->_('Indexer les notices'), 'class' => 'ico', 'title' => $this->_('Indexer les notices du domaine "%s"', - $this->catalogue->getLibelle())]), - ['data-popup' => 'true']) + $this->catalogue->getLibelle())])) . $this->tagAnchor($this->url(['action' => 'edit', 'id_catalogue' => $this->catalogue->getId()]), diff --git a/application/modules/admin/views/scripts/catalogue/tester.phtml b/application/modules/admin/views/scripts/catalogue/tester.phtml index d8ecc23ac93..179abfb8eb3 100644 --- a/application/modules/admin/views/scripts/catalogue/tester.phtml +++ b/application/modules/admin/views/scripts/catalogue/tester.phtml @@ -1,6 +1,26 @@ <?php -if (Class_Users::isCurrentUserSuperAdmin()) - echo '<p style="font-weight:bold; font-size: 0.9em">' . $this->requete . '</p>'; + echo $this->tag('div', + $this->tagAnchor($this->url(['action' => 'edit', + 'id_catalogue' => $this->catalogue->getId()]), + Class_Admin_Skin::current() + ->renderActionIconOn('edit', + $this, + ['alt' => $this->_('Modifier'), + 'class' => 'ico', + 'title' => $this->_('Modifier le domaine "%s"', + $this->catalogue->getLibelle())])) + . + $this->tagAnchor($this->url(['action' => 'paniers', + 'id_catalogue' => $this->catalogue->getId()]), + Class_Admin_Skin::current() + ->renderActionIconOn('basket', + $this, + ['alt' => $this->_('Paniers'), + 'class' => 'ico', + 'title' => $this->_('Paniers rattachés au domaine "%s"', + $this->catalogue->getLibelle())])), + ['class' => 'header_actions']); + if ($this->error) echo '<p align="center" class="error">' . $this->error . '.</p>'; @@ -19,8 +39,7 @@ if ($this->notices) { } -echo $this->tag('p', - $this->_('Information : Affichage des 20 premières notices uniquement...')); +echo $this->tagNotice('Affichage des 20 premières notices uniquement.'); if (!$this->isPopup()) echo $this->button((new Class_Entity()) diff --git a/tests/application/modules/admin/controllers/CatalogueControllerTest.php b/tests/application/modules/admin/controllers/CatalogueControllerTest.php index 4af3bf2b2f5..a803ced0263 100644 --- a/tests/application/modules/admin/controllers/CatalogueControllerTest.php +++ b/tests/application/modules/admin/controllers/CatalogueControllerTest.php @@ -625,26 +625,26 @@ class CatalogueControllerActionTesterTest extends AbstractControllerTestCase { /** @test */ - public function pageShouldDisplayRequest() { - $this->assertContains("select * from notices Where (MATCH(facettes) AGAINST(' +(B1) +( D78308*)' IN BOOLEAN MODE) and notices.type_doc IN ('1', '3', '4', '5') and annee >= '2012' and annee <= '2012') and type=1 order by alpha_titre LIMIT 0,20", - $this->_response->getBody()); + public function noResultMessageShouldBePresent() { + $this->assertXPathContentContains('//p', 'Ce domaine ne renvoie aucun résultat.'); } /** @test */ - public function noResultMessageShouldBePresent() { - $this->assertXPathContentContains('//p', 'Ce domaine ne renvoie aucun résultat.'); + public function pageShouldContainsLinkToEdit() { + $this->assertXPath('//a[contains(@href, "/edit/id_catalogue/6")]'); } /** @test */ - public function modifyLinkShouldContainsSlashes() { - $this->assertXPathContentContains('//button[contains(@onclick, "/admin/catalogue/edit/id_catalogue/6")]', "Modifier le domaine"); + public function pageShouldContainsLinkToBaskets() { + $this->assertXPath('//a[contains(@href, "/paniers/id_catalogue/6")]'); } } + class CatalogueControllerActionTesterWithEmptyDomainTest extends AbstractControllerTestCase { protected $_storm_default_to_volatile = true; @@ -809,8 +809,8 @@ class CatalogueControllerEditCatalogueTest extends AdminCatalogueControllerTestC /** @test */ - public function shouldContainsPopupLinkToTestAction() { - $this->assertXPath('//a[contains(@href, "/tester/id_catalogue/6")][@data-popup]'); + public function shouldContainsPopupToTestAction() { + $this->assertXPath('//a[contains(@href, "/tester/id_catalogue/6")]'); } @@ -1342,8 +1342,8 @@ class CatalogueControllerPaniersHistoireTest extends AdminCatalogueControllerTes /** @test */ - public function shouldContainsPopupLinkToTestAction() { - $this->assertXPath('//a[contains(@href, "/tester/id_catalogue/100")][@data-popup]'); + public function shouldContainsLinkToTestAction() { + $this->assertXPath('//a[contains(@href, "/tester/id_catalogue/100")'); } -- GitLab