Commit ce23c2a88037167f46644bb2d323535f65215848
1 parent
93ddd72e
Exists in
master
and in
3 other branches
correction bug materiel/add -> désignation obligatoire sans vraiment l'être
Showing
2 changed files
with
15 additions
and
19 deletions
Show diff stats
src/Template/Materiels/add.ctp
@@ -44,11 +44,17 @@ if (isset($cpMateriel)) { | @@ -44,11 +44,17 @@ if (isset($cpMateriel)) { | ||
44 | <?=$this->Form->submit(__('Enregistrer'))?> | 44 | <?=$this->Form->submit(__('Enregistrer'))?> |
45 | 45 | ||
46 | <?php | 46 | <?php |
47 | - echo '<div class="input text required"><label for="designation">Désignation</label><input list="designa" id="designation" name="designation" type="text" placeholder="choisir/ajouter une designation" autocomplete="off"><datalist id="designa">'; | ||
48 | - foreach ($designation as $e) { | ||
49 | - echo "<option value=\"$e\">"; | ||
50 | - } | ||
51 | - echo '</datalist> </div>'; | 47 | +// echo '<div class="input text required"><label for="designation">Désignation</label><input list="designa" id="designation" name="designation" type="text" placeholder="choisir/ajouter une designation" autocomplete="off"><datalist id="designa">'; |
48 | +// foreach ($designation as $e) { | ||
49 | +// echo "<option value=\"$e\">"; | ||
50 | +// } | ||
51 | +// echo '</datalist> </div>'; | ||
52 | + | ||
53 | + echo $this->Form->input('designation', [ | ||
54 | + 'label' => 'Désignation', | ||
55 | + 'default' => $Designation | ||
56 | + ]); | ||
57 | + | ||
52 | echo $this->Form->input('sur_categorie_id', [ | 58 | echo $this->Form->input('sur_categorie_id', [ |
53 | 'label' => 'Domaine', | 59 | 'label' => 'Domaine', |
54 | 'style' => 'width: 260px', | 60 | 'style' => 'width: 260px', |
src/Template/Materiels/edit.ctp
@@ -3,20 +3,10 @@ use Cake\ORM\TableRegistry; | @@ -3,20 +3,10 @@ use Cake\ORM\TableRegistry; | ||
3 | 3 | ||
4 | $USER_IS_UTILISATEUR_AND_CREATOR_OR_OWNER = $USER_IS_UTILISATEUR && in_array($username, [$materiel->nom_createur, $materiel->nom_responsable]); | 4 | $USER_IS_UTILISATEUR_AND_CREATOR_OR_OWNER = $USER_IS_UTILISATEUR && in_array($username, [$materiel->nom_createur, $materiel->nom_responsable]); |
5 | 5 | ||
6 | -$USER_IS_RESPONSABLE_AND_SAME_GROUP = | ||
7 | - $USER_IS_RESPONSABLE | ||
8 | - && | ||
9 | - ( | ||
10 | - ( | ||
11 | - isset($userConnected->groupes_metier_id) | ||
12 | - && $materiel->groupes_metier_id == $userConnected->groupes_metier_id | ||
13 | - ) | ||
14 | - || | ||
15 | - ( | ||
16 | - isset($userConnected->groupe_thematique_id) | ||
17 | - && $materiel->groupes_thematique_id == $userConnected->groupe_thematique_id | ||
18 | - ) | ||
19 | - ); | 6 | +$USER_IS_RESPONSABLE_AND_SAME_GROUP = $USER_IS_RESPONSABLE && ( |
7 | + ( isset($userConnected->groupes_metier_id) && $materiel->groupes_metier_id == $userConnected->groupes_metier_id ) | ||
8 | + || ( isset($userConnected->groupe_thematique_id) && $materiel->groupes_thematique_id == $userConnected->groupe_thematique_id ) | ||
9 | + ); | ||
20 | 10 | ||
21 | $administrationData = array( | 11 | $administrationData = array( |
22 | 'eotp', | 12 | 'eotp', |