public function view($buildId)
    {
        try {
            $build = BuildFactory::getBuildById($buildId);
        } catch (\Exception $ex) {
            $build = null;
        }

        if (empty($build)) {
            throw new NotFoundException(Lang::get('build_x_not_found', $buildId));
        }

        $this->view->plugins  = $this->getUiPlugins();
        $this->view->build    = $build;
        $this->view->data     = $this->getBuildData($build);

        $this->layout->title = Lang::get('build_n', $buildId);
        $this->layout->subtitle = $build->getProjectTitle();

        switch ($build->getStatus()) {
            case 0:
                $this->layout->skin = 'blue';
                break;

            case 1:
                $this->layout->skin = 'yellow';
                break;

            case 2:
                $this->layout->skin = 'green';
                break;

            case 3:
                $this->layout->skin = 'red';
                break;
        }

        $rebuild = Lang::get('rebuild_now');
        $rebuildLink = PHPCI_URL . 'build/rebuild/' . $build->getId();

        $delete = Lang::get('delete_build');
        $deleteLink = PHPCI_URL . 'build/delete/' . $build->getId();

        $actions = "<a class=\"btn btn-default\" href=\"{$rebuildLink}\">{$rebuild}</a> ";

        if ($this->currentUserIsAdmin()) {
            $actions .= " <a class=\"btn btn-danger\" href=\"{$deleteLink}\">{$delete}</a>";
        }

        $this->layout->actions = $actions;
    }
public function view($buildId)
    {
        try {
            $build = BuildFactory::getBuildById($buildId);
        } catch (\Exception $ex) {
            $build = null;
        }

        if (empty($build)) {
            throw new NotFoundException(Lang::get('build_x_not_found', $buildId));
        }

        $this->view->plugins  = $this->getUiPlugins();
        $this->view->build    = $build;
        $this->view->data     = $this->getBuildData($build);

        $this->layout->title = Lang::get('build_n', $buildId);
        $this->layout->subtitle = $build->getProjectTitle();

        switch ($build->getStatus()) {
            case 0:
                $this->layout->skin = 'blue';
                break;

            case 1:
                $this->layout->skin = 'yellow';
                break;

            case 2:
                $this->layout->skin = 'green';
                break;

            case 3:
                $this->layout->skin = 'red';
                break;
        }

        $rebuild = Lang::get('rebuild_now');
        $rebuildLink = PHPCI_URL . 'build/rebuild/' . $build->getId();

        $delete = Lang::get('delete_build');
        $deleteLink = PHPCI_URL . 'build/delete/' . $build->getId();

        $actions = "<a class=\"btn btn-default\" href=\"{$rebuildLink}\">{$rebuild}</a> ";

        if ($this->currentUserIsAdmin()) {
            $actions .= " <a class=\"btn btn-danger\" href=\"{$deleteLink}\">{$delete}</a>";
        }

        $this->layout->actions = $actions;
    }
public function view ( $ buildId ) { try { $ build = BuildFactory :: getBuildById ( $ buildId ) ; } catch ( \ Exception $ ex ) { $ build = null ; } if ( empty ( $ build ) ) { throw new NotFoundException ( Lang :: get ( 'build_x_not_found' , $ buildId ) ) ; } $ this -> view -> plugins = $ this -> getUiPlugins ( ) ; $ this -> view -> build = $ build ; $ this -> view -> data = $ this -> getBuildData ( $ build ) ; $ this -> layout -> title = Lang :: get ( 'build_n' , $ buildId ) ; $ this -> layout -> subtitle = $ build -> getProjectTitle ( ) ; switch ( $ build -> getStatus ( ) ) { case 0 : $ this -> layout -> skin = 'blue' ; break ; case 1 : $ this -> layout -> skin = 'yellow' ; break ; case 2 : $ this -> layout -> skin = 'green' ; break ; case 3 : $ this -> layout -> skin = 'red' ; break ; } $ rebuild = Lang :: get ( 'rebuild_now' ) ; $ rebuildLink = PHPCI_URL . 'build/rebuild/' . $ build -> getId ( ) ; $ delete = Lang :: get ( 'delete_build' ) ; $ deleteLink = PHPCI_URL . 'build/delete/' . $ build -> getId ( ) ; $ actions = "<a class=\"btn btn-default\" href=\"{$rebuildLink}\">{$rebuild}</a> " ; if ( $ this -> currentUserIsAdmin ( ) ) { $ actions .= " <a class=\"btn btn-danger\" href=\"{$deleteLink}\">{$delete}</a>" ; } $ this -> layout -> actions = $ actions ; }
View a specific build.
View a specific build .