Commit 3cdb671f authored by ErikHommel's avatar ErikHommel
Browse files

fix issue 7505 - tested locally

parent 03d5b6b2
## Version 1.31
* issue 7505: generate study participation ID in the invite task before sending out the actual email.
## Version 1.30
* issue 7314: add from email to MSP and process in invite by email (less than 50)
......
......@@ -56,7 +56,7 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteBulk extends CRM_Contact_Form_
public function postProcess() {
// only if we have a study, invited ids and a template
if (isset($this->_studyId) && !empty($this->_invited)) {
// change study status to invitation pending
// change study status to invitation pending AND generate study participation ID (issue 7505)
$this->changeStatusInvitationPending();
// first create temporary group
try {
......@@ -73,6 +73,7 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteBulk extends CRM_Contact_Form_
}
}
/**
* Method to change the invitation pending status for each invite
*/
......@@ -81,8 +82,9 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteBulk extends CRM_Contact_Form_
foreach ($this->_invited as $invitedContactId => $invitedData) {
$caseId = CRM_Nihrbackbone_NbrVolunteerCase::getActiveParticipationCaseId($this->_studyId, $invitedContactId);
if ($caseId) {
// issue 7505: generate the study participation ID because it might be required in the invite mail!
CRM_Nihrnumbergenerator_StudyParticipantNumberGenerator::createNewNumberForCase($caseId);
CRM_Nihrbackbone_NbrVolunteerCase::updateStudyStatus($caseId, $invitedContactId, $status);
}
else {
Civi::log()->warning("Could not find a case ID for volunteer with ID " . $invitedContactId . " in study "
......
......@@ -121,6 +121,8 @@ class CRM_Nbrprojectvolunteerlist_Form_Task_InviteByEmail extends CRM_Contact_Fo
$caseIds = $this->getRelevantCaseIds();
// then send email (include case_id so the activity is recorded) and add an invited activity
foreach ($caseIds as $caseId => $contactId) {
// issue 7505: generate the study participation ID because it might be required in the invite mail!
CRM_Nihrnumbergenerator_StudyParticipantNumberGenerator::createNewNumberForCase($caseId);
$emailParams = [
'template_id' => $this->_submitValues['template_id'],
'contact_id' => $contactId,
......
......@@ -14,8 +14,8 @@
<url desc="Support">https://civicoop.org</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-02-15</releaseDate>
<version>1.30</version>
<releaseDate>2021-02-25</releaseDate>
<version>1.31</version>
<develStage>beta</develStage>
<compatibility>
<ver>4.7</ver>
......
Markdown is supported
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