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

Allow task statuses to have claiming disabled

Summary:
Fixes T10343. All solutions here seem basically fine. I think adding this small bit of complexity is OK, and sorrrrt of like this behavior sometimes.

- Allow disabling this behavior per-status.
- Disable it by default for "Invalid" and "Duplicate" (I left "wontfix", since that's a resolution?).

Beyond being more flexible, I think this is slightly better?

Test Plan:
- Closed a task as invalid: no claim.
- Closed a task as resolved: claim.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10343

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

+14 -3
+5 -2
src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
··· 111 111 'name' => pht('Invalid'), 112 112 'name.full' => pht('Closed, Invalid'), 113 113 'closed' => true, 114 + 'claim' => false, 114 115 'prefixes' => array( 115 116 'invalidate', 116 117 'invalidates', ··· 126 127 'transaction.icon' => 'fa-files-o', 127 128 'special' => ManiphestTaskStatus::SPECIAL_DUPLICATE, 128 129 'closed' => true, 130 + 'claim' => false, 129 131 ), 130 132 'spite' => array( 131 133 'name' => pht('Spite'), ··· 202 204 tasks can not be created or edited to have this status. Existing tasks with 203 205 this status will not be affected, but you can batch edit them or let them 204 206 die out on their own. 207 + - `claim` //Optional bool.// By default, closing an unassigned task claims 208 + it. You can set this to `false` to disable this behavior for a particular 209 + status. 205 210 206 211 Statuses will appear in the UI in the order specified. Note the status marked 207 212 `special` as `duplicate` is not settable directly and will not appear in UI ··· 288 293 See the example below for a starting point. 289 294 EOTEXT 290 295 )); 291 - 292 - 293 296 294 297 return array( 295 298 $this->newOption('maniphest.custom-field-definitions', 'wild', array())
+5
src/applications/maniphest/constants/ManiphestTaskStatus.php
··· 155 155 return false; 156 156 } 157 157 158 + public static function isClaimStatus($status) { 159 + return self::getStatusAttribute($status, 'claim', true); 160 + } 161 + 158 162 public static function isClosedStatus($status) { 159 163 return !self::isOpenStatus($status); 160 164 } ··· 279 283 'suffixes' => 'optional list<string>', 280 284 'keywords' => 'optional list<string>', 281 285 'disabled' => 'optional bool', 286 + 'claim' => 'optional bool', 282 287 )); 283 288 } 284 289
+4 -1
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 971 971 // If the task is not assigned, not being assigned, currently open, and 972 972 // being closed, try to assign the actor as the owner. 973 973 if ($is_unassigned && !$any_assign && $is_open && $is_closing) { 974 + $is_claim = ManiphestTaskStatus::isClaimStatus($new_status); 975 + 974 976 // Don't assign the actor if they aren't a real user. 975 - if ($actor_phid) { 977 + // Don't claim the task if the status is configured to not claim. 978 + if ($actor_phid && $is_claim) { 976 979 $results[] = id(new ManiphestTransaction()) 977 980 ->setTransactionType(ManiphestTransaction::TYPE_OWNER) 978 981 ->setNewValue($actor_phid);