withStatus(ManiphestTaskQuery::STATUS_OPEN) ->withPriority(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW) ->setLimit(1) ->setCalculateRows(true); $query->execute(); $count = $query->getRowCount(); $type = $count ? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION : PhabricatorApplicationStatusView::TYPE_EMPTY; $status[] = id(new PhabricatorApplicationStatusView()) ->setType($type) ->setText(pht('%d Unbreak Now Task(s)!', $count)) ->setCount($count); $query = id(new ManiphestTaskQuery()) ->withStatus(ManiphestTaskQuery::STATUS_OPEN) ->withOwners(array($user->getPHID())) ->setLimit(1) ->setCalculateRows(true); $query->execute(); $count = $query->getRowCount(); $type = $count ? PhabricatorApplicationStatusView::TYPE_INFO : PhabricatorApplicationStatusView::TYPE_EMPTY; $status[] = id(new PhabricatorApplicationStatusView()) ->setType($type) ->setText(pht('%d Assigned Task(s)', $count)); return $status; } }