Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libriciel
web-DPO
Commits
62374bda
Commit
62374bda
authored
Jun 08, 2018
by
tguillon
Browse files
Correction réorientation d'un traitement en demande de consultation
parent
608c8731
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Controller/EtatFichesController.php
View file @
62374bda
...
...
@@ -391,8 +391,17 @@ class EtatFichesController extends AppController {
'actif'
=>
true
]
]);
if
(
empty
(
$traitementEnCoursValidation
))
{
$reorientationDemandeAvis
=
$this
->
EtatFiche
->
find
(
'first'
,
[
'conditions'
=>
[
'id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'etatFiche'
],
'fiche_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'ficheNum'
],
'etat_id'
=>
EtatFiche
::
DEMANDE_AVIS
,
'actif'
=>
true
]
]);
if
(
empty
(
$traitementEnCoursValidation
)
&&
empty
(
$reorientationDemandeAvis
))
{
$success
=
$success
&&
$this
->
EtatFiche
->
updateAll
([
'actif'
=>
false
],
[
...
...
@@ -402,16 +411,26 @@ class EtatFichesController extends AppController {
}
if
(
$success
==
true
)
{
$this
->
EtatFiche
->
create
([
'EtatFiche'
=>
[
'etat_id'
=>
EtatFiche
::
DEMANDE_AVIS
,
'previous_user_id'
=>
$this
->
Auth
->
user
(
'id'
),
'user_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'destinataire'
],
'previous_etat_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'etatFiche'
],
'fiche_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'ficheNum'
]
]
]);
$success
=
$success
&&
false
!==
$this
->
EtatFiche
->
save
();
if
(
empty
(
$reorientationDemandeAvis
))
{
$this
->
EtatFiche
->
create
([
'EtatFiche'
=>
[
'etat_id'
=>
EtatFiche
::
DEMANDE_AVIS
,
'previous_user_id'
=>
$this
->
Auth
->
user
(
'id'
),
'user_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'destinataire'
],
'previous_etat_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'etatFiche'
],
'fiche_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'ficheNum'
]
]
]);
$success
=
$success
&&
false
!==
$this
->
EtatFiche
->
save
();
}
else
{
$success
=
$success
&&
$this
->
EtatFiche
->
updateAll
([
'user_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'destinataire'
]
],
[
'id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'etatFiche'
]
]
)
!==
false
;
}
if
(
$success
==
true
)
{
$destinataire
=
$this
->
User
->
find
(
'first'
,
[
...
...
@@ -420,6 +439,22 @@ class EtatFichesController extends AppController {
]
]);
if
(
!
empty
(
$reorientationDemandeAvis
))
{
$precedentDestinataire
=
$this
->
User
->
find
(
'first'
,
[
'conditions'
=>
[
'id'
=>
$reorientationDemandeAvis
[
'EtatFiche'
][
'user_id'
]
]
]);
$this
->
Historique
->
create
([
'Historique'
=>
[
'content'
=>
$this
->
Auth
->
user
(
'prenom'
)
.
' '
.
$this
->
Auth
->
user
(
'nom'
)
.
' '
.
__d
(
'historique'
,
'historique.annulerDemandeAvis'
)
.
' '
.
$precedentDestinataire
[
'User'
][
'prenom'
]
.
' '
.
$precedentDestinataire
[
'User'
][
'nom'
],
'fiche_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'ficheNum'
]
]
]);
$success
=
$success
&&
false
!==
$this
->
Historique
->
save
();
}
$this
->
Historique
->
create
([
'Historique'
=>
[
'content'
=>
$this
->
Auth
->
user
(
'prenom'
)
.
' '
.
$this
->
Auth
->
user
(
'nom'
)
.
' '
.
__d
(
'historique'
,
'historique.demandeAvis'
)
.
' '
.
$destinataire
[
'User'
][
'prenom'
]
.
' '
.
$destinataire
[
'User'
][
'nom'
],
...
...
@@ -475,7 +510,7 @@ class EtatFichesController extends AppController {
$success
=
true
;
$this
->
EtatFiche
->
begin
();
$traitementEnReponse
=
$this
->
EtatFiche
->
find
(
'first'
,
[
'conditions'
=>
[
'id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'etatFiche'
]
...
...
@@ -487,12 +522,12 @@ class EtatFichesController extends AppController {
'id'
=>
$traitementEnReponse
[
'EtatFiche'
][
'previous_etat_id'
]
]
]);
$traitements
=
$this
->
EtatFiche
->
find
(
'all'
,
[
'conditions'
=>
[
'id <>'
=>
[
$traitementEnReponse
[
'EtatFiche'
][
'id'
],
$traitementEnReponse
[
'EtatFiche'
][
'previous_etat_id'
]
$traitementEnReponse
[
'EtatFiche'
][
'id'
],
$traitementEnReponse
[
'EtatFiche'
][
'previous_etat_id'
]
],
'fiche_id'
=>
$this
->
request
->
data
[
'EtatFiche'
][
'ficheNum'
]
]
...
...
app/Locale/fra/LC_MESSAGES/historique.po
View file @
62374bda
...
...
@@ -46,4 +46,7 @@ msgstr "a répondu à la demande d'avis de"
msgid "historique.demandeAvis"
msgstr "a demandé l'avis de"
msgid "historique.annulerDemandeAvis"
msgstr "a annulé la demande d'avis à"
###############################################################################
app/View/Elements/historique.ctp
View file @
62374bda
<?php
echo
$this
->
Form
->
button
(
"<i class='fa fa-eye'>
<!---->
</i>"
.
__d
(
'pannel'
,
'pannel.btnVoirHistoriqueComplet'
),
[
echo
$this
->
Form
->
button
(
"<i class='fa fa-eye'>
</i>"
.
__d
(
'pannel'
,
'pannel.btnVoirHistoriqueComplet'
),
[
'type'
=>
'button'
,
'class'
=>
'historique-button btn btn-default-default'
,
'data-value'
=>
$id
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment