mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Fix validation agreement check
This commit is contained in:
@@ -508,13 +508,19 @@ return call_user_func(
|
||||
if ( ! $basket->getValidation()->getParticipant($user)->getCanAgree()) {
|
||||
throw new ControllerException('You have not right to agree');
|
||||
}
|
||||
|
||||
$agreed = false;
|
||||
/* @var $basket \Entities\Basket */
|
||||
foreach ($basket->getElements() as $element) {
|
||||
if (null === $element->getUserValidationDatas($user)->getAgreement()) {
|
||||
throw new ControllerException(_('You have to give your feedback at least on one document to send a report'));
|
||||
if (null !== $element->getUserValidationDatas($user)->getAgreement()) {
|
||||
$agreed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$agreed) {
|
||||
throw new ControllerException(_('You have to give your feedback at least on one document to send a report'));
|
||||
}
|
||||
|
||||
/* @var $basket \Entities\Basket */
|
||||
$participant = $basket->getValidation()->getParticipant($user);
|
||||
|
||||
|
Reference in New Issue
Block a user