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) { 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(); 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(); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Project($this->objProject->ProjectId, t('Overview')); if ($this->objProject instanceof NarroProject && QApplication::HasPermissionForThisLang('Can edit project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectEdit($this->objProject->ProjectId, t('Edit')); } $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Translate($this->objProject->ProjectId, '', 0, '', 0, 0, 10, 0, 0, t('Translate')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Review($this->objProject->ProjectId, '', NarroReviewPanel::SHOW_NOT_APPROVED, '', 0, 0, 10, 0, 0, t('Review')); $this->pnlSelectedTab = new NarroProjectFileListPanel($this->objProject, $this->objParentFile, $this->pnlMainTab); $this->pnlSelectedTab->ChangeDirectory(QApplication::QueryString('pf')); $arrHeaders[] = NarroLink::ProjectFileList($this->objProject->ProjectId, '', '', t('Files')); $this->pnlMainTab->Selected = count($arrHeaders) - 1; $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectLanguages($this->objProject->ProjectId, t('Languages')); if (QApplication::HasPermissionForThisLang('Can import project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectImport($this->objProject->ProjectId, t('Import')); } if (QApplication::HasPermissionForThisLang('Can export project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectExport($this->objProject->ProjectId, t('Export')); } $this->pnlMainTab->Headers = $arrHeaders; }
public function __construct(NarroProject $objNarroProject, string $strCurrentPath = null, $objParentObject, $strControlId = null) { // Call the Parent try { parent::__construct($objParentObject, $strControlId); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } $this->pnlBreadcrumb = new NarroBreadcrumbPanel($this); $this->pnlBreadcrumb->strSeparator = ' / '; $this->objProject = $objNarroProject; $this->chkShowHierarchy = new QCheckBox($this); $this->chkShowHierarchy->Checked = QApplication::QueryString('s') == ''; $this->chkShowHierarchy->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgFile_SetConditions')); $this->chkShowFolders = new QCheckBox($this); $this->chkShowFolders->Checked = true; $this->chkShowFolders->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgFile_SetConditions')); $this->strTemplate = __NARRO_INCLUDES__ . '/narro/panel/NarroProjectFileListPanel.tpl.php'; $this->ChangeDirectory($strCurrentPath); $this->btnSearch = new QButton($this); $this->btnSearch->Text = t('Search'); $this->btnSearch->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSearch_Click')); $this->btnSearch->PrimaryButton = true; $this->txtSearch = new QTextBox($this); $this->txtSearch->Text = QApplication::QueryString('s'); $this->ChangeDirectory(QApplication::QueryString('pf')); $this->dtgFile_Create(); $this->dtgFile_SetConditions(); }
public function lstSort_Create() { $this->lstSort = new QListBox($this); $this->lstSort->AddItem(t('not sorted'), null, true); $this->lstSort->AddItem(t('sorted by most recent translation'), self::SORT_TRANSLATION_DATE); $this->lstSort->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'btnSearch_Click')); if (QApplication::QueryString('o')) { $this->lstSort->SelectedValue = QApplication::QueryString('o'); } }
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->txtSearch = new SearchTextBox($this, 'txtSearch'); $this->txtSearch->Text = QApplication::QueryString('search'); $this->txtSearch->AddAction(new QEnterKeyEvent(0, "qc.getControl('txtSearch').value != ''"), new QServerAction('txtSearch_Enter')); $this->txtSearch->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->dtrForums = new QDataRepeater($this, 'dtrForums'); $this->dtrForums->Template = 'dtrForums.tpl.php'; $this->dtrForums->SetDataBinder('dtrForums_Bind'); }
protected function SetupShipment() { // Lookup Object PK information from Query String (if applicable) // Set mode to Edit or New depending on what's found $intShipmentId = QApplication::QueryString('intShipmentId'); if ($intShipmentId) { $this->objShipment = Shipment::Load($intShipmentId); if (!$this->objShipment) { throw new Exception('Could not find a Shipment object with PK arguments: ' . $intShipmentId); } } }
protected function Form_Create() { $this->intTabIndex = 1; // Call SetupAddress to either Load/Edit Existing or Create New $this->SetupAddress(); if (!$this->blnEditMode) { // Load the Company from the $_GET variable passed $this->objAddress->CompanyId = QApplication::QueryString('intCompanyId'); } // Create the Header Menu $this->ctlHeaderMenu_Create(); // Create the Shortcut Menu $this->ctlShortcutMenu_Create(); // Create labels for Address information $this->lblCompany_Create(); $this->lblShortDescription_Create(); $this->lblHeaderAddress_Create(); $this->lblAddress1_Create(); $this->lblAddress2_Create(); $this->lblCity_Create(); $this->lblStateProvince_Create(); $this->lblCountry_Create(); $this->lblPostalCode_Create(); $this->lblCreationDate_Create(); $this->lblModifiedDate_Create(); $this->UpdateAddressLabels(); // Create/Setup Controls for Address' Data Fields $this->txtShortDescription_Create(); $this->lstCountry_Create(); $this->txtAddress1_Create(); $this->txtAddress2_Create(); $this->txtCity_Create(); $this->lstStateProvince_Create(); $this->txtPostalCode_Create(); $this->UpdateAddressControls(); // Create all custom contact fields $this->customFields_Create(); $this->UpdateBuiltInFields(); // Create/Setup Button Action controls $this->btnEdit_Create(); $this->btnSave_Create(); $this->btnCancel_Create(); $this->btnDelete_Create(); $this->atcAttach_Create(); $this->pnlAttachments_Create(); // Display labels for the existing address if ($this->blnEditMode) { $this->displayLabels(); } else { $this->displayInputs(); } }
protected function Form_Create() { parent::Form_Create(); if (QApplication::QueryString('p') == 0) { $this->pnlMainTab = new QTabs($this); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectList(t('Projects')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Translate(0, '', NarroTranslatePanel::SHOW_NOT_APPROVED, '', 0, 0, 10, 0, 0, t('Translate')); $this->pnlReview = new NarroTranslatePanel($this->pnlMainTab); $arrHeaders[] = t('Review'); $this->pnlMainTab->Selected = count($arrHeaders) - 1; if (NarroLanguage::CountAllActive() > 2 || QApplication::HasPermission('Administrator')) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::LanguageList(t('Languages')); } $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::UserList('', t('Users')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::RoleList(0, '', t('Roles')); if (QApplication::HasPermissionForThisLang('Administrator')) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Log('', t('Application Log')); } $this->pnlMainTab->Headers = $arrHeaders; } else { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Project($this->objProject->ProjectId, t('Overview')); if ($this->objProject instanceof NarroProject && QApplication::HasPermissionForThisLang('Can edit project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectEdit($this->objProject->ProjectId, t('Edit')); } $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Translate($this->objProject->ProjectId, '', NarroTranslatePanel::SHOW_NOT_TRANSLATED, '', 0, 0, 10, 0, 0, t('Translate')); $this->pnlReview = new NarroTranslatePanel($this->pnlMainTab); $arrHeaders[] = t('Review'); $this->pnlMainTab->Selected = count($arrHeaders) - 1; $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectFileList($this->objProject->ProjectId, '', '', t('Files')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectLanguages($this->objProject->ProjectId, t('Languages')); if (QApplication::HasPermissionForThisLang('Can import project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectImport($this->objProject->ProjectId, t('Import')); } if (QApplication::HasPermissionForThisLang('Can export project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectExport($this->objProject->ProjectId, t('Export')); } $this->pnlMainTab->Headers = $arrHeaders; } }
public function __construct($objParentObject, $intEntityQtypeId = null, $strControlId = null) { // First, call the parent to do most of the basic setup try { parent::__construct($objParentObject, $strControlId); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } $this->objParentObject = $objParentObject; $this->intEntityQtypeId = $intEntityQtypeId; $this->chkEntityView = new QCheckBox($this); $this->chkEntityEdit = new QCheckBox($this); $this->chkBuiltInView = new QCheckBox($this); $this->chkBuiltInView->Enabled = false; $this->chkBuiltInView->Checked = true; $intRoleId = QApplication::QueryString('intRoleId'); if ($intRoleId) { $objBuiltInViewAuth = RoleEntityQtypeBuiltInAuthorization::LoadByRoleIdEntityQtypeIdAuthorizationId($intRoleId, $intEntityQtypeId, 1); } if (isset($objBuiltInViewAuth)) { $this->chkBuiltInView->Checked = $objBuiltInViewAuth->AuthorizedFlag; } $this->chkBuiltInEdit = new QCheckBox($this); if ($intRoleId) { $objBuiltInEditAuth = RoleEntityQtypeBuiltInAuthorization::LoadByRoleIdEntityQtypeIdAuthorizationId($intRoleId, $intEntityQtypeId, 2); } if (isset($objBuiltInEditAuth)) { $this->chkBuiltInEdit->Checked = $objBuiltInEditAuth->AuthorizedFlag; } // Load all custom fields and their values into an array arrCustomChecks $objCustomFieldArray = CustomField::LoadObjCustomFieldArray($intEntityQtypeId, false, null); foreach ($objCustomFieldArray as $objCustomField) { $chkCustomView = new QCheckBox($this); $chkCustomEdit = new QCheckBox($this); $objEntityQtypeCustomField = EntityQtypeCustomField::LoadByEntityQtypeIdCustomFieldId($intEntityQtypeId, $objCustomField->CustomFieldId); if ($objEntityQtypeCustomField) { $objCustomAuthView = RoleEntityQtypeCustomFieldAuthorization::LoadByRoleIdEntityQtypeCustomFieldIdAuthorizationId($intRoleId, $objEntityQtypeCustomField->EntityQtypeCustomFieldId, 1); if ($objCustomAuthView) { $chkCustomView->Checked = $objCustomAuthView->AuthorizedFlag; } $objCustomAuthEdit = RoleEntityQtypeCustomFieldAuthorization::LoadByRoleIdEntityQtypeCustomFieldIdAuthorizationId($intRoleId, $objEntityQtypeCustomField->EntityQtypeCustomFieldId, 2); if ($objCustomAuthEdit) { $chkCustomEdit->Checked = $objCustomAuthEdit->AuthorizedFlag; } } $this->arrCustomChecks[] = array('name' => $objCustomField->ShortDescription . ':', 'view' => $chkCustomView, 'edit' => $chkCustomEdit); } }
protected function SetupDepreciationClass() { // Lookup Object PK information from PathInfo (if applicable) // Set mode to Edit or New depending on what's found $intDepreciationClassId = QApplication::QueryString('intDepreciationClassId'); if ($intDepreciationClassId) { $this->objDepreciationClass = DepreciationClass::Load($intDepreciationClassId); if (!$this->objDepreciationClass) { throw new Exception('Could not find a DepreciationClass object with PK arguments: ' . $intDepreciationClassId); } $this->blnEditMode = true; } else { $this->objDepreciationClass = new DepreciationClass(); $this->blnEditMode = false; } }
public function __construct($objParentObject, $strControlId = null) { // Call the Parent try { parent::__construct($objParentObject, $strControlId); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } $this->strTemplate = __NARRO_INCLUDES__ . '/narro/panel/NarroRoleListPanel.tpl.php'; $this->pnlRolePermissions = new NarroRolePermissionPanel($this); if (QApplication::QueryString('r')) { $this->pnlRolePermissions->Role = NarroRole::Load(QApplication::QueryString('r')); } $this->pnlRoleUsers = new NarroRoleUserListPanel($this); if ($this->pnlRolePermissions->Role instanceof NarroRole) { $this->pnlRoleUsers->Role = $this->pnlRolePermissions->Role; } switch (QApplication::QueryString('view')) { case 'permission': $this->pnlRolePermissions->Display = QDisplayStyle::Inline; $this->pnlRoleUsers->Display = QDisplayStyle::None; break; case 'user': $this->pnlRolePermissions->Display = QDisplayStyle::None; $this->pnlRoleUsers->Display = QDisplayStyle::Inline; break; default: $this->pnlRolePermissions->Display = QDisplayStyle::None; $this->pnlRoleUsers->Display = QDisplayStyle::None; } // Setup DataGrid Columns $this->colRoleName = new QDataGridColumn(t('Role'), '<?= $_CONTROL->ParentControl->dtgRole_RoleNameColumn_Render($_ITEM) ?>', array('OrderByClause' => QQ::OrderBy(QQN::NarroRole()->RoleName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::NarroRole()->RoleName, false))); $this->colRoleName->HtmlEntities = false; $this->colActions = new QDataGridColumn(t('Actions'), '<?= $_CONTROL->ParentControl->dtgRole_Actions_Render($_ITEM) ?>'); $this->colActions->HtmlEntities = false; // Setup DataGrid $this->dtgRole = new NarroDataGrid($this); $this->dtgRole->Title = t('Roles'); // Specify Whether or Not to Refresh using Ajax $this->dtgRole->UseAjax = false; // Specify the local databind method this datagrid will use $this->dtgRole->SetDataBinder('dtgRole_Bind', $this); $this->dtgRole->AddColumn($this->colRoleName); $this->dtgRole->AddColumn($this->colActions); $this->dtgRole->SortColumnIndex = 0; }
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 SetupVariable() { // Lookup Object PK information from Query String (if applicable) // Set mode to Edit or New depending on what's found $intId = QApplication::QueryString('intId'); if ($intId) { $this->objVariable = Variable::Load($intId); if (!$this->objVariable) { throw new Exception('Could not find a Variable object with PK arguments: ' . $intId); } $this->strTitleVerb = QApplication::Translate('Edit'); $this->blnEditMode = true; } else { $this->objVariable = new Variable(); $this->strTitleVerb = QApplication::Translate('Create'); $this->blnEditMode = false; } }
protected function SetupRoleEntityQtypeCustomFieldAuthorization() { // Lookup Object PK information from Query String (if applicable) // Set mode to Edit or New depending on what's found $intRoleEntityQtypeCustomFieldAuthorizationId = QApplication::QueryString('intRoleEntityQtypeCustomFieldAuthorizationId'); if ($intRoleEntityQtypeCustomFieldAuthorizationId) { $this->objRoleEntityQtypeCustomFieldAuthorization = RoleEntityQtypeCustomFieldAuthorization::Load($intRoleEntityQtypeCustomFieldAuthorizationId); if (!$this->objRoleEntityQtypeCustomFieldAuthorization) { throw new Exception('Could not find a RoleEntityQtypeCustomFieldAuthorization object with PK arguments: ' . $intRoleEntityQtypeCustomFieldAuthorizationId); } $this->strTitleVerb = QApplication::Translate('Edit'); $this->blnEditMode = true; } else { $this->objRoleEntityQtypeCustomFieldAuthorization = new RoleEntityQtypeCustomFieldAuthorization(); $this->strTitleVerb = QApplication::Translate('Create'); $this->blnEditMode = false; } }
protected function Form_Create() { $this->dtgParentPagerIndividuals = new ParentPagerIndividualDataGrid($this); $this->dtgParentPagerIndividuals->Paginator = new QPaginator($this->dtgParentPagerIndividuals); $this->dtgParentPagerIndividuals->MetaAddColumn('ServerIdentifier', 'Name=Parent Pager ID', 'Html=<?= $_FORM->RenderIdentifier($_ITEM); ?>', 'Width=120px', 'HtmlEntities=false'); $this->dtgParentPagerIndividuals->MetaAddColumn('FirstName', 'Width=140px'); $this->dtgParentPagerIndividuals->MetaAddColumn('LastName', 'Width=160px'); $this->dtgParentPagerIndividuals->AddColumn(new QDataGridColumn('Address(es)', '<?= $_FORM->RenderAddresses($_ITEM); ?>', 'Width=270px', 'HtmlEntities=false')); $this->dtgParentPagerIndividuals->MetaAddColumn(QQN::ParentPagerIndividual()->Person->FirstName, 'Name=Linked to NOAH Record', 'Html=<?= $_FORM->RenderLinkedPerson($_ITEM); ?>', 'Width=220px', 'HtmlEntities=false'); $this->dtgParentPagerIndividuals->SortColumnIndex = 2; $this->dtgParentPagerIndividuals->NoDataHtml = '<em>No results found... please try a less restrictive filter</em>'; $this->dtgParentPagerIndividuals->ItemsPerPage = 25; $this->dtgParentPagerIndividuals->SetDataBinder('dtgParentPagerIndividual_Bind', $this); $this->txtServerIdentifier = new QTextBox($this); $this->txtServerIdentifier->Text = QApplication::QueryString('id'); $this->txtServerIdentifier->AddAction(new QEnterKeyEvent(), new QAjaxAction('Filter_Change')); $this->txtServerIdentifier->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtFirstName = new QTextBox($this); $this->txtFirstName->Text = QApplication::QueryString('fn'); $this->txtFirstName->AddAction(new QEnterKeyEvent(), new QAjaxAction('Filter_Change')); $this->txtFirstName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtLastName = new QTextBox($this); $this->txtLastName->Text = QApplication::QueryString('ln'); $this->txtLastName->AddAction(new QEnterKeyEvent(), new QAjaxAction('Filter_Change')); $this->txtLastName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstParentPagerSyncStatusTypeId = new QListBox($this); $this->lstParentPagerSyncStatusTypeId->AddItem('- View All -'); $this->lstParentPagerSyncStatusTypeId->AddItem('- Hidden -', -1, QApplication::QueryString('sync') == -1); foreach (ParentPagerSyncStatusType::$NameArray as $intId => $strName) { $this->lstParentPagerSyncStatusTypeId->AddItem($strName, $intId, QApplication::QueryString('sync') == $intId); } $this->lstParentPagerSyncStatusTypeId->AddAction(new QChangeEvent(), new QAjaxAction('Filter_Change')); $this->lstGender = new QListBox($this); $this->lstGender->AddItem('- View All -'); $this->lstGender->AddItem('Male', 'M', QApplication::QueryString('g') == 'M'); $this->lstGender->AddItem('Female', 'F', QApplication::QueryString('g') == 'F'); $this->lstGender->AddAction(new QChangeEvent(), new QAjaxAction('Filter_Change')); $this->txtGraduationYear = new QTextBox($this); $this->txtGraduationYear->Text = QApplication::QueryString('year'); $this->txtGraduationYear->AddAction(new QChangeEvent(), new QAjaxAction('Filter_Change')); $this->txtGraduationYear->AddAction(new QEnterKeyEvent(), new QAjaxAction('Filter_Change')); $this->txtGraduationYear->AddAction(new QEnterKeyEvent(), new QTerminateAction()); }
protected function Form_Create() { // define the proxy that we will use later $this->pxyLink = new QControlProxy($this); $this->pxyLink->AddAction(new QMouseOverEvent(), new QAjaxAction('mouseOver')); // Define the DataGrid $this->tblProjects = new QHtmlTable($this); // This css class is used to style alternate rows and the header, all in css $this->tblProjects->CssClass = 'simple_table'; // Define Columns // Create a link column that shows the name of the project, and when clicked, calls back to this page with an id // of the item clicked on $this->tblProjects->CreateLinkColumn('Project', '->Name', QApplication::$ScriptName, ['intId' => '->Id']); // Create a link column using a proxy $col = $this->tblProjects->CreateLinkColumn('Status', '->ProjectStatusType', $this->pxyLink, '->Id'); $this->tblProjects->SetDataBinder('tblProjects_Bind'); $this->pnlClick = new QPanel($this); if (($intId = QApplication::QueryString('intId')) && ($objProject = Project::Load($intId))) { $this->pnlClick->Text = 'You clicked on ' . $objProject->Name; } }
public function __construct($objParentObject, $strControlId = null) { // First, call the parent to do most of the basic setup try { parent::__construct($objParentObject, $strControlId); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // Assign the parent object (AssetEditForm from asset_edit.php) $this->objParentObject = $objParentObject; // Setup the Asset, which assigns objAsset and blnEditMode $this->objParentObject->SetupAsset($this); // Create an empty Asset Array $this->objAssetArray = array(); if (!$this->intTransactionTypeId) { $this->intTransactionTypeId = QApplication::QueryString("intTransactionTypeId"); } // Check Out //if ($this->intTransactionTypeId == 3) { $this->CheckOutTo_Create(); $this->DueDate_Create(); // Removed it from constructor and added where it used //$this->objCompanyArray = Company::LoadAllIntoArray(); $this->lstToCompany_Create(); $this->lstToContact_Create(); $this->lblNewToCompany_Create(); $this->lblNewToContact_Create(); $this->dlgNew_Create(); //} $this->btnCancel_Create(); $this->lstLocation_Create(); $this->txtNote_Create(); $this->txtNewAssetCode_Create(); $this->btnAdd_Create(); $this->btnSave_Create(); $this->dtgAssetTransact_Create(); $this->ctlAssetSearchTool_Create(); }
protected function Form_Create() { // check rigths for the Inventory to Ship $this->blnShowInventory = true; $objRoleModule = RoleModule::LoadByRoleIdModuleId(QApplication::$objUserAccount->RoleId, 3); if ($objRoleModule->AccessFlag) { $objRoleModuleAuthorization = RoleModuleAuthorization::LoadByRoleModuleIdAuthorizationId($objRoleModule->RoleModuleId, 2); if ($objRoleModuleAuthorization->AuthorizationLevelId == 3) { $this->blnShowInventory = false; } } else { $this->blnShowInventory = false; } // Call Setup Receipt to either load existing or create new receipt $this->SetupReceipt(); // Create the Header Menu $this->ctlHeaderMenu_Create(); // Create the Shortcut Menu $this->ctlShortcutMenu_Create(); // Create the labels $this->lblHeaderReceipt_Create(); $this->lblFromCompany_Create(); $this->lblFromContact_Create(); $this->lblToContact_Create(); $this->lblToAddress_Create(); $this->lblReceiptNumber_Create(); $this->pnlNote_Create(); $this->lblDueDate_Create(); $this->lblReceiptDate_Create(); // Create the inputs $this->lstFromCompany_Create(); $this->lblNewFromCompany_Create(); $this->lstFromContact_Create(); $this->lblNewFromContact_Create(); $this->lstToContact_Create(); $this->lblNewToContact_Create(); $this->lstToAddress_Create(); $this->lblNewToAddress_Create(); $this->txtNote_Create(); // Create all custom asset fields - this must be here for tab ordering $this->customFields_Create(); if ($this->blnShowInventory) { $this->txtNewInventoryModelCode_Create(); $this->ctlInventorySearchTool_Create(); $this->txtQuantity_Create(); $this->btnAddInventory_Create(); } $this->txtNewAssetCode_Create(); $this->rblAssetType_Create(); $this->lstAssetModel_Create(); $this->chkAutoGenerateAssetCode_Create(); $this->calDueDate_Create(); $this->calDateReceived_Create(); if (QApplication::$TracmorSettings->CustomReceiptNumbers) { $this->txtReceiptNumber_Create(); } // Create the buttons $this->btnSave_Create(); $this->btnEdit_Create(); $this->btnCancel_Create(); $this->btnDelete_Create(); $this->atcAttach_Create(); $this->pnlAttachments_Create(); $this->btnAddAsset_Create(); $this->ctlAssetSearchTool_Create(); //Set display logic of Built-In Fields $this->UpdateBuiltInFields(); // Set display logic of certain Entities $this->UpdateAddressAccess(); $this->UpdateCompanyAccess(); $this->UpdateContactAccess(); // Check prerequisites for scheduling receipts $this->CheckPrerequisites(); // Create the datagrids $this->dtgAssetTransact_Create(); $this->dtgInventoryTransact_Create(); // New entities Dialog $this->dlgNew_Create(); // Load the objAssetTransactionArray and objInventoryTransactionArray for the first time if ($this->blnEditMode) { $objClauses = array(); if ($objClause = $this->dtgAssetTransact->OrderByClause) { array_push($objClauses, $objClause); } /*if ($objClause = $this->dtgAssetTransact->LimitClause) array_push($objClauses, $objClause);*/ if ($objClause = QQ::Expand(QQN::AssetTransaction()->Asset->AssetModel)) { array_push($objClauses, $objClause); } $this->objAssetTransactionArray = AssetTransaction::LoadArrayByTransactionId($this->objReceipt->TransactionId, $objClauses); $objClauses = null; $objClauses = array(); if ($objClause = $this->dtgInventoryTransact->OrderByClause) { array_push($objClauses, $objClause); } /*if ($objClause = $this->dtgInventoryTransact->LimitClause) array_push($objClauses, $objClause);*/ if ($objClause = QQ::Expand(QQN::InventoryTransaction()->InventoryLocation->InventoryModel)) { } array_push($objClauses, $objClause); $this->objInventoryTransactionArray = InventoryTransaction::LoadArrayByTransactionId($this->objReceipt->TransactionId, $objClauses); $this->DisplayLabels(); } elseif (!$this->blnEditMode) { $this->DisplayInputs(); } // Check if there is an Asset or InventoryModel ID in the query string to automatically add them - they would be coming from AssetEdit or InventoryEdit if (!$this->blnEditMode) { $intAssetId = QApplication::QueryString('intAssetId'); // If an Asset was passed in the query string, load the txt in the Asset Code text box and click the add button if ($intAssetId) { $objAsset = Asset::Load($intAssetId); if ($objAsset) { $this->txtNewAssetCode->Text = $objAsset->AssetCode; $this->btnAddAsset_Click($this, null, null); } } $intInventoryModelId = QApplication::QueryString('intInventoryModelId'); // If an InventoryModel was passed in the query string, load the text in the InventoryModel text box and set the focus to the quantity box if ($intInventoryModelId) { $objInventoryModel = InventoryModel::Load($intInventoryModelId); if ($objInventoryModel) { $this->txtNewInventoryModelCode->Text = $objInventoryModel->InventoryModelCode; $this->txtQuantity->Focus(); } } } }
public function SetupAsset($objCaller = null) { // Lookup Object PK information from Query String (if applicable) // Set mode to Edit or New depending on what's found // Overridden from AssetEditFormBase to add the $objCaller parameter $intAssetId = QApplication::QueryString('intAssetId'); if ($intAssetId) { //$objCaller->objAsset = Asset::Load($intAssetId); // To minimize the count of queries $objClauses = array(); array_push($objClauses, QQ::Expand(QQN::Asset()->AssetModel)); array_push($objClauses, QQ::Expand(QQN::Asset()->AssetModel->Category)); array_push($objClauses, QQ::Expand(QQN::Asset()->AssetModel->Manufacturer)); array_push($objClauses, QQ::Expand(QQN::Asset()->ParentAsset)); array_push($objClauses, QQ::Expand(QQN::Asset()->Location)); array_push($objClauses, QQ::Expand(QQN::Asset()->CreatedByObject)); $objCaller->objAsset = Asset::QuerySingle(QQ::Equal(QQN::Asset()->AssetId, $intAssetId), $objClauses); if (!$objCaller->objAsset) { throw new Exception('Could not find a Asset object with PK arguments: ' . $intAssetId); } $objCaller->strTitleVerb = QApplication::Translate('Edit'); $objCaller->blnEditMode = true; $this->blnEditChild = true; } else { $objCaller->objAsset = new Asset(); $objCaller->strTitleVerb = QApplication::Translate('Create'); $objCaller->blnEditMode = false; } QApplication::AuthorizeEntity($objCaller->objAsset, $objCaller->blnEditMode); }
/** * Static Helper Method to Create using QueryString arguments * * @param mixed $objParentObject QForm or QPanel which will be using this AttributeOptionMetaControl * @param QMetaControlCreateType $intCreateType rules governing AttributeOption object creation - defaults to CreateOrEdit * @return AttributeOptionMetaControl */ public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) { $intId = QApplication::QueryString('intId'); return AttributeOptionMetaControl::Create($objParentObject, $intId, $intCreateType); }
/** * Static Helper Method to Create using QueryString arguments * * @param mixed $objParentObject QForm or QPanel which will be using this RoleModuleAuthorizationMetaControl * @param QMetaControlCreateType $intCreateType rules governing RoleModuleAuthorization object creation - defaults to CreateOrEdit * @return RoleModuleAuthorizationMetaControl */ public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) { $intRoleModuleAuthorizationId = QApplication::QueryString('intRoleModuleAuthorizationId'); return RoleModuleAuthorizationMetaControl::Create($objParentObject, $intRoleModuleAuthorizationId, $intCreateType); }
public function lblContextInfo_Create() { if (!$this->lblContextInfo) { $this->lblContextInfo = new QLabel($this); $this->lblContextInfo->CssClass = 'instructions ctxinfo'; $this->lblContextInfo->TagName = 'div'; $this->lblContextInfo->DisplayStyle = QDisplayStyle::None; if (QApplication::QueryString('p')) { $this->lblContextInfo->Text = sprintf('%s<br /><span>%s</span>', $this->objContextInfo->Context->File->FilePath, NarroString::HtmlEntities($this->objContextInfo->Context->Context)); } else { $this->lblContextInfo->Text = sprintf('<b>%s</b>%s<br /><span>%s</span>', $this->objContextInfo->Context->Project->ProjectName, $this->objContextInfo->Context->File->FilePath, NarroString::HtmlEntities($this->objContextInfo->Context->Context)); } $this->lblContextInfo->HtmlEntities = false; if ($this->objContextInfo->Context->Comment) { $this->lblContextInfo->Text .= '<br />' . nl2br(str_replace(array('<!--', '-->'), array('', ''), NarroString::HtmlEntities($this->objContextInfo->Context->Comment))); } } }
public function btnCancelInstallation_click() { QPluginInstaller::cleanupExtractedFiles(QApplication::QueryString('strName')); self::redirectToListPage(); }
protected $lastName; protected $street; protected $city; protected $state; protected $zip; protected $button; protected function Form_Create() { $this->firstName = new MyTextBox($this); // Normally you would use Bs\Textbox here. $this->firstName->Name = QApplication::Translate('First Name'); $this->lastName = new MyTextBox($this); $this->lastName->Name = QApplication::Translate('Last Name'); $this->street = new MyTextBox($this); $this->street->Name = QApplication::Translate('Street'); $this->city = new MyTextBox($this); $this->city->Name = QApplication::Translate('City'); $this->state = new MyTextBox($this); $this->state->Name = QApplication::Translate('State'); $this->zip = new MyTextBox($this); $this->zip->Name = QApplication::Translate('Postal Code'); $this->button = new MyButton($this); // Normally you would use Bs\Button here. $this->button->Text = 'OK'; } } $formName = QApplication::QueryString('formName'); if (!$formName) { $formName = 'forms1'; } SampleForm::Run('SampleForm', $formName . '.tpl.php');
/** * Called by QApplication::Initialize() to initialize the various * QApplication settings on ScriptName, DocumentRoot, etc. * @return void */ protected static function InitializeScriptInfo() { // Setup ScriptFilename and ScriptName QApplication::$ScriptFilename = $_SERVER['SCRIPT_FILENAME']; QApplication::$ScriptName = $_SERVER['SCRIPT_NAME']; // Ensure both are set, or we'll have to abort if (!QApplication::$ScriptFilename) { throw new Exception('Error on QApplication::Initialize() - ScriptFilename or ScriptName was not set'); } // Setup PathInfo and QueryString (if applicable) QApplication::$PathInfo = array_key_exists('PATH_INFO', $_SERVER) ? trim($_SERVER['PATH_INFO']) : null; QApplication::$QueryString = array_key_exists('QUERY_STRING', $_SERVER) ? $_SERVER['QUERY_STRING'] : null; // Setup DocumentRoot QApplication::$DocumentRoot = trim(__DOCROOT__); }
protected function chkCustom_Create() { $intRoleId = QApplication::QueryString('intRoleId'); $objCustomFieldArray = CustomField::LoadObjCustomFieldArray($this->intEntityQtypeId, false, null); foreach ($objCustomFieldArray as $objCustomField) { //For each Custom Field, we setup one checkbox for View Access and one for Edit Access $chkCustomView = new QCheckBox($this); $chkCustomView->AddAction(new QClickEvent(), new QAjaxAction('chkCustom_Click')); $chkCustomEdit = new QCheckBox($this); //When we click in a View Checkbox, we need to control the Edit Checkbox Control too in the chkCustom_Click method. $chkCustomView->ActionParameter = $chkCustomEdit->ControlId; //In order to manipulate the RoleEntityQtypeCustomFieldAuthorization table, we need to obtain the EntityQtypeCustomFieldId field. $objEntityQtypeCustomField = EntityQtypeCustomField::LoadByEntityQtypeIdCustomFieldId($this->intEntityQtypeId, $objCustomField->CustomFieldId); if ($objEntityQtypeCustomField) { $objCustomAuthView = RoleEntityQtypeCustomFieldAuthorization::LoadByRoleIdEntityQtypeCustomFieldIdAuthorizationId($intRoleId, $objEntityQtypeCustomField->EntityQtypeCustomFieldId, 1); //If Creation Mode, the View Privilege of the Custom Fields is checked by default if (!$this->blnEditMode) { $chkCustomView->Checked = 1; } elseif (isset($objCustomAuthView)) { $chkCustomView->Checked = $objCustomAuthView->AuthorizedFlag; } $objCustomAuthEdit = RoleEntityQtypeCustomFieldAuthorization::LoadByRoleIdEntityQtypeCustomFieldIdAuthorizationId($intRoleId, $objEntityQtypeCustomField->EntityQtypeCustomFieldId, 2); //If Creation Mode, the Edit Privilege of the Custom Fields is checked by default if (!$this->blnEditMode) { $chkCustomEdit->Checked = 1; } elseif (isset($objCustomAuthEdit)) { $chkCustomEdit->Checked = $objCustomAuthEdit->AuthorizedFlag; } //if view access is not authorized, edit access won't be authorized if (!$chkCustomView->Checked) { $chkCustomEdit->Enabled = false; $chkCustomEdit->Checked = false; } } //In order to manipulate all the custom checkbox of the entity, we save them in an associated array. $this->arrCustomChecks[] = array('name' => $objCustomField->ShortDescription . ':', 'view' => $chkCustomView, 'edit' => $chkCustomEdit, 'id' => $objCustomField->CustomFieldId); } }
protected function Form_Create() { if (QApplication::QueryString('intDownloadCsv')) { $this->RenderBegin(false); session_cache_limiter('must-revalidate'); // force a "no cache" effect header("Pragma: hack"); // IE chokes on "no cache", so set to something, anything, else. $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT"; header($ExpStr); header('Content-Type: text/csv'); header('Content-Disposition: csv; filename=skipped_records.csv'); $file = fopen(sprintf("%s/%s_contact_skipped.csv", __TRACMOR_TMP__, $_SESSION['intUserAccountId']), "r"); ob_end_clean(); while ($row = fgets($file, 1000)) { print $row; @ob_flush(); flush(); } QApplication::$JavaScriptArray = array(); QApplication::$JavaScriptArrayHighPriority = array(); $this->RenderEnd(false); exit; } // Create the Header Menu $this->ctlHeaderMenu_Create(); //$this->ctlShortcutMenu_Create(); $this->pnlMain_Create(); $this->pnlStepOne_Create(); $this->Buttons_Create(); $this->intStep = 1; $this->intSkippedRecordCount = 0; $this->blnImportEnd = true; $this->btnRemoveArray = array(); $this->arrItemCustomField = array(); $this->Labels_Create(); $this->objDatabase = Asset::GetDatabase(); // Load Custom Field foreach (CustomField::LoadArrayByActiveFlagEntity(1, EntityQtype::Contact) as $objCustomField) { $this->arrItemCustomField[$objCustomField->CustomFieldId] = $objCustomField; } $this->blnError = true; $intRoleId = QApplication::$objUserAccount->RoleId; $objRoleEntityQtypeBuiltInAuthorization = RoleEntityQtypeBuiltInAuthorization::LoadByRoleIdEntityQtypeIdAuthorizationId($intRoleId, EntityQtype::Contact, 2); // Check the user have edit permissions if ($objRoleEntityQtypeBuiltInAuthorization && $objRoleEntityQtypeBuiltInAuthorization->AuthorizedFlag) { $this->blnError = false; } if (isset($intCustomFieldIdArray) && count($intCustomFieldIdArray)) { //QApplication::$Database[1]->EnableProfiling(); // Load restrict permisions for Custom Fields $objConditions = QQ::AndCondition(QQ::Equal(QQN::RoleEntityQtypeCustomFieldAuthorization()->RoleId, (string) $intRoleId), QQ::In(QQN::RoleEntityQtypeCustomFieldAuthorization()->EntityQtypeCustomField->CustomFieldId, $intCustomFieldIdArray), QQ::Equal(QQN::RoleEntityQtypeCustomFieldAuthorization()->AuthorizedFlag, false)); $objClauses = array(); array_push($objClauses, QQ::Expand(QQN::RoleEntityQtypeCustomFieldAuthorization()->EntityQtypeCustomField->EntityQtypeCustomFieldId)); array_push($objClauses, QQ::OrderBy(QQN::RoleEntityQtypeCustomFieldAuthorization()->EntityQtypeCustomFieldId)); $arrRoleEntityQtypeCustomFieldAuthorization = RoleEntityQtypeCustomFieldAuthorization::QueryArray($objConditions, $objClauses); if ($arrRoleEntityQtypeCustomFieldAuthorization) { foreach ($arrRoleEntityQtypeCustomFieldAuthorization as $objRoleAuth) { if (array_key_exists($objRoleAuth->EntityQtypeCustomField->CustomFieldId, $this->arrAssetCustomField)) { unset($this->arrAssetCustomField[$objRoleAuth->EntityQtypeCustomField->CustomFieldId]); } } } //QApplication::$Database[1]->OutputProfiling(); } $this->intUserArray = array(); // Load Users foreach (UserAccount::LoadAll() as $objUser) { $this->intUserArray[strtolower($objUser->Username)] = $objUser->UserAccountId; } $this->strAcceptibleMimeArray = array('text/plain' => 'txt', 'text/comma-separated-values' => 'csv', 'text/csv' => 'csv', 'text/x-comma-separated-values' => 'csv', 'application/vnd.ms-excel' => 'csv', 'application/csv' => 'csv', 'text/x-csv' => 'csv'); }