/** * Refresh this MetaControl with Data from the local PackageVersion object. * @param boolean $blnReload reload PackageVersion from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objPackageVersion->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objPackageVersion->Id; } } if ($this->lstPackageContribution) { $this->lstPackageContribution->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPackageContribution->AddItem(QApplication::Translate('- Select One -'), null); } $objPackageContributionArray = PackageContribution::LoadAll(); if ($objPackageContributionArray) { foreach ($objPackageContributionArray as $objPackageContribution) { $objListItem = new QListItem($objPackageContribution->__toString(), $objPackageContribution->Id); if ($this->objPackageVersion->PackageContribution && $this->objPackageVersion->PackageContribution->Id == $objPackageContribution->Id) { $objListItem->Selected = true; } $this->lstPackageContribution->AddItem($objListItem); } } } if ($this->lblPackageContributionId) { $this->lblPackageContributionId->Text = $this->objPackageVersion->PackageContribution ? $this->objPackageVersion->PackageContribution->__toString() : null; } if ($this->txtVersionNumber) { $this->txtVersionNumber->Text = $this->objPackageVersion->VersionNumber; } if ($this->lblVersionNumber) { $this->lblVersionNumber->Text = $this->objPackageVersion->VersionNumber; } if ($this->txtNotes) { $this->txtNotes->Text = $this->objPackageVersion->Notes; } if ($this->lblNotes) { $this->lblNotes->Text = $this->objPackageVersion->Notes; } if ($this->txtQcodoVersion) { $this->txtQcodoVersion->Text = $this->objPackageVersion->QcodoVersion; } if ($this->lblQcodoVersion) { $this->lblQcodoVersion->Text = $this->objPackageVersion->QcodoVersion; } if ($this->txtNewFileCount) { $this->txtNewFileCount->Text = $this->objPackageVersion->NewFileCount; } if ($this->lblNewFileCount) { $this->lblNewFileCount->Text = $this->objPackageVersion->NewFileCount; } if ($this->txtChangedFileCount) { $this->txtChangedFileCount->Text = $this->objPackageVersion->ChangedFileCount; } if ($this->lblChangedFileCount) { $this->lblChangedFileCount->Text = $this->objPackageVersion->ChangedFileCount; } if ($this->calPostDate) { $this->calPostDate->DateTime = $this->objPackageVersion->PostDate; } if ($this->lblPostDate) { $this->lblPostDate->Text = sprintf($this->objPackageVersion->PostDate) ? $this->objPackageVersion->__toString($this->strPostDateDateTimeFormat) : null; } if ($this->txtDownloadCount) { $this->txtDownloadCount->Text = $this->objPackageVersion->DownloadCount; } if ($this->lblDownloadCount) { $this->lblDownloadCount->Text = $this->objPackageVersion->DownloadCount; } }
/** * Default / simple DataBinder for this Meta DataGrid. This can easily be overridden * by calling SetDataBinder() on this DataGrid with another DataBinder of your choice. * * If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used. * It will also perform any sorting (if applicable). */ public function MetaDataBinder() { // Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = PackageContribution::CountAll(); } // 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->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from PackageContribution, given the clauses above $this->DataSource = PackageContribution::LoadAll($objClauses); }