protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= $this->objHousehold->Name; // Setup DataGrids $this->dtgMembers = new HouseholdParticipationDataGrid($this); $this->dtgMembers->AddColumn(new QDataGridColumn('Remove', '<?= $_FORM->RenderRadio($_ITEM); ?>', 'Width=80px', 'HtmlEntities=false')); $this->dtgMembers->MetaAddColumn('Role', 'Width=80px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhone->Number, 'Name=Phone', 'Width=200px'); $this->dtgMembers->GetColumn(0)->OrderByClause = null; $this->dtgMembers->GetColumn(1)->OrderByClause = null; $this->dtgMembers->GetColumn(2)->OrderByClause = null; $this->dtgMembers->GetColumn(3)->OrderByClause = null; $this->dtgMembers->GetColumn(4)->OrderByClause = null; $this->dtgMembers->DataSource = $this->objHousehold->GetOrderedParticipantArray(); $this->btnSave = new QButton($this); $this->btnSave->Text = 'Remove'; $this->btnSave->CssClass = 'primary'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); $this->dlgMessage = new MessageDialog($this); }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= $this->objHousehold->Name; // Setup DataGrids $this->dtgMembers = new QDataGrid($this); $this->dtgMembers->AlternateRowStyle->CssClass = 'alternate'; $this->dtgMembers->AddColumn(new QDataGridColumn('Head', '<?= $_FORM->RenderHead($_ITEM); ?>', 'HtmlEntities=false', 'Width=50px')); $this->dtgMembers->AddColumn(new QDataGridColumn('Name', '<?= $_ITEM->Person->Name; ?>', 'Width=250px')); $this->dtgMembers->AddColumn(new QDataGridColumn('Role in Household', '<?= $_FORM->RenderRole($_ITEM); ?>', 'HtmlEntities=false', 'Width=630px')); $this->dtgMembers->SetDataBinder('dtgMembers_Bind'); $this->btnSave = new QButton($this); $this->btnSave->Text = 'Update'; $this->btnSave->CssClass = 'primary'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= 'Home Address - ' . $this->objHousehold->Name; $this->pnlContent = new EditHouseholdHomeAddressPanel($this); $this->pnlContent->objDelegate = new EditHomeAddressDelegate($this->pnlContent, '/households/view.php/' . $this->objHousehold->Id, QApplication::PathInfo(1)); $this->pnlContent->btnSave->AddAction(new QClickEvent(), new QShowDialogBox($this->pnlContent->objDelegate->dlgMessage)); $this->pnlContent->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this->pnlContent, 'btnSave_Click')); $this->strPageTitle = ($this->pnlContent->objDelegate->mctAddress->EditMode ? 'Edit' : 'Create New') . ' ' . $this->strPageTitle; }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= $this->objHousehold->Name; $this->lblHeadline = new QLabel($this); $this->lblHeadline->TagName = 'h3'; $this->lblHeadline->Text = 'Select Individual(s) to Split Off'; // Setup DataGrids $this->dtgMembers = new HouseholdParticipationDataGrid($this); $this->dtgMembers->AddColumn(new QDataGridColumn('Select', '<?= $_FORM->RenderRadio($_ITEM); ?>', 'Width=80px', 'HtmlEntities=false')); $this->dtgMembers->MetaAddColumn('Role', 'Width=80px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhoneText, 'Name=Phone', 'Width=200px'); $this->dtgMembers->GetColumn(0)->OrderByClause = null; $this->dtgMembers->GetColumn(1)->OrderByClause = null; $this->dtgMembers->GetColumn(2)->OrderByClause = null; $this->dtgMembers->GetColumn(3)->OrderByClause = null; $this->dtgMembers->GetColumn(4)->OrderByClause = null; $this->dtgMembers->SetDataBinder('dtgMembers_Bind'); $this->lstHead = new QListBox($this); $this->lstHead->Name = 'Head of New Household'; $this->lstHead->Visible = false; $this->pnlAddress = new EditHouseholdHomeAddressPanel($this); $this->pnlAddress->Visible = false; $this->lstHead->Name = 'Head of New Household'; $this->lstHead->Visible = false; $this->btnNext = new QButton($this); $this->btnNext->Text = 'Next'; $this->btnNext->CssClass = 'primary'; $this->btnNext->AddAction(new QClickEvent(), new QAjaxAction('btnNext_Click')); $this->btnNext->CausesValidation = true; $this->btnSave = new QButton($this); $this->btnSave->Text = 'Save Changes'; $this->btnSave->CssClass = 'primary'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnSave->Visible = false; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); $this->dlgMessage = new MessageDialog($this); }
protected function Form_Create() { $this->objHousehold = Household::Load(QApplication::PathInfo(1)); if ($this->objHousehold) { if (!HouseholdParticipation::LoadByPersonIdHouseholdId($this->objPerson->Id, $this->objHousehold->Id)) { QApplication::Redirect('/individuals/'); } } else { $objHouseholdParticipationArray = HouseholdParticipation::LoadArrayByPersonId($this->objPerson->Id); if ($objHouseholdParticipationArray) { $this->objHousehold = $objHouseholdParticipationArray[0]->Household; } } $this->strPageTitle .= $this->objPerson->Name; // Unset based on Permissions if (!QApplication::$Login->IsPermissionAllowed(PermissionType::AccessStewardship)) { unset($this->strSubNavItemArray['stewardship']); } if (!QApplication::$Login->IsPermissionAllowed(PermissionType::MergeIndividuals)) { unset($this->strSubNavItemArray['merge']); } // Alter Inactive/Active based on whether or not the person has a login if ($this->objPerson->PublicLogin) { $this->strSubNavItemArray['online'][2] = null; } $this->lblHeading = new QLabel($this); $this->lblSubheading = new QLabel($this); $this->lblSubheading->CssClass = 'subhead'; $this->lblSubheading->HtmlEntities = false; $this->lstHouseholdSwitcher = new QListBox($this); $this->lstHouseholdSwitcher->SetCustomStyle('float', 'right'); $this->lstHouseholdSwitcher->SetCustomStyle('margin-top', '8px;'); $this->lstHouseholdSwitcher->Visible = false; $this->lstHouseholdSwitcher->AddAction(new QChangeEvent(), new QAjaxAction('lstHouseholdSwitcher_Change')); $this->pnlHouseholdSelector = new HouseholdSelectorPanel($this); $this->pnlSubnavBar = new ViewIndividualSubNavPanel($this); $this->pnlMainContent = new QPanel($this); $this->pnlMainContent->AutoRenderChildren = true; $this->pnlMainContent->CssClass = 'subnavContent'; $this->SetUrlHashProcessor('Form_ProcessHash'); $this->lblHeading_Refresh(); $this->lstHouseholdSwitcher_Refresh(); }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= $this->objHousehold->Name; // Setup DataGrids $this->dtgMembers = new HouseholdParticipationDataGrid($this); $this->dtgMembers->MetaAddColumn('Role', 'Width=80px', 'Html=<?= $_ITEM->RoleToDisplay; ?>'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhone->Number, 'Name=Phone', 'Width=290px'); $this->dtgMembers->GetColumn(0)->OrderByClause = null; $this->dtgMembers->GetColumn(1)->OrderByClause = null; $this->dtgMembers->GetColumn(2)->OrderByClause = null; $this->dtgMembers->GetColumn(3)->OrderByClause = null; $this->dtgMembers->SetDataBinder('dtgMembers_Bind'); $this->dtgHomeAddresses = new QDataGrid($this); $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('', '<?= $_FORM->RenderHomeAddressType($_ITEM); ?>', 'HtmlEntities=false', 'Width=60px')); $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('Address', '<?= $_FORM->RenderHomeAddress($_ITEM); ?>', 'HtmlEntities=false', 'Width=235px')); $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('City, State', '<?= $_ITEM->City . ", " . $_ITEM->State; ?>', 'Width=160px')); $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('Zip', '<?= $_ITEM->ZipCode; ?>', 'Width=90px')); $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('Phone', '<?= $_FORM->RenderHomePhone($_ITEM); ?>', 'Width=105px')); $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('', '<?= $_ITEM->InvalidFlag ? "<img src=\\"/assets/images/marker_invalid.png\\" title=\\"Invalid Address\\"/>" : null; ?>', 'Width=54px', 'HtmlEntities=false')); $this->dtgHomeAddresses->SetDataBinder('dtgHomeAddresses_Bind', $this); $this->pxySetCurrentHomeAddress = new QControlProxy($this); $this->pxySetCurrentHomeAddress->AddAction(new QClickEvent(), new QAjaxAction('pxySetCurrentHomeAddress_Click')); $this->pxySetCurrentHomeAddress->AddAction(new QClickEvent(), new QTerminateAction()); // Display Stewardship Preferences? if (QApplication::IsLoginHasPermission(PermissionType::AccessStewardship)) { $this->lblStewardship = new QLabel($this); $this->lblStewardship->HtmlEntities = false; $this->lblStewardship_Refresh(); $this->pxyStewardship = new QControlProxy($this); $this->pxyStewardship->AddAction(new QClickEvent(), new QAjaxAction('pxyStewardship_Click')); $this->pxyStewardship->AddAction(new QClickEvent(), new QTerminateAction()); } }
public function radSelect_Click($strFormId, $strControlId, $strParameter) { $this->objSelectedHousehold = Household::Load($strParameter); $this->lstHead_Refresh(); }
/** * Reload this Household 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 Household object.'); } // Reload the Object $objReloaded = Household::Load($this->intId); // Update $this's local variables to match $this->strName = $objReloaded->strName; $this->HeadPersonId = $objReloaded->HeadPersonId; $this->blnCombinedStewardshipFlag = $objReloaded->blnCombinedStewardshipFlag; $this->strMembers = $objReloaded->strMembers; }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'PersonId': // Gets the value for intPersonId (Not Null) // @return integer return $this->intPersonId; case 'HouseholdId': // Gets the value for intHouseholdId (Not Null) // @return integer return $this->intHouseholdId; case 'Role': // Gets the value for strRole // @return string return $this->strRole; case 'RoleOverride': // Gets the value for strRoleOverride // @return string return $this->strRoleOverride; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Person': // Gets the value for the Person object referenced by intPersonId (Not Null) // @return Person try { if (!$this->objPerson && !is_null($this->intPersonId)) { $this->objPerson = Person::Load($this->intPersonId); } return $this->objPerson; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Household': // Gets the value for the Household object referenced by intHouseholdId (Not Null) // @return Household try { if (!$this->objHousehold && !is_null($this->intHouseholdId)) { $this->objHousehold = Household::Load($this->intHouseholdId); } return $this->objHousehold; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
<?php require dirname(__FILE__) . '/../../includes/prepend.inc.php'; QApplication::Authenticate(null, array(PermissionType::AccessStewardship)); // Setup Zend Framework load set_include_path(get_include_path() . ':' . __INCLUDES__); require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Pdf'); // Expected PathInfo to be PersonId/HouseholdId/Year // Note that HouseholdId is OPTIONAL -- if HouseholdId, then it is a combined statement for the entire household // Otherwise, if no HouseholdId (e.g. "0"), then it is just a individual statement $objPerson = Person::Load(QApplication::PathInfo(0)); $objObject = $objPerson; if (QApplication::PathInfo(1)) { $objHousehold = Household::Load(QApplication::PathInfo(1)); if (!$objHousehold) { QApplication::Redirect('/main/'); } if (!HouseholdParticipation::LoadByPersonIdHouseholdId($objPerson->Id, $objHousehold->Id)) { QApplication::Redirect('/main/'); } $objObject = $objHousehold; } if (!(QApplication::PathInfo(2) >= 1950 && QApplication::PathInfo(2) <= 2500)) { QApplication::Redirect('/main/'); } // Create the PDF Object $objPdf = new Zend_Pdf(); StewardshipContribution::GenerateReceiptInPdf($objPdf, $objObject, QApplication::PathInfo(2), true); // Get PDF document as a string $strData = $objPdf->render();
public function testMergeHouseholds() { $objOldHead = $this->objMultiplePersonHousehold1->HeadPerson; $objHeadPerson = Person::CreatePerson('HeadOfOne', null, 'Person', true); $objMergeHousehold = Household::CreateHousehold($objHeadPerson); $this->objMultiplePersonHousehold1->MergeHousehold($objMergeHousehold, $objHeadPerson); $this->AssertNull(Household::Load($objMergeHousehold->Id), 'MergeHousehold did not delete merged household'); $this->AssertEquals($this->objMultiplePersonHousehold1->CountHouseholdParticipations(), 4, 'MergeHousehold Person Count incorrect'); $objOldHead = Person::Load($objOldHead->Id); $this->AssertEquals($objOldHead->GetHouseholdStatus(), Person::HouseholdStatusMemberOfOne, 'MergeHousehold OldHead Status incorrect'); $objHeadPerson = Person::Load($objHeadPerson->Id); $this->AssertEquals($objHeadPerson->GetHouseholdStatus(), Person::HouseholdStatusHeadOfFamily, 'MergeHousehold NewHead Status incorrect'); $this->objMultiplePersonHousehold1->SetAsHeadPerson($objOldHead); $this->objMultiplePersonHousehold1->UnassociatePerson($objHeadPerson); $this->AssertEquals($this->objMultiplePersonHousehold1->CountHouseholdParticipations(), 3, 'MergeHousehold Person Count incorrect'); $objHeadPerson->Delete(); }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'AddressTypeId': // Gets the value for intAddressTypeId (Not Null) // @return integer return $this->intAddressTypeId; case 'PersonId': // Gets the value for intPersonId // @return integer return $this->intPersonId; case 'HouseholdId': // Gets the value for intHouseholdId // @return integer return $this->intHouseholdId; case 'PrimaryPhoneId': // Gets the value for intPrimaryPhoneId // @return integer return $this->intPrimaryPhoneId; case 'Address1': // Gets the value for strAddress1 // @return string return $this->strAddress1; case 'Address2': // Gets the value for strAddress2 // @return string return $this->strAddress2; case 'Address3': // Gets the value for strAddress3 // @return string return $this->strAddress3; case 'City': // Gets the value for strCity // @return string return $this->strCity; case 'State': // Gets the value for strState // @return string return $this->strState; case 'ZipCode': // Gets the value for strZipCode // @return string return $this->strZipCode; case 'Country': // Gets the value for strCountry // @return string return $this->strCountry; case 'CurrentFlag': // Gets the value for blnCurrentFlag // @return boolean return $this->blnCurrentFlag; case 'InvalidFlag': // Gets the value for blnInvalidFlag // @return boolean return $this->blnInvalidFlag; case 'VerificationCheckedFlag': // Gets the value for blnVerificationCheckedFlag // @return boolean return $this->blnVerificationCheckedFlag; case 'DateUntilWhen': // Gets the value for dttDateUntilWhen // @return QDateTime return $this->dttDateUntilWhen; case 'InternationalFlag': // Gets the value for blnInternationalFlag // @return boolean return $this->blnInternationalFlag; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Person': // Gets the value for the Person object referenced by intPersonId // @return Person try { if (!$this->objPerson && !is_null($this->intPersonId)) { $this->objPerson = Person::Load($this->intPersonId); } return $this->objPerson; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Household': // Gets the value for the Household object referenced by intHouseholdId // @return Household try { if (!$this->objHousehold && !is_null($this->intHouseholdId)) { $this->objHousehold = Household::Load($this->intHouseholdId); } return $this->objHousehold; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'PrimaryPhone': // Gets the value for the Phone object referenced by intPrimaryPhoneId // @return Phone try { if (!$this->objPrimaryPhone && !is_null($this->intPrimaryPhoneId)) { $this->objPrimaryPhone = Phone::Load($this->intPrimaryPhoneId); } return $this->objPrimaryPhone; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_FormAnswer': // Gets the value for the private _objFormAnswer (Read-Only) // if set due to an expansion on the form_answer.address_id reverse relationship // @return FormAnswer return $this->_objFormAnswer; case '_FormAnswerArray': // Gets the value for the private _objFormAnswerArray (Read-Only) // if set due to an ExpandAsArray on the form_answer.address_id reverse relationship // @return FormAnswer[] return (array) $this->_objFormAnswerArray; case '_PersonAsMailing': // Gets the value for the private _objPersonAsMailing (Read-Only) // if set due to an expansion on the person.mailing_address_id reverse relationship // @return Person return $this->_objPersonAsMailing; case '_PersonAsMailingArray': // Gets the value for the private _objPersonAsMailingArray (Read-Only) // if set due to an ExpandAsArray on the person.mailing_address_id reverse relationship // @return Person[] return (array) $this->_objPersonAsMailingArray; case '_PersonAsStewardship': // Gets the value for the private _objPersonAsStewardship (Read-Only) // if set due to an expansion on the person.stewardship_address_id reverse relationship // @return Person return $this->_objPersonAsStewardship; case '_PersonAsStewardshipArray': // Gets the value for the private _objPersonAsStewardshipArray (Read-Only) // if set due to an ExpandAsArray on the person.stewardship_address_id reverse relationship // @return Person[] return (array) $this->_objPersonAsStewardshipArray; case '_Phone': // Gets the value for the private _objPhone (Read-Only) // if set due to an expansion on the phone.address_id reverse relationship // @return Phone return $this->_objPhone; case '_PhoneArray': // Gets the value for the private _objPhoneArray (Read-Only) // if set due to an ExpandAsArray on the phone.address_id reverse relationship // @return Phone[] return (array) $this->_objPhoneArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * 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 HouseholdMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing Household object creation - defaults to CreateOrEdit * @return HouseholdMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objHousehold = Household::Load($intId); // Household was found -- return it! if ($objHousehold) { return new HouseholdMetaControl($objParentObject, $objHousehold); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a Household 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 HouseholdMetaControl($objParentObject, new Household()); }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'HouseholdId': // Gets the value for intHouseholdId (Not Null) // @return integer return $this->intHouseholdId; case 'SplitHouseholdId': // Gets the value for intSplitHouseholdId (Not Null) // @return integer return $this->intSplitHouseholdId; case 'DateSplit': // Gets the value for dttDateSplit // @return QDateTime return $this->dttDateSplit; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Household': // Gets the value for the Household object referenced by intHouseholdId (Not Null) // @return Household try { if (!$this->objHousehold && !is_null($this->intHouseholdId)) { $this->objHousehold = Household::Load($this->intHouseholdId); } return $this->objHousehold; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'SplitHousehold': // Gets the value for the Household object referenced by intSplitHouseholdId (Not Null) // @return Household try { if (!$this->objSplitHousehold && !is_null($this->intSplitHouseholdId)) { $this->objSplitHousehold = Household::Load($this->intSplitHouseholdId); } return $this->objSplitHousehold; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'ServerIdentifier': // Gets the value for intServerIdentifier (Unique) // @return integer return $this->intServerIdentifier; case 'HouseholdId': // Gets the value for intHouseholdId // @return integer return $this->intHouseholdId; case 'HiddenFlag': // Gets the value for blnHiddenFlag (Not Null) // @return boolean return $this->blnHiddenFlag; case 'ParentPagerSyncStatusTypeId': // Gets the value for intParentPagerSyncStatusTypeId (Not Null) // @return integer return $this->intParentPagerSyncStatusTypeId; case 'Name': // Gets the value for strName // @return string return $this->strName; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Household': // Gets the value for the Household object referenced by intHouseholdId // @return Household try { if (!$this->objHousehold && !is_null($this->intHouseholdId)) { $this->objHousehold = Household::Load($this->intHouseholdId); } return $this->objHousehold; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_ParentPagerAddress': // Gets the value for the private _objParentPagerAddress (Read-Only) // if set due to an expansion on the parent_pager_address.parent_pager_household_id reverse relationship // @return ParentPagerAddress return $this->_objParentPagerAddress; case '_ParentPagerAddressArray': // Gets the value for the private _objParentPagerAddressArray (Read-Only) // if set due to an ExpandAsArray on the parent_pager_address.parent_pager_household_id reverse relationship // @return ParentPagerAddress[] return (array) $this->_objParentPagerAddressArray; case '_ParentPagerIndividual': // Gets the value for the private _objParentPagerIndividual (Read-Only) // if set due to an expansion on the parent_pager_individual.parent_pager_household_id reverse relationship // @return ParentPagerIndividual return $this->_objParentPagerIndividual; case '_ParentPagerIndividualArray': // Gets the value for the private _objParentPagerIndividualArray (Read-Only) // if set due to an ExpandAsArray on the parent_pager_individual.parent_pager_household_id reverse relationship // @return ParentPagerIndividual[] return (array) $this->_objParentPagerIndividualArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * This will save this object's Person instance, * updating only the fields which have had a control created for it. */ public function SavePerson() { try { // Update any fields for controls that have been created if ($this->lstMembershipStatusType) { $this->objPerson->MembershipStatusTypeId = $this->lstMembershipStatusType->SelectedValue; } if ($this->lstMaritalStatusType) { $this->objPerson->MaritalStatusTypeId = $this->lstMaritalStatusType->SelectedValue; } if ($this->txtFirstName) { $this->objPerson->FirstName = $this->txtFirstName->Text; } if ($this->txtMiddleName) { $this->objPerson->MiddleName = $this->txtMiddleName->Text; } if ($this->txtLastName) { $this->objPerson->LastName = $this->txtLastName->Text; } if ($this->txtMailingLabel) { $this->objPerson->MailingLabel = $this->txtMailingLabel->Text; } if ($this->txtPriorLastNames) { $this->objPerson->PriorLastNames = $this->txtPriorLastNames->Text; } if ($this->txtNickname) { $this->objPerson->Nickname = $this->txtNickname->Text; } if ($this->txtTitle) { $this->objPerson->Title = $this->txtTitle->Text; } if ($this->txtSuffix) { $this->objPerson->Suffix = $this->txtSuffix->Text; } if ($this->txtGender) { $this->objPerson->Gender = $this->txtGender->Text; } if ($this->calDateOfBirth) { $this->objPerson->DateOfBirth = $this->calDateOfBirth->DateTime; } if ($this->chkDobYearApproximateFlag) { $this->objPerson->DobYearApproximateFlag = $this->chkDobYearApproximateFlag->Checked; } if ($this->chkDobGuessedFlag) { $this->objPerson->DobGuessedFlag = $this->chkDobGuessedFlag->Checked; } if ($this->txtAge) { $this->objPerson->Age = $this->txtAge->Text; } if ($this->chkDeceasedFlag) { $this->objPerson->DeceasedFlag = $this->chkDeceasedFlag->Checked; } if ($this->calDateDeceased) { $this->objPerson->DateDeceased = $this->calDateDeceased->DateTime; } if ($this->lstCurrentHeadShot) { $this->objPerson->CurrentHeadShotId = $this->lstCurrentHeadShot->SelectedValue; } if ($this->lstMailingAddress) { $this->objPerson->MailingAddressId = $this->lstMailingAddress->SelectedValue; } if ($this->lstStewardshipAddress) { $this->objPerson->StewardshipAddressId = $this->lstStewardshipAddress->SelectedValue; } if ($this->lstPrimaryPhone) { $this->objPerson->PrimaryPhoneId = $this->lstPrimaryPhone->SelectedValue; } if ($this->lstPrimaryEmail) { $this->objPerson->PrimaryEmailId = $this->lstPrimaryEmail->SelectedValue; } if ($this->chkCanMailFlag) { $this->objPerson->CanMailFlag = $this->chkCanMailFlag->Checked; } if ($this->chkCanPhoneFlag) { $this->objPerson->CanPhoneFlag = $this->chkCanPhoneFlag->Checked; } if ($this->chkCanEmailFlag) { $this->objPerson->CanEmailFlag = $this->chkCanEmailFlag->Checked; } if ($this->txtPrimaryAddressText) { $this->objPerson->PrimaryAddressText = $this->txtPrimaryAddressText->Text; } if ($this->txtPrimaryCityText) { $this->objPerson->PrimaryCityText = $this->txtPrimaryCityText->Text; } if ($this->txtPrimaryStateText) { $this->objPerson->PrimaryStateText = $this->txtPrimaryStateText->Text; } if ($this->txtPrimaryZipCodeText) { $this->objPerson->PrimaryZipCodeText = $this->txtPrimaryZipCodeText->Text; } if ($this->txtPrimaryPhoneText) { $this->objPerson->PrimaryPhoneText = $this->txtPrimaryPhoneText->Text; } if ($this->chkPublicCreationFlag) { $this->objPerson->PublicCreationFlag = $this->chkPublicCreationFlag->Checked; } if ($this->lstCoPrimaryObject) { $this->objPerson->CoPrimary = $this->lstCoPrimaryObject->SelectedValue; } // Update any UniqueReverseReferences (if any) for controls that have been created for it if ($this->lstHouseholdAsHead) { $this->objPerson->HouseholdAsHead = Household::Load($this->lstHouseholdAsHead->SelectedValue); } if ($this->lstPublicLogin) { $this->objPerson->PublicLogin = PublicLogin::Load($this->lstPublicLogin->SelectedValue); } // Save the Person object $this->objPerson->Save(); // Finally, update any ManyToManyReferences (if any) $this->lstCheckingAccountLookups_Update(); $this->lstCommunicationLists_Update(); $this->lstNameItems_Update(); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }