Skip to content
Snippets Groups Projects
Commit d47406af authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

dev #75882 refacto flat codification list view mode

parent 17cf1088
Branches
Tags
3 merge requests!2711Dev#75882 minsoc faire des filtres sur des facettes et des domaines au moment de la recherche s2,!2707Tessadoc lost pass,!2699Dev#75882 minsoc faire des filtres sur des facettes et des domaines au moment de la recherche s2
Pipeline #4385 failed with stage
in 35 minutes and 8 seconds
<?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
<?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
<?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
<?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
......@@ -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')]]];
}
......
......@@ -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')]]];
}
......
......@@ -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')]]];
}
......
......@@ -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')]]];
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment