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

Add "subtype" storage to Maniphest tasks

Summary: Ref T12314. Provides a field on tasks for storing subtypes. Does nothing interesting yet.

Test Plan:
- Ran storage upgrade.
- Created some tasks.
- Looked in the database.
- Used Conduit to query some tasks.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12314

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

+52 -1
+2
resources/sql/autopatches/20170301.subtype.03.taskcol.sql
··· 1 + ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task 2 + ADD subtype VARCHAR(64) COLLATE {$COLLATE_TEXT} NOT NULL;
+2
resources/sql/autopatches/20170301.subtype.04.taskdefault.sql
··· 1 + UPDATE {$NAMESPACE}_maniphest.maniphest_task 2 + SET subtype = 'default' WHERE subtype = '';
+2
src/__phutil_library_map__.php
··· 2626 2626 'PhabricatorEditEngineSettingsPanel' => 'applications/settings/panel/PhabricatorEditEngineSettingsPanel.php', 2627 2627 'PhabricatorEditEngineStaticCommentAction' => 'applications/transactions/commentaction/PhabricatorEditEngineStaticCommentAction.php', 2628 2628 'PhabricatorEditEngineSubtype' => 'applications/transactions/editengine/PhabricatorEditEngineSubtype.php', 2629 + 'PhabricatorEditEngineSubtypeInterface' => 'applications/transactions/editengine/PhabricatorEditEngineSubtypeInterface.php', 2629 2630 'PhabricatorEditEngineSubtypeTestCase' => 'applications/transactions/editengine/__tests__/PhabricatorEditEngineSubtypeTestCase.php', 2630 2631 'PhabricatorEditEngineTokenizerCommentAction' => 'applications/transactions/commentaction/PhabricatorEditEngineTokenizerCommentAction.php', 2631 2632 'PhabricatorEditField' => 'applications/transactions/editfield/PhabricatorEditField.php', ··· 6367 6368 'PhabricatorConduitResultInterface', 6368 6369 'PhabricatorFulltextInterface', 6369 6370 'DoorkeeperBridgedObjectInterface', 6371 + 'PhabricatorEditEngineSubtypeInterface', 6370 6372 ), 6371 6373 'ManiphestTaskAssignHeraldAction' => 'HeraldAction', 6372 6374 'ManiphestTaskAssignOtherHeraldAction' => 'ManiphestTaskAssignHeraldAction',
+13
src/applications/maniphest/query/ManiphestTaskQuery.php
··· 24 24 private $hasOpenSubtasks; 25 25 private $parentTaskIDs; 26 26 private $subtaskIDs; 27 + private $subtypes; 27 28 28 29 private $fullTextSearch = ''; 29 30 ··· 205 206 206 207 public function withBridgedObjectPHIDs(array $phids) { 207 208 $this->bridgedObjectPHIDs = $phids; 209 + return $this; 210 + } 211 + 212 + public function withSubtypes(array $subtypes) { 213 + $this->subtypes = $subtypes; 208 214 return $this; 209 215 } 210 216 ··· 421 427 $conn, 422 428 'task.bridgedObjectPHID IN (%Ls)', 423 429 $this->bridgedObjectPHIDs); 430 + } 431 + 432 + if ($this->subtypes !== null) { 433 + $where[] = qsprintf( 434 + $conn, 435 + 'task.subtype IN (%Ls)', 436 + $this->subtypes); 424 437 } 425 438 426 439 return $where;
+25 -1
src/applications/maniphest/storage/ManiphestTask.php
··· 16 16 PhabricatorSpacesInterface, 17 17 PhabricatorConduitResultInterface, 18 18 PhabricatorFulltextInterface, 19 - DoorkeeperBridgedObjectInterface { 19 + DoorkeeperBridgedObjectInterface, 20 + PhabricatorEditEngineSubtypeInterface { 20 21 21 22 const MARKUP_FIELD_DESCRIPTION = 'markup:desc'; 22 23 ··· 40 41 protected $bridgedObjectPHID; 41 42 protected $properties = array(); 42 43 protected $points; 44 + protected $subtype; 43 45 44 46 private $subscriberPHIDs = self::ATTACHABLE; 45 47 private $groupByProjectPHID = self::ATTACHABLE; ··· 63 65 ->setViewPolicy($view_policy) 64 66 ->setEditPolicy($edit_policy) 65 67 ->setSpacePHID($actor->getDefaultSpacePHID()) 68 + ->setSubtype(PhabricatorEditEngineSubtype::SUBTYPE_DEFAULT) 66 69 ->attachProjectPHIDs(array()) 67 70 ->attachSubscriberPHIDs(array()); 68 71 } ··· 86 89 'subpriority' => 'double', 87 90 'points' => 'double?', 88 91 'bridgedObjectPHID' => 'phid?', 92 + 'subtype' => 'text64', 89 93 ), 90 94 self::CONFIG_KEY_SCHEMA => array( 91 95 'key_phid' => null, ··· 123 127 'key_bridgedobject' => array( 124 128 'columns' => array('bridgedObjectPHID'), 125 129 'unique' => true, 130 + ), 131 + 'key_subtype' => array( 132 + 'columns' => array('subtype'), 126 133 ), 127 134 ), 128 135 ) + parent::getConfiguration(); ··· 474 481 ->setKey('points') 475 482 ->setType('points') 476 483 ->setDescription(pht('Point value of the task.')), 484 + id(new PhabricatorConduitSearchFieldSpecification()) 485 + ->setKey('subtype') 486 + ->setType('string') 487 + ->setDescription(pht('Subtype of the task.')), 477 488 ); 478 489 } 479 490 ··· 501 512 'status' => $status_info, 502 513 'priority' => $priority_info, 503 514 'points' => $this->getPoints(), 515 + 'subtype' => $this->getSubtype(), 504 516 ); 505 517 } 506 518 ··· 531 543 DoorkeeperExternalObject $object = null) { 532 544 $this->bridgedObject = $object; 533 545 return $this; 546 + } 547 + 548 + 549 + /* -( PhabricatorEditEngineSubtypeInterface )------------------------------ */ 550 + 551 + 552 + public function getEditEngineSubtype() { 553 + return $this->getSubtype(); 554 + } 555 + 556 + public function setEditEngineSubtype($value) { 557 + return $this->setSubtype($value); 534 558 } 535 559 536 560 }
+8
src/applications/transactions/editengine/PhabricatorEditEngineSubtypeInterface.php
··· 1 + <?php 2 + 3 + interface PhabricatorEditEngineSubtypeInterface { 4 + 5 + public function getEditEngineSubtype(); 6 + public function setEditEngineSubtype($subtype); 7 + 8 + }