diff --git a/VERSIONS_WIP/82369 b/VERSIONS_WIP/82369 index d221c40bdfd9921c9c9adc91e031ecbb88e7dcd2..dd4c9b5708498517b99babf5a09f565584a01ec2 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 60417cd45417f93b718e3c221998d4adcf438c6c..59e586a3a2105f6dac1e59856eae05a101c1b91d 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 6de346cf616c770159ecd4bbc94ea7190b244c70..f1801d30b512212c3c0799d22de204a777b47e10 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 7173e03b8222dc5aa0b243293f1c4f89c482554f..3992de903a85258bc4244dc002e03e8003104652 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 d8ecc23ac9338fa16be519e18b3f3fe31be80fb8..179abfb8eb3fe03a34543f6d4581279dfe8e56a8 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 4af3bf2b2f55df21dfb63ae8732a53e26fc15a2d..a803ced0263fa7b151a4cf798424607bf1b8b80c 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")'); }