Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
open-source
OSE
Commits
ab1f2ddf
Commit
ab1f2ddf
authored
Feb 14, 2022
by
joriot221
Browse files
Verification de presence de fichier pour la saisie de date de retour signé
parent
307d17d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
module/Application/src/Controller/ContratController.php
View file @
ab1f2ddf
...
...
@@ -312,17 +312,21 @@ class ContratController extends AbstractController
if
(
!
$this
->
isAllowed
(
$contrat
,
Privileges
::
CONTRAT_SAISIE_DATE_RETOUR_SIGNE
))
{
throw
new
UnAuthorizedException
(
'Vous n\'avez pas les droits requis pour saisir la date de retour du contrat signé.'
);
}
$canSaisieDateSigne
=
true
;
if
(
$contrat
->
getDateRetourSigne
()
!=
null
||
$contrat
->
getFichier
()
->
count
()
>
0
)
{
$form
->
bindRequestSave
(
$contrat
,
$this
->
getRequest
(),
function
()
use
(
$contrat
,
$contratToString
)
{
$form
->
bindRequestSave
(
$contrat
,
$this
->
getRequest
(),
function
()
use
(
$contrat
,
$contratToString
)
{
$this
->
getServiceContrat
()
->
save
(
$contrat
);
$this
->
updateTableauxBord
(
$contrat
->
getIntervenant
());
$this
->
flashMessenger
()
->
addSuccessMessage
(
"Saisie du retour
$contratToString
signé enregistrée avec succès."
);
});
$this
->
getServiceContrat
()
->
save
(
$contrat
);
$this
->
updateTableauxBord
(
$contrat
->
getIntervenant
());
$this
->
flashMessenger
()
->
addSuccessMessage
(
"Saisie du retour
$contratToString
signé enregistrée avec succès."
);
});
}
else
{
$canSaisieDateSigne
=
false
;
}
return
compact
(
'form'
,
'done'
,
'title'
);
return
compact
(
'form'
,
'done'
,
'title'
,
'canSaisieDateSigne'
);
}
...
...
module/Application/view/application/contrat/saisir-retour.phtml
View file @
ab1f2ddf
...
...
@@ -12,10 +12,13 @@
<?php
if
(
!
$done
)
echo
$this
->
messenger
()
->
addMessagesFromFlashMessenger
();
$form
->
prepare
();
echo
$this
->
form
()
->
openTag
(
$form
);
echo
$this
->
formControlGroup
(
$form
->
get
(
'dateRetourSigne'
));
echo
$this
->
formHidden
(
$form
->
get
(
'security'
));
echo
$this
->
formSubmit
(
$form
->
get
(
'submit'
)
->
setAttribute
(
'class'
,
'btn btn-primary'
));
echo
$this
->
form
()
->
closeTag
();
\ No newline at end of file
if
(
$canSaisieDateSigne
)
{
$form
->
prepare
();
echo
$this
->
form
()
->
openTag
(
$form
);
echo
$this
->
formControlGroup
(
$form
->
get
(
'dateRetourSigne'
));
echo
$this
->
formHidden
(
$form
->
get
(
'security'
));
echo
$this
->
formSubmit
(
$form
->
get
(
'submit'
)
->
setAttribute
(
'class'
,
'btn btn-primary'
));
echo
$this
->
form
()
->
closeTag
();
}
else
{
echo
"Vous ne pouvez pas renseigner la date de retour signé"
;
}
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