public function Save($blnForceInsert = false, $blnForceUpdate = false) { $mixResult = parent::Save($blnForceInsert, $blnForceUpdate); foreach (NarroProject::LoadAll() as $objProject) { $objProjectProgress = NarroProjectProgress::LoadByProjectIdLanguageId($objProject->ProjectId, $this->LanguageId); if (!$objProjectProgress) { $objProject->CountAllTextsByLanguage($this->LanguageId); } } return $mixResult; }
/** * Refresh this MetaControl with Data from the local NarroLog object. * @param boolean $blnReload reload NarroLog from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objNarroLog->Reload(); } if ($this->lblLogId) { if ($this->blnEditMode) { $this->lblLogId->Text = $this->objNarroLog->LogId; } } if ($this->lstLanguage) { $this->lstLanguage->RemoveAllItems(); $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->objNarroLog->Language && $this->objNarroLog->Language->LanguageId == $objLanguage->LanguageId) { $objListItem->Selected = true; } $this->lstLanguage->AddItem($objListItem); } } } if ($this->lblLanguageId) { $this->lblLanguageId->Text = $this->objNarroLog->Language ? $this->objNarroLog->Language->__toString() : null; } if ($this->lstProject) { $this->lstProject->RemoveAllItems(); $this->lstProject->AddItem(QApplication::Translate('- Select One -'), null); $objProjectArray = NarroProject::LoadAll(); if ($objProjectArray) { foreach ($objProjectArray as $objProject) { $objListItem = new QListItem($objProject->__toString(), $objProject->ProjectId); if ($this->objNarroLog->Project && $this->objNarroLog->Project->ProjectId == $objProject->ProjectId) { $objListItem->Selected = true; } $this->lstProject->AddItem($objListItem); } } } if ($this->lblProjectId) { $this->lblProjectId->Text = $this->objNarroLog->Project ? $this->objNarroLog->Project->__toString() : null; } if ($this->lstUser) { $this->lstUser->RemoveAllItems(); $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->objNarroLog->User && $this->objNarroLog->User->UserId == $objUser->UserId) { $objListItem->Selected = true; } $this->lstUser->AddItem($objListItem); } } } if ($this->lblUserId) { $this->lblUserId->Text = $this->objNarroLog->User ? $this->objNarroLog->User->__toString() : null; } if ($this->txtMessage) { $this->txtMessage->Text = $this->objNarroLog->Message; } if ($this->lblMessage) { $this->lblMessage->Text = $this->objNarroLog->Message; } if ($this->txtPriority) { $this->txtPriority->Text = $this->objNarroLog->Priority; } if ($this->lblPriority) { $this->lblPriority->Text = $this->objNarroLog->Priority; } if ($this->calDate) { $this->calDate->DateTime = $this->objNarroLog->Date; } if ($this->lblDate) { $this->lblDate->Text = sprintf($this->objNarroLog->Date) ? $this->objNarroLog->Date->qFormat($this->strDateDateTimeFormat) : null; } }
protected function Form_Create() { parent::Form_Create(); if (!QApplication::HasPermissionForThisLang('Administrator')) { QApplication::Redirect(NarroLink::ProjectList()); } $this->pnlTab = new QTabs($this); $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::ProjectList(t('Projects')); $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::Translate(0, '', NarroTranslatePanel::SHOW_NOT_TRANSLATED, '', 0, 0, 10, 0, 0, t('Translate')); $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::Review(0, '', NarroTranslatePanel::SHOW_NOT_APPROVED, '', 0, 0, 10, 0, 0, t('Review')); if (NarroLanguage::CountAllActive() > 2 || QApplication::HasPermission('Administrator')) { $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::LanguageList(t('Languages')); } $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::UserList('', t('Users')); $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::RoleList(0, '', t('Roles')); if (QApplication::HasPermissionForThisLang('Administrator')) { $this->pnlLog = new QPanel($this->pnlTab); $this->pnlLog->AutoRenderChildren = true; $btnClearLog = new QButton($this->pnlLog); $btnClearLog->Text = t('Clear the log'); $btnClearLog->AddAction(new QClickEvent(), new QConfirmAction(t('Are you sure you want to delete all the logged messages?'))); $btnClearLog->AddAction(new QClickEvent(), new QAjaxAction('btnClearLog_Click')); $this->dtgLog = new NarroLogDataGrid($this->pnlLog); // Datagrid Paginator $this->dtgLog->Paginator = new QPaginator($this->dtgLog); $this->dtgLog->PaginatorAlternate = new QPaginator($this->dtgLog); $this->dtgLog->ItemsPerPage = QApplication::$User->GetPreferenceValueByName('Items per page'); $this->dtgLog->SortColumnIndex = 0; $this->dtgLog->SortDirection = 1; $colDate = $this->dtgLog->MetaAddColumn(QQN::NarroLog()->Date); $colDate->OrderByClause = QQ::OrderBy(QQN::NarroLog()->LogId); $colDate->ReverseOrderByClause = QQ::OrderBy(QQN::NarroLog()->LogId, 0); if (QApplication::HasPermission('Administrator')) { $colLanguage = $this->dtgLog->MetaAddColumn(QQN::NarroLog()->Language->LanguageName); $colLanguage->Filter = null; $colLanguage->FilterAddListItem(t('-Not set-'), QQ::IsNull(QQN::NarroLog()->LanguageId)); foreach (NarroLanguage::LoadAll(QQ::OrderBy(QQN::NarroLanguage()->LanguageName)) as $objLanguage) { $colLanguage->FilterAddListItem($objLanguage->LanguageName, QQ::Equal(QQN::NarroLog()->LanguageId, $objLanguage->LanguageId)); } } else { $this->dtgLog->AdditionalConditions = QQ::Equal(QQN::NarroLog()->LanguageId, QApplication::GetLanguageId()); } $colProject = $this->dtgLog->MetaAddColumn(QQN::NarroLog()->Project->ProjectName); $colProject->Filter = null; $colProject->FilterAddListItem(t('-Not set-'), QQ::IsNull(QQN::NarroLog()->ProjectId)); foreach (NarroProject::LoadAll(QQ::OrderBy(QQN::NarroProject()->ProjectName)) as $objProject) { $colProject->FilterAddListItem($objProject->ProjectName, QQ::Equal(QQN::NarroLog()->ProjectId, $objProject->ProjectId)); } $colUser = $this->dtgLog->MetaAddColumn(QQN::NarroLog()->User->Username); $colUser->Html = '<?=(($_ITEM->UserId)?NarroLink::UserProfile($_ITEM->UserId, $_ITEM->User->Username):"")?>'; $colUser->HtmlEntities = false; $colPriority = $this->dtgLog->MetaAddColumn(QQN::NarroLog()->Priority); $colPriority->Name = 'P'; $colPriority->Width = 16; $colPriority->FilterBoxSize = 1; $colPriority->HtmlEntities = false; $colMessage = $this->dtgLog->MetaAddColumn(QQN::NarroLog()->Message); $colMessage->HtmlEntities = false; $colMessage->Html = '<?=$_FORM->dtgLog_colMessage_Render($_ITEM)?>'; $arrHeaders[] = NarroLink::Log('', t('Application Log')); $this->pnlTab->Selected = count($arrHeaders) - 1; } $this->pnlTab->Headers = $arrHeaders; }
/** * Refresh this MetaControl with Data from the local NarroProjectProgress object. * @param boolean $blnReload reload NarroProjectProgress from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objNarroProjectProgress->Reload(); } if ($this->lblProjectProgressId) { if ($this->blnEditMode) { $this->lblProjectProgressId->Text = $this->objNarroProjectProgress->ProjectProgressId; } } if ($this->lstProject) { $this->lstProject->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstProject->AddItem(QApplication::Translate('- Select One -'), null); } $objProjectArray = NarroProject::LoadAll(); if ($objProjectArray) { foreach ($objProjectArray as $objProject) { $objListItem = new QListItem($objProject->__toString(), $objProject->ProjectId); if ($this->objNarroProjectProgress->Project && $this->objNarroProjectProgress->Project->ProjectId == $objProject->ProjectId) { $objListItem->Selected = true; } $this->lstProject->AddItem($objListItem); } } } if ($this->lblProjectId) { $this->lblProjectId->Text = $this->objNarroProjectProgress->Project ? $this->objNarroProjectProgress->Project->__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->objNarroProjectProgress->Language && $this->objNarroProjectProgress->Language->LanguageId == $objLanguage->LanguageId) { $objListItem->Selected = true; } $this->lstLanguage->AddItem($objListItem); } } } if ($this->lblLanguageId) { $this->lblLanguageId->Text = $this->objNarroProjectProgress->Language ? $this->objNarroProjectProgress->Language->__toString() : null; } if ($this->chkActive) { $this->chkActive->Checked = $this->objNarroProjectProgress->Active; } if ($this->lblActive) { $this->lblActive->Text = $this->objNarroProjectProgress->Active ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->calLastModified) { $this->calLastModified->DateTime = $this->objNarroProjectProgress->LastModified; } if ($this->lblLastModified) { $this->lblLastModified->Text = sprintf($this->objNarroProjectProgress->LastModified) ? $this->objNarroProjectProgress->LastModified->qFormat($this->strLastModifiedDateTimeFormat) : null; } if ($this->txtTotalTextCount) { $this->txtTotalTextCount->Text = $this->objNarroProjectProgress->TotalTextCount; } if ($this->lblTotalTextCount) { $this->lblTotalTextCount->Text = $this->objNarroProjectProgress->TotalTextCount; } if ($this->txtFuzzyTextCount) { $this->txtFuzzyTextCount->Text = $this->objNarroProjectProgress->FuzzyTextCount; } if ($this->lblFuzzyTextCount) { $this->lblFuzzyTextCount->Text = $this->objNarroProjectProgress->FuzzyTextCount; } if ($this->txtApprovedTextCount) { $this->txtApprovedTextCount->Text = $this->objNarroProjectProgress->ApprovedTextCount; } if ($this->lblApprovedTextCount) { $this->lblApprovedTextCount->Text = $this->objNarroProjectProgress->ApprovedTextCount; } if ($this->txtProgressPercent) { $this->txtProgressPercent->Text = $this->objNarroProjectProgress->ProgressPercent; } if ($this->lblProgressPercent) { $this->lblProgressPercent->Text = $this->objNarroProjectProgress->ProgressPercent; } if ($this->txtData) { $this->txtData->Text = $this->objNarroProjectProgress->Data; } if ($this->lblData) { $this->lblData->Text = $this->objNarroProjectProgress->Data; } }
/** * Refresh this MetaControl with Data from the local NarroContext object. * @param boolean $blnReload reload NarroContext from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objNarroContext->Reload(); } if ($this->lblContextId) { if ($this->blnEditMode) { $this->lblContextId->Text = $this->objNarroContext->ContextId; } } if ($this->lstText) { $this->lstText->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstText->AddItem(QApplication::Translate('- Select One -'), null); } $objTextArray = NarroText::LoadAll(); if ($objTextArray) { foreach ($objTextArray as $objText) { $objListItem = new QListItem($objText->__toString(), $objText->TextId); if ($this->objNarroContext->Text && $this->objNarroContext->Text->TextId == $objText->TextId) { $objListItem->Selected = true; } $this->lstText->AddItem($objListItem); } } } if ($this->lblTextId) { $this->lblTextId->Text = $this->objNarroContext->Text ? $this->objNarroContext->Text->__toString() : null; } if ($this->txtTextAccessKey) { $this->txtTextAccessKey->Text = $this->objNarroContext->TextAccessKey; } if ($this->lblTextAccessKey) { $this->lblTextAccessKey->Text = $this->objNarroContext->TextAccessKey; } if ($this->txtTextCommandKey) { $this->txtTextCommandKey->Text = $this->objNarroContext->TextCommandKey; } if ($this->lblTextCommandKey) { $this->lblTextCommandKey->Text = $this->objNarroContext->TextCommandKey; } if ($this->lstProject) { $this->lstProject->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstProject->AddItem(QApplication::Translate('- Select One -'), null); } $objProjectArray = NarroProject::LoadAll(); if ($objProjectArray) { foreach ($objProjectArray as $objProject) { $objListItem = new QListItem($objProject->__toString(), $objProject->ProjectId); if ($this->objNarroContext->Project && $this->objNarroContext->Project->ProjectId == $objProject->ProjectId) { $objListItem->Selected = true; } $this->lstProject->AddItem($objListItem); } } } if ($this->lblProjectId) { $this->lblProjectId->Text = $this->objNarroContext->Project ? $this->objNarroContext->Project->__toString() : null; } if ($this->txtContext) { $this->txtContext->Text = $this->objNarroContext->Context; } if ($this->lblContext) { $this->lblContext->Text = $this->objNarroContext->Context; } if ($this->txtContextMd5) { $this->txtContextMd5->Text = $this->objNarroContext->ContextMd5; } if ($this->lblContextMd5) { $this->lblContextMd5->Text = $this->objNarroContext->ContextMd5; } if ($this->txtComment) { $this->txtComment->Text = $this->objNarroContext->Comment; } if ($this->lblComment) { $this->lblComment->Text = $this->objNarroContext->Comment; } if ($this->txtCommentMd5) { $this->txtCommentMd5->Text = $this->objNarroContext->CommentMd5; } if ($this->lblCommentMd5) { $this->lblCommentMd5->Text = $this->objNarroContext->CommentMd5; } if ($this->lstFile) { $this->lstFile->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstFile->AddItem(QApplication::Translate('- Select One -'), null); } $objFileArray = NarroFile::LoadAll(); if ($objFileArray) { foreach ($objFileArray as $objFile) { $objListItem = new QListItem($objFile->__toString(), $objFile->FileId); if ($this->objNarroContext->File && $this->objNarroContext->File->FileId == $objFile->FileId) { $objListItem->Selected = true; } $this->lstFile->AddItem($objListItem); } } } if ($this->lblFileId) { $this->lblFileId->Text = $this->objNarroContext->File ? $this->objNarroContext->File->__toString() : null; } if ($this->calCreated) { $this->calCreated->DateTime = $this->objNarroContext->Created; } if ($this->lblCreated) { $this->lblCreated->Text = sprintf($this->objNarroContext->Created) ? $this->objNarroContext->Created->qFormat($this->strCreatedDateTimeFormat) : null; } if ($this->calModified) { $this->calModified->DateTime = $this->objNarroContext->Modified; } if ($this->lblModified) { $this->lblModified->Text = sprintf($this->objNarroContext->Modified) ? $this->objNarroContext->Modified->qFormat($this->strModifiedDateTimeFormat) : null; } if ($this->chkActive) { $this->chkActive->Checked = $this->objNarroContext->Active; } if ($this->lblActive) { $this->lblActive->Text = $this->objNarroContext->Active ? QApplication::Translate('Yes') : QApplication::Translate('No'); } }
/** * Refresh this MetaControl with Data from the local NarroFile object. * @param boolean $blnReload reload NarroFile from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objNarroFile->Reload(); } if ($this->lblFileId) { if ($this->blnEditMode) { $this->lblFileId->Text = $this->objNarroFile->FileId; } } if ($this->txtFileName) { $this->txtFileName->Text = $this->objNarroFile->FileName; } if ($this->lblFileName) { $this->lblFileName->Text = $this->objNarroFile->FileName; } if ($this->txtFilePath) { $this->txtFilePath->Text = $this->objNarroFile->FilePath; } if ($this->lblFilePath) { $this->lblFilePath->Text = $this->objNarroFile->FilePath; } if ($this->txtFileMd5) { $this->txtFileMd5->Text = $this->objNarroFile->FileMd5; } if ($this->lblFileMd5) { $this->lblFileMd5->Text = $this->objNarroFile->FileMd5; } if ($this->lstParent) { $this->lstParent->RemoveAllItems(); $this->lstParent->AddItem(QApplication::Translate('- Select One -'), null); $objParentArray = NarroFile::LoadAll(); if ($objParentArray) { foreach ($objParentArray as $objParent) { $objListItem = new QListItem($objParent->__toString(), $objParent->FileId); if ($this->objNarroFile->Parent && $this->objNarroFile->Parent->FileId == $objParent->FileId) { $objListItem->Selected = true; } $this->lstParent->AddItem($objListItem); } } } if ($this->lblParentId) { $this->lblParentId->Text = $this->objNarroFile->Parent ? $this->objNarroFile->Parent->__toString() : null; } if ($this->lstType) { $this->lstType->SelectedValue = $this->objNarroFile->TypeId; } if ($this->lblTypeId) { $this->lblTypeId->Text = $this->objNarroFile->TypeId ? NarroFileType::$NameArray[$this->objNarroFile->TypeId] : null; } if ($this->lstProject) { $this->lstProject->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstProject->AddItem(QApplication::Translate('- Select One -'), null); } $objProjectArray = NarroProject::LoadAll(); if ($objProjectArray) { foreach ($objProjectArray as $objProject) { $objListItem = new QListItem($objProject->__toString(), $objProject->ProjectId); if ($this->objNarroFile->Project && $this->objNarroFile->Project->ProjectId == $objProject->ProjectId) { $objListItem->Selected = true; } $this->lstProject->AddItem($objListItem); } } } if ($this->lblProjectId) { $this->lblProjectId->Text = $this->objNarroFile->Project ? $this->objNarroFile->Project->__toString() : null; } if ($this->chkActive) { $this->chkActive->Checked = $this->objNarroFile->Active; } if ($this->lblActive) { $this->lblActive->Text = $this->objNarroFile->Active ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->calCreated) { $this->calCreated->DateTime = $this->objNarroFile->Created; } if ($this->lblCreated) { $this->lblCreated->Text = sprintf($this->objNarroFile->Created) ? $this->objNarroFile->Created->qFormat($this->strCreatedDateTimeFormat) : null; } if ($this->calModified) { $this->calModified->DateTime = $this->objNarroFile->Modified; } if ($this->lblModified) { $this->lblModified->Text = sprintf($this->objNarroFile->Modified) ? $this->objNarroFile->Modified->qFormat($this->strModifiedDateTimeFormat) : null; } if ($this->txtHeader) { $this->txtHeader->Text = $this->objNarroFile->Header; } if ($this->lblHeader) { $this->lblHeader->Text = $this->objNarroFile->Header; } }
/** * Refresh this MetaControl with Data from the local NarroUserRole object. * @param boolean $blnReload reload NarroUserRole from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objNarroUserRole->Reload(); } if ($this->lblUserRoleId) { if ($this->blnEditMode) { $this->lblUserRoleId->Text = $this->objNarroUserRole->UserRoleId; } } 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->objNarroUserRole->User && $this->objNarroUserRole->User->UserId == $objUser->UserId) { $objListItem->Selected = true; } $this->lstUser->AddItem($objListItem); } } } if ($this->lblUserId) { $this->lblUserId->Text = $this->objNarroUserRole->User ? $this->objNarroUserRole->User->__toString() : null; } if ($this->lstRole) { $this->lstRole->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstRole->AddItem(QApplication::Translate('- Select One -'), null); } $objRoleArray = NarroRole::LoadAll(); if ($objRoleArray) { foreach ($objRoleArray as $objRole) { $objListItem = new QListItem($objRole->__toString(), $objRole->RoleId); if ($this->objNarroUserRole->Role && $this->objNarroUserRole->Role->RoleId == $objRole->RoleId) { $objListItem->Selected = true; } $this->lstRole->AddItem($objListItem); } } } if ($this->lblRoleId) { $this->lblRoleId->Text = $this->objNarroUserRole->Role ? $this->objNarroUserRole->Role->__toString() : null; } if ($this->lstProject) { $this->lstProject->RemoveAllItems(); $this->lstProject->AddItem(QApplication::Translate('- Select One -'), null); $objProjectArray = NarroProject::LoadAll(); if ($objProjectArray) { foreach ($objProjectArray as $objProject) { $objListItem = new QListItem($objProject->__toString(), $objProject->ProjectId); if ($this->objNarroUserRole->Project && $this->objNarroUserRole->Project->ProjectId == $objProject->ProjectId) { $objListItem->Selected = true; } $this->lstProject->AddItem($objListItem); } } } if ($this->lblProjectId) { $this->lblProjectId->Text = $this->objNarroUserRole->Project ? $this->objNarroUserRole->Project->__toString() : null; } if ($this->lstLanguage) { $this->lstLanguage->RemoveAllItems(); $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->objNarroUserRole->Language && $this->objNarroUserRole->Language->LanguageId == $objLanguage->LanguageId) { $objListItem->Selected = true; } $this->lstLanguage->AddItem($objListItem); } } } if ($this->lblLanguageId) { $this->lblLanguageId->Text = $this->objNarroUserRole->Language ? $this->objNarroUserRole->Language->__toString() : null; } }