/** * Refresh this MetaControl with Data from the local EmailOutgoingQueue object. * @param boolean $blnReload reload EmailOutgoingQueue from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objEmailOutgoingQueue->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objEmailOutgoingQueue->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->objEmailOutgoingQueue->EmailMessage && $this->objEmailOutgoingQueue->EmailMessage->Id == $objEmailMessage->Id) { $objListItem->Selected = true; } $this->lstEmailMessage->AddItem($objListItem); } } } if ($this->lblEmailMessageId) { $this->lblEmailMessageId->Text = $this->objEmailOutgoingQueue->EmailMessage ? $this->objEmailOutgoingQueue->EmailMessage->__toString() : null; } if ($this->txtToAddress) { $this->txtToAddress->Text = $this->objEmailOutgoingQueue->ToAddress; } if ($this->lblToAddress) { $this->lblToAddress->Text = $this->objEmailOutgoingQueue->ToAddress; } if ($this->chkErrorFlag) { $this->chkErrorFlag->Checked = $this->objEmailOutgoingQueue->ErrorFlag; } if ($this->lblErrorFlag) { $this->lblErrorFlag->Text = $this->objEmailOutgoingQueue->ErrorFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtToken) { $this->txtToken->Text = $this->objEmailOutgoingQueue->Token; } if ($this->lblToken) { $this->lblToken->Text = $this->objEmailOutgoingQueue->Token; } }
/** * 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; } }