diff --git a/VERSIONS_WIP/75659 b/VERSIONS_WIP/75659 new file mode 100644 index 0000000000000000000000000000000000000000..0a74c273aada69c74d4f2ba5f07d253147646e97 --- /dev/null +++ b/VERSIONS_WIP/75659 @@ -0,0 +1,2 @@ + - ticket #75659 : Administration : ajout du bouton tester dans le formulaire de modification d'un domaine. + \ No newline at end of file diff --git a/application/modules/admin/views/scripts/catalogue/form.phtml b/application/modules/admin/views/scripts/catalogue/form.phtml index c52ca489f905555642d9f8210fc3130ba4abfdcd..42effded8e2a3da4250fbf10c891c137cfc5ce2d 100644 --- a/application/modules/admin/views/scripts/catalogue/form.phtml +++ b/application/modules/admin/views/scripts/catalogue/form.phtml @@ -1 +1,15 @@ -<?php echo $this->renderForm($this->form); ?> +<?php +if(!$this->catalogue->isNew()) + echo $this->tag('div', + $this->tagAnchor($this->url(['action' => 'tester', + 'id_catalogue' => $this->catalogue->getId()]), + Class_Admin_Skin::current() + ->renderActionIconOn('test', + $this, + ['alt' => $this->_('Tester'), + 'title' => $this->_('Tester le catalogue "%s"', + $this->catalogue->getLibelle())]), + ['data-popup' => true]), + ['class' => 'header_actions']); + +echo $this->renderForm($this->form); diff --git a/tests/application/modules/admin/controllers/CatalogueControllerTest.php b/tests/application/modules/admin/controllers/CatalogueControllerTest.php index efb85b730d6d28a34a05004a07c28b4e37e365a4..49a7d8076e06c171d3d37d2f17640ad4387a9ce2 100644 --- a/tests/application/modules/admin/controllers/CatalogueControllerTest.php +++ b/tests/application/modules/admin/controllers/CatalogueControllerTest.php @@ -270,7 +270,7 @@ class CatalogueControllerWithAdminBibAndRightTotalAccessTest extends AdminCatalo /** @test */ public function editCatalogueShouldShowValiderButton() { - $this->dispatch('/admin/catalogue/edit/id_catalogue/300'); + $this->dispatch('/admin/catalogue/edit/id_catalogue/300', true); $this->assertXPathContentContains('//button', 'Valider'); } @@ -785,6 +785,12 @@ class CatalogueControllerEditCatalogueTest extends AdminCatalogueControllerTestC public function shouldNotContainsAnnexeNoveltyThesaurus() { $this->assertNotXPath('//input[@name="NANA"]'); } + + + /** @test */ + public function shouldContainsPopupLinkToTestAction() { + $this->assertXPath('//a[contains(@href, "/tester/id_catalogue/6")][@data-popup]'); + } } @@ -1737,4 +1743,4 @@ class Admin_CatalogueControllerActionDomainesTestCase extends AbstractController $this->dispatch('/admin/catalogue/domaines', true); $this->assertNotRedirect(); } -} +} \ No newline at end of file