Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4115285
D25991.1746946009.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25991.1746946009.diff
View Options
diff --git a/src/applications/maniphest/typeahead/ManiphestAssigneeDatasource.php b/src/applications/maniphest/typeahead/ManiphestAssigneeDatasource.php
--- a/src/applications/maniphest/typeahead/ManiphestAssigneeDatasource.php
+++ b/src/applications/maniphest/typeahead/ManiphestAssigneeDatasource.php
@@ -13,6 +13,7 @@
public function getComponentDatasources() {
return array(
+ new PhabricatorViewerDatasource(),
new PhabricatorPeopleDatasource(),
new PhabricatorPeopleNoOwnerDatasource(),
);
diff --git a/src/applications/people/typeahead/PhabricatorViewerDatasource.php b/src/applications/people/typeahead/PhabricatorViewerDatasource.php
--- a/src/applications/people/typeahead/PhabricatorViewerDatasource.php
+++ b/src/applications/people/typeahead/PhabricatorViewerDatasource.php
@@ -3,6 +3,8 @@
final class PhabricatorViewerDatasource
extends PhabricatorTypeaheadDatasource {
+ const FUNCTION_TOKEN = 'viewer()';
+
public function getBrowseTitle() {
return pht('Browse Viewer');
}
diff --git a/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php b/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php
--- a/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php
+++ b/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php
@@ -18,6 +18,9 @@
if ($value === PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN) {
$value = null;
}
+ if ($value === PhabricatorViewerDatasource::FUNCTION_TOKEN) {
+ $value = $this->getViewer()->getPHID();
+ }
return $value;
}
@@ -35,7 +38,8 @@
throw new Exception(
pht(
'Owner rule value is required. Specify a user to assign tasks '.
- 'to, or the token "none()" to unassign tasks.'));
+ 'to, the token "viewer()" to assign to the user moving tasks, '.
+ 'or the token "none()" to unassign tasks.'));
}
if (count($value) > 1) {
@@ -123,11 +127,10 @@
}
public function getRuleViewDescription($value) {
- $value = $this->convertTokenizerValueToOwner($value);
-
- if (!$value) {
- return pht('Unassign task.');
- } else {
+ if (head($value) === PhabricatorViewerDatasource::FUNCTION_TOKEN) {
+ return pht('Assign task to user moving the task.');
+ } else if ($value) {
+ $value = $this->convertTokenizerValueToOwner($value);
return pht(
'Assign task to %s.',
phutil_tag(
@@ -136,6 +139,8 @@
$this->getViewer()
->renderHandle($value)
->render()));
+ } else { // !$value
+ return pht('Unassign task.');
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 11, 06:46 (7 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1524593
Default Alt Text
D25991.1746946009.diff (2 KB)
Attached To
Mode
D25991: Column triggers: Allow assigning user who performs the move
Attached
Detach File
Event Timeline
Log In to Comment