feat: remind teamers of open questionnaires on the dashboard
This commit is contained in:
1 parent
5e4e574076
commit
890e04f8a6
7 files changed
+313
-4
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Security\Voter;
|
||||
|
||||
use App\Config\QuestionnaireCatalog;
|
||||
use App\Entity\Disposition;
|
||||
use App\Entity\Upload;
|
||||
use App\Entity\User;
|
||||
@@ -33,10 +34,7 @@ class DispositionVoter extends Voter
|
||||
private readonly Security $security,
|
||||
?string $questionnaireGoLive,
|
||||
) {
|
||||
$this->questionnaireGoLive = null === $questionnaireGoLive
|
||||
? null
|
||||
: (\DateTimeImmutable::createFromFormat('!Y-m-d', $questionnaireGoLive)
|
||||
?: throw new \InvalidArgumentException(sprintf('questionnaire_go_live "%s" is not a Y-m-d date', $questionnaireGoLive)));
|
||||
$this->questionnaireGoLive = QuestionnaireCatalog::parseGoLive($questionnaireGoLive);
|
||||
}
|
||||
|
||||
protected function supports(string $attribute, mixed $subject): bool
|
||||
@@ -128,6 +126,9 @@ class DispositionVoter extends Voter
|
||||
* assignment ending today counts as over, as in DispositionRepository's feedback queries.
|
||||
*
|
||||
* Skip-formalities placements are left out, as they are from contract, invoice and feedback.
|
||||
*
|
||||
* DispositionRepository::getPendingQuestionnaireQuery() applies the same rules in DQL for the
|
||||
* dashboard; change both together.
|
||||
*/
|
||||
private function assertQuestionnaireAllowed(TokenInterface $token, Disposition $disposition): bool
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user