/** * Refresh this MetaControl with Data from the local SignupForm object. * @param boolean $blnReload reload SignupForm from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objSignupForm->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objSignupForm->Id; } } if ($this->lstSignupFormType) { $this->lstSignupFormType->SelectedValue = $this->objSignupForm->SignupFormTypeId; } if ($this->lblSignupFormTypeId) { $this->lblSignupFormTypeId->Text = $this->objSignupForm->SignupFormTypeId ? SignupFormType::$NameArray[$this->objSignupForm->SignupFormTypeId] : null; } if ($this->lstMinistry) { $this->lstMinistry->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstMinistry->AddItem(QApplication::Translate('- Select One -'), null); } $objMinistryArray = Ministry::LoadAll(); if ($objMinistryArray) { foreach ($objMinistryArray as $objMinistry) { $objListItem = new QListItem($objMinistry->__toString(), $objMinistry->Id); if ($this->objSignupForm->Ministry && $this->objSignupForm->Ministry->Id == $objMinistry->Id) { $objListItem->Selected = true; } $this->lstMinistry->AddItem($objListItem); } } } if ($this->lblMinistryId) { $this->lblMinistryId->Text = $this->objSignupForm->Ministry ? $this->objSignupForm->Ministry->__toString() : null; } if ($this->txtName) { $this->txtName->Text = $this->objSignupForm->Name; } if ($this->lblName) { $this->lblName->Text = $this->objSignupForm->Name; } if ($this->txtToken) { $this->txtToken->Text = $this->objSignupForm->Token; } if ($this->lblToken) { $this->lblToken->Text = $this->objSignupForm->Token; } if ($this->chkActiveFlag) { $this->chkActiveFlag->Checked = $this->objSignupForm->ActiveFlag; } if ($this->lblActiveFlag) { $this->lblActiveFlag->Text = $this->objSignupForm->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkConfidentialFlag) { $this->chkConfidentialFlag->Checked = $this->objSignupForm->ConfidentialFlag; } if ($this->lblConfidentialFlag) { $this->lblConfidentialFlag->Text = $this->objSignupForm->ConfidentialFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtDescription) { $this->txtDescription->Text = $this->objSignupForm->Description; } if ($this->lblDescription) { $this->lblDescription->Text = $this->objSignupForm->Description; } if ($this->txtInformationUrl) { $this->txtInformationUrl->Text = $this->objSignupForm->InformationUrl; } if ($this->lblInformationUrl) { $this->lblInformationUrl->Text = $this->objSignupForm->InformationUrl; } if ($this->txtSupportEmail) { $this->txtSupportEmail->Text = $this->objSignupForm->SupportEmail; } if ($this->lblSupportEmail) { $this->lblSupportEmail->Text = $this->objSignupForm->SupportEmail; } if ($this->txtEmailNotification) { $this->txtEmailNotification->Text = $this->objSignupForm->EmailNotification; } if ($this->lblEmailNotification) { $this->lblEmailNotification->Text = $this->objSignupForm->EmailNotification; } if ($this->chkAllowOtherFlag) { $this->chkAllowOtherFlag->Checked = $this->objSignupForm->AllowOtherFlag; } if ($this->lblAllowOtherFlag) { $this->lblAllowOtherFlag->Text = $this->objSignupForm->AllowOtherFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkAllowMultipleFlag) { $this->chkAllowMultipleFlag->Checked = $this->objSignupForm->AllowMultipleFlag; } if ($this->lblAllowMultipleFlag) { $this->lblAllowMultipleFlag->Text = $this->objSignupForm->AllowMultipleFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtSignupLimit) { $this->txtSignupLimit->Text = $this->objSignupForm->SignupLimit; } if ($this->lblSignupLimit) { $this->lblSignupLimit->Text = $this->objSignupForm->SignupLimit; } if ($this->txtSignupMaleLimit) { $this->txtSignupMaleLimit->Text = $this->objSignupForm->SignupMaleLimit; } if ($this->lblSignupMaleLimit) { $this->lblSignupMaleLimit->Text = $this->objSignupForm->SignupMaleLimit; } if ($this->txtSignupFemaleLimit) { $this->txtSignupFemaleLimit->Text = $this->objSignupForm->SignupFemaleLimit; } if ($this->lblSignupFemaleLimit) { $this->lblSignupFemaleLimit->Text = $this->objSignupForm->SignupFemaleLimit; } if ($this->txtFundingAccount) { $this->txtFundingAccount->Text = $this->objSignupForm->FundingAccount; } if ($this->lblFundingAccount) { $this->lblFundingAccount->Text = $this->objSignupForm->FundingAccount; } if ($this->lstDonationStewardshipFund) { $this->lstDonationStewardshipFund->RemoveAllItems(); $this->lstDonationStewardshipFund->AddItem(QApplication::Translate('- Select One -'), null); $objDonationStewardshipFundArray = StewardshipFund::LoadAll(); if ($objDonationStewardshipFundArray) { foreach ($objDonationStewardshipFundArray as $objDonationStewardshipFund) { $objListItem = new QListItem($objDonationStewardshipFund->__toString(), $objDonationStewardshipFund->Id); if ($this->objSignupForm->DonationStewardshipFund && $this->objSignupForm->DonationStewardshipFund->Id == $objDonationStewardshipFund->Id) { $objListItem->Selected = true; } $this->lstDonationStewardshipFund->AddItem($objListItem); } } } if ($this->lblDonationStewardshipFundId) { $this->lblDonationStewardshipFundId->Text = $this->objSignupForm->DonationStewardshipFund ? $this->objSignupForm->DonationStewardshipFund->__toString() : null; } if ($this->calDateCreated) { $this->calDateCreated->DateTime = $this->objSignupForm->DateCreated; } if ($this->lblDateCreated) { $this->lblDateCreated->Text = sprintf($this->objSignupForm->DateCreated) ? $this->objSignupForm->__toString($this->strDateCreatedDateTimeFormat) : null; } if ($this->chkLoginNotRequiredFlag) { $this->chkLoginNotRequiredFlag->Checked = $this->objSignupForm->LoginNotRequiredFlag; } if ($this->lblLoginNotRequiredFlag) { $this->lblLoginNotRequiredFlag->Text = $this->objSignupForm->LoginNotRequiredFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstClassMeeting) { $this->lstClassMeeting->RemoveAllItems(); $this->lstClassMeeting->AddItem(QApplication::Translate('- Select One -'), null); $objClassMeetingArray = ClassMeeting::LoadAll(); if ($objClassMeetingArray) { foreach ($objClassMeetingArray as $objClassMeeting) { $objListItem = new QListItem($objClassMeeting->__toString(), $objClassMeeting->SignupFormId); if ($objClassMeeting->SignupFormId == $this->objSignupForm->Id) { $objListItem->Selected = true; } $this->lstClassMeeting->AddItem($objListItem); } } // Because ClassMeeting's ClassMeeting is not null, if a value is already selected, it cannot be changed. if ($this->lstClassMeeting->SelectedValue) { $this->lstClassMeeting->Enabled = false; } else { $this->lstClassMeeting->Enabled = true; } } if ($this->lblClassMeeting) { $this->lblClassMeeting->Text = $this->objSignupForm->ClassMeeting ? $this->objSignupForm->ClassMeeting->__toString() : null; } if ($this->lstEventSignupForm) { $this->lstEventSignupForm->RemoveAllItems(); $this->lstEventSignupForm->AddItem(QApplication::Translate('- Select One -'), null); $objEventSignupFormArray = EventSignupForm::LoadAll(); if ($objEventSignupFormArray) { foreach ($objEventSignupFormArray as $objEventSignupForm) { $objListItem = new QListItem($objEventSignupForm->__toString(), $objEventSignupForm->SignupFormId); if ($objEventSignupForm->SignupFormId == $this->objSignupForm->Id) { $objListItem->Selected = true; } $this->lstEventSignupForm->AddItem($objListItem); } } // Because EventSignupForm's EventSignupForm is not null, if a value is already selected, it cannot be changed. if ($this->lstEventSignupForm->SelectedValue) { $this->lstEventSignupForm->Enabled = false; } else { $this->lstEventSignupForm->Enabled = true; } } if ($this->lblEventSignupForm) { $this->lblEventSignupForm->Text = $this->objSignupForm->EventSignupForm ? $this->objSignupForm->EventSignupForm->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local ClassRegistration object. * @param boolean $blnReload reload ClassRegistration from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objClassRegistration->Reload(); } if ($this->lstSignupEntry) { $this->lstSignupEntry->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstSignupEntry->AddItem(QApplication::Translate('- Select One -'), null); } $objSignupEntryArray = SignupEntry::LoadAll(); if ($objSignupEntryArray) { foreach ($objSignupEntryArray as $objSignupEntry) { $objListItem = new QListItem($objSignupEntry->__toString(), $objSignupEntry->Id); if ($this->objClassRegistration->SignupEntry && $this->objClassRegistration->SignupEntry->Id == $objSignupEntry->Id) { $objListItem->Selected = true; } $this->lstSignupEntry->AddItem($objListItem); } } } if ($this->lblSignupEntryId) { $this->lblSignupEntryId->Text = $this->objClassRegistration->SignupEntry ? $this->objClassRegistration->SignupEntry->__toString() : null; } if ($this->lstClassMeeting) { $this->lstClassMeeting->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstClassMeeting->AddItem(QApplication::Translate('- Select One -'), null); } $objClassMeetingArray = ClassMeeting::LoadAll(); if ($objClassMeetingArray) { foreach ($objClassMeetingArray as $objClassMeeting) { $objListItem = new QListItem($objClassMeeting->__toString(), $objClassMeeting->SignupFormId); if ($this->objClassRegistration->ClassMeeting && $this->objClassRegistration->ClassMeeting->SignupFormId == $objClassMeeting->SignupFormId) { $objListItem->Selected = true; } $this->lstClassMeeting->AddItem($objListItem); } } } if ($this->lblClassMeetingId) { $this->lblClassMeetingId->Text = $this->objClassRegistration->ClassMeeting ? $this->objClassRegistration->ClassMeeting->__toString() : null; } 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->objClassRegistration->Person && $this->objClassRegistration->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objClassRegistration->Person ? $this->objClassRegistration->Person->__toString() : null; } if ($this->lstClassGrade) { $this->lstClassGrade->RemoveAllItems(); $this->lstClassGrade->AddItem(QApplication::Translate('- Select One -'), null); $objClassGradeArray = ClassGrade::LoadAll(); if ($objClassGradeArray) { foreach ($objClassGradeArray as $objClassGrade) { $objListItem = new QListItem($objClassGrade->__toString(), $objClassGrade->Id); if ($this->objClassRegistration->ClassGrade && $this->objClassRegistration->ClassGrade->Id == $objClassGrade->Id) { $objListItem->Selected = true; } $this->lstClassGrade->AddItem($objListItem); } } } if ($this->lblClassGradeId) { $this->lblClassGradeId->Text = $this->objClassRegistration->ClassGrade ? $this->objClassRegistration->ClassGrade->__toString() : null; } if ($this->txtChildcareNotes) { $this->txtChildcareNotes->Text = $this->objClassRegistration->ChildcareNotes; } if ($this->lblChildcareNotes) { $this->lblChildcareNotes->Text = $this->objClassRegistration->ChildcareNotes; } }