/** * Refresh this MetaControl with Data from the local ParentPagerHousehold object. * @param boolean $blnReload reload ParentPagerHousehold from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objParentPagerHousehold->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objParentPagerHousehold->Id; } } if ($this->txtServerIdentifier) { $this->txtServerIdentifier->Text = $this->objParentPagerHousehold->ServerIdentifier; } if ($this->lblServerIdentifier) { $this->lblServerIdentifier->Text = $this->objParentPagerHousehold->ServerIdentifier; } if ($this->lstHousehold) { $this->lstHousehold->RemoveAllItems(); $this->lstHousehold->AddItem(QApplication::Translate('- Select One -'), null); $objHouseholdArray = Household::LoadAll(); if ($objHouseholdArray) { foreach ($objHouseholdArray as $objHousehold) { $objListItem = new QListItem($objHousehold->__toString(), $objHousehold->Id); if ($this->objParentPagerHousehold->Household && $this->objParentPagerHousehold->Household->Id == $objHousehold->Id) { $objListItem->Selected = true; } $this->lstHousehold->AddItem($objListItem); } } } if ($this->lblHouseholdId) { $this->lblHouseholdId->Text = $this->objParentPagerHousehold->Household ? $this->objParentPagerHousehold->Household->__toString() : null; } if ($this->chkHiddenFlag) { $this->chkHiddenFlag->Checked = $this->objParentPagerHousehold->HiddenFlag; } if ($this->lblHiddenFlag) { $this->lblHiddenFlag->Text = $this->objParentPagerHousehold->HiddenFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstParentPagerSyncStatusType) { $this->lstParentPagerSyncStatusType->SelectedValue = $this->objParentPagerHousehold->ParentPagerSyncStatusTypeId; } if ($this->lblParentPagerSyncStatusTypeId) { $this->lblParentPagerSyncStatusTypeId->Text = $this->objParentPagerHousehold->ParentPagerSyncStatusTypeId ? ParentPagerSyncStatusType::$NameArray[$this->objParentPagerHousehold->ParentPagerSyncStatusTypeId] : null; } if ($this->txtName) { $this->txtName->Text = $this->objParentPagerHousehold->Name; } if ($this->lblName) { $this->lblName->Text = $this->objParentPagerHousehold->Name; } }
/** * Refresh this MetaControl with Data from the local HouseholdParticipation object. * @param boolean $blnReload reload HouseholdParticipation from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objHouseholdParticipation->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objHouseholdParticipation->Id; } } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); } $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objHouseholdParticipation->Person && $this->objHouseholdParticipation->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objHouseholdParticipation->Person ? $this->objHouseholdParticipation->Person->__toString() : null; } if ($this->lstHousehold) { $this->lstHousehold->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstHousehold->AddItem(QApplication::Translate('- Select One -'), null); } $objHouseholdArray = Household::LoadAll(); if ($objHouseholdArray) { foreach ($objHouseholdArray as $objHousehold) { $objListItem = new QListItem($objHousehold->__toString(), $objHousehold->Id); if ($this->objHouseholdParticipation->Household && $this->objHouseholdParticipation->Household->Id == $objHousehold->Id) { $objListItem->Selected = true; } $this->lstHousehold->AddItem($objListItem); } } } if ($this->lblHouseholdId) { $this->lblHouseholdId->Text = $this->objHouseholdParticipation->Household ? $this->objHouseholdParticipation->Household->__toString() : null; } if ($this->txtRole) { $this->txtRole->Text = $this->objHouseholdParticipation->Role; } if ($this->lblRole) { $this->lblRole->Text = $this->objHouseholdParticipation->Role; } if ($this->txtRoleOverride) { $this->txtRoleOverride->Text = $this->objHouseholdParticipation->RoleOverride; } if ($this->lblRoleOverride) { $this->lblRoleOverride->Text = $this->objHouseholdParticipation->RoleOverride; } }
public static function GenerateHouseholds() { while (QDataGen::DisplayWhileTask('Generating Households', self::HouseholdCount, false)) { $objHousehold = null; $objPerson = null; switch (rand(0, 9)) { case 0: case 1: case 2: // Single-Family Household $objHousehold = self::GenerateHouseholdSingleFamily(); break; case 3: case 4: case 5: // Single-Person Household $objPerson = self::GenerateIndividual(rand(0, 1), rand(0, 8)); $objHousehold = Household::CreateHousehold($objPerson); break; case 6: case 7: // Multi-Family Households // TODO break; case 8: case 9: // Non-Household $objPerson = self::GenerateIndividual(rand(0, 1), rand(0, 8)); break; } // Address and Phone for Household if ($objHousehold) { self::GenerateAddressesForHousehold($objHousehold); foreach ($objHousehold->GetHouseholdParticipationArray() as $objParticipation) { $objParticipation->Person->RefreshPrimaryContactInfo(); } } else { if ($objPerson) { $objPerson->RefreshPrimaryContactInfo(); } } } self::$HouseholdArray = Household::LoadAll(); }
/** * Refresh this MetaControl with Data from the local Address object. * @param boolean $blnReload reload Address from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objAddress->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objAddress->Id; } } if ($this->lstAddressType) { $this->lstAddressType->SelectedValue = $this->objAddress->AddressTypeId; } if ($this->lblAddressTypeId) { $this->lblAddressTypeId->Text = $this->objAddress->AddressTypeId ? AddressType::$NameArray[$this->objAddress->AddressTypeId] : null; } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objAddress->Person && $this->objAddress->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objAddress->Person ? $this->objAddress->Person->__toString() : null; } if ($this->lstHousehold) { $this->lstHousehold->RemoveAllItems(); $this->lstHousehold->AddItem(QApplication::Translate('- Select One -'), null); $objHouseholdArray = Household::LoadAll(); if ($objHouseholdArray) { foreach ($objHouseholdArray as $objHousehold) { $objListItem = new QListItem($objHousehold->__toString(), $objHousehold->Id); if ($this->objAddress->Household && $this->objAddress->Household->Id == $objHousehold->Id) { $objListItem->Selected = true; } $this->lstHousehold->AddItem($objListItem); } } } if ($this->lblHouseholdId) { $this->lblHouseholdId->Text = $this->objAddress->Household ? $this->objAddress->Household->__toString() : null; } if ($this->lstPrimaryPhone) { $this->lstPrimaryPhone->RemoveAllItems(); $this->lstPrimaryPhone->AddItem(QApplication::Translate('- Select One -'), null); $objPrimaryPhoneArray = Phone::LoadAll(); if ($objPrimaryPhoneArray) { foreach ($objPrimaryPhoneArray as $objPrimaryPhone) { $objListItem = new QListItem($objPrimaryPhone->__toString(), $objPrimaryPhone->Id); if ($this->objAddress->PrimaryPhone && $this->objAddress->PrimaryPhone->Id == $objPrimaryPhone->Id) { $objListItem->Selected = true; } $this->lstPrimaryPhone->AddItem($objListItem); } } } if ($this->lblPrimaryPhoneId) { $this->lblPrimaryPhoneId->Text = $this->objAddress->PrimaryPhone ? $this->objAddress->PrimaryPhone->__toString() : null; } if ($this->txtAddress1) { $this->txtAddress1->Text = $this->objAddress->Address1; } if ($this->lblAddress1) { $this->lblAddress1->Text = $this->objAddress->Address1; } if ($this->txtAddress2) { $this->txtAddress2->Text = $this->objAddress->Address2; } if ($this->lblAddress2) { $this->lblAddress2->Text = $this->objAddress->Address2; } if ($this->txtAddress3) { $this->txtAddress3->Text = $this->objAddress->Address3; } if ($this->lblAddress3) { $this->lblAddress3->Text = $this->objAddress->Address3; } if ($this->txtCity) { $this->txtCity->Text = $this->objAddress->City; } if ($this->lblCity) { $this->lblCity->Text = $this->objAddress->City; } if ($this->txtState) { $this->txtState->Text = $this->objAddress->State; } if ($this->lblState) { $this->lblState->Text = $this->objAddress->State; } if ($this->txtZipCode) { $this->txtZipCode->Text = $this->objAddress->ZipCode; } if ($this->lblZipCode) { $this->lblZipCode->Text = $this->objAddress->ZipCode; } if ($this->txtCountry) { $this->txtCountry->Text = $this->objAddress->Country; } if ($this->lblCountry) { $this->lblCountry->Text = $this->objAddress->Country; } if ($this->chkCurrentFlag) { $this->chkCurrentFlag->Checked = $this->objAddress->CurrentFlag; } if ($this->lblCurrentFlag) { $this->lblCurrentFlag->Text = $this->objAddress->CurrentFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkInvalidFlag) { $this->chkInvalidFlag->Checked = $this->objAddress->InvalidFlag; } if ($this->lblInvalidFlag) { $this->lblInvalidFlag->Text = $this->objAddress->InvalidFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkVerificationCheckedFlag) { $this->chkVerificationCheckedFlag->Checked = $this->objAddress->VerificationCheckedFlag; } if ($this->lblVerificationCheckedFlag) { $this->lblVerificationCheckedFlag->Text = $this->objAddress->VerificationCheckedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->calDateUntilWhen) { $this->calDateUntilWhen->DateTime = $this->objAddress->DateUntilWhen; } if ($this->lblDateUntilWhen) { $this->lblDateUntilWhen->Text = sprintf($this->objAddress->DateUntilWhen) ? $this->objAddress->__toString($this->strDateUntilWhenDateTimeFormat) : null; } if ($this->chkInternationalFlag) { $this->chkInternationalFlag->Checked = $this->objAddress->InternationalFlag; } if ($this->lblInternationalFlag) { $this->lblInternationalFlag->Text = $this->objAddress->InternationalFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } }
/** * Refresh this MetaControl with Data from the local Person object. * @param boolean $blnReload reload Person from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objPerson->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objPerson->Id; } } if ($this->lstMembershipStatusType) { $this->lstMembershipStatusType->SelectedValue = $this->objPerson->MembershipStatusTypeId; } if ($this->lblMembershipStatusTypeId) { $this->lblMembershipStatusTypeId->Text = $this->objPerson->MembershipStatusTypeId ? MembershipStatusType::$NameArray[$this->objPerson->MembershipStatusTypeId] : null; } if ($this->lstMaritalStatusType) { $this->lstMaritalStatusType->SelectedValue = $this->objPerson->MaritalStatusTypeId; } if ($this->lblMaritalStatusTypeId) { $this->lblMaritalStatusTypeId->Text = $this->objPerson->MaritalStatusTypeId ? MaritalStatusType::$NameArray[$this->objPerson->MaritalStatusTypeId] : null; } if ($this->txtFirstName) { $this->txtFirstName->Text = $this->objPerson->FirstName; } if ($this->lblFirstName) { $this->lblFirstName->Text = $this->objPerson->FirstName; } if ($this->txtMiddleName) { $this->txtMiddleName->Text = $this->objPerson->MiddleName; } if ($this->lblMiddleName) { $this->lblMiddleName->Text = $this->objPerson->MiddleName; } if ($this->txtLastName) { $this->txtLastName->Text = $this->objPerson->LastName; } if ($this->lblLastName) { $this->lblLastName->Text = $this->objPerson->LastName; } if ($this->txtMailingLabel) { $this->txtMailingLabel->Text = $this->objPerson->MailingLabel; } if ($this->lblMailingLabel) { $this->lblMailingLabel->Text = $this->objPerson->MailingLabel; } if ($this->txtPriorLastNames) { $this->txtPriorLastNames->Text = $this->objPerson->PriorLastNames; } if ($this->lblPriorLastNames) { $this->lblPriorLastNames->Text = $this->objPerson->PriorLastNames; } if ($this->txtNickname) { $this->txtNickname->Text = $this->objPerson->Nickname; } if ($this->lblNickname) { $this->lblNickname->Text = $this->objPerson->Nickname; } if ($this->txtTitle) { $this->txtTitle->Text = $this->objPerson->Title; } if ($this->lblTitle) { $this->lblTitle->Text = $this->objPerson->Title; } if ($this->txtSuffix) { $this->txtSuffix->Text = $this->objPerson->Suffix; } if ($this->lblSuffix) { $this->lblSuffix->Text = $this->objPerson->Suffix; } if ($this->txtGender) { $this->txtGender->Text = $this->objPerson->Gender; } if ($this->lblGender) { $this->lblGender->Text = $this->objPerson->Gender; } if ($this->calDateOfBirth) { $this->calDateOfBirth->DateTime = $this->objPerson->DateOfBirth; } if ($this->lblDateOfBirth) { $this->lblDateOfBirth->Text = sprintf($this->objPerson->DateOfBirth) ? $this->objPerson->__toString($this->strDateOfBirthDateTimeFormat) : null; } if ($this->chkDobYearApproximateFlag) { $this->chkDobYearApproximateFlag->Checked = $this->objPerson->DobYearApproximateFlag; } if ($this->lblDobYearApproximateFlag) { $this->lblDobYearApproximateFlag->Text = $this->objPerson->DobYearApproximateFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkDobGuessedFlag) { $this->chkDobGuessedFlag->Checked = $this->objPerson->DobGuessedFlag; } if ($this->lblDobGuessedFlag) { $this->lblDobGuessedFlag->Text = $this->objPerson->DobGuessedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtAge) { $this->txtAge->Text = $this->objPerson->Age; } if ($this->lblAge) { $this->lblAge->Text = $this->objPerson->Age; } if ($this->chkDeceasedFlag) { $this->chkDeceasedFlag->Checked = $this->objPerson->DeceasedFlag; } if ($this->lblDeceasedFlag) { $this->lblDeceasedFlag->Text = $this->objPerson->DeceasedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->calDateDeceased) { $this->calDateDeceased->DateTime = $this->objPerson->DateDeceased; } if ($this->lblDateDeceased) { $this->lblDateDeceased->Text = sprintf($this->objPerson->DateDeceased) ? $this->objPerson->__toString($this->strDateDeceasedDateTimeFormat) : null; } if ($this->lstCurrentHeadShot) { $this->lstCurrentHeadShot->RemoveAllItems(); $this->lstCurrentHeadShot->AddItem(QApplication::Translate('- Select One -'), null); $objCurrentHeadShotArray = HeadShot::LoadAll(); if ($objCurrentHeadShotArray) { foreach ($objCurrentHeadShotArray as $objCurrentHeadShot) { $objListItem = new QListItem($objCurrentHeadShot->__toString(), $objCurrentHeadShot->Id); if ($this->objPerson->CurrentHeadShot && $this->objPerson->CurrentHeadShot->Id == $objCurrentHeadShot->Id) { $objListItem->Selected = true; } $this->lstCurrentHeadShot->AddItem($objListItem); } } } if ($this->lblCurrentHeadShotId) { $this->lblCurrentHeadShotId->Text = $this->objPerson->CurrentHeadShot ? $this->objPerson->CurrentHeadShot->__toString() : null; } if ($this->lstMailingAddress) { $this->lstMailingAddress->RemoveAllItems(); $this->lstMailingAddress->AddItem(QApplication::Translate('- Select One -'), null); $objMailingAddressArray = Address::LoadAll(); if ($objMailingAddressArray) { foreach ($objMailingAddressArray as $objMailingAddress) { $objListItem = new QListItem($objMailingAddress->__toString(), $objMailingAddress->Id); if ($this->objPerson->MailingAddress && $this->objPerson->MailingAddress->Id == $objMailingAddress->Id) { $objListItem->Selected = true; } $this->lstMailingAddress->AddItem($objListItem); } } } if ($this->lblMailingAddressId) { $this->lblMailingAddressId->Text = $this->objPerson->MailingAddress ? $this->objPerson->MailingAddress->__toString() : null; } if ($this->lstStewardshipAddress) { $this->lstStewardshipAddress->RemoveAllItems(); $this->lstStewardshipAddress->AddItem(QApplication::Translate('- Select One -'), null); $objStewardshipAddressArray = Address::LoadAll(); if ($objStewardshipAddressArray) { foreach ($objStewardshipAddressArray as $objStewardshipAddress) { $objListItem = new QListItem($objStewardshipAddress->__toString(), $objStewardshipAddress->Id); if ($this->objPerson->StewardshipAddress && $this->objPerson->StewardshipAddress->Id == $objStewardshipAddress->Id) { $objListItem->Selected = true; } $this->lstStewardshipAddress->AddItem($objListItem); } } } if ($this->lblStewardshipAddressId) { $this->lblStewardshipAddressId->Text = $this->objPerson->StewardshipAddress ? $this->objPerson->StewardshipAddress->__toString() : null; } if ($this->lstPrimaryPhone) { $this->lstPrimaryPhone->RemoveAllItems(); $this->lstPrimaryPhone->AddItem(QApplication::Translate('- Select One -'), null); $objPrimaryPhoneArray = Phone::LoadAll(); if ($objPrimaryPhoneArray) { foreach ($objPrimaryPhoneArray as $objPrimaryPhone) { $objListItem = new QListItem($objPrimaryPhone->__toString(), $objPrimaryPhone->Id); if ($this->objPerson->PrimaryPhone && $this->objPerson->PrimaryPhone->Id == $objPrimaryPhone->Id) { $objListItem->Selected = true; } $this->lstPrimaryPhone->AddItem($objListItem); } } } if ($this->lblPrimaryPhoneId) { $this->lblPrimaryPhoneId->Text = $this->objPerson->PrimaryPhone ? $this->objPerson->PrimaryPhone->__toString() : null; } if ($this->lstPrimaryEmail) { $this->lstPrimaryEmail->RemoveAllItems(); $this->lstPrimaryEmail->AddItem(QApplication::Translate('- Select One -'), null); $objPrimaryEmailArray = Email::LoadAll(); if ($objPrimaryEmailArray) { foreach ($objPrimaryEmailArray as $objPrimaryEmail) { $objListItem = new QListItem($objPrimaryEmail->__toString(), $objPrimaryEmail->Id); if ($this->objPerson->PrimaryEmail && $this->objPerson->PrimaryEmail->Id == $objPrimaryEmail->Id) { $objListItem->Selected = true; } $this->lstPrimaryEmail->AddItem($objListItem); } } } if ($this->lblPrimaryEmailId) { $this->lblPrimaryEmailId->Text = $this->objPerson->PrimaryEmail ? $this->objPerson->PrimaryEmail->__toString() : null; } if ($this->chkCanMailFlag) { $this->chkCanMailFlag->Checked = $this->objPerson->CanMailFlag; } if ($this->lblCanMailFlag) { $this->lblCanMailFlag->Text = $this->objPerson->CanMailFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkCanPhoneFlag) { $this->chkCanPhoneFlag->Checked = $this->objPerson->CanPhoneFlag; } if ($this->lblCanPhoneFlag) { $this->lblCanPhoneFlag->Text = $this->objPerson->CanPhoneFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkCanEmailFlag) { $this->chkCanEmailFlag->Checked = $this->objPerson->CanEmailFlag; } if ($this->lblCanEmailFlag) { $this->lblCanEmailFlag->Text = $this->objPerson->CanEmailFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtPrimaryAddressText) { $this->txtPrimaryAddressText->Text = $this->objPerson->PrimaryAddressText; } if ($this->lblPrimaryAddressText) { $this->lblPrimaryAddressText->Text = $this->objPerson->PrimaryAddressText; } if ($this->txtPrimaryCityText) { $this->txtPrimaryCityText->Text = $this->objPerson->PrimaryCityText; } if ($this->lblPrimaryCityText) { $this->lblPrimaryCityText->Text = $this->objPerson->PrimaryCityText; } if ($this->txtPrimaryStateText) { $this->txtPrimaryStateText->Text = $this->objPerson->PrimaryStateText; } if ($this->lblPrimaryStateText) { $this->lblPrimaryStateText->Text = $this->objPerson->PrimaryStateText; } if ($this->txtPrimaryZipCodeText) { $this->txtPrimaryZipCodeText->Text = $this->objPerson->PrimaryZipCodeText; } if ($this->lblPrimaryZipCodeText) { $this->lblPrimaryZipCodeText->Text = $this->objPerson->PrimaryZipCodeText; } if ($this->txtPrimaryPhoneText) { $this->txtPrimaryPhoneText->Text = $this->objPerson->PrimaryPhoneText; } if ($this->lblPrimaryPhoneText) { $this->lblPrimaryPhoneText->Text = $this->objPerson->PrimaryPhoneText; } if ($this->chkPublicCreationFlag) { $this->chkPublicCreationFlag->Checked = $this->objPerson->PublicCreationFlag; } if ($this->lblPublicCreationFlag) { $this->lblPublicCreationFlag->Text = $this->objPerson->PublicCreationFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstCoPrimaryObject) { $this->lstCoPrimaryObject->RemoveAllItems(); $this->lstCoPrimaryObject->AddItem(QApplication::Translate('- Select One -'), null); $objCoPrimaryObjectArray = Person::LoadAll(); if ($objCoPrimaryObjectArray) { foreach ($objCoPrimaryObjectArray as $objCoPrimaryObject) { $objListItem = new QListItem($objCoPrimaryObject->__toString(), $objCoPrimaryObject->Id); if ($this->objPerson->CoPrimaryObject && $this->objPerson->CoPrimaryObject->Id == $objCoPrimaryObject->Id) { $objListItem->Selected = true; } $this->lstCoPrimaryObject->AddItem($objListItem); } } } if ($this->lblCoPrimary) { $this->lblCoPrimary->Text = $this->objPerson->CoPrimaryObject ? $this->objPerson->CoPrimaryObject->__toString() : null; } if ($this->lstHouseholdAsHead) { $this->lstHouseholdAsHead->RemoveAllItems(); $this->lstHouseholdAsHead->AddItem(QApplication::Translate('- Select One -'), null); $objHouseholdArray = Household::LoadAll(); if ($objHouseholdArray) { foreach ($objHouseholdArray as $objHousehold) { $objListItem = new QListItem($objHousehold->__toString(), $objHousehold->Id); if ($objHousehold->HeadPersonId == $this->objPerson->Id) { $objListItem->Selected = true; } $this->lstHouseholdAsHead->AddItem($objListItem); } } // Because Household's HouseholdAsHead is not null, if a value is already selected, it cannot be changed. if ($this->lstHouseholdAsHead->SelectedValue) { $this->lstHouseholdAsHead->Enabled = false; } else { $this->lstHouseholdAsHead->Enabled = true; } } if ($this->lblHouseholdAsHead) { $this->lblHouseholdAsHead->Text = $this->objPerson->HouseholdAsHead ? $this->objPerson->HouseholdAsHead->__toString() : null; } if ($this->lstPublicLogin) { $this->lstPublicLogin->RemoveAllItems(); $this->lstPublicLogin->AddItem(QApplication::Translate('- Select One -'), null); $objPublicLoginArray = PublicLogin::LoadAll(); if ($objPublicLoginArray) { foreach ($objPublicLoginArray as $objPublicLogin) { $objListItem = new QListItem($objPublicLogin->__toString(), $objPublicLogin->Id); if ($objPublicLogin->PersonId == $this->objPerson->Id) { $objListItem->Selected = true; } $this->lstPublicLogin->AddItem($objListItem); } } } if ($this->lblPublicLogin) { $this->lblPublicLogin->Text = $this->objPerson->PublicLogin ? $this->objPerson->PublicLogin->__toString() : null; } if ($this->lstCheckingAccountLookups) { $this->lstCheckingAccountLookups->RemoveAllItems(); $objAssociatedArray = $this->objPerson->GetCheckingAccountLookupArray(); $objCheckingAccountLookupArray = CheckingAccountLookup::LoadAll(); if ($objCheckingAccountLookupArray) { foreach ($objCheckingAccountLookupArray as $objCheckingAccountLookup) { $objListItem = new QListItem($objCheckingAccountLookup->__toString(), $objCheckingAccountLookup->Id); foreach ($objAssociatedArray as $objAssociated) { if ($objAssociated->Id == $objCheckingAccountLookup->Id) { $objListItem->Selected = true; } } $this->lstCheckingAccountLookups->AddItem($objListItem); } } } if ($this->lblCheckingAccountLookups) { $objAssociatedArray = $this->objPerson->GetCheckingAccountLookupArray(); $strItems = array(); foreach ($objAssociatedArray as $objAssociated) { $strItems[] = $objAssociated->__toString(); } $this->lblCheckingAccountLookups->Text = implode($strGlue, $strItems); } if ($this->lstCommunicationLists) { $this->lstCommunicationLists->RemoveAllItems(); $objAssociatedArray = $this->objPerson->GetCommunicationListArray(); $objCommunicationListArray = CommunicationList::LoadAll(); if ($objCommunicationListArray) { foreach ($objCommunicationListArray as $objCommunicationList) { $objListItem = new QListItem($objCommunicationList->__toString(), $objCommunicationList->Id); foreach ($objAssociatedArray as $objAssociated) { if ($objAssociated->Id == $objCommunicationList->Id) { $objListItem->Selected = true; } } $this->lstCommunicationLists->AddItem($objListItem); } } } if ($this->lblCommunicationLists) { $objAssociatedArray = $this->objPerson->GetCommunicationListArray(); $strItems = array(); foreach ($objAssociatedArray as $objAssociated) { $strItems[] = $objAssociated->__toString(); } $this->lblCommunicationLists->Text = implode($strGlue, $strItems); } if ($this->lstNameItems) { $this->lstNameItems->RemoveAllItems(); $objAssociatedArray = $this->objPerson->GetNameItemArray(); $objNameItemArray = NameItem::LoadAll(); if ($objNameItemArray) { foreach ($objNameItemArray as $objNameItem) { $objListItem = new QListItem($objNameItem->__toString(), $objNameItem->Id); foreach ($objAssociatedArray as $objAssociated) { if ($objAssociated->Id == $objNameItem->Id) { $objListItem->Selected = true; } } $this->lstNameItems->AddItem($objListItem); } } } if ($this->lblNameItems) { $objAssociatedArray = $this->objPerson->GetNameItemArray(); $strItems = array(); foreach ($objAssociatedArray as $objAssociated) { $strItems[] = $objAssociated->__toString(); } $this->lblNameItems->Text = implode($strGlue, $strItems); } }
/** * Refresh this MetaControl with Data from the local HouseholdSplit object. * @param boolean $blnReload reload HouseholdSplit from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objHouseholdSplit->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objHouseholdSplit->Id; } } if ($this->lstHousehold) { $this->lstHousehold->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstHousehold->AddItem(QApplication::Translate('- Select One -'), null); } $objHouseholdArray = Household::LoadAll(); if ($objHouseholdArray) { foreach ($objHouseholdArray as $objHousehold) { $objListItem = new QListItem($objHousehold->__toString(), $objHousehold->Id); if ($this->objHouseholdSplit->Household && $this->objHouseholdSplit->Household->Id == $objHousehold->Id) { $objListItem->Selected = true; } $this->lstHousehold->AddItem($objListItem); } } } if ($this->lblHouseholdId) { $this->lblHouseholdId->Text = $this->objHouseholdSplit->Household ? $this->objHouseholdSplit->Household->__toString() : null; } if ($this->lstSplitHousehold) { $this->lstSplitHousehold->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstSplitHousehold->AddItem(QApplication::Translate('- Select One -'), null); } $objSplitHouseholdArray = Household::LoadAll(); if ($objSplitHouseholdArray) { foreach ($objSplitHouseholdArray as $objSplitHousehold) { $objListItem = new QListItem($objSplitHousehold->__toString(), $objSplitHousehold->Id); if ($this->objHouseholdSplit->SplitHousehold && $this->objHouseholdSplit->SplitHousehold->Id == $objSplitHousehold->Id) { $objListItem->Selected = true; } $this->lstSplitHousehold->AddItem($objListItem); } } } if ($this->lblSplitHouseholdId) { $this->lblSplitHouseholdId->Text = $this->objHouseholdSplit->SplitHousehold ? $this->objHouseholdSplit->SplitHousehold->__toString() : null; } if ($this->calDateSplit) { $this->calDateSplit->DateTime = $this->objHouseholdSplit->DateSplit; } if ($this->lblDateSplit) { $this->lblDateSplit->Text = sprintf($this->objHouseholdSplit->DateSplit) ? $this->objHouseholdSplit->__toString($this->strDateSplitDateTimeFormat) : null; } }