diff --git a/application/modules/admin/controllers/InterestBrowserController.php b/application/modules/admin/controllers/InterestBrowserController.php new file mode 100644 index 0000000000000000000000000000000000000000..1826ccf22127d86d4ea5efb79744c0d58eada2f4 --- /dev/null +++ b/application/modules/admin/controllers/InterestBrowserController.php @@ -0,0 +1,27 @@ +<?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 Admin_InterestBrowserController extends ZendAfi_Controller_Action { + public function getPlugins() { + return ['ZendAfi_Controller_Plugin_ResourceDefinition_Codification_Interest']; + } +} \ No newline at end of file diff --git a/library/Class/CodifCentreInteret.php b/library/Class/CodifCentreInteret.php index 58c634a86187d731394bd72f9428f77d672d366f..98558501853ef9415160a0d49370244c37db345a 100644 --- a/library/Class/CodifCentreInteret.php +++ b/library/Class/CodifCentreInteret.php @@ -20,6 +20,7 @@ */ class Class_CodifCentreInteret extends Storm_Model_Abstract { + use Trait_Facetable; const CODE_FACETTE = 'F'; diff --git a/library/ZendAfi/Controller/Action/Helper/CodificationListViewMode.php b/library/ZendAfi/Controller/Action/Helper/CodificationListViewMode.php index 60f7cd7fa6297ec53317ba6aabdbbc4ea8559a32..ef48c0134982bcc1d5b7656bb9785c225e0a93c2 100644 --- a/library/ZendAfi/Controller/Action/Helper/CodificationListViewMode.php +++ b/library/ZendAfi/Controller/Action/Helper/CodificationListViewMode.php @@ -36,6 +36,10 @@ class ZendAfi_Controller_Action_Helper_CodificationListViewMode ->setLibelle($this->_('Auteurs')) ->setController('author-browser'), + (new Class_CodifCentreInteret) + ->setLibelle($this->_('Centres d\'intérêts')) + ->setController('interest-browser'), + (new Class_CodifDewey) ->setLibelle($this->_('Dewey')) ->setController('dewey-browser'), diff --git a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Codification/Interest.php b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Codification/Interest.php new file mode 100644 index 0000000000000000000000000000000000000000..483c25c72ebaa5e40e249b3a7d87408794c04b6f --- /dev/null +++ b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Codification/Interest.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_Interest + extends ZendAfi_Controller_Plugin_ResourceDefinition_Codification_Abstract { + + public function getDefinitions() { + return + ['model' => ['class' => 'Class_CodifCentreInteret', + 'name' => 'interest', + 'order' => 'libelle'], + + 'listViewMode' => ['helper_method' => 'flatCodificationListViewMode', + 'label' => $this->_('Centres d\'intérêts'), + 'controller' => 'interest-browser'], + + 'actions' => ['index' => ['title' => $this->_('Parcourir la codification des centres d\'intérêts')]]]; + } +} \ No newline at end of file diff --git a/tests/scenarios/CodificationBrowser/CodificationBrowserTest.php b/tests/scenarios/CodificationBrowser/CodificationBrowserTest.php index 0f9478633f0943682cc26e8d0e4cc784453db887..d779a14de35c36c3ac62fa7b6c6ec5dcbed35969 100644 --- a/tests/scenarios/CodificationBrowser/CodificationBrowserTest.php +++ b/tests/scenarios/CodificationBrowser/CodificationBrowserTest.php @@ -44,7 +44,8 @@ class CodificationBrowserIndexDispatchTest extends Admin_AbstractControllerTestC ['tag-browser', 'Tags'], ['doctype-browser', 'Types de documents'], ['pcdm4-browser', 'PCDM4'], - ['dewey-browser', 'Dewey']]; + ['dewey-browser', 'Dewey'], + ['interest-browser', 'Centres d\'intérêts']]; } @@ -220,3 +221,12 @@ class CodificationBrowserDeweySimpleIndexTest extends CodificationBrowserSimpleI $_model = 'Class_CodifDewey', $_attribs = ['id' => '000', 'libelle' => '']; } + + + +class CodificationBrowserInterestSimpleIndexTest extends CodificationBrowserSimpleIndexTestCase { + protected + $_controller = 'interest-browser', + $_model = 'Class_CodifCentreInteret', + $_attribs = ['id' => 5, 'libelle' => 'Ping pong']; +}