public function btnSave_Click($strFormId, $strControlId, $strParameter) { $objPerson = $this->pnlPerson->Person; // Validate the Dates $dttDateArray = GroupParticipation::GetParticipationDatesArrayForPersonIdGroupIdGroupRoleId($objPerson->Id, $this->objGroup->Id, $this->lstRole->SelectedValue); // Add This One $dttDateArray[] = array($this->dtxDateStart->DateTime, $this->dtxDateEnd->DateTime); // If we have trouble trying to add it, let's redirect the user to the full record if (!GroupParticipation::IsValidDates($dttDateArray)) { QApplication::DisplayAlert('You are adding a participation that already exists. Taking you to this person\'s record for more information.'); return $this->ReturnTo('#' . $this->objGroup->Id . '/edit_participation/' . $objPerson->Id); } // Go ahead and create the record $this->objGroup->AddPerson($objPerson, $this->lstRole->SelectedValue, $this->dtxDateStart->DateTime, $this->dtxDateEnd->DateTime); return $this->ReturnTo('#' . $this->objGroup->Id); }
public function btnAssign_Click($strFormId, $strControlId, $strParameter) { $objPerson = Person::Load($this->intPersonId); $intRoleId = $this->objRegistrant->GroupRoleId; $this->objRegistrant->GroupsPlaced = ''; foreach ($this->rbtnSelectArray as $rbtnSelect) { if ($rbtnSelect->Checked) { $objGroup = Group::Load($rbtnSelect->ActionParameter); // Validate the Dates $dttDateArray = GroupParticipation::GetParticipationDatesArrayForPersonIdGroupIdGroupRoleId($objPerson->Id, $objGroup->Id, $intRoleId); // Add This Date $dtDateStart = new QDateTime(QDateTime::Now); $dttDateArray[] = array($dtDateStart, null); // Go ahead and create the record $objGroup->AddPerson($objPerson, $intRoleId, $dtDateStart, null); $this->objRegistrant->GroupsPlaced .= $objGroup->Name . ','; } } $this->objRegistrant->GroupsPlaced = substr($this->objRegistrant->GroupsPlaced, 0, strlen($this->objRegistrant->GroupsPlaced) - 1); $this->objRegistrant->DateProcessed = new QDateTime(QDateTime::Now); $this->objRegistrant->ProcessedFlag = true; $this->objRegistrant->Save(); // GJS: Send email to both Person and facilitator. CC Carisa $this->SendMessage(); // Hide panels and refresh the participants page // by calling the Form's Method CallBack, passing in "true" to state that we've made an update $strMethodCallBack = $this->strMethodCallBack; $this->objForm->{$strMethodCallBack}(true); }