protected function Form_Create() { parent::Form_Create(); $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('Translate')); if (NarroLanguage::CountAllActive() > 2 || QApplication::HasPermission('Administrator')) { $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::LanguageList(t('Languages')); } $this->pnlUserList = new NarroUserListPanel($this->pnlTab); $arrHeaders[] = NarroLink::UserList('', t('Users')); $this->pnlTab->Selected = count($arrHeaders) - 1; $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::RoleList(0, '', t('Roles')); if (QApplication::HasPermissionForThisLang('Administrator')) { $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::Log('', t('Application Log')); } $this->pnlTab->Headers = $arrHeaders; }
protected function Form_Create() { parent::Form_Create(); $this->pnlTab = new QTabs($this); /** * Create the project list panel and set the filter from the url. * The filter is used to show only projects of a given status based on their progress * (finished, empty, in progress). */ $this->pnlProjectList = new NarroProjectListPanel($this->pnlTab); $this->pnlTop = new NarroTopPanel(date(sprintf('Y-m-%d 00:00:00', date('d') - date('N') + 1)), $this); $pnlDummy = new QPanel($this->pnlTab); $pnlDummy = new QPanel($this->pnlTab); $arrHeaders = array(t('Projects'), NarroLink::Translate(0, '', NarroTranslatePanel::SHOW_NOT_TRANSLATED, '', 0, 0, 10, 0, 0, t('Translate')), NarroLink::Review(0, '', NarroTranslatePanel::SHOW_NOT_APPROVED, '', 0, 0, 10, 0, 0, t('Review'))); /** * Do not show the langauge tab if only two languages are active (source and target * Unless the user is an administrator and might want to set another one active */ 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')) { $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::Log('', t('Application Log')); } $this->pnlTab->Headers = $arrHeaders; }
protected function Form_Create() { parent::Form_Create(); $this->pnlTab = new QTabs($this); $pnlDummy = new QPanel($this->pnlTab); $pnlDummy = new QPanel($this->pnlTab); $pnlDummy = new QPanel($this->pnlTab); $arrHeaders = array(NarroLink::ProjectList(t('Projects')), NarroLink::Translate(0, '', NarroTranslatePanel::SHOW_ALL, '', 0, 0, 10, 0, 0, t('Translate')), NarroLink::Translate(0, '', NarroTranslatePanel::SHOW_NOT_APPROVED, '', 0, 0, 10, 0, 0, t('Review'))); /** * Do not show the langauge tab if only two languages are active (source and target * Unless the user is an administrator and might want to set another one active */ if (NarroLanguage::CountAllActive() > 2 || QApplication::HasPermission('Administrator')) { $this->pnlLanguageTab = new QTabs($this->pnlTab); $pnlDummy = new QPanel($this->pnlLanguageTab); $arrLangHeaders[] = t('List'); if (QApplication::HasPermissionForThisLang('Can add language')) { $this->pnlLanguageEdit = new NarroLanguageEditPanel($this->pnlLanguageTab, NarroLanguage::Load(QApplication::QueryString('lid'))); $arrLangHeaders[] = QApplication::QueryString('lid') ? t('Edit') : t('Add'); } $this->pnlLanguageTab->Headers = $arrLangHeaders; $this->pnlLanguageTab->Selected = 1; $arrHeaders[] = t('Languages'); $this->pnlTab->Selected = count($arrHeaders) - 1; } $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')) { $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::Log('', t('Application Log')); } $this->pnlTab->Headers = $arrHeaders; }
protected function Form_Create() { parent::Form_Create(); if (QApplication::GetUserId() == NarroUser::ANONYMOUS_USER_ID) { $strPassHash = QApplication::QueryString('h'); $strUsername = QApplication::QueryString('u'); if ($strPassHash && $strUsername) { $objUser = NarroUser::LoadByUsernameAndPassword($strUsername, $strPassHash); if ($objUser instanceof NarroUser) { QApplication::$User = $objUser; } else { QApplication::Redirect('login.php'); } } else { QApplication::Redirect('login.php'); } } $this->lblMessage = new QLabel($this); $this->lblMessage->HtmlEntities = false; $this->txtPassword = new QTextBox($this); $this->txtPassword->TextMode = QTextMode::Password; $this->btnChangePassword = new QButton($this); $this->btnChangePassword->PrimaryButton = true; $this->btnChangePassword->Text = t('Change password'); $this->btnChangePassword->AddAction(new QClickEvent(), new QServerAction('btnChangePassword_Click')); }
protected function Form_Create() { parent::Form_Create(); if (QApplication::GetUserId() == NarroUser::ANONYMOUS_USER_ID) { QApplication::Redirect(NarroLink::ProjectList()); exit; } if (QApplication::GetUserId() != QApplication::QueryString('u') && QApplication::HasPermissionForThisLang('Can manage users', null)) { $this->objUser = NarroUser::Load(QApplication::QueryString('u')); } if (!$this->objUser instanceof NarroUser) { $this->objUser = QApplication::$User; } $this->pnlBreadcrumb->setElements(NarroLink::ProjectList(t('Projects')), NarroLink::UserList('', t('Users')), $this->objUser->RealName); $this->pnlTab = new QTabs($this); new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::UserProfile($this->objUser->UserId, t('Profile')); if (QApplication::GetUserId() == $this->objUser->UserId || QApplication::HasPermissionForThisLang('Can manage users', null)) { new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::UserPreferences($this->objUser->UserId, t('Preferences')); } new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::UserRole($this->objUser->UserId, t('Roles')); if (QApplication::GetUserId() == $this->objUser->UserId || QApplication::HasPermissionForThisLang('Can manage users', null)) { $this->pnlUser = new NarroUserEditPanel($this->objUser, $this->pnlTab); $arrHeaders[] = NarroLink::UserEdit($this->objUser->UserId, t('Edit')); $this->pnlTab->Selected = count($arrHeaders) - 1; } $this->pnlTab->Headers = $arrHeaders; }
protected function Form_Create() { parent::Form_Create(); $this->pnlMainTab = new QTabs($this); if (QApplication::QueryString('p') > 0) { if ($this->SetupNarroProject(QApplication::QueryString('p')) === false) { return false; } } }
protected function Form_Create() { parent::Form_Create(); $this->pnlBreadcrumb->setElements(NarroLink::ProjectList(t('Projects')), NarroLink::UserList('', t('Users')), t('Register')); $this->pnlTab = new QTabs($this); $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::UserLogin(t('Login')); $this->pnlUserRegister = new NarroUserRegisterPanel($this->pnlTab); $arrHeaders[] = t('Register'); $this->pnlTab->Selected = count($arrHeaders) - 1; $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::UserRecoverPassword(t('Lost and found')); $this->pnlTab->Headers = $arrHeaders; }
protected function Form_Create() { parent::Form_Create(); $this->pnlTab = new QTabPanel($this); $this->pnlTab->UseAjax = false; $this->pnlRoleTab = new QTabPanel($this->pnlTab); $this->pnlRoleEdit = new NarroRoleEditPanel($this->pnlRoleTab, NarroRole::Load(QApplication::QueryString('rid'))); $this->pnlRoleTab->addTab(new QPanel($this->pnlRoleTab), t('List'), NarroLink::RoleList()); $this->pnlRoleTab->addTab($this->pnlRoleEdit, QApplication::QueryString('lid') ? t('Edit') : t('Add')); $this->pnlTab->addTab(new QPanel($this->pnlTab), t('Projects'), NarroLink::ProjectList()); $this->pnlTab->addTab(new QPanel($this->pnlTab), t('Translate'), NarroLink::Translate(0, '', NarroTranslatePanel::SHOW_ALL, '', 0, 0, 10, 0, 0)); $this->pnlTab->addTab(new QPanel($this->pnlTab), t('Languages'), NarroLink::LanguageList()); $this->pnlTab->addTab(new QPanel($this->pnlTab), t('Users'), NarroLink::UserList()); $this->pnlTab->addTab($this->pnlRoleTab, t('Roles')); $this->pnlTab->SelectedTab = 4; $this->pnlRoleTab->SelectedTab = 1; $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('Translate')); 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')); $this->pnlRoleTab = new QTabs($this->pnlTab); new QPanel($this->pnlRoleTab); $arrRoleHeaders[] = NarroLink::RoleList(0, '', t('List')); if (QApplication::HasPermissionForThisLang('Can add role')) { $pnlDummy = new NarroRoleEditPanel($this->pnlRoleTab, NarroRole::Load(QApplication::QueryString('rid'))); $arrRoleHeaders[] = NarroLink::RoleEdit(null, t('Add')); $this->pnlRoleTab->Selected = count($arrRoleHeaders) - 1; } $this->pnlRoleTab->Headers = $arrRoleHeaders; $arrHeaders[] = t('Roles'); $this->pnlTab->Selected = count($arrHeaders) - 1; if (QApplication::HasPermissionForThisLang('Administrator')) { $pnlDummy = new QPanel($this->pnlTab); $arrHeaders[] = NarroLink::Log('', t('Application Log')); } $this->pnlTab->Headers = $arrHeaders; }
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; }