Commit f826c739 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FIX #17812 TIME 1:00 delegate can give parallel opinion

parent 2d7a215a
......@@ -944,13 +944,13 @@ class ActionMethodController
public static function giveOpinionParallel(array $args)
{
ValidatorModel::notEmpty($args, ['resId']);
ValidatorModel::intVal($args, ['resId']);
ValidatorModel::notEmpty($args, ['resId', 'userId']);
ValidatorModel::intVal($args, ['resId', 'userId']);
$currentStep = ListInstanceModel::get([
'select' => ['listinstance_id', 'item_id'],
'where' => ['res_id = ?', 'difflist_type = ?', 'item_id = ?', 'item_mode in (?)'],
'data' => [$args['resId'], 'entity_id', $GLOBALS['id'], ['avis', 'avis_copy', 'avis_info']],
'data' => [$args['resId'], 'entity_id', $args['userId'], ['avis', 'avis_copy', 'avis_info']],
'limit' => 1
]);
......
......@@ -1431,6 +1431,13 @@ class PreProcessActionController
'where' => ['res_id = ?', 'difflist_type = ?', 'process_date is null', 'item_id = ?', 'item_mode = ?'],
'data' => [$resId, 'entity_id', $GLOBALS['id'], 'avis']
]);
if (empty($isInCircuit)) {
$isInCircuit = ListInstanceModel::get([
'select' => [1],
'where' => ['res_id = ?', 'difflist_type = ?', 'process_date is null', 'item_id = ?', 'item_mode = ?'],
'data' => [$resId, 'entity_id', $args['userId'], 'avis']
]);
}
if (empty($isInCircuit)) {
$resourcesInformation['error'][] = ['alt_identifier' => $resource['alt_identifier'], 'res_id' => $resId, 'reason' => 'userNotInDiffusionList'];
} else {
......
......@@ -505,7 +505,7 @@ class ResourceListController
}
if (!empty($method)) {
$methodResponse = ActionMethodController::$method(['resId' => $resId, 'data' => $body['data'], 'note' => $body['note'], 'action' => $action, 'resources' => $resourcesForAction]);
$methodResponse = ActionMethodController::$method(['resId' => $resId, 'data' => $body['data'], 'note' => $body['note'], 'action' => $action, 'resources' => $resourcesForAction, 'userId' => $aArgs['userId']]);
if (!empty($methodResponse['errors'])) {
if (empty($methodResponses['errors'])) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment