diff --git a/library/ZendAfi/Controller/Action/Helper/AuthorListViewMode.php b/library/ZendAfi/Controller/Action/Helper/AuthorListViewMode.php deleted file mode 100644 index ded29c2a1226b25a083472c182f3cab3685ff50c..0000000000000000000000000000000000000000 --- a/library/ZendAfi/Controller/Action/Helper/AuthorListViewMode.php +++ /dev/null @@ -1,116 +0,0 @@ -<?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_Action_Helper_AuthorListViewMode extends ZendAfi_Controller_Action_Helper_AbstractListViewMode { - - - public function authorListViewMode($params) { - $this->_params = $params; - return $this; - } - - - public function direct($params) { - return $this->authorListViewMode($params); - } - - - protected function _describeCategoriesIn($description) { - return $description; - } - - - protected function _describeItemsIn($description) { - return $description - ->addColumn($this->_('Nom prénom'), ['attribute' => 'libelle', - 'callback' => function($model, $attrib) - { - return $this->_renderItem($model, $attrib); - }]) - ->addColumn($this->_('Code facette'), ['attribute' => 'facet_code', - 'sort_attribute' => 'id_auteur']) - ->setSorterServer(); - } - - - public function getBreadcrumb() { - return [['url' => ['module' => 'admin', - 'controller' => 'codification-browser', - 'action' => 'index'], - 'label' => $this->_('Racine'), - 'options' => []], - - ['url' => ['module' => 'admin', - 'controller' => 'author-browser', - 'action' => 'index'], - 'label' => $this->_('Auteurs'), - 'options' => []]]; - } - - - public function getBaseUrl() { - return ['module' => 'admin', - 'controller' => 'author-browser', - 'action' => 'index']; - } - - - public function getItems() { - $default_params = ['limitPage' => [$this->getPage(), $this->_items_by_page], - 'order' => $this->getOrder()]; - - $params = $this->isSearching() - ? $this->getSearchParams() - : []; - - return Class_CodifAuteur::findAllBy(array_merge($params, $default_params)); - } - - - public function getSearchColumns() { - return ['libelle', - 'id_auteur']; - } - - - protected function enabledSorter() { - return false; - } - - - public function countItemsFor($model) { - return Class_CodifAuteur::count(); - } - - - public function getCountSearchResult() { - $params = array_merge($this->getItemsParams(), - $this->getSearchParams()); - unset($params['limitPage']); - return Class_CodifAuteur::countBy($params); - } - - - public function getOrder() { - return $this->getParam('order', 'libelle'); - } -} \ No newline at end of file diff --git a/library/ZendAfi/Controller/Action/Helper/LanguageListViewMode.php b/library/ZendAfi/Controller/Action/Helper/LanguageListViewMode.php deleted file mode 100644 index cbf75a46b5cdfc55ac164ab76d6a85f4e665c717..0000000000000000000000000000000000000000 --- a/library/ZendAfi/Controller/Action/Helper/LanguageListViewMode.php +++ /dev/null @@ -1,117 +0,0 @@ -<?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_Action_Helper_LanguageListViewMode - extends ZendAfi_Controller_Action_Helper_AbstractListViewMode { - - - public function languageListViewMode($params) { - $this->_params = $params; - return $this; - } - - - public function direct($params) { - return $this->languageListViewMode($params); - } - - - protected function _describeCategoriesIn($description) { - return $description; - } - - - protected function _describeItemsIn($description) { - return $description - ->addColumn($this->_('Libellé'), ['attribute' => 'libelle', - 'callback' => function($model, $attrib) - { - return $this->_renderItem($model, $attrib); - }]) - ->addColumn($this->_('Code facette'), ['attribute' => 'facet_code', - 'sort_attribute' => 'id_langue']) - ->setSorterServer(); - } - - - public function getBreadcrumb() { - return [['url' => ['module' => 'admin', - 'controller' => 'codification-browser', - 'action' => 'index'], - 'label' => $this->_('Racine'), - 'options' => []], - - ['url' => ['module' => 'admin', - 'controller' => 'language-browser', - 'action' => 'index'], - 'label' => $this->_('Langues'), - 'options' => []]]; - } - - - public function getBaseUrl() { - return ['module' => 'admin', - 'controller' => 'language-browser', - 'action' => 'index']; - } - - - public function getItems() { - $default_params = ['limitPage' => [$this->getPage(), $this->_items_by_page], - 'order' => $this->getOrder()]; - - $params = $this->isSearching() - ? $this->getSearchParams() - : []; - - return Class_CodifLangue::findAllBy(array_merge($params, $default_params)); - } - - - public function getSearchColumns() { - return ['libelle', - 'id_langue']; - } - - - protected function enabledSorter() { - return false; - } - - - public function countItemsFor($model) { - return Class_CodifLangue::count(); - } - - - public function getCountSearchResult() { - $params = array_merge($this->getItemsParams(), - $this->getSearchParams()); - unset($params['limitPage']); - return Class_CodifLangue::countBy($params); - } - - - public function getOrder() { - return $this->getParam('order', 'libelle'); - } -} \ No newline at end of file diff --git a/library/ZendAfi/Controller/Action/Helper/LocationListViewMode.php b/library/ZendAfi/Controller/Action/Helper/LocationListViewMode.php deleted file mode 100644 index 49d57b0d9b4195167651ed409c6a66a173d05b4e..0000000000000000000000000000000000000000 --- a/library/ZendAfi/Controller/Action/Helper/LocationListViewMode.php +++ /dev/null @@ -1,117 +0,0 @@ -<?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_Action_Helper_LocationListViewMode - extends ZendAfi_Controller_Action_Helper_AbstractListViewMode { - - - public function locationListViewMode($params) { - $this->_params = $params; - return $this; - } - - - public function direct($params) { - return $this->locationListViewMode($params); - } - - - protected function _describeCategoriesIn($description) { - return $description; - } - - - protected function _describeItemsIn($description) { - return $description - ->addColumn($this->_('Libellé'), ['attribute' => 'libelle', - 'callback' => function($model, $attrib) - { - return $this->_renderItem($model, $attrib); - }]) - ->addColumn($this->_('Code facette'), ['attribute' => 'facet_code', - 'sort_attribute' => 'id_emplacement']) - ->setSorterServer(); - } - - - public function getBreadcrumb() { - return [['url' => ['module' => 'admin', - 'controller' => 'codification-browser', - 'action' => 'index'], - 'label' => $this->_('Racine'), - 'options' => []], - - ['url' => ['module' => 'admin', - 'controller' => 'location-browser', - 'action' => 'index'], - 'label' => $this->_('Emplacements'), - 'options' => []]]; - } - - - public function getBaseUrl() { - return ['module' => 'admin', - 'controller' => 'location-browser', - 'action' => 'index']; - } - - - public function getItems() { - $default_params = ['limitPage' => [$this->getPage(), $this->_items_by_page], - 'order' => $this->getOrder()]; - - $params = $this->isSearching() - ? $this->getSearchParams() - : []; - - return Class_CodifEmplacement::findAllBy(array_merge($params, $default_params)); - } - - - public function getSearchColumns() { - return ['libelle', - 'id_emplacement']; - } - - - protected function enabledSorter() { - return false; - } - - - public function countItemsFor($model) { - return Class_CodifEmplacement::count(); - } - - - public function getCountSearchResult() { - $params = array_merge($this->getItemsParams(), - $this->getSearchParams()); - unset($params['limitPage']); - return Class_CodifEmplacement::countBy($params); - } - - - public function getOrder() { - return $this->getParam('order', 'libelle'); - } -} \ No newline at end of file diff --git a/library/ZendAfi/Controller/Action/Helper/SiteListViewMode.php b/library/ZendAfi/Controller/Action/Helper/SiteListViewMode.php deleted file mode 100644 index f4e3967b39098b7878616847d5fac9976ae8b1c6..0000000000000000000000000000000000000000 --- a/library/ZendAfi/Controller/Action/Helper/SiteListViewMode.php +++ /dev/null @@ -1,116 +0,0 @@ -<?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_Action_Helper_SiteListViewMode extends ZendAfi_Controller_Action_Helper_AbstractListViewMode { - - - public function siteListViewMode($params) { - $this->_params = $params; - return $this; - } - - - public function direct($params) { - return $this->siteListViewMode($params); - } - - - protected function _describeCategoriesIn($description) { - return $description; - } - - - protected function _describeItemsIn($description) { - return $description - ->addColumn($this->_('Libellé'), ['attribute' => 'libelle', - 'callback' => function($model, $attrib) - { - return $this->_renderItem($model, $attrib); - }]) - ->addColumn($this->_('Code facette'), ['attribute' => 'facet_code', - 'sort_attribute' => 'id_annexe']) - ->setSorterServer(); - } - - - public function getBreadcrumb() { - return [['url' => ['module' => 'admin', - 'controller' => 'codification-browser', - 'action' => 'index'], - 'label' => $this->_('Racine'), - 'options' => []], - - ['url' => ['module' => 'admin', - 'controller' => 'site-browser', - 'action' => 'index'], - 'label' => $this->_('Annexes'), - 'options' => []]]; - } - - - public function getBaseUrl() { - return ['module' => 'admin', - 'controller' => 'site-browser', - 'action' => 'index']; - } - - - public function getItems() { - $default_params = ['limitPage' => [$this->getPage(), $this->_items_by_page], - 'order' => $this->getOrder()]; - - $params = $this->isSearching() - ? $this->getSearchParams() - : []; - - return Class_CodifAnnexe::findAllBy(array_merge($params, $default_params)); - } - - - public function getSearchColumns() { - return ['libelle', - 'id_annexe']; - } - - - protected function enabledSorter() { - return false; - } - - - public function countItemsFor($model) { - return Class_CodifAnnexe::count(); - } - - - public function getCountSearchResult() { - $params = array_merge($this->getItemsParams(), - $this->getSearchParams()); - unset($params['limitPage']); - return Class_CodifAnnexe::countBy($params); - } - - - public function getOrder() { - return $this->getParam('order', 'libelle'); - } -} \ No newline at end of file diff --git a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Author.php b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Author.php index 76c82efeb56ffebe97ae0e1cbb0aa89f461a5af9..b35d7190febc7862421ec8761b8b0ec9b18600a7 100644 --- a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Author.php +++ b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Author.php @@ -27,7 +27,9 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_Author extends ZendAfi_Contro 'name' => 'author', 'order' => 'libelle'], - 'listViewMode' => ['helper_method' => 'authorListViewMode'], + 'listViewMode' => ['helper_method' => 'flatCodificationListViewMode', + 'label' => $this->_('Auteurs'), + 'controller' => 'author-browser'], 'actions' => ['index' => ['title' => $this->_('Parcourir les auteurs')]]]; } diff --git a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Language.php b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Language.php index ba817c47d89162874d7012efe8a99f7a8bb9f957..1f698513269a534906195c8241f91534f1275924 100644 --- a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Language.php +++ b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Language.php @@ -29,7 +29,9 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_Language 'name' => 'langue', 'order' => 'libelle'], - 'listViewMode' => ['helper_method' => 'languageListViewMode'], + 'listViewMode' => ['helper_method' => 'flatCodificationListViewMode', + 'label' => $this->_('Langues'), + 'controller' => 'language-browser'], 'actions' => ['index' => ['title' => $this->_('Parcourir les langues')]]]; } diff --git a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Location.php b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Location.php index 6507d607b625fa06f665faf77c43067f5b6a48be..cded8a3ad9d159967948752be376199f207f2a5f 100644 --- a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Location.php +++ b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Location.php @@ -27,7 +27,9 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_Location extends ZendAfi_Cont 'name' => 'location', 'order' => 'libelle'], - 'listViewMode' => ['helper_method' => 'locationListViewMode'], + 'listViewMode' => ['helper_method' => 'flatCodificationListViewMode', + 'label' => $this->_('Emplacements'), + 'controller' => 'location-browser'], 'actions' => ['index' => ['title' => $this->_('Parcourir les emplacements')]]]; } diff --git a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Site.php b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Site.php index 6aaf74d8e79a93b3363cf42870bed47ad851dcd8..c8d6f5b310da1a45ae231357659b4ca483659a3f 100644 --- a/library/ZendAfi/Controller/Plugin/ResourceDefinition/Site.php +++ b/library/ZendAfi/Controller/Plugin/ResourceDefinition/Site.php @@ -27,7 +27,9 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_Site extends ZendAfi_Controll 'name' => 'site', 'order' => 'libelle'], - 'listViewMode' => ['helper_method' => 'siteListViewMode'], + 'listViewMode' => ['helper_method' => 'flatCodificationListViewMode', + 'label' => $this->_('Annexes'), + 'controller' => 'site-browser'], 'actions' => ['index' => ['title' => $this->_('Parcourir les annexes')]]]; }