PHRAS-3399 lis new user, save not notify

This commit is contained in:
aynsix
2021-03-25 16:19:15 +03:00
parent 101399dd24
commit 420a645580
24 changed files with 1709 additions and 1489 deletions

View File

@@ -445,17 +445,20 @@ class PushController extends Controller
$receipt = $request->get('recept') ? $this->getAuthenticatedUser()->getEmail() : '';
$this->dispatch(
PhraseaEvents::VALIDATION_CREATE,
new ValidationEvent(
$validationParticipant,
$basket,
$url,
$request->request->get('message'),
$receipt,
(int)$request->request->get('duration')
)
);
// send only mail if notify is needed
if ($request->request->get('notify') == 1) {
$this->dispatch(
PhraseaEvents::VALIDATION_CREATE,
new ValidationEvent(
$validationParticipant,
$basket,
$url,
$request->request->get('message'),
$receipt,
(int)$request->request->get('duration')
)
);
}
}
if ($feedbackAction == 'adduser') {
@@ -900,15 +903,20 @@ class PushController extends Controller
$feedbackaction = $request->request->get('feedbackaction');
$participants = [];
$participantUserIds = '';
$initiatorUserId = null;
if ($context === 'Feedback' && $feedbackaction === 'adduser' && $push->is_basket() && $push->get_original_basket()->getValidation()) {
$participants = $push->get_original_basket()->getValidation()->getParticipants();
$participantUserIds = implode('_', $push->get_original_basket()->getValidation()->getListParticipantsUserId());
$initiatorUserId = $push->get_original_basket()->getValidation()->getInitiator()->getId();
} elseif ($context === 'Feedback') {
// Display the initiator in the participant list window when the first time to create a feedback
$validationParticipant = new ValidationParticipant();
$validationParticipant->setUser($this->getAuthenticatedUser());
$validationParticipant->setCanSeeOthers(1);
array_push($participants, $validationParticipant);
$initiatorUserId = $participantUserIds = $this->getAuthenticatedUser()->getId();
}
$repository = $this->getUserListRepository();
@@ -923,7 +931,9 @@ class PushController extends Controller
'context' => $context,
'RecommendedUsers' => $recommendedUsers,
'participants' => $participants,
'feedbackAction' => $feedbackaction
'participantUserIds' => $participantUserIds,
'feedbackAction' => $feedbackaction,
'initiatorUserId' => $initiatorUserId
]
);
}