From 822bbe95516c3470a38ed1fd53c16036b641fcff Mon Sep 17 00:00:00 2001 From: pbarroca <pbarroca@afi-sa.fr> Date: Fri, 20 Jan 2017 12:04:17 +0100 Subject: [PATCH] dev #53936 : doc_types list ordered --- library/ZendAfi/View/Helper/TagListeCoches.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/ZendAfi/View/Helper/TagListeCoches.php b/library/ZendAfi/View/Helper/TagListeCoches.php index cd70a8c4abc..52c1c33c582 100644 --- a/library/ZendAfi/View/Helper/TagListeCoches.php +++ b/library/ZendAfi/View/Helper/TagListeCoches.php @@ -23,6 +23,7 @@ class ZendAfi_View_Helper_TagListeCoches extends ZendAfi_View_Helper_BaseHelper protected $selected_all_means_nothing = true, $_name, + $_type, $_definition, $_possibles, $_selection = '', @@ -62,6 +63,7 @@ class ZendAfi_View_Helper_TagListeCoches extends ZendAfi_View_Helper_BaseHelper return ''; $this->_name = $name; + $this->_type = $rubrique; Class_ScriptLoader::getInstance()->addAdminScript('tag_selection'); $this->_definition = $rubriques[$rubrique]; $this->_possibles = $this->_getList(); @@ -152,6 +154,14 @@ class ZendAfi_View_Helper_TagListeCoches extends ZendAfi_View_Helper_BaseHelper protected function _getList() { $instances = $this->_getInstances(); + if ('type_doc' == $this->_type) + usort($instances, + function($a, $b) + { + return strtolower($a->getLabel()) > strtolower($b->getLabel()); + }); + + $list = []; foreach($instances as $instance) { -- GitLab