/** * Refresh this MetaControl with Data from the local NarroContextInfo object. * @param boolean $blnReload reload NarroContextInfo from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objNarroContextInfo->Reload(); } if ($this->lblContextInfoId) { if ($this->blnEditMode) { $this->lblContextInfoId->Text = $this->objNarroContextInfo->ContextInfoId; } } if ($this->lstContext) { $this->lstContext->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstContext->AddItem(QApplication::Translate('- Select One -'), null); } $objContextArray = NarroContext::LoadAll(); if ($objContextArray) { foreach ($objContextArray as $objContext) { $objListItem = new QListItem($objContext->__toString(), $objContext->ContextId); if ($this->objNarroContextInfo->Context && $this->objNarroContextInfo->Context->ContextId == $objContext->ContextId) { $objListItem->Selected = true; } $this->lstContext->AddItem($objListItem); } } } if ($this->lblContextId) { $this->lblContextId->Text = $this->objNarroContextInfo->Context ? $this->objNarroContextInfo->Context->__toString() : null; } if ($this->lstLanguage) { $this->lstLanguage->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstLanguage->AddItem(QApplication::Translate('- Select One -'), null); } $objLanguageArray = NarroLanguage::LoadAll(); if ($objLanguageArray) { foreach ($objLanguageArray as $objLanguage) { $objListItem = new QListItem($objLanguage->__toString(), $objLanguage->LanguageId); if ($this->objNarroContextInfo->Language && $this->objNarroContextInfo->Language->LanguageId == $objLanguage->LanguageId) { $objListItem->Selected = true; } $this->lstLanguage->AddItem($objListItem); } } } if ($this->lblLanguageId) { $this->lblLanguageId->Text = $this->objNarroContextInfo->Language ? $this->objNarroContextInfo->Language->__toString() : null; } if ($this->lstValidatorUser) { $this->lstValidatorUser->RemoveAllItems(); $this->lstValidatorUser->AddItem(QApplication::Translate('- Select One -'), null); $objValidatorUserArray = NarroUser::LoadAll(); if ($objValidatorUserArray) { foreach ($objValidatorUserArray as $objValidatorUser) { $objListItem = new QListItem($objValidatorUser->__toString(), $objValidatorUser->UserId); if ($this->objNarroContextInfo->ValidatorUser && $this->objNarroContextInfo->ValidatorUser->UserId == $objValidatorUser->UserId) { $objListItem->Selected = true; } $this->lstValidatorUser->AddItem($objListItem); } } } if ($this->lblValidatorUserId) { $this->lblValidatorUserId->Text = $this->objNarroContextInfo->ValidatorUser ? $this->objNarroContextInfo->ValidatorUser->__toString() : null; } if ($this->lstValidSuggestion) { $this->lstValidSuggestion->RemoveAllItems(); $this->lstValidSuggestion->AddItem(QApplication::Translate('- Select One -'), null); $objValidSuggestionArray = NarroSuggestion::LoadAll(); if ($objValidSuggestionArray) { foreach ($objValidSuggestionArray as $objValidSuggestion) { $objListItem = new QListItem($objValidSuggestion->__toString(), $objValidSuggestion->SuggestionId); if ($this->objNarroContextInfo->ValidSuggestion && $this->objNarroContextInfo->ValidSuggestion->SuggestionId == $objValidSuggestion->SuggestionId) { $objListItem->Selected = true; } $this->lstValidSuggestion->AddItem($objListItem); } } } if ($this->lblValidSuggestionId) { $this->lblValidSuggestionId->Text = $this->objNarroContextInfo->ValidSuggestion ? $this->objNarroContextInfo->ValidSuggestion->__toString() : null; } if ($this->chkHasSuggestions) { $this->chkHasSuggestions->Checked = $this->objNarroContextInfo->HasSuggestions; } if ($this->lblHasSuggestions) { $this->lblHasSuggestions->Text = $this->objNarroContextInfo->HasSuggestions ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtSuggestionAccessKey) { $this->txtSuggestionAccessKey->Text = $this->objNarroContextInfo->SuggestionAccessKey; } if ($this->lblSuggestionAccessKey) { $this->lblSuggestionAccessKey->Text = $this->objNarroContextInfo->SuggestionAccessKey; } if ($this->txtSuggestionCommandKey) { $this->txtSuggestionCommandKey->Text = $this->objNarroContextInfo->SuggestionCommandKey; } if ($this->lblSuggestionCommandKey) { $this->lblSuggestionCommandKey->Text = $this->objNarroContextInfo->SuggestionCommandKey; } if ($this->calCreated) { $this->calCreated->DateTime = $this->objNarroContextInfo->Created; } if ($this->lblCreated) { $this->lblCreated->Text = sprintf($this->objNarroContextInfo->Created) ? $this->objNarroContextInfo->Created->qFormat($this->strCreatedDateTimeFormat) : null; } if ($this->calModified) { $this->calModified->DateTime = $this->objNarroContextInfo->Modified; } if ($this->lblModified) { $this->lblModified->Text = sprintf($this->objNarroContextInfo->Modified) ? $this->objNarroContextInfo->Modified->qFormat($this->strModifiedDateTimeFormat) : null; } }
/** * Refresh this MetaControl with Data from the local NarroSuggestionVote object. * @param boolean $blnReload reload NarroSuggestionVote from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objNarroSuggestionVote->Reload(); } if ($this->lstSuggestion) { $this->lstSuggestion->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstSuggestion->AddItem(QApplication::Translate('- Select One -'), null); } $objSuggestionArray = NarroSuggestion::LoadAll(); if ($objSuggestionArray) { foreach ($objSuggestionArray as $objSuggestion) { $objListItem = new QListItem($objSuggestion->__toString(), $objSuggestion->SuggestionId); if ($this->objNarroSuggestionVote->Suggestion && $this->objNarroSuggestionVote->Suggestion->SuggestionId == $objSuggestion->SuggestionId) { $objListItem->Selected = true; } $this->lstSuggestion->AddItem($objListItem); } } } if ($this->lblSuggestionId) { $this->lblSuggestionId->Text = $this->objNarroSuggestionVote->Suggestion ? $this->objNarroSuggestionVote->Suggestion->__toString() : null; } if ($this->lstContext) { $this->lstContext->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstContext->AddItem(QApplication::Translate('- Select One -'), null); } $objContextArray = NarroContext::LoadAll(); if ($objContextArray) { foreach ($objContextArray as $objContext) { $objListItem = new QListItem($objContext->__toString(), $objContext->ContextId); if ($this->objNarroSuggestionVote->Context && $this->objNarroSuggestionVote->Context->ContextId == $objContext->ContextId) { $objListItem->Selected = true; } $this->lstContext->AddItem($objListItem); } } } if ($this->lblContextId) { $this->lblContextId->Text = $this->objNarroSuggestionVote->Context ? $this->objNarroSuggestionVote->Context->__toString() : null; } if ($this->lstUser) { $this->lstUser->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstUser->AddItem(QApplication::Translate('- Select One -'), null); } $objUserArray = NarroUser::LoadAll(); if ($objUserArray) { foreach ($objUserArray as $objUser) { $objListItem = new QListItem($objUser->__toString(), $objUser->UserId); if ($this->objNarroSuggestionVote->User && $this->objNarroSuggestionVote->User->UserId == $objUser->UserId) { $objListItem->Selected = true; } $this->lstUser->AddItem($objListItem); } } } if ($this->lblUserId) { $this->lblUserId->Text = $this->objNarroSuggestionVote->User ? $this->objNarroSuggestionVote->User->__toString() : null; } if ($this->txtVoteValue) { $this->txtVoteValue->Text = $this->objNarroSuggestionVote->VoteValue; } if ($this->lblVoteValue) { $this->lblVoteValue->Text = $this->objNarroSuggestionVote->VoteValue; } if ($this->calCreated) { $this->calCreated->DateTime = $this->objNarroSuggestionVote->Created; } if ($this->lblCreated) { $this->lblCreated->Text = sprintf($this->objNarroSuggestionVote->Created) ? $this->objNarroSuggestionVote->Created->qFormat($this->strCreatedDateTimeFormat) : null; } if ($this->calModified) { $this->calModified->DateTime = $this->objNarroSuggestionVote->Modified; } if ($this->lblModified) { $this->lblModified->Text = sprintf($this->objNarroSuggestionVote->Modified) ? $this->objNarroSuggestionVote->Modified->qFormat($this->strModifiedDateTimeFormat) : null; } }
/** * Refresh this MetaControl with Data from the local NarroContextComment object. * @param boolean $blnReload reload NarroContextComment from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objNarroContextComment->Reload(); } if ($this->lblCommentId) { if ($this->blnEditMode) { $this->lblCommentId->Text = $this->objNarroContextComment->CommentId; } } if ($this->lstContext) { $this->lstContext->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstContext->AddItem(QApplication::Translate('- Select One -'), null); } $objContextArray = NarroContext::LoadAll(); if ($objContextArray) { foreach ($objContextArray as $objContext) { $objListItem = new QListItem($objContext->__toString(), $objContext->ContextId); if ($this->objNarroContextComment->Context && $this->objNarroContextComment->Context->ContextId == $objContext->ContextId) { $objListItem->Selected = true; } $this->lstContext->AddItem($objListItem); } } } if ($this->lblContextId) { $this->lblContextId->Text = $this->objNarroContextComment->Context ? $this->objNarroContextComment->Context->__toString() : null; } if ($this->calCreated) { $this->calCreated->DateTime = $this->objNarroContextComment->Created; } if ($this->lblCreated) { $this->lblCreated->Text = sprintf($this->objNarroContextComment->Created) ? $this->objNarroContextComment->Created->qFormat($this->strCreatedDateTimeFormat) : null; } if ($this->calModified) { $this->calModified->DateTime = $this->objNarroContextComment->Modified; } if ($this->lblModified) { $this->lblModified->Text = sprintf($this->objNarroContextComment->Modified) ? $this->objNarroContextComment->Modified->qFormat($this->strModifiedDateTimeFormat) : null; } if ($this->txtCommentText) { $this->txtCommentText->Text = $this->objNarroContextComment->CommentText; } if ($this->lblCommentText) { $this->lblCommentText->Text = $this->objNarroContextComment->CommentText; } if ($this->txtCommentTextMd5) { $this->txtCommentTextMd5->Text = $this->objNarroContextComment->CommentTextMd5; } if ($this->lblCommentTextMd5) { $this->lblCommentTextMd5->Text = $this->objNarroContextComment->CommentTextMd5; } }