Differential D19615 Diff 46892 src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/controller/HarbormasterBuildableViewController.php
| Show First 20 Lines • Show All 312 Lines • ▼ Show 20 Lines | $lint_data = id(new HarbormasterBuildLintMessage())->loadAllWhere( | ||||
| $target_phids); | $target_phids); | ||||
| $unit_data = id(new HarbormasterBuildUnitMessage())->loadAllWhere( | $unit_data = id(new HarbormasterBuildUnitMessage())->loadAllWhere( | ||||
| 'buildTargetPHID IN (%Ls)', | 'buildTargetPHID IN (%Ls)', | ||||
| $target_phids); | $target_phids); | ||||
| if ($lint_data) { | if ($lint_data) { | ||||
| $lint_table = id(new HarbormasterLintPropertyView()) | $lint_table = id(new HarbormasterLintPropertyView()) | ||||
| ->setUser($viewer) | ->setViewer($viewer) | ||||
| ->setLimit(10) | ->setLimit(10) | ||||
| ->setLintMessages($lint_data); | ->setLintMessages($lint_data); | ||||
| $lint_href = $this->getApplicationURI('lint/'.$buildable->getID().'/'); | $lint_href = $this->getApplicationURI('lint/'.$buildable->getID().'/'); | ||||
| $lint_header = id(new PHUIHeaderView()) | $lint_header = id(new PHUIHeaderView()) | ||||
| ->setHeader(pht('Lint Messages')) | ->setHeader(pht('Lint Messages')) | ||||
| ->addActionLink( | ->addActionLink( | ||||
| id(new PHUIButtonView()) | id(new PHUIButtonView()) | ||||
| ->setTag('a') | ->setTag('a') | ||||
| ->setHref($lint_href) | ->setHref($lint_href) | ||||
| ->setIcon('fa-list-ul') | ->setIcon('fa-list-ul') | ||||
| ->setText('View All')); | ->setText('View All')); | ||||
| $lint = id(new PHUIObjectBoxView()) | $lint = id(new PHUIObjectBoxView()) | ||||
| ->setHeader($lint_header) | ->setHeader($lint_header) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->setTable($lint_table); | ->setTable($lint_table); | ||||
| } else { | } else { | ||||
| $lint = null; | $lint = null; | ||||
| } | } | ||||
| if ($unit_data) { | if ($unit_data) { | ||||
| $unit = id(new HarbormasterUnitSummaryView()) | $unit = id(new HarbormasterUnitSummaryView()) | ||||
| ->setViewer($viewer) | |||||
| ->setBuildable($buildable) | ->setBuildable($buildable) | ||||
| ->setUnitMessages($unit_data) | ->setUnitMessages($unit_data) | ||||
| ->setShowViewAll(true) | ->setShowViewAll(true) | ||||
| ->setLimit(5); | ->setLimit(5); | ||||
| } else { | } else { | ||||
| $unit = null; | $unit = null; | ||||
| } | } | ||||
| return array($lint, $unit); | return array($lint, $unit); | ||||
| } | } | ||||
| } | } | ||||