Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/customfield/field/PhabricatorCustomFieldList.php
| Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | public function buildFieldTransactionsFromRequest( | ||||
| foreach ($this->fields as $field) { | foreach ($this->fields as $field) { | ||||
| if (!$field->shouldEnableForRole($role)) { | if (!$field->shouldEnableForRole($role)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| $old_value = $field->getOldValueForApplicationTransactions(); | $old_value = $field->getOldValueForApplicationTransactions(); | ||||
| $field->readValueFromRequest($request); | $field->readValueFromRequest($request); | ||||
| $transaction_type = $field->getApplicationTransactionType(); | |||||
| $xaction = id(clone $template) | $xaction = id(clone $template) | ||||
| ->setTransactionType(PhabricatorTransactions::TYPE_CUSTOMFIELD) | ->setTransactionType($transaction_type) | ||||
| ->setMetadataValue('customfield:key', $field->getFieldKey()) | ->setMetadataValue('customfield:key', $field->getFieldKey()) | ||||
| ->setOldValue($old_value) | |||||
| ->setNewValue($field->getNewValueForApplicationTransactions()); | ->setNewValue($field->getNewValueForApplicationTransactions()); | ||||
| if ($transaction_type == PhabricatorTransactions::TYPE_CUSTOMFIELD) { | |||||
| // For TYPE_CUSTOMFIELD transactions only, we provide the old value | |||||
| // as an input. | |||||
| $xaction->setOldValue($old_value); | |||||
| } | |||||
| $xactions[] = $xaction; | $xactions[] = $xaction; | ||||
| } | } | ||||
| return $xactions; | return $xactions; | ||||
| } | } | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines | |||||