diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index ae535feb50..816dea40e6 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -2209,7 +2209,7 @@ celerity_register_resource_map(array( ), 'phabricator-standard-page-view' => array( - 'uri' => '/res/cfa91002/rsrc/css/application/base/standard-page-view.css', + 'uri' => '/res/30fbf899/rsrc/css/application/base/standard-page-view.css', 'type' => 'css', 'requires' => array( @@ -2464,7 +2464,7 @@ celerity_register_resource_map(array( ), array( 'packages' => array( - '2b054c5c' => + '5b0e4abf' => array( 'name' => 'core.pkg.css', 'symbols' => @@ -2493,7 +2493,7 @@ celerity_register_resource_map(array( 21 => 'phabricator-flag-css', 22 => 'aphront-error-view-css', ), - 'uri' => '/res/pkg/2b054c5c/core.pkg.css', + 'uri' => '/res/pkg/5b0e4abf/core.pkg.css', 'type' => 'css', ), '0c96375e' => @@ -2660,20 +2660,20 @@ celerity_register_resource_map(array( 'reverse' => array( 'aphront-attached-file-view-css' => '7839ae2d', - 'aphront-crumbs-view-css' => '2b054c5c', - 'aphront-dialog-view-css' => '2b054c5c', - 'aphront-error-view-css' => '2b054c5c', - 'aphront-form-view-css' => '2b054c5c', + 'aphront-crumbs-view-css' => '5b0e4abf', + 'aphront-dialog-view-css' => '5b0e4abf', + 'aphront-error-view-css' => '5b0e4abf', + 'aphront-form-view-css' => '5b0e4abf', 'aphront-headsup-action-list-view-css' => 'd9299c35', - 'aphront-headsup-view-css' => '2b054c5c', - 'aphront-list-filter-view-css' => '2b054c5c', - 'aphront-pager-view-css' => '2b054c5c', - 'aphront-panel-view-css' => '2b054c5c', - 'aphront-side-nav-view-css' => '2b054c5c', - 'aphront-table-view-css' => '2b054c5c', - 'aphront-tokenizer-control-css' => '2b054c5c', - 'aphront-tooltip-css' => '2b054c5c', - 'aphront-typeahead-control-css' => '2b054c5c', + 'aphront-headsup-view-css' => '5b0e4abf', + 'aphront-list-filter-view-css' => '5b0e4abf', + 'aphront-pager-view-css' => '5b0e4abf', + 'aphront-panel-view-css' => '5b0e4abf', + 'aphront-side-nav-view-css' => '5b0e4abf', + 'aphront-table-view-css' => '5b0e4abf', + 'aphront-tokenizer-control-css' => '5b0e4abf', + 'aphront-tooltip-css' => '5b0e4abf', + 'aphront-typeahead-control-css' => '5b0e4abf', 'differential-changeset-view-css' => 'd9299c35', 'differential-core-view-css' => 'd9299c35', 'differential-inline-comment-editor' => '5ef7da0b', @@ -2739,15 +2739,15 @@ celerity_register_resource_map(array( 'javelin-workflow' => '0c96375e', 'maniphest-task-summary-css' => '7839ae2d', 'maniphest-transaction-detail-css' => '7839ae2d', - 'phabricator-app-buttons-css' => '2b054c5c', + 'phabricator-app-buttons-css' => '5b0e4abf', 'phabricator-content-source-view-css' => 'd9299c35', - 'phabricator-core-buttons-css' => '2b054c5c', - 'phabricator-core-css' => '2b054c5c', - 'phabricator-directory-css' => '2b054c5c', + 'phabricator-core-buttons-css' => '5b0e4abf', + 'phabricator-core-css' => '5b0e4abf', + 'phabricator-directory-css' => '5b0e4abf', 'phabricator-drag-and-drop-file-upload' => '5ef7da0b', 'phabricator-dropdown-menu' => '0c96375e', - 'phabricator-flag-css' => '2b054c5c', - 'phabricator-jump-nav' => '2b054c5c', + 'phabricator-flag-css' => '5b0e4abf', + 'phabricator-jump-nav' => '5b0e4abf', 'phabricator-keyboard-shortcut' => '0c96375e', 'phabricator-keyboard-shortcut-manager' => '0c96375e', 'phabricator-menu-item' => '0c96375e', @@ -2755,11 +2755,11 @@ celerity_register_resource_map(array( 'phabricator-paste-file-upload' => '0c96375e', 'phabricator-prefab' => '0c96375e', 'phabricator-project-tag-css' => '7839ae2d', - 'phabricator-remarkup-css' => '2b054c5c', + 'phabricator-remarkup-css' => '5b0e4abf', 'phabricator-shaped-request' => '5ef7da0b', - 'phabricator-standard-page-view' => '2b054c5c', + 'phabricator-standard-page-view' => '5b0e4abf', 'phabricator-tooltip' => '0c96375e', - 'phabricator-transaction-view-css' => '2b054c5c', - 'syntax-highlighting-css' => '2b054c5c', + 'phabricator-transaction-view-css' => '5b0e4abf', + 'syntax-highlighting-css' => '5b0e4abf', ), )); diff --git a/src/applications/conduit/method/user/getcurrentstatus/ConduitAPI_user_getcurrentstatus_Method.php b/src/applications/conduit/method/user/getcurrentstatus/ConduitAPI_user_getcurrentstatus_Method.php index bae10f0f4e..6f43e8c868 100644 --- a/src/applications/conduit/method/user/getcurrentstatus/ConduitAPI_user_getcurrentstatus_Method.php +++ b/src/applications/conduit/method/user/getcurrentstatus/ConduitAPI_user_getcurrentstatus_Method.php @@ -46,8 +46,7 @@ final class ConduitAPI_user_getcurrentstatus_Method } protected function execute(ConduitAPIRequest $request) { - $statuses = id(new PhabricatorUserStatus())->loadAllWhere( - 'userPHID IN (%Ls) AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo', + $statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses( $request->getValue('userPHIDs')); $return = array(); diff --git a/src/applications/differential/field/specification/base/DifferentialFieldSpecification.php b/src/applications/differential/field/specification/base/DifferentialFieldSpecification.php index 6ed0b16eec..970071d95f 100644 --- a/src/applications/differential/field/specification/base/DifferentialFieldSpecification.php +++ b/src/applications/differential/field/specification/base/DifferentialFieldSpecification.php @@ -277,10 +277,8 @@ abstract class DifferentialFieldSpecification { return 'None'; } - $statuses = id(new PhabricatorUserStatus())->loadAllWhere( - 'userPHID IN (%Ls) AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo', + $statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses( $user_phids); - $statuses = mpull($statuses, null, 'getUserPHID'); $links = array(); foreach ($user_phids as $user_phid) { diff --git a/src/applications/people/controller/profile/PhabricatorPeopleProfileController.php b/src/applications/people/controller/profile/PhabricatorPeopleProfileController.php index a48d06508c..9a75640020 100644 --- a/src/applications/people/controller/profile/PhabricatorPeopleProfileController.php +++ b/src/applications/people/controller/profile/PhabricatorPeopleProfileController.php @@ -127,11 +127,10 @@ final class PhabricatorPeopleProfileController if ($user->getIsDisabled()) { $header->setStatus('Disabled'); } else { - $status = id(new PhabricatorUserStatus())->loadOneWhere( - 'userPHID = %s AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo', - $user->getPHID()); - if ($status) { - $header->setStatus($status->getStatusDescription()); + $statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses( + array($user->getPHID())); + if ($statuses) { + $header->setStatus(reset($statuses)->getStatusDescription()); } } diff --git a/src/applications/people/storage/userstatus/PhabricatorUserStatus.php b/src/applications/people/storage/userstatus/PhabricatorUserStatus.php index 5586537e67..607629c1b0 100644 --- a/src/applications/people/storage/userstatus/PhabricatorUserStatus.php +++ b/src/applications/people/storage/userstatus/PhabricatorUserStatus.php @@ -49,4 +49,11 @@ final class PhabricatorUserStatus extends PhabricatorUserDAO { return $this->setStatus($statuses[$status]); } + public function loadCurrentStatuses($user_phids) { + $statuses = $this->loadAllWhere( + 'userPHID IN (%Ls) AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo', + $user_phids); + return mpull($statuses, null, 'getUserPHID'); + } + } diff --git a/src/applications/people/storage/userstatus/__init__.php b/src/applications/people/storage/userstatus/__init__.php index ecdf37ac53..5db77e00e1 100644 --- a/src/applications/people/storage/userstatus/__init__.php +++ b/src/applications/people/storage/userstatus/__init__.php @@ -9,5 +9,7 @@ phutil_require_module('phabricator', 'applications/people/storage/base'); phutil_require_module('phabricator', 'view/utils'); +phutil_require_module('phutil', 'utils'); + phutil_require_source('PhabricatorUserStatus.php'); diff --git a/src/applications/phid/handle/PhabricatorObjectHandle.php b/src/applications/phid/handle/PhabricatorObjectHandle.php index 5d2901f5a0..56fa21e2d4 100644 --- a/src/applications/phid/handle/PhabricatorObjectHandle.php +++ b/src/applications/phid/handle/PhabricatorObjectHandle.php @@ -27,7 +27,7 @@ final class PhabricatorObjectHandle { private $imageURI; private $timestamp; private $alternateID; - private $status = 'open'; + private $status = PhabricatorObjectHandleStatus::STATUS_OPEN; private $complete; private $disabled; @@ -197,13 +197,16 @@ final class PhabricatorObjectHandle { public function renderLink() { $name = $this->getLinkName(); $class = null; + $title = null; if ($this->status != PhabricatorObjectHandleStatus::STATUS_OPEN) { $class .= ' handle-status-'.$this->status; + $title = $this->status; } if ($this->disabled) { $class .= ' handle-disabled'; + $title = 'disabled'; // Overwrite status. } return phutil_render_tag( @@ -211,6 +214,7 @@ final class PhabricatorObjectHandle { array( 'href' => $this->getURI(), 'class' => $class, + 'title' => $title, ), phutil_escape_html($name)); } diff --git a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php index d45956ee8f..8fa322a56d 100644 --- a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php @@ -156,6 +156,9 @@ final class PhabricatorObjectHandleData { $phids); $emails = mpull($emails, 'getAddress', 'getUserPHID'); + $statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses( + $phids); + foreach ($phids as $phid) { $handle = new PhabricatorObjectHandle(); $handle->setPHID($phid); @@ -171,6 +174,9 @@ final class PhabricatorObjectHandleData { $user->getUsername().' ('.$user->getRealName().')'); $handle->setAlternateID($user->getID()); $handle->setComplete(true); + if (isset($statuses[$phid])) { + $handle->setStatus($statuses[$phid]->getTextStatus()); + } $handle->setDisabled($user->getIsDisabled() || $user->getIsSystemAgent()); diff --git a/src/applications/phid/handle/data/__init__.php b/src/applications/phid/handle/data/__init__.php index ed2961497f..d2622bba45 100644 --- a/src/applications/phid/handle/data/__init__.php +++ b/src/applications/phid/handle/data/__init__.php @@ -13,6 +13,7 @@ phutil_require_module('phabricator', 'applications/maniphest/constants/owner'); phutil_require_module('phabricator', 'applications/maniphest/constants/status'); phutil_require_module('phabricator', 'applications/people/storage/email'); phutil_require_module('phabricator', 'applications/people/storage/user'); +phutil_require_module('phabricator', 'applications/people/storage/userstatus'); phutil_require_module('phabricator', 'applications/phid/constants'); phutil_require_module('phabricator', 'applications/phid/handle'); phutil_require_module('phabricator', 'applications/phid/handle/const/status'); diff --git a/webroot/rsrc/css/application/base/standard-page-view.css b/webroot/rsrc/css/application/base/standard-page-view.css index f66975934b..1026097a47 100644 --- a/webroot/rsrc/css/application/base/standard-page-view.css +++ b/webroot/rsrc/css/application/base/standard-page-view.css @@ -187,6 +187,16 @@ td.phabricator-login-details { text-decoration: line-through; } +.aphront-table-view a.handle-status-away { + border-left: 2px solid #aa0000; + padding-left: .25em; +} + +.aphront-table-view a.handle-status-sporadic { + border-left: 2px solid #ffdd33; + padding-left: .25em; +} + a.handle-disabled { background: #999999; color: #cccccc;