Differential D20424 Diff 48778 src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
| Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | public function buildManagementPanelContent() { | ||||
| $track_only_rules = $repository->getTrackOnlyRules(); | $track_only_rules = $repository->getTrackOnlyRules(); | ||||
| $track_only_rules = implode(', ', $track_only_rules); | $track_only_rules = implode(', ', $track_only_rules); | ||||
| $track_only = nonempty( | $track_only = nonempty( | ||||
| $track_only_rules, | $track_only_rules, | ||||
| phutil_tag('em', array(), pht('Track All Branches'))); | phutil_tag('em', array(), pht('Track All Branches'))); | ||||
| $view->addProperty(pht('Track Only'), $track_only); | $view->addProperty(pht('Track Only'), $track_only); | ||||
| $autoclose_rules = $repository->getAutocloseOnlyRules(); | |||||
| $autoclose_rules = implode(', ', $autoclose_rules); | |||||
| $autoclose_only = nonempty( | |||||
| $autoclose_rules, | |||||
| phutil_tag('em', array(), pht('All Branches'))); | |||||
| $autoclose_disabled = false; | |||||
| if ($repository->getDetail('disable-autoclose')) { | |||||
| $autoclose_disabled = true; | |||||
| $autoclose_only = | |||||
| phutil_tag('em', array(), pht('Autoclose has been disabled')); | |||||
| } | |||||
| $view->addProperty(pht('Permanent Refs'), $autoclose_only); | $publishing_disabled = $repository->isPublishingDisabled(); | ||||
| if ($publishing_disabled) { | |||||
| $permanent_display = | |||||
| phutil_tag('em', array(), pht('Publishing Disabled')); | |||||
| } else { | |||||
| $permanent_rules = $repository->getAutocloseOnlyRules(); | |||||
| if ($permanent_rules) { | |||||
| $permanent_display = implode(', ', $permanent_rules); | |||||
| } else { | |||||
| $permanent_display = phutil_tag('em', array(), pht('All Branches')); | |||||
| } | |||||
| } | |||||
| $view->addProperty(pht('Permanent Refs'), $permanent_display); | |||||
| $content[] = $this->newBox(pht('Branches'), $view); | $content[] = $this->newBox(pht('Branches'), $view); | ||||
| // Branch Autoclose Table | |||||
| if (!$repository->isImporting()) { | if (!$repository->isImporting()) { | ||||
| $request = $this->getRequest(); | $request = $this->getRequest(); | ||||
| $pager = id(new PHUIPagerView()) | $pager = id(new PHUIPagerView()) | ||||
| ->readFromRequest($request); | ->readFromRequest($request); | ||||
| $params = array( | $params = array( | ||||
| 'offset' => $pager->getOffset(), | 'offset' => $pager->getOffset(), | ||||
| 'limit' => $pager->getPageSize() + 1, | 'limit' => $pager->getPageSize() + 1, | ||||
| Show All 23 Lines | if (!$repository->isImporting()) { | ||||
| $fields = $branch->getRawFields(); | $fields = $branch->getRawFields(); | ||||
| $closed = idx($fields, 'closed'); | $closed = idx($fields, 'closed'); | ||||
| if ($closed) { | if ($closed) { | ||||
| $status = pht('Closed'); | $status = pht('Closed'); | ||||
| } else { | } else { | ||||
| $status = pht('Open'); | $status = pht('Open'); | ||||
| } | } | ||||
| if ($autoclose_disabled) { | if ($publishing_disabled) { | ||||
| $autoclose_status = pht('Disabled (Repository)'); | $permanent_status = pht('Publishing Disabled'); | ||||
| } else { | |||||
| if ($permanent) { | |||||
| $permanent_status = pht('Permanent'); | |||||
| } else { | } else { | ||||
| $autoclose_status = pht('Not Permanent'); | $permanent_status = pht('Not Permanent'); | ||||
| } | |||||
| } | } | ||||
| $rows[] = array( | $rows[] = array( | ||||
| $icon, | $icon, | ||||
| $branch_name, | $branch_name, | ||||
| $status, | $status, | ||||
| $tracking ? pht('Tracking') : pht('Off'), | $tracking ? pht('Tracking') : pht('Off'), | ||||
| $permanent ? pht('Permanent') : $autoclose_status, | $permanent_status, | ||||
| ); | ); | ||||
| } | } | ||||
| $branch_table = new AphrontTableView($rows); | $branch_table = new AphrontTableView($rows); | ||||
| $branch_table->setHeaders( | $branch_table->setHeaders( | ||||
| array( | array( | ||||
| '', | '', | ||||
| pht('Branch'), | pht('Branch'), | ||||
| pht('Status'), | pht('Status'), | ||||
| Show All 36 Lines | |||||