From 8dcd96ebd975981dd857234326892c16d3e700dc Mon Sep 17 00:00:00 2001
From: gloas <gloas@afi-sa.fr>
Date: Thu, 31 May 2018 09:44:07 +0200
Subject: [PATCH] dev #75742 remove old action updatethesaurus

---
 .../admin/controllers/SystemeController.php   | 40 -------------------
 .../ZendAfi/View/Helper/Admin/ContentNav.php  |  2 -
 .../controllers/SystemeControllerTest.php     | 26 ------------
 .../View/Helper/Admin/MenuGaucheAdminTest.php |  4 +-
 4 files changed, 2 insertions(+), 70 deletions(-)

diff --git a/application/modules/admin/controllers/SystemeController.php b/application/modules/admin/controllers/SystemeController.php
index cfac3df4724..6e9da91e377 100644
--- a/application/modules/admin/controllers/SystemeController.php
+++ b/application/modules/admin/controllers/SystemeController.php
@@ -158,46 +158,6 @@ class Admin_SystemeController extends Zend_Controller_Action {
   }
 
 
-  public function updatethesaurusAction() {
-    $this->view->titre = $this->_('Mise à jour des thesauri');
-
-    $group=[];
-    $form = $this->view->newForm(['id' => 'updatethesaurus']);
-    foreach (Class_CodifThesaurus::getIndices('root',true) as $thesaurus) {
-      $form->addElement('text',
-                        'libelle' . $thesaurus->getId(),
-                        ['label' => $thesaurus->getCode(),
-                         'size' => 50,
-                         'id' => $thesaurus->getId(),
-                         'required' => true,
-                         'allowEmpty' => false,
-                         'value' => $thesaurus->getLibelleFacette()]);
-
-      $group[] = 'libelle' . $thesaurus->getId();
-    }
-
-    $form
-      ->addDisplayGroup($group, 'thesaurus', ['legend' => 'Général'])
-      ->addElement('submit', 'send', ['label' => 'Enregistrer']);
-
-
-    if ($this->_request->isPost()
-        && $form->isValid($this->_request->getPost())) {
-      foreach (Class_CodifThesaurus::getIndices('root', true) as $thesaurus) {
-        if ($newlibelle=$this->_request->getPost("libelle" . $thesaurus->getId())) {
-          $thesaurus=Class_CodifThesaurus::find($thesaurus->getId());
-          $thesaurus->setLibelleFacette($newlibelle);
-          $thesaurus->save();
-        }
-      }
-
-      $this->view->message = $this->_('Les libellés ont été mis à jour');
-    }
-
-    $this->view->form = $form;
-  }
-
-
   public function importthesaurusAction() {
     $this->view->titre = $this->_('Importation d\'un thesaurus');
 
diff --git a/library/ZendAfi/View/Helper/Admin/ContentNav.php b/library/ZendAfi/View/Helper/Admin/ContentNav.php
index 77810a13421..f151f68490d 100644
--- a/library/ZendAfi/View/Helper/Admin/ContentNav.php
+++ b/library/ZendAfi/View/Helper/Admin/ContentNav.php
@@ -168,8 +168,6 @@ class ZendAfi_View_Helper_Admin_ContentNav extends ZendAfi_View_Helper_BaseHelpe
                     ["thesaurus_init", $this->_("Import Thesaurus"), "/admin/systeme/importthesaurus",
                      [], function($user) { return defined('DEVELOPMENT') && $user->isAdmin();}],
 
-                    ["thesaurus_edit",$this->_("Modification Thesaurus"),    "/admin/systeme/updatethesaurus",
-                     [], function($user) { return defined('DEVELOPMENT') && $user->isAdmin();}],
                     ["thesaurus_edit",
                      $this->_("Parcourir les Thesaurus"),    "/admin/thesauri/index",
                      [],
diff --git a/tests/application/modules/admin/controllers/SystemeControllerTest.php b/tests/application/modules/admin/controllers/SystemeControllerTest.php
index 97dcf256746..fa61cd404de 100644
--- a/tests/application/modules/admin/controllers/SystemeControllerTest.php
+++ b/tests/application/modules/admin/controllers/SystemeControllerTest.php
@@ -321,32 +321,6 @@ class SystemeControllerImageCacheResetAllTest extends Admin_AbstractControllerTe
 
 
 
-
-class Admin_SystemControllerTest extends Admin_AbstractControllerTestCase {
-  protected $_storm_default_to_volatile = true;
-
-  public function setUp() {
-    parent::setUp();
-
-    $parent = $this->fixture('Class_CodifThesaurus',
-                             ['id' => 'NNNN',
-                              'id_thesaurus' => 'NNNN',
-                              'code' => 'Nouveauté',
-                              'libelle' => 'Nouveauté',
-                              'libelle_facette' => 'nouveau']);
-
-    $this->dispatch('/admin/systeme/updatethesaurus', true);
-  }
-
-
-  /** @test */
-  public function libelleFacetteShouldBeNouveau() {
-    $this->assertXPath('//form//input[contains(@name, "NNNN")][@value="nouveau"]');
-  }
-}
-
-
-
 class Admin_SystemControllerStatusTest extends Admin_AbstractControllerTestCase {
   protected $_storm_default_to_volatile = true;
 
diff --git a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php
index ddff774f9bb..21797ec21f7 100644
--- a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php
+++ b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php
@@ -239,7 +239,7 @@ Trait MenuGaucheAdminRolesDefinition {
             'custom-fields-report',
             'type-docs',
             'systeme/importthesaurus',
-            'systeme/updatethesaurus',
+            'thesauri/index',
             'file-manager',
     ];
   }
@@ -287,7 +287,7 @@ Trait MenuGaucheAdminRolesDefinition {
          'custom-fields-report',
          'type-docs',
          'systeme/importthesaurus',
-         'systeme/updatethesaurus',
+         'thesauri/index',
          'file-manager'
         ] ],
 
-- 
GitLab