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 Form_Create() { parent::Form_Create(); // Instantiate the Meta DataGrid $this->dtgNarroFileProgresses = new NarroFileProgressDataGrid($this); // Style the DataGrid (if desired) $this->dtgNarroFileProgresses->CssClass = 'datagrid'; $this->dtgNarroFileProgresses->AlternateRowStyle->CssClass = 'alternate'; // Add Pagination (if desired) $this->dtgNarroFileProgresses->Paginator = new QPaginator($this->dtgNarroFileProgresses); $this->dtgNarroFileProgresses->ItemsPerPage = __FORM_DRAFTS_FORM_LIST_ITEMS_PER_PAGE__; // Use the MetaDataGrid functionality to add Columns for this datagrid // Create an Edit Column $strEditPageUrl = __VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/narro_file_progress_edit.php'; $this->dtgNarroFileProgresses->MetaAddEditLinkColumn($strEditPageUrl, 'Edit', 'Edit'); // Create the Other Columns (note that you can use strings for narro_file_progress's properties, or you // can traverse down QQN::narro_file_progress() to display fields that are down the hierarchy) $this->dtgNarroFileProgresses->MetaAddColumn('FileProgressId'); $this->dtgNarroFileProgresses->MetaAddColumn(QQN::NarroFileProgress()->File); $this->dtgNarroFileProgresses->MetaAddColumn(QQN::NarroFileProgress()->Language); $this->dtgNarroFileProgresses->MetaAddColumn('FileMd5'); $this->dtgNarroFileProgresses->MetaAddColumn('Header'); $this->dtgNarroFileProgresses->MetaAddColumn('TotalTextCount'); $this->dtgNarroFileProgresses->MetaAddColumn('ApprovedTextCount'); $this->dtgNarroFileProgresses->MetaAddColumn('FuzzyTextCount'); $this->dtgNarroFileProgresses->MetaAddColumn('ProgressPercent'); $this->dtgNarroFileProgresses->MetaAddColumn('Export'); }
/** * Bind the Projects table to the html table. * * @throws QCallerException */ protected function tblProjects_Bind() { // Expand the PersonAsTeamMember node as an array so that it will be included in each item sent to the columns. $clauses = QQ::ExpandAsArray(QQN::Project()->PersonAsTeamMember); // We load the data source, and set it to the datagrid's DataSource parameter $this->tblProjects->DataSource = Project::LoadAll($clauses); }
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 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 __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() { // 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() { parent::Form_Create(); // Instantiate the Meta DataGrid $this->dtgNarroLogs = new NarroLogDataGrid($this); // Style the DataGrid (if desired) $this->dtgNarroLogs->CssClass = 'datagrid'; $this->dtgNarroLogs->AlternateRowStyle->CssClass = 'alternate'; // Add Pagination (if desired) $this->dtgNarroLogs->Paginator = new QPaginator($this->dtgNarroLogs); $this->dtgNarroLogs->ItemsPerPage = __FORM_DRAFTS_FORM_LIST_ITEMS_PER_PAGE__; // Use the MetaDataGrid functionality to add Columns for this datagrid // Create an Edit Column $strEditPageUrl = __VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/narro_log_edit.php'; $this->dtgNarroLogs->MetaAddEditLinkColumn($strEditPageUrl, 'Edit', 'Edit'); // Create the Other Columns (note that you can use strings for narro_log's properties, or you // can traverse down QQN::narro_log() to display fields that are down the hierarchy) $this->dtgNarroLogs->MetaAddColumn('LogId'); $this->dtgNarroLogs->MetaAddColumn(QQN::NarroLog()->Language); $this->dtgNarroLogs->MetaAddColumn(QQN::NarroLog()->Project); $this->dtgNarroLogs->MetaAddColumn(QQN::NarroLog()->User); $this->dtgNarroLogs->MetaAddColumn('Message'); $this->dtgNarroLogs->MetaAddColumn('Priority'); $this->dtgNarroLogs->MetaAddColumn('Date'); }
protected function Form_Create() { parent::Form_Create(); // Instantiate the Meta DataGrid $this->dtgNarroFiles = new NarroFileDataGrid($this); // Style the DataGrid (if desired) $this->dtgNarroFiles->CssClass = 'datagrid'; $this->dtgNarroFiles->AlternateRowStyle->CssClass = 'alternate'; // Add Pagination (if desired) $this->dtgNarroFiles->Paginator = new QPaginator($this->dtgNarroFiles); $this->dtgNarroFiles->ItemsPerPage = __FORM_DRAFTS_FORM_LIST_ITEMS_PER_PAGE__; // Use the MetaDataGrid functionality to add Columns for this datagrid // Create an Edit Column $strEditPageUrl = __VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/narro_file_edit.php'; $this->dtgNarroFiles->MetaAddEditLinkColumn($strEditPageUrl, 'Edit', 'Edit'); // Create the Other Columns (note that you can use strings for narro_file's properties, or you // can traverse down QQN::narro_file() to display fields that are down the hierarchy) $this->dtgNarroFiles->MetaAddColumn('FileId'); $this->dtgNarroFiles->MetaAddColumn('FileName'); $this->dtgNarroFiles->MetaAddColumn('FilePath'); $this->dtgNarroFiles->MetaAddColumn('FileMd5'); $this->dtgNarroFiles->MetaAddColumn(QQN::NarroFile()->Parent); $this->dtgNarroFiles->MetaAddTypeColumn('TypeId', 'NarroFileType'); $this->dtgNarroFiles->MetaAddColumn(QQN::NarroFile()->Project); $this->dtgNarroFiles->MetaAddColumn('Active'); $this->dtgNarroFiles->MetaAddColumn('Created'); $this->dtgNarroFiles->MetaAddColumn('Modified'); $this->dtgNarroFiles->MetaAddColumn('Header'); }
protected function Form_Create() { // Define the DataGrid -- note that the Meta DataGrid is a DataGrid, itself -- // so let's just use it as a datagrid $this->dtgProjects = new ProjectDataGrid($this); // DataBinding is already configured -- so we do not need to worry about it // But remember that dtgProjects is just a regular datagrid, as well // So we can configure as we see fit, e.g. adding pagination or styling $this->dtgProjects->Paginator = new QPaginator($this->dtgProjects); $this->dtgProjects->ItemsPerPage = 6; $this->dtgProjects->AlternateRowStyle->CssClass = 'alternate'; // All we need to do is to utilize the ProjectDataGrid built-in functionality // to create, define and setup the various columns that WE choose, in the order // that WE want. NOTE that we use simple string-based property names, OR QQuery // node descriptors to specify what we want for each column. $this->dtgProjects->MetaAddColumn('Name'); $this->dtgProjects->MetaAddColumn('StartDate'); $this->dtgProjects->MetaAddColumn(QQN::Project()->EndDate); // We can easily add columns from linked/related tables. However, to do this // you MUST use a QQuery node descriptor. No string-based properties allowed. // Bonus: the Meta DataGrid will even automatically add sorting for columns in related tables. $colUsername = $this->dtgProjects->MetaAddColumn(QQN::Project()->ManagerPerson->Login->Username); // And remember, since it's a regular datagrid with regular columns, // we can stylize as we see fit $colUsername->BackColor = '#cef'; $colUsername->Name = 'Manager\'s Username'; // Also, note that MetaAddColumn and MetaAddTypeColumn can use attribute overriding as well $this->dtgProjects->MetaAddTypeColumn('ProjectStatusTypeId', 'ProjectStatusType', 'FontBold=true'); $this->pxyExample = new QControlProxy($this); $this->pxyExample->AddAction(new QClickEvent(), new QAjaxAction('pxyExample_Click')); // FInally, there are even Meta methods to add an Edit Button column $this->dtgProjects->MetaAddEditProxyColumn($this->pxyExample, 'Click Me', 'Faux Edit Column'); }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= $this->objHousehold->Name; // Setup DataGrids $this->dtgMembers = new HouseholdParticipationDataGrid($this); $this->dtgMembers->AddColumn(new QDataGridColumn('Remove', '<?= $_FORM->RenderRadio($_ITEM); ?>', 'Width=80px', 'HtmlEntities=false')); $this->dtgMembers->MetaAddColumn('Role', 'Width=80px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhone->Number, 'Name=Phone', 'Width=200px'); $this->dtgMembers->GetColumn(0)->OrderByClause = null; $this->dtgMembers->GetColumn(1)->OrderByClause = null; $this->dtgMembers->GetColumn(2)->OrderByClause = null; $this->dtgMembers->GetColumn(3)->OrderByClause = null; $this->dtgMembers->GetColumn(4)->OrderByClause = null; $this->dtgMembers->DataSource = $this->objHousehold->GetOrderedParticipantArray(); $this->btnSave = new QButton($this); $this->btnSave->Text = 'Remove'; $this->btnSave->CssClass = 'primary'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); $this->dlgMessage = new MessageDialog($this); }
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; }
public function dtgStaff_Bind() { $objConditions = QQ::All(); if ($this->lstMinistry->SelectedValue) { $objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->Ministry->MinistryId, $this->lstMinistry->SelectedValue)); } if ($this->lstActiveFlag->SelectedValue) { $objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->DomainActiveFlag, true), QQ::Equal(QQN::Login()->LoginActiveFlag, true)); } else { $objConditions = QQ::AndCondition($objConditions, QQ::OrCondition(QQ::Equal(QQN::Login()->DomainActiveFlag, false), QQ::Equal(QQN::Login()->LoginActiveFlag, false))); } $this->dtgStaff->TotalItemCount = Login::QueryCount($objConditions); // Setup the $objClauses Array $objClauses = array(); // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->dtgStaff->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->dtgStaff->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from Login, given the clauses above $this->dtgStaff->DataSource = Login::QueryArray($objConditions, $objClauses); }
protected function Form_Create() { // Instantiate the DataGrid $this->dtgProjects = new QDataGrid($this); // Style the DataGrid //$this->dtgProjects->CssClass = 'datagrid'; $this->dtgProjects->AlternateRowCssClass = 'alternate'; // Add Pagination $this->dtgProjects->Paginator = new QPaginator($this->dtgProjects); $this->dtgProjects->ItemsPerPage = 3; // Add columns // Create a column that will hold a toggle button. We will need to manually draw the content of the cell. $col = $this->dtgProjects->CreateCallableColumn('', [$this, 'render_btnToggleRecordsSummary']); $col->HtmlEntities = false; $col->CellStyler->Width = "1%"; $this->dtgProjects->CreateNodeColumn('Id', QQN::Project()->Id); $this->dtgProjects->CreateNodeColumn('Name', QQN::Project()->Name); $this->dtgProjects->CreateNodeColumn('Status', QQN::Project()->ProjectStatusType); $this->dtgProjects->CreateNodeColumn('Description', QQN::Project()->Description); $this->dtgProjects->CreateNodeColumn('Start Date', QQN::Project()->StartDate); $this->dtgProjects->CreateNodeColumn('End Date', QQN::Project()->EndDate); $this->dtgProjects->CreateNodeColumn('Budget', QQN::Project()->Budget); $this->dtgProjects->CreateNodeColumn('Spent', QQN::Project()->Spent); // Create a column that will hold a child datagrid $col = $this->dtgProjects->CreateCallableColumn('', [$this, 'render_ucRecordsSummary']); $col->HtmlEntities = false; $col->CellStyler->Width = 0; // Specify the Datagrid's Data Binder method $this->dtgProjects->SetDataBinder('dtgProjects_Bind'); // For purposes of this example, add a css file that styles the table. // Normally you would include your global style sheets in your tpl file or header.inc.php file. $this->dtgProjects->AddCssFile(__QCUBED_ASSETS__ . '/php/examples/master_detail/styles.css'); }
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()); } }
public function testSelectSubsetInExpandAsArray() { $objPersonArray = Person::LoadAll(QQ::Clause(QQ::Select(QQN::Person()->FirstName), QQ::ExpandAsArray(QQN::Person()->Address, QQ::Select(QQN::Person()->Address->Street, QQN::Person()->Address->City)), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager, QQ::Select(QQN::Person()->ProjectAsManager->StartDate)), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager->Milestone, QQ::Select(QQN::Person()->ProjectAsManager->Milestone->Name)))); foreach ($objPersonArray as $objPerson) { $this->assertNull($objPerson->LastName, "LastName should be null, since it was not selected"); $this->assertNotNull($objPerson->Id, "Id should not be null since it's always added to the select list"); if (sizeof($objPerson->_AddressArray) > 0) { foreach ($objPerson->_AddressArray as $objAddress) { $this->assertNotNull($objAddress->Id, "Address->Id should not be null since it's always added to the select list"); $this->assertNull($objAddress->PersonId, "Address->PersonId should be null, since it was not selected"); } } if (sizeof($objPerson->_ProjectAsManagerArray) > 0) { foreach ($objPerson->_ProjectAsManagerArray as $objProject) { $this->assertNotNull($objProject->Id, "Project->Id should not be null since it's always added to the select list"); $this->assertNull($objProject->Name, "Project->Name should be null, since it was not selected"); if (sizeof($objProject->_MilestoneArray) > 0) { foreach ($objProject->_MilestoneArray as $objMilestone) { $this->assertNotNull($objMilestone->Id, "Milestone->Id should not be null since it's always added to the select list"); $this->assertNull($objMilestone->ProjectId, "Milestone->ProjectId should be null, since it was not selected"); } } } } } }
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() { 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 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 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 GetControlHtml() { $strLogContents = ''; foreach (NarroLog::QueryArray(QQ::AndCondition(QQ::Equal(QQN::NarroLog()->ProjectId, $this->intProjectId), QQ::Equal(QQN::NarroLog()->LanguageId, $this->intLanguageId), QQ::GreaterThan(QQN::NarroLog()->Date, $this->dttStart))) as $objLogEntry) { switch ($objLogEntry->Priority) { case NarroLog::PRIORITY_INFO: $strLogContents .= '<div class="info"'; break; case NarroLog::PRIORITY_WARN: $strLogContents .= '<div class="warning"'; break; case NarroLog::PRIORITY_ERROR: $strLogContents .= '<div class="error"'; break; default: $strLogContents .= '<div'; } $strLogContents .= sprintf('title="%s">%s</div>', $objLogEntry->Date, nl2br(NarroString::HtmlEntities($objLogEntry->Message))); } $this->strText = sprintf('<div class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons"> <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-state-active ui-corner-top"> <span class="ui-icon ui-icon-triangle-1-s"></span> <a>%s</a> </h3> <div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" style="max-height:300px;overflow:auto"> %s </div> </div>', t('Operation log'), $strLogContents); return parent::GetControlHtml(); }
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() { // Define the DataGrid $this->dtgPersons = new QDataGrid($this, 'dtgPersons'); $this->dtgPersons->Height = "560px"; // Define the DataGrid using event delegation $this->dtgPersonsDelegated = new QDataGrid($this, 'dtgPersonsDelegated'); // Define Columns $this->dtgPersons->CreateNodeColumn('Person Id', QQN::Person()->Id); $this->dtgPersons->CreateNodeColumn('First Name', QQN::Person()->FirstName); $this->dtgPersons->CreateNodeColumn('Last Name', QQN::Person()->LastName); $col = $this->dtgPersons->CreateCallableColumn('', [$this, 'RenderDeleteButton']); $col->HtmlEntities = false; $this->dtgPersonsDelegated->CreateNodeColumn('Person Id', QQN::Person()->Id); $this->dtgPersonsDelegated->CreateNodeColumn('First Name', QQN::Person()->FirstName); $this->dtgPersonsDelegated->CreateNodeColumn('Last Name', QQN::Person()->LastName); $col = $this->dtgPersonsDelegated->CreateCallableColumn('', [$this, 'RenderDeleteButton2']); $col->HtmlEntities = false; // Create the delegated event action. We bind the event to the data grid, even though the event is // coming from buttons in the datagrid. These click events will bubble up to the table. $this->dtgPersonsDelegated->AddAction(new QClickEvent(null, 0, 'button[data-id]'), new QAjaxAction('dtgPersonsButton_Click', null, null, '$j(event.target).data("id")')); // Specify the Datagrid's Data Binder method // Notice we are using the same binder for two datagrids $this->dtgPersons->SetDataBinder('dtgPersons_Bind'); $this->dtgPersonsDelegated->SetDataBinder('dtgPersons_Bind'); }
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); }
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() { 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 __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() { // Define the DataGrid $this->dtgPersons = new QDataGrid($this); // 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 $col = $this->dtgPersons->CreateNodeColumn('Person ID', QQN::Person()->Id); $col->CellStyler->Width = 100; $col = $this->dtgPersons->CreateNodeColumn('First Name', [QQN::Person()->FirstName, QQN::Person()->LastName]); $col->CellStyler->Width = 200; $col = $this->dtgPersons->CreateNodeColumn('Last Name', [QQN::Person()->LastName, QQN::Person()->LastName]); $col->CellStyler->Width = 200; // 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'); }
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() { // 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'; }