Beispiel #1
0
 protected function Form_Create()
 {
     parent::Form_Create();
     $this->dtgIssues = new IssueDataGrid($this, 'issues');
     $this->dtgIssues->CssClass = 'datagrid issuesDataGrid';
     $this->dtgIssues->Paginator = new QPaginator($this->dtgIssues);
     $this->dtgIssues->AlternateRowStyle->CssClass = 'alternate';
     $this->dtgIssues->Noun = 'issue';
     $this->dtgIssues->NounPlural = 'issues';
     $this->dtgIssues->SetDataBinder('dtgIssues_Bind');
     $this->dtgIssues->MetaAddColumn('Id', 'Html=<?= $_FORM->RenderId($_ITEM); ?>', 'Name=Issue ID', 'HtmlEntities=false');
     $this->dtgIssues->MetaAddColumn('Title', 'Html=<?= $_FORM->RenderTitle($_ITEM); ?>', 'Name=Summary', 'HtmlEntities=false');
     $this->dtgIssues->MetaAddTypeColumn('IssuePriorityTypeId', 'IssuePriorityType', 'Name=Priority');
     $this->dtgIssues->MetaAddTypeColumn('IssueStatusTypeId', 'IssueStatusType', 'Html=<?= $_FORM->RenderStatus($_ITEM); ?>', 'HtmlEntities=false', 'Name=Status');
     $this->dtgIssues->AddColumn(new QDataGridColumn('Category', '<?= $_FORM->RenderCategory($_ITEM); ?>', 'CssClass=small'));
     $this->dtgIssues->MetaAddColumn('PostDate', 'Name=Posted', 'CssClass=small');
     $this->dtgIssues->MetaAddColumn(QQN::Issue()->PostedByPerson->DisplayName, 'Name=By', 'Html=<?= $_FORM->RenderPostedBy($_ITEM); ?>', 'HtmlEntities=false', 'CssClass=small reverseLink');
     $this->dtgIssues->MetaAddColumn(QQN::Issue()->TopicLink->LastPostDate, 'Name=Last Updated', 'CssClass=small');
     $this->dtgIssues->MetaAddColumn(QQN::Issue()->AssignedToPerson->DisplayName, 'Name=Assigned To', 'Html=<?= $_FORM->RenderAssignedTo($_ITEM); ?>', 'HtmlEntities=false', 'CssClass=small reverseLink');
     $this->dtgIssues->GetColumnByName('Status')->OrderByClause = QQ::OrderBy(QQN::Issue()->IssueStatusTypeId, QQN::Issue()->IssueResolutionTypeId);
     $this->dtgIssues->GetColumnByName('Status')->ReverseOrderByClause = QQ::OrderBy(QQN::Issue()->IssueStatusTypeId, false, QQN::Issue()->IssueResolutionTypeId, false);
     $this->dtgIssues->SortColumnIndex = 7;
     $this->dtgIssues->SortDirection = 1;
     $this->objIssueFieldForCategory = IssueField::LoadIssueFieldForCategory();
     $this->objIssueFieldForQcodoVersion = IssueField::LoadIssueFieldForQcodoVersion();
     $this->objIssueFieldForPhpVersion = IssueField::LoadIssueFieldForPhpVersion();
     $this->txtId = new QIntegerTextBox($this);
     $this->txtId->Name = 'Go to Issue by ID';
     $this->txtId->AddAction(new QChangeEvent(), new QAjaxAction('txtId_Change'));
     $this->txtId->AddAction(new QEnterKeyEvent(), new QAjaxAction('txtId_Change'));
     $this->txtId->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtId->CausesValidation = $this->txtId;
     $this->btnNew = new RoundedLinkButton($this);
     $this->btnNew->CssClass = 'searchOption';
     $this->btnNew->ToolTip = 'Report a new bug or issue';
     $this->btnNew->LinkUrl = '/issues/edit.php/new';
     $this->txtSummary = new QTextBox($this);
     $this->txtSummary->Name = 'Summary';
     $this->txtSummary->AddAction(new QChangeEvent(), new QAjaxAction('Refresh'));
     $this->txtSummary->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh'));
     $this->txtSummary->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->lstCategory = new QListBox($this);
     $this->lstCategory->Name = 'Category';
     $this->lstCategory->AddAction(new QChangeEvent(), new QAjaxAction('Refresh'));
     $this->lstCategory->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh'));
     $this->lstCategory->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->lstCategory->AddItem('- View All -', null);
     foreach ($this->objIssueFieldForCategory->GetIssueFieldOptionArray(QQ::OrderBy(QQN::IssueFieldOption()->OrderNumber)) as $objOption) {
         $this->lstCategory->AddItem($objOption->Name, $objOption->Id);
     }
     $this->lstPriority = new QListBox($this);
     $this->lstPriority->Name = 'Priority';
     $this->lstPriority->AddAction(new QChangeEvent(), new QAjaxAction('Refresh'));
     $this->lstPriority->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh'));
     $this->lstPriority->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->lstPriority->AddItem('- View All -', null);
     foreach (IssuePriorityType::$NameArray as $intKey => $strName) {
         $this->lstPriority->AddItem($strName, $intKey);
     }
     $this->lstStatus = new QListBox($this);
     $this->lstStatus->Name = 'Status';
     $this->lstStatus->AddAction(new QChangeEvent(), new QAjaxAction('Refresh'));
     $this->lstStatus->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh'));
     $this->lstStatus->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->lstStatus->AddItem('- View All -', null);
     foreach (IssueStatusType::$NameArray as $intKey => $strName) {
         $this->lstStatus->AddItem($strName, $intKey);
     }
     $this->txtPostedBy = new QTextBox($this);
     $this->txtPostedBy->Name = 'Posted By';
     $this->txtPostedBy->AddAction(new QChangeEvent(), new QAjaxAction('Refresh'));
     $this->txtPostedBy->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh'));
     $this->txtPostedBy->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtAssignedTo = new QTextBox($this);
     $this->txtAssignedTo->Name = 'Assigned To';
     $this->txtAssignedTo->AddAction(new QChangeEvent(), new QAjaxAction('Refresh'));
     $this->txtAssignedTo->AddAction(new QEnterKeyEvent(), new QAjaxAction('Refresh'));
     $this->txtAssignedTo->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->chkIncludeClosed = new QCheckBox($this);
     $this->chkIncludeClosed->AddAction(new QClickEvent(), new QAjaxAction('Refresh'));
 }