protected function Form_Create() { // Setup DataGrid Columns $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgParameter_EditLinkColumn_Render($_ITEM) ?>'); $this->colEditLinkColumn->HtmlEntities = false; $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Parameter()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Parameter()->Id, false))); $this->colOperationId = new QDataGridColumn(QApplication::Translate('Operation Id'), '<?= $_FORM->dtgParameter_Operation_Render($_ITEM); ?>'); $this->colOrderNumber = new QDataGridColumn(QApplication::Translate('Order Number'), '<?= $_ITEM->OrderNumber; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Parameter()->OrderNumber), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Parameter()->OrderNumber, false))); $this->colVariableId = new QDataGridColumn(QApplication::Translate('Variable Id'), '<?= $_FORM->dtgParameter_Variable_Render($_ITEM); ?>'); $this->colReferenceFlag = new QDataGridColumn(QApplication::Translate('Reference Flag'), '<?= ($_ITEM->ReferenceFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::Parameter()->ReferenceFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Parameter()->ReferenceFlag, false))); // Setup DataGrid $this->dtgParameter = new QDataGrid($this); $this->dtgParameter->CellSpacing = 0; $this->dtgParameter->CellPadding = 4; $this->dtgParameter->BorderStyle = QBorderStyle::Solid; $this->dtgParameter->BorderWidth = 1; $this->dtgParameter->GridLines = QGridLines::Both; // Datagrid Paginator $this->dtgParameter->Paginator = new QPaginator($this->dtgParameter); $this->dtgParameter->ItemsPerPage = 10; // Specify Whether or Not to Refresh using Ajax $this->dtgParameter->UseAjax = false; // Specify the local databind method this datagrid will use $this->dtgParameter->SetDataBinder('dtgParameter_Bind'); $this->dtgParameter->AddColumn($this->colEditLinkColumn); $this->dtgParameter->AddColumn($this->colId); $this->dtgParameter->AddColumn($this->colOperationId); $this->dtgParameter->AddColumn($this->colOrderNumber); $this->dtgParameter->AddColumn($this->colVariableId); $this->dtgParameter->AddColumn($this->colReferenceFlag); }
protected function Form_Create() { // Setup DataGrid Columns $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgDatagridColumnPreference_EditLinkColumn_Render($_ITEM) ?>'); $this->colEditLinkColumn->HtmlEntities = false; $this->colDatagridColumnPreferenceId = new QDataGridColumn(QApplication::Translate('Datagrid Column Preference Id'), '<?= $_ITEM->DatagridColumnPreferenceId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DatagridColumnPreferenceId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DatagridColumnPreferenceId, false))); $this->colDatagridId = new QDataGridColumn(QApplication::Translate('Datagrid Id'), '<?= $_FORM->dtgDatagridColumnPreference_Datagrid_Render($_ITEM); ?>'); $this->colColumnName = new QDataGridColumn(QApplication::Translate('Column Name'), '<?= QString::Truncate($_ITEM->ColumnName, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->ColumnName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->ColumnName, false))); $this->colUserAccountId = new QDataGridColumn(QApplication::Translate('User Account Id'), '<?= $_FORM->dtgDatagridColumnPreference_UserAccount_Render($_ITEM); ?>'); $this->colDisplayFlag = new QDataGridColumn(QApplication::Translate('Display Flag'), '<?= ($_ITEM->DisplayFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DisplayFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DisplayFlag, false))); // Setup DataGrid $this->dtgDatagridColumnPreference = new QDataGrid($this); $this->dtgDatagridColumnPreference->CellSpacing = 0; $this->dtgDatagridColumnPreference->CellPadding = 4; $this->dtgDatagridColumnPreference->BorderStyle = QBorderStyle::Solid; $this->dtgDatagridColumnPreference->BorderWidth = 1; $this->dtgDatagridColumnPreference->GridLines = QGridLines::Both; // Datagrid Paginator $this->dtgDatagridColumnPreference->Paginator = new QPaginator($this->dtgDatagridColumnPreference); $this->dtgDatagridColumnPreference->ItemsPerPage = 10; // Specify Whether or Not to Refresh using Ajax $this->dtgDatagridColumnPreference->UseAjax = false; // Specify the local databind method this datagrid will use $this->dtgDatagridColumnPreference->SetDataBinder('dtgDatagridColumnPreference_Bind'); $this->dtgDatagridColumnPreference->AddColumn($this->colEditLinkColumn); $this->dtgDatagridColumnPreference->AddColumn($this->colDatagridColumnPreferenceId); $this->dtgDatagridColumnPreference->AddColumn($this->colDatagridId); $this->dtgDatagridColumnPreference->AddColumn($this->colColumnName); $this->dtgDatagridColumnPreference->AddColumn($this->colUserAccountId); $this->dtgDatagridColumnPreference->AddColumn($this->colDisplayFlag); }
public function __set($strName, $mixValue) { switch ($strName) { case "Expanded": $this->blnExpanded = $mixValue; if (!$this->blnDataBound) { $this->blnDataBound = true; // Get the class in question $intClassId = $this->strItemId; $objClass = QcodoClass::Load($intClassId); // Bind Children foreach ($objClass->Operations as $objOperation) { new QTreeNavItem($objOperation->DisplayName, $intClassId . 'm' . $objOperation->Id, false, $this->objTreeNav->GetItem($intClassId . 'm'), $intClassId . 'm' . $objOperation->Id); } foreach ($objClass->GetPropertiesForVariableGroupId(null) as $objProperty) { new QTreeNavItem($objProperty->DisplayName, $intClassId . 'p' . $objProperty->Id, false, $this->objTreeNav->GetItem($intClassId . 'p'), $intClassId . 'p' . $objProperty->Id); } foreach ($objClass->GetVariablesForVariableGroupId(null) as $objClassVariable) { new QTreeNavItem($objClassVariable->DisplayName, $intClassId . 'v' . $objClassVariable->Id, false, $this->objTreeNav->GetItem($intClassId . 'v'), $intClassId . 'v' . $objClassVariable->Id); } foreach ($objClass->GetQcodoConstantArray(QQ::Clause(QQ::OrderBy(QQN::QcodoConstant()->Variable->Name))) as $objConstant) { new QTreeNavItem($objConstant->Variable->Name, $intClassId . 'c' . $objConstant->Id, false, $this->objTreeNav->GetItem($intClassId . 'c'), $intClassId . 'c' . $objConstant->Id); } } break; default: try { return parent::__set($strName, $mixValue); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
protected function Form_Create() { if (!QApplication::$Login) { QApplication::Redirect('/'); } $this->objQcodoClass = QcodoClass::Load(QApplication::PathInfo(0)); if (!$this->objQcodoClass) { throw new Exception('Invalid QcodoClass Id: ' . QApplication::PathInfo(0)); } $this->lblName = new QLabel($this); $this->lblName->Text = $this->objQcodoClass->Name; $this->lstClassGroup = new QListBox($this); $this->lstClassGroup->Name = 'Class Group/Classification'; foreach (ClassGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::ClassGroup()->OrderNumber))) as $objClassGroup) { $this->lstClassGroup->AddItem($objClassGroup->Name, $objClassGroup->Id, $objClassGroup->Id == $this->objQcodoClass->ClassGroupId); } $this->chkEnumerationFlag = new QCheckBox($this); $this->chkEnumerationFlag->Checked = $this->objQcodoClass->EnumerationFlag; $this->chkEnumerationFlag->Name = 'Enumeration Class Flag'; $this->txtShortDescription = new QTextBox($this); $this->txtShortDescription->Name = QApplication::Translate('Short Description'); $this->txtShortDescription->Text = $this->objQcodoClass->ShortDescription; $this->txtShortDescription->TextMode = QTextMode::MultiLine; $this->txtExtendedDescription = new QWriteBox($this); $this->txtExtendedDescription->Name = QApplication::Translate('Extended Description'); $this->txtExtendedDescription->Text = $this->objQcodoClass->ExtendedDescription; $this->btnSave = new QButton($this); $this->btnSave->Text = 'Save'; $this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click')); $this->btnCancel->CausesValidation = false; }
protected function Form_Create() { // Define the DataGrid $this->dtgPersons = new QDataGrid($this); $this->dtgPersons->CellPadding = 5; $this->dtgPersons->CellSpacing = 0; // Define Columns // Note how we add SortByCommand and ReverseSortByCommand properties to each column $this->dtgPersons->AddColumn(new QDataGridColumn('Person ID', '<?= $_ITEM->Id ?>', 'Width=100', array('OrderByClause' => QQ::OrderBy(QQN::Person()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->Id, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('First Name', '<?= $_ITEM->FirstName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->FirstName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->FirstName, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('Last Name', '<?= $_ITEM->LastName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->LastName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->LastName, false)))); // Let's pre-default the sorting by last name (column index #2) $this->dtgPersons->SortColumnIndex = 2; // Specify the Datagrid's Data Binder method $this->dtgPersons->SetDataBinder('dtgPersons_Bind'); // Make the DataGrid look nice $objStyle = $this->dtgPersons->RowStyle; $objStyle->FontSize = 12; $objStyle = $this->dtgPersons->AlternateRowStyle; $objStyle->BackColor = '#f6f6f6'; $objStyle = $this->dtgPersons->HeaderRowStyle; $objStyle->ForeColor = 'white'; $objStyle->BackColor = '#780000'; // Because browsers will apply different styles/colors for LINKs // We must explicitly define the ForeColor for the HeaderLink. // The header row turns into links when the column can be sorted. $objStyle = $this->dtgPersons->HeaderLinkStyle; $objStyle->ForeColor = 'white'; }
protected function dtgAudit_Create() { $this->dtgAudit = new QDataGrid($this); $this->dtgAudit->Name = 'asset_audit_list'; $this->dtgAudit->CellPadding = 5; $this->dtgAudit->CellSpacing = 0; $this->dtgAudit->CssClass = "datagrid"; // Enable Pagination, and set to 1000 items per page $objPaginator = new QPaginator($this->dtgAudit); $this->dtgAudit->Paginator = $objPaginator; $this->dtgAudit->ItemsPerPage = 1000; $this->dtgAudit->UseAjax = true; // Allow for column toggling $this->dtgAudit->ShowColumnToggle = true; // Allow for CSV Export $this->dtgAudit->ShowExportCsv = true; $this->dtgAudit->AddColumn(new QDataGridColumnExt('Location', '<?= $_ITEM->Location->ShortDescription ?>', array('OrderByClause' => QQ::OrderBy(QQN::AuditScan()->LocationId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AuditScan()->LocationId, false), 'CssClass' => 'dtg_column'))); $this->dtgAudit->AddColumn(new QDataGridColumnExt('Asset Code', '<?= $_ITEM->Asset->AssetCode ?>', array('OrderByClause' => QQ::OrderBy(AuditScan::AuditScanExt()->Asset->AssetCode), 'ReverseOrderByClause' => QQ::OrderBy(AuditScan::AuditScanExt()->Asset->AssetCode, false), 'CssClass' => 'dtg_column'))); $this->dtgAudit->AddColumn(new QDataGridColumnExt('Asset Model', '<?= $_ITEM->Asset->AssetModel->ShortDescription ?>', array('OrderByClause' => QQ::OrderBy(AuditScan::AuditScanExt()->Asset->AssetModel->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(AuditScan::AuditScanExt()->Asset->AssetModel->ShortDescription, false), 'CssClass' => 'dtg_column'))); $this->dtgAudit->AddColumn(new QDataGridColumnExt('PDT Count', '<?= $_ITEM->Count ?>', array('OrderByClause' => QQ::OrderBy(QQN::AuditScan()->Count), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AuditScan()->Count, false), 'CssClass' => 'dtg_column'))); $this->dtgAudit->AddColumn(new QDataGridColumnExt('System Count', '<?= $_ITEM->SystemCount ?>', array('OrderByClause' => QQ::OrderBy(QQN::AuditScan()->SystemCount), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AuditScan()->SystemCount, false), 'CssClass' => 'dtg_column'))); $objStyle = $this->dtgAudit->RowStyle; $objStyle->ForeColor = '#000000'; $objStyle->BackColor = '#FFFFFF'; $objStyle->FontSize = 12; $objStyle = $this->dtgAudit->AlternateRowStyle; $objStyle->BackColor = '#EFEFEF'; $objStyle = $this->dtgAudit->HeaderRowStyle; $objStyle->ForeColor = '#000000'; $objStyle->BackColor = '#EFEFEF'; $objStyle->CssClass = 'dtg_header'; $this->dtgAudit->SetDataBinder('dtgAudit_Bind'); }
protected function Form_Create() { // Define the DataGrid $this->dtgPersons = new QDataGrid($this); $this->dtgPersons->CellPadding = 5; $this->dtgPersons->CellSpacing = 0; // Let's enable AJAX!!! $this->dtgPersons->UseAjax = true; // Enable Pagination, and set to 5 items per page $objPaginator = new QPaginator($this->dtgPersons); $this->dtgPersons->Paginator = $objPaginator; $this->dtgPersons->ItemsPerPage = 20; // Define Columns $this->dtgPersons->AddColumn(new QDataGridColumn('Person ID', '<?= $_ITEM->Id ?>', 'Width=100', array('OrderByClause' => QQ::OrderBy(QQN::Person()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->Id, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('First Name', '<?= $_ITEM->FirstName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->FirstName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->FirstName, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('Last Name', '<?= $_ITEM->LastName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->LastName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->LastName, false)))); // Let's pre-default the sorting by last name (column index #2) $this->dtgPersons->SortColumnIndex = 2; // Finally, we define the method that will handle the binding of the data source to the datagrid $this->dtgPersons->SetDataBinder('dtgPersons_Bind'); // Make the DataGrid look nice $objStyle = $this->dtgPersons->RowStyle; $objStyle->FontSize = 12; $objStyle = $this->dtgPersons->AlternateRowStyle; $objStyle->BackColor = '#f6f6f6'; }
protected function Form_Create() { // Define the DataGrid // NOTE: We are using a special QDataGrid subclass that we have defined in the // included /examples/datagrid/QDataGrid.inc file. Feel free to make changes to the // main QDataGrid.inc custom subclass, which is located in /includes/qform/QDataGrid.inc. $this->dtgPersons = new QDataGrid($this); $this->dtgPersons->CellPadding = 5; $this->dtgPersons->CellSpacing = 0; // Enabling AJAX $this->dtgPersons->UseAjax = true; // Enable Pagination, and set to 5 items per page $objPaginator = new QPaginator($this->dtgPersons); $this->dtgPersons->Paginator = $objPaginator; $this->dtgPersons->ItemsPerPage = 20; // Let's create our ALTERNATE paginator $this->dtgPersons->PaginatorAlternate = new QPaginator($this->dtgPersons); // Define Columns $this->dtgPersons->AddColumn(new QDataGridColumn('Person ID', '<?= $_ITEM->Id ?>', 'Width=100', array('OrderByClause' => QQ::OrderBy(QQN::Person()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->Id, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('First Name', '<?= $_ITEM->FirstName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->FirstName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->FirstName, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('Last Name', '<?= $_ITEM->LastName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->LastName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->LastName, false)))); // Let's pre-default the sorting by last name (column index #2) $this->dtgPersons->SortColumnIndex = 2; // Specify the Datagrid's Data Binder method $this->dtgPersons->SetDataBinder('dtgPersons_Bind'); // Make the DataGrid look nice $objStyle = $this->dtgPersons->RowStyle; $objStyle->FontSize = 12; $objStyle = $this->dtgPersons->AlternateRowStyle; $objStyle->BackColor = '#f6f6f6'; }
protected function Form_Create() { // Define the DataGrid $this->dtgPersons = new QDataGrid($this); $this->dtgPersons->CellPadding = 5; $this->dtgPersons->CellSpacing = 0; // Using Ajax for Pagination $this->dtgPersons->UseAjax = true; // To create pagination, we will create a new paginator, and specify the datagrid // as the paginator's parent. (We do this because the datagrid is the control // who is responsible for rendering the paginator, as opposed to the form.) $objPaginator = new QPaginator($this->dtgPersons); $this->dtgPersons->Paginator = $objPaginator; // Now, with a paginator defined, we can set up some additional properties on // the datagrid. For purposes of this example, let's make the datagrid show // only 5 items per page. $this->dtgPersons->ItemsPerPage = 5; // Define Columns $this->dtgPersons->AddColumn(new QDataGridColumn('Person ID', '<?= $_ITEM->Id ?>', 'Width=100', array('OrderByClause' => QQ::OrderBy(QQN::Person()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->Id, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('First Name', '<?= $_ITEM->FirstName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->FirstName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->FirstName, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('Last Name', '<?= $_ITEM->LastName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->LastName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->LastName, false)))); // Let's pre-default the sorting by last name (column index #2) $this->dtgPersons->SortColumnIndex = 2; // Specify the Datagrid's Data Binder method $this->dtgPersons->SetDataBinder('dtgPersons_Bind'); // Make the DataGrid look nice $objStyle = $this->dtgPersons->RowStyle; $objStyle->FontSize = 12; $objStyle = $this->dtgPersons->AlternateRowStyle; $objStyle->BackColor = '#f6f6f6'; }
public static function LoadAllActive($objOptionalClauses = null) { if (is_null($objOptionalClauses)) { $objOptionalClauses = array(QQ::OrderBy(QQN::NarroLanguage()->LanguageName)); } return parent::QueryArray(QQ::AndCondition(QQ::NotEqual(QQN::NarroLanguage()->LanguageCode, NarroLanguage::SOURCE_LANGUAGE_CODE), QQ::Equal(QQN::NarroLanguage()->Active, 1)), $objOptionalClauses); }
protected function Form_Create() { // Setup DataGrid Columns // Note that although we are using "Beta 2" style of SortBy and LimitInfo, QDataGrid does have support to "convert" QQ::OrderBy to SortBy strings. $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Person()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->Id, false))); /* $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', 'SortByCommand="id ASC"', 'ReverseSortByCommand="id DESC"');*/ $this->colFirstName = new QDataGridColumn(QApplication::Translate('First Name'), '<?= $_ITEM->FirstName; ?>', 'SortByCommand="first_name ASC"', 'ReverseSortByCommand="first_name DESC"'); $this->colLastName = new QDataGridColumn(QApplication::Translate('Last Name'), '<?= $_ITEM->LastName; ?>', 'SortByCommand="last_name ASC"', 'ReverseSortByCommand="last_name DESC"'); // Setup DataGrid $this->dtgPerson = new QDataGrid($this); $this->dtgPerson->CellSpacing = 0; $this->dtgPerson->CellPadding = 4; $this->dtgPerson->BorderStyle = QBorderStyle::Solid; $this->dtgPerson->BorderWidth = 1; $this->dtgPerson->GridLines = QGridLines::Both; $this->dtgPerson->SortColumnIndex = 0; // Datagrid Paginator $this->dtgPerson->Paginator = new QPaginator($this->dtgPerson); $this->dtgPerson->ItemsPerPage = 5; // Specify Whether or Not to Refresh using Ajax $this->dtgPerson->UseAjax = true; // Add the Columns to the DataGrid $this->dtgPerson->AddColumn($this->colId); $this->dtgPerson->AddColumn($this->colFirstName); $this->dtgPerson->AddColumn($this->colLastName); }
protected function Form_Create() { $this->strInitialToken = QApplication::PathInfo(0); if ($this->strInitialToken) { $this->objList = CommunicationList::LoadByToken($this->strInitialToken); } $this->chkBtnListArray = array(); foreach (CommunicationList::LoadArrayBySubscribable(true, QQ::OrderBy(QQN::CommunicationList()->Token)) as $objEmailList) { $objItemList = new QCheckBox($this); $objItemList->Name = $objEmailList->Token; $objItemList->Text = $objEmailList->Name . ' - ' . $objEmailList->Description . "\n"; if ($objEmailList->Token == $this->strInitialToken) { $objItemList->Checked = true; } $this->chkBtnListArray[] = $objItemList; } $this->txtEmail = new QTextBox($this); $this->txtEmail->Name = 'Email: '; $this->txtEmail->Visible = true; $this->txtFirstName = new QTextBox($this); $this->txtFirstName->Name = 'First Name: '; $this->txtFirstName->Visible = true; $this->txtLastName = new QTextBox($this); $this->txtLastName->Name = 'Last Name'; $this->txtLastName->Visible = true; $this->btnSubscribe = new QButton($this); $this->btnSubscribe->Name = 'Subscribe'; $this->btnSubscribe->Text = 'Subscribe'; $this->btnSubscribe->CssClass = 'primary'; $this->btnSubscribe->Visible = true; $this->btnSubscribe->AddAction(new QClickEvent(), new QAjaxAction('btnSubscribe_Click')); $this->lblMessage = new QLabel($this); $this->lblMessage->FontBold = true; $this->lblMessage->Visible = false; }
protected function Form_Create() { // Setup DataGrid Columns $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgDirectoryToken_EditLinkColumn_Render($_ITEM) ?>'); $this->colEditLinkColumn->HtmlEntities = false; $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Id, false))); $this->colToken = new QDataGridColumn(QApplication::Translate('Token'), '<?= QString::Truncate($_ITEM->Token, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Token), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Token, false))); $this->colPath = new QDataGridColumn(QApplication::Translate('Path'), '<?= QString::Truncate($_ITEM->Path, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Path), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->Path, false))); $this->colCoreFlag = new QDataGridColumn(QApplication::Translate('Core Flag'), '<?= ($_ITEM->CoreFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->CoreFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->CoreFlag, false))); $this->colRelativeFlag = new QDataGridColumn(QApplication::Translate('Relative Flag'), '<?= ($_ITEM->RelativeFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->RelativeFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DirectoryToken()->RelativeFlag, false))); // Setup DataGrid $this->dtgDirectoryToken = new QDataGrid($this); $this->dtgDirectoryToken->CellSpacing = 0; $this->dtgDirectoryToken->CellPadding = 4; $this->dtgDirectoryToken->BorderStyle = QBorderStyle::Solid; $this->dtgDirectoryToken->BorderWidth = 1; $this->dtgDirectoryToken->GridLines = QGridLines::Both; // Datagrid Paginator $this->dtgDirectoryToken->Paginator = new QPaginator($this->dtgDirectoryToken); $this->dtgDirectoryToken->ItemsPerPage = 10; // Specify Whether or Not to Refresh using Ajax $this->dtgDirectoryToken->UseAjax = false; // Specify the local databind method this datagrid will use $this->dtgDirectoryToken->SetDataBinder('dtgDirectoryToken_Bind'); $this->dtgDirectoryToken->AddColumn($this->colEditLinkColumn); $this->dtgDirectoryToken->AddColumn($this->colId); $this->dtgDirectoryToken->AddColumn($this->colToken); $this->dtgDirectoryToken->AddColumn($this->colPath); $this->dtgDirectoryToken->AddColumn($this->colCoreFlag); $this->dtgDirectoryToken->AddColumn($this->colRelativeFlag); }
public function dtgItems_Bind() { $intYear = QApplication::PathInfo(0); $dttStart = new QDateTime($intYear . '-01-01'); $dttEnd = new QDateTime($dttStart); $dttEnd->Year += 1; $dttStart->SetTime(null, null, null); $dttEnd->SetTime(null, null, null); $objPersonCursor = Person::QueryCursor(QQ::AndCondition(QQ::GreaterOrEqual(QQN::Person()->StewardshipContribution->DateCredited, $dttStart), QQ::LessThan(QQN::Person()->StewardshipContribution->DateCredited, $dttEnd)), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName))); $strNameArray = array(); $strNameValueArray = array(); while ($objPerson = Person::InstantiateCursor($objPersonCursor)) { $strToken = strtolower($objPerson->FirstName . '|' . $objPerson->LastName); $strToken = str_replace(' ', '', $strToken); $strToken = str_replace('.', '', $strToken); $strToken = str_replace(',', '', $strToken); $strToken = str_replace('-', '', $strToken); $strToken = str_replace('_', '', $strToken); $strToken = str_replace('/', '', $strToken); if (array_key_exists($strToken, $strNameArray)) { $strNameValueArray[$strToken] = $objPerson->FirstName . ' ' . $objPerson->LastName; } $strNameArray[$strToken] = true; } $this->dtgItems->DataSource = $strNameValueArray; }
protected function Form_Create() { // Setup DataGrid Columns $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgCustomFieldSelection_EditLinkColumn_Render($_ITEM) ?>'); $this->colEditLinkColumn->HtmlEntities = false; $this->colCustomFieldSelectionId = new QDataGridColumn(QApplication::Translate('Custom Field Selection Id'), '<?= $_ITEM->CustomFieldSelectionId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->CustomFieldSelectionId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->CustomFieldSelectionId, false))); $this->colCustomFieldValueId = new QDataGridColumn(QApplication::Translate('Custom Field Value Id'), '<?= $_FORM->dtgCustomFieldSelection_CustomFieldValue_Render($_ITEM); ?>'); $this->colEntityQtypeId = new QDataGridColumn(QApplication::Translate('Entity Qtype'), '<?= $_FORM->dtgCustomFieldSelection_EntityQtypeId_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->EntityQtypeId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->EntityQtypeId, false))); $this->colEntityId = new QDataGridColumn(QApplication::Translate('Entity Id'), '<?= $_ITEM->EntityId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->EntityId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::CustomFieldSelection()->EntityId, false))); // Setup DataGrid $this->dtgCustomFieldSelection = new QDataGrid($this); $this->dtgCustomFieldSelection->CellSpacing = 0; $this->dtgCustomFieldSelection->CellPadding = 4; $this->dtgCustomFieldSelection->BorderStyle = QBorderStyle::Solid; $this->dtgCustomFieldSelection->BorderWidth = 1; $this->dtgCustomFieldSelection->GridLines = QGridLines::Both; // Datagrid Paginator $this->dtgCustomFieldSelection->Paginator = new QPaginator($this->dtgCustomFieldSelection); $this->dtgCustomFieldSelection->ItemsPerPage = 10; // Specify Whether or Not to Refresh using Ajax $this->dtgCustomFieldSelection->UseAjax = false; // Specify the local databind method this datagrid will use $this->dtgCustomFieldSelection->SetDataBinder('dtgCustomFieldSelection_Bind'); $this->dtgCustomFieldSelection->AddColumn($this->colEditLinkColumn); $this->dtgCustomFieldSelection->AddColumn($this->colCustomFieldSelectionId); $this->dtgCustomFieldSelection->AddColumn($this->colCustomFieldValueId); $this->dtgCustomFieldSelection->AddColumn($this->colEntityQtypeId); $this->dtgCustomFieldSelection->AddColumn($this->colEntityId); }
protected function Form_Create() { // Setup DataGrid Columns $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgClassProperty_EditLinkColumn_Render($_ITEM) ?>'); $this->colEditLinkColumn->HtmlEntities = false; $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::ClassProperty()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::ClassProperty()->Id, false))); $this->colQcodoClassId = new QDataGridColumn(QApplication::Translate('Qcodo Class Id'), '<?= $_FORM->dtgClassProperty_QcodoClass_Render($_ITEM); ?>'); $this->colVariableGroupId = new QDataGridColumn(QApplication::Translate('Variable Group Id'), '<?= $_FORM->dtgClassProperty_VariableGroup_Render($_ITEM); ?>'); $this->colVariableId = new QDataGridColumn(QApplication::Translate('Variable Id'), '<?= $_FORM->dtgClassProperty_Variable_Render($_ITEM); ?>'); $this->colClassVariableId = new QDataGridColumn(QApplication::Translate('Class Variable Id'), '<?= $_FORM->dtgClassProperty_ClassVariable_Render($_ITEM); ?>'); $this->colReadOnlyFlag = new QDataGridColumn(QApplication::Translate('Read Only Flag'), '<?= ($_ITEM->ReadOnlyFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::ClassProperty()->ReadOnlyFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::ClassProperty()->ReadOnlyFlag, false))); $this->colWriteOnlyFlag = new QDataGridColumn(QApplication::Translate('Write Only Flag'), '<?= ($_ITEM->WriteOnlyFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::ClassProperty()->WriteOnlyFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::ClassProperty()->WriteOnlyFlag, false))); // Setup DataGrid $this->dtgClassProperty = new QDataGrid($this); $this->dtgClassProperty->CellSpacing = 0; $this->dtgClassProperty->CellPadding = 4; $this->dtgClassProperty->BorderStyle = QBorderStyle::Solid; $this->dtgClassProperty->BorderWidth = 1; $this->dtgClassProperty->GridLines = QGridLines::Both; // Datagrid Paginator $this->dtgClassProperty->Paginator = new QPaginator($this->dtgClassProperty); $this->dtgClassProperty->ItemsPerPage = 10; // Specify Whether or Not to Refresh using Ajax $this->dtgClassProperty->UseAjax = false; // Specify the local databind method this datagrid will use $this->dtgClassProperty->SetDataBinder('dtgClassProperty_Bind'); $this->dtgClassProperty->AddColumn($this->colEditLinkColumn); $this->dtgClassProperty->AddColumn($this->colId); $this->dtgClassProperty->AddColumn($this->colQcodoClassId); $this->dtgClassProperty->AddColumn($this->colVariableGroupId); $this->dtgClassProperty->AddColumn($this->colVariableId); $this->dtgClassProperty->AddColumn($this->colClassVariableId); $this->dtgClassProperty->AddColumn($this->colReadOnlyFlag); $this->dtgClassProperty->AddColumn($this->colWriteOnlyFlag); }
protected function SetupPanel() { if (!$this->objGroup->IsLoginCanEdit(QApplication::$Login)) { $this->ReturnTo('/groups/'); } // See if Group can have Explicitly Defined Participants if (!$this->objGroup->IsGroupCanHaveExplicitlyDefinedParticipants()) { return $this->ReturnTo('#' . $this->objGroup->Id); } $this->pnlPerson = new SelectPersonPanel($this); $this->pnlPerson->Name = 'Participant'; $this->pnlPerson->AllowCreate = true; $this->pnlPerson->Required = true; $this->lstRole = new QListBox($this); $this->lstRole->Name = 'Role'; $this->lstRole->Required = true; $this->lstRole->AddItem('- Select One -'); foreach ($this->objGroup->Ministry->GetGroupRoleArray(QQ::OrderBy(QQN::GroupRole()->Name)) as $objGroupRole) { $this->lstRole->AddItem($objGroupRole->Name, $objGroupRole->Id); } $this->dtxDateStart = new QDateTimeTextBox($this); $this->dtxDateStart->Name = 'Participation Started'; $this->dtxDateStart->Required = true; $this->calDateStart = new QCalendar($this, $this->dtxDateStart); $this->dtxDateEnd = new QDateTimeTextBox($this); $this->dtxDateEnd->Name = 'Participation Ended'; $this->calDateEnd = new QCalendar($this, $this->dtxDateEnd); $this->dtxDateStart->RemoveAllActions(QClickEvent::EventName); $this->dtxDateEnd->RemoveAllActions(QClickEvent::EventName); $this->pnlPerson->txtName->Focus(); }
public function __construct($objParentObject, $strControlId = null) { parent::__construct($objParentObject, $strControlId); $this->blnAutoRenderChildren = true; $this->strTemplate = dirname(__FILE__) . '/' . __CLASS__ . '.tpl.php'; $this->txtSearch = new QTextBox($this); $this->txtSearch->Name = t('Text'); $this->txtSearch->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, 'txtSearch_KeyUp')); $this->txtSearch->SetCustomAttribute('autocomplete', 'off'); $this->btnClear = new QImageButton($this); $this->btnClear->AlternateText = t('Clear'); $this->btnClear->ToolTip = $this->btnClear->AlternateText; $this->btnClear->CssClass = 'clear_button'; $this->btnClear->ImageUrl = __NARRO_IMAGE_ASSETS__ . '/clear.png'; $this->btnClear->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnClear_Click')); $this->lstLanguage = new QListBox($this); $arrLanguages = NarroLanguage::LoadAllActive(QQ::OrderBy(QQN::NarroLanguage()->LanguageName)); foreach ($arrLanguages as $objLanguage) { $this->lstLanguage->AddItem(t($objLanguage->LanguageName), $objLanguage->LanguageId, $objLanguage->LanguageCode == QApplication::$TargetLanguage->LanguageCode); } $this->btnSearch = new QImageButton($this); $this->btnSearch->AlternateText = t('Search'); $this->btnSearch->ToolTip = $this->btnSearch->AlternateText; $this->btnSearch->CssClass = 'clear_button'; $this->btnSearch->ImageUrl = __NARRO_IMAGE_ASSETS__ . '/search.png'; $this->btnSearch->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'txtSearch_KeyUp')); $this->dtgSuggestion = new NarroSuggestionDataGrid($this); $this->dtgSuggestion->ShowHeader = false; $this->dtgSuggestion->MetaAddColumn(QQN::NarroSuggestion()->SuggestionValue); $this->dtgSuggestion->AdditionalClauses = array(QQ::LimitInfo(20), QQ::OrderBy(QQN::NarroSuggestion()->Text->TextCharCount)); $this->btnClear_Click(); }
protected function Form_Create() { $this->mctObject = ClassInstructorMetaControl::CreateFromPathInfo($this, QMetaControlCreateType::CreateOnRecordNotFound); if ($this->mctObject->EditMode) { $this->strPageTitle .= 'Edit Instructor'; } else { $this->strPageTitle .= 'Create New Instructor'; } $this->lstLogin = $this->mctObject->lstLogin_Create(null, QQ::OrCondition(QQ::AndCondition(QQ::IsNull(QQN::Login()->ClassInstructor->Id), QQ::Equal(QQN::Login()->LoginActiveFlag, true), QQ::Equal(QQN::Login()->DomainActiveFlag, true)), QQ::Equal(QQN::Login()->Id, $this->mctObject->ClassInstructor->LoginId)), QQ::OrderBy(QQN::Login()->FirstName, QQN::Login()->LastName)); $this->txtDisplayName = $this->mctObject->txtDisplayName_Create(); $this->txtDisplayName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->btnSave = new QButton($this); $this->btnSave->CssClass = 'primary'; $this->btnSave->Text = $this->mctObject->EditMode ? 'Update' : 'Create'; $this->btnSave->CausesValidation = true; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->AddAction(new QClickEvent(), new QTerminateAction()); $this->btnCancel = new QLinkButton($this); $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->Text = 'Cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); if ($this->mctObject->EditMode) { $this->btnDelete = new QLinkButton($this); $this->btnDelete->CssClass = 'delete'; $this->btnDelete->Text = 'Delete'; $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to PERMANENTLY DELETE this?')); $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click')); $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction()); } }
protected function Form_Create() { $this->dtgStaff = new LoginDataGrid($this); $this->dtgStaff->FontSize = 11; $this->dtgStaff->AddColumn(new QDataGridColumn('View', '<?= $_FORM->RenderView($_ITEM); ?>', 'HtmlEntities=false', 'Width=30px')); $this->dtgStaff->MetaAddColumn(QQN::Login()->Username, 'Width=75px'); $this->dtgStaff->MetaAddColumn(QQN::Login()->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Name; ?>', 'Width=110px'); $this->dtgStaff->AddColumn(new QDataGridColumn('Acct Disabled', '<?= (!$_ITEM->DomainActiveFlag || !$_ITEM->LoginActiveFlag) ? "Disabled":""; ?>', 'Width=60px')); $this->dtgStaff->MetaAddTypeColumn('RoleTypeId', 'RoleType', 'Name=Role', 'Width=120px'); foreach (PermissionType::$NameArray as $intId => $strName) { $this->dtgStaff->AddColumn(new QDataGridColumn('<span style="font-size: 10px;">' . $strName . '</span>', '<?= $_FORM->RenderPermission(' . $intId . ', $_ITEM); ?>', 'Width=50px', 'HtmlEntities=false')); } $this->dtgStaff->SetDataBinder('dtgStaff_Bind'); $this->dtgStaff->SortColumnIndex = 1; $this->dtgStaff->SortDirection = 0; $this->dtgStaff->Paginator = new QPaginator($this->dtgStaff); $this->dtgStaff->ItemsPerPage = 100; $this->lstActiveFlag = new QListBox($this); $this->lstActiveFlag->Name = 'Active'; $this->lstActiveFlag->AddItem('Active', true, true); $this->lstActiveFlag->AddItem('Inactive', false); $this->lstActiveFlag->AddAction(new QChangeEvent(), new QAjaxAction('dtgStaff_Refresh')); $this->lstMinistry = new QListBox($this); $this->lstMinistry->Name = 'Ministry'; $this->lstMinistry->AddItem('- View All -', null); foreach (Ministry::LoadAll(QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) { $this->lstMinistry->AddItem($objMinistry->Name, $objMinistry->Id); } $this->lstMinistry->AddAction(new QChangeEvent(), new QAjaxAction('dtgStaff_Refresh')); }
public function __construct(QcodoClass $objClass, $objParentControl, $strControlId = null) { parent::__construct($objParentControl, $strControlId); $this->objQcodoClass = $objClass; $this->strTemplate = 'ClassPanel.tpl.php'; $this->strUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/' . $this->objQcodoClass->Name; $this->strShortDescriptionHtml = $this->objQcodoClass->ShortDescriptionAsHtml; if (!$this->strShortDescriptionHtml) { $this->strShortDescriptionHtml = '<span style="color: #888888;"><i>No description entered yet.</i></span>'; } $this->strLongDescriptionHtml = QWriteBox::DisplayHtml($this->objQcodoClass->ExtendedDescription, 'writebox_code'); $this->strVersion = 'Qcodo >= ' . $this->objQcodoClass->FirstVersion; if ($this->objQcodoClass->LastVersion) { $this->strVersion .= ' - Deprecated as of ' . $this->objQcodoClass->LastVersion; } $this->strParentClassArray[$objClass->Id] = $objClass->DisplayName; $objParentClass = $objClass->ParentQcodoClass; while ($objParentClass) { $this->strParentClassArray[$objParentClass->Id] = $objParentClass->DisplayName; $objParentClass = $objParentClass->ParentQcodoClass; } $this->strParentClassArray = array_reverse($this->strParentClassArray, true); foreach ($this->objQcodoClass->GetChildQcodoClassArray(QQ::Clause(QQ::OrderBy(QQN::QcodoClass()->Name))) as $objChildClass) { $this->strChildClassArray[$objChildClass->Id] = $objChildClass->DisplayName; } if (QApplication::$Login) { $this->strEditLink = '<div class="edit_link" title="Edit" onclick="document.location=\'/edit_class.php/'; $this->strEditLink .= $this->objQcodoClass->Id; $this->strEditLink .= '\'">EDIT</div>'; } }
protected function Form_Create() { // Define the DataGrid $this->dtgPersons = new QDataGrid($this); $this->dtgPersons->CellPadding = 5; $this->dtgPersons->CellSpacing = 0; // Specify Pagination with 10 items per page $objPaginator = new QPaginator($this->dtgPersons); $this->dtgPersons->Paginator = $objPaginator; $this->dtgPersons->ItemsPerPage = 10; // Define Columns $this->dtgPersons->AddColumn(new QDataGridColumn('Person ID', '<?= $_ITEM->Id ?>', 'Width=100', array('OrderByClause' => QQ::OrderBy(QQN::Person()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->Id, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('First Name', '<?= $_ITEM->FirstName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->FirstName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->FirstName, false)))); $this->dtgPersons->AddColumn(new QDataGridColumn('Last Name', '<?= $_ITEM->LastName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->LastName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->LastName, false)))); // For the last column we will be calling a PHP method on the form // to help with the dynamic creation of a Checkbox $this->dtgPersons->AddColumn(new QDataGridColumn('Select Person', '<?= $_FORM->chkSelected_Render($_ITEM) ?>', 'HtmlEntities=false')); // Let's pre-default the sorting by last name (column index #2) $this->dtgPersons->SortColumnIndex = 2; // Specify the DataBinder method for the DataGrid $this->dtgPersons->SetDataBinder('dtgPersons_Bind'); // Make the DataGrid look nice $objStyle = $this->dtgPersons->RowStyle; $objStyle->FontSize = 12; $objStyle = $this->dtgPersons->AlternateRowStyle; $objStyle->BackColor = '#f6f6f6'; // Define the Label -- keep it blank for now $this->lblResponse = new QLabel($this); $this->lblResponse->HtmlEntities = false; }
protected function Form_Create() { // Setup DataGrid Columns $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgAudit_EditLinkColumn_Render($_ITEM) ?>'); $this->colEditLinkColumn->HtmlEntities = false; $this->colAuditId = new QDataGridColumn(QApplication::Translate('Audit Id'), '<?= $_ITEM->AuditId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->AuditId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->AuditId, false))); $this->colEntityQtypeId = new QDataGridColumn(QApplication::Translate('Entity Qtype'), '<?= $_FORM->dtgAudit_EntityQtypeId_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->EntityQtypeId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->EntityQtypeId, false))); $this->colCreatedBy = new QDataGridColumn(QApplication::Translate('Created By'), '<?= $_FORM->dtgAudit_CreatedByObject_Render($_ITEM); ?>'); $this->colCreationDate = new QDataGridColumn(QApplication::Translate('Creation Date'), '<?= $_FORM->dtgAudit_CreationDate_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->CreationDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->CreationDate, false))); $this->colModifiedBy = new QDataGridColumn(QApplication::Translate('Modified By'), '<?= $_FORM->dtgAudit_ModifiedByObject_Render($_ITEM); ?>'); $this->colModifiedDate = new QDataGridColumn(QApplication::Translate('Modified Date'), '<?= QString::Truncate($_ITEM->ModifiedDate, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->ModifiedDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->ModifiedDate, false))); // Setup DataGrid $this->dtgAudit = new QDataGrid($this); $this->dtgAudit->CellSpacing = 0; $this->dtgAudit->CellPadding = 4; $this->dtgAudit->BorderStyle = QBorderStyle::Solid; $this->dtgAudit->BorderWidth = 1; $this->dtgAudit->GridLines = QGridLines::Both; // Datagrid Paginator $this->dtgAudit->Paginator = new QPaginator($this->dtgAudit); $this->dtgAudit->ItemsPerPage = 10; // Specify Whether or Not to Refresh using Ajax $this->dtgAudit->UseAjax = false; // Specify the local databind method this datagrid will use $this->dtgAudit->SetDataBinder('dtgAudit_Bind'); $this->dtgAudit->AddColumn($this->colEditLinkColumn); $this->dtgAudit->AddColumn($this->colAuditId); $this->dtgAudit->AddColumn($this->colEntityQtypeId); $this->dtgAudit->AddColumn($this->colCreatedBy); $this->dtgAudit->AddColumn($this->colCreationDate); $this->dtgAudit->AddColumn($this->colModifiedBy); $this->dtgAudit->AddColumn($this->colModifiedDate); }
protected function Form_Create() { if (!QApplication::$Login) { QApplication::Redirect('/'); } $this->objVariable = ClassVariable::Load(QApplication::PathInfo(0)); if (!$this->objVariable) { throw new Exception('Invalid Variable Id: ' . QApplication::PathInfo(0)); } $this->lblClass = new QLabel($this); $this->lblClass->Text = $this->objVariable->QcodoClass->Name; $this->lblName = new QLabel($this); $this->lblName->Text = $this->objVariable->Variable->Name; $this->lstVariableGroup = new QListBox($this); $this->lstVariableGroup->Name = 'Variable Group/Classification'; foreach (VariableGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::VariableGroup()->OrderNumber))) as $objVariableGroup) { $this->lstVariableGroup->AddItem($objVariableGroup->Name, $objVariableGroup->Id, $objVariableGroup->Id == $this->objVariable->VariableGroupId); } $this->ctlVariable = new VariableControl($this, $this->objVariable->Variable, true, false); $this->ctlVariable->Name = 'Variable Information'; $this->btnSave = new QButton($this); $this->btnSave->Text = 'Save'; $this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click')); $this->btnCancel->CausesValidation = false; }
protected function SetupPanel() { if (!$this->objGroup->IsLoginCanView(QApplication::$Login)) { $this->ReturnTo('/groups/'); } $this->SetupViewControls(true, true); $this->dtgMembers->AddColumn(new QDataGridColumn('Active Member', '<?= $_CONTROL->ParentControl->RenderCurrentMember($_ITEM); ?>', 'HtmlEntities=true', 'Width=60px', array('OrderByClause' => QQ::OrderBy(QQN::Person()->GroupParticipation->DateEnd), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->GroupParticipation->DateEnd, false)))); $this->dtgMembers->SetDataBinder('dtgMembers_Bind', $this); $this->txtFirstName = new QTextBox($this); $this->txtFirstName->Name = 'First Name (Exact)'; $this->txtFirstName->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'dtgMembers_Refresh')); $this->txtFirstName->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, 'dtgMembers_Refresh')); $this->txtFirstName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtLastName = new QTextBox($this); $this->txtLastName->Name = 'Last Name (Exact)'; $this->txtLastName->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'dtgMembers_Refresh')); $this->txtLastName->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, 'dtgMembers_Refresh')); $this->txtLastName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); if ($this->objGroup->CountEmailMessageRoutes()) { $this->SetupEmailMessageControls(); } $this->SetupSmsControls(); $this->chkViewAll = new QCheckBox($this); $this->chkViewAll->Text = 'View "Inactive/Past" Members as well'; $this->chkViewAll->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'chkViewAll_Click')); $this->btnInactivate = new QButton($this); $this->btnInactivate->CssClass = "primary"; $this->btnInactivate->Text = "Inactivate all Group Members"; $this->btnInactivate->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnInactivate_Click')); }
protected function SetupPanel() { // Get and Validate the Comments Object $this->mctComments = CommentMetaControl::Create($this, $this->strUrlHashArgument, QMetaControlCreateType::CreateOnRecordNotFound); if (!$this->mctComments->EditMode) { // Trying to create a NEW comment $this->mctComments->Comment->Person = $this->objPerson; $this->mctComments->Comment->PostedByLogin = QApplication::$Login; $this->mctComments->Comment->CommentPrivacyTypeId = CommentPrivacyType::Staff; $this->btnSave->Text = 'Create'; } else { // Ensure the this loginId can modify this comment if (!$this->mctComments->Comment->IsLoginCanEdit(QApplication::$Login)) { return $this->ReturnTo('#comments'); } $this->btnSave->Text = 'Update'; } // Create Controls $this->lstPrivacyLevel = $this->mctComments->lstCommentPrivacyType_Create(); if (!QApplication::$Login->IsPermissionAllowed(PermissionType::AccessConfidentialNotes)) { $this->lstPrivacyLevel->RemoveItem(0); } $this->lstCategory = $this->mctComments->lstCommentCategory_Create(null, null, QQ::OrderBy(QQN::CommentCategory()->Name)); $this->txtComment = $this->mctComments->txtComment_Create(); $this->txtComment->Width = '500px'; $this->txtComment->Height = '200px'; $this->dtxDateAction = $this->mctComments->dtxDateAction_Create(); $this->calDateAction = $this->mctComments->calDateAction_Create(); }
public function RenderValue(AttributeValue $objValue) { switch ($objValue->Attribute->AttributeDataTypeId) { case AttributeDataType::Text: return QApplication::HtmlEntities($objValue->TextValue); case AttributeDataType::Checkbox: return $objValue->BooleanValue ? 'Yes' : 'No'; case AttributeDataType::Date: return $objValue->DateValue->ToString('MMMM D, YYYY'); case AttributeDataType::DateTime: return $objValue->DatetimeValue->ToString('MMMM D, YYYY') . ' at ' . $objValue->DatetimeValue->ToString('h:mmz'); case AttributeDataType::ImmutableSingleDropdown: case AttributeDataType::MutableSingleDropdown: return $objValue->SingleAttributeOption != null ? QApplication::HtmlEntities($objValue->SingleAttributeOption->Name) : ' '; case AttributeDataType::ImmutableMultipleDropdown: case AttributeDataType::MutableMultipleDropdown: $strArray = array(); foreach ($objValue->GetAttributeOptionAsMultipleArray(QQ::OrderBy(QQN::AttributeOption()->Name)) as $objOption) { $strArray[] = '• ' . QApplication::HtmlEntities($objOption->Name); } return implode('<br/>', $strArray); default: throw new Exception('Unhandled Attribute Data Type'); } }
protected function SetupPanel() { $this->mctPledge = StewardshipPledgeMetaControl::Create($this, $this->strUrlHashArgument, QMetaControlCreateType::CreateOnRecordNotFound); if (!$this->mctPledge->EditMode) { // Trying to create a NEW comment $this->mctPledge->StewardshipPledge->DateStarted = QDateTime::Now(); $this->mctPledge->StewardshipPledge->Person = $this->objPerson; $this->mctPledge->StewardshipPledge->FulfilledFlag = false; $this->mctPledge->StewardshipPledge->ActiveFlag = true; $this->btnSave->Text = 'Create'; } else { $this->btnSave->Text = 'Update'; $this->btnDelete = new QLinkButton($this); $this->btnDelete->Text = 'Delete'; $this->btnDelete->CssClass = 'delete'; $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this pledge?')); $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click')); $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction()); } // Create Controls $this->lstStewardshipFund = $this->mctPledge->lstStewardshipFund_Create(null, QQ::All(), array(QQ::OrderBy(QQN::StewardshipFund()->Name))); $this->calDateStarted = $this->mctPledge->calDateStarted_Create(); $this->calDateEnded = $this->mctPledge->calDateEnded_Create(); $this->txtPledgeAmount = $this->mctPledge->txtPledgeAmount_Create(); $this->chkActiveFlag = $this->mctPledge->chkActiveFlag_Create(); $this->chkActiveFlag->Text = 'Note: All fulfilled pledges automatically considred "inactive".'; $this->calDateStarted->MinimumYear = 2000; $this->calDateStarted->MaximumYear = date('Y') + 10; $this->calDateEnded->MinimumYear = 2000; $this->calDateEnded->MaximumYear = date('Y') + 10; }
protected function Form_Create() { // Setup DataGrid Columns $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgDatagrid_EditLinkColumn_Render($_ITEM) ?>'); $this->colEditLinkColumn->HtmlEntities = false; $this->colDatagridId = new QDataGridColumn(QApplication::Translate('Datagrid Id'), '<?= $_ITEM->DatagridId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Datagrid()->DatagridId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Datagrid()->DatagridId, false))); $this->colShortDescription = new QDataGridColumn(QApplication::Translate('Short Description'), '<?= QString::Truncate($_ITEM->ShortDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Datagrid()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Datagrid()->ShortDescription, false))); // Setup DataGrid $this->dtgDatagrid = new QDataGrid($this); $this->dtgDatagrid->CellSpacing = 0; $this->dtgDatagrid->CellPadding = 4; $this->dtgDatagrid->BorderStyle = QBorderStyle::Solid; $this->dtgDatagrid->BorderWidth = 1; $this->dtgDatagrid->GridLines = QGridLines::Both; // Datagrid Paginator $this->dtgDatagrid->Paginator = new QPaginator($this->dtgDatagrid); $this->dtgDatagrid->ItemsPerPage = 10; // Specify Whether or Not to Refresh using Ajax $this->dtgDatagrid->UseAjax = false; // Specify the local databind method this datagrid will use $this->dtgDatagrid->SetDataBinder('dtgDatagrid_Bind'); $this->dtgDatagrid->AddColumn($this->colEditLinkColumn); $this->dtgDatagrid->AddColumn($this->colDatagridId); $this->dtgDatagrid->AddColumn($this->colShortDescription); }
protected function Form_Create() { $this->dtgBatches = new StewardshipBatchDataGrid($this); $this->dtgBatches->FontSize = '10px'; $this->dtgBatches->Paginator = new QPaginator($this->dtgBatches); $this->dtgBatches->MetaAddColumn('DateEntered', 'Name=Batch Label', 'Html=<?= $_FORM->RenderBatchLabel($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px'); $this->dtgBatches->MetaAddColumn('DateCredited', 'Name=Post Date', 'Html=<?= $_FORM->RenderPostDate($_ITEM); ?>', 'HtmlEntities=false', 'Width=80px'); $this->dtgBatches->MetaAddTypeColumn('StewardshipBatchStatusTypeId', 'StewardshipBatchStatusType', 'Name=Status', 'Width=80px'); $this->dtgBatches->MetaAddColumn('Description', 'Width=210px'); $this->dtgBatches->MetaAddColumn('ItemCount', 'Name=Items', 'Width=40px'); $this->dtgBatches->MetaAddColumn('ActualTotalAmount', 'Name=Total', 'Html=<?= $_FORM->FormatNumber($_ITEM->ActualTotalAmount); ?>', 'Width=85px', 'HtmlEntities=false'); $this->dtgBatches->MetaAddColumn('ReportedTotalAmount', 'Name=Reported', 'Html=<?= $_FORM->FormatNumber($_ITEM->ReportedTotalAmount); ?>', 'Width=85px', 'HtmlEntities=false'); $this->dtgBatches->MetaAddColumn('PostedTotalAmount', 'Name=Posted', 'Html=<?= $_FORM->FormatNumber($_ITEM->PostedTotalAmount); ?>', 'Width=85px', 'HtmlEntities=false'); $this->dtgBatches->MetaAddColumn(QQN::StewardshipBatch()->CreatedByLogin->LastName, 'Name=Created By', 'Html=<?= ($_ITEM->CreatedByLogin->Name); ?>', 'Width=100px'); $this->dtgBatches->SetDataBinder('dtgBatches_Bind'); $this->dtgBatches->SortColumnIndex = 0; $this->dtgBatches->SortDirection = 1; $this->txtDescription = new QTextBox($this); $this->lstStatus = new QListBox($this); $this->lstStatus->AddItem('- View All -'); foreach (StewardshipBatchStatusType::$NameArray as $intId => $strName) { $this->lstStatus->AddItem($strName, $intId); } $this->lstCreatedBy = new QListBox($this); $this->lstCreatedBy->AddItem('- View All -'); foreach (Login::LoadAll(QQ::OrderBy(QQN::Login()->LastName)) as $objLogin) { $this->lstCreatedBy->AddItem($objLogin->Name, $objLogin->Id); } $this->txtDescription->AddAction(new QEnterKeyEvent(), new QAjaxAction('ResetFilter')); $this->txtDescription->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtDescription->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->lstStatus->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->lstCreatedBy->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); }