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
fd582fda
Verified
Commit
fd582fda
authored
6 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FEAT set VAL status in res_letterbox only if all attachments is processed (external signatory book)
parent
9312cff3
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
+15
-4
15 additions, 4 deletions
modules/visa/batch/batch_tools.php
modules/visa/batch/process_mailsFromSignatoryBook.php
+4
-6
4 additions, 6 deletions
modules/visa/batch/process_mailsFromSignatoryBook.php
with
19 additions
and
10 deletions
modules/visa/batch/batch_tools.php
+
15
−
4
View file @
fd582fda
...
@@ -195,8 +195,6 @@ function Bt_createAttachment($aArgs = [])
...
@@ -195,8 +195,6 @@ function Bt_createAttachment($aArgs = [])
curl_setopt_array
(
$curl
,
$opts
);
curl_setopt_array
(
$curl
,
$opts
);
$rawResponse
=
curl_exec
(
$curl
);
$rawResponse
=
curl_exec
(
$curl
);
$GLOBALS
[
'db'
]
->
query
(
"UPDATE res_letterbox SET status = ? WHERE res_id = ?"
,
[
$aArgs
[
'validatedStatus'
],
$aArgs
[
'res_id_master'
]]);
return
json_decode
(
$rawResponse
,
true
);
return
json_decode
(
$rawResponse
,
true
);
}
}
...
@@ -237,7 +235,6 @@ function Bt_processVisaWorkflow($aArgs = [])
...
@@ -237,7 +235,6 @@ function Bt_processVisaWorkflow($aArgs = [])
$nbVisaWorkflow
=
$visaWorkflow
->
rowCount
();
$nbVisaWorkflow
=
$visaWorkflow
->
rowCount
();
if
(
$nbVisaWorkflow
>
0
)
{
if
(
$nbVisaWorkflow
>
0
)
{
$signatureRequestedFound
=
false
;
while
(
$listInstance
=
$visaWorkflow
->
fetchObject
())
{
while
(
$listInstance
=
$visaWorkflow
->
fetchObject
())
{
$GLOBALS
[
'db'
]
->
query
(
"UPDATE listinstance SET process_date = CURRENT_TIMESTAMP WHERE listinstance_id = ?"
,
[
$listInstance
->
listinstance_id
]);
$GLOBALS
[
'db'
]
->
query
(
"UPDATE listinstance SET process_date = CURRENT_TIMESTAMP WHERE listinstance_id = ?"
,
[
$listInstance
->
listinstance_id
]);
$nbUserProcess
++
;
$nbUserProcess
++
;
...
@@ -256,8 +253,10 @@ function Bt_processVisaWorkflow($aArgs = [])
...
@@ -256,8 +253,10 @@ function Bt_processVisaWorkflow($aArgs = [])
$mailStatus
=
'EVIS'
;
$mailStatus
=
'EVIS'
;
}
}
$GLOBALS
[
'db'
]
->
query
(
'UPDATE res_letterbox SET status = ? WHERE res_id = ? '
,
[
$mailStatus
,
$aArgs
[
'res_id_master'
]]);
Bt_validatedMail
([
'status'
=>
$mailStatus
,
'resId'
=>
$aArgs
[
'res_id_master'
]]);
}
}
}
else
{
Bt_validatedMail
([
'status'
=>
$aArgs
[
'validatedStatus'
],
'resId'
=>
$aArgs
[
'res_id_master'
]]);
}
}
}
}
...
@@ -268,3 +267,15 @@ function Bt_getVisaWorkflow($aArgs = [])
...
@@ -268,3 +267,15 @@ function Bt_getVisaWorkflow($aArgs = [])
return
$stmt
;
return
$stmt
;
}
}
function
Bt_validatedMail
(
$aArgs
=
[])
{
$req
=
"SELECT count(1) as nbresult FROM res_view_attachments WHERE res_id_master = ? AND status = ?"
;
$stmt
=
$GLOBALS
[
'db'
]
->
query
(
$req
,
array
(
$aArgs
[
'resId'
],
'FRZ'
));
$reqResult
=
$stmt
->
fetchObject
();
var_dump
(
$reqResult
->
nbresult
);
if
(
$reqResult
->
nbresult
==
0
)
{
var_dump
(
'a'
);
$GLOBALS
[
'db'
]
->
query
(
'UPDATE res_letterbox SET status = ? WHERE res_id = ? '
,
[
$aArgs
[
'status'
],
$aArgs
[
'resId'
]]);
}
}
This diff is collapsed.
Click to expand it.
modules/visa/batch/process_mailsFromSignatoryBook.php
+
4
−
6
View file @
fd582fda
...
@@ -256,12 +256,11 @@ foreach ($retrievedMails['isVersion'] as $resId => $value) {
...
@@ -256,12 +256,11 @@ foreach ($retrievedMails['isVersion'] as $resId => $value) {
'dest_contact_id'
=>
$value
->
dest_contact_id
,
'dest_contact_id'
=>
$value
->
dest_contact_id
,
'dest_address_id'
=>
$value
->
dest_address_id
,
'dest_address_id'
=>
$value
->
dest_address_id
,
'dest_user'
=>
$value
->
dest_user
,
'dest_user'
=>
$value
->
dest_user
,
'typist'
=>
$value
->
typist
,
'typist'
=>
$value
->
typist
'validatedStatus'
=>
$validatedStatus
]);
]);
$GLOBALS
[
'db'
]
->
query
(
"UPDATE res_version_attachments set status = 'TRA' WHERE res_id = ?"
,
[
$resId
]);
$GLOBALS
[
'db'
]
->
query
(
"UPDATE res_version_attachments set status = 'TRA' WHERE res_id = ?"
,
[
$resId
]);
Bt_processVisaWorkflow
([
'res_id_master'
=>
$value
->
res_id_master
]);
Bt_processVisaWorkflow
([
'res_id_master'
=>
$value
->
res_id_master
,
'validatedStatus'
=>
$validatedStatus
]);
$historyInfo
=
'La signature de la pièce jointe '
.
$resId
.
' (res_version_attachments) a été validée dans le parapheur externe'
;
$historyInfo
=
'La signature de la pièce jointe '
.
$resId
.
' (res_version_attachments) a été validée dans le parapheur externe'
;
Bt_history
([
Bt_history
([
...
@@ -302,12 +301,11 @@ foreach ($retrievedMails['noVersion'] as $resId => $value) {
...
@@ -302,12 +301,11 @@ foreach ($retrievedMails['noVersion'] as $resId => $value) {
'dest_user'
=>
$value
->
dest_user
,
'dest_user'
=>
$value
->
dest_user
,
'typist'
=>
$value
->
typist
,
'typist'
=>
$value
->
typist
,
'format'
=>
$value
->
format
,
'format'
=>
$value
->
format
,
'encodedFile'
=>
$value
->
encodedFile
,
'encodedFile'
=>
$value
->
encodedFile
'validatedStatus'
=>
$validatedStatus
]);
]);
$GLOBALS
[
'db'
]
->
query
(
"UPDATE res_attachments SET status = 'TRA' WHERE res_id = ?"
,
[
$resId
]);
$GLOBALS
[
'db'
]
->
query
(
"UPDATE res_attachments SET status = 'TRA' WHERE res_id = ?"
,
[
$resId
]);
Bt_processVisaWorkflow
([
'res_id_master'
=>
$value
->
res_id_master
]);
Bt_processVisaWorkflow
([
'res_id_master'
=>
$value
->
res_id_master
,
'validatedStatus'
=>
$validatedStatus
]);
$historyInfo
=
'La signature de la pièce jointe '
.
$resId
.
' (res_attachments) a été validée dans le parapheur externe'
;
$historyInfo
=
'La signature de la pièce jointe '
.
$resId
.
' (res_attachments) a été validée dans le parapheur externe'
;
Bt_history
([
Bt_history
([
...
...
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