@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at recaptime-dev/main 69 lines 1.9 kB view raw
1<?php 2 3final class PhabricatorConfigIssuePanelController 4 extends PhabricatorConfigController { 5 6 public function handleRequest(AphrontRequest $request) { 7 $viewer = $request->getViewer(); 8 9 $engine = new PhabricatorSetupEngine(); 10 $response = $engine->execute(); 11 if ($response) { 12 return $response; 13 } 14 $issues = $engine->getIssues(); 15 $unresolved_count = count($engine->getUnresolvedIssues()); 16 17 if ($issues) { 18 require_celerity_resource('phabricator-notification-menu-css'); 19 20 $items = array(); 21 foreach ($issues as $issue) { 22 $classes = array(); 23 $classes[] = 'phabricator-notification'; 24 if ($issue->getIsIgnored()) { 25 $classes[] = 'phabricator-notification-read'; 26 } else { 27 $classes[] = 'phabricator-notification-unread'; 28 } 29 $uri = '/config/issue/'.$issue->getIssueKey().'/'; 30 $title = $issue->getName(); 31 $summary = $issue->getSummary(); 32 $items[] = javelin_tag( 33 'div', 34 array( 35 'class' => implode(' ', $classes), 36 'sigil' => 'notification', 37 'meta' => array( 38 'href' => $uri, 39 ), 40 ), 41 $title); 42 } 43 $content = phutil_tag_div('setup-issue-menu', $items); 44 } else { 45 $content = phutil_tag_div( 46 'phabricator-notification no-notifications', 47 pht('You have no unresolved setup issues.')); 48 } 49 50 $content = hsprintf( 51 '<div class="phabricator-notification-header">%s</div>'. 52 '%s', 53 phutil_tag( 54 'a', 55 array( 56 'href' => '/config/issue/', 57 ), 58 pht('Unresolved Setup Issues')), 59 $content); 60 61 $json = array( 62 'content' => $content, 63 'number' => (int)$unresolved_count, 64 ); 65 66 return id(new AphrontAjaxResponse())->setContent($json); 67 } 68 69}