protected function Form_Create() { parent::Form_Create(); $this->objCategory = PackageCategory::LoadByToken(QApplication::PathInfo(0)); if (!$this->objCategory) { QApplication::Redirect('/qpm/'); } $this->strPageTitle .= $this->objCategory->Name; $this->dtgPackages = new PackageDataGrid($this); $this->dtgPackages->SetDataBinder('dtgPackages_Bind'); $this->dtgPackages->AlternateRowStyle->CssClass = 'alternate'; $this->dtgPackages->MetaAddColumn('Name', 'VerticalAlign=top', 'Width=250px'); $this->dtgPackages->MetaAddColumn('Token', 'Name=Path', 'VerticalAlign=top', 'Width=190px', 'HtmlEntities=false', 'Html=<a href="/qpm/package.php/<?= $_ITEM->Token; ?>" title="View Package Details"><?= $_ITEM->Token; ?></a>'); $this->dtgPackages->MetaAddColumn('Description', 'CssClass=small', 'Width=300px'); $this->dtgPackages->MetaAddColumn('LastPostDate', 'Name=Last Upload', 'Width=100px', 'VerticalAlign=top', 'CssClass=small'); $this->dtgPackages->MetaAddColumn(QQN::Package()->LastPostedByPerson->DisplayName, 'Name=By', 'Html=<?= $_FORM->RenderPostedBy($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px', 'CssClass=small reverseLink', 'VerticalAlign=top'); $this->dtgPackages->Paginator = new QPaginator($this->dtgPackages); $this->btnNew = new RoundedLinkButton($this); $this->btnNew->CssClass = 'searchOption'; $this->btnNew->ToolTip = 'Create a new QPM package'; $this->btnNew->LinkUrl = '/qpm/edit.php/new'; }
/** * Creates the QPM Package for this Issue object. * @return Package */ public function CreatePackage() { $objPackage = new Package(); $objPackage->PackageCategory = PackageCategory::LoadByToken('issues'); $objPackage->Token = 'issue_' . $this->intId; $objPackage->Name = 'Fix for Issue #' . $this->intId; $objPackage->Description = 'This package is for user-submitted fixes for Issue #' . $this->intId; $objPackage->Save(); $objPackage->CreateTopicAndTopicLink($this->PostedByPerson); $objPackage->PackageCategory->RefreshStats(); return $objPackage; }