@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 parents and subtasks to be edited via Conduit API

Summary:
See PHI39. This adds support for editing parents and subtasks of a task via Conduit.

It might be nice to tie this into the `PhabricatorObjectRelationship` stuff eventually, but I think we'd effectively end up in the same place anyway in terms of what the API looks like.

Test Plan: {F5116163}

Reviewers: chad

Reviewed By: chad

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

+50
+50
src/applications/maniphest/editor/ManiphestEditEngine.php
··· 251 251 id(new PHUIRemarkupPreviewPanel()) 252 252 ->setHeader(pht('Description Preview'))); 253 253 254 + $parent_type = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST; 255 + $subtask_type = ManiphestTaskDependsOnTaskEdgeType::EDGECONST; 256 + 257 + $src_phid = $object->getPHID(); 258 + if ($src_phid) { 259 + $edge_query = id(new PhabricatorEdgeQuery()) 260 + ->withSourcePHIDs(array($src_phid)) 261 + ->withEdgeTypes( 262 + array( 263 + $parent_type, 264 + $subtask_type, 265 + )); 266 + $edge_query->execute(); 267 + 268 + $parent_phids = $edge_query->getDestinationPHIDs( 269 + array($src_phid), 270 + array($parent_type)); 271 + 272 + $subtask_phids = $edge_query->getDestinationPHIDs( 273 + array($src_phid), 274 + array($subtask_type)); 275 + } else { 276 + $parent_phids = array(); 277 + $subtask_phids = array(); 278 + } 279 + 280 + $fields[] = id(new PhabricatorHandlesEditField()) 281 + ->setKey('parents') 282 + ->setLabel(pht('Parents')) 283 + ->setDescription(pht('Parent tasks.')) 284 + ->setConduitDescription(pht('Change the parents of this task.')) 285 + ->setConduitTypeDescription(pht('List of parent task PHIDs.')) 286 + ->setUseEdgeTransactions(true) 287 + ->setIsConduitOnly(true) 288 + ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) 289 + ->setMetadataValue('edge:type', $parent_type) 290 + ->setValue($parent_phids); 291 + 292 + $fields[] = id(new PhabricatorHandlesEditField()) 293 + ->setKey('subtasks') 294 + ->setLabel(pht('Subtasks')) 295 + ->setDescription(pht('Subtasks.')) 296 + ->setConduitDescription(pht('Change the subtasks of this task.')) 297 + ->setConduitTypeDescription(pht('List of subtask PHIDs.')) 298 + ->setUseEdgeTransactions(true) 299 + ->setIsConduitOnly(true) 300 + ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) 301 + ->setMetadataValue('edge:type', $subtask_type) 302 + ->setValue($parent_phids); 303 + 254 304 return $fields; 255 305 } 256 306