Skip to content

Commit

Permalink
Homepage|Build Repository: Include build date (if known) in the JSON …
Browse files Browse the repository at this point in the history
…data
  • Loading branch information
danij-deng committed Feb 16, 2012
1 parent 043bb6c commit 1cab905
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
15 changes: 11 additions & 4 deletions web/plugins/buildrepository/buildrepository.php
Expand Up @@ -821,7 +821,14 @@ private function outputBuildStreamNavigation($prevEvent=NULL, $nextEvent=NULL)
?></ul></div><?php
}

private function findBuildByUniqueId($uniqueId=0)
/**
* Retrieve the BuildEvent object associated with @a uniqueId.
* If no match is found then the special 'unknown' platform is returned.
*
* @param uniqueId (Integer) Unique identfier of the build event.
* @return (Mixed) BuildEvent object for the build else Boolean @c NULL.
*/
public function buildByUniqueId($uniqueId=0)
{
$uniqueId = intval($uniqueId);
$build = NULL;
Expand Down Expand Up @@ -1099,6 +1106,8 @@ public function execute($args=NULL)
{
global $FrontController;

date_default_timezone_set('EET');

if(isset($args['getpackage']))
{
$this->outputPackageRedirect($args['getpackage']);
Expand All @@ -1112,7 +1121,7 @@ public function execute($args=NULL)

// Determine whether we are detailing a single build event or listing all events.
$uniqueId = $args['build'];
$build = $this->findBuildByUniqueId($uniqueId);
$build = $this->buildByUniqueId($uniqueId);

$pageTitle = (!is_null($build)? $build->composeName() : 'Builds');

Expand All @@ -1126,8 +1135,6 @@ public function execute($args=NULL)
{
// Detailing a single build event.

date_default_timezone_set('EET');

?><div class="buildevent"><?php

$buildOverview = $this->genBuildOverview($build);
Expand Down
Expand Up @@ -70,15 +70,21 @@ public function composeFullTitle($includeVersion=true, $includeBuildId=true)
// Extends implementation in AbstractPackage.
public function populateGraphTemplate(&$tpl)
{
global $FrontController;

if(!is_array($tpl))
throw new Exception('Invalid template argument, array expected');

parent::populateGraphTemplate($tpl);
$tpl['is_unstable'] = true;
$tpl['build_uniqueid'] = $this->buildUniqueId();
$tpl['compile_loguri'] = $this->compileLogUri();
$tpl['compile_errorcount'] = $this->compileErrorCount();
$tpl['compile_warncount'] = $this->compileWarnCount();

$build = $FrontController->findPlugin('BuildRepository')->buildByUniqueId($this->buildId);
$tpl['build_startdate'] = date(DATE_ATOM, $build->startDate());
$tpl['build_uniqueid'] = $this->buildId;

$tpl['compile_loguri'] = $this->compileLogUri;
$tpl['compile_errorcount'] = $this->compileErrorCount;
$tpl['compile_warncount'] = $this->compileWarnCount;
}

// Implements iBuilderProduct.
Expand Down

0 comments on commit 1cab905

Please sign in to comment.