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
25e42234
Verified
Commit
25e42234
authored
4 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #15116 TIME 2:20 Save date positions
parent
4546fa40
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sql/2010.sql
+3
-1
3 additions, 1 deletion
sql/2010.sql
sql/structure.sql
+1
-0
1 addition, 0 deletions
sql/structure.sql
src/app/document/controllers/DocumentController.php
+14
-1
14 additions, 1 deletion
src/app/document/controllers/DocumentController.php
with
18 additions
and
2 deletions
sql/2010.sql
+
3
−
1
View file @
25e42234
...
@@ -59,6 +59,8 @@ ALTER TABLE users ADD COLUMN x509_fingerprint text;
...
@@ -59,6 +59,8 @@ ALTER TABLE users ADD COLUMN x509_fingerprint text;
ALTER
TABLE
workflows
DROP
COLUMN
IF
EXISTS
signature_positions
;
ALTER
TABLE
workflows
DROP
COLUMN
IF
EXISTS
signature_positions
;
ALTER
TABLE
workflows
ADD
COLUMN
signature_positions
jsonb
DEFAULT
'[]'
;
ALTER
TABLE
workflows
ADD
COLUMN
signature_positions
jsonb
DEFAULT
'[]'
;
ALTER
TABLE
workflows
DROP
COLUMN
IF
EXISTS
date_positions
;
ALTER
TABLE
workflows
ADD
COLUMN
date_positions
jsonb
DEFAULT
'[]'
;
ALTER
TABLE
workflows
DROP
COLUMN
IF
EXISTS
digital_signature_id
;
ALTER
TABLE
workflows
DROP
COLUMN
IF
EXISTS
digital_signature_id
;
ALTER
TABLE
workflows
ADD
COLUMN
digital_signature_id
text
;
ALTER
TABLE
workflows
ADD
COLUMN
digital_signature_id
text
;
...
@@ -71,4 +73,4 @@ DO $$ BEGIN
...
@@ -71,4 +73,4 @@ DO $$ BEGIN
INSERT
INTO
docservers
(
type
,
label
,
is_readonly
,
size_limit_number
,
actual_size_number
,
path
)
INSERT
INTO
docservers
(
type
,
label
,
is_readonly
,
size_limit_number
,
actual_size_number
,
path
)
VALUES
(
'ESIGN'
,
'Document avec signatures électronique'
,
'N'
,
50000000000
,
0
,
'/opt/maarchparapheur/docservers/esigned_documents/'
);
VALUES
(
'ESIGN'
,
'Document avec signatures électronique'
,
'N'
,
50000000000
,
0
,
'/opt/maarchparapheur/docservers/esigned_documents/'
);
END
IF
;
END
IF
;
END
$$
;
END
$$
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
sql/structure.sql
+
1
−
0
View file @
25e42234
...
@@ -239,6 +239,7 @@ CREATE TABLE workflows
...
@@ -239,6 +239,7 @@ CREATE TABLE workflows
mode
CHARACTER
VARYING
(
16
)
NOT
NULL
,
mode
CHARACTER
VARYING
(
16
)
NOT
NULL
,
signature_mode
CHARACTER
VARYING
(
64
)
NOT
NULL
,
signature_mode
CHARACTER
VARYING
(
64
)
NOT
NULL
,
signature_positions
jsonb
DEFAULT
'[]'
,
signature_positions
jsonb
DEFAULT
'[]'
,
date_positions
jsonb
DEFAULT
'[]'
,
"order"
INTEGER
NOT
NULL
,
"order"
INTEGER
NOT
NULL
,
status
CHARACTER
VARYING
(
16
)
DEFAULT
NULL
,
status
CHARACTER
VARYING
(
16
)
DEFAULT
NULL
,
note
text
DEFAULT
NULL
,
note
text
DEFAULT
NULL
,
...
...
This diff is collapsed.
Click to expand it.
src/app/document/controllers/DocumentController.php
+
14
−
1
View file @
25e42234
...
@@ -171,7 +171,7 @@ class DocumentController
...
@@ -171,7 +171,7 @@ class DocumentController
}
}
}
}
$workflow
=
WorkflowModel
::
getByDocumentId
([
'select'
=>
[
'user_id'
,
'mode'
,
'process_date'
,
'signature_mode'
,
'status'
,
'note'
,
'signature_positions'
],
'documentId'
=>
$args
[
'id'
],
'orderBy'
=>
[
'"order"'
]]);
$workflow
=
WorkflowModel
::
getByDocumentId
([
'select'
=>
[
'user_id'
,
'mode'
,
'process_date'
,
'signature_mode'
,
'status'
,
'note'
,
'signature_positions'
,
'date_positions'
],
'documentId'
=>
$args
[
'id'
],
'orderBy'
=>
[
'"order"'
]]);
$currentFound
=
false
;
$currentFound
=
false
;
foreach
(
$workflow
as
$value
)
{
foreach
(
$workflow
as
$value
)
{
if
(
!
empty
(
$value
[
'process_date'
]))
{
if
(
!
empty
(
$value
[
'process_date'
]))
{
...
@@ -188,6 +188,7 @@ class DocumentController
...
@@ -188,6 +188,7 @@ class DocumentController
'current'
=>
!
$currentFound
&&
empty
(
$value
[
'status'
]),
'current'
=>
!
$currentFound
&&
empty
(
$value
[
'status'
]),
'signatureMode'
=>
$value
[
'signature_mode'
],
'signatureMode'
=>
$value
[
'signature_mode'
],
'signaturePositions'
=>
json_decode
(
$value
[
'signature_positions'
],
true
),
'signaturePositions'
=>
json_decode
(
$value
[
'signature_positions'
],
true
),
'datePositions'
=>
json_decode
(
$value
[
'date_positions'
],
true
),
'userSignatureModes'
=>
json_decode
(
$userSignaturesModes
[
'signature_modes'
],
true
),
'userSignatureModes'
=>
json_decode
(
$userSignaturesModes
[
'signature_modes'
],
true
),
'note'
=>
$value
[
'note'
]
'note'
=>
$value
[
'note'
]
];
];
...
@@ -323,6 +324,18 @@ class DocumentController
...
@@ -323,6 +324,18 @@ class DocumentController
}
}
}
}
}
}
if
(
!
empty
(
$workflow
[
'datePositions'
]))
{
if
(
!
Validator
::
arrayType
()
->
validate
(
$workflow
[
'datePositions'
]))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
"Body workflow[
{
$key
}
] datePositions is not an array"
]);
}
foreach
(
$workflow
[
'datePositions'
]
as
$keyDP
=>
$datePosition
)
{
if
(
empty
(
$datePosition
[
'positionX'
])
||
empty
(
$datePosition
[
'positionY'
])
||
empty
(
$datePosition
[
'page'
]))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
"Body workflow[
{
$key
}
][datePositions][
{
$keyDP
}
] is wrong formatted"
]);
}
elseif
(
empty
(
$datePosition
[
'color'
])
||
empty
(
$datePosition
[
'font'
])
||
empty
(
$datePosition
[
'format'
])
||
empty
(
$datePosition
[
'size'
]))
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
"Body workflow[
{
$key
}
][datePositions][
{
$keyDP
}
] is wrong formatted"
]);
}
}
}
if
(
$workflow
[
'signatureMode'
]
==
'eidas'
)
{
if
(
$workflow
[
'signatureMode'
]
==
'eidas'
)
{
$hasEidas
=
true
;
$hasEidas
=
true
;
}
}
...
...
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