Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/editor/ManiphestTransactionEditor.php
| Show First 20 Lines • Show All 1,027 Lines • ▼ Show 20 Lines | switch ($xaction->getTransactionType()) { | ||||
| )) | )) | ||||
| ->setNewValue( | ->setNewValue( | ||||
| array( | array( | ||||
| 'projectPHID' => $column->getProjectPHID(), | 'projectPHID' => $column->getProjectPHID(), | ||||
| 'columnPHIDs' => array($column->getPHID()), | 'columnPHIDs' => array($column->getPHID()), | ||||
| )); | )); | ||||
| break; | break; | ||||
| case ManiphestTransaction::TYPE_OWNER: | case ManiphestTransaction::TYPE_OWNER: | ||||
| // If this is a no-op update, don't expand it. | |||||
| $old_value = $object->getOwnerPHID(); | |||||
| $new_value = $xaction->getNewValue(); | |||||
| if ($old_value === $new_value) { | |||||
| continue; | |||||
| } | |||||
| // When a task is reassigned, move the old owner to the subscriber | // When a task is reassigned, move the old owner to the subscriber | ||||
| // list so they're still in the loop. | // list so they're still in the loop. | ||||
| $owner_phid = $object->getOwnerPHID(); | if ($old_value) { | ||||
| if ($owner_phid) { | |||||
| $results[] = id(new ManiphestTransaction()) | $results[] = id(new ManiphestTransaction()) | ||||
| ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) | ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) | ||||
| ->setIgnoreOnNoEffect(true) | ->setIgnoreOnNoEffect(true) | ||||
| ->setNewValue( | ->setNewValue( | ||||
| array( | array( | ||||
| '+' => array($owner_phid => $owner_phid), | '+' => array($old_value => $old_value), | ||||
| )); | )); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| return $results; | return $results; | ||||
| } | } | ||||
| Show All 23 Lines | |||||