@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.

Provide task closed date via Conduit API, data export pipeline, and in list UI

Summary:
Depends on D19037. Ref T4434. Adds closed date to `maniphest.search` and "Export Data".

When a task has been closed, show the closed date with a checkmark in the UI instead of the modified date.

Test Plan:
- Exported data to CSV, saw close information.
- Saw close information in `/maniphest/`.
- Queried for close information via `maniphest.search`.

Maniphest Tasks: T4434

Differential Revision: https://secure.phabricator.com/D19038

+55 -3
+20
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
··· 456 456 id(new PhabricatorStringExportField()) 457 457 ->setKey('statusName') 458 458 ->setLabel(pht('Status Name')), 459 + id(new PhabricatorEpochExportField()) 460 + ->setKey('dateClosed') 461 + ->setLabel(pht('Date Closed')), 462 + id(new PhabricatorPHIDExportField()) 463 + ->setKey('closerPHID') 464 + ->setLabel(pht('Closer PHID')), 465 + id(new PhabricatorStringExportField()) 466 + ->setKey('closer') 467 + ->setLabel(pht('Closer')), 459 468 id(new PhabricatorStringExportField()) 460 469 ->setKey('priority') 461 470 ->setLabel(pht('Priority')), ··· 492 501 foreach ($tasks as $task) { 493 502 $phids[] = $task->getAuthorPHID(); 494 503 $phids[] = $task->getOwnerPHID(); 504 + $phids[] = $task->getCloserPHID(); 495 505 } 496 506 $handles = $viewer->loadHandles($phids); 497 507 ··· 512 522 $owner_name = null; 513 523 } 514 524 525 + $closer_phid = $task->getCloserPHID(); 526 + if ($closer_phid) { 527 + $closer_name = $handles[$closer_phid]->getName(); 528 + } else { 529 + $closer_name = null; 530 + } 531 + 515 532 $status_value = $task->getStatus(); 516 533 $status_name = ManiphestTaskStatus::getTaskStatusName($status_value); 517 534 ··· 534 551 'title' => $task->getTitle(), 535 552 'uri' => PhabricatorEnv::getProductionURI($task->getURI()), 536 553 'description' => $task->getDescription(), 554 + 'dateClosed' => $task->getClosedEpoch(), 555 + 'closerPHID' => $closer_phid, 556 + 'closer' => $closer_name, 537 557 ); 538 558 } 539 559
+17
src/applications/maniphest/storage/ManiphestTask.php
··· 513 513 ->setKey('subtype') 514 514 ->setType('string') 515 515 ->setDescription(pht('Subtype of the task.')), 516 + id(new PhabricatorConduitSearchFieldSpecification()) 517 + ->setKey('closerPHID') 518 + ->setType('phid?') 519 + ->setDescription( 520 + pht('User who closed the task, if the task is closed.')), 521 + id(new PhabricatorConduitSearchFieldSpecification()) 522 + ->setKey('dateClosed') 523 + ->setType('int?') 524 + ->setDescription( 525 + pht('Epoch timestamp when the task was closed.')), 516 526 ); 517 527 } 518 528 ··· 532 542 'color' => ManiphestTaskPriority::getTaskPriorityColor($priority_value), 533 543 ); 534 544 545 + $closed_epoch = $this->getClosedEpoch(); 546 + if ($closed_epoch !== null) { 547 + $closed_epoch = (int)$closed_epoch; 548 + } 549 + 535 550 return array( 536 551 'name' => $this->getTitle(), 537 552 'description' => array( ··· 543 558 'priority' => $priority_info, 544 559 'points' => $this->getPoints(), 545 560 'subtype' => $this->getSubtype(), 561 + 'closerPHID' => $this->getCloserPHID(), 562 + 'dateClosed' => $closed_epoch, 546 563 ); 547 564 } 548 565
+18 -3
src/applications/maniphest/view/ManiphestTaskListView.php
··· 86 86 87 87 $item->setStatusIcon($icon.' '.$color, $tooltip); 88 88 89 - $item->addIcon( 90 - 'none', 91 - phabricator_datetime($task->getDateModified(), $this->getUser())); 89 + if ($task->isClosed()) { 90 + $closed_epoch = $task->getClosedEpoch(); 91 + 92 + // We don't expect a task to be closed without a closed epoch, but 93 + // recover if we find one. This can happen with older objects or with 94 + // lipsum test data. 95 + if (!$closed_epoch) { 96 + $closed_epoch = $task->getDateModified(); 97 + } 98 + 99 + $item->addIcon( 100 + 'fa-check-square-o grey', 101 + phabricator_datetime($closed_epoch, $this->getUser())); 102 + } else { 103 + $item->addIcon( 104 + 'none', 105 + phabricator_datetime($task->getDateModified(), $this->getUser())); 106 + } 92 107 93 108 if ($this->showSubpriorityControls) { 94 109 $item->setGrippable(true);