diff --git a/application/modules/admin/views/scripts/users/_form.phtml b/application/modules/admin/views/scripts/users/_form.phtml index 17717172c4eed5243231e6a3a3ca87e0e153da0f..d91375afb875953d59db184ef6cb6611aa63cf8c 100644 --- a/application/modules/admin/views/scripts/users/_form.phtml +++ b/application/modules/admin/views/scripts/users/_form.phtml @@ -55,7 +55,7 @@ if ($this->user->getId() == '1') echo '<select disabled="disabled"><option selected="selected" value="7">super_admin</option></select><input type="hidden" value="7" name="role" id="role"/>'; else - print $comboListeRole->rendCombo($this->user->getRole(),$this->authUser->ROLE_LEVEL); + print $this->user->getRoleLevel() != 2 ? $comboListeRole->rendCombo($this->user->getRole(),$this->authUser->ROLE_LEVEL) : ZendAfi_Acl_AdminControllerRoles::getLibelleRole(2); ; ?> </td> diff --git a/library/ZendAfi/Acl/AdminControllerRoles.php b/library/ZendAfi/Acl/AdminControllerRoles.php index 8a9862ff9ca9089a7aa52f4b0dad0532ead8b022..f71fbfa4aeb10ee7b98e16e0829d7d174c46bc2c 100644 --- a/library/ZendAfi/Acl/AdminControllerRoles.php +++ b/library/ZendAfi/Acl/AdminControllerRoles.php @@ -152,8 +152,6 @@ class ZendAfi_Acl_AdminControllerRoles extends Zend_Acl { //---------------------------------------------------------------------------------- public static function rendCombo($selected,$user_role_level,$tous=false) { - if($selected=='abonne_sigb') - return self::getLibelleRole(2); $html[]='<select name="role">'; if($tous==true) diff --git a/tests/application/modules/admin/controllers/UsersControllerTest.php b/tests/application/modules/admin/controllers/UsersControllerTest.php index 3cd9cb364e8ccef78819489f3511af78cfce79a6..9d0941b92749adaca5ae1bc3c9d9ab258d64b2e7 100644 --- a/tests/application/modules/admin/controllers/UsersControllerTest.php +++ b/tests/application/modules/admin/controllers/UsersControllerTest.php @@ -91,6 +91,12 @@ class UsersControllerIndexTest extends UsersControllerWithMarcusTestCase { public function formShouldContainsInputForNom() { $this->assertXPath('//input[@name="nom"]'); } + + + /** @test */ + public function formShouldContainsRoleSelect() { + $this->assertXPath('//select[@name="role"]'); + } }