Commit 62830338 authored by THEO GUILLON's avatar THEO GUILLON
Browse files

Correction bug : lorsque la modification ou visualisation par un utilisateur

qui n'était pas à l'origine du traitement, ses informations étaient
renseignées en tant que rédacteur
parent b9932fa8
......@@ -585,7 +585,33 @@ class FichesController extends AppController {
$this->Fiche->id = $id;
$data = $this->request->data;
unset($data['Fiche']['declarantpersonnenom']);
unset($data['Fiche']['declarantservice']);
unset($data['Fiche']['declarantpersonneportable']);
unset($data['Fiche']['declarantpersonneemail']);
unset($data['Fiche']['declarantpersonnefix']);
unset($data['Fiche']['raisonsociale']);
unset($data['Fiche']['telephone']);
unset($data['Fiche']['fax']);
unset($data['Fiche']['adresse']);
unset($data['Fiche']['email']);
unset($data['Fiche']['sigle']);
unset($data['Fiche']['siret']);
unset($data['Fiche']['ape']);
unset($data['Fiche']['civiliteresponsable']);
unset($data['Fiche']['nomresponsable']);
unset($data['Fiche']['prenomresponsable']);
unset($data['Fiche']['fonctionresponsable']);
unset($data['Fiche']['emailresponsable']);
unset($data['Fiche']['telephoneresponsable']);
unset($data['Fiche']['dpo']);
unset($data['Fiche']['numerodpo']);
unset($data['Fiche']['fixDpo']);
unset($data['Fiche']['emailDpo']);
unset($data['Fiche']['portableDpo']);
if (Hash::check($this->request->data, 'Fiche.formulaire_id')) {
$data['Fiche']['form_id'] = Hash::get($this->request->data, 'Fiche.formulaire_id');
}
......
......@@ -132,37 +132,12 @@
'required' => true
]);
$countService = count($this->Session->read('User.service'));
// Champ Service *
if ($countService >= 2) {
foreach ($this->Session->read('User.service') as $service) {
$listeUserService[$service] = $service;
}
echo $this->WebcilForm->input('declarantservice', [
'id' => 'declarantservice',
'readonly' => true,
'required' => true
]);
echo $this->WebcilForm->input('declarantservice', [
'id' => 'declarantservice',
'options' => $listeUserService,
'empty' => __d('fiche', 'fiche.emptySelectionnerServiceDeclarant'),
'required' => true,
'placeholder' => false
]);
} else if ($countService == 0) {
echo $this->WebcilForm->input('declarantservice', [
'id' => 'declarantservice',
'readonly' => true,
'required' => true,
'value' => 'Aucun service'
]);
} else {
echo $this->WebcilForm->input('declarantservice', [
'id' => 'declarantservice',
'readonly' => true,
'required' => true,
'value' => $this->Session->read('User.service')
]);
}
echo $this->WebcilForm->input('declarantpersonneportable', [
'id' => 'declarantpersonneportable',
'readonly' => true,
......
......@@ -98,36 +98,12 @@
'required' => true
]);
$countService = count($this->Session->read('User.service'));
// Champ Service *
if ($countService >= 2) {
foreach ($this->Session->read('User.service') as $service) {
$listeUserService[$service] = $service;
}
echo $this->WebcilForm->input('declarantservice', [
'id' => 'declarantservice',
'readonly' => true,
'required' => true
]);
echo $this->WebcilForm->input('declarantservice', [
'id' => 'declarantservice',
'options' => $listeUserService,
'empty' => 'Séléctionnez un service de déclaration',
'required' => true,
'placeholder' => false
]);
} else if ($countService == 0) {
echo $this->WebcilForm->input('declarantservice', [
'id' => 'declarantservice',
'readonly' => true,
'required' => true,
'value' => 'Aucun service'
]);
} else {
echo $this->WebcilForm->input('declarantservice', [
'id' => 'declarantservice',
'readonly' => true,
'required' => true
]);
}
echo $this->WebcilForm->input('declarantpersonneportable', [
'id' => 'declarantpersonneportable',
'readonly' => true,
......@@ -143,8 +119,7 @@
'declarantpersonneemail' => [
'id' => 'declarantpersonneemail',
'readonly' => true,
'required' => true,
'value' => $this->Session->read('Auth.User.email')
'required' => true
],
'declarantpersonnefix' => [
'id' => 'declarantpersonneportable',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment