Skip to content

Commit

Permalink
fix(Massive actions) rights uniformisation for twig and massive actio…
Browse files Browse the repository at this point in the history
…ns to add tasks and followups
  • Loading branch information
tsadock authored and trasher committed Feb 9, 2023
1 parent 635e949 commit 2519e73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CommonITILObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -3699,7 +3699,7 @@ public static function processMassiveActionsForOneItemtype(
'state' => $input['state'],
'content' => $input['content']
];
if ($task->can(-1, CREATE, $input2)) {
if ($task->can(-1, CREATE, $input2) && !in_array($item->fields['status'], array_merge($item->getSolvedStatusArray(), $item->getClosedStatusArray()))) {
if ($task->add($input2)) {
$ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/ITILFollowup.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ public static function processMassiveActionsForOneItemtype(
$fup = new self();
foreach ($ids as $id) {
if ($item->getFromDB($id)) {
if (in_array($item->fields['status'], $item->getClosedStatusArray())) {
if (in_array($item->fields['status'], array_merge($item->getSolvedStatusArray(), $item->getClosedStatusArray()))) {
$ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
$ma->addMessage($item->getErrorMessage(ERROR_RIGHT));
} else {
Expand Down

0 comments on commit 2519e73

Please sign in to comment.