Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
0fb53ea6
Commit
0fb53ea6
authored
5 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FIX #10704 TIME 0:15 rm process visa workflow in batch
parent
804a63f8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/visa/batch/batch_tools.php
+0
-41
0 additions, 41 deletions
modules/visa/batch/batch_tools.php
modules/visa/batch/process_mailsFromSignatoryBook.php
+3
-3
3 additions, 3 deletions
modules/visa/batch/process_mailsFromSignatoryBook.php
with
3 additions
and
44 deletions
modules/visa/batch/batch_tools.php
+
0
−
41
View file @
0fb53ea6
...
...
@@ -275,47 +275,6 @@ function Bt_refusedSignedMail($aArgs = [])
]);
}
function
Bt_processVisaWorkflow
(
$aArgs
=
[])
{
$visaWorkflow
=
Bt_getVisaWorkflow
([
'resId'
=>
$aArgs
[
'res_id_master'
]]);
$nbVisaWorkflow
=
$visaWorkflow
->
rowCount
();
if
(
$nbVisaWorkflow
>
0
)
{
while
(
$listInstance
=
$visaWorkflow
->
fetchObject
())
{
$GLOBALS
[
'db'
]
->
query
(
"UPDATE listinstance SET process_date = CURRENT_TIMESTAMP WHERE listinstance_id = ?"
,
[
$listInstance
->
listinstance_id
]);
$nbUserProcess
++
;
// Stop to the first signatory user
if
(
$listInstance
->
requested_signature
)
{
$GLOBALS
[
'db'
]
->
query
(
"UPDATE listinstance SET signatory = 'true' WHERE listinstance_id = ?"
,
[
$listInstance
->
listinstance_id
]);
break
;
}
}
if
(
$nbUserProcess
<
$nbVisaWorkflow
)
{
// Get the next user in workflow
$listInstance
=
$visaWorkflow
->
fetchObject
();
if
(
$listInstance
->
requested_signature
)
{
$mailStatus
=
'ESIG'
;
}
else
{
$mailStatus
=
'EVIS'
;
}
Bt_validatedMail
([
'status'
=>
$mailStatus
,
'resId'
=>
$aArgs
[
'res_id_master'
]]);
}
else
{
Bt_validatedMail
([
'status'
=>
$aArgs
[
'validatedStatus'
],
'resId'
=>
$aArgs
[
'res_id_master'
]]);
}
}
else
{
Bt_validatedMail
([
'status'
=>
$aArgs
[
'validatedStatus'
],
'resId'
=>
$aArgs
[
'res_id_master'
]]);
}
}
function
Bt_getVisaWorkflow
(
$aArgs
=
[])
{
$req
=
"SELECT listinstance_id, item_id, requested_signature FROM listinstance WHERE res_id = ? AND difflist_type = 'VISA_CIRCUIT' AND process_date IS NULL ORDER BY listinstance_id ASC"
;
$stmt
=
$GLOBALS
[
'db'
]
->
query
(
$req
,
array
(
$aArgs
[
'resId'
]));
return
$stmt
;
}
function
Bt_validatedMail
(
$aArgs
=
[])
{
$req
=
"SELECT count(1) as nbresult FROM res_view_attachments WHERE res_id_master = ? AND status = ?"
;
...
...
This diff is collapsed.
Click to expand it.
modules/visa/batch/process_mailsFromSignatoryBook.php
+
3
−
3
View file @
0fb53ea6
...
...
@@ -335,8 +335,8 @@ foreach ($retrievedMails['isVersion'] as $resId => $value) {
}
else
{
$status
=
$validatedStatus
;
}
Bt_processVisaWorkflow
([
'res_id_master'
=>
$value
->
res_id_master
,
'validatedStatus'
=>
$status
]);
Bt_validatedMail
([
'status'
=>
$status
,
'resId'
=>
$value
->
res_id_master
]);
$historyInfo
=
'La signature de la pièce jointe '
.
$resId
.
' (res_version_attachments) a été validée dans le parapheur externe'
;
Bt_history
([
'table_name'
=>
'res_version_attachments'
,
...
...
@@ -439,7 +439,7 @@ foreach ($retrievedMails['noVersion'] as $resId => $value) {
}
else
{
$status
=
$validatedStatus
;
}
Bt_
processVisaWorkflow
([
'res_id_master'
=>
$value
->
res_id_master
,
'validatedStatus'
=>
$status
]);
Bt_
validatedMail
([
'status'
=>
$status
,
'resId'
=>
$value
->
res_id_master
]);
$historyInfo
=
'La signature de la pièce jointe '
.
$resId
.
' (res_attachments) a été validée dans le parapheur externe'
;
Bt_history
([
...
...
@@ -508,7 +508,7 @@ foreach ($retrievedMails['resLetterbox'] as $resId => $value) {
if
(
$value
->
status
==
'validatedNote'
)
{
$GLOBALS
[
'logger'
]
->
write
(
'Document validated'
,
'INFO'
);
Bt_
processVisaWorkflow
([
'res_id_master'
=>
$value
->
res_id
,
'validatedStatus'
=>
$validatedStatusAnnot
]);
Bt_
validatedMail
([
'status'
=>
$validatedStatusAnnot
,
'resId'
=>
$value
->
res_id
]);
Bt_history
([
'table_name'
=>
'res_letterbox'
,
...
...
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