mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 08:12:40 +01:00
(stable) Promote 2016 Week 14
This commit is contained in:
commit
0b4be847a1
247 changed files with 2920 additions and 1569 deletions
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
return array(
|
||||
'names' => array(
|
||||
'core.pkg.css' => '9acdee84',
|
||||
'core.pkg.js' => '7d8faf57',
|
||||
'core.pkg.css' => '2d0339fc',
|
||||
'core.pkg.js' => 'e5484f37',
|
||||
'darkconsole.pkg.js' => 'e7393ebb',
|
||||
'differential.pkg.css' => '7ba78475',
|
||||
'differential.pkg.js' => 'd0cd0df6',
|
||||
|
@ -94,7 +94,7 @@ return array(
|
|||
'rsrc/css/application/policy/policy.css' => '957ea14c',
|
||||
'rsrc/css/application/ponder/ponder-view.css' => 'fbd45f96',
|
||||
'rsrc/css/application/project/project-card-view.css' => '9418c97d',
|
||||
'rsrc/css/application/project/project-view.css' => '9ce99f21',
|
||||
'rsrc/css/application/project/project-view.css' => 'cbaa10a1',
|
||||
'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733',
|
||||
'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5',
|
||||
'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd',
|
||||
|
@ -104,7 +104,7 @@ return array(
|
|||
'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
|
||||
'rsrc/css/application/uiexample/example.css' => '528b19de',
|
||||
'rsrc/css/core/core.css' => 'd0801452',
|
||||
'rsrc/css/core/remarkup.css' => 'fc228f08',
|
||||
'rsrc/css/core/remarkup.css' => '2c9ed46f',
|
||||
'rsrc/css/core/syntax.css' => '9fd11da8',
|
||||
'rsrc/css/core/z-index.css' => '5b6fcf3f',
|
||||
'rsrc/css/diviner/diviner-shared.css' => 'aa3656aa',
|
||||
|
@ -133,7 +133,7 @@ return array(
|
|||
'rsrc/css/phui/phui-document.css' => '9c71d2bf',
|
||||
'rsrc/css/phui/phui-feed-story.css' => '04aec08f',
|
||||
'rsrc/css/phui/phui-fontkit.css' => '9cda225e',
|
||||
'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e',
|
||||
'rsrc/css/phui/phui-form-view.css' => '6a51768e',
|
||||
'rsrc/css/phui/phui-form.css' => 'aac1d51d',
|
||||
'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f',
|
||||
'rsrc/css/phui/phui-header-view.css' => '230254d3',
|
||||
|
@ -156,7 +156,7 @@ return array(
|
|||
'rsrc/css/phui/phui-status.css' => '37309046',
|
||||
'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2',
|
||||
'rsrc/css/phui/phui-timeline-view.css' => '6e342216',
|
||||
'rsrc/css/phui/phui-two-column-view.css' => '9c43b599',
|
||||
'rsrc/css/phui/phui-two-column-view.css' => '691fec04',
|
||||
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7',
|
||||
'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647',
|
||||
'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96',
|
||||
|
@ -244,7 +244,7 @@ return array(
|
|||
'rsrc/externals/javelin/lib/URI.js' => 'c989ade3',
|
||||
'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8',
|
||||
'rsrc/externals/javelin/lib/WebSocket.js' => 'e292eaf4',
|
||||
'rsrc/externals/javelin/lib/Workflow.js' => '5b2e3e2b',
|
||||
'rsrc/externals/javelin/lib/Workflow.js' => '28cfbdd0',
|
||||
'rsrc/externals/javelin/lib/__tests__/Cookie.js' => '5ed109e8',
|
||||
'rsrc/externals/javelin/lib/__tests__/DOM.js' => 'c984504b',
|
||||
'rsrc/externals/javelin/lib/__tests__/JSON.js' => '837a7d68',
|
||||
|
@ -433,7 +433,7 @@ return array(
|
|||
'rsrc/js/application/search/behavior-reorder-profile-menu-items.js' => 'e2e0a072',
|
||||
'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08',
|
||||
'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f',
|
||||
'rsrc/js/application/transactions/behavior-comment-actions.js' => '1f2fcaf8',
|
||||
'rsrc/js/application/transactions/behavior-comment-actions.js' => '06460e71',
|
||||
'rsrc/js/application/transactions/behavior-reorder-configs.js' => 'd7a74243',
|
||||
'rsrc/js/application/transactions/behavior-reorder-fields.js' => 'b59e1e96',
|
||||
'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6',
|
||||
|
@ -580,7 +580,7 @@ return array(
|
|||
'javelin-behavior-audit-preview' => 'd835b03a',
|
||||
'javelin-behavior-bulk-job-reload' => 'edf8a145',
|
||||
'javelin-behavior-choose-control' => '327a00d1',
|
||||
'javelin-behavior-comment-actions' => '1f2fcaf8',
|
||||
'javelin-behavior-comment-actions' => '06460e71',
|
||||
'javelin-behavior-config-reorder-fields' => 'b6993408',
|
||||
'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a',
|
||||
'javelin-behavior-conpherence-menu' => '1d45c74d',
|
||||
|
@ -734,7 +734,7 @@ return array(
|
|||
'javelin-workboard-card' => 'c587b80f',
|
||||
'javelin-workboard-column' => 'bae58312',
|
||||
'javelin-workboard-controller' => '55baf5ed',
|
||||
'javelin-workflow' => '5b2e3e2b',
|
||||
'javelin-workflow' => '28cfbdd0',
|
||||
'lightbox-attachment-css' => '7acac05d',
|
||||
'maniphest-batch-editor' => 'b0f0b6d5',
|
||||
'maniphest-report-css' => '9b9580b7',
|
||||
|
@ -771,7 +771,7 @@ return array(
|
|||
'phabricator-object-selector-css' => '85ee8ce6',
|
||||
'phabricator-phtize' => 'd254d646',
|
||||
'phabricator-prefab' => 'e67df814',
|
||||
'phabricator-remarkup-css' => 'fc228f08',
|
||||
'phabricator-remarkup-css' => '2c9ed46f',
|
||||
'phabricator-search-results-css' => '7dea472c',
|
||||
'phabricator-shaped-request' => '7cbe244b',
|
||||
'phabricator-side-menu-view-css' => '3a3d9f41',
|
||||
|
@ -821,7 +821,7 @@ return array(
|
|||
'phui-font-icon-base-css' => '6449bce8',
|
||||
'phui-fontkit-css' => '9cda225e',
|
||||
'phui-form-css' => 'aac1d51d',
|
||||
'phui-form-view-css' => '4a1a0f5e',
|
||||
'phui-form-view-css' => '6a51768e',
|
||||
'phui-head-thing-view-css' => 'fd311e5f',
|
||||
'phui-header-view-css' => '230254d3',
|
||||
'phui-hovercard' => '1bd28176',
|
||||
|
@ -846,7 +846,7 @@ return array(
|
|||
'phui-tag-view-css' => '6bbd83e2',
|
||||
'phui-theme-css' => '027ba77e',
|
||||
'phui-timeline-view-css' => '6e342216',
|
||||
'phui-two-column-view-css' => '9c43b599',
|
||||
'phui-two-column-view-css' => '691fec04',
|
||||
'phui-workboard-color-css' => 'ac6fe6a7',
|
||||
'phui-workboard-view-css' => 'e6d89647',
|
||||
'phui-workcard-view-css' => '3646fb96',
|
||||
|
@ -862,7 +862,7 @@ return array(
|
|||
'policy-transaction-detail-css' => '82100a43',
|
||||
'ponder-view-css' => 'fbd45f96',
|
||||
'project-card-view-css' => '9418c97d',
|
||||
'project-view-css' => '9ce99f21',
|
||||
'project-view-css' => 'cbaa10a1',
|
||||
'releeph-core' => '9b3c5733',
|
||||
'releeph-preview-branch' => 'b7a6f4a5',
|
||||
'releeph-request-differential-create-dialog' => '8d8b92cd',
|
||||
|
@ -920,6 +920,15 @@ return array(
|
|||
'aphront-typeahead-control-css',
|
||||
'phui-tag-view-css',
|
||||
),
|
||||
'06460e71' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-stratcom',
|
||||
'javelin-workflow',
|
||||
'javelin-dom',
|
||||
'phuix-form-control-view',
|
||||
'phuix-icon-view',
|
||||
'javelin-behavior-phabricator-gesture',
|
||||
),
|
||||
'065227cc' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
|
@ -1025,15 +1034,6 @@ return array(
|
|||
'javelin-dom',
|
||||
'javelin-reactor-dom',
|
||||
),
|
||||
'1f2fcaf8' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-stratcom',
|
||||
'javelin-workflow',
|
||||
'javelin-dom',
|
||||
'phuix-form-control-view',
|
||||
'phuix-icon-view',
|
||||
'javelin-behavior-phabricator-gesture',
|
||||
),
|
||||
'21ba5861' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
|
@ -1059,6 +1059,17 @@ return array(
|
|||
'phabricator-drag-and-drop-file-upload',
|
||||
'phabricator-draggable-list',
|
||||
),
|
||||
'28cfbdd0' => array(
|
||||
'javelin-stratcom',
|
||||
'javelin-request',
|
||||
'javelin-dom',
|
||||
'javelin-vector',
|
||||
'javelin-install',
|
||||
'javelin-util',
|
||||
'javelin-mask',
|
||||
'javelin-uri',
|
||||
'javelin-routable',
|
||||
),
|
||||
'2926fff2' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
|
@ -1312,17 +1323,6 @@ return array(
|
|||
'javelin-vector',
|
||||
'javelin-magical-init',
|
||||
),
|
||||
'5b2e3e2b' => array(
|
||||
'javelin-stratcom',
|
||||
'javelin-request',
|
||||
'javelin-dom',
|
||||
'javelin-vector',
|
||||
'javelin-install',
|
||||
'javelin-util',
|
||||
'javelin-mask',
|
||||
'javelin-uri',
|
||||
'javelin-routable',
|
||||
),
|
||||
'5c54cbf3' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-stratcom',
|
||||
|
|
|
@ -4,8 +4,7 @@ $conn_w = id(new DifferentialRevision())->establishConnection('w');
|
|||
$rows = new LiskRawMigrationIterator($conn_w, 'differential_comment');
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize();
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
|
||||
|
||||
echo pht('Migrating Differential comment text to modern storage...')."\n";
|
||||
foreach ($rows as $row) {
|
||||
|
|
|
@ -4,8 +4,7 @@ $conn_w = id(new DifferentialRevision())->establishConnection('w');
|
|||
$rows = new LiskRawMigrationIterator($conn_w, 'differential_comment');
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize();
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
|
||||
|
||||
echo pht('Migrating Differential comments to modern storage...')."\n";
|
||||
foreach ($rows as $row) {
|
||||
|
|
|
@ -10,8 +10,7 @@ $dst_table = 'audit_transaction_comment';
|
|||
echo pht('Migrating Audit inline comments to new format...')."\n";
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize();
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
|
||||
|
||||
$rows = new LiskRawMigrationIterator($conn_w, $src_table);
|
||||
foreach ($rows as $row) {
|
||||
|
|
|
@ -4,8 +4,7 @@ $conn_w = id(new PhabricatorAuditTransaction())->establishConnection('w');
|
|||
$rows = new LiskRawMigrationIterator($conn_w, 'audit_comment');
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize();
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
|
||||
|
||||
echo pht('Migrating Audit comment text to modern storage...')."\n";
|
||||
foreach ($rows as $row) {
|
||||
|
|
|
@ -4,8 +4,7 @@ $conn_w = id(new PhabricatorAuditTransaction())->establishConnection('w');
|
|||
$rows = new LiskRawMigrationIterator($conn_w, 'audit_comment');
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize();
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
|
||||
|
||||
echo pht('Migrating Audit comments to modern storage...')."\n";
|
||||
foreach ($rows as $row) {
|
||||
|
|
10
resources/sql/autopatches/20160102.badges.award.sql
Normal file
10
resources/sql/autopatches/20160102.badges.award.sql
Normal file
|
@ -0,0 +1,10 @@
|
|||
CREATE TABLE {$NAMESPACE}_badges.badges_award (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
badgePHID VARBINARY(64) NOT NULL,
|
||||
recipientPHID VARBINARY(64) NOT NULL,
|
||||
awarderPHID varbinary(64) NOT NULL,
|
||||
dateCreated INT UNSIGNED NOT NULL,
|
||||
dateModified INT UNSIGNED NOT NULL,
|
||||
UNIQUE KEY `key_badge` (badgePHID, recipientPHID),
|
||||
KEY `key_recipient` (recipientPHID)
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
6
resources/sql/autopatches/20160323.badgemigrate.sql
Normal file
6
resources/sql/autopatches/20160323.badgemigrate.sql
Normal file
|
@ -0,0 +1,6 @@
|
|||
/* PhabricatorBadgeHasRecipientEdgeType::TYPECONST = 59 */
|
||||
|
||||
INSERT IGNORE INTO {$NAMESPACE}_badges.badges_award
|
||||
(badgePHID, recipientPHID, awarderPHID, dateCreated, dateModified)
|
||||
SELECT src, dst, 'PHID-VOID-00000000000000000000', dateCreated, dateCreated
|
||||
FROM {$NAMESPACE}_badges.edge WHERE type = 59;
|
|
@ -0,0 +1 @@
|
|||
DROP TABLE IF EXISTS {$NAMESPACE}_nuance.nuance_requestor;
|
|
@ -0,0 +1 @@
|
|||
DROP TABLE IF EXISTS {$NAMESPACE}_nuance.nuance_requestorsource;
|
|
@ -0,0 +1 @@
|
|||
DROP TABLE IF EXISTS {$NAMESPACE}_nuance.nuance_requestortransaction;
|
|
@ -0,0 +1 @@
|
|||
DROP TABLE IF EXISTS {$NAMESPACE}_nuance.nuance_requestortransaction_comment;
|
32
resources/sql/autopatches/20160330.badges.migratequality.sql
Normal file
32
resources/sql/autopatches/20160330.badges.migratequality.sql
Normal file
|
@ -0,0 +1,32 @@
|
|||
/* Change quality from color to int */
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_badge
|
||||
SET quality = 140
|
||||
WHERE quality = 'grey';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_badge
|
||||
SET quality = 120
|
||||
WHERE quality = 'white';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_badge
|
||||
SET quality = 100
|
||||
WHERE quality = 'green';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_badge
|
||||
SET quality = 80
|
||||
WHERE quality = 'blue';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_badge
|
||||
SET quality = 60
|
||||
WHERE quality = 'indigo';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_badge
|
||||
SET quality = 40
|
||||
WHERE quality = 'orange';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_badge
|
||||
SET quality = 20
|
||||
WHERE quality = 'yellow';
|
||||
|
||||
ALTER TABLE {$NAMESPACE}_badges.badges_badge
|
||||
MODIFY quality INT UNSIGNED NOT NULL;
|
|
@ -0,0 +1,59 @@
|
|||
/* Migrate old badge quality transactions */
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET oldValue = 140
|
||||
WHERE oldValue = '"grey"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET oldValue = 120
|
||||
WHERE oldValue = '"white"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET oldValue = 100
|
||||
WHERE oldValue = '"green"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET oldValue = 80
|
||||
WHERE oldValue = '"blue"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET oldValue = 60
|
||||
WHERE oldValue = '"indigo"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET oldValue = 40
|
||||
WHERE oldValue = '"orange"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET oldValue = 20
|
||||
WHERE oldValue = '"yellow"' AND transactionType = 'badges:quality';
|
||||
|
||||
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET newValue = 140
|
||||
WHERE newValue = '"grey"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET newValue = 120
|
||||
WHERE newValue = '"white"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET newValue = 100
|
||||
WHERE newValue = '"green"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET newValue = 80
|
||||
WHERE newValue = '"blue"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET newValue = 60
|
||||
WHERE newValue = '"indigo"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET newValue = 40
|
||||
WHERE newValue = '"orange"' AND transactionType = 'badges:quality';
|
||||
|
||||
UPDATE {$NAMESPACE}_badges.badges_transaction
|
||||
SET newValue = 20
|
||||
WHERE newValue = '"yellow"' AND transactionType = 'badges:quality';
|
18
resources/sql/autopatches/20160331.fund.comments.1.sql
Normal file
18
resources/sql/autopatches/20160331.fund.comments.1.sql
Normal file
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE {$NAMESPACE}_fund.fund_initiativetransaction_comment (
|
||||
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
phid VARCHAR(64) NOT NULL,
|
||||
transactionPHID VARCHAR(64),
|
||||
authorPHID VARCHAR(64) NOT NULL,
|
||||
viewPolicy VARCHAR(64) NOT NULL,
|
||||
editPolicy VARCHAR(64) NOT NULL,
|
||||
commentVersion INT UNSIGNED NOT NULL,
|
||||
content LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT},
|
||||
contentSource LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT},
|
||||
isDeleted BOOL NOT NULL,
|
||||
dateCreated INT UNSIGNED NOT NULL,
|
||||
dateModified INT UNSIGNED NOT NULL,
|
||||
|
||||
UNIQUE KEY `key_phid` (phid),
|
||||
UNIQUE KEY `key_version` (transactionPHID, commentVersion)
|
||||
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
|
@ -46,9 +46,8 @@ foreach ($comments as $comment) {
|
|||
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST,
|
||||
PhabricatorSlowvotePollPHIDType::TYPECONST);
|
||||
|
||||
$source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize();
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
|
||||
|
||||
queryfx(
|
||||
$conn_w,
|
||||
|
|
|
@ -49,8 +49,7 @@ foreach ($rows as $row) {
|
|||
1,
|
||||
$row['content'],
|
||||
PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize(),
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize(),
|
||||
0,
|
||||
$row['dateCreated'],
|
||||
$row['dateModified']);
|
||||
|
@ -73,8 +72,7 @@ foreach ($rows as $row) {
|
|||
'null',
|
||||
'null',
|
||||
PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize(),
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize(),
|
||||
'[]',
|
||||
$row['dateCreated'],
|
||||
$row['dateModified']);
|
||||
|
|
|
@ -34,8 +34,7 @@ foreach ($rows as $row) {
|
|||
'null',
|
||||
$row['filePHID'],
|
||||
PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize(),
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize(),
|
||||
'[]',
|
||||
$row['dateCreated'],
|
||||
$row['dateCreated'],
|
||||
|
|
|
@ -10,8 +10,7 @@ $dst_table = 'differential_transaction_comment';
|
|||
echo pht('Migrating Differential inline comments to new format...')."\n";
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize();
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
|
||||
|
||||
$rows = new LiskRawMigrationIterator($conn_w, $src_table);
|
||||
foreach ($rows as $row) {
|
||||
|
|
|
@ -10,8 +10,7 @@ $dst_table = 'project_transaction';
|
|||
echo pht('Migrating Project transactions to new format...')."\n";
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array())->serialize();
|
||||
PhabricatorOldWorldContentSource::SOURCECONST)->serialize();
|
||||
|
||||
$rows = new LiskRawMigrationIterator($conn_w, $src_table);
|
||||
foreach ($rows as $row) {
|
||||
|
|
|
@ -843,12 +843,14 @@ phutil_register_library_map(array(
|
|||
'DoorkeeperBridgeAsana' => 'applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php',
|
||||
'DoorkeeperBridgeGitHub' => 'applications/doorkeeper/bridge/DoorkeeperBridgeGitHub.php',
|
||||
'DoorkeeperBridgeGitHubIssue' => 'applications/doorkeeper/bridge/DoorkeeperBridgeGitHubIssue.php',
|
||||
'DoorkeeperBridgeGitHubUser' => 'applications/doorkeeper/bridge/DoorkeeperBridgeGitHubUser.php',
|
||||
'DoorkeeperBridgeJIRA' => 'applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php',
|
||||
'DoorkeeperBridgeJIRATestCase' => 'applications/doorkeeper/bridge/__tests__/DoorkeeperBridgeJIRATestCase.php',
|
||||
'DoorkeeperBridgedObjectCurtainExtension' => 'applications/doorkeeper/engineextension/DoorkeeperBridgedObjectCurtainExtension.php',
|
||||
'DoorkeeperBridgedObjectInterface' => 'applications/doorkeeper/bridge/DoorkeeperBridgedObjectInterface.php',
|
||||
'DoorkeeperDAO' => 'applications/doorkeeper/storage/DoorkeeperDAO.php',
|
||||
'DoorkeeperExternalObject' => 'applications/doorkeeper/storage/DoorkeeperExternalObject.php',
|
||||
'DoorkeeperExternalObjectPHIDType' => 'applications/doorkeeper/phid/DoorkeeperExternalObjectPHIDType.php',
|
||||
'DoorkeeperExternalObjectQuery' => 'applications/doorkeeper/query/DoorkeeperExternalObjectQuery.php',
|
||||
'DoorkeeperFeedStoryPublisher' => 'applications/doorkeeper/engine/DoorkeeperFeedStoryPublisher.php',
|
||||
'DoorkeeperFeedWorker' => 'applications/doorkeeper/worker/DoorkeeperFeedWorker.php',
|
||||
|
@ -1022,6 +1024,7 @@ phutil_register_library_map(array(
|
|||
'FundInitiative' => 'applications/fund/storage/FundInitiative.php',
|
||||
'FundInitiativeBackController' => 'applications/fund/controller/FundInitiativeBackController.php',
|
||||
'FundInitiativeCloseController' => 'applications/fund/controller/FundInitiativeCloseController.php',
|
||||
'FundInitiativeCommentController' => 'applications/fund/controller/FundInitiativeCommentController.php',
|
||||
'FundInitiativeEditController' => 'applications/fund/controller/FundInitiativeEditController.php',
|
||||
'FundInitiativeEditor' => 'applications/fund/editor/FundInitiativeEditor.php',
|
||||
'FundInitiativeFulltextEngine' => 'applications/fund/search/FundInitiativeFulltextEngine.php',
|
||||
|
@ -1032,6 +1035,7 @@ phutil_register_library_map(array(
|
|||
'FundInitiativeReplyHandler' => 'applications/fund/mail/FundInitiativeReplyHandler.php',
|
||||
'FundInitiativeSearchEngine' => 'applications/fund/query/FundInitiativeSearchEngine.php',
|
||||
'FundInitiativeTransaction' => 'applications/fund/storage/FundInitiativeTransaction.php',
|
||||
'FundInitiativeTransactionComment' => 'applications/fund/storage/FundInitiativeTransactionComment.php',
|
||||
'FundInitiativeTransactionQuery' => 'applications/fund/query/FundInitiativeTransactionQuery.php',
|
||||
'FundInitiativeViewController' => 'applications/fund/controller/FundInitiativeViewController.php',
|
||||
'FundSchemaSpec' => 'applications/fund/storage/FundSchemaSpec.php',
|
||||
|
@ -1228,6 +1232,7 @@ phutil_register_library_map(array(
|
|||
'HeraldRulePHIDType' => 'applications/herald/phid/HeraldRulePHIDType.php',
|
||||
'HeraldRuleQuery' => 'applications/herald/query/HeraldRuleQuery.php',
|
||||
'HeraldRuleSearchEngine' => 'applications/herald/query/HeraldRuleSearchEngine.php',
|
||||
'HeraldRuleSerializer' => 'applications/herald/editor/HeraldRuleSerializer.php',
|
||||
'HeraldRuleTestCase' => 'applications/herald/storage/__tests__/HeraldRuleTestCase.php',
|
||||
'HeraldRuleTransaction' => 'applications/herald/storage/HeraldRuleTransaction.php',
|
||||
'HeraldRuleTransactionComment' => 'applications/herald/storage/HeraldRuleTransactionComment.php',
|
||||
|
@ -1426,6 +1431,7 @@ phutil_register_library_map(array(
|
|||
'MultimeterViewer' => 'applications/multimeter/storage/MultimeterViewer.php',
|
||||
'NuanceConduitAPIMethod' => 'applications/nuance/conduit/NuanceConduitAPIMethod.php',
|
||||
'NuanceConsoleController' => 'applications/nuance/controller/NuanceConsoleController.php',
|
||||
'NuanceContentSource' => 'applications/nuance/contentsource/NuanceContentSource.php',
|
||||
'NuanceController' => 'applications/nuance/controller/NuanceController.php',
|
||||
'NuanceDAO' => 'applications/nuance/storage/NuanceDAO.php',
|
||||
'NuanceGitHubEventItemType' => 'applications/nuance/item/NuanceGitHubEventItemType.php',
|
||||
|
@ -1475,16 +1481,6 @@ phutil_register_library_map(array(
|
|||
'NuanceQueueTransactionComment' => 'applications/nuance/storage/NuanceQueueTransactionComment.php',
|
||||
'NuanceQueueTransactionQuery' => 'applications/nuance/query/NuanceQueueTransactionQuery.php',
|
||||
'NuanceQueueViewController' => 'applications/nuance/controller/NuanceQueueViewController.php',
|
||||
'NuanceRequestor' => 'applications/nuance/storage/NuanceRequestor.php',
|
||||
'NuanceRequestorEditController' => 'applications/nuance/controller/NuanceRequestorEditController.php',
|
||||
'NuanceRequestorEditor' => 'applications/nuance/editor/NuanceRequestorEditor.php',
|
||||
'NuanceRequestorPHIDType' => 'applications/nuance/phid/NuanceRequestorPHIDType.php',
|
||||
'NuanceRequestorQuery' => 'applications/nuance/query/NuanceRequestorQuery.php',
|
||||
'NuanceRequestorSource' => 'applications/nuance/storage/NuanceRequestorSource.php',
|
||||
'NuanceRequestorTransaction' => 'applications/nuance/storage/NuanceRequestorTransaction.php',
|
||||
'NuanceRequestorTransactionComment' => 'applications/nuance/storage/NuanceRequestorTransactionComment.php',
|
||||
'NuanceRequestorTransactionQuery' => 'applications/nuance/query/NuanceRequestorTransactionQuery.php',
|
||||
'NuanceRequestorViewController' => 'applications/nuance/controller/NuanceRequestorViewController.php',
|
||||
'NuanceSchemaSpec' => 'applications/nuance/storage/NuanceSchemaSpec.php',
|
||||
'NuanceSource' => 'applications/nuance/storage/NuanceSource.php',
|
||||
'NuanceSourceActionController' => 'applications/nuance/controller/NuanceSourceActionController.php',
|
||||
|
@ -1870,6 +1866,9 @@ phutil_register_library_map(array(
|
|||
'PhabricatorBadgeHasRecipientEdgeType' => 'applications/badges/edge/PhabricatorBadgeHasRecipientEdgeType.php',
|
||||
'PhabricatorBadgesApplication' => 'applications/badges/application/PhabricatorBadgesApplication.php',
|
||||
'PhabricatorBadgesArchiveController' => 'applications/badges/controller/PhabricatorBadgesArchiveController.php',
|
||||
'PhabricatorBadgesAward' => 'applications/badges/storage/PhabricatorBadgesAward.php',
|
||||
'PhabricatorBadgesAwardController' => 'applications/badges/controller/PhabricatorBadgesAwardController.php',
|
||||
'PhabricatorBadgesAwardQuery' => 'applications/badges/query/PhabricatorBadgesAwardQuery.php',
|
||||
'PhabricatorBadgesBadge' => 'applications/badges/storage/PhabricatorBadgesBadge.php',
|
||||
'PhabricatorBadgesCommentController' => 'applications/badges/controller/PhabricatorBadgesCommentController.php',
|
||||
'PhabricatorBadgesController' => 'applications/badges/controller/PhabricatorBadgesController.php',
|
||||
|
@ -1884,6 +1883,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorBadgesListController' => 'applications/badges/controller/PhabricatorBadgesListController.php',
|
||||
'PhabricatorBadgesMailReceiver' => 'applications/badges/mail/PhabricatorBadgesMailReceiver.php',
|
||||
'PhabricatorBadgesPHIDType' => 'applications/badges/phid/PhabricatorBadgesPHIDType.php',
|
||||
'PhabricatorBadgesQuality' => 'applications/badges/constants/PhabricatorBadgesQuality.php',
|
||||
'PhabricatorBadgesQuery' => 'applications/badges/query/PhabricatorBadgesQuery.php',
|
||||
'PhabricatorBadgesRecipientsListView' => 'applications/badges/view/PhabricatorBadgesRecipientsListView.php',
|
||||
'PhabricatorBadgesRemoveRecipientsController' => 'applications/badges/controller/PhabricatorBadgesRemoveRecipientsController.php',
|
||||
|
@ -1919,6 +1919,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorBotWhatsNewHandler' => 'infrastructure/daemon/bot/handler/PhabricatorBotWhatsNewHandler.php',
|
||||
'PhabricatorBritishEnglishTranslation' => 'infrastructure/internationalization/translation/PhabricatorBritishEnglishTranslation.php',
|
||||
'PhabricatorBuiltinPatchList' => 'infrastructure/storage/patch/PhabricatorBuiltinPatchList.php',
|
||||
'PhabricatorBulkContentSource' => 'infrastructure/daemon/contentsource/PhabricatorBulkContentSource.php',
|
||||
'PhabricatorBusyUIExample' => 'applications/uiexample/examples/PhabricatorBusyUIExample.php',
|
||||
'PhabricatorCacheDAO' => 'applications/cache/storage/PhabricatorCacheDAO.php',
|
||||
'PhabricatorCacheGeneralGarbageCollector' => 'applications/cache/garbagecollector/PhabricatorCacheGeneralGarbageCollector.php',
|
||||
|
@ -1993,6 +1994,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConduitCertificateToken' => 'applications/conduit/storage/PhabricatorConduitCertificateToken.php',
|
||||
'PhabricatorConduitConnectionLog' => 'applications/conduit/storage/PhabricatorConduitConnectionLog.php',
|
||||
'PhabricatorConduitConsoleController' => 'applications/conduit/controller/PhabricatorConduitConsoleController.php',
|
||||
'PhabricatorConduitContentSource' => 'infrastructure/contentsource/PhabricatorConduitContentSource.php',
|
||||
'PhabricatorConduitController' => 'applications/conduit/controller/PhabricatorConduitController.php',
|
||||
'PhabricatorConduitDAO' => 'applications/conduit/storage/PhabricatorConduitDAO.php',
|
||||
'PhabricatorConduitEditField' => 'applications/transactions/editfield/PhabricatorConduitEditField.php',
|
||||
|
@ -2080,8 +2082,10 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConpherencePreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php',
|
||||
'PhabricatorConpherenceThreadPHIDType' => 'applications/conpherence/phid/PhabricatorConpherenceThreadPHIDType.php',
|
||||
'PhabricatorConsoleApplication' => 'applications/console/application/PhabricatorConsoleApplication.php',
|
||||
'PhabricatorContentSource' => 'applications/metamta/contentsource/PhabricatorContentSource.php',
|
||||
'PhabricatorContentSourceView' => 'applications/metamta/contentsource/PhabricatorContentSourceView.php',
|
||||
'PhabricatorConsoleContentSource' => 'infrastructure/contentsource/PhabricatorConsoleContentSource.php',
|
||||
'PhabricatorContentSource' => 'infrastructure/contentsource/PhabricatorContentSource.php',
|
||||
'PhabricatorContentSourceModule' => 'infrastructure/contentsource/PhabricatorContentSourceModule.php',
|
||||
'PhabricatorContentSourceView' => 'infrastructure/contentsource/PhabricatorContentSourceView.php',
|
||||
'PhabricatorContributedToObjectEdgeType' => 'applications/transactions/edges/PhabricatorContributedToObjectEdgeType.php',
|
||||
'PhabricatorController' => 'applications/base/controller/PhabricatorController.php',
|
||||
'PhabricatorCookies' => 'applications/auth/constants/PhabricatorCookies.php',
|
||||
|
@ -2138,6 +2142,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDaemonBulkJobMonitorController' => 'applications/daemon/controller/PhabricatorDaemonBulkJobMonitorController.php',
|
||||
'PhabricatorDaemonBulkJobViewController' => 'applications/daemon/controller/PhabricatorDaemonBulkJobViewController.php',
|
||||
'PhabricatorDaemonConsoleController' => 'applications/daemon/controller/PhabricatorDaemonConsoleController.php',
|
||||
'PhabricatorDaemonContentSource' => 'infrastructure/daemon/contentsource/PhabricatorDaemonContentSource.php',
|
||||
'PhabricatorDaemonController' => 'applications/daemon/controller/PhabricatorDaemonController.php',
|
||||
'PhabricatorDaemonDAO' => 'applications/daemon/storage/PhabricatorDaemonDAO.php',
|
||||
'PhabricatorDaemonEventListener' => 'applications/daemon/event/PhabricatorDaemonEventListener.php',
|
||||
|
@ -2302,6 +2307,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorElasticFulltextStorageEngine' => 'applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php',
|
||||
'PhabricatorElasticSearchSetupCheck' => 'applications/config/check/PhabricatorElasticSearchSetupCheck.php',
|
||||
'PhabricatorEmailAddressesSettingsPanel' => 'applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php',
|
||||
'PhabricatorEmailContentSource' => 'applications/metamta/contentsource/PhabricatorEmailContentSource.php',
|
||||
'PhabricatorEmailFormatSettingsPanel' => 'applications/settings/panel/PhabricatorEmailFormatSettingsPanel.php',
|
||||
'PhabricatorEmailLoginController' => 'applications/auth/controller/PhabricatorEmailLoginController.php',
|
||||
'PhabricatorEmailPreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php',
|
||||
|
@ -2347,6 +2353,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFactSimpleSpec' => 'applications/fact/spec/PhabricatorFactSimpleSpec.php',
|
||||
'PhabricatorFactSpec' => 'applications/fact/spec/PhabricatorFactSpec.php',
|
||||
'PhabricatorFactUpdateIterator' => 'applications/fact/extract/PhabricatorFactUpdateIterator.php',
|
||||
'PhabricatorFaxContentSource' => 'infrastructure/contentsource/PhabricatorFaxContentSource.php',
|
||||
'PhabricatorFeedApplication' => 'applications/feed/application/PhabricatorFeedApplication.php',
|
||||
'PhabricatorFeedBuilder' => 'applications/feed/builder/PhabricatorFeedBuilder.php',
|
||||
'PhabricatorFeedConfigOptions' => 'applications/feed/config/PhabricatorFeedConfigOptions.php',
|
||||
|
@ -2476,6 +2483,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorHelpKeyboardShortcutController' => 'applications/help/controller/PhabricatorHelpKeyboardShortcutController.php',
|
||||
'PhabricatorHelpMainMenuBarExtension' => 'applications/help/extension/PhabricatorHelpMainMenuBarExtension.php',
|
||||
'PhabricatorHeraldApplication' => 'applications/herald/application/PhabricatorHeraldApplication.php',
|
||||
'PhabricatorHeraldContentSource' => 'applications/herald/contentsource/PhabricatorHeraldContentSource.php',
|
||||
'PhabricatorHighSecurityRequestExceptionHandler' => 'aphront/handler/PhabricatorHighSecurityRequestExceptionHandler.php',
|
||||
'PhabricatorHomeApplication' => 'applications/home/application/PhabricatorHomeApplication.php',
|
||||
'PhabricatorHomeController' => 'applications/home/controller/PhabricatorHomeController.php',
|
||||
|
@ -2524,6 +2532,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorLibraryTestCase' => '__tests__/PhabricatorLibraryTestCase.php',
|
||||
'PhabricatorLinkProfilePanel' => 'applications/search/profilepanel/PhabricatorLinkProfilePanel.php',
|
||||
'PhabricatorLipsumArtist' => 'applications/lipsum/image/PhabricatorLipsumArtist.php',
|
||||
'PhabricatorLipsumContentSource' => 'infrastructure/contentsource/PhabricatorLipsumContentSource.php',
|
||||
'PhabricatorLipsumGenerateWorkflow' => 'applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php',
|
||||
'PhabricatorLipsumManagementWorkflow' => 'applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php',
|
||||
'PhabricatorLipsumMondrianArtist' => 'applications/lipsum/image/PhabricatorLipsumMondrianArtist.php',
|
||||
|
@ -2737,6 +2746,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorObjectSelectorDialog' => 'view/control/PhabricatorObjectSelectorDialog.php',
|
||||
'PhabricatorObjectUsesCredentialsEdgeType' => 'applications/transactions/edges/PhabricatorObjectUsesCredentialsEdgeType.php',
|
||||
'PhabricatorOffsetPagedQuery' => 'infrastructure/query/PhabricatorOffsetPagedQuery.php',
|
||||
'PhabricatorOldWorldContentSource' => 'infrastructure/contentsource/PhabricatorOldWorldContentSource.php',
|
||||
'PhabricatorOneTimeTriggerClock' => 'infrastructure/daemon/workers/clock/PhabricatorOneTimeTriggerClock.php',
|
||||
'PhabricatorOpcodeCacheSpec' => 'applications/cache/spec/PhabricatorOpcodeCacheSpec.php',
|
||||
'PhabricatorOwnerPathQuery' => 'applications/owners/query/PhabricatorOwnerPathQuery.php',
|
||||
|
@ -2871,6 +2881,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPholioConfigOptions' => 'applications/pholio/config/PhabricatorPholioConfigOptions.php',
|
||||
'PhabricatorPholioMockTestDataGenerator' => 'applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php',
|
||||
'PhabricatorPhortuneApplication' => 'applications/phortune/application/PhabricatorPhortuneApplication.php',
|
||||
'PhabricatorPhortuneContentSource' => 'applications/phortune/contentsource/PhabricatorPhortuneContentSource.php',
|
||||
'PhabricatorPhortuneManagementInvoiceWorkflow' => 'applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php',
|
||||
'PhabricatorPhortuneManagementWorkflow' => 'applications/phortune/management/PhabricatorPhortuneManagementWorkflow.php',
|
||||
'PhabricatorPhragmentApplication' => 'applications/phragment/application/PhabricatorPhragmentApplication.php',
|
||||
|
@ -3471,7 +3482,9 @@ phutil_register_library_map(array(
|
|||
'PhabricatorUIExampleRenderController' => 'applications/uiexample/controller/PhabricatorUIExampleRenderController.php',
|
||||
'PhabricatorUIExamplesApplication' => 'applications/uiexample/application/PhabricatorUIExamplesApplication.php',
|
||||
'PhabricatorUSEnglishTranslation' => 'infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php',
|
||||
'PhabricatorUnitTestContentSource' => 'infrastructure/contentsource/PhabricatorUnitTestContentSource.php',
|
||||
'PhabricatorUnitsTestCase' => 'view/__tests__/PhabricatorUnitsTestCase.php',
|
||||
'PhabricatorUnknownContentSource' => 'infrastructure/contentsource/PhabricatorUnknownContentSource.php',
|
||||
'PhabricatorUnsubscribedFromObjectEdgeType' => 'applications/transactions/edges/PhabricatorUnsubscribedFromObjectEdgeType.php',
|
||||
'PhabricatorUser' => 'applications/people/storage/PhabricatorUser.php',
|
||||
'PhabricatorUserBlurbField' => 'applications/people/customfield/PhabricatorUserBlurbField.php',
|
||||
|
@ -3511,6 +3524,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorVeryWowEnglishTranslation' => 'infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php',
|
||||
'PhabricatorViewerDatasource' => 'applications/people/typeahead/PhabricatorViewerDatasource.php',
|
||||
'PhabricatorWatcherHasObjectEdgeType' => 'applications/transactions/edges/PhabricatorWatcherHasObjectEdgeType.php',
|
||||
'PhabricatorWebContentSource' => 'infrastructure/contentsource/PhabricatorWebContentSource.php',
|
||||
'PhabricatorWordPressAuthProvider' => 'applications/auth/provider/PhabricatorWordPressAuthProvider.php',
|
||||
'PhabricatorWorker' => 'infrastructure/daemon/workers/PhabricatorWorker.php',
|
||||
'PhabricatorWorkerActiveTask' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php',
|
||||
|
@ -5000,6 +5014,7 @@ phutil_register_library_map(array(
|
|||
'DoorkeeperBridgeAsana' => 'DoorkeeperBridge',
|
||||
'DoorkeeperBridgeGitHub' => 'DoorkeeperBridge',
|
||||
'DoorkeeperBridgeGitHubIssue' => 'DoorkeeperBridgeGitHub',
|
||||
'DoorkeeperBridgeGitHubUser' => 'DoorkeeperBridgeGitHub',
|
||||
'DoorkeeperBridgeJIRA' => 'DoorkeeperBridge',
|
||||
'DoorkeeperBridgeJIRATestCase' => 'PhabricatorTestCase',
|
||||
'DoorkeeperBridgedObjectCurtainExtension' => 'PHUICurtainExtension',
|
||||
|
@ -5008,6 +5023,7 @@ phutil_register_library_map(array(
|
|||
'DoorkeeperDAO',
|
||||
'PhabricatorPolicyInterface',
|
||||
),
|
||||
'DoorkeeperExternalObjectPHIDType' => 'PhabricatorPHIDType',
|
||||
'DoorkeeperExternalObjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'DoorkeeperFeedStoryPublisher' => 'Phobject',
|
||||
'DoorkeeperFeedWorker' => 'FeedPushWorker',
|
||||
|
@ -5224,6 +5240,7 @@ phutil_register_library_map(array(
|
|||
),
|
||||
'FundInitiativeBackController' => 'FundController',
|
||||
'FundInitiativeCloseController' => 'FundController',
|
||||
'FundInitiativeCommentController' => 'FundController',
|
||||
'FundInitiativeEditController' => 'FundController',
|
||||
'FundInitiativeEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'FundInitiativeFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||
|
@ -5234,6 +5251,7 @@ phutil_register_library_map(array(
|
|||
'FundInitiativeReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||
'FundInitiativeSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'FundInitiativeTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'FundInitiativeTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'FundInitiativeTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'FundInitiativeViewController' => 'FundController',
|
||||
'FundSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
|
@ -5476,6 +5494,7 @@ phutil_register_library_map(array(
|
|||
'HeraldRulePHIDType' => 'PhabricatorPHIDType',
|
||||
'HeraldRuleQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'HeraldRuleSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'HeraldRuleSerializer' => 'Phobject',
|
||||
'HeraldRuleTestCase' => 'PhabricatorTestCase',
|
||||
'HeraldRuleTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'HeraldRuleTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
|
@ -5710,6 +5729,7 @@ phutil_register_library_map(array(
|
|||
'MultimeterViewer' => 'MultimeterDimension',
|
||||
'NuanceConduitAPIMethod' => 'ConduitAPIMethod',
|
||||
'NuanceConsoleController' => 'NuanceController',
|
||||
'NuanceContentSource' => 'PhabricatorContentSource',
|
||||
'NuanceController' => 'PhabricatorController',
|
||||
'NuanceDAO' => 'PhabricatorLiskDAO',
|
||||
'NuanceGitHubEventItemType' => 'NuanceItemType',
|
||||
|
@ -5773,20 +5793,6 @@ phutil_register_library_map(array(
|
|||
'NuanceQueueTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'NuanceQueueTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'NuanceQueueViewController' => 'NuanceQueueController',
|
||||
'NuanceRequestor' => array(
|
||||
'NuanceDAO',
|
||||
'PhabricatorPolicyInterface',
|
||||
'PhabricatorApplicationTransactionInterface',
|
||||
),
|
||||
'NuanceRequestorEditController' => 'NuanceController',
|
||||
'NuanceRequestorEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'NuanceRequestorPHIDType' => 'PhabricatorPHIDType',
|
||||
'NuanceRequestorQuery' => 'NuanceQuery',
|
||||
'NuanceRequestorSource' => 'NuanceDAO',
|
||||
'NuanceRequestorTransaction' => 'NuanceTransaction',
|
||||
'NuanceRequestorTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'NuanceRequestorTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'NuanceRequestorViewController' => 'NuanceController',
|
||||
'NuanceSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
'NuanceSource' => array(
|
||||
'NuanceDAO',
|
||||
|
@ -6217,6 +6223,13 @@ phutil_register_library_map(array(
|
|||
'PhabricatorBadgeHasRecipientEdgeType' => 'PhabricatorEdgeType',
|
||||
'PhabricatorBadgesApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorBadgesArchiveController' => 'PhabricatorBadgesController',
|
||||
'PhabricatorBadgesAward' => array(
|
||||
'PhabricatorBadgesDAO',
|
||||
'PhabricatorDestructibleInterface',
|
||||
'PhabricatorPolicyInterface',
|
||||
),
|
||||
'PhabricatorBadgesAwardController' => 'PhabricatorBadgesController',
|
||||
'PhabricatorBadgesAwardQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorBadgesBadge' => array(
|
||||
'PhabricatorBadgesDAO',
|
||||
'PhabricatorPolicyInterface',
|
||||
|
@ -6239,6 +6252,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorBadgesListController' => 'PhabricatorBadgesController',
|
||||
'PhabricatorBadgesMailReceiver' => 'PhabricatorObjectMailReceiver',
|
||||
'PhabricatorBadgesPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorBadgesQuality' => 'Phobject',
|
||||
'PhabricatorBadgesQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorBadgesRecipientsListView' => 'AphrontView',
|
||||
'PhabricatorBadgesRemoveRecipientsController' => 'PhabricatorBadgesController',
|
||||
|
@ -6274,6 +6288,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorBotWhatsNewHandler' => 'PhabricatorBotHandler',
|
||||
'PhabricatorBritishEnglishTranslation' => 'PhutilTranslation',
|
||||
'PhabricatorBuiltinPatchList' => 'PhabricatorSQLPatchList',
|
||||
'PhabricatorBulkContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorBusyUIExample' => 'PhabricatorUIExample',
|
||||
'PhabricatorCacheDAO' => 'PhabricatorLiskDAO',
|
||||
'PhabricatorCacheGeneralGarbageCollector' => 'PhabricatorGarbageCollector',
|
||||
|
@ -6369,6 +6384,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConduitCertificateToken' => 'PhabricatorConduitDAO',
|
||||
'PhabricatorConduitConnectionLog' => 'PhabricatorConduitDAO',
|
||||
'PhabricatorConduitConsoleController' => 'PhabricatorConduitController',
|
||||
'PhabricatorConduitContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorConduitController' => 'PhabricatorController',
|
||||
'PhabricatorConduitDAO' => 'PhabricatorLiskDAO',
|
||||
'PhabricatorConduitEditField' => 'PhabricatorEditField',
|
||||
|
@ -6469,7 +6485,9 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConpherencePreferencesSettingsPanel' => 'PhabricatorSettingsPanel',
|
||||
'PhabricatorConpherenceThreadPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorConsoleApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorConsoleContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorContentSource' => 'Phobject',
|
||||
'PhabricatorContentSourceModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorContentSourceView' => 'AphrontView',
|
||||
'PhabricatorContributedToObjectEdgeType' => 'PhabricatorEdgeType',
|
||||
'PhabricatorController' => 'AphrontController',
|
||||
|
@ -6535,6 +6553,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDaemonBulkJobMonitorController' => 'PhabricatorDaemonController',
|
||||
'PhabricatorDaemonBulkJobViewController' => 'PhabricatorDaemonController',
|
||||
'PhabricatorDaemonConsoleController' => 'PhabricatorDaemonController',
|
||||
'PhabricatorDaemonContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorDaemonController' => 'PhabricatorController',
|
||||
'PhabricatorDaemonDAO' => 'PhabricatorLiskDAO',
|
||||
'PhabricatorDaemonEventListener' => 'PhabricatorEventListener',
|
||||
|
@ -6726,6 +6745,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorElasticFulltextStorageEngine' => 'PhabricatorFulltextStorageEngine',
|
||||
'PhabricatorElasticSearchSetupCheck' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorEmailAddressesSettingsPanel' => 'PhabricatorSettingsPanel',
|
||||
'PhabricatorEmailContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorEmailFormatSettingsPanel' => 'PhabricatorSettingsPanel',
|
||||
'PhabricatorEmailLoginController' => 'PhabricatorAuthController',
|
||||
'PhabricatorEmailPreferencesSettingsPanel' => 'PhabricatorSettingsPanel',
|
||||
|
@ -6773,6 +6793,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFactSimpleSpec' => 'PhabricatorFactSpec',
|
||||
'PhabricatorFactSpec' => 'Phobject',
|
||||
'PhabricatorFactUpdateIterator' => 'PhutilBufferedIterator',
|
||||
'PhabricatorFaxContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorFeedApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorFeedBuilder' => 'Phobject',
|
||||
'PhabricatorFeedConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
|
@ -6935,6 +6956,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorHelpKeyboardShortcutController' => 'PhabricatorHelpController',
|
||||
'PhabricatorHelpMainMenuBarExtension' => 'PhabricatorMainMenuBarExtension',
|
||||
'PhabricatorHeraldApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorHeraldContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorHighSecurityRequestExceptionHandler' => 'PhabricatorRequestExceptionHandler',
|
||||
'PhabricatorHomeApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorHomeController' => 'PhabricatorController',
|
||||
|
@ -6983,6 +7005,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorLibraryTestCase' => 'PhutilLibraryTestCase',
|
||||
'PhabricatorLinkProfilePanel' => 'PhabricatorProfilePanel',
|
||||
'PhabricatorLipsumArtist' => 'Phobject',
|
||||
'PhabricatorLipsumContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorLipsumGenerateWorkflow' => 'PhabricatorLipsumManagementWorkflow',
|
||||
'PhabricatorLipsumManagementWorkflow' => 'PhabricatorManagementWorkflow',
|
||||
'PhabricatorLipsumMondrianArtist' => 'PhabricatorLipsumArtist',
|
||||
|
@ -7218,6 +7241,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorObjectSelectorDialog' => 'Phobject',
|
||||
'PhabricatorObjectUsesCredentialsEdgeType' => 'PhabricatorEdgeType',
|
||||
'PhabricatorOffsetPagedQuery' => 'PhabricatorQuery',
|
||||
'PhabricatorOldWorldContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorOneTimeTriggerClock' => 'PhabricatorTriggerClock',
|
||||
'PhabricatorOpcodeCacheSpec' => 'PhabricatorCacheSpec',
|
||||
'PhabricatorOwnerPathQuery' => 'Phobject',
|
||||
|
@ -7375,6 +7399,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPholioConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
'PhabricatorPholioMockTestDataGenerator' => 'PhabricatorTestDataGenerator',
|
||||
'PhabricatorPhortuneApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorPhortuneContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorPhortuneManagementInvoiceWorkflow' => 'PhabricatorPhortuneManagementWorkflow',
|
||||
'PhabricatorPhortuneManagementWorkflow' => 'PhabricatorManagementWorkflow',
|
||||
'PhabricatorPhragmentApplication' => 'PhabricatorApplication',
|
||||
|
@ -8094,7 +8119,9 @@ phutil_register_library_map(array(
|
|||
'PhabricatorUIExampleRenderController' => 'PhabricatorController',
|
||||
'PhabricatorUIExamplesApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorUSEnglishTranslation' => 'PhutilTranslation',
|
||||
'PhabricatorUnitTestContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorUnitsTestCase' => 'PhabricatorTestCase',
|
||||
'PhabricatorUnknownContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorUnsubscribedFromObjectEdgeType' => 'PhabricatorEdgeType',
|
||||
'PhabricatorUser' => array(
|
||||
'PhabricatorUserDAO',
|
||||
|
@ -8150,6 +8177,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorVeryWowEnglishTranslation' => 'PhutilTranslation',
|
||||
'PhabricatorViewerDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhabricatorWatcherHasObjectEdgeType' => 'PhabricatorEdgeType',
|
||||
'PhabricatorWebContentSource' => 'PhabricatorContentSource',
|
||||
'PhabricatorWordPressAuthProvider' => 'PhabricatorOAuth2AuthProvider',
|
||||
'PhabricatorWorker' => 'Phobject',
|
||||
'PhabricatorWorkerActiveTask' => 'PhabricatorWorkerTask',
|
||||
|
|
|
@ -99,25 +99,35 @@ final class AlmanacBindingEditController
|
|||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setValidationException($validation_exception)
|
||||
->setHeaderText($title)
|
||||
->setHeaderText(pht('Binding'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->appendChild($form);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb($service->getName(), $service_uri);
|
||||
if ($is_new) {
|
||||
$crumbs->addTextCrumb(pht('Create Binding'));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Create Binding'))
|
||||
->setHeaderIcon('fa-plus-square');
|
||||
} else {
|
||||
$crumbs->addTextCrumb(pht('Edit Binding'));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Create Binding'))
|
||||
->setHeaderIcon('fa-pencil');
|
||||
}
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$box,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$box,
|
||||
));
|
||||
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -61,18 +61,25 @@ final class AlmanacConsoleController extends AlmanacController {
|
|||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Console'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Console'))
|
||||
->setObjectList($menu);
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Almanac Console'))
|
||||
->setHeaderIcon('fa-server');
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$box,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Almanac Console'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$box,
|
||||
));
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -131,24 +131,36 @@ final class AlmanacInterfaceEditController
|
|||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setValidationException($validation_exception)
|
||||
->setHeaderText($title)
|
||||
->setHeaderText(pht('Interface'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($form);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb($device->getName(), $device_uri);
|
||||
if ($is_new) {
|
||||
$crumbs->addTextCrumb(pht('Create Interface'));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Create Interface'))
|
||||
->setHeaderIcon('fa-plus-square');
|
||||
} else {
|
||||
$crumbs->addTextCrumb(pht('Edit Interface'));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Edit Interface'))
|
||||
->setHeaderIcon('fa-pencil');
|
||||
}
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$box,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$box,
|
||||
));
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -75,8 +75,12 @@ final class AlmanacServiceEditController
|
|||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Create Service'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$title = pht('Choose Service Type');
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Create Service'))
|
||||
->setHeaderIcon('fa-plus-square');
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($viewer)
|
||||
|
@ -88,13 +92,21 @@ final class AlmanacServiceEditController
|
|||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setFormErrors($errors)
|
||||
->setHeaderText($title)
|
||||
->setHeaderText(pht('Service'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($form);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$box,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($box);
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,4 +13,8 @@ final class AlmanacBindingPropertyEditEngine
|
|||
return $object->getURI();
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Property');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,6 +53,10 @@ final class AlmanacDeviceEditEngine
|
|||
return pht('Create Device');
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Device');
|
||||
}
|
||||
|
||||
protected function getEditorURI() {
|
||||
return '/almanac/device/edit/';
|
||||
}
|
||||
|
|
|
@ -13,4 +13,8 @@ final class AlmanacDevicePropertyEditEngine
|
|||
return $object->getURI();
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Property');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,6 +53,10 @@ final class AlmanacNamespaceEditEngine
|
|||
return pht('Create Namespace');
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Namespace');
|
||||
}
|
||||
|
||||
protected function getEditorURI() {
|
||||
return '/almanac/namespace/edit/';
|
||||
}
|
||||
|
|
|
@ -53,6 +53,10 @@ final class AlmanacNetworkEditEngine
|
|||
return pht('Create Network');
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Network');
|
||||
}
|
||||
|
||||
protected function getEditorURI() {
|
||||
return '/almanac/network/edit/';
|
||||
}
|
||||
|
|
|
@ -65,6 +65,10 @@ final class AlmanacServiceEditEngine
|
|||
return pht('Create Service');
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Service');
|
||||
}
|
||||
|
||||
protected function getEditorURI() {
|
||||
return '/almanac/service/edit/';
|
||||
}
|
||||
|
|
|
@ -13,4 +13,8 @@ final class AlmanacServicePropertyEditEngine
|
|||
return $object->getURI();
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Property');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
abstract class AlmanacManagementWorkflow
|
||||
extends PhabricatorManagementWorkflow {
|
||||
|
||||
|
||||
protected function loadServices(array $names) {
|
||||
if (!$names) {
|
||||
return array();
|
||||
|
@ -37,7 +36,7 @@ abstract class AlmanacManagementWorkflow
|
|||
$editor = id(new AlmanacServiceEditor())
|
||||
->setActor($this->getViewer())
|
||||
->setActingAsPHID($almanac_phid)
|
||||
->setContentSource(PhabricatorContentSource::newConsoleSource())
|
||||
->setContentSource($this->newContentSource())
|
||||
->setContinueOnMissingFields(true);
|
||||
|
||||
$editor->applyTransactions($service, array($xaction));
|
||||
|
|
|
@ -34,8 +34,7 @@ final class PhabricatorAuditInlineComment
|
|||
|
||||
public function getTransactionCommentForSave() {
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array());
|
||||
PhabricatorOldWorldContentSource::SOURCECONST);
|
||||
|
||||
$this->proxy
|
||||
->setViewPolicy('public')
|
||||
|
|
|
@ -66,15 +66,12 @@ final class PhabricatorAuthConfirmLinkController
|
|||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Confirm Link'), $panel_uri);
|
||||
$crumbs->addTextCrumb($provider->getProviderName());
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$dialog,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Confirm External Account Link'),
|
||||
));
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Confirm External Account Link'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($dialog);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,11 +7,9 @@ abstract class PhabricatorAuthController extends PhabricatorController {
|
|||
$view->setTitle($title);
|
||||
$view->setErrors($messages);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$view,
|
||||
array(
|
||||
'title' => $title,
|
||||
));
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -116,15 +116,12 @@ final class PhabricatorAuthLinkController
|
|||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Link Account'), $panel_uri);
|
||||
$crumbs->addTextCrumb($provider->getProviderName($name));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$form,
|
||||
),
|
||||
array(
|
||||
'title' => $title,
|
||||
));
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($form);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -236,7 +236,6 @@ final class PhabricatorAuthLoginController
|
|||
$content) {
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
if ($this->getRequest()->getUser()->isLoggedIn()) {
|
||||
$crumbs->addTextCrumb(pht('Link Account'), $provider->getSettingsURI());
|
||||
|
@ -245,15 +244,12 @@ final class PhabricatorAuthLoginController
|
|||
}
|
||||
|
||||
$crumbs->addTextCrumb($provider->getProviderName());
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$content,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Login'),
|
||||
));
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Login'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($content);
|
||||
}
|
||||
|
||||
public function buildProviderErrorResponse(
|
||||
|
|
|
@ -28,11 +28,10 @@ final class PhabricatorAuthNeedsApprovalController
|
|||
->appendChild($wait_for_approval)
|
||||
->addCancelButton('/', pht('Wait Patiently'));
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$dialog,
|
||||
array(
|
||||
'title' => pht('Wait For Approval'),
|
||||
));
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Wait For Approval'))
|
||||
->appendChild($dialog);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -76,15 +76,16 @@ final class PhabricatorAuthNeedsMultiFactorController
|
|||
));
|
||||
}
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$help,
|
||||
$panel,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Add Multi-Factor Authentication'),
|
||||
));
|
||||
$view = array(
|
||||
$help,
|
||||
$panel,
|
||||
);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Add Multi-Factor Authentication'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -497,6 +497,7 @@ final class PhabricatorAuthRegisterController
|
|||
$crumbs->addTextCrumb($provider->getProviderName());
|
||||
$title = pht('Phabricator Registration');
|
||||
}
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$welcome_view = null;
|
||||
if ($is_setup) {
|
||||
|
@ -511,7 +512,6 @@ final class PhabricatorAuthRegisterController
|
|||
}
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($title)
|
||||
->setForm($form)
|
||||
->setFormErrors($errors);
|
||||
|
||||
|
@ -520,16 +520,21 @@ final class PhabricatorAuthRegisterController
|
|||
$invite_header = $this->renderInviteHeader($invite);
|
||||
}
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$welcome_view,
|
||||
$invite_header,
|
||||
$object_box,
|
||||
),
|
||||
array(
|
||||
'title' => $title,
|
||||
));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$welcome_view,
|
||||
$invite_header,
|
||||
$object_box,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function loadDefaultAccount() {
|
||||
|
|
|
@ -189,16 +189,17 @@ final class PhabricatorAuthStartController
|
|||
$crumbs->addTextCrumb(pht('Login'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$header,
|
||||
$invite_message,
|
||||
$out,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Login to Phabricator'),
|
||||
));
|
||||
$title = pht('Login to Phabricator');
|
||||
$view = array(
|
||||
$header,
|
||||
$invite_message,
|
||||
$out,
|
||||
);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,8 +15,7 @@ final class PhabricatorDisabledUserController
|
|||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
return id(new AphrontDialogView())
|
||||
->setUser($viewer)
|
||||
return $this->newDialog()
|
||||
->setTitle(pht('Account Disabled'))
|
||||
->addCancelButton('/logout/', pht('Okay'))
|
||||
->appendParagraph(pht('Your account has been disabled.'));
|
||||
|
|
|
@ -144,6 +144,7 @@ final class PhabricatorEmailLoginController
|
|||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Reset Password'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($request->getUser());
|
||||
|
@ -152,14 +153,11 @@ final class PhabricatorEmailLoginController
|
|||
$dialog->addSubmitButton(pht('Send Email'));
|
||||
$dialog->setSubmitURI('/login/email/');
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$dialog,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Forgot Password'),
|
||||
));
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Forgot Password'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($dialog);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -77,15 +77,13 @@ final class PhabricatorEmailVerificationController
|
|||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Verify Email'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Verify Email'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($dialog);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$dialog,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Verify Email'),
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,14 +56,11 @@ final class PhabricatorLogoutController
|
|||
}
|
||||
|
||||
if ($viewer->getPHID()) {
|
||||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($viewer)
|
||||
return $this->newDialog()
|
||||
->setTitle(pht('Log out of Phabricator?'))
|
||||
->appendChild(pht('Are you sure you want to log out?'))
|
||||
->addSubmitButton(pht('Logout'))
|
||||
->addCancelButton('/');
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
}
|
||||
|
||||
return id(new AphrontRedirectResponse())->setURI('/');
|
||||
|
|
|
@ -53,14 +53,15 @@ final class PhabricatorMustVerifyEmailController
|
|||
->appendParagraph($send_again)
|
||||
->addSubmitButton(pht('Send Another Email'));
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$sent,
|
||||
$dialog,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Must Verify Email'),
|
||||
));
|
||||
$view = array(
|
||||
$sent,
|
||||
$dialog,
|
||||
);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Must Verify Email'))
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -176,15 +176,33 @@ final class PhabricatorAuthEditController
|
|||
$button = pht('Add Provider');
|
||||
}
|
||||
$crumb = pht('Add Provider');
|
||||
$title = pht('Add Authentication Provider');
|
||||
$title = pht('Add Auth Provider');
|
||||
$header_icon = 'fa-plus-square';
|
||||
$cancel_uri = $this->getApplicationURI('/config/new/');
|
||||
} else {
|
||||
$button = pht('Save');
|
||||
$crumb = pht('Edit Provider');
|
||||
$title = pht('Edit Authentication Provider');
|
||||
$title = pht('Edit Auth Provider');
|
||||
$header_icon = 'fa-pencil';
|
||||
$cancel_uri = $this->getApplicationURI();
|
||||
}
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('%s: %s', $title, $provider->getProviderName()))
|
||||
->setHeaderIcon($header_icon);
|
||||
|
||||
if ($config->getIsEnabled()) {
|
||||
$status_name = pht('Enabled');
|
||||
$status_color = 'green';
|
||||
$status_icon = 'fa-check';
|
||||
$header->setStatus($status_icon, $status_color, $status_name);
|
||||
} else if (!$is_new) {
|
||||
$status_name = pht('Disabled');
|
||||
$status_color = 'indigo';
|
||||
$status_icon = 'fa-ban';
|
||||
$header->setStatus($status_icon, $status_color, $status_name);
|
||||
}
|
||||
|
||||
$config_name = 'auth.email-domains';
|
||||
$config_href = '/config/edit/'.$config_name.'/';
|
||||
|
||||
|
@ -253,32 +271,8 @@ final class PhabricatorAuthEditController
|
|||
'Phabricator will automatically login with this provider if it is '.
|
||||
'the only available provider.'));
|
||||
|
||||
$status_tag = id(new PHUITagView())
|
||||
->setType(PHUITagView::TYPE_STATE);
|
||||
if ($is_new) {
|
||||
$status_tag
|
||||
->setName(pht('New Provider'))
|
||||
->setBackgroundColor('blue');
|
||||
} else if ($config->getIsEnabled()) {
|
||||
$status_tag
|
||||
->setName(pht('Enabled'))
|
||||
->setBackgroundColor('green');
|
||||
} else {
|
||||
$status_tag
|
||||
->setName(pht('Disabled'))
|
||||
->setBackgroundColor('red');
|
||||
}
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($viewer)
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel(pht('Provider'))
|
||||
->setValue($provider->getProviderName()))
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel(pht('Status'))
|
||||
->setValue($status_tag))
|
||||
->appendChild(
|
||||
id(new AphrontFormCheckboxControl())
|
||||
->setLabel(pht('Allow'))
|
||||
|
@ -348,6 +342,7 @@ final class PhabricatorAuthEditController
|
|||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb($crumb);
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$timeline = null;
|
||||
if (!$is_new) {
|
||||
|
@ -358,23 +353,28 @@ final class PhabricatorAuthEditController
|
|||
foreach ($xactions as $xaction) {
|
||||
$xaction->setProvider($provider);
|
||||
}
|
||||
$timeline->setShouldTerminate(true);
|
||||
}
|
||||
|
||||
$form_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($title)
|
||||
->setHeaderText(pht('Provider'))
|
||||
->setFormErrors($errors)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($form);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$form_box,
|
||||
$footer,
|
||||
$timeline,
|
||||
),
|
||||
array(
|
||||
'title' => $title,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
final class PhabricatorAuthListController
|
||||
extends PhabricatorAuthProviderConfigController {
|
||||
|
||||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
$viewer = $request->getUser();
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$configs = id(new PhabricatorAuthProviderConfigQuery())
|
||||
->setViewer($viewer)
|
||||
|
@ -93,6 +92,7 @@ final class PhabricatorAuthListController
|
|||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Auth Providers'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$domains_key = 'auth.email-domains';
|
||||
$domains_link = $this->renderConfigLink($domains_key);
|
||||
|
@ -155,24 +155,29 @@ final class PhabricatorAuthListController
|
|||
->setDisabled(!$can_manage)
|
||||
->setText(pht('Add Provider'));
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Authentication Providers'))
|
||||
->addActionLink($button);
|
||||
|
||||
$list->setFlush(true);
|
||||
$list = id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setInfoView($warning)
|
||||
->setHeaderText(pht('Providers'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->appendChild($list);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$title = pht('Auth Providers');
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setHeaderIcon('fa-key')
|
||||
->addActionLink($button);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$warning,
|
||||
$list,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Authentication Providers'),
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function renderConfigLink($key) {
|
||||
|
|
|
@ -80,21 +80,32 @@ final class PhabricatorAuthNewController
|
|||
->setValue(pht('Continue')));
|
||||
|
||||
$form_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Add Authentication Provider'))
|
||||
->setHeaderText(pht('Provider'))
|
||||
->setFormErrors($errors)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($form);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Add Provider'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$title = pht('Add Auth Provider');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setHeaderIcon('fa-plus-square');
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$form_box,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Add Authentication Provider'),
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,9 +44,9 @@ final class PhabricatorAuthProviderConfigTransaction
|
|||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_ENABLE:
|
||||
if ($new) {
|
||||
return 'fa-play';
|
||||
return 'fa-check';
|
||||
} else {
|
||||
return 'fa-pause';
|
||||
return 'fa-ban';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ final class PhabricatorAuthProviderConfigTransaction
|
|||
if ($new) {
|
||||
return 'green';
|
||||
} else {
|
||||
return 'red';
|
||||
return 'indigo';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,12 +39,14 @@ final class PhabricatorBadgesApplication extends PhabricatorApplication {
|
|||
'/badges/' => array(
|
||||
'(?:query/(?P<queryKey>[^/]+)/)?'
|
||||
=> 'PhabricatorBadgesListController',
|
||||
'award/(?:(?P<id>\d+)/)?'
|
||||
=> 'PhabricatorBadgesAwardController',
|
||||
'create/'
|
||||
=> 'PhabricatorBadgesEditController',
|
||||
'comment/(?P<id>[1-9]\d*)/'
|
||||
=> 'PhabricatorBadgesCommentController',
|
||||
'edit/(?:(?P<id>\d+)/)?'
|
||||
=> 'PhabricatorBadgesEditController',
|
||||
$this->getEditRoutePattern('edit/')
|
||||
=> 'PhabricatorBadgesEditController',
|
||||
'archive/(?:(?P<id>\d+)/)?'
|
||||
=> 'PhabricatorBadgesArchiveController',
|
||||
'view/(?:(?P<id>\d+)/)?'
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorBadgesQuality
|
||||
extends Phobject {
|
||||
|
||||
const POOR = 140;
|
||||
const COMMON = 120;
|
||||
const UNCOMMON = 100;
|
||||
const RARE = 80;
|
||||
const EPIC = 60;
|
||||
const LEGENDARY = 40;
|
||||
const HEIRLOOM = 20;
|
||||
|
||||
const DEFAULT_QUALITY = 140;
|
||||
|
||||
public static function getQualityName($quality) {
|
||||
$map = self::getQualityDictionary($quality);
|
||||
$default = pht('Unknown Quality ("%s")', $quality);
|
||||
return idx($map, 'name', $default);
|
||||
}
|
||||
|
||||
public static function getQualityColor($quality) {
|
||||
$map = self::getQualityDictionary($quality);
|
||||
$default = 'grey';
|
||||
return idx($map, 'color', $default);
|
||||
}
|
||||
|
||||
private static function getQualityDictionary($quality) {
|
||||
$map = self::getQualityMap();
|
||||
$default = array();
|
||||
return idx($map, $quality, $default);
|
||||
}
|
||||
|
||||
public static function getQualityMap() {
|
||||
return array(
|
||||
self::POOR => array(
|
||||
'rarity' => 140,
|
||||
'name' => pht('Poor'),
|
||||
'color' => 'grey',
|
||||
),
|
||||
self::COMMON => array(
|
||||
'rarity' => 120,
|
||||
'name' => pht('Common'),
|
||||
'color' => 'white',
|
||||
),
|
||||
self::UNCOMMON => array(
|
||||
'rarity' => 100,
|
||||
'name' => pht('Uncommon'),
|
||||
'color' => 'green',
|
||||
),
|
||||
self::RARE => array(
|
||||
'rarity' => 80,
|
||||
'name' => pht('Rare'),
|
||||
'color' => 'blue',
|
||||
),
|
||||
self::EPIC => array(
|
||||
'rarity' => 60,
|
||||
'name' => pht('Epic'),
|
||||
'color' => 'indigo',
|
||||
),
|
||||
self::LEGENDARY => array(
|
||||
'rarity' => 40,
|
||||
'name' => pht('Legendary'),
|
||||
'color' => 'orange',
|
||||
),
|
||||
self::HEIRLOOM => array(
|
||||
'rarity' => 20,
|
||||
'name' => pht('Heirloom'),
|
||||
'color' => 'yellow',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public static function getDropdownQualityMap() {
|
||||
$map = self::getQualityMap();
|
||||
return ipull($map, 'name');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorBadgesAwardController
|
||||
extends PhabricatorBadgesController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$id = $request->getURIData('id');
|
||||
|
||||
$user = id(new PhabricatorPeopleQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($id))
|
||||
->executeOne();
|
||||
if (!$user) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$view_uri = '/p/'.$user->getUsername();
|
||||
|
||||
if ($request->isFormPost()) {
|
||||
$xactions = array();
|
||||
$badge_phid = $request->getStr('badgePHID');
|
||||
$badge = id(new PhabricatorBadgesQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($badge_phid))
|
||||
->needRecipients(true)
|
||||
->requireCapabilities(
|
||||
array(
|
||||
PhabricatorPolicyCapability::CAN_EDIT,
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
))
|
||||
->executeOne();
|
||||
if (!$badge) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
$award_phids = array($user->getPHID());
|
||||
|
||||
$xactions[] = id(new PhabricatorBadgesTransaction())
|
||||
->setTransactionType(PhabricatorBadgesTransaction::TYPE_AWARD)
|
||||
->setNewValue($award_phids);
|
||||
|
||||
$editor = id(new PhabricatorBadgesEditor($badge))
|
||||
->setActor($viewer)
|
||||
->setContentSourceFromRequest($request)
|
||||
->setContinueOnNoEffect(true)
|
||||
->setContinueOnMissingFields(true)
|
||||
->applyTransactions($badge, $xactions);
|
||||
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setURI($view_uri);
|
||||
}
|
||||
|
||||
$badges = id(new PhabricatorBadgesQuery())
|
||||
->setViewer($viewer)
|
||||
->withStatuses(array(
|
||||
PhabricatorBadgesBadge::STATUS_ACTIVE,
|
||||
))
|
||||
->requireCapabilities(
|
||||
array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
PhabricatorPolicyCapability::CAN_EDIT,
|
||||
))
|
||||
->execute();
|
||||
|
||||
$options = mpull($badges, 'getName', 'getPHID');
|
||||
asort($options);
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($viewer)
|
||||
->appendChild(
|
||||
id(new AphrontFormSelectControl())
|
||||
->setLabel(pht('Badge'))
|
||||
->setName('badgePHID')
|
||||
->setOptions($options));
|
||||
|
||||
$dialog = $this->newDialog()
|
||||
->setTitle(pht('Grant Badge'))
|
||||
->appendForm($form)
|
||||
->addCancelButton($view_uri)
|
||||
->addSubmitButton(pht('Award'));
|
||||
|
||||
return $dialog;
|
||||
}
|
||||
|
||||
}
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
final class PhabricatorBadgesEditController extends
|
||||
PhabricatorBadgesController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
return id(new PhabricatorBadgesEditEngine())
|
||||
->setController($this)
|
||||
|
|
|
@ -6,6 +6,7 @@ final class PhabricatorBadgesEditRecipientsController
|
|||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$id = $request->getURIData('id');
|
||||
$xactions = array();
|
||||
|
||||
$badge = id(new PhabricatorBadgesQuery())
|
||||
->setViewer($viewer)
|
||||
|
@ -21,30 +22,23 @@ final class PhabricatorBadgesEditRecipientsController
|
|||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$recipient_phids = $badge->getRecipientPHIDs();
|
||||
$view_uri = $this->getApplicationURI('view/'.$badge->getID().'/');
|
||||
$awards = $badge->getAwards();
|
||||
$recipient_phids = mpull($awards, 'getRecipientPHID');
|
||||
|
||||
if ($request->isFormPost()) {
|
||||
$recipient_spec = array();
|
||||
|
||||
$remove = $request->getStr('remove');
|
||||
if ($remove) {
|
||||
$recipient_spec['-'] = array_fuse(array($remove));
|
||||
}
|
||||
$award_phids = array();
|
||||
|
||||
$add_recipients = $request->getArr('phids');
|
||||
if ($add_recipients) {
|
||||
$recipient_spec['+'] = array_fuse($add_recipients);
|
||||
foreach ($add_recipients as $phid) {
|
||||
$award_phids[] = $phid;
|
||||
}
|
||||
}
|
||||
|
||||
$type_recipient = PhabricatorBadgeHasRecipientEdgeType::EDGECONST;
|
||||
|
||||
$xactions = array();
|
||||
|
||||
$xactions[] = id(new PhabricatorBadgesTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
|
||||
->setMetadataValue('edge:type', $type_recipient)
|
||||
->setNewValue($recipient_spec);
|
||||
->setTransactionType(PhabricatorBadgesTransaction::TYPE_AWARD)
|
||||
->setNewValue($award_phids);
|
||||
|
||||
$editor = id(new PhabricatorBadgesEditor($badge))
|
||||
->setActor($viewer)
|
||||
|
|
|
@ -16,16 +16,9 @@ final class PhabricatorBadgesListController
|
|||
protected function buildApplicationCrumbs() {
|
||||
$crumbs = parent::buildApplicationCrumbs();
|
||||
|
||||
$can_create = $this->hasApplicationCapability(
|
||||
PhabricatorBadgesCreateCapability::CAPABILITY);
|
||||
|
||||
$crumbs->addAction(
|
||||
id(new PHUIListItemView())
|
||||
->setName(pht('Create Badge'))
|
||||
->setHref($this->getApplicationURI('create/'))
|
||||
->setIcon('fa-plus-square')
|
||||
->setDisabled(!$can_create)
|
||||
->setWorkflow(!$can_create));
|
||||
id(new PhabricatorBadgesEditEngine())
|
||||
->setViewer($this->getViewer())
|
||||
->addActionToCrumbs($crumbs);
|
||||
|
||||
return $crumbs;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,8 @@ final class PhabricatorBadgesRemoveRecipientsController
|
|||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$recipient_phids = $badge->getRecipientPHIDs();
|
||||
$awards = $badge->getAwards();
|
||||
$recipient_phids = mpull($awards, 'getRecipientPHID');
|
||||
$remove_phid = $request->getStr('phid');
|
||||
|
||||
if (!in_array($remove_phid, $recipient_phids)) {
|
||||
|
@ -31,17 +32,10 @@ final class PhabricatorBadgesRemoveRecipientsController
|
|||
$view_uri = $this->getApplicationURI('view/'.$badge->getID().'/');
|
||||
|
||||
if ($request->isFormPost()) {
|
||||
$recipient_spec = array();
|
||||
$recipient_spec['-'] = array($remove_phid => $remove_phid);
|
||||
|
||||
$type_recipient = PhabricatorBadgeHasRecipientEdgeType::EDGECONST;
|
||||
|
||||
$xactions = array();
|
||||
|
||||
$xactions[] = id(new PhabricatorBadgesTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
|
||||
->setMetadataValue('edge:type', $type_recipient)
|
||||
->setNewValue($recipient_spec);
|
||||
->setTransactionType(PhabricatorBadgesTransaction::TYPE_REVOKE)
|
||||
->setNewValue(array($remove_phid));
|
||||
|
||||
$editor = id(new PhabricatorBadgesEditor($badge))
|
||||
->setActor($viewer)
|
||||
|
|
|
@ -50,7 +50,8 @@ final class PhabricatorBadgesViewController
|
|||
$badge,
|
||||
new PhabricatorBadgesTransactionQuery());
|
||||
|
||||
$recipient_phids = $badge->getRecipientPHIDs();
|
||||
$awards = $badge->getAwards();
|
||||
$recipient_phids = mpull($awards, 'getRecipientPHID');
|
||||
$recipient_phids = array_reverse($recipient_phids);
|
||||
$handles = $this->loadViewerHandles($recipient_phids);
|
||||
|
||||
|
@ -59,7 +60,9 @@ final class PhabricatorBadgesViewController
|
|||
->setHandles($handles)
|
||||
->setUser($viewer);
|
||||
|
||||
$add_comment = $this->buildCommentForm($badge);
|
||||
$comment_view = id(new PhabricatorBadgesEditEngine())
|
||||
->setViewer($viewer)
|
||||
->buildEditEngineCommentView($badge);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
|
@ -67,9 +70,9 @@ final class PhabricatorBadgesViewController
|
|||
->setMainColumn(array(
|
||||
$recipient_list,
|
||||
$timeline,
|
||||
$add_comment,
|
||||
$comment_view,
|
||||
))
|
||||
->addPropertySection(pht('BADGE DETAILS'), $details);
|
||||
->addPropertySection(pht('DESCRIPTION'), $details);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
|
@ -85,25 +88,8 @@ final class PhabricatorBadgesViewController
|
|||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer);
|
||||
|
||||
$quality = idx($badge->getQualityNameMap(), $badge->getQuality());
|
||||
|
||||
$view->addProperty(
|
||||
pht('Quality'),
|
||||
$quality);
|
||||
|
||||
$view->addProperty(
|
||||
pht('Icon'),
|
||||
id(new PhabricatorBadgesIconSet())
|
||||
->getIconLabel($badge->getIcon()));
|
||||
|
||||
$view->addProperty(
|
||||
pht('Flavor'),
|
||||
$badge->getFlavor());
|
||||
|
||||
$description = $badge->getDescription();
|
||||
if (strlen($description)) {
|
||||
$view->addSectionHeader(
|
||||
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
|
||||
$view->addTextContent(
|
||||
new PHUIRemarkupView($viewer, $description));
|
||||
}
|
||||
|
@ -170,24 +156,4 @@ final class PhabricatorBadgesViewController
|
|||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildCommentForm(PhabricatorBadgesBadge $badge) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
|
||||
|
||||
$add_comment_header = $is_serious
|
||||
? pht('Add Comment')
|
||||
: pht('Render Honors');
|
||||
|
||||
$draft = PhabricatorDraft::newFromUserAndKey($viewer, $badge->getPHID());
|
||||
|
||||
return id(new PhabricatorApplicationTransactionCommentView())
|
||||
->setUser($viewer)
|
||||
->setObjectPHID($badge->getPHID())
|
||||
->setDraft($draft)
|
||||
->setHeaderText($add_comment_header)
|
||||
->setAction($this->getApplicationURI('/comment/'.$badge->getID().'/'))
|
||||
->setSubmitButtonName(pht('Add Comment'));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ final class PhabricatorBadgesEditEngine
|
|||
}
|
||||
|
||||
protected function getObjectEditTitleText($object) {
|
||||
return pht('Edit %s', $object->getName());
|
||||
return pht('Edit Badge: %s', $object->getName());
|
||||
}
|
||||
|
||||
protected function getObjectEditShortText($object) {
|
||||
|
@ -45,18 +45,35 @@ final class PhabricatorBadgesEditEngine
|
|||
return pht('Create Badge');
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Badge');
|
||||
}
|
||||
|
||||
protected function getObjectCreateCancelURI($object) {
|
||||
return $this->getApplication()->getApplicationURI('/');
|
||||
}
|
||||
|
||||
protected function getEditorURI() {
|
||||
return $this->getApplication()->getApplicationURI('edit/');
|
||||
}
|
||||
|
||||
protected function getCommentViewHeaderText($object) {
|
||||
return pht('Add Comment');
|
||||
return pht('Render Honors');
|
||||
}
|
||||
|
||||
protected function getCommentViewButtonText($object) {
|
||||
return pht('Submit');
|
||||
return pht('Salute');
|
||||
}
|
||||
|
||||
protected function getObjectViewURI($object) {
|
||||
return $object->getViewURI();
|
||||
}
|
||||
|
||||
protected function getCreateNewObjectPolicy() {
|
||||
return $this->getApplication()->getPolicy(
|
||||
PhabricatorBadgesCreateCapability::CAPABILITY);
|
||||
}
|
||||
|
||||
protected function buildCustomEditFields($object) {
|
||||
|
||||
return array(
|
||||
|
@ -85,7 +102,7 @@ final class PhabricatorBadgesEditEngine
|
|||
->setLabel(pht('Quality'))
|
||||
->setValue($object->getQuality())
|
||||
->setTransactionType(PhabricatorBadgesTransaction::TYPE_QUALITY)
|
||||
->setOptions($object->getQualityNameMap()),
|
||||
->setOptions(PhabricatorBadgesQuality::getDropdownQualityMap()),
|
||||
id(new PhabricatorRemarkupEditField())
|
||||
->setKey('description')
|
||||
->setLabel(pht('Description'))
|
||||
|
|
|
@ -20,6 +20,8 @@ final class PhabricatorBadgesEditor
|
|||
$types[] = PhabricatorBadgesTransaction::TYPE_ICON;
|
||||
$types[] = PhabricatorBadgesTransaction::TYPE_STATUS;
|
||||
$types[] = PhabricatorBadgesTransaction::TYPE_QUALITY;
|
||||
$types[] = PhabricatorBadgesTransaction::TYPE_AWARD;
|
||||
$types[] = PhabricatorBadgesTransaction::TYPE_REVOKE;
|
||||
|
||||
$types[] = PhabricatorTransactions::TYPE_COMMENT;
|
||||
$types[] = PhabricatorTransactions::TYPE_EDGE;
|
||||
|
@ -44,6 +46,11 @@ final class PhabricatorBadgesEditor
|
|||
return $object->getQuality();
|
||||
case PhabricatorBadgesTransaction::TYPE_STATUS:
|
||||
return $object->getStatus();
|
||||
case PhabricatorBadgesTransaction::TYPE_AWARD:
|
||||
$award_phids = mpull($object->getAwards(), 'getRecipientPHID');
|
||||
return $award_phids;
|
||||
case PhabricatorBadgesTransaction::TYPE_REVOKE:
|
||||
return null;
|
||||
}
|
||||
|
||||
return parent::getCustomTransactionOldValue($object, $xaction);
|
||||
|
@ -59,8 +66,11 @@ final class PhabricatorBadgesEditor
|
|||
case PhabricatorBadgesTransaction::TYPE_DESCRIPTION:
|
||||
case PhabricatorBadgesTransaction::TYPE_ICON:
|
||||
case PhabricatorBadgesTransaction::TYPE_STATUS:
|
||||
case PhabricatorBadgesTransaction::TYPE_QUALITY:
|
||||
case PhabricatorBadgesTransaction::TYPE_AWARD:
|
||||
case PhabricatorBadgesTransaction::TYPE_REVOKE:
|
||||
return $xaction->getNewValue();
|
||||
case PhabricatorBadgesTransaction::TYPE_QUALITY:
|
||||
return (int)$xaction->getNewValue();
|
||||
}
|
||||
|
||||
return parent::getCustomTransactionNewValue($object, $xaction);
|
||||
|
@ -90,6 +100,9 @@ final class PhabricatorBadgesEditor
|
|||
case PhabricatorBadgesTransaction::TYPE_STATUS:
|
||||
$object->setStatus($xaction->getNewValue());
|
||||
return;
|
||||
case PhabricatorBadgesTransaction::TYPE_AWARD:
|
||||
case PhabricatorBadgesTransaction::TYPE_REVOKE:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
|
@ -108,6 +121,34 @@ final class PhabricatorBadgesEditor
|
|||
case PhabricatorBadgesTransaction::TYPE_STATUS:
|
||||
case PhabricatorBadgesTransaction::TYPE_QUALITY:
|
||||
return;
|
||||
case PhabricatorBadgesTransaction::TYPE_REVOKE:
|
||||
$revoked_recipient_phids = $xaction->getNewValue();
|
||||
$awards = $object->getAwards();
|
||||
$awards = mpull($awards, null, 'getRecipientPHID');
|
||||
|
||||
foreach ($revoked_recipient_phids as $phid) {
|
||||
$awards[$phid]->delete();
|
||||
}
|
||||
$object->attachAwards($awards);
|
||||
return;
|
||||
case PhabricatorBadgesTransaction::TYPE_AWARD:
|
||||
$recipient_phids = $xaction->getNewValue();
|
||||
$awards = $object->getAwards();
|
||||
$awards = mpull($awards, null, 'getRecipientPHID');
|
||||
|
||||
foreach ($recipient_phids as $phid) {
|
||||
$award = idx($awards, $phid);
|
||||
if (!$award) {
|
||||
$award = PhabricatorBadgesAward::initializeNewBadgesAward(
|
||||
$this->getActor(),
|
||||
$object,
|
||||
$phid);
|
||||
$award->save();
|
||||
$awards[] = $award;
|
||||
}
|
||||
}
|
||||
$object->attachAwards($awards);
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorBadgesAwardQuery
|
||||
extends PhabricatorCursorPagedPolicyAwareQuery {
|
||||
|
||||
private $badgePHIDs;
|
||||
private $recipientPHIDs;
|
||||
private $awarderPHIDs;
|
||||
|
||||
|
||||
protected function willFilterPage(array $awards) {
|
||||
$badges = id(new PhabricatorBadgesQuery())
|
||||
->setViewer($this->getViewer())
|
||||
->withRecipientPHIDs(mpull($awards, null, 'getRecipientPHID'))
|
||||
->execute();
|
||||
|
||||
$badges = mpull($badges, null, 'getPHID');
|
||||
|
||||
foreach ($awards as $key => $award) {
|
||||
$award_badge = idx($badges, $award->getBadgePHID());
|
||||
if ($award_badge === null) {
|
||||
$this->didRejectResult($award);
|
||||
unset($awards[$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
$award->attachBadge($award_badge);
|
||||
}
|
||||
|
||||
return $awards;
|
||||
}
|
||||
|
||||
public function withBadgePHIDs(array $phids) {
|
||||
$this->badgePHIDs = $phids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withRecipientPHIDs(array $phids) {
|
||||
$this->recipientPHIDs = $phids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withAwarderPHIDs(array $phids) {
|
||||
$this->awarderPHIDs = $phids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function loadPage() {
|
||||
return $this->loadStandardPage($this->newResultObject());
|
||||
}
|
||||
|
||||
public function newResultObject() {
|
||||
return new PhabricatorBadgesAward();
|
||||
}
|
||||
|
||||
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
|
||||
$where = parent::buildWhereClauseParts($conn);
|
||||
|
||||
if ($this->badgePHIDs !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'badgePHID IN (%Ls)',
|
||||
$this->badgePHIDs);
|
||||
}
|
||||
|
||||
if ($this->recipientPHIDs !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'recipientPHID IN (%Ls)',
|
||||
$this->recipientPHIDs);
|
||||
}
|
||||
|
||||
if ($this->awarderPHIDs !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'awarderPHID IN (%Ls)',
|
||||
$this->awarderPHIDs);
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
public function getQueryApplicationClass() {
|
||||
return 'PhabricatorBadgesApplication';
|
||||
}
|
||||
|
||||
}
|
|
@ -50,22 +50,17 @@ final class PhabricatorBadgesQuery
|
|||
}
|
||||
|
||||
protected function didFilterPage(array $badges) {
|
||||
|
||||
if ($this->needRecipients) {
|
||||
$edge_query = id(new PhabricatorEdgeQuery())
|
||||
->withSourcePHIDs(mpull($badges, 'getPHID'))
|
||||
->withEdgeTypes(
|
||||
array(
|
||||
PhabricatorBadgeHasRecipientEdgeType::EDGECONST,
|
||||
));
|
||||
$edge_query->execute();
|
||||
$query = id(new PhabricatorBadgesAwardQuery())
|
||||
->setViewer($this->getViewer())
|
||||
->withBadgePHIDs(mpull($badges, 'getPHID'))
|
||||
->execute();
|
||||
|
||||
$awards = mgroup($query, 'getBadgePHID');
|
||||
|
||||
foreach ($badges as $badge) {
|
||||
$phids = $edge_query->getDestinationPHIDs(
|
||||
array(
|
||||
$badge->getPHID(),
|
||||
));
|
||||
$badge->attachRecipientPHIDs($phids);
|
||||
$badge_awards = idx($awards, $badge->getPHID(), array());
|
||||
$badge->attachAwards($badge_awards);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,4 +105,36 @@ final class PhabricatorBadgesQuery
|
|||
return 'PhabricatorBadgesApplication';
|
||||
}
|
||||
|
||||
public function getBuiltinOrders() {
|
||||
return array(
|
||||
'quality' => array(
|
||||
'vector' => array('quality', 'id'),
|
||||
'name' => pht('Rarity (Rarest First)'),
|
||||
),
|
||||
'shoddiness' => array(
|
||||
'vector' => array('-quality', '-id'),
|
||||
'name' => pht('Rarity (Most Common First)'),
|
||||
),
|
||||
) + parent::getBuiltinOrders();
|
||||
}
|
||||
|
||||
public function getOrderableColumns() {
|
||||
return array(
|
||||
'quality' => array(
|
||||
'table' => $this->getPrimaryTableAlias(),
|
||||
'column' => 'quality',
|
||||
'reverse' => true,
|
||||
'type' => 'int',
|
||||
),
|
||||
) + parent::getOrderableColumns();
|
||||
}
|
||||
|
||||
protected function getPagingValueMap($cursor, array $keys) {
|
||||
$badge = $this->loadCursorObject($cursor);
|
||||
return array(
|
||||
'quality' => $badge->getQuality(),
|
||||
'id' => $badge->getID(),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,9 +34,7 @@ final class PhabricatorBadgesSearchEngine
|
|||
id(new PhabricatorSearchCheckboxesField())
|
||||
->setKey('qualities')
|
||||
->setLabel(pht('Quality'))
|
||||
->setOptions(
|
||||
id(new PhabricatorBadgesBadge())
|
||||
->getQualityNameMap()),
|
||||
->setOptions(PhabricatorBadgesQuality::getDropdownQualityMap()),
|
||||
id(new PhabricatorSearchCheckboxesField())
|
||||
->setKey('statuses')
|
||||
->setLabel(pht('Status'))
|
||||
|
@ -110,8 +108,9 @@ final class PhabricatorBadgesSearchEngine
|
|||
|
||||
$list = id(new PHUIObjectItemListView());
|
||||
foreach ($badges as $badge) {
|
||||
$quality_name = PhabricatorBadgesQuality::getQualityName(
|
||||
$badge->getQuality());
|
||||
|
||||
$quality = idx($badge->getQualityNameMap(), $badge->getQuality());
|
||||
$mini_badge = id(new PHUIBadgeMiniView())
|
||||
->setHeader($badge->getName())
|
||||
->setIcon($badge->getIcon())
|
||||
|
@ -121,7 +120,7 @@ final class PhabricatorBadgesSearchEngine
|
|||
->setHeader($badge->getName())
|
||||
->setBadge($mini_badge)
|
||||
->setHref('/badges/view/'.$badge->getID().'/')
|
||||
->addAttribute($quality)
|
||||
->addAttribute($quality_name)
|
||||
->addAttribute($badge->getFlavor());
|
||||
|
||||
if ($badge->isArchived()) {
|
||||
|
|
83
src/applications/badges/storage/PhabricatorBadgesAward.php
Normal file
83
src/applications/badges/storage/PhabricatorBadgesAward.php
Normal file
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorBadgesAward extends PhabricatorBadgesDAO
|
||||
implements
|
||||
PhabricatorDestructibleInterface,
|
||||
PhabricatorPolicyInterface {
|
||||
|
||||
protected $badgePHID;
|
||||
protected $recipientPHID;
|
||||
protected $awarderPHID;
|
||||
|
||||
private $badge = self::ATTACHABLE;
|
||||
|
||||
public static function initializeNewBadgesAward(
|
||||
PhabricatorUser $actor,
|
||||
PhabricatorBadgesBadge $badge,
|
||||
$recipient_phid) {
|
||||
return id(new self())
|
||||
->setRecipientPHID($recipient_phid)
|
||||
->setBadgePHID($badge->getPHID())
|
||||
->setAwarderPHID($actor->getPHID())
|
||||
->attachBadge($badge);
|
||||
}
|
||||
|
||||
protected function getConfiguration() {
|
||||
return array(
|
||||
self::CONFIG_KEY_SCHEMA => array(
|
||||
'key_badge' => array(
|
||||
'columns' => array('badgePHID', 'recipientPHID'),
|
||||
'unique' => true,
|
||||
),
|
||||
'key_recipient' => array(
|
||||
'columns' => array('recipientPHID'),
|
||||
),
|
||||
),
|
||||
) + parent::getConfiguration();
|
||||
}
|
||||
|
||||
public function attachBadge(PhabricatorBadgesBadge $badge) {
|
||||
$this->badge = $badge;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBadge() {
|
||||
return $this->assertAttached($this->badge);
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorDestructibleInterface )----------------------------------- */
|
||||
|
||||
|
||||
public function destroyObjectPermanently(
|
||||
PhabricatorDestructionEngine $engine) {
|
||||
|
||||
$this->openTransaction();
|
||||
$this->delete();
|
||||
$this->saveTransaction();
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
||||
|
||||
|
||||
public function getCapabilities() {
|
||||
return array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
PhabricatorPolicyCapability::CAN_EDIT,
|
||||
);
|
||||
}
|
||||
|
||||
public function getPolicy($capability) {
|
||||
return $this->getBadge()->getPolicy($capability);
|
||||
}
|
||||
|
||||
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function describeAutomaticCapability($capability) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -19,21 +19,12 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO
|
|||
protected $status;
|
||||
protected $creatorPHID;
|
||||
|
||||
private $recipientPHIDs = self::ATTACHABLE;
|
||||
private $awards = self::ATTACHABLE;
|
||||
|
||||
const STATUS_ACTIVE = 'open';
|
||||
const STATUS_ARCHIVED = 'closed';
|
||||
|
||||
const DEFAULT_ICON = 'fa-star';
|
||||
const DEFAULT_QUALITY = 'green';
|
||||
|
||||
const POOR = 'grey';
|
||||
const COMMON = 'white';
|
||||
const UNCOMMON = 'green';
|
||||
const RARE = 'blue';
|
||||
const EPIC = 'indigo';
|
||||
const LEGENDARY = 'orange';
|
||||
const HEIRLOOM = 'yellow';
|
||||
|
||||
public static function getStatusNameMap() {
|
||||
return array(
|
||||
|
@ -42,18 +33,6 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO
|
|||
);
|
||||
}
|
||||
|
||||
public static function getQualityNameMap() {
|
||||
return array(
|
||||
self::POOR => pht('Poor'),
|
||||
self::COMMON => pht('Common'),
|
||||
self::UNCOMMON => pht('Uncommon'),
|
||||
self::RARE => pht('Rare'),
|
||||
self::EPIC => pht('Epic'),
|
||||
self::LEGENDARY => pht('Legendary'),
|
||||
self::HEIRLOOM => pht('Heirloom'),
|
||||
);
|
||||
}
|
||||
|
||||
public static function initializeNewBadge(PhabricatorUser $actor) {
|
||||
$app = id(new PhabricatorApplicationQuery())
|
||||
->setViewer($actor)
|
||||
|
@ -67,7 +46,7 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO
|
|||
|
||||
return id(new PhabricatorBadgesBadge())
|
||||
->setIcon(self::DEFAULT_ICON)
|
||||
->setQuality(self::DEFAULT_QUALITY)
|
||||
->setQuality(PhabricatorBadgesQuality::DEFAULT_QUALITY)
|
||||
->setCreatorPHID($actor->getPHID())
|
||||
->setEditPolicy($edit_policy)
|
||||
->setStatus(self::STATUS_ACTIVE);
|
||||
|
@ -81,7 +60,7 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO
|
|||
'flavor' => 'text255',
|
||||
'description' => 'text',
|
||||
'icon' => 'text255',
|
||||
'quality' => 'text255',
|
||||
'quality' => 'uint32',
|
||||
'status' => 'text32',
|
||||
'mailKey' => 'bytes20',
|
||||
),
|
||||
|
@ -102,13 +81,13 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO
|
|||
return ($this->getStatus() == self::STATUS_ARCHIVED);
|
||||
}
|
||||
|
||||
public function attachRecipientPHIDs(array $phids) {
|
||||
$this->recipientPHIDs = $phids;
|
||||
public function attachAwards(array $awards) {
|
||||
$this->awards = $awards;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRecipientPHIDs() {
|
||||
return $this->assertAttached($this->recipientPHIDs);
|
||||
public function getAwards() {
|
||||
return $this->assertAttached($this->awards);
|
||||
}
|
||||
|
||||
public function getViewURI() {
|
||||
|
@ -197,6 +176,15 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO
|
|||
public function destroyObjectPermanently(
|
||||
PhabricatorDestructionEngine $engine) {
|
||||
|
||||
$awards = id(new PhabricatorBadgesAwardQuery())
|
||||
->setViewer($engine->getViewer())
|
||||
->withBadgePHIDs(array($this->getPHID()))
|
||||
->execute();
|
||||
|
||||
foreach ($awards as $award) {
|
||||
$engine->destroyObjectPermanently($award);
|
||||
}
|
||||
|
||||
$this->openTransaction();
|
||||
$this->delete();
|
||||
$this->saveTransaction();
|
||||
|
|
|
@ -9,6 +9,8 @@ final class PhabricatorBadgesTransaction
|
|||
const TYPE_ICON = 'badges:icon';
|
||||
const TYPE_STATUS = 'badges:status';
|
||||
const TYPE_FLAVOR = 'badges:flavor';
|
||||
const TYPE_AWARD = 'badges:award';
|
||||
const TYPE_REVOKE = 'badges:revoke';
|
||||
|
||||
const MAILTAG_DETAILS = 'badges:details';
|
||||
const MAILTAG_COMMENT = 'badges:comment';
|
||||
|
@ -71,6 +73,18 @@ final class PhabricatorBadgesTransaction
|
|||
$this->renderHandleLink($author_phid));
|
||||
}
|
||||
break;
|
||||
case self::TYPE_STATUS:
|
||||
switch ($new) {
|
||||
case PhabricatorBadgesBadge::STATUS_ACTIVE:
|
||||
return pht(
|
||||
'%s activated this badge.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case PhabricatorBadgesBadge::STATUS_ARCHIVED:
|
||||
return pht(
|
||||
'%s archived this badge.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
}
|
||||
break;
|
||||
case self::TYPE_ICON:
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
|
@ -97,9 +111,8 @@ final class PhabricatorBadgesTransaction
|
|||
$this->renderHandleLink($author_phid),
|
||||
$new);
|
||||
} else {
|
||||
$qual_map = PhabricatorBadgesBadge::getQualityNameMap();
|
||||
$qual_new = idx($qual_map, $new, $new);
|
||||
$qual_old = idx($qual_map, $old, $old);
|
||||
$qual_new = PhabricatorBadgesQuality::getQualityName($new);
|
||||
$qual_old = PhabricatorBadgesQuality::getQualityName($old);
|
||||
return pht(
|
||||
'%s updated the quality for this badge from "%s" to "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
|
@ -107,6 +120,26 @@ final class PhabricatorBadgesTransaction
|
|||
$qual_new);
|
||||
}
|
||||
break;
|
||||
case self::TYPE_AWARD:
|
||||
if (!is_array($new)) {
|
||||
$new = array();
|
||||
}
|
||||
$handles = $this->renderHandleList($new);
|
||||
return pht(
|
||||
'%s awarded this badge to %s recipient(s): %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
new PhutilNumber(count($new)),
|
||||
$handles);
|
||||
case self::TYPE_REVOKE:
|
||||
if (!is_array($new)) {
|
||||
$new = array();
|
||||
}
|
||||
$handles = $this->renderHandleList($new);
|
||||
return pht(
|
||||
'%s revoked this badge from %s recipient(s): %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
new PhutilNumber(count($new)),
|
||||
$handles);
|
||||
}
|
||||
|
||||
return parent::getTitle();
|
||||
|
@ -169,6 +202,28 @@ final class PhabricatorBadgesTransaction
|
|||
$this->renderHandleLink($object_phid));
|
||||
}
|
||||
break;
|
||||
case self::TYPE_AWARD:
|
||||
if (!is_array($new)) {
|
||||
$new = array();
|
||||
}
|
||||
$handles = $this->renderHandleList($new);
|
||||
return pht(
|
||||
'%s awarded %s to %s recipient(s): %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid),
|
||||
new PhutilNumber(count($new)),
|
||||
$handles);
|
||||
case self::TYPE_REVOKE:
|
||||
if (!is_array($new)) {
|
||||
$new = array();
|
||||
}
|
||||
$handles = $this->renderHandleList($new);
|
||||
return pht(
|
||||
'%s revoked %s from %s recipient(s): %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid),
|
||||
new PhutilNumber(count($new)),
|
||||
$handles);
|
||||
}
|
||||
|
||||
return parent::getTitleForFeed();
|
||||
|
@ -221,4 +276,24 @@ final class PhabricatorBadgesTransaction
|
|||
$this->getOldValue(),
|
||||
$this->getNewValue());
|
||||
}
|
||||
|
||||
public function getRequiredHandlePHIDs() {
|
||||
$phids = parent::getRequiredHandlePHIDs();
|
||||
|
||||
$type = $this->getTransactionType();
|
||||
switch ($type) {
|
||||
case self::TYPE_AWARD:
|
||||
case self::TYPE_REVOKE:
|
||||
$new = $this->getNewValue();
|
||||
if (!is_array($new)) {
|
||||
$new = array();
|
||||
}
|
||||
foreach ($new as $phid) {
|
||||
$phids[] = $phid;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return $phids;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@ final class PhabricatorBadgesRecipientsListView extends AphrontView {
|
|||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$list = id(new PHUIObjectItemListView())
|
||||
->setNoDataString(pht('This badge does not have any recipients.'));
|
||||
->setNoDataString(pht('This badge does not have any recipients.'))
|
||||
->setFlush(true);
|
||||
|
||||
foreach ($handles as $handle) {
|
||||
$remove_uri = '/badges/recipients/'.
|
||||
|
@ -51,7 +52,8 @@ final class PhabricatorBadgesRecipientsListView extends AphrontView {
|
|||
}
|
||||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Recipients'))
|
||||
->setHeaderText(pht('RECIPIENTS'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($list);
|
||||
|
||||
return $box;
|
||||
|
|
|
@ -69,7 +69,8 @@ final class PhabricatorCalendarEventEditController
|
|||
$recurrence_end_date_value->setOptional(true);
|
||||
|
||||
$submit_label = pht('Create');
|
||||
$page_title = pht('Create Event');
|
||||
$title = pht('Create Event');
|
||||
$header_icon = 'fa-plus-square';
|
||||
$redirect = 'created';
|
||||
$subscribers = array();
|
||||
$invitees = array($user_phid);
|
||||
|
@ -121,7 +122,8 @@ final class PhabricatorCalendarEventEditController
|
|||
->setOptional(true);
|
||||
|
||||
$submit_label = pht('Update');
|
||||
$page_title = pht('Update Event');
|
||||
$title = pht('Edit Event: %s', $event->getName());
|
||||
$header_icon = 'fa-pencil';
|
||||
|
||||
$subscribers = PhabricatorSubscribersQuery::loadSubscribersForPHID(
|
||||
$event->getPHID());
|
||||
|
@ -540,7 +542,7 @@ final class PhabricatorCalendarEventEditController
|
|||
|
||||
if ($request->isAjax()) {
|
||||
return $this->newDialog()
|
||||
->setTitle($page_title)
|
||||
->setTitle($title)
|
||||
->setWidth(AphrontDialogView::WIDTH_FULL)
|
||||
->appendForm($form)
|
||||
->addCancelButton($cancel_uri)
|
||||
|
@ -554,30 +556,35 @@ final class PhabricatorCalendarEventEditController
|
|||
$form->appendChild($submit);
|
||||
|
||||
$form_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($page_title)
|
||||
->setHeaderText(pht('Event'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setValidationException($validation_exception)
|
||||
->setForm($form);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
|
||||
if (!$this->isCreate()) {
|
||||
$crumbs->addTextCrumb('E'.$event->getId(), '/E'.$event->getId());
|
||||
$crumb_title = pht('Edit Event');
|
||||
} else {
|
||||
$crumb_title = pht('Create Event');
|
||||
}
|
||||
|
||||
$crumbs->addTextCrumb($page_title);
|
||||
$crumbs->addTextCrumb($crumb_title);
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($page_title)
|
||||
->setValidationException($validation_exception)
|
||||
->appendChild($form);
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setHeaderIcon($header_icon);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$object_box,
|
||||
),
|
||||
array(
|
||||
'title' => $page_title,
|
||||
));
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($form_box);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -57,4 +57,9 @@ final class ConduitAPIRequest extends Phobject {
|
|||
return $this->isClusterRequest;
|
||||
}
|
||||
|
||||
public function newContentSource() {
|
||||
return PhabricatorContentSource::newForSource(
|
||||
PhabricatorConduitContentSource::SOURCECONST);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ final class ConpherenceRoomTestCase extends ConpherenceTestCase {
|
|||
|
||||
id(new ConpherenceEditor())
|
||||
->setActor($creator)
|
||||
->setContentSource(PhabricatorContentSource::newConsoleSource())
|
||||
->setContentSource($this->newContentSource())
|
||||
->setContinueOnNoEffect(true)
|
||||
->applyTransactions($conpherence, $xactions);
|
||||
|
||||
|
@ -166,7 +166,7 @@ final class ConpherenceRoomTestCase extends ConpherenceTestCase {
|
|||
|
||||
id(new ConpherenceEditor())
|
||||
->setActor($actor)
|
||||
->setContentSource(PhabricatorContentSource::newConsoleSource())
|
||||
->setContentSource($this->newContentSource())
|
||||
->setContinueOnNoEffect(true)
|
||||
->applyTransactions($room, $xactions);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ abstract class ConpherenceTestCase extends PhabricatorTestCase {
|
|||
);
|
||||
$editor = id(new ConpherenceEditor())
|
||||
->setActor($actor)
|
||||
->setContentSource(PhabricatorContentSource::newConsoleSource())
|
||||
->setContentSource($this->newContentSource())
|
||||
->applyTransactions($conpherence, $xactions);
|
||||
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ abstract class ConpherenceTestCase extends PhabricatorTestCase {
|
|||
);
|
||||
$editor = id(new ConpherenceEditor())
|
||||
->setActor($actor)
|
||||
->setContentSource(PhabricatorContentSource::newConsoleSource())
|
||||
->setContentSource($this->newContentSource())
|
||||
->applyTransactions($conpherence, $xactions);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ abstract class ConpherenceTestCase extends PhabricatorTestCase {
|
|||
|
||||
$editor = id(new ConpherenceEditor())
|
||||
->setActor($actor)
|
||||
->setContentSource(PhabricatorContentSource::newConsoleSource());
|
||||
->setContentSource($this->newContentSource());
|
||||
|
||||
$xactions = $editor->generateTransactionsFromText(
|
||||
$actor,
|
||||
|
|
|
@ -42,7 +42,7 @@ final class ConpherenceCreateThreadConduitAPIMethod
|
|||
$participant_phids,
|
||||
$title,
|
||||
$message,
|
||||
PhabricatorContentSource::newFromConduitRequest($request));
|
||||
$request->newContentSource());
|
||||
|
||||
if ($errors) {
|
||||
foreach ($errors as $error_code) {
|
||||
|
|
|
@ -58,7 +58,7 @@ final class ConpherenceUpdateThreadConduitAPIMethod
|
|||
throw new ConduitException('ERR_USAGE_ROOM_NOT_FOUND');
|
||||
}
|
||||
|
||||
$source = PhabricatorContentSource::newFromConduitRequest($request);
|
||||
$source = $request->newContentSource();
|
||||
$editor = id(new ConpherenceEditor())
|
||||
->setContentSource($source)
|
||||
->setActor($user);
|
||||
|
|
|
@ -48,11 +48,7 @@ final class ConpherenceReplyHandler extends PhabricatorMailReplyHandler {
|
|||
$conpherence->attachParticipants($participants);
|
||||
}
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_EMAIL,
|
||||
array(
|
||||
'id' => $mail->getID(),
|
||||
));
|
||||
$content_source = $mail->newContentSource();
|
||||
|
||||
$editor = id(new ConpherenceEditor())
|
||||
->setActor($user)
|
||||
|
|
|
@ -8,7 +8,6 @@ final class PhabricatorCountdownEditController
|
|||
$id = $request->getURIData('id');
|
||||
|
||||
if ($id) {
|
||||
$page_title = pht('Edit Countdown');
|
||||
$countdown = id(new PhabricatorCountdownQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($id))
|
||||
|
@ -28,8 +27,9 @@ final class PhabricatorCountdownEditController
|
|||
$countdown->getPHID(),
|
||||
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
|
||||
$v_projects = array_reverse($v_projects);
|
||||
$title = pht('Edit Countdown: %s', $countdown->getTitle());
|
||||
} else {
|
||||
$page_title = pht('Create Countdown');
|
||||
$title = pht('Create Countdown');
|
||||
$countdown = PhabricatorCountdown::initializeNewCountdown($viewer);
|
||||
$date_value = AphrontFormDateControlValue::newFromEpoch(
|
||||
$viewer, PhabricatorTime::getNow());
|
||||
|
@ -116,6 +116,7 @@ final class PhabricatorCountdownEditController
|
|||
}
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$cancel_uri = '/countdown/';
|
||||
if ($countdown->getID()) {
|
||||
|
@ -123,9 +124,11 @@ final class PhabricatorCountdownEditController
|
|||
$crumbs->addTextCrumb('C'.$countdown->getID(), $cancel_uri);
|
||||
$crumbs->addTextCrumb(pht('Edit'));
|
||||
$submit_label = pht('Save Changes');
|
||||
$header_icon = 'fa-pencil';
|
||||
} else {
|
||||
$crumbs->addTextCrumb(pht('Create Countdown'));
|
||||
$submit_label = pht('Create Countdown');
|
||||
$header_icon = 'fa-plus-square';
|
||||
}
|
||||
|
||||
$policies = id(new PhabricatorPolicyQuery())
|
||||
|
@ -180,16 +183,25 @@ final class PhabricatorCountdownEditController
|
|||
->setValue($submit_label));
|
||||
|
||||
$form_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($page_title)
|
||||
->setHeaderText(pht('Countdown'))
|
||||
->setFormErrors($errors)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($form);
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setHeaderIcon($header_icon);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($form_box);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($page_title)
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild(
|
||||
array(
|
||||
$form_box,
|
||||
$view,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -45,13 +45,11 @@ final class DifferentialCloseConduitAPIMethod
|
|||
->setTransactionType(DifferentialTransaction::TYPE_ACTION)
|
||||
->setNewValue(DifferentialAction::ACTION_CLOSE);
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_CONDUIT,
|
||||
array());
|
||||
$content_source = $request->newContentSource();
|
||||
|
||||
$editor = id(new DifferentialTransactionEditor())
|
||||
->setActor($viewer)
|
||||
->setContentSourceFromConduitRequest($request)
|
||||
->setContentSource($request->newContentSource())
|
||||
->setContinueOnMissingFields(true)
|
||||
->setContinueOnNoEffect(true);
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ abstract class DifferentialConduitAPIMethod extends ConduitAPIMethod {
|
|||
|
||||
$editor = id(new DifferentialTransactionEditor())
|
||||
->setActor($viewer)
|
||||
->setContentSourceFromConduitRequest($request)
|
||||
->setContentSource($request->newContentSource())
|
||||
->setContinueOnNoEffect(true)
|
||||
->setContinueOnMissingFields(true);
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ final class DifferentialCreateCommentConduitAPIMethod
|
|||
$editor = id(new DifferentialTransactionEditor())
|
||||
->setActor($viewer)
|
||||
->setDisableEmail($request->getValue('silent'))
|
||||
->setContentSourceFromConduitRequest($request)
|
||||
->setContentSource($request->newContentSource())
|
||||
->setContinueOnNoEffect(true)
|
||||
->setContinueOnMissingFields(true);
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ final class DifferentialCreateDiffConduitAPIMethod
|
|||
|
||||
id(new DifferentialDiffEditor())
|
||||
->setActor($viewer)
|
||||
->setContentSourceFromConduitRequest($request)
|
||||
->setContentSource($request->newContentSource())
|
||||
->setContinueOnNoEffect(true)
|
||||
->applyTransactions($diff, $xactions);
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ final class DifferentialCreateRawDiffConduitAPIMethod
|
|||
|
||||
id(new DifferentialDiffEditor())
|
||||
->setActor($viewer)
|
||||
->setContentSourceFromConduitRequest($request)
|
||||
->setContentSource($request->newContentSource())
|
||||
->setContinueOnNoEffect(true)
|
||||
->setLookupRepository(false) // respect user choice
|
||||
->applyTransactions($diff, $xactions);
|
||||
|
|
|
@ -275,6 +275,7 @@ final class DifferentialChangesetViewController extends DifferentialController {
|
|||
->setRenderURI('/differential/changeset/')
|
||||
->setDiff($diff)
|
||||
->setTitle(pht('Standalone View'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setParser($parser);
|
||||
|
||||
if ($revision_id) {
|
||||
|
@ -296,16 +297,20 @@ final class DifferentialChangesetViewController extends DifferentialController {
|
|||
}
|
||||
|
||||
$crumbs->addTextCrumb($changeset->getDisplayFilename());
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$detail,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Changeset View'),
|
||||
'device' => false,
|
||||
));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Changeset View'))
|
||||
->setHeaderIcon('fa-gear');
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($detail);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Changeset View'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildRawFileResponse(
|
||||
|
|
|
@ -124,10 +124,12 @@ final class DifferentialDiffCreateController extends DifferentialController {
|
|||
$title = pht('Update Diff');
|
||||
$header = pht('Update Diff');
|
||||
$button = pht('Continue');
|
||||
$header_icon = 'fa-upload';
|
||||
} else {
|
||||
$title = pht('Create Diff');
|
||||
$header = pht('Create New Diff');
|
||||
$button = pht('Create Diff');
|
||||
$header_icon = 'fa-plus-square';
|
||||
}
|
||||
|
||||
$form
|
||||
|
@ -180,15 +182,12 @@ final class DifferentialDiffCreateController extends DifferentialController {
|
|||
->setValue($button));
|
||||
|
||||
$form_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($header)
|
||||
->setHeaderText(pht('Diff'))
|
||||
->setValidationException($validation_exception)
|
||||
->setForm($form)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setFormErrors($errors);
|
||||
|
||||
if ($info_view) {
|
||||
$form_box->setInfoView($info_view);
|
||||
}
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
if ($revision) {
|
||||
$crumbs->addTextCrumb(
|
||||
|
@ -196,15 +195,23 @@ final class DifferentialDiffCreateController extends DifferentialController {
|
|||
'/'.$revision->getMonogram());
|
||||
}
|
||||
$crumbs->addTextCrumb($title);
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setHeaderIcon($header_icon);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$info_view,
|
||||
$form_box,
|
||||
),
|
||||
array(
|
||||
'title' => $title,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -171,35 +171,44 @@ final class DifferentialRevisionEditController
|
|||
$crumbs = $this->buildApplicationCrumbs();
|
||||
if ($revision->getID()) {
|
||||
if ($diff) {
|
||||
$header_icon = 'fa-upload';
|
||||
$title = pht('Update Differential Revision');
|
||||
$crumbs->addTextCrumb(
|
||||
'D'.$revision->getID(),
|
||||
'/differential/diff/'.$diff->getID().'/');
|
||||
} else {
|
||||
$header_icon = 'fa-pencil';
|
||||
$title = pht('Edit Differential Revision');
|
||||
$crumbs->addTextCrumb(
|
||||
'D'.$revision->getID(),
|
||||
'/D'.$revision->getID());
|
||||
}
|
||||
} else {
|
||||
$header_icon = 'fa-plus-square';
|
||||
$title = pht('Create New Differential Revision');
|
||||
}
|
||||
|
||||
$form_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($title)
|
||||
->setHeaderText('Revision')
|
||||
->setValidationException($validation_exception)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($form);
|
||||
|
||||
$crumbs->addTextCrumb($title);
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$form_box,
|
||||
),
|
||||
array(
|
||||
'title' => $title,
|
||||
));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setHeaderIcon($header_icon);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($form_box);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -68,9 +68,7 @@ final class PhabricatorDifferentialAttachCommitWorkflow
|
|||
->setViewer($viewer)
|
||||
->setAuthorPHID($differential_phid);
|
||||
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_CONSOLE,
|
||||
array());
|
||||
$content_source = $this->newContentSource();
|
||||
|
||||
$extraction_engine->updateRevisionWithCommit(
|
||||
$revision,
|
||||
|
|
|
@ -376,7 +376,7 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
if (!$new) {
|
||||
$th_new = phutil_tag('th', array());
|
||||
} else {
|
||||
$th_new = phutil_tag('th', array('id' => "C{$id}OL1"), 1);
|
||||
$th_new = phutil_tag('th', array('id' => "C{$id}NL1"), 1);
|
||||
}
|
||||
|
||||
$output = hsprintf(
|
||||
|
|
|
@ -18,8 +18,7 @@ final class DifferentialInlineComment
|
|||
|
||||
public function getTransactionCommentForSave() {
|
||||
$content_source = PhabricatorContentSource::newForSource(
|
||||
PhabricatorContentSource::SOURCE_LEGACY,
|
||||
array());
|
||||
PhabricatorOldWorldContentSource::SOURCECONST);
|
||||
|
||||
$this->proxy
|
||||
->setViewPolicy('public')
|
||||
|
|
|
@ -95,7 +95,7 @@ final class DiffusionCreateCommentConduitAPIMethod
|
|||
|
||||
id(new PhabricatorAuditEditor())
|
||||
->setActor($request->getUser())
|
||||
->setContentSourceFromConduitRequest($request)
|
||||
->setContentSource($request->newContentSource())
|
||||
->setDisableEmail($request->getValue('silent'))
|
||||
->setContinueOnMissingFields(true)
|
||||
->applyTransactions($commit, $xactions);
|
||||
|
|
|
@ -995,8 +995,8 @@ final class DiffusionBrowseController extends DiffusionController {
|
|||
array $lines,
|
||||
array $blame_list,
|
||||
array $blame_commits,
|
||||
$show_color,
|
||||
$show_blame) {
|
||||
$show_blame,
|
||||
$show_color) {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$viewer = $this->getViewer();
|
||||
|
@ -1233,27 +1233,29 @@ final class DiffusionBrowseController extends DiffusionController {
|
|||
"\xC2\xAB");
|
||||
}
|
||||
|
||||
$row[] = phutil_tag(
|
||||
'th',
|
||||
array(
|
||||
'class' => 'diffusion-blame-link',
|
||||
),
|
||||
$before_link);
|
||||
if ($show_blame) {
|
||||
$row[] = phutil_tag(
|
||||
'th',
|
||||
array(
|
||||
'class' => 'diffusion-blame-link',
|
||||
),
|
||||
$before_link);
|
||||
|
||||
$object_links = array();
|
||||
$object_links[] = $commit_link;
|
||||
if ($revision_link) {
|
||||
$object_links[] = phutil_tag('span', array(), '/');
|
||||
$object_links[] = $revision_link;
|
||||
$object_links = array();
|
||||
$object_links[] = $commit_link;
|
||||
if ($revision_link) {
|
||||
$object_links[] = phutil_tag('span', array(), '/');
|
||||
$object_links[] = $revision_link;
|
||||
}
|
||||
|
||||
$row[] = phutil_tag(
|
||||
'th',
|
||||
array(
|
||||
'class' => 'diffusion-rev-link',
|
||||
),
|
||||
$object_links);
|
||||
}
|
||||
|
||||
$row[] = phutil_tag(
|
||||
'th',
|
||||
array(
|
||||
'class' => 'diffusion-rev-link',
|
||||
),
|
||||
$object_links);
|
||||
|
||||
$line_link = phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
|
|
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
|
||||
final class DoorkeeperBridgeGitHubUser
|
||||
extends DoorkeeperBridgeGitHub {
|
||||
|
||||
const OBJTYPE_GITHUB_USER = 'github.user';
|
||||
|
||||
public function canPullRef(DoorkeeperObjectRef $ref) {
|
||||
if (!parent::canPullRef($ref)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($ref->getObjectType() !== self::OBJTYPE_GITHUB_USER) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function pullRefs(array $refs) {
|
||||
$token = $this->getGitHubAccessToken();
|
||||
if (!strlen($token)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$template = id(new PhutilGitHubFuture())
|
||||
->setAccessToken($token);
|
||||
|
||||
$futures = array();
|
||||
$id_map = mpull($refs, 'getObjectID', 'getObjectKey');
|
||||
foreach ($id_map as $key => $id) {
|
||||
// GitHub doesn't provide a way to query for users by ID directly, but we
|
||||
// can list all users, ordered by ID, starting at some particular ID,
|
||||
// with a page size of one, which will achieve the desired effect.
|
||||
$one_less = ($id - 1);
|
||||
$uri = "/users?since={$one_less}&per_page=1";
|
||||
|
||||
$data = array();
|
||||
$futures[$key] = id(clone $template)
|
||||
->setRawGitHubQuery($uri, $data);
|
||||
}
|
||||
|
||||
$results = array();
|
||||
$failed = array();
|
||||
foreach (new FutureIterator($futures) as $key => $future) {
|
||||
try {
|
||||
$results[$key] = $future->resolve();
|
||||
} catch (Exception $ex) {
|
||||
if (($ex instanceof HTTPFutureResponseStatus) &&
|
||||
($ex->getStatusCode() == 404)) {
|
||||
// TODO: Do we end up here for deleted objects and invisible
|
||||
// objects?
|
||||
} else {
|
||||
phlog($ex);
|
||||
$failed[$key] = $ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
foreach ($refs as $ref) {
|
||||
$ref->setAttribute('name', pht('GitHub User %s', $ref->getObjectID()));
|
||||
|
||||
$did_fail = idx($failed, $ref->getObjectKey());
|
||||
if ($did_fail) {
|
||||
$ref->setSyncFailed(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
$result = idx($results, $ref->getObjectKey());
|
||||
if (!$result) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$body = $result->getBody();
|
||||
if (!is_array($body) || !count($body)) {
|
||||
$ref->setSyncFailed(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
$spec = head($body);
|
||||
if (!is_array($spec)) {
|
||||
$ref->setSyncFailed(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Because we're using a paging query to load each user, if a user (say,
|
||||
// user ID 123) does not exist for some reason, we might get the next
|
||||
// user (say, user ID 124) back. Make sure the user we got back is really
|
||||
// the user we expect.
|
||||
$id = idx($spec, 'id');
|
||||
if ($id !== $ref->getObjectID()) {
|
||||
$ref->setSyncFailed(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
$ref->setIsVisible(true);
|
||||
$ref->setAttribute('api.raw', $spec);
|
||||
$ref->setAttribute('name', $spec['login']);
|
||||
|
||||
$obj = $ref->getExternalObject();
|
||||
$this->fillObjectFromData($obj, $spec);
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
$obj->save();
|
||||
unset($unguarded);
|
||||
}
|
||||
}
|
||||
|
||||
public function fillObjectFromData(DoorkeeperExternalObject $obj, $spec) {
|
||||
$uri = $spec['html_url'];
|
||||
$obj->setObjectURI($uri);
|
||||
|
||||
$login = $spec['login'];
|
||||
|
||||
$obj->setDisplayName(pht('%s <%s>', $login, pht('GitHub')));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
final class DoorkeeperExternalObjectPHIDType
|
||||
extends PhabricatorPHIDType {
|
||||
|
||||
const TYPECONST = 'XOBJ';
|
||||
|
||||
public function getTypeName() {
|
||||
return pht('External Object');
|
||||
}
|
||||
|
||||
public function newObject() {
|
||||
return new DoorkeeperExternalObject();
|
||||
}
|
||||
|
||||
public function getPHIDTypeApplicationClass() {
|
||||
return 'PhabricatorDoorkeeperApplication';
|
||||
}
|
||||
|
||||
protected function buildQueryForObjects(
|
||||
PhabricatorObjectQuery $query,
|
||||
array $phids) {
|
||||
|
||||
return id(new DoorkeeperExternalObjectQuery())
|
||||
->withPHIDs($phids);
|
||||
}
|
||||
|
||||
public function loadHandles(
|
||||
PhabricatorHandleQuery $query,
|
||||
array $handles,
|
||||
array $objects) {
|
||||
|
||||
foreach ($handles as $phid => $handle) {
|
||||
$xobj = $objects[$phid];
|
||||
|
||||
$uri = $xobj->getObjectURI();
|
||||
$name = $xobj->getDisplayName();
|
||||
$full_name = $xobj->getDisplayFullName();
|
||||
|
||||
$handle
|
||||
->setURI($uri)
|
||||
->setName($name)
|
||||
->setFullName($full_name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -16,40 +16,32 @@ final class DoorkeeperExternalObjectQuery
|
|||
return $this;
|
||||
}
|
||||
|
||||
protected function loadPage() {
|
||||
$table = new DoorkeeperExternalObject();
|
||||
$conn_r = $table->establishConnection('r');
|
||||
|
||||
$data = queryfx_all(
|
||||
$conn_r,
|
||||
'SELECT * FROM %T %Q %Q %Q',
|
||||
$table->getTableName(),
|
||||
$this->buildWhereClause($conn_r),
|
||||
$this->buildOrderClause($conn_r),
|
||||
$this->buildLimitClause($conn_r));
|
||||
|
||||
return $table->loadAllFromArray($data);
|
||||
public function newResultObject() {
|
||||
return new DoorkeeperExternalObject();
|
||||
}
|
||||
|
||||
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
|
||||
$where = array();
|
||||
protected function loadPage() {
|
||||
return $this->loadStandardPage($this->newResultObject());
|
||||
}
|
||||
|
||||
if ($this->phids) {
|
||||
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
|
||||
$where = parent::buildWhereClauseParts($conn);
|
||||
|
||||
if ($this->phids !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn_r,
|
||||
$conn,
|
||||
'phid IN (%Ls)',
|
||||
$this->phids);
|
||||
}
|
||||
|
||||
if ($this->objectKeys) {
|
||||
if ($this->objectKeys !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn_r,
|
||||
$conn,
|
||||
'objectKey IN (%Ls)',
|
||||
$this->objectKeys);
|
||||
}
|
||||
|
||||
$where[] = $this->buildPagingClause($conn_r);
|
||||
return $this->formatWhereClause($where);
|
||||
return $where;
|
||||
}
|
||||
|
||||
public function getQueryApplicationClass() {
|
||||
|
|
|
@ -47,7 +47,7 @@ final class DoorkeeperExternalObject extends DoorkeeperDAO
|
|||
|
||||
public function generatePHID() {
|
||||
return PhabricatorPHID::generateNewPHID(
|
||||
PhabricatorPHIDConstants::PHID_TYPE_XOBJ);
|
||||
DoorkeeperExternalObjectPHIDType::TYPECONST);
|
||||
}
|
||||
|
||||
public function getProperty($key, $default = null) {
|
||||
|
@ -83,6 +83,27 @@ final class DoorkeeperExternalObject extends DoorkeeperDAO
|
|||
return parent::save();
|
||||
}
|
||||
|
||||
public function setDisplayName($display_name) {
|
||||
return $this->setProperty('xobj.name.display', $display_name);
|
||||
}
|
||||
|
||||
public function getDisplayName() {
|
||||
return $this->getProperty('xobj.name.display', pht('External Object'));
|
||||
}
|
||||
|
||||
public function setDisplayFullName($full_name) {
|
||||
return $this->setProperty('xobj.name.display-full', $full_name);
|
||||
}
|
||||
|
||||
public function getDisplayFullName() {
|
||||
$full_name = $this->getProperty('xobj.name.display-full');
|
||||
|
||||
if ($full_name !== null) {
|
||||
return $full_name;
|
||||
}
|
||||
|
||||
return $this->getDisplayName();
|
||||
}
|
||||
|
||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
||||
|
||||
|
|
|
@ -75,6 +75,10 @@ final class DrydockBlueprintEditEngine
|
|||
return pht('Create Blueprint');
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Blueprint');
|
||||
}
|
||||
|
||||
protected function getEditorURI() {
|
||||
return '/drydock/blueprint/edit/';
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ final class PhabricatorFundApplication extends PhabricatorApplication {
|
|||
'/fund/' => array(
|
||||
'(?:query/(?P<queryKey>[^/]+)/)?' => 'FundInitiativeListController',
|
||||
'create/' => 'FundInitiativeEditController',
|
||||
'comment/(?P<id>[1-9]\d*)/' => 'FundInitiativeCommentController',
|
||||
'edit/(?:(?P<id>\d+)/)?' => 'FundInitiativeEditController',
|
||||
'close/(?P<id>\d+)/' => 'FundInitiativeCloseController',
|
||||
'back/(?P<id>\d+)/' => 'FundInitiativeBackController',
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
|
||||
final class FundInitiativeCommentController
|
||||
extends FundController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$id = $request->getURIData('id');
|
||||
|
||||
if (!$request->isFormPost()) {
|
||||
return new Aphront400Response();
|
||||
}
|
||||
|
||||
$initiative = id(new FundInitiativeQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($id))
|
||||
->executeOne();
|
||||
if (!$initiative) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$is_preview = $request->isPreviewRequest();
|
||||
$draft = PhabricatorDraft::buildFromRequest($request);
|
||||
|
||||
$view_uri = '/'.$initiative->getMonogram();
|
||||
|
||||
$xactions = array();
|
||||
$xactions[] = id(new FundInitiativeTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
|
||||
->attachComment(
|
||||
id(new FundInitiativeTransactionComment())
|
||||
->setContent($request->getStr('comment')));
|
||||
|
||||
$editor = id(new FundInitiativeEditor())
|
||||
->setActor($viewer)
|
||||
->setContinueOnNoEffect($request->isContinueRequest())
|
||||
->setContentSourceFromRequest($request)
|
||||
->setIsPreview($is_preview);
|
||||
|
||||
try {
|
||||
$xactions = $editor->applyTransactions($initiative, $xactions);
|
||||
} catch (PhabricatorApplicationTransactionNoEffectException $ex) {
|
||||
return id(new PhabricatorApplicationTransactionNoEffectResponse())
|
||||
->setCancelURI($view_uri)
|
||||
->setException($ex);
|
||||
}
|
||||
|
||||
if ($draft) {
|
||||
$draft->replaceOrDelete();
|
||||
}
|
||||
|
||||
if ($request->isAjax() && $is_preview) {
|
||||
return id(new PhabricatorApplicationTransactionResponse())
|
||||
->setViewer($viewer)
|
||||
->setTransactions($xactions)
|
||||
->setIsPreview($is_preview);
|
||||
} else {
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setURI($view_uri);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -52,12 +52,16 @@ final class FundInitiativeViewController
|
|||
$timeline = $this->buildTransactionTimeline(
|
||||
$initiative,
|
||||
new FundInitiativeTransactionQuery());
|
||||
$timeline->setShouldTerminate(true);
|
||||
|
||||
$add_comment = $this->buildCommentForm($initiative);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn($timeline)
|
||||
->setMainColumn(array(
|
||||
$timeline,
|
||||
$add_comment,
|
||||
))
|
||||
->addPropertySection(pht('DETAILS'), $details);
|
||||
|
||||
return $this->newPage()
|
||||
|
@ -160,4 +164,27 @@ final class FundInitiativeViewController
|
|||
return $curtain;
|
||||
}
|
||||
|
||||
private function buildCommentForm(FundInitiative $initiative) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
|
||||
|
||||
$add_comment_header = $is_serious
|
||||
? pht('Add Comment')
|
||||
: pht('Add Liquidity');
|
||||
|
||||
$draft = PhabricatorDraft::newFromUserAndKey(
|
||||
$viewer, $initiative->getPHID());
|
||||
|
||||
return id(new PhabricatorApplicationTransactionCommentView())
|
||||
->setUser($viewer)
|
||||
->setObjectPHID($initiative->getPHID())
|
||||
->setDraft($draft)
|
||||
->setHeaderText($add_comment_header)
|
||||
->setAction(
|
||||
$this->getApplicationURI('/comment/'.$initiative->getID().'/'))
|
||||
->setSubmitButtonName(pht('Add Comment'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ final class FundInitiativeEditor
|
|||
$types[] = FundInitiativeTransaction::TYPE_MERCHANT;
|
||||
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
||||
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
|
||||
$types[] = PhabricatorTransactions::TYPE_COMMENT;
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ final class FundInitiativeTransaction
|
|||
}
|
||||
|
||||
public function getApplicationTransactionCommentObject() {
|
||||
return null;
|
||||
return new FundInitiativeTransactionComment();
|
||||
}
|
||||
|
||||
public function getRequiredHandlePHIDs() {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
final class NuanceRequestorTransactionComment
|
||||
final class FundInitiativeTransactionComment
|
||||
extends PhabricatorApplicationTransactionComment {
|
||||
|
||||
public function getApplicationTransactionObject() {
|
||||
return new NuanceRequestorTransaction();
|
||||
return new FundInitiativeTransaction();
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue