Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
thirdPartyArchiving
Commits
ba74861d
Verified
Commit
ba74861d
authored
Mar 13, 2019
by
Alexandre Morin
Browse files
Fix Destruction of the archives by the batch processing
parent
b79544ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
bundle/medona/Controller/ArchiveDestructionRequest.php
View file @
ba74861d
...
...
@@ -271,7 +271,19 @@ class ArchiveDestructionRequest extends abstractMessage
{
$results
=
array
();
$index
=
$this
->
sdoFactory
->
index
(
'medona/message'
,
array
(
'messageId'
),
'type = "ArchiveDestructionRequest" AND status = "validated"'
);
$index
=
$this
->
sdoFactory
->
index
(
'medona/message'
,
array
(
'messageId'
),
'(
type = "ArchiveDestructionRequest"
OR type = "ArchiveRestitution"
OR (
type = "ArchiveTransfer"
&& isIncoming = false
)
)
AND status = "validated"'
);
foreach
(
$index
as
$messageId
)
{
$results
[(
string
)
$messageId
]
=
$this
->
process
(
$messageId
);
...
...
@@ -311,7 +323,7 @@ class ArchiveDestructionRequest extends abstractMessage
try
{
$archives
=
$this
->
archiveController
->
destruct
(
$archiveIds
);
$logMessage
=
[
"message"
=>
"%s archives are deleted"
,
"variables"
=>
count
(
$archives
)];
$logMessage
=
[
"message"
=>
"%s archives are deleted"
,
"variables"
=>
count
(
$archives
[
'success'
]
)];
\
laabs
::
notify
(
\
bundle\audit\AUDIT_ENTRY_OUTPUT
,
$logMessage
);
$message
->
status
=
"processed"
;
...
...
@@ -338,8 +350,15 @@ class ArchiveDestructionRequest extends abstractMessage
$archiveDestructionNotificationController
=
\
laabs
::
newController
(
"medona/ArchiveDestructionNotification"
);
// TO DO : Write destruction failures in comments
$replyMessage
=
$archiveDestructionNotificationController
->
send
(
$message
,
$archives
[
'success'
]);
try
{
if
(
count
(
$archives
[
'success'
])
>
0
)
{
$replyMessage
=
$archiveDestructionNotificationController
->
send
(
$message
,
$archives
[
'success'
]);
}
else
{
return
;
}
}
catch
(
\
Exception
$e
)
{
throw
$e
;
}
return
$replyMessage
->
messageId
;
}
...
...
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