diff --git a/application/modules/admin/controllers/DoctypeBrowserController.php b/application/modules/admin/controllers/DoctypeBrowserController.php index 4afc044e6ea6ddb1693cb97518a29376d76adc41..e938ac488a5fab21ffccfeecb45b05cd47464441 100644 --- a/application/modules/admin/controllers/DoctypeBrowserController.php +++ b/application/modules/admin/controllers/DoctypeBrowserController.php @@ -22,6 +22,6 @@ class Admin_DoctypeBrowserController extends ZendAfi_Controller_Action { public function getPlugins() { - return ['ZendAfi_Controller_Plugin_ResourceDefinition_Doctype']; + return ['ZendAfi_Controller_Plugin_ResourceDefinition_Codification_DocType']; } } \ No newline at end of file diff --git a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Doctype.php b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Codification/Abstract.php similarity index 71% rename from library/ZendAfi/Controller/Plugin/ResourceDefinition/Doctype.php rename to library/ZendAfi/Controller/Plugin/ResourceDefinition/Codification/Abstract.php index d8fba9c07c27214b6fb75defac51fcfc84983a77..2fd7dd19d67db8da2b42c86cb21ea286b7b5af49 100644 --- a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Doctype.php +++ b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Codification/Abstract.php @@ -20,22 +20,7 @@ */ -class ZendAfi_Controller_Plugin_ResourceDefinition_Doctype - extends ZendAfi_Controller_Plugin_ResourceDefinition_Abstract { - - public function getDefinitions() { - return - ['model' => ['class' => 'Class_TypeDoc', - 'name' => 'doctype', - 'order' => 'libelle'], - - 'listViewMode' => ['helper_method' => 'flatCodificationListViewMode', - 'label' => $this->_('Type de documents'), - 'controller' => 'doctype-browser'], - - 'actions' => ['index' => ['title' => $this->_('Parcourir les types de documents')]]]; - } - +class ZendAfi_Controller_Plugin_ResourceDefinition_Codification_Abstract extends ZendAfi_Controller_Plugin_ResourceDefinition_Abstract { public function getActions($model) { if(!$model) @@ -52,6 +37,6 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_Doctype 'icon' => 'view', 'label' => $this->_('Voir les documents qui ont la facette "%s"',$model->getFacetCode()), 'anchorOptions' => ['target' => '_blank'] - ]]; + ]]; } } \ No newline at end of file diff --git a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Codification/DocType.php b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Codification/DocType.php new file mode 100644 index 0000000000000000000000000000000000000000..fd7c7bfcc70bb0ae4886dfd2ad0e2316a9121506 --- /dev/null +++ b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Codification/DocType.php @@ -0,0 +1,38 @@ +<?php +/** + * Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +class ZendAfi_Controller_Plugin_ResourceDefinition_Codification_DocType + extends ZendAfi_Controller_Plugin_ResourceDefinition_Codification_Abstract { + + public function getDefinitions() { + return + ['model' => ['class' => 'Class_TypeDoc', + 'name' => 'doctype', + 'order' => 'libelle'], + + 'listViewMode' => ['helper_method' => 'flatCodificationListViewMode', + 'label' => $this->_('Type de documents'), + 'controller' => 'doctype-browser'], + + 'actions' => ['index' => ['title' => $this->_('Parcourir les types de documents')]]]; + } +} \ No newline at end of file diff --git a/tests/application/modules/admin/controllers/TypeDocsControllerTest.php b/tests/application/modules/admin/controllers/TypeDocsControllerTest.php index d51cfe85c4c1474ac2215048dcecf78fecd4ff44..3b74c310dd962ec1c7323ca5a94afecf3ff5c624 100644 --- a/tests/application/modules/admin/controllers/TypeDocsControllerTest.php +++ b/tests/application/modules/admin/controllers/TypeDocsControllerTest.php @@ -68,13 +68,13 @@ class TypeDocsControllerIndexTest extends AbstractTypeDocsControllerTestCase { /** @test */ public function tableShouldContainsLivresTypeDoc() { - $this->assertXPathContentContains('//tbody//tr[2]//td[1]', 'Livres',$this->_response->getBody()); + $this->assertXPathContentContains('//tbody//tr//td', 'Livres',$this->_response->getBody()); } /** @test */ public function tableShouldContainsFamilleLivreCodifTypeDoc() { - $this->assertXPathContentContains('//tbody//tr[2]//td[2]', 'Livre',$this->_response->getBody()); + $this->assertXPathContentContains('//tbody//tr//td', 'Livre',$this->_response->getBody()); }