Merge branch 'master' into blender-tweaks

Conflicts:
	resources/celerity/map.php
	src/applications/maniphest/controller/ManiphestTaskEditController.php
This commit is contained in:
2014-07-22 13:29:23 +06:00
241 changed files with 3179 additions and 2272 deletions

View File

@@ -8,7 +8,7 @@
return array(
'names' => array(
'core.pkg.css' => '4e1d9fba',
'core.pkg.js' => '80884e9b',
'core.pkg.js' => 'ba6a742f',
'darkconsole.pkg.js' => 'df001cab',
'differential.pkg.css' => '4a93db37',
'differential.pkg.js' => '7528cfc9',
@@ -214,7 +214,7 @@ return array(
'rsrc/externals/javelin/lib/__tests__/behavior.js' => '1ea62783',
'rsrc/externals/javelin/lib/behavior.js' => '61cbc29a',
'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => 'a5b67173',
'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => '61f72a3d',
'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'e614d22b',
'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => 'aa93c7b0',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '8b3fd187',
@@ -394,7 +394,7 @@ return array(
'rsrc/js/application/files/behavior-icon-composer.js' => '8ef9ab58',
'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888',
'rsrc/js/application/harbormaster/behavior-reorder-steps.js' => 'b716477f',
'rsrc/js/application/herald/HeraldRuleEditor.js' => '58e048fc',
'rsrc/js/application/herald/HeraldRuleEditor.js' => '3fc2c8f2',
'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec',
'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3',
'rsrc/js/application/maniphest/behavior-batch-editor.js' => 'f588412e',
@@ -416,7 +416,7 @@ return array(
'rsrc/js/application/phortune/behavior-test-payment-form.js' => 'ab8d2723',
'rsrc/js/application/phortune/phortune-credit-card-form.js' => '2290aeef',
'rsrc/js/application/policy/behavior-policy-control.js' => 'f3fef818',
'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '92918fcb',
'rsrc/js/application/policy/behavior-policy-rule-editor.js' => 'fe9a552f',
'rsrc/js/application/ponder/behavior-votebox.js' => '4e9b766b',
'rsrc/js/application/projects/behavior-boards-dropdown.js' => '0ec56e1d',
'rsrc/js/application/projects/behavior-project-boards.js' => 'c6b95cbd',
@@ -452,7 +452,7 @@ return array(
'rsrc/js/core/KeyboardShortcutManager.js' => 'ad7a69ca',
'rsrc/js/core/MultirowRowManager.js' => '41e47dea',
'rsrc/js/core/Notification.js' => '0c6946e7',
'rsrc/js/core/Prefab.js' => '41ed7994',
'rsrc/js/core/Prefab.js' => 'bbae734c',
'rsrc/js/core/ShapedRequest.js' => '7cbe244b',
'rsrc/js/core/TextAreaUtils.js' => 'b3ec3cfc',
'rsrc/js/core/ToolTip.js' => '3915d490',
@@ -487,7 +487,7 @@ return array(
'rsrc/js/core/behavior-remarkup-preview.js' => 'f7379f45',
'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e',
'rsrc/js/core/behavior-reveal-content.js' => '60821bc7',
'rsrc/js/core/behavior-search-typeahead.js' => '5a376f34',
'rsrc/js/core/behavior-search-typeahead.js' => 'd712ac5f',
'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6',
'rsrc/js/core/behavior-toggle-class.js' => 'e566f52c',
'rsrc/js/core/behavior-tokenizer.js' => 'b3a4b884',
@@ -545,7 +545,7 @@ return array(
'global-drag-and-drop-css' => '697324ad',
'harbormaster-css' => 'cec833b7',
'herald-css' => 'c544dd1c',
'herald-rule-editor' => '58e048fc',
'herald-rule-editor' => '3fc2c8f2',
'herald-test-css' => '778b008e',
'inline-comment-summary-css' => '8cfd34e8',
'javelin-aphlict' => '4a07e8e3',
@@ -631,7 +631,7 @@ return array(
'javelin-behavior-phabricator-oncopy' => '2926fff2',
'javelin-behavior-phabricator-remarkup-assist' => 'e32d14ab',
'javelin-behavior-phabricator-reveal-content' => '60821bc7',
'javelin-behavior-phabricator-search-typeahead' => '5a376f34',
'javelin-behavior-phabricator-search-typeahead' => 'd712ac5f',
'javelin-behavior-phabricator-show-all-transactions' => '7c273581',
'javelin-behavior-phabricator-tooltips' => '3ee3408b',
'javelin-behavior-phabricator-transaction-comment-form' => '9f7309fb',
@@ -643,7 +643,7 @@ return array(
'javelin-behavior-phui-object-box-tabs' => 'a3e2244e',
'javelin-behavior-phui-timeline-dropdown-menu' => '4d94d9c3',
'javelin-behavior-policy-control' => 'f3fef818',
'javelin-behavior-policy-rule-editor' => '92918fcb',
'javelin-behavior-policy-rule-editor' => 'fe9a552f',
'javelin-behavior-ponder-votebox' => '4e9b766b',
'javelin-behavior-project-boards' => 'c6b95cbd',
'javelin-behavior-project-create' => '065227cc',
@@ -685,7 +685,7 @@ return array(
'javelin-router' => '29274e2b',
'javelin-stratcom' => '8b0ad945',
'javelin-tokenizer' => 'a5b67173',
'javelin-typeahead' => '61f72a3d',
'javelin-typeahead' => 'e614d22b',
'javelin-typeahead-composite-source' => '503e17fd',
'javelin-typeahead-normalizer' => 'aa93c7b0',
'javelin-typeahead-ondemand-source' => '8b3fd187',
@@ -739,7 +739,7 @@ return array(
'phabricator-notification-menu-css' => '8ae4a008',
'phabricator-object-selector-css' => '029a133d',
'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => '41ed7994',
'phabricator-prefab' => 'bbae734c',
'phabricator-profile-css' => 'b459416e',
'phabricator-remarkup-css' => 'ad4c0676',
'phabricator-search-results-css' => 'f240504c',
@@ -1095,6 +1095,15 @@ return array(
2 => 'javelin-stratcom',
3 => 'phabricator-tooltip',
),
'3fc2c8f2' => array(
0 => 'multirow-row-manager',
1 => 'javelin-install',
2 => 'javelin-util',
3 => 'javelin-dom',
4 => 'javelin-stratcom',
5 => 'javelin-json',
6 => 'phabricator-prefab',
),
'40a6a403' => array(
0 => 'javelin-install',
1 => 'javelin-dom',
@@ -1118,18 +1127,6 @@ return array(
2 => 'javelin-dom',
3 => 'javelin-util',
),
'41ed7994' => array(
0 => 'javelin-install',
1 => 'javelin-util',
2 => 'javelin-dom',
3 => 'javelin-typeahead',
4 => 'javelin-tokenizer',
5 => 'javelin-typeahead-preloaded-source',
6 => 'javelin-typeahead-ondemand-source',
7 => 'javelin-dom',
8 => 'javelin-stratcom',
9 => 'javelin-util',
),
'44168bad' => array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
@@ -1203,15 +1200,6 @@ return array(
2 => 'javelin-vector',
3 => 'javelin-dom',
),
'58e048fc' => array(
0 => 'multirow-row-manager',
1 => 'javelin-install',
2 => 'javelin-util',
3 => 'javelin-dom',
4 => 'javelin-stratcom',
5 => 'javelin-json',
6 => 'phabricator-prefab',
),
'58f7803f' => array(
0 => 'javelin-behavior',
1 => 'javelin-aphlict',
@@ -1224,15 +1212,6 @@ return array(
2 => 'javelin-vector',
3 => 'javelin-dom',
),
'5a376f34' => array(
0 => 'javelin-behavior',
1 => 'javelin-typeahead-ondemand-source',
2 => 'javelin-typeahead',
3 => 'javelin-dom',
4 => 'javelin-uri',
5 => 'javelin-util',
6 => 'javelin-stratcom',
),
'5bc2cb21' => array(
0 => 'javelin-behavior',
1 => 'javelin-stratcom',
@@ -1258,12 +1237,6 @@ return array(
0 => 'javelin-magical-init',
1 => 'javelin-util',
),
'61f72a3d' => array(
0 => 'javelin-install',
1 => 'javelin-dom',
2 => 'javelin-vector',
3 => 'javelin-util',
),
'6453c869' => array(
0 => 'javelin-install',
1 => 'javelin-dom',
@@ -1453,17 +1426,6 @@ return array(
1 => 'javelin-uri',
2 => 'phabricator-notification',
),
'92918fcb' => array(
0 => 'javelin-behavior',
1 => 'multirow-row-manager',
2 => 'javelin-dom',
3 => 'javelin-util',
4 => 'phabricator-prefab',
5 => 'javelin-tokenizer',
6 => 'javelin-typeahead',
7 => 'javelin-typeahead-preloaded-source',
8 => 'javelin-json',
),
'92eb531d' => array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
@@ -1667,6 +1629,18 @@ return array(
1 => 'javelin-stratcom',
2 => 'javelin-dom',
),
'bbae734c' => array(
0 => 'javelin-install',
1 => 'javelin-util',
2 => 'javelin-dom',
3 => 'javelin-typeahead',
4 => 'javelin-tokenizer',
5 => 'javelin-typeahead-preloaded-source',
6 => 'javelin-typeahead-ondemand-source',
7 => 'javelin-dom',
8 => 'javelin-stratcom',
9 => 'javelin-util',
),
'bd4c8dca' => array(
0 => 'javelin-install',
1 => 'javelin-util',
@@ -1767,6 +1741,16 @@ return array(
2 => 'javelin-stratcom',
3 => 'javelin-dom',
),
'd712ac5f' => array(
0 => 'javelin-behavior',
1 => 'javelin-typeahead-ondemand-source',
2 => 'javelin-typeahead',
3 => 'javelin-dom',
4 => 'javelin-uri',
5 => 'javelin-util',
6 => 'javelin-stratcom',
7 => 'phabricator-prefab',
),
'd75709e6' => array(
0 => 'javelin-behavior',
1 => 'javelin-workflow',
@@ -1838,6 +1822,12 @@ return array(
2 => 'javelin-view-visitor',
3 => 'javelin-util',
),
'e614d22b' => array(
0 => 'javelin-install',
1 => 'javelin-dom',
2 => 'javelin-vector',
3 => 'javelin-util',
),
'e9581f08' => array(
0 => 'javelin-behavior',
1 => 'javelin-stratcom',
@@ -1958,6 +1948,14 @@ return array(
2 => 'javelin-dom',
3 => 'javelin-typeahead-normalizer',
),
'fe9a552f' => array(
0 => 'javelin-behavior',
1 => 'multirow-row-manager',
2 => 'javelin-dom',
3 => 'javelin-util',
4 => 'phabricator-prefab',
5 => 'javelin-json',
),
42126667 => array(
0 => 'javelin-behavior',
1 => 'javelin-dom',

View File

@@ -0,0 +1,10 @@
/* PhabricatorProjectObjectHasProjectEdgeType::EDGECONST = 41 */
/* PhabricatorProjectProjectHasObjectEdgeType::EDGECONST = 42 */
INSERT IGNORE INTO {$NAMESPACE}_maniphest.edge (src, type, dst)
SELECT taskPHID, 41, projectPHID
FROM {$NAMESPACE}_maniphest.maniphest_taskproject;
INSERT IGNORE INTO {$NAMESPACE}_project.edge (src, type, dst)
SELECT projectPHID, 42, taskPHID
FROM {$NAMESPACE}_maniphest.maniphest_taskproject;

View File

@@ -0,0 +1,7 @@
CREATE TABLE {$NAMESPACE}_project.project_datasourcetoken (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
projectID INT UNSIGNED NOT NULL,
token VARCHAR(128) NOT NULL COLLATE utf8_general_ci,
UNIQUE KEY (token, projectID),
KEY (projectID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@@ -0,0 +1,11 @@
<?php
echo "Updating project datasource tokens...\n";
foreach (new LiskMigrationIterator(new PhabricatorProject()) as $project) {
$name = $project->getName();
echo "Updating project '{$name}'...\n";
$project->updateDatasourceTokens();
}
echo "Done.\n";

View File

@@ -19,7 +19,6 @@ foreach ($revs as $rev) {
}
$editor = new PhabricatorEdgeEditor();
$editor->setSuppressEvents(true);
foreach ($unsubscribed as $user_phid => $_) {
$editor->addEdge(
$rev['phid'],

View File

@@ -3,7 +3,7 @@
echo "Migrating differential.revisionPHID to edges...\n";
$commit_table = new PhabricatorRepositoryCommit();
$data_table = new PhabricatorRepositoryCommitData();
$editor = id(new PhabricatorEdgeEditor())->setSuppressEvents(true);
$editor = new PhabricatorEdgeEditor();
$commit_table->establishConnection('w');
$edges = 0;
@@ -24,7 +24,7 @@ foreach (new LiskMigrationIterator($commit_table) as $commit) {
if ($edges % 256 == 0) {
echo '.';
$editor->save();
$editor = id(new PhabricatorEdgeEditor())->setSuppressEvents(true);
$editor = new PhabricatorEdgeEditor();
}
}

View File

@@ -25,9 +25,7 @@ foreach (new LiskMigrationIterator($table) as $revision) {
continue;
}
$editor = id(new PhabricatorEdgeEditor())
->setActor(PhabricatorUser::getOmnipotentUser());
$editor = new PhabricatorEdgeEditor();
foreach ($reviewer_phids as $dst) {
if (phid_get_type($dst) == PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN) {
// At least one old install ran into some issues here. Skip the row if we

View File

@@ -121,7 +121,6 @@ foreach ($map as $credential_type => $credential_usernames) {
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_USES_CREDENTIAL;
id(new PhabricatorEdgeEditor())
->setActor($viewer)
->addEdge($repository->getPHID(), $edge_type, $credential->getPHID())
->save();
}

View File

@@ -15,7 +15,6 @@ foreach (new LiskMigrationIterator($table) as $rev) {
}
$editor = new PhabricatorEdgeEditor();
$editor->setSuppressEvents(true);
foreach ($deps as $dep) {
$editor->addEdge(
$rev->getPHID(),

View File

@@ -15,7 +15,6 @@ foreach (new LiskMigrationIterator($table) as $task) {
}
$editor = new PhabricatorEdgeEditor();
$editor->setSuppressEvents(true);
foreach ($deps as $dep) {
$editor->addEdge(
$task->getPHID(),

View File

@@ -15,11 +15,10 @@ foreach (new LiskMigrationIterator($table) as $task) {
}
$editor = new PhabricatorEdgeEditor();
$editor->setSuppressEvents(true);
foreach ($revs as $rev) {
$editor->addEdge(
$task->getPHID(),
PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV,
ManiphestTaskHasRevisionEdgeType::EDGECONST,
$rev);
}
$editor->save();

View File

@@ -22,7 +22,6 @@ foreach (new LiskMigrationIterator($table) as $proj) {
$members = ipull($members, 'userPHID');
$editor = new PhabricatorEdgeEditor();
$editor->setSuppressEvents(true);
foreach ($members as $user_phid) {
$editor->addEdge(
$proj->getPHID(),

File diff suppressed because it is too large Load Diff

View File

@@ -85,13 +85,13 @@ final class PhabricatorCommitSearchEngine
$form
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/usersprojectsorpackages/')
->setDatasource(new DiffusionAuditorDatasource())
->setName('auditorPHIDs')
->setLabel(pht('Auditors'))
->setValue(array_select_keys($handles, $auditor_phids)))
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Commit Authors'))
->setValue(array_select_keys($handles, $commit_author_phids)))

View File

@@ -4,10 +4,6 @@ final class PhabricatorAuthPHIDTypeAuthFactor extends PhabricatorPHIDType {
const TYPECONST = 'AFTR';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Auth Factor');
}

View File

@@ -180,7 +180,7 @@ abstract class PhabricatorAuthProvider {
protected function renderLoginForm(
AphrontRequest $request,
$mode) {
throw new Exception('Not implemented!');
throw new PhutilMethodNotImplementedException();
}
public function createProviders() {
@@ -295,7 +295,7 @@ abstract class PhabricatorAuthProvider {
}
public function getDefaultExternalAccount() {
throw new Exception('Not implemented!');
throw new PhutilMethodNotImplementedException();
}
public function getLoginOrder() {

View File

@@ -4,10 +4,6 @@ final class PhabricatorCalendarPHIDTypeEvent extends PhabricatorPHIDType {
const TYPECONST = 'CEVT';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Event');
}

View File

@@ -106,13 +106,13 @@ final class PhabricatorCalendarEventSearchEngine
$form
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/accounts/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('creators')
->setLabel(pht('Created By'))
->setValue($creator_handles))
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/accounts/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('invited')
->setLabel(pht('Invited'))
->setValue($invited_handles))

View File

@@ -4,10 +4,6 @@ final class PhabricatorConfigPHIDTypeConfig extends PhabricatorPHIDType {
const TYPECONST = 'CONF';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Config');
}

View File

@@ -82,7 +82,7 @@ final class ConpherenceNewController extends ConpherenceController {
->setName('participants')
->setValue($participant_handles)
->setUser($user)
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setLabel(pht('To'))
->setError($e_participants))
->appendChild(

View File

@@ -206,7 +206,7 @@ final class ConpherenceUpdateController
id(new AphrontFormTokenizerControl())
->setName('add_person')
->setUser($user)
->setDatasource('/typeahead/common/users/'));
->setDatasource(new PhabricatorPeopleDatasource()));
require_celerity_resource('conpherence-update-css');
return id(new AphrontDialogView())

View File

@@ -216,8 +216,7 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
switch ($xaction->getTransactionType()) {
case ConpherenceTransactionType::TYPE_FILES:
$editor = id(new PhabricatorEdgeEditor())
->setActor($this->getActor());
$editor = new PhabricatorEdgeEditor();
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
$old = array_fill_keys($xaction->getOldValue(), true);
$new = array_fill_keys($xaction->getNewValue(), true);

View File

@@ -4,10 +4,6 @@ final class PhabricatorConpherencePHIDTypeThread extends PhabricatorPHIDType {
const TYPECONST = 'CONP';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Conpherence Thread');
}

View File

@@ -4,10 +4,6 @@ final class PhabricatorCountdownPHIDTypeCountdown extends PhabricatorPHIDType {
const TYPECONST = 'CDWN';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Countdown');
}

View File

@@ -51,7 +51,7 @@ final class PhabricatorCountdownSearchEngine
$form
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))

View File

@@ -4,10 +4,6 @@ final class PhabricatorDashboardPHIDTypeDashboard extends PhabricatorPHIDType {
const TYPECONST = 'DSHB';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Dashboard');
}

View File

@@ -4,10 +4,6 @@ final class PhabricatorDashboardPHIDTypePanel extends PhabricatorPHIDType {
const TYPECONST = 'DSHP';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Panel');
}

View File

@@ -257,8 +257,7 @@ final class DifferentialJIRAIssuesField
$revision_phid,
$edge_type);
$editor = id(new PhabricatorEdgeEditor())
->setActor($this->getViewer());
$editor = new PhabricatorEdgeEditor();
foreach (array_diff($edges, $edge_dsts) as $rem_edge) {
$editor->removeEdge($revision_phid, $edge_type, $rem_edge);

View File

@@ -42,7 +42,7 @@ final class DifferentialManiphestTasksField
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$revision->getPHID(),
PhabricatorEdgeConfig::TYPE_DREV_HAS_RELATED_TASK);
DifferentialRevisionHasTaskEdgeType::EDGECONST);
}
public function getApplicationTransactionType() {
@@ -51,7 +51,7 @@ final class DifferentialManiphestTasksField
public function getApplicationTransactionMetadata() {
return array(
'edge:type' => PhabricatorEdgeConfig::TYPE_DREV_HAS_RELATED_TASK,
'edge:type' => DifferentialRevisionHasTaskEdgeType::EDGECONST,
);
}

View File

@@ -35,7 +35,7 @@ final class DifferentialProjectsField
$projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$revision->getPHID(),
PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
$projects = array_reverse($projects);
return $projects;
@@ -97,7 +97,9 @@ final class DifferentialProjectsField
}
public function getApplicationTransactionMetadata() {
return array('edge:type' => PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
return array(
'edge:type' => PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
);
}
public function parseValueFromCommitMessage($value) {

View File

@@ -69,7 +69,7 @@ final class DifferentialReviewersField
public function renderEditControl(array $handles) {
return id(new AphrontFormTokenizerControl())
->setName($this->getFieldKey())
->setDatasource('/typeahead/common/usersorprojects/')
->setDatasource(new PhabricatorProjectOrUserDatasource())
->setValue($handles)
->setError($this->getFieldError())
->setLabel($this->getFieldName());

View File

@@ -44,7 +44,7 @@ final class DifferentialSubscribersField
public function renderEditControl(array $handles) {
return id(new AphrontFormTokenizerControl())
->setName($this->getFieldKey())
->setDatasource('/typeahead/common/mailable/')
->setDatasource(new PhabricatorMetaMTAMailableDatasource())
->setValue($handles)
->setError($this->getFieldError())
->setLabel($this->getFieldName());

View File

@@ -0,0 +1,105 @@
<?php
final class DifferentialRevisionHasTaskEdgeType extends PhabricatorEdgeType {
const EDGECONST = 12;
public function getInverseEdgeConstant() {
return ManiphestTaskHasRevisionEdgeType::EDGECONST;
}
public function shouldWriteInverseTransactions() {
return true;
}
public function getTransactionAddString(
$actor,
$add_count,
$add_edges) {
return pht(
'%s added %s task(s): %s.',
$actor,
$add_count,
$add_edges);
}
public function getTransactionRemoveString(
$actor,
$rem_count,
$rem_edges) {
return pht(
'%s removed %s task(s): %s.',
$actor,
$rem_count,
$rem_edges);
}
public function getTransactionEditString(
$actor,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges) {
return pht(
'%s edited %s task(s), added %s: %s; removed %s: %s.',
$actor,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges);
}
public function getFeedAddString(
$actor,
$object,
$add_count,
$add_edges) {
return pht(
'%s added %s task(s) to %s: %s.',
$actor,
$add_count,
$object,
$add_edges);
}
public function getFeedRemoveString(
$actor,
$object,
$rem_count,
$rem_edges) {
return pht(
'%s removed %s task(s) from %s: %s.',
$actor,
$rem_count,
$object,
$rem_edges);
}
public function getFeedEditString(
$actor,
$object,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges) {
return pht(
'%s edited %s task(s) for %s, added %s: %s; removed %s: %s.',
$actor,
$total_count,
$object,
$add_count,
$add_edges,
$rem_count,
$rem_edges);
}
}

View File

@@ -254,7 +254,7 @@ final class DifferentialTransactionEditor
$status_plan = ArcanistDifferentialRevisionStatus::CHANGES_PLANNED;
$edge_reviewer = PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER;
$edge_ref_task = PhabricatorEdgeConfig::TYPE_DREV_HAS_RELATED_TASK;
$edge_ref_task = DifferentialRevisionHasTaskEdgeType::EDGECONST;
$is_sticky_accept = PhabricatorEnv::getEnvConfig(
'differential.sticky-accept');
@@ -1250,7 +1250,7 @@ final class DifferentialTransactionEditor
->execute();
if ($tasks) {
$edge_related = PhabricatorEdgeConfig::TYPE_DREV_HAS_RELATED_TASK;
$edge_related = DifferentialRevisionHasTaskEdgeType::EDGECONST;
$edges[$edge_related] = mpull($tasks, 'getPHID', 'getPHID');
}
}

View File

@@ -28,7 +28,7 @@ final class DifferentialHovercardEventListener
$rev->loadRelationships();
$reviewer_phids = $rev->getReviewers();
$e_task = PhabricatorEdgeConfig::TYPE_DREV_HAS_RELATED_TASK;
$e_task = DifferentialRevisionHasTaskEdgeType::EDGECONST;
$edge_query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(array($phid))
->withEdgeTypes(

View File

@@ -4,10 +4,6 @@ final class DifferentialPHIDTypeDiff extends PhabricatorPHIDType {
const TYPECONST = 'DIFF';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Differential Diff');
}

View File

@@ -4,10 +4,6 @@ final class DifferentialPHIDTypeRevision extends PhabricatorPHIDType {
const TYPECONST = 'DREV';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Revision');
}

View File

@@ -143,25 +143,25 @@ final class DifferentialRevisionSearchEngine
id(new AphrontFormTokenizerControl())
->setLabel(pht('Responsible Users'))
->setName('responsibles')
->setDatasource('/typeahead/common/accounts/')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue(array_select_keys($handles, $responsible_phids)))
->appendChild(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Authors'))
->setName('authors')
->setDatasource('/typeahead/common/accounts/')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue(array_select_keys($handles, $author_phids)))
->appendChild(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Reviewers'))
->setName('reviewers')
->setDatasource('/typeahead/common/accountsorprojects/')
->setDatasource(new PhabricatorProjectOrUserDatasource())
->setValue(array_select_keys($handles, $reviewer_phids)))
->appendChild(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Subscribers'))
->setName('subscribers')
->setDatasource('/typeahead/common/allmailable/')
->setDatasource(new PhabricatorMetaMTAMailableDatasource())
->setValue(array_select_keys($handles, $subscriber_phids)))
->appendChild(
id(new AphrontFormTokenizerControl())

View File

@@ -67,11 +67,13 @@ final class DifferentialChangesetOneUpRenderer
return null;
}
public function renderFileChange($old_file = null,
$new_file = null,
$id = 0,
$vs = 0) {
throw new Exception('Not implemented!');
public function renderFileChange(
$old_file = null,
$new_file = null,
$id = 0,
$vs = 0) {
throw new PhutilMethodNotImplementedException();
}
}

View File

@@ -76,11 +76,13 @@ abstract class DifferentialChangesetTestRenderer
}
public function renderFileChange($old_file = null,
$new_file = null,
$id = 0,
$vs = 0) {
throw new Exception('Not implemented!');
public function renderFileChange(
$old_file = null,
$new_file = null,
$id = 0,
$vs = 0) {
throw new PhutilMethodNotImplementedException();
}
}

View File

@@ -6,7 +6,7 @@ final class DifferentialDiff
PhabricatorPolicyInterface,
HarbormasterBuildableInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorDestructableInterface {
PhabricatorDestructibleInterface {
protected $revisionID;
protected $authorPHID;
@@ -392,7 +392,7 @@ final class DifferentialDiff
}
/* -( PhabricatorDestructableInterface )----------------------------------- */
/* -( PhabricatorDestructibleInterface )----------------------------------- */
public function destroyObjectPermanently(

View File

@@ -10,7 +10,7 @@ final class DifferentialRevision extends DifferentialDAO
PhabricatorSubscribableInterface,
PhabricatorCustomFieldInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorDestructableInterface,
PhabricatorDestructibleInterface,
PhabricatorProjectInterface {
protected $title = '';
@@ -449,7 +449,7 @@ final class DifferentialRevision extends DifferentialDAO
}
/* -( PhabricatorDestructableInterface )----------------------------------- */
/* -( PhabricatorDestructibleInterface )----------------------------------- */
public function destroyObjectPermanently(

View File

@@ -108,6 +108,9 @@ final class DifferentialAddCommentView extends AphrontView {
id(new AphrontFormSubmitControl())
->setValue(pht('Submit')));
$mailable_source = new PhabricatorMetaMTAMailableDatasource();
$reviewer_source = new PhabricatorProjectOrUserDatasource();
Javelin::initBehavior(
'differential-add-reviewers-and-ccs',
array(
@@ -118,18 +121,18 @@ final class DifferentialAddCommentView extends AphrontView {
'add_reviewers' => 1,
'resign' => 1,
),
'src' => '/typeahead/common/usersorprojects/',
'src' => $reviewer_source->getDatasourceURI(),
'value' => $this->reviewers,
'row' => 'add-reviewers',
'labels' => $add_reviewers_labels,
'placeholder' => pht('Type a user or project name...'),
'placeholder' => $reviewer_source->getPlaceholderText(),
),
'add-ccs-tokenizer' => array(
'actions' => array('add_ccs' => 1),
'src' => '/typeahead/common/mailable/',
'src' => $mailable_source->getDatasourceURI(),
'value' => $this->ccs,
'row' => 'add-ccs',
'placeholder' => pht('Type a user or mailing list...'),
'placeholder' => $mailable_source->getPlaceholderText(),
),
),
'select' => 'comment-action',

View File

@@ -269,7 +269,7 @@ final class ConduitAPI_diffusion_getcommits_Method
* Enhances the commits list with Maniphest information.
*/
private function addManiphestInformation(array $commits) {
$task_type = PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK;
$task_type = DiffusionCommitHasTaskEdgeType::EDGECONST;
$commit_phids = ipull($commits, 'commitPHID');

View File

@@ -420,7 +420,7 @@ final class DiffusionCommitController extends DiffusionController {
$edge_query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(array($commit_phid))
->withEdgeTypes(array(
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK,
DiffusionCommitHasTaskEdgeType::EDGECONST,
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT,
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV,
));
@@ -428,7 +428,7 @@ final class DiffusionCommitController extends DiffusionController {
$edges = $edge_query->execute();
$task_phids = array_keys(
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK]);
$edges[$commit_phid][DiffusionCommitHasTaskEdgeType::EDGECONST]);
$proj_phids = array_keys(
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT]);
$revision_phid = key(
@@ -771,21 +771,24 @@ final class DiffusionCommitController extends DiffusionController {
require_celerity_resource('phabricator-transaction-view-css');
$mailable_source = new PhabricatorMetaMTAMailableDatasource();
$auditor_source = new DiffusionAuditorDatasource();
Javelin::initBehavior(
'differential-add-reviewers-and-ccs',
array(
'dynamic' => array(
'add-auditors-tokenizer' => array(
'actions' => array('add_auditors' => 1),
'src' => '/typeahead/common/usersprojectsorpackages/',
'src' => $auditor_source->getDatasourceURI(),
'row' => 'add-auditors',
'placeholder' => pht('Type a user, project, or package name...'),
'placeholder' => $auditor_source->getPlaceholderText(),
),
'add-ccs-tokenizer' => array(
'actions' => array('add_ccs' => 1),
'src' => '/typeahead/common/mailable/',
'src' => $mailable_source->getDatasourceURI(),
'row' => 'add-ccs',
'placeholder' => pht('Type a user or mailing list...'),
'placeholder' => $mailable_source->getPlaceholderText(),
),
),
'select' => 'audit-action',

View File

@@ -34,8 +34,8 @@ final class DiffusionCommitEditController extends DiffusionController {
$new_proj_phids = array_values($proj_phids);
$rem_proj_phids = array_diff($current_proj_phids,
$new_proj_phids);
$editor = id(new PhabricatorEdgeEditor());
$editor->setActor($user);
$editor = id(new PhabricatorEdgeEditor());
foreach ($rem_proj_phids as $phid) {
$editor->removeEdge($commit_phid, $edge_type, $phid);
}

View File

@@ -112,7 +112,7 @@ final class DiffusionLintController extends DiffusionController {
->setMethod('GET')
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setLimit(1)
->setName('owner')
->setLabel(pht('Owner'))

View File

@@ -231,7 +231,7 @@ final class DiffusionRepositoryController extends DiffusionController {
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$repository->getPHID(),
PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
if ($project_phids) {
$this->loadHandles($project_phids);
$view->addProperty(

View File

@@ -73,7 +73,7 @@ final class DiffusionRepositoryEditBasicController
->setTransactionType($type_edge)
->setMetadataValue(
'edge:type',
PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT)
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST)
->setNewValue(
array(
'=' => array_fuse($v_projects),

View File

@@ -265,7 +265,7 @@ final class DiffusionRepositoryEditMainController
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$repository->getPHID(),
PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
if ($project_phids) {
$this->loadHandles($project_phids);
$project_text = $this->renderHandlesForPHIDs($project_phids);

View File

@@ -0,0 +1,103 @@
<?php
final class DiffusionCommitHasTaskEdgeType extends PhabricatorEdgeType {
const EDGECONST = 2;
public function shouldWriteInverseTransactions() {
// TODO: This should happen after T4896, but Diffusion does not support
// transactions yet.
return false;
}
public function getTransactionAddString(
$actor,
$add_count,
$add_edges) {
return pht(
'%s added %s task(s): %s.',
$actor,
$add_count,
$add_edges);
}
public function getTransactionRemoveString(
$actor,
$rem_count,
$rem_edges) {
return pht(
'%s removed %s task(s): %s.',
$actor,
$rem_count,
$rem_edges);
}
public function getTransactionEditString(
$actor,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges) {
return pht(
'%s edited %s task(s), added %s: %s; removed %s: %s.',
$actor,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges);
}
public function getFeedAddString(
$actor,
$object,
$add_count,
$add_edges) {
return pht(
'%s added %s task(s) to %s: %s.',
$actor,
$add_count,
$object,
$add_edges);
}
public function getFeedRemoveString(
$actor,
$object,
$rem_count,
$rem_edges) {
return pht(
'%s removed %s task(s) from %s: %s.',
$actor,
$rem_count,
$object,
$rem_edges);
}
public function getFeedEditString(
$actor,
$object,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges) {
return pht(
'%s edited %s task(s) for %s, added %s: %s; removed %s: %s.',
$actor,
$total_count,
$object,
$add_count,
$add_edges,
$rem_count,
$rem_edges);
}
}

View File

@@ -0,0 +1,22 @@
<?php
final class DiffusionAuditorDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getPlaceholderText() {
return pht('Type a user, project or package name...');
}
public function getDatasourceApplicationClass() {
return 'PhabricatorApplicationDiffusion';
}
public function getComponentDatasources() {
return array(
new PhabricatorPeopleDatasource(),
new PhabricatorProjectDatasource(),
new PhabricatorOwnersPackageDatasource(),
);
}
}

View File

@@ -25,8 +25,7 @@ final class DiffusionRepositoryDatasource
->setName($repo->getMonogram().' '.$repo->getName())
->setURI('/diffusion/'.$repo->getCallsign().'/')
->setPHID($repo->getPHID())
->setPriorityString($repo->getMonogram())
->setIcon('fa-database bluegrey');
->setPriorityString($repo->getMonogram());
}
return $results;

View File

@@ -0,0 +1,47 @@
<?php
final class DiffusionSymbolDatasource
extends PhabricatorTypeaheadDatasource {
public function getPlaceholderText() {
return pht('Type a symbol name...');
}
public function getDatasourceApplicationClass() {
return 'PhabricatorApplicationDiffusion';
}
public function loadResults() {
$viewer = $this->getViewer();
$raw_query = $this->getRawQuery();
$results = array();
if (strlen($raw_query)) {
$symbols = id(new DiffusionSymbolQuery())
->setNamePrefix($raw_query)
->setLimit(15)
->needArcanistProjects(true)
->needRepositories(true)
->needPaths(true)
->execute();
foreach ($symbols as $symbol) {
$lang = $symbol->getSymbolLanguage();
$name = $symbol->getSymbolName();
$type = $symbol->getSymbolType();
$proj = $symbol->getArcanistProject()->getName();
$results[] = id(new PhabricatorTypeaheadResult())
->setName($name)
->setURI($symbol->getURI())
->setPHID(md5($symbol->getURI())) // Just needs to be unique.
->setDisplayName($name)
->setDisplayType(strtoupper($lang).' '.ucwords($type).' ('.$proj.')')
->setPriorityType('symb');
}
}
return $results;
}
}

View File

@@ -4,10 +4,6 @@ final class DivinerPHIDTypeAtom extends PhabricatorPHIDType {
const TYPECONST = 'ATOM';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Atom');
}

View File

@@ -4,10 +4,6 @@ final class DivinerPHIDTypeBook extends PhabricatorPHIDType {
const TYPECONST = 'BOOK';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Book');
}

View File

@@ -235,7 +235,6 @@ final class DoorkeeperFeedWorkerAsana extends DoorkeeperFeedWorker {
);
id(new PhabricatorEdgeEditor())
->setActor($viewer)
->addEdge($src_phid, $etype_main, $dst_phid, $edge_options)
->save();
@@ -247,8 +246,7 @@ final class DoorkeeperFeedWorkerAsana extends DoorkeeperFeedWorker {
// Now, handle the subtasks.
$sub_editor = id(new PhabricatorEdgeEditor())
->setActor($viewer);
$sub_editor = new PhabricatorEdgeEditor();
// First, find all the object references in Phabricator for tasks that we
// know about and import their objects from Asana.

View File

@@ -4,10 +4,6 @@ final class DrydockPHIDTypeBlueprint extends PhabricatorPHIDType {
const TYPECONST = 'DRYB';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Blueprint');
}

View File

@@ -4,10 +4,6 @@ final class DrydockPHIDTypeLease extends PhabricatorPHIDType {
const TYPECONST = 'DRYL';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Drydock Lease');
}

View File

@@ -4,10 +4,6 @@ final class DrydockPHIDTypeResource extends PhabricatorPHIDType {
const TYPECONST = 'DRYR';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Drydock Resource');
}

View File

@@ -176,7 +176,7 @@ final class PhabricatorFeedStoryPublisher {
$data = array(
'key' => (string)$chrono_key,
'type' => 'notification',
'subscribers' => $this->subscribedPHIDs,
'subscribers' => array_values($this->subscribedPHIDs),
);
PhabricatorNotificationClient::tryToPostMessage($data);

View File

@@ -78,7 +78,7 @@ final class PhabricatorFeedSearchEngine
$form
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('users')
->setLabel(pht('Include Users'))
->setValue($user_handles))

View File

@@ -4,10 +4,6 @@ final class PhabricatorFilePHIDTypeFile extends PhabricatorPHIDType {
const TYPECONST = 'FILE';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('File');
}

View File

@@ -61,7 +61,7 @@ final class PhabricatorFileSearchEngine
$form
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))

View File

@@ -859,8 +859,6 @@ final class PhabricatorFile extends PhabricatorFileDAO
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
id(new PhabricatorEdgeEditor())
->setActor($actor)
->setSuppressEvents(true)
->addEdge($phid, $edge_type, $this->getPHID())
->save();

View File

@@ -4,10 +4,6 @@ final class HarbormasterPHIDTypeBuild extends PhabricatorPHIDType {
const TYPECONST = 'HMBD';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Build');
}

View File

@@ -4,10 +4,6 @@ final class HarbormasterPHIDTypeBuildItem extends PhabricatorPHIDType {
const TYPECONST = 'HMBI';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Build Item');
}

View File

@@ -4,10 +4,6 @@ final class HarbormasterPHIDTypeBuildLog extends PhabricatorPHIDType {
const TYPECONST = 'HMCL';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Build Log');
}

View File

@@ -4,10 +4,6 @@ final class HarbormasterPHIDTypeBuildPlan extends PhabricatorPHIDType {
const TYPECONST = 'HMCP';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Build Plan');
}

View File

@@ -4,10 +4,6 @@ final class HarbormasterPHIDTypeBuildStep extends PhabricatorPHIDType {
const TYPECONST = 'HMCS';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Build Step');
}

View File

@@ -4,10 +4,6 @@ final class HarbormasterPHIDTypeBuildTarget extends PhabricatorPHIDType {
const TYPECONST = 'HMBT';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Build Target');
}

View File

@@ -4,10 +4,6 @@ final class HarbormasterPHIDTypeBuildable extends PhabricatorPHIDType {
const TYPECONST = 'HMBB';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Buildable');
}

View File

@@ -103,7 +103,7 @@ final class HeraldPholioMockAdapter extends HeraldAdapter {
case self::FIELD_PROJECTS:
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getMock()->getPHID(),
PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
}
return parent::getHeraldField($field);

View File

@@ -596,14 +596,17 @@ final class HeraldRuleController extends HeraldController {
'arcanistprojects' => new DiffusionArcanistProjectDatasource(),
'package' => new PhabricatorOwnersPackageDatasource(),
'project' => new PhabricatorProjectDatasource(),
'user' => new PhabricatorPeopleDatasource(),
'email' => new PhabricatorMetaMTAMailableDatasource(),
'userorproject' => new PhabricatorProjectOrUserDatasource(),
);
$sources = mpull($sources, 'getDatasourceURI');
$sources += array(
'email' => '/typeahead/common/mailable/',
'user' => '/typeahead/common/accounts/',
'userorproject' => '/typeahead/common/accountsorprojects/',
);
foreach ($sources as $key => $source) {
$sources[$key] = array(
'uri' => $source->getDatasourceURI(),
'placeholder' => $source->getPlaceholderText(),
);
}
return array(
'source' => $sources,

View File

@@ -4,10 +4,6 @@ final class HeraldPHIDTypeRule extends PhabricatorPHIDType {
const TYPECONST = 'HRUL';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Herald Rule');
}

View File

@@ -71,7 +71,7 @@ final class HeraldRuleSearchEngine
$form
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))

View File

@@ -4,7 +4,7 @@ final class HeraldRule extends HeraldDAO
implements
PhabricatorFlaggableInterface,
PhabricatorPolicyInterface,
PhabricatorDestructableInterface {
PhabricatorDestructibleInterface {
const TABLE_RULE_APPLIED = 'herald_ruleapplied';
@@ -252,7 +252,7 @@ final class HeraldRule extends HeraldDAO
}
/* -( PhabricatorDestructableInterface )----------------------------------- */
/* -( PhabricatorDestructibleInterface )----------------------------------- */
public function destroyObjectPermanently(
PhabricatorDestructionEngine $engine) {

View File

@@ -130,7 +130,7 @@ final class LegalpadDocumentSignatureAddController extends LegalpadController {
->setLabel(pht('Exempt User'))
->setName('users')
->setLimit(1)
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue($user_handles)
->setError($e_user));
} else {

View File

@@ -105,7 +105,6 @@ final class LegalpadDocumentEditor
$type = PhabricatorEdgeConfig::TYPE_CONTRIBUTED_TO_OBJECT;
id(new PhabricatorEdgeEditor())
->addEdge($actor->getPHID(), $type, $object->getPHID())
->setActor($actor)
->save();
$type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_CONTRIBUTOR;

View File

@@ -4,10 +4,6 @@ final class PhabricatorLegalpadPHIDTypeDocument extends PhabricatorPHIDType {
const TYPECONST = 'LEGD';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Legalpad Document');
}

View File

@@ -95,13 +95,13 @@ final class LegalpadDocumentSearchEngine
->setDisabled(!$this->requireViewer()->getPHID()))
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('creators')
->setLabel(pht('Creators'))
->setValue(array_select_keys($handles, $creator_phids)))
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('contributors')
->setLabel(pht('Contributors'))
->setValue(array_select_keys($handles, $contributor_phids)));

View File

@@ -99,7 +99,7 @@ final class LegalpadDocumentSignatureSearchEngine
$form
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('signers')
->setLabel(pht('Signers'))
->setValue(array_select_keys($handles, $signer_phids)))

View File

@@ -5,7 +5,7 @@ final class LegalpadDocument extends LegalpadDAO
PhabricatorPolicyInterface,
PhabricatorSubscribableInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorDestructableInterface {
PhabricatorDestructibleInterface {
protected $title;
protected $contributorCount;
@@ -201,7 +201,7 @@ final class LegalpadDocument extends LegalpadDAO
}
/* -( PhabricatorDestructableInterface )----------------------------------- */
/* -( PhabricatorDestructibleInterface )----------------------------------- */
public function destroyObjectPermanently(

View File

@@ -23,7 +23,6 @@ final class LegalpadDocumentDatasource
foreach ($documents as $document) {
$results[] = id(new PhabricatorTypeaheadResult())
->setPHID($document->getPHID())
->setIcon('fa-file-text-o')
->setName($document->getMonogram().' '.$document->getTitle());
}

View File

@@ -4,10 +4,6 @@ final class PhabricatorMacroPHIDTypeMacro extends PhabricatorPHIDType {
const TYPECONST = 'MCRO';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Image Macro');
}

View File

@@ -93,7 +93,7 @@ final class PhabricatorMacroSearchEngine
->setValue($status))
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))

View File

@@ -25,8 +25,7 @@ final class PhabricatorMacroDatasource
foreach ($macros as $macro) {
$results[] = id(new PhabricatorTypeaheadResult())
->setPHID($macro->getPHID())
->setName($macro->getName())
->setIcon('fa-meh-o bluegrey');
->setName($macro->getName());
}
return $results;

View File

@@ -4,14 +4,14 @@ final class PhabricatorMailingListPHIDTypeList extends PhabricatorPHIDType {
const TYPECONST = 'MLST';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Mailing List');
}
public function getTypeIcon() {
return 'fa-envelope-o';
}
public function newObject() {
return new PhabricatorMetaMTAMailingList();
}

View File

@@ -1,7 +1,9 @@
<?php
final class PhabricatorMetaMTAMailingList extends PhabricatorMetaMTADAO
implements PhabricatorPolicyInterface {
implements
PhabricatorPolicyInterface,
PhabricatorDestructibleInterface {
protected $name;
protected $email;
@@ -40,4 +42,16 @@ final class PhabricatorMetaMTAMailingList extends PhabricatorMetaMTADAO
return null;
}
/* -( PhabricatorDestructibleInterface )----------------------------------- */
public function destroyObjectPermanently(
PhabricatorDestructionEngine $engine) {
$this->openTransaction();
$this->delete();
$this->saveTransaction();
}
}

View File

@@ -0,0 +1,33 @@
<?php
final class PhabricatorMailingListDatasource
extends PhabricatorTypeaheadDatasource {
public function getPlaceholderText() {
return pht('Type a mailing list name...');
}
public function getDatasourceApplicationClass() {
return 'PhabricatorApplicationMailingLists';
}
public function loadResults() {
$viewer = $this->getViewer();
$raw_query = $this->getRawQuery();
$results = array();
$lists = id(new PhabricatorMailingListQuery())
->setViewer($viewer)
->execute();
foreach ($lists as $list) {
$results[] = id(new PhabricatorTypeaheadResult())
->setName($list->getName())
->setURI($list->getURI())
->setPHID($list->getPHID());
}
return $results;
}
}

View File

@@ -116,18 +116,27 @@ abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod {
$changes[ManiphestTransaction::TYPE_CCS] = $ccs;
}
$transactions = array();
$project_phids = $request->getValue('projectPHIDs');
if ($project_phids !== null) {
$this->validatePHIDList(
$project_phids,
PhabricatorProjectPHIDTypeProject::TYPECONST,
'projectPHIDS');
$changes[ManiphestTransaction::TYPE_PROJECTS] = $project_phids;
$project_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$transactions[] = id(new ManiphestTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $project_type)
->setNewValue(
array(
'=' => array_fuse($project_phids),
));
}
$template = new ManiphestTransaction();
$transactions = array();
foreach ($changes as $type => $value) {
$transaction = clone $template;
$transaction->setTransactionType($type);

View File

@@ -62,6 +62,8 @@ final class ManiphestBatchEditController extends ManiphestController {
$template = $template->render();
$projects_source = new PhabricatorProjectDatasource();
$mailable_source = new PhabricatorMetaMTAMailableDatasource();
$owner_source = new PhabricatorTypeaheadOwnerDatasource();
require_celerity_resource('maniphest-batch-editor');
Javelin::initBehavior(
@@ -75,14 +77,13 @@ final class ManiphestBatchEditController extends ManiphestController {
'placeholder' => $projects_source->getPlaceholderText(),
),
'owner' => array(
'src' => '/typeahead/common/searchowner/',
'placeholder' => pht(
'Type a user name or "upforgrabs" to unassign...'),
'src' => $owner_source->getDatasourceURI(),
'placeholder' => $owner_source->getPlaceholderText(),
'limit' => 1,
),
'cc' => array(
'src' => '/typeahead/common/mailable/',
'placeholder' => pht('Type a user name...'),
'src' => $mailable_source->getDatasourceURI(),
'placeholder' => $mailable_source->getPlaceholderText(),
)
),
'input' => 'batch-form-actions',
@@ -324,6 +325,18 @@ final class ManiphestBatchEditController extends ManiphestController {
id(new ManiphestTransactionComment())
->setContent($value));
break;
case ManiphestTransaction::TYPE_PROJECTS:
// TODO: Clean this mess up.
$project_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$xaction
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $project_type)
->setNewValue(
array(
'=' => array_fuse($value),
));
break;
default:
$xaction->setNewValue($value);
break;

View File

@@ -84,9 +84,10 @@ final class ManiphestReportController extends ManiphestController {
$joins = qsprintf(
$conn,
'JOIN %T t ON x.objectPHID = t.phid
JOIN %T p ON p.taskPHID = t.phid AND p.projectPHID = %s',
JOIN %T p ON p.src = t.phid AND p.type = %d AND p.dst = %s',
id(new ManiphestTask())->getTableName(),
id(new ManiphestTaskProject())->getTableName(),
PhabricatorEdgeConfig::TABLE_NAME_EDGE,
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
$project_phid);
}
@@ -321,7 +322,7 @@ final class ManiphestReportController extends ManiphestController {
->setUser($user)
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/searchproject/')
->setDatasource(new PhabricatorProjectDatasource())
->setLabel(pht('Project'))
->setLimit(1)
->setName('set_project')

View File

@@ -52,10 +52,10 @@ final class ManiphestTaskDetailController extends ManiphestController {
->setViewer($user)
->readFieldsFromStorage($task);
$e_commit = PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT;
$e_commit = ManiphestTaskHasCommitEdgeType::EDGECONST;
$e_dep_on = PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK;
$e_dep_by = PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK;
$e_rev = PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV;
$e_rev = ManiphestTaskHasRevisionEdgeType::EDGECONST;
$e_mock = PhabricatorEdgeConfig::TYPE_TASK_HAS_MOCK;
$phid = $task->getPHID();
@@ -284,6 +284,8 @@ final class ManiphestTaskDetailController extends ManiphestController {
);
$projects_source = new PhabricatorProjectDatasource();
$users_source = new PhabricatorPeopleDatasource();
$mailable_source = new PhabricatorMetaMTAMailableDatasource();
$tokenizer_map = array(
ManiphestTransaction::TYPE_PROJECTS => array(
@@ -293,15 +295,15 @@ final class ManiphestTaskDetailController extends ManiphestController {
),
ManiphestTransaction::TYPE_OWNER => array(
'id' => 'assign-tokenizer',
'src' => '/typeahead/common/users/',
'src' => $users_source->getDatasourceURI(),
'value' => $default_claim,
'limit' => 1,
'placeholder' => pht('Type a user name...'),
'placeholder' => $users_source->getPlaceholderText(),
),
ManiphestTransaction::TYPE_CCS => array(
'id' => 'cc-tokenizer',
'src' => '/typeahead/common/mailable/',
'placeholder' => pht('Type a user or mailing list...'),
'src' => $mailable_source->getDatasourceURI(),
'placeholder' => $mailable_source->getPlaceholderText(),
),
);
@@ -591,20 +593,20 @@ final class ManiphestTaskDetailController extends ManiphestController {
$edge_types = array(
PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK
=> pht('Blocks'),
=> pht('Blocks'),
PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK
=> pht('Blocked By'),
PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV
=> pht('Differential Revisions'),
=> pht('Blocked By'),
ManiphestTaskHasRevisionEdgeType::EDGECONST
=> pht('Differential Revisions'),
PhabricatorEdgeConfig::TYPE_TASK_HAS_MOCK
=> pht('Pholio Mocks'),
=> pht('Pholio Mocks'),
);
$revisions_commits = array();
$handles = $this->getLoadedHandles();
$commit_phids = array_keys(
$edges[PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT]);
$edges[ManiphestTaskHasCommitEdgeType::EDGECONST]);
if ($commit_phids) {
$commit_drev = PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV;
$drev_edges = id(new PhabricatorEdgeQuery())
@@ -617,7 +619,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
$revision_phid = key($drev_edges[$phid][$commit_drev]);
$revision_handle = idx($handles, $revision_phid);
if ($revision_handle) {
$task_drev = PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV;
$task_drev = ManiphestTaskHasRevisionEdgeType::EDGECONST;
unset($edges[$task_drev][$revision_phid]);
$revisions_commits[$phid] = hsprintf(
'%s / %s',

View File

@@ -81,7 +81,6 @@ final class ManiphestTaskEditController extends ManiphestController {
->withNames($tokens)
->execute();
$default_projects = mpull($default_projects, 'getPHID');
}
$project_key = $request->getStr('project');
@@ -95,7 +94,7 @@ final class ManiphestTaskEditController extends ManiphestController {
}
if ($default_projects) {
$task->setProjectPHIDs($default_projects);
$task->attachProjectPHIDs($default_projects);
}
}
@@ -228,7 +227,7 @@ final class ManiphestTaskEditController extends ManiphestController {
$task->setPriority($request->getInt('priority'));
$task->setOwnerPHID($owner_phid);
$task->setCCPHIDs($request->getArr('cc'));
$task->setProjectPHIDs($request->getArr('projects'));
$task->attachProjectPHIDs($request->getArr('projects'));
} else {
if ($can_edit_priority) {
@@ -282,6 +281,17 @@ final class ManiphestTaskEditController extends ManiphestController {
if ($type == ManiphestTransaction::TYPE_PROJECT_COLUMN) {
$transaction->setNewValue($value['new']);
$transaction->setOldValue($value['old']);
} else if ($type == ManiphestTransaction::TYPE_PROJECTS) {
// TODO: Gross.
$project_type =
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$transaction
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $project_type)
->setNewValue(
array(
'=' => array_fuse($value),
));
} else {
$transaction->setNewValue($value);
}
@@ -343,7 +353,6 @@ final class ManiphestTaskEditController extends ManiphestController {
if ($parent_task) {
id(new PhabricatorEdgeEditor())
->setActor($user)
->addEdge(
$parent_task->getPHID(),
PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK,
@@ -452,7 +461,7 @@ final class ManiphestTaskEditController extends ManiphestController {
->executeOne();
if ($template_task) {
$task->setCCPHIDs($template_task->getCCPHIDs());
$task->setProjectPHIDs($template_task->getProjectPHIDs());
$task->attachProjectPHIDs($template_task->getProjectPHIDs());
$task->setOwnerPHID($template_task->getOwnerPHID());
$task->setPriority($template_task->getPriority());
$task->setViewPolicy($template_task->getViewPolicy());
@@ -663,7 +672,7 @@ final class ManiphestTaskEditController extends ManiphestController {
->setName('assigned_to')
->setValue($assigned_value)
->setUser($user)
->setDatasource('/typeahead/common/users/')
->setDatasource(new PhabricatorPeopleDatasource())
->setLimit(1));
}
@@ -681,7 +690,7 @@ final class ManiphestTaskEditController extends ManiphestController {
->setName('cc')
->setValue($cc_value)
->setUser($user)
->setDatasource('/typeahead/common/mailable/')
->setDatasource(new PhabricatorMetaMTAMailableDatasource())
->setHidden($creating_for_project));
if ($can_edit_priority) {
@@ -735,7 +744,7 @@ final class ManiphestTaskEditController extends ManiphestController {
->setValue($projects_value)
->setID($project_tokenizer_id)
->setCaption($projects_caption)
->setDatasource('/typeahead/common/projects/'));
->setDatasource(new PhabricatorMetaMTAMailableDatasource()));
}
foreach ($aux_fields as $aux_field) {

View File

@@ -84,14 +84,19 @@ final class ManiphestTransactionPreviewController extends ManiphestController {
$value = array();
}
$phids = $value;
foreach ($task->getProjectPHIDs() as $project_phid) {
$phids = array();
$value = array_fuse($value);
foreach ($value as $project_phid) {
$phids[] = $project_phid;
$value[] = $project_phid;
$value[$project_phid] = array('dst' => $project_phid);
}
$transaction->setOldValue($task->getProjectPHIDs());
$transaction->setNewValue($value);
$project_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$transaction
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $project_type)
->setOldValue(array())
->setNewValue($value);
break;
case ManiphestTransaction::TYPE_STATUS:
$phids = array();

View File

@@ -53,7 +53,16 @@ final class ManiphestTransactionSaveController extends ManiphestController {
$projects = array_merge($projects, $task->getProjectPHIDs());
$projects = array_filter($projects);
$projects = array_unique($projects);
$transaction->setNewValue($projects);
// TODO: Bleh.
$project_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$transaction
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $project_type)
->setNewValue(
array(
'+' => array_fuse($projects),
));
break;
case ManiphestTransaction::TYPE_CCS:
// Accumulate the new explicit CCs into the array that we'll add in

View File

@@ -0,0 +1,103 @@
<?php
final class ManiphestTaskHasCommitEdgeType extends PhabricatorEdgeType {
const EDGECONST = 1;
public function shouldWriteInverseTransactions() {
// TODO: This should happen after T4896, but Diffusion does not support
// transactions yet.
return false;
}
public function getTransactionAddString(
$actor,
$add_count,
$add_edges) {
return pht(
'%s added %s commit(s): %s.',
$actor,
$add_count,
$add_edges);
}
public function getTransactionRemoveString(
$actor,
$rem_count,
$rem_edges) {
return pht(
'%s removed %s commit(s): %s.',
$actor,
$rem_count,
$rem_edges);
}
public function getTransactionEditString(
$actor,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges) {
return pht(
'%s edited %s commit(s), added %s: %s; removed %s: %s.',
$actor,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges);
}
public function getFeedAddString(
$actor,
$object,
$add_count,
$add_edges) {
return pht(
'%s added %s commit(s) to %s: %s.',
$actor,
$add_count,
$object,
$add_edges);
}
public function getFeedRemoveString(
$actor,
$object,
$rem_count,
$rem_edges) {
return pht(
'%s removed %s commit(s) from %s: %s.',
$actor,
$rem_count,
$object,
$rem_edges);
}
public function getFeedEditString(
$actor,
$object,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges) {
return pht(
'%s edited %s commit(s) for %s, added %s: %s; removed %s: %s.',
$actor,
$total_count,
$object,
$add_count,
$add_edges,
$rem_count,
$rem_edges);
}
}

View File

@@ -0,0 +1,105 @@
<?php
final class ManiphestTaskHasRevisionEdgeType extends PhabricatorEdgeType {
const EDGECONST = 11;
public function getInverseEdgeConstant() {
return DifferentialRevisionHasTaskEdgeType::EDGECONST;
}
public function shouldWriteInverseTransactions() {
return true;
}
public function getTransactionAddString(
$actor,
$add_count,
$add_edges) {
return pht(
'%s added %s revision(s): %s.',
$actor,
$add_count,
$add_edges);
}
public function getTransactionRemoveString(
$actor,
$rem_count,
$rem_edges) {
return pht(
'%s removed %s revision(s): %s.',
$actor,
$rem_count,
$rem_edges);
}
public function getTransactionEditString(
$actor,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges) {
return pht(
'%s edited %s revision(s), added %s: %s; removed %s: %s.',
$actor,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges);
}
public function getFeedAddString(
$actor,
$object,
$add_count,
$add_edges) {
return pht(
'%s added %s revision(s) to %s: %s.',
$actor,
$add_count,
$object,
$add_edges);
}
public function getFeedRemoveString(
$actor,
$object,
$rem_count,
$rem_edges) {
return pht(
'%s removed %s revision(s) from %s: %s.',
$actor,
$rem_count,
$object,
$rem_edges);
}
public function getFeedEditString(
$actor,
$object,
$total_count,
$add_count,
$add_edges,
$rem_count,
$rem_edges) {
return pht(
'%s edited %s revision(s) for %s, added %s: %s; removed %s: %s.',
$actor,
$total_count,
$object,
$add_count,
$add_edges,
$rem_count,
$rem_edges);
}
}

View File

@@ -9,14 +9,13 @@ final class ManiphestTransactionEditor
$types = parent::getTransactionTypes();
$types[] = PhabricatorTransactions::TYPE_COMMENT;
$types[] = PhabricatorTransactions::TYPE_EDGE;
$types[] = ManiphestTransaction::TYPE_PRIORITY;
$types[] = ManiphestTransaction::TYPE_STATUS;
$types[] = ManiphestTransaction::TYPE_TITLE;
$types[] = ManiphestTransaction::TYPE_DESCRIPTION;
$types[] = ManiphestTransaction::TYPE_OWNER;
$types[] = ManiphestTransaction::TYPE_CCS;
$types[] = ManiphestTransaction::TYPE_PROJECTS;
$types[] = ManiphestTransaction::TYPE_EDGE;
$types[] = ManiphestTransaction::TYPE_SUBPRIORITY;
$types[] = ManiphestTransaction::TYPE_PROJECT_COLUMN;
$types[] = ManiphestTransaction::TYPE_UNBLOCK;
@@ -55,9 +54,6 @@ final class ManiphestTransactionEditor
return nonempty($object->getOwnerPHID(), null);
case ManiphestTransaction::TYPE_CCS:
return array_values(array_unique($object->getCCPHIDs()));
case ManiphestTransaction::TYPE_PROJECTS:
return array_values(array_unique($object->getProjectPHIDs()));
case ManiphestTransaction::TYPE_EDGE:
case ManiphestTransaction::TYPE_PROJECT_COLUMN:
// These are pre-populated.
return $xaction->getOldValue();
@@ -75,14 +71,12 @@ final class ManiphestTransactionEditor
case ManiphestTransaction::TYPE_PRIORITY:
return (int)$xaction->getNewValue();
case ManiphestTransaction::TYPE_CCS:
case ManiphestTransaction::TYPE_PROJECTS:
return array_values(array_unique($xaction->getNewValue()));
case ManiphestTransaction::TYPE_OWNER:
return nonempty($xaction->getNewValue(), null);
case ManiphestTransaction::TYPE_STATUS:
case ManiphestTransaction::TYPE_TITLE:
case ManiphestTransaction::TYPE_DESCRIPTION:
case ManiphestTransaction::TYPE_EDGE:
case ManiphestTransaction::TYPE_SUBPRIORITY:
case ManiphestTransaction::TYPE_PROJECT_COLUMN:
case ManiphestTransaction::TYPE_UNBLOCK:
@@ -99,7 +93,6 @@ final class ManiphestTransactionEditor
$new = $xaction->getNewValue();
switch ($xaction->getTransactionType()) {
case ManiphestTransaction::TYPE_PROJECTS:
case ManiphestTransaction::TYPE_CCS:
sort($old);
sort($new);
@@ -151,12 +144,6 @@ final class ManiphestTransactionEditor
return $object->setOwnerPHID($phid);
case ManiphestTransaction::TYPE_CCS:
return $object->setCCPHIDs($xaction->getNewValue());
case ManiphestTransaction::TYPE_PROJECTS:
return $object->setProjectPHIDs($xaction->getNewValue());
case ManiphestTransaction::TYPE_EDGE:
// These are a weird, funky mess and are already being applied by the
// time we reach this.
return;
case ManiphestTransaction::TYPE_SUBPRIORITY:
$data = $xaction->getNewValue();
$new_sub = $this->getNextSubpriority(
@@ -229,10 +216,7 @@ final class ManiphestTransactionEditor
return;
}
$editor = id(new PhabricatorEdgeEditor())
->setActor($this->getActor())
->setSuppressEvents(true);
$editor = new PhabricatorEdgeEditor();
foreach ($add as $phid) {
$editor->addEdge($src, $edge_type, $phid);
}
@@ -415,19 +399,6 @@ final class ManiphestTransactionEditor
$existing_cc = $object->getCCPHIDs();
$new_cc = array_unique(array_merge($cc_phids, $existing_cc));
$object->setCCPHIDs($new_cc);
$save_again = true;
}
$project_phids = $adapter->getProjectPHIDs();
if ($project_phids) {
$existing_projects = $object->getProjectPHIDs();
$new_projects = array_unique(
array_merge($project_phids, $existing_projects));
$object->setProjectPHIDs($new_projects);
$save_again = true;
}
if ($save_again) {
$object->save();
}
@@ -442,6 +413,18 @@ final class ManiphestTransactionEditor
->setNewValue($assign_phid);
}
$project_phids = $adapter->getProjectPHIDs();
if ($project_phids) {
$project_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$xactions[] = id(new ManiphestTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $project_type)
->setNewValue(
array(
'+' => array_fuse($project_phids),
));
}
return $xactions;
}
@@ -456,8 +439,6 @@ final class ManiphestTransactionEditor
ManiphestCapabilityEditPriority::CAPABILITY,
ManiphestTransaction::TYPE_STATUS =>
ManiphestCapabilityEditStatus::CAPABILITY,
ManiphestTransaction::TYPE_PROJECTS =>
ManiphestCapabilityEditProjects::CAPABILITY,
ManiphestTransaction::TYPE_OWNER =>
ManiphestCapabilityEditAssign::CAPABILITY,
PhabricatorTransactions::TYPE_EDIT_POLICY =>
@@ -466,8 +447,19 @@ final class ManiphestTransactionEditor
ManiphestCapabilityEditPolicies::CAPABILITY,
);
$transaction_type = $xaction->getTransactionType();
$app_capability = idx($app_capability_map, $transaction_type);
$app_capability = null;
if ($transaction_type == PhabricatorTransactions::TYPE_EDGE) {
switch ($xaction->getMetadataValue('edge:type')) {
case PhabricatorProjectObjectHasProjectEdgeType::EDGECONST:
$app_capability = ManiphestCapabilityEditProjects::CAPABILITY;
break;
}
} else {
$app_capability = idx($app_capability_map, $transaction_type);
}
if ($app_capability) {
$app = id(new PhabricatorApplicationQuery())

Some files were not shown because too many files have changed in this diff Show More