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

Highlight away and sporadic users in revision list

Summary:
This is not so general as `getRequiredHandlePHIDs()`.
It allows bulk loading of user statuses only in revision list.

It also loads data in `render()`. I'm not sure if it's OK.

Maybe we can use the colorful point here.
Or maybe some unicode symbol?

Test Plan: {F11451, size=full}

Reviewers: btrahan, epriestley

Reviewed By: btrahan

CC: aran, Koolvin

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

vrana 9f35a3ba d9b4fcb3

+63 -37
+26 -26
src/__celerity_resource_map__.php
··· 2209 2209 ), 2210 2210 'phabricator-standard-page-view' => 2211 2211 array( 2212 - 'uri' => '/res/cfa91002/rsrc/css/application/base/standard-page-view.css', 2212 + 'uri' => '/res/30fbf899/rsrc/css/application/base/standard-page-view.css', 2213 2213 'type' => 'css', 2214 2214 'requires' => 2215 2215 array( ··· 2464 2464 ), array( 2465 2465 'packages' => 2466 2466 array( 2467 - '2b054c5c' => 2467 + '5b0e4abf' => 2468 2468 array( 2469 2469 'name' => 'core.pkg.css', 2470 2470 'symbols' => ··· 2493 2493 21 => 'phabricator-flag-css', 2494 2494 22 => 'aphront-error-view-css', 2495 2495 ), 2496 - 'uri' => '/res/pkg/2b054c5c/core.pkg.css', 2496 + 'uri' => '/res/pkg/5b0e4abf/core.pkg.css', 2497 2497 'type' => 'css', 2498 2498 ), 2499 2499 '0c96375e' => ··· 2660 2660 'reverse' => 2661 2661 array( 2662 2662 'aphront-attached-file-view-css' => '7839ae2d', 2663 - 'aphront-crumbs-view-css' => '2b054c5c', 2664 - 'aphront-dialog-view-css' => '2b054c5c', 2665 - 'aphront-error-view-css' => '2b054c5c', 2666 - 'aphront-form-view-css' => '2b054c5c', 2663 + 'aphront-crumbs-view-css' => '5b0e4abf', 2664 + 'aphront-dialog-view-css' => '5b0e4abf', 2665 + 'aphront-error-view-css' => '5b0e4abf', 2666 + 'aphront-form-view-css' => '5b0e4abf', 2667 2667 'aphront-headsup-action-list-view-css' => 'd9299c35', 2668 - 'aphront-headsup-view-css' => '2b054c5c', 2669 - 'aphront-list-filter-view-css' => '2b054c5c', 2670 - 'aphront-pager-view-css' => '2b054c5c', 2671 - 'aphront-panel-view-css' => '2b054c5c', 2672 - 'aphront-side-nav-view-css' => '2b054c5c', 2673 - 'aphront-table-view-css' => '2b054c5c', 2674 - 'aphront-tokenizer-control-css' => '2b054c5c', 2675 - 'aphront-tooltip-css' => '2b054c5c', 2676 - 'aphront-typeahead-control-css' => '2b054c5c', 2668 + 'aphront-headsup-view-css' => '5b0e4abf', 2669 + 'aphront-list-filter-view-css' => '5b0e4abf', 2670 + 'aphront-pager-view-css' => '5b0e4abf', 2671 + 'aphront-panel-view-css' => '5b0e4abf', 2672 + 'aphront-side-nav-view-css' => '5b0e4abf', 2673 + 'aphront-table-view-css' => '5b0e4abf', 2674 + 'aphront-tokenizer-control-css' => '5b0e4abf', 2675 + 'aphront-tooltip-css' => '5b0e4abf', 2676 + 'aphront-typeahead-control-css' => '5b0e4abf', 2677 2677 'differential-changeset-view-css' => 'd9299c35', 2678 2678 'differential-core-view-css' => 'd9299c35', 2679 2679 'differential-inline-comment-editor' => '5ef7da0b', ··· 2739 2739 'javelin-workflow' => '0c96375e', 2740 2740 'maniphest-task-summary-css' => '7839ae2d', 2741 2741 'maniphest-transaction-detail-css' => '7839ae2d', 2742 - 'phabricator-app-buttons-css' => '2b054c5c', 2742 + 'phabricator-app-buttons-css' => '5b0e4abf', 2743 2743 'phabricator-content-source-view-css' => 'd9299c35', 2744 - 'phabricator-core-buttons-css' => '2b054c5c', 2745 - 'phabricator-core-css' => '2b054c5c', 2746 - 'phabricator-directory-css' => '2b054c5c', 2744 + 'phabricator-core-buttons-css' => '5b0e4abf', 2745 + 'phabricator-core-css' => '5b0e4abf', 2746 + 'phabricator-directory-css' => '5b0e4abf', 2747 2747 'phabricator-drag-and-drop-file-upload' => '5ef7da0b', 2748 2748 'phabricator-dropdown-menu' => '0c96375e', 2749 - 'phabricator-flag-css' => '2b054c5c', 2750 - 'phabricator-jump-nav' => '2b054c5c', 2749 + 'phabricator-flag-css' => '5b0e4abf', 2750 + 'phabricator-jump-nav' => '5b0e4abf', 2751 2751 'phabricator-keyboard-shortcut' => '0c96375e', 2752 2752 'phabricator-keyboard-shortcut-manager' => '0c96375e', 2753 2753 'phabricator-menu-item' => '0c96375e', ··· 2755 2755 'phabricator-paste-file-upload' => '0c96375e', 2756 2756 'phabricator-prefab' => '0c96375e', 2757 2757 'phabricator-project-tag-css' => '7839ae2d', 2758 - 'phabricator-remarkup-css' => '2b054c5c', 2758 + 'phabricator-remarkup-css' => '5b0e4abf', 2759 2759 'phabricator-shaped-request' => '5ef7da0b', 2760 - 'phabricator-standard-page-view' => '2b054c5c', 2760 + 'phabricator-standard-page-view' => '5b0e4abf', 2761 2761 'phabricator-tooltip' => '0c96375e', 2762 - 'phabricator-transaction-view-css' => '2b054c5c', 2763 - 'syntax-highlighting-css' => '2b054c5c', 2762 + 'phabricator-transaction-view-css' => '5b0e4abf', 2763 + 'syntax-highlighting-css' => '5b0e4abf', 2764 2764 ), 2765 2765 ));
+1 -2
src/applications/conduit/method/user/getcurrentstatus/ConduitAPI_user_getcurrentstatus_Method.php
··· 46 46 } 47 47 48 48 protected function execute(ConduitAPIRequest $request) { 49 - $statuses = id(new PhabricatorUserStatus())->loadAllWhere( 50 - 'userPHID IN (%Ls) AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo', 49 + $statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses( 51 50 $request->getValue('userPHIDs')); 52 51 53 52 $return = array();
+1 -3
src/applications/differential/field/specification/base/DifferentialFieldSpecification.php
··· 277 277 return '<em>None</em>'; 278 278 } 279 279 280 - $statuses = id(new PhabricatorUserStatus())->loadAllWhere( 281 - 'userPHID IN (%Ls) AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo', 280 + $statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses( 282 281 $user_phids); 283 - $statuses = mpull($statuses, null, 'getUserPHID'); 284 282 285 283 $links = array(); 286 284 foreach ($user_phids as $user_phid) {
+4 -5
src/applications/people/controller/profile/PhabricatorPeopleProfileController.php
··· 127 127 if ($user->getIsDisabled()) { 128 128 $header->setStatus('Disabled'); 129 129 } else { 130 - $status = id(new PhabricatorUserStatus())->loadOneWhere( 131 - 'userPHID = %s AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo', 132 - $user->getPHID()); 133 - if ($status) { 134 - $header->setStatus($status->getStatusDescription()); 130 + $statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses( 131 + array($user->getPHID())); 132 + if ($statuses) { 133 + $header->setStatus(reset($statuses)->getStatusDescription()); 135 134 } 136 135 } 137 136
+7
src/applications/people/storage/userstatus/PhabricatorUserStatus.php
··· 49 49 return $this->setStatus($statuses[$status]); 50 50 } 51 51 52 + public function loadCurrentStatuses($user_phids) { 53 + $statuses = $this->loadAllWhere( 54 + 'userPHID IN (%Ls) AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo', 55 + $user_phids); 56 + return mpull($statuses, null, 'getUserPHID'); 57 + } 58 + 52 59 }
+2
src/applications/people/storage/userstatus/__init__.php
··· 9 9 phutil_require_module('phabricator', 'applications/people/storage/base'); 10 10 phutil_require_module('phabricator', 'view/utils'); 11 11 12 + phutil_require_module('phutil', 'utils'); 13 + 12 14 13 15 phutil_require_source('PhabricatorUserStatus.php');
+5 -1
src/applications/phid/handle/PhabricatorObjectHandle.php
··· 27 27 private $imageURI; 28 28 private $timestamp; 29 29 private $alternateID; 30 - private $status = 'open'; 30 + private $status = PhabricatorObjectHandleStatus::STATUS_OPEN; 31 31 private $complete; 32 32 private $disabled; 33 33 ··· 197 197 public function renderLink() { 198 198 $name = $this->getLinkName(); 199 199 $class = null; 200 + $title = null; 200 201 201 202 if ($this->status != PhabricatorObjectHandleStatus::STATUS_OPEN) { 202 203 $class .= ' handle-status-'.$this->status; 204 + $title = $this->status; 203 205 } 204 206 205 207 if ($this->disabled) { 206 208 $class .= ' handle-disabled'; 209 + $title = 'disabled'; // Overwrite status. 207 210 } 208 211 209 212 return phutil_render_tag( ··· 211 214 array( 212 215 'href' => $this->getURI(), 213 216 'class' => $class, 217 + 'title' => $title, 214 218 ), 215 219 phutil_escape_html($name)); 216 220 }
+6
src/applications/phid/handle/data/PhabricatorObjectHandleData.php
··· 156 156 $phids); 157 157 $emails = mpull($emails, 'getAddress', 'getUserPHID'); 158 158 159 + $statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses( 160 + $phids); 161 + 159 162 foreach ($phids as $phid) { 160 163 $handle = new PhabricatorObjectHandle(); 161 164 $handle->setPHID($phid); ··· 171 174 $user->getUsername().' ('.$user->getRealName().')'); 172 175 $handle->setAlternateID($user->getID()); 173 176 $handle->setComplete(true); 177 + if (isset($statuses[$phid])) { 178 + $handle->setStatus($statuses[$phid]->getTextStatus()); 179 + } 174 180 $handle->setDisabled($user->getIsDisabled() || 175 181 $user->getIsSystemAgent()); 176 182
+1
src/applications/phid/handle/data/__init__.php
··· 13 13 phutil_require_module('phabricator', 'applications/maniphest/constants/status'); 14 14 phutil_require_module('phabricator', 'applications/people/storage/email'); 15 15 phutil_require_module('phabricator', 'applications/people/storage/user'); 16 + phutil_require_module('phabricator', 'applications/people/storage/userstatus'); 16 17 phutil_require_module('phabricator', 'applications/phid/constants'); 17 18 phutil_require_module('phabricator', 'applications/phid/handle'); 18 19 phutil_require_module('phabricator', 'applications/phid/handle/const/status');
+10
webroot/rsrc/css/application/base/standard-page-view.css
··· 187 187 text-decoration: line-through; 188 188 } 189 189 190 + .aphront-table-view a.handle-status-away { 191 + border-left: 2px solid #aa0000; 192 + padding-left: .25em; 193 + } 194 + 195 + .aphront-table-view a.handle-status-sporadic { 196 + border-left: 2px solid #ffdd33; 197 + padding-left: .25em; 198 + } 199 + 190 200 a.handle-disabled { 191 201 background: #999999; 192 202 color: #cccccc;