Empêcher l'édition nom prenom par un membre simple -optimisation écriture

This commit is contained in:
Fred Tempez 2020-07-07 15:17:48 +02:00
parent 4c348e44f0
commit a4ac385577
1 changed files with 2 additions and 5 deletions

View File

@ -1,7 +1,4 @@
<?php echo template::formOpen('userEditForm'); ?>
<?php if( $this->getUser('group') > 2): $readonly = false;
else: $readonly = true;
endif;?>
<div class="row">
<div class="col2">
<?php if($this->getUrl(3)): ?>
@ -32,7 +29,7 @@
<div class="col6">
<?php echo template::text('userEditFirstname', [
'autocomplete' => 'off',
'disabled' => $readonly,
'disabled' => $this->getUser('group') > 2 ? false : true,
'label' => 'Prénom',
'value' => $this->getData(['user', $this->getUrl(2), 'firstname'])
]); ?>
@ -40,7 +37,7 @@
<div class="col6">
<?php echo template::text('userEditLastname', [
'autocomplete' => 'off',
'disabled' => $readonly,
'disabled' => $this->getUser('group') > 2 ? false : true,
'label' => 'Nom',
'value' => $this->getData(['user', $this->getUrl(2), 'lastname'])
]); ?>