mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +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()) {
|
if ( ! $basket->getValidation()->getParticipant($user)->getCanAgree()) {
|
||||||
throw new ControllerException('You have not right to agree');
|
throw new ControllerException('You have not right to agree');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$agreed = false;
|
||||||
/* @var $basket \Entities\Basket */
|
/* @var $basket \Entities\Basket */
|
||||||
foreach ($basket->getElements() as $element) {
|
foreach ($basket->getElements() as $element) {
|
||||||
if (null === $element->getUserValidationDatas($user)->getAgreement()) {
|
if (null !== $element->getUserValidationDatas($user)->getAgreement()) {
|
||||||
throw new ControllerException(_('You have to give your feedback at least on one document to send a report'));
|
$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 */
|
/* @var $basket \Entities\Basket */
|
||||||
$participant = $basket->getValidation()->getParticipant($user);
|
$participant = $basket->getValidation()->getParticipant($user);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user