Ejemplo n.º 1
0
 /**
  * Refresh this MetaControl with Data from the local SignupEntry object.
  * @param boolean $blnReload reload SignupEntry from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objSignupEntry->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objSignupEntry->Id;
         }
     }
     if ($this->lstSignupForm) {
         $this->lstSignupForm->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstSignupForm->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objSignupFormArray = SignupForm::LoadAll();
         if ($objSignupFormArray) {
             foreach ($objSignupFormArray as $objSignupForm) {
                 $objListItem = new QListItem($objSignupForm->__toString(), $objSignupForm->Id);
                 if ($this->objSignupEntry->SignupForm && $this->objSignupEntry->SignupForm->Id == $objSignupForm->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstSignupForm->AddItem($objListItem);
             }
         }
     }
     if ($this->lblSignupFormId) {
         $this->lblSignupFormId->Text = $this->objSignupEntry->SignupForm ? $this->objSignupEntry->SignupForm->__toString() : 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->objSignupEntry->Person && $this->objSignupEntry->Person->Id == $objPerson->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstPerson->AddItem($objListItem);
             }
         }
     }
     if ($this->lblPersonId) {
         $this->lblPersonId->Text = $this->objSignupEntry->Person ? $this->objSignupEntry->Person->__toString() : null;
     }
     if ($this->lstSignupByPerson) {
         $this->lstSignupByPerson->RemoveAllItems();
         $this->lstSignupByPerson->AddItem(QApplication::Translate('- Select One -'), null);
         $objSignupByPersonArray = Person::LoadAll();
         if ($objSignupByPersonArray) {
             foreach ($objSignupByPersonArray as $objSignupByPerson) {
                 $objListItem = new QListItem($objSignupByPerson->__toString(), $objSignupByPerson->Id);
                 if ($this->objSignupEntry->SignupByPerson && $this->objSignupEntry->SignupByPerson->Id == $objSignupByPerson->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstSignupByPerson->AddItem($objListItem);
             }
         }
     }
     if ($this->lblSignupByPersonId) {
         $this->lblSignupByPersonId->Text = $this->objSignupEntry->SignupByPerson ? $this->objSignupEntry->SignupByPerson->__toString() : null;
     }
     if ($this->lstSignupEntryStatusType) {
         $this->lstSignupEntryStatusType->SelectedValue = $this->objSignupEntry->SignupEntryStatusTypeId;
     }
     if ($this->lblSignupEntryStatusTypeId) {
         $this->lblSignupEntryStatusTypeId->Text = $this->objSignupEntry->SignupEntryStatusTypeId ? SignupEntryStatusType::$NameArray[$this->objSignupEntry->SignupEntryStatusTypeId] : null;
     }
     if ($this->calDateCreated) {
         $this->calDateCreated->DateTime = $this->objSignupEntry->DateCreated;
     }
     if ($this->lblDateCreated) {
         $this->lblDateCreated->Text = sprintf($this->objSignupEntry->DateCreated) ? $this->objSignupEntry->__toString($this->strDateCreatedDateTimeFormat) : null;
     }
     if ($this->calDateSubmitted) {
         $this->calDateSubmitted->DateTime = $this->objSignupEntry->DateSubmitted;
     }
     if ($this->lblDateSubmitted) {
         $this->lblDateSubmitted->Text = sprintf($this->objSignupEntry->DateSubmitted) ? $this->objSignupEntry->__toString($this->strDateSubmittedDateTimeFormat) : null;
     }
     if ($this->txtAmountTotal) {
         $this->txtAmountTotal->Text = $this->objSignupEntry->AmountTotal;
     }
     if ($this->lblAmountTotal) {
         $this->lblAmountTotal->Text = $this->objSignupEntry->AmountTotal;
     }
     if ($this->txtAmountPaid) {
         $this->txtAmountPaid->Text = $this->objSignupEntry->AmountPaid;
     }
     if ($this->lblAmountPaid) {
         $this->lblAmountPaid->Text = $this->objSignupEntry->AmountPaid;
     }
     if ($this->txtAmountBalance) {
         $this->txtAmountBalance->Text = $this->objSignupEntry->AmountBalance;
     }
     if ($this->lblAmountBalance) {
         $this->lblAmountBalance->Text = $this->objSignupEntry->AmountBalance;
     }
     if ($this->txtInternalNotes) {
         $this->txtInternalNotes->Text = $this->objSignupEntry->InternalNotes;
     }
     if ($this->lblInternalNotes) {
         $this->lblInternalNotes->Text = $this->objSignupEntry->InternalNotes;
     }
     if ($this->lstCommunicationsEntry) {
         $this->lstCommunicationsEntry->RemoveAllItems();
         $this->lstCommunicationsEntry->AddItem(QApplication::Translate('- Select One -'), null);
         $objCommunicationsEntryArray = CommunicationListEntry::LoadAll();
         if ($objCommunicationsEntryArray) {
             foreach ($objCommunicationsEntryArray as $objCommunicationsEntry) {
                 $objListItem = new QListItem($objCommunicationsEntry->__toString(), $objCommunicationsEntry->Id);
                 if ($this->objSignupEntry->CommunicationsEntry && $this->objSignupEntry->CommunicationsEntry->Id == $objCommunicationsEntry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstCommunicationsEntry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCommunicationsEntryId) {
         $this->lblCommunicationsEntryId->Text = $this->objSignupEntry->CommunicationsEntry ? $this->objSignupEntry->CommunicationsEntry->__toString() : null;
     }
     if ($this->lstClassRegistration) {
         $this->lstClassRegistration->RemoveAllItems();
         $this->lstClassRegistration->AddItem(QApplication::Translate('- Select One -'), null);
         $objClassRegistrationArray = ClassRegistration::LoadAll();
         if ($objClassRegistrationArray) {
             foreach ($objClassRegistrationArray as $objClassRegistration) {
                 $objListItem = new QListItem($objClassRegistration->__toString(), $objClassRegistration->SignupEntryId);
                 if ($objClassRegistration->SignupEntryId == $this->objSignupEntry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstClassRegistration->AddItem($objListItem);
             }
         }
         // Because ClassRegistration's ClassRegistration is not null, if a value is already selected, it cannot be changed.
         if ($this->lstClassRegistration->SelectedValue) {
             $this->lstClassRegistration->Enabled = false;
         } else {
             $this->lstClassRegistration->Enabled = true;
         }
     }
     if ($this->lblClassRegistration) {
         $this->lblClassRegistration->Text = $this->objSignupEntry->ClassRegistration ? $this->objSignupEntry->ClassRegistration->__toString() : null;
     }
 }
 /**
  * Refresh this MetaControl with Data from the local EmailMessageRoute object.
  * @param boolean $blnReload reload EmailMessageRoute from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objEmailMessageRoute->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objEmailMessageRoute->Id;
         }
     }
     if ($this->lstEmailMessage) {
         $this->lstEmailMessage->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstEmailMessage->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objEmailMessageArray = EmailMessage::LoadAll();
         if ($objEmailMessageArray) {
             foreach ($objEmailMessageArray as $objEmailMessage) {
                 $objListItem = new QListItem($objEmailMessage->__toString(), $objEmailMessage->Id);
                 if ($this->objEmailMessageRoute->EmailMessage && $this->objEmailMessageRoute->EmailMessage->Id == $objEmailMessage->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstEmailMessage->AddItem($objListItem);
             }
         }
     }
     if ($this->lblEmailMessageId) {
         $this->lblEmailMessageId->Text = $this->objEmailMessageRoute->EmailMessage ? $this->objEmailMessageRoute->EmailMessage->__toString() : null;
     }
     if ($this->lstGroup) {
         $this->lstGroup->RemoveAllItems();
         $this->lstGroup->AddItem(QApplication::Translate('- Select One -'), null);
         $objGroupArray = Group::LoadAll();
         if ($objGroupArray) {
             foreach ($objGroupArray as $objGroup) {
                 $objListItem = new QListItem($objGroup->__toString(), $objGroup->Id);
                 if ($this->objEmailMessageRoute->Group && $this->objEmailMessageRoute->Group->Id == $objGroup->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstGroup->AddItem($objListItem);
             }
         }
     }
     if ($this->lblGroupId) {
         $this->lblGroupId->Text = $this->objEmailMessageRoute->Group ? $this->objEmailMessageRoute->Group->__toString() : null;
     }
     if ($this->lstCommunicationList) {
         $this->lstCommunicationList->RemoveAllItems();
         $this->lstCommunicationList->AddItem(QApplication::Translate('- Select One -'), null);
         $objCommunicationListArray = CommunicationList::LoadAll();
         if ($objCommunicationListArray) {
             foreach ($objCommunicationListArray as $objCommunicationList) {
                 $objListItem = new QListItem($objCommunicationList->__toString(), $objCommunicationList->Id);
                 if ($this->objEmailMessageRoute->CommunicationList && $this->objEmailMessageRoute->CommunicationList->Id == $objCommunicationList->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstCommunicationList->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCommunicationListId) {
         $this->lblCommunicationListId->Text = $this->objEmailMessageRoute->CommunicationList ? $this->objEmailMessageRoute->CommunicationList->__toString() : null;
     }
     if ($this->lstLogin) {
         $this->lstLogin->RemoveAllItems();
         $this->lstLogin->AddItem(QApplication::Translate('- Select One -'), null);
         $objLoginArray = Login::LoadAll();
         if ($objLoginArray) {
             foreach ($objLoginArray as $objLogin) {
                 $objListItem = new QListItem($objLogin->__toString(), $objLogin->Id);
                 if ($this->objEmailMessageRoute->Login && $this->objEmailMessageRoute->Login->Id == $objLogin->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstLogin->AddItem($objListItem);
             }
         }
     }
     if ($this->lblLoginId) {
         $this->lblLoginId->Text = $this->objEmailMessageRoute->Login ? $this->objEmailMessageRoute->Login->__toString() : null;
     }
     if ($this->lstCommunicationListEntry) {
         $this->lstCommunicationListEntry->RemoveAllItems();
         $this->lstCommunicationListEntry->AddItem(QApplication::Translate('- Select One -'), null);
         $objCommunicationListEntryArray = CommunicationListEntry::LoadAll();
         if ($objCommunicationListEntryArray) {
             foreach ($objCommunicationListEntryArray as $objCommunicationListEntry) {
                 $objListItem = new QListItem($objCommunicationListEntry->__toString(), $objCommunicationListEntry->Id);
                 if ($this->objEmailMessageRoute->CommunicationListEntry && $this->objEmailMessageRoute->CommunicationListEntry->Id == $objCommunicationListEntry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstCommunicationListEntry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCommunicationListEntryId) {
         $this->lblCommunicationListEntryId->Text = $this->objEmailMessageRoute->CommunicationListEntry ? $this->objEmailMessageRoute->CommunicationListEntry->__toString() : 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->objEmailMessageRoute->Person && $this->objEmailMessageRoute->Person->Id == $objPerson->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstPerson->AddItem($objListItem);
             }
         }
     }
     if ($this->lblPersonId) {
         $this->lblPersonId->Text = $this->objEmailMessageRoute->Person ? $this->objEmailMessageRoute->Person->__toString() : null;
     }
 }
 /**
  * Refresh this MetaControl with Data from the local CommunicationList object.
  * @param boolean $blnReload reload CommunicationList from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objCommunicationList->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objCommunicationList->Id;
         }
     }
     if ($this->lstEmailBroadcastType) {
         $this->lstEmailBroadcastType->SelectedValue = $this->objCommunicationList->EmailBroadcastTypeId;
     }
     if ($this->lblEmailBroadcastTypeId) {
         $this->lblEmailBroadcastTypeId->Text = $this->objCommunicationList->EmailBroadcastTypeId ? EmailBroadcastType::$NameArray[$this->objCommunicationList->EmailBroadcastTypeId] : 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->objCommunicationList->Ministry && $this->objCommunicationList->Ministry->Id == $objMinistry->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstMinistry->AddItem($objListItem);
             }
         }
     }
     if ($this->lblMinistryId) {
         $this->lblMinistryId->Text = $this->objCommunicationList->Ministry ? $this->objCommunicationList->Ministry->__toString() : null;
     }
     if ($this->txtName) {
         $this->txtName->Text = $this->objCommunicationList->Name;
     }
     if ($this->lblName) {
         $this->lblName->Text = $this->objCommunicationList->Name;
     }
     if ($this->txtToken) {
         $this->txtToken->Text = $this->objCommunicationList->Token;
     }
     if ($this->lblToken) {
         $this->lblToken->Text = $this->objCommunicationList->Token;
     }
     if ($this->txtDescription) {
         $this->txtDescription->Text = $this->objCommunicationList->Description;
     }
     if ($this->lblDescription) {
         $this->lblDescription->Text = $this->objCommunicationList->Description;
     }
     if ($this->chkSubscribable) {
         $this->chkSubscribable->Checked = $this->objCommunicationList->Subscribable;
     }
     if ($this->lblSubscribable) {
         $this->lblSubscribable->Text = $this->objCommunicationList->Subscribable ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->lstCommunicationListEntries) {
         $this->lstCommunicationListEntries->RemoveAllItems();
         $objAssociatedArray = $this->objCommunicationList->GetCommunicationListEntryArray();
         $objCommunicationListEntryArray = CommunicationListEntry::LoadAll();
         if ($objCommunicationListEntryArray) {
             foreach ($objCommunicationListEntryArray as $objCommunicationListEntry) {
                 $objListItem = new QListItem($objCommunicationListEntry->__toString(), $objCommunicationListEntry->Id);
                 foreach ($objAssociatedArray as $objAssociated) {
                     if ($objAssociated->Id == $objCommunicationListEntry->Id) {
                         $objListItem->Selected = true;
                     }
                 }
                 $this->lstCommunicationListEntries->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCommunicationListEntries) {
         $objAssociatedArray = $this->objCommunicationList->GetCommunicationListEntryArray();
         $strItems = array();
         foreach ($objAssociatedArray as $objAssociated) {
             $strItems[] = $objAssociated->__toString();
         }
         $this->lblCommunicationListEntries->Text = implode($strGlue, $strItems);
     }
     if ($this->lstPeople) {
         $this->lstPeople->RemoveAllItems();
         $objAssociatedArray = $this->objCommunicationList->GetPersonArray();
         $objPersonArray = Person::LoadAll();
         if ($objPersonArray) {
             foreach ($objPersonArray as $objPerson) {
                 $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id);
                 foreach ($objAssociatedArray as $objAssociated) {
                     if ($objAssociated->Id == $objPerson->Id) {
                         $objListItem->Selected = true;
                     }
                 }
                 $this->lstPeople->AddItem($objListItem);
             }
         }
     }
     if ($this->lblPeople) {
         $objAssociatedArray = $this->objCommunicationList->GetPersonArray();
         $strItems = array();
         foreach ($objAssociatedArray as $objAssociated) {
             $strItems[] = $objAssociated->__toString();
         }
         $this->lblPeople->Text = implode($strGlue, $strItems);
     }
 }