Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
db98b363
Commit
db98b363
authored
4 years ago
by
Guillaume Heurtier
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #14565 TIME 0:00 block adding stamp signatory after non-stamp signatory
parent
5c0de770
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lang/en.json
+3
-2
3 additions, 2 deletions
lang/en.json
lang/fr.json
+2
-1
2 additions, 1 deletion
lang/fr.json
src/app/document/controllers/DocumentController.php
+7
-0
7 additions, 0 deletions
src/app/document/controllers/DocumentController.php
with
12 additions
and
3 deletions
lang/en.json
+
3
−
2
View file @
db98b363
...
...
@@ -397,6 +397,7 @@
"addNewDate"
:
"Add a new date"
,
"add"
:
"Add"
,
"dateInDocAdded"
:
"Date added in document"
,
"rejectDocumentWarning"
:
"You are about to decline this document!"
"rejectDocumentWarning"
:
"You are about to decline this document!"
,
"stampInTheMiddleImpossible"
:
"You cannot add a Signatory with stamp after a Signatory with an electronic signature"
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
lang/fr.json
+
2
−
1
View file @
db98b363
...
...
@@ -396,6 +396,7 @@
"addNewDate"
:
"Ajouter une nouvelle date"
,
"add"
:
"Ajouter"
,
"dateInDocAdded"
:
"Date ajoutée dans le document"
,
"rejectDocumentWarning"
:
"Vous êtes sur le point de refuser ce document !"
"rejectDocumentWarning"
:
"Vous êtes sur le point de refuser ce document !"
,
"stampInTheMiddleImpossible"
:
"Vous ne pouvez pas ajouter un Signataire Griffe après un Signataire avec signature électronique"
}
}
This diff is collapsed.
Click to expand it.
src/app/document/controllers/DocumentController.php
+
7
−
0
View file @
db98b363
...
...
@@ -303,6 +303,7 @@ class DocumentController
}
$hasEidas
=
false
;
$hasElectronicSignature
=
false
;
foreach
(
$body
[
'workflow'
]
as
$key
=>
$workflow
)
{
if
(
!
empty
(
$workflow
[
'processingUser'
]))
{
$processingUser
=
UserModel
::
getByLogin
([
'select'
=>
[
'id'
],
'login'
=>
strtolower
(
$workflow
[
'processingUser'
])]);
...
...
@@ -314,6 +315,9 @@ class DocumentController
}
elseif
(
!
Validator
::
stringType
()
->
notEmpty
()
->
validate
(
$workflow
[
'mode'
])
||
!
in_array
(
$workflow
[
'mode'
],
DocumentController
::
MODES
))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
"Body workflow[
{
$key
}
] mode is empty or not a string in ('visa', 'sign', 'note')"
]);
}
if
(
$hasElectronicSignature
&&
$workflow
[
'signatureMode'
]
==
'stamp'
)
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
"Body workflow[
{
$key
}
] signatureMode cannot be stamp after an electronic signature"
,
'lang'
=>
'stampInTheMiddleImpossible'
]);
}
if
(
!
empty
(
$workflow
[
'signaturePositions'
]))
{
if
(
!
Validator
::
arrayType
()
->
validate
(
$workflow
[
'signaturePositions'
]))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
"Body workflow[
{
$key
}
] signaturePositions is not an array"
]);
...
...
@@ -339,6 +343,9 @@ class DocumentController
if
(
in_array
(
$workflow
[
'signatureMode'
],
[
'eidas'
,
'rgs_2stars_timestamped'
,
'inca_card_eidas'
]))
{
$hasEidas
=
true
;
}
if
(
$workflow
[
'signatureMode'
]
!=
'stamp'
)
{
$hasElectronicSignature
=
true
;
}
$body
[
'workflow'
][
$key
][
'userId'
]
=
$processingUser
[
'id'
];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment