Differential D14404 Diff 34805 src/applications/transactions/editengine/PhabricatorApplicationEditEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editengine/PhabricatorApplicationEditEngine.php
| Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | if ($object instanceof PhabricatorProjectInterface) { | ||||
| $project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | $project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | ||||
| $object_phid, | $object_phid, | ||||
| $project_edge_type); | $project_edge_type); | ||||
| $project_phids = array_reverse($project_phids); | $project_phids = array_reverse($project_phids); | ||||
| } else { | } else { | ||||
| $project_phids = array(); | $project_phids = array(); | ||||
| } | } | ||||
| $edge_field = id(new PhabricatorDatasourceEditField()) | $edge_field = id(new PhabricatorProjectsEditField()) | ||||
| ->setKey('projectPHIDs') | ->setKey('projectPHIDs') | ||||
| ->setLabel(pht('Projects')) | ->setLabel(pht('Projects')) | ||||
| ->setEditTypeKey('projects') | ->setEditTypeKey('projects') | ||||
| ->setDescription( | ->setDescription(pht('Add or remove associated projects.')) | ||||
| pht( | |||||
| 'Add or remove associated projects.')) | |||||
| ->setDatasource(new PhabricatorProjectDatasource()) | |||||
| ->setAliases(array('project', 'projects')) | ->setAliases(array('project', 'projects')) | ||||
| ->setTransactionType($edge_type) | ->setTransactionType($edge_type) | ||||
| ->setMetadataValue('edge:type', $project_edge_type) | ->setMetadataValue('edge:type', $project_edge_type) | ||||
| ->setValue($project_phids); | ->setValue($project_phids); | ||||
| $fields[] = $edge_field; | $fields[] = $edge_field; | ||||
| } | } | ||||
| } | } | ||||
| $subscribers_type = PhabricatorTransactions::TYPE_SUBSCRIBERS; | $subscribers_type = PhabricatorTransactions::TYPE_SUBSCRIBERS; | ||||
| if ($object instanceof PhabricatorSubscribableInterface) { | if ($object instanceof PhabricatorSubscribableInterface) { | ||||
| if (isset($types[$subscribers_type])) { | if (isset($types[$subscribers_type])) { | ||||
| if ($object_phid) { | if ($object_phid) { | ||||
| $sub_phids = PhabricatorSubscribersQuery::loadSubscribersForPHID( | $sub_phids = PhabricatorSubscribersQuery::loadSubscribersForPHID( | ||||
| $object_phid); | $object_phid); | ||||
| } else { | } else { | ||||
| // TODO: Allow applications to provide default subscribers; Maniphest | // TODO: Allow applications to provide default subscribers; Maniphest | ||||
| // does this at a minimum. | // does this at a minimum. | ||||
| $sub_phids = array(); | $sub_phids = array(); | ||||
| } | } | ||||
| $subscribers_field = id(new PhabricatorDatasourceEditField()) | $subscribers_field = id(new PhabricatorSubscribersEditField()) | ||||
| ->setKey('subscriberPHIDs') | ->setKey('subscriberPHIDs') | ||||
| ->setLabel(pht('Subscribers')) | ->setLabel(pht('Subscribers')) | ||||
| ->setEditTypeKey('subscribers') | ->setEditTypeKey('subscribers') | ||||
| ->setDescription(pht('Manage subscribers.')) | ->setDescription(pht('Manage subscribers.')) | ||||
| ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) | |||||
| ->setAliases(array('subscriber', 'subscribers')) | ->setAliases(array('subscriber', 'subscribers')) | ||||
| ->setTransactionType($subscribers_type) | ->setTransactionType($subscribers_type) | ||||
| ->setValue($sub_phids); | ->setValue($sub_phids); | ||||
| $fields[] = $subscribers_field; | $fields[] = $subscribers_field; | ||||
| } | } | ||||
| } | } | ||||
| foreach ($fields as $field) { | foreach ($fields as $field) { | ||||
| ▲ Show 20 Lines • Show All 589 Lines • Show Last 20 Lines | |||||