@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Do not hardcode default Priority names in Project Reports tooltip

Summary:
Pull the names of Priority field values instead of hardcoding them.

Closes T15799

Test Plan:
* As an admin, go to `/config/edit/maniphest.priorities/` and change the value of `"name"` of a Priority value with a value < `50` (e.g.: Low, Wishlist)
* Open `/maniphest/report/project/`
* Hover over the `Oldest (Pri)` column and check the tooltip text before and after applying this patch

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15799

Differential Revision: https://we.phorge.it/D25602

+17 -4
+17 -4
src/applications/maniphest/controller/ManiphestReportController.php
··· 487 487 ); 488 488 } 489 489 490 + private function getAveragePriority() { 491 + // TODO: This is sort of a hard-code for the default "normal" status. 492 + // When reports are more powerful, this should be made more general. 493 + return 50; 494 + } 495 + 490 496 public function renderOpenTasks() { 491 497 $request = $this->getRequest(); 492 498 $viewer = $request->getUser(); ··· 626 632 627 633 $normal_or_better = array(); 628 634 foreach ($taskv as $id => $task) { 629 - // TODO: This is sort of a hard-code for the default "normal" status. 630 - // When reports are more powerful, this should be made more general. 631 - if ($task->getPriority() < 50) { 635 + if ($task->getPriority() < $this->getAveragePriority()) { 632 636 continue; 633 637 } 634 638 $normal_or_better[$id] = $task; ··· 700 704 ), 701 705 pht('Oldest (All)')); 702 706 $cclass[] = 'n'; 707 + $low_priorities = array(); 708 + $priorities_map = ManiphestTaskPriority::getTaskPriorityMap(); 709 + $normal_priority = $this->getAveragePriority(); 710 + foreach ($priorities_map as $pri => $full_label) { 711 + if ($pri < $normal_priority) { 712 + $low_priorities[] = $full_label; 713 + } 714 + } 715 + $pri_string = implode(', ', $low_priorities); 703 716 $cname[] = javelin_tag( 704 717 'span', 705 718 array( 706 719 'sigil' => 'has-tooltip', 707 720 'meta' => array( 708 721 'tip' => pht( 709 - 'Oldest open task, excluding those with Low or Wishlist priority.'), 722 + 'Oldest open task, excluding those with priority %s', $pri_string), 710 723 'size' => 200, 711 724 ), 712 725 ),