/** * Reload this GrowthGroupStructure from the database. * @return void */ public function Reload() { // Make sure we are actually Restored from the database if (!$this->__blnRestored) { throw new QCallerException('Cannot call Reload() on a new, unsaved GrowthGroupStructure object.'); } // Reload the Object $objReloaded = GrowthGroupStructure::Load($this->intId); // Update $this's local variables to match $this->strName = $objReloaded->strName; }
public function btnSubmit_Click($strFormId, $strControlId, $strParameter) { $this->objGroupRegistration->DateReceived = new QDateTime(QDateTime::Now); $this->objGroupRegistration->FirstName = $this->txtFirstName->Text; $this->objGroupRegistration->LastName = $this->txtLastName->Text; $this->objGroupRegistration->Address = $this->txtAddress->Text; $this->objGroupRegistration->City = $this->txtCity->Text; $this->objGroupRegistration->Zipcode = $this->txtZipCode->Text; $this->objGroupRegistration->Email = $this->txtEmail->Text; $this->objGroupRegistration->Phone = $this->txtPhoneNumber->Text; $this->objGroupRegistration->Comments = $this->txtComments->Text; foreach (SourceList::LoadAll() as $objSourceList) { if ($objSourceList->Name == $this->lstSource->SelectedName) { $this->objGroupRegistration->SourceListId = $objSourceList->Id; break; } } $this->objGroupRegistration->Gender = $this->lstGender->SelectedName; $this->objGroupRegistration->GroupRoleId = $this->lstParticipationType->SelectedValue; $strDays = ''; foreach ($this->chkDaysAvailable as $chkDays) { if ($chkDays->Checked) { $strDays .= $chkDays->Text . ', '; } } $strDays = substr($strDays, 0, strlen($strDays) - 1); $this->objGroupRegistration->GroupDay = $strDays; $this->objGroupRegistration->PreferredLocation1 = $this->lstLocationFirst->SelectedName; $this->objGroupRegistration->PreferredLocation2 = $this->lstLocationSecond->SelectedName; $this->objGroupRegistration->Save(); foreach ($this->chkGroupType as $chkGroup) { if ($chkGroup->Checked) { $this->objGroupRegistration->AssociateGrowthGroupStructureAsGroupstructure(GrowthGroupStructure::Load($chkGroup->Name)); } } // Send Facilitator Application if user selected to be a Facilitator if ($this->lstParticipationType->SelectedName == 'Facilitator') { $this->SendMessage(); } //Send notification $this->SendNotification(); QApplication::Redirect('/success.php'); }
$objParentGroup = Group::CreateGroupForMinistry($objMinistry, GroupType::GroupCategory, trim($strTokens[0]), 'Growth Groups in ' . $objGrowthGroupLocation->Location); $objGroupCategory = new GroupCategory(); $objGroupCategory->Group = $objParentGroup; $objGroupCategory->Save(); $objGgResult = $objMySqli->Query('SELECT * FROM growth_group WHERE growth_group_location_id=' . $objRow['id'] . ' ORDER BY id'); while ($objGgRow = $objGgResult->fetch_array()) { $objGroup = Group::CreateGroupForMinistry($objMinistry, GroupType::GrowthGroup, $objGgRow['name'], 'Growth Group for ' . $objGgRow['name'], $objParentGroup); $objGrowthGroup = new GrowthGroup(); $objGrowthGroup->Group = $objGroup; $objGrowthGroup->GrowthGroupLocationId = $objGgRow['growth_group_location_id']; $objGrowthGroup->GrowthGroupDayTypeId = $objGgRow['growth_group_day_type_id']; $objGrowthGroup->MeetingBitmap = $objGgRow['meeting_bitmap']; $objGrowthGroup->StartTime = $objGgRow['start_time']; $objGrowthGroup->EndTime = $objGgRow['end_time']; $objGrowthGroup->Address1 = $objGgRow['address_1']; $objGrowthGroup->Address2 = $objGgRow['address_2']; $objGrowthGroup->CrossStreet1 = $objGgRow['cross_street_1']; $objGrowthGroup->CrossStreet2 = $objGgRow['cross_street_2']; $objGrowthGroup->ZipCode = $objGgRow['zip_code']; $objGrowthGroup->Longitude = $objGgRow['longitude']; $objGrowthGroup->Latitude = $objGgRow['latitude']; $objGrowthGroup->Accuracy = $objGgRow['accuracy']; $objGrowthGroup->Save(); $objStructureResult = $objMySqli->Query('SELECT * FROM growthgroupstructure_growthgroup_assn where growth_group_id=' . $objGgRow['id']); while ($objStructureRow = $objStructureResult->fetch_array()) { $objGrowthGroup->AssociateGrowthGroupStructure(GrowthGroupStructure::Load($objStructureRow['growth_group_structure_id'])); } } } $objMySqli->Close(); Group::RefreshHierarchyDataForMinistry($objMinistry->Id);
protected function lstGrowthGroupStructuresAsGroupstructure_Update() { if ($this->lstGrowthGroupStructuresAsGroupstructure) { $this->objGroupRegistrations->UnassociateAllGrowthGroupStructuresAsGroupstructure(); $objSelectedListItems = $this->lstGrowthGroupStructuresAsGroupstructure->SelectedItems; if ($objSelectedListItems) { foreach ($objSelectedListItems as $objListItem) { $this->objGroupRegistrations->AssociateGrowthGroupStructureAsGroupstructure(GrowthGroupStructure::Load($objListItem->Value)); } } } }
/** * Static Helper Method to Create using PK arguments * You must pass in the PK arguments on an object to load, or leave it blank to create a new one. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to * edit, or if we are also allowed to create a new one, etc. * * @param mixed $objParentObject QForm or QPanel which will be using this GrowthGroupStructureMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing GrowthGroupStructure object creation - defaults to CreateOrEdit * @return GrowthGroupStructureMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objGrowthGroupStructure = GrowthGroupStructure::Load($intId); // GrowthGroupStructure was found -- return it! if ($objGrowthGroupStructure) { return new GrowthGroupStructureMetaControl($objParentObject, $objGrowthGroupStructure); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a GrowthGroupStructure object with PK arguments: ' . $intId); } } // If EditOnly is specified, throw an exception } else { if ($intCreateType == QMetaControlCreateType::EditOnly) { throw new QCallerException('No PK arguments specified'); } } // If we are here, then we need to create a new record return new GrowthGroupStructureMetaControl($objParentObject, new GrowthGroupStructure()); }