mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-15 18:10:53 +01:00
(stable) Promote 2017 Week 18
This commit is contained in:
commit
ebb64ca3c9
170 changed files with 4905 additions and 4514 deletions
|
@ -9,8 +9,8 @@ return array(
|
|||
'names' => array(
|
||||
'conpherence.pkg.css' => 'ff161f2d',
|
||||
'conpherence.pkg.js' => 'b5b51108',
|
||||
'core.pkg.css' => '84ce260a',
|
||||
'core.pkg.js' => 'fffe0122',
|
||||
'core.pkg.css' => '24ffbe93',
|
||||
'core.pkg.js' => '2ff7879f',
|
||||
'darkconsole.pkg.js' => '1f9a31bc',
|
||||
'differential.pkg.css' => '90b30783',
|
||||
'differential.pkg.js' => 'ddfeb49b',
|
||||
|
@ -114,7 +114,7 @@ return array(
|
|||
'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
|
||||
'rsrc/css/application/uiexample/example.css' => '528b19de',
|
||||
'rsrc/css/core/core.css' => '9f4cb463',
|
||||
'rsrc/css/core/remarkup.css' => '17c0fb37',
|
||||
'rsrc/css/core/remarkup.css' => 'd1a5e11e',
|
||||
'rsrc/css/core/syntax.css' => 'cae95e89',
|
||||
'rsrc/css/core/z-index.css' => '0233d039',
|
||||
'rsrc/css/diviner/diviner-shared.css' => '896f1d43',
|
||||
|
@ -378,7 +378,7 @@ return array(
|
|||
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
|
||||
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '4d863052',
|
||||
'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762',
|
||||
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'aa3bd034',
|
||||
'rsrc/js/application/conpherence/behavior-durable-column.js' => '2ae077e1',
|
||||
'rsrc/js/application/conpherence/behavior-menu.js' => 'c9b99b77',
|
||||
'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8',
|
||||
'rsrc/js/application/conpherence/behavior-pontificate.js' => '55616e04',
|
||||
|
@ -639,7 +639,7 @@ return array(
|
|||
'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc',
|
||||
'javelin-behavior-doorkeeper-tag' => 'e5822781',
|
||||
'javelin-behavior-drydock-live-operation-status' => '901935ef',
|
||||
'javelin-behavior-durable-column' => 'aa3bd034',
|
||||
'javelin-behavior-durable-column' => '2ae077e1',
|
||||
'javelin-behavior-editengine-reorder-configs' => 'd7a74243',
|
||||
'javelin-behavior-editengine-reorder-fields' => 'b59e1e96',
|
||||
'javelin-behavior-error-log' => '6882e80a',
|
||||
|
@ -804,7 +804,7 @@ return array(
|
|||
'phabricator-object-selector-css' => '85ee8ce6',
|
||||
'phabricator-phtize' => 'd254d646',
|
||||
'phabricator-prefab' => 'c5af80a2',
|
||||
'phabricator-remarkup-css' => '17c0fb37',
|
||||
'phabricator-remarkup-css' => 'd1a5e11e',
|
||||
'phabricator-search-results-css' => 'f87d23ad',
|
||||
'phabricator-shaped-request' => '7cbe244b',
|
||||
'phabricator-slowvote-css' => 'a94b7230',
|
||||
|
@ -1095,6 +1095,16 @@ return array(
|
|||
'javelin-install',
|
||||
'javelin-util',
|
||||
),
|
||||
'2ae077e1' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
'javelin-stratcom',
|
||||
'javelin-behavior-device',
|
||||
'javelin-scrollbar',
|
||||
'javelin-quicksand',
|
||||
'phabricator-keyboard-shortcut',
|
||||
'conpherence-thread-manager',
|
||||
),
|
||||
'2b8de964' => array(
|
||||
'javelin-install',
|
||||
'javelin-util',
|
||||
|
@ -1793,16 +1803,6 @@ return array(
|
|||
'javelin-util',
|
||||
'phabricator-prefab',
|
||||
),
|
||||
'aa3bd034' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
'javelin-stratcom',
|
||||
'javelin-behavior-device',
|
||||
'javelin-scrollbar',
|
||||
'javelin-quicksand',
|
||||
'phabricator-keyboard-shortcut',
|
||||
'conpherence-thread-manager',
|
||||
),
|
||||
'ab2f381b' => array(
|
||||
'javelin-request',
|
||||
'javelin-behavior',
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE {$NAMESPACE}_slowvote.slowvote_poll
|
||||
MODIFY shuffle BOOL NOT NULL DEFAULT 0;
|
|
@ -292,13 +292,14 @@ phutil_register_library_map(array(
|
|||
'ConpherenceCreateThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php',
|
||||
'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php',
|
||||
'ConpherenceDurableColumnView' => 'applications/conpherence/view/ConpherenceDurableColumnView.php',
|
||||
'ConpherenceEditConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceEditConduitAPIMethod.php',
|
||||
'ConpherenceEditEngine' => 'applications/conpherence/editor/ConpherenceEditEngine.php',
|
||||
'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php',
|
||||
'ConpherenceFulltextQuery' => 'applications/conpherence/query/ConpherenceFulltextQuery.php',
|
||||
'ConpherenceIndex' => 'applications/conpherence/storage/ConpherenceIndex.php',
|
||||
'ConpherenceLayoutView' => 'applications/conpherence/view/ConpherenceLayoutView.php',
|
||||
'ConpherenceListController' => 'applications/conpherence/controller/ConpherenceListController.php',
|
||||
'ConpherenceMenuItemView' => 'applications/conpherence/view/ConpherenceMenuItemView.php',
|
||||
'ConpherenceNewRoomController' => 'applications/conpherence/controller/ConpherenceNewRoomController.php',
|
||||
'ConpherenceNotificationPanelController' => 'applications/conpherence/controller/ConpherenceNotificationPanelController.php',
|
||||
'ConpherenceParticipant' => 'applications/conpherence/storage/ConpherenceParticipant.php',
|
||||
'ConpherenceParticipantController' => 'applications/conpherence/controller/ConpherenceParticipantController.php',
|
||||
|
@ -308,6 +309,7 @@ phutil_register_library_map(array(
|
|||
'ConpherenceQueryThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php',
|
||||
'ConpherenceQueryTransactionConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php',
|
||||
'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php',
|
||||
'ConpherenceRoomEditController' => 'applications/conpherence/controller/ConpherenceRoomEditController.php',
|
||||
'ConpherenceRoomListController' => 'applications/conpherence/controller/ConpherenceRoomListController.php',
|
||||
'ConpherenceRoomPictureController' => 'applications/conpherence/controller/ConpherenceRoomPictureController.php',
|
||||
'ConpherenceRoomPreferencesController' => 'applications/conpherence/controller/ConpherenceRoomPreferencesController.php',
|
||||
|
@ -1122,29 +1124,40 @@ phutil_register_library_map(array(
|
|||
'FundBackerPHIDType' => 'applications/fund/phid/FundBackerPHIDType.php',
|
||||
'FundBackerProduct' => 'applications/fund/phortune/FundBackerProduct.php',
|
||||
'FundBackerQuery' => 'applications/fund/query/FundBackerQuery.php',
|
||||
'FundBackerRefundTransaction' => 'applications/fund/xaction/FundBackerRefundTransaction.php',
|
||||
'FundBackerSearchEngine' => 'applications/fund/query/FundBackerSearchEngine.php',
|
||||
'FundBackerStatusTransaction' => 'applications/fund/xaction/FundBackerStatusTransaction.php',
|
||||
'FundBackerTransaction' => 'applications/fund/storage/FundBackerTransaction.php',
|
||||
'FundBackerTransactionQuery' => 'applications/fund/query/FundBackerTransactionQuery.php',
|
||||
'FundBackerTransactionType' => 'applications/fund/xaction/FundBackerTransactionType.php',
|
||||
'FundController' => 'applications/fund/controller/FundController.php',
|
||||
'FundCreateInitiativesCapability' => 'applications/fund/capability/FundCreateInitiativesCapability.php',
|
||||
'FundDAO' => 'applications/fund/storage/FundDAO.php',
|
||||
'FundDefaultViewCapability' => 'applications/fund/capability/FundDefaultViewCapability.php',
|
||||
'FundInitiative' => 'applications/fund/storage/FundInitiative.php',
|
||||
'FundInitiativeBackController' => 'applications/fund/controller/FundInitiativeBackController.php',
|
||||
'FundInitiativeBackerTransaction' => 'applications/fund/xaction/FundInitiativeBackerTransaction.php',
|
||||
'FundInitiativeCloseController' => 'applications/fund/controller/FundInitiativeCloseController.php',
|
||||
'FundInitiativeCommentController' => 'applications/fund/controller/FundInitiativeCommentController.php',
|
||||
'FundInitiativeDescriptionTransaction' => 'applications/fund/xaction/FundInitiativeDescriptionTransaction.php',
|
||||
'FundInitiativeEditController' => 'applications/fund/controller/FundInitiativeEditController.php',
|
||||
'FundInitiativeEditor' => 'applications/fund/editor/FundInitiativeEditor.php',
|
||||
'FundInitiativeFulltextEngine' => 'applications/fund/search/FundInitiativeFulltextEngine.php',
|
||||
'FundInitiativeListController' => 'applications/fund/controller/FundInitiativeListController.php',
|
||||
'FundInitiativeMerchantTransaction' => 'applications/fund/xaction/FundInitiativeMerchantTransaction.php',
|
||||
'FundInitiativeNameTransaction' => 'applications/fund/xaction/FundInitiativeNameTransaction.php',
|
||||
'FundInitiativePHIDType' => 'applications/fund/phid/FundInitiativePHIDType.php',
|
||||
'FundInitiativeQuery' => 'applications/fund/query/FundInitiativeQuery.php',
|
||||
'FundInitiativeRefundTransaction' => 'applications/fund/xaction/FundInitiativeRefundTransaction.php',
|
||||
'FundInitiativeRemarkupRule' => 'applications/fund/remarkup/FundInitiativeRemarkupRule.php',
|
||||
'FundInitiativeReplyHandler' => 'applications/fund/mail/FundInitiativeReplyHandler.php',
|
||||
'FundInitiativeRisksTransaction' => 'applications/fund/xaction/FundInitiativeRisksTransaction.php',
|
||||
'FundInitiativeSearchEngine' => 'applications/fund/query/FundInitiativeSearchEngine.php',
|
||||
'FundInitiativeStatusTransaction' => 'applications/fund/xaction/FundInitiativeStatusTransaction.php',
|
||||
'FundInitiativeTransaction' => 'applications/fund/storage/FundInitiativeTransaction.php',
|
||||
'FundInitiativeTransactionComment' => 'applications/fund/storage/FundInitiativeTransactionComment.php',
|
||||
'FundInitiativeTransactionQuery' => 'applications/fund/query/FundInitiativeTransactionQuery.php',
|
||||
'FundInitiativeTransactionType' => 'applications/fund/xaction/FundInitiativeTransactionType.php',
|
||||
'FundInitiativeViewController' => 'applications/fund/controller/FundInitiativeViewController.php',
|
||||
'FundSchemaSpec' => 'applications/fund/storage/FundSchemaSpec.php',
|
||||
'HarbormasterArcLintBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterArcLintBuildStepImplementation.php',
|
||||
|
@ -1398,8 +1411,10 @@ phutil_register_library_map(array(
|
|||
'LegalpadDocumentEditor' => 'applications/legalpad/editor/LegalpadDocumentEditor.php',
|
||||
'LegalpadDocumentListController' => 'applications/legalpad/controller/LegalpadDocumentListController.php',
|
||||
'LegalpadDocumentManageController' => 'applications/legalpad/controller/LegalpadDocumentManageController.php',
|
||||
'LegalpadDocumentPreambleTransaction' => 'applications/legalpad/xaction/LegalpadDocumentPreambleTransaction.php',
|
||||
'LegalpadDocumentQuery' => 'applications/legalpad/query/LegalpadDocumentQuery.php',
|
||||
'LegalpadDocumentRemarkupRule' => 'applications/legalpad/remarkup/LegalpadDocumentRemarkupRule.php',
|
||||
'LegalpadDocumentRequireSignatureTransaction' => 'applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php',
|
||||
'LegalpadDocumentSearchEngine' => 'applications/legalpad/query/LegalpadDocumentSearchEngine.php',
|
||||
'LegalpadDocumentSignController' => 'applications/legalpad/controller/LegalpadDocumentSignController.php',
|
||||
'LegalpadDocumentSignature' => 'applications/legalpad/storage/LegalpadDocumentSignature.php',
|
||||
|
@ -1407,8 +1422,12 @@ phutil_register_library_map(array(
|
|||
'LegalpadDocumentSignatureListController' => 'applications/legalpad/controller/LegalpadDocumentSignatureListController.php',
|
||||
'LegalpadDocumentSignatureQuery' => 'applications/legalpad/query/LegalpadDocumentSignatureQuery.php',
|
||||
'LegalpadDocumentSignatureSearchEngine' => 'applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php',
|
||||
'LegalpadDocumentSignatureTypeTransaction' => 'applications/legalpad/xaction/LegalpadDocumentSignatureTypeTransaction.php',
|
||||
'LegalpadDocumentSignatureVerificationController' => 'applications/legalpad/controller/LegalpadDocumentSignatureVerificationController.php',
|
||||
'LegalpadDocumentSignatureViewController' => 'applications/legalpad/controller/LegalpadDocumentSignatureViewController.php',
|
||||
'LegalpadDocumentTextTransaction' => 'applications/legalpad/xaction/LegalpadDocumentTextTransaction.php',
|
||||
'LegalpadDocumentTitleTransaction' => 'applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php',
|
||||
'LegalpadDocumentTransactionType' => 'applications/legalpad/xaction/LegalpadDocumentTransactionType.php',
|
||||
'LegalpadMailReceiver' => 'applications/legalpad/mail/LegalpadMailReceiver.php',
|
||||
'LegalpadObjectNeedsSignatureEdgeType' => 'applications/legalpad/edge/LegalpadObjectNeedsSignatureEdgeType.php',
|
||||
'LegalpadReplyHandler' => 'applications/legalpad/mail/LegalpadReplyHandler.php',
|
||||
|
@ -1760,23 +1779,32 @@ phutil_register_library_map(array(
|
|||
'PassphraseCredential' => 'applications/passphrase/storage/PassphraseCredential.php',
|
||||
'PassphraseCredentialAuthorPolicyRule' => 'applications/passphrase/policyrule/PassphraseCredentialAuthorPolicyRule.php',
|
||||
'PassphraseCredentialConduitController' => 'applications/passphrase/controller/PassphraseCredentialConduitController.php',
|
||||
'PassphraseCredentialConduitTransaction' => 'applications/passphrase/xaction/PassphraseCredentialConduitTransaction.php',
|
||||
'PassphraseCredentialControl' => 'applications/passphrase/view/PassphraseCredentialControl.php',
|
||||
'PassphraseCredentialCreateController' => 'applications/passphrase/controller/PassphraseCredentialCreateController.php',
|
||||
'PassphraseCredentialDescriptionTransaction' => 'applications/passphrase/xaction/PassphraseCredentialDescriptionTransaction.php',
|
||||
'PassphraseCredentialDestroyController' => 'applications/passphrase/controller/PassphraseCredentialDestroyController.php',
|
||||
'PassphraseCredentialDestroyTransaction' => 'applications/passphrase/xaction/PassphraseCredentialDestroyTransaction.php',
|
||||
'PassphraseCredentialEditController' => 'applications/passphrase/controller/PassphraseCredentialEditController.php',
|
||||
'PassphraseCredentialFulltextEngine' => 'applications/passphrase/search/PassphraseCredentialFulltextEngine.php',
|
||||
'PassphraseCredentialListController' => 'applications/passphrase/controller/PassphraseCredentialListController.php',
|
||||
'PassphraseCredentialLockController' => 'applications/passphrase/controller/PassphraseCredentialLockController.php',
|
||||
'PassphraseCredentialLockTransaction' => 'applications/passphrase/xaction/PassphraseCredentialLockTransaction.php',
|
||||
'PassphraseCredentialLookedAtTransaction' => 'applications/passphrase/xaction/PassphraseCredentialLookedAtTransaction.php',
|
||||
'PassphraseCredentialNameTransaction' => 'applications/passphrase/xaction/PassphraseCredentialNameTransaction.php',
|
||||
'PassphraseCredentialPHIDType' => 'applications/passphrase/phid/PassphraseCredentialPHIDType.php',
|
||||
'PassphraseCredentialPublicController' => 'applications/passphrase/controller/PassphraseCredentialPublicController.php',
|
||||
'PassphraseCredentialQuery' => 'applications/passphrase/query/PassphraseCredentialQuery.php',
|
||||
'PassphraseCredentialRevealController' => 'applications/passphrase/controller/PassphraseCredentialRevealController.php',
|
||||
'PassphraseCredentialSearchEngine' => 'applications/passphrase/query/PassphraseCredentialSearchEngine.php',
|
||||
'PassphraseCredentialSecretIDTransaction' => 'applications/passphrase/xaction/PassphraseCredentialSecretIDTransaction.php',
|
||||
'PassphraseCredentialTransaction' => 'applications/passphrase/storage/PassphraseCredentialTransaction.php',
|
||||
'PassphraseCredentialTransactionEditor' => 'applications/passphrase/editor/PassphraseCredentialTransactionEditor.php',
|
||||
'PassphraseCredentialTransactionQuery' => 'applications/passphrase/query/PassphraseCredentialTransactionQuery.php',
|
||||
'PassphraseCredentialTransactionType' => 'applications/passphrase/xaction/PassphraseCredentialTransactionType.php',
|
||||
'PassphraseCredentialType' => 'applications/passphrase/credentialtype/PassphraseCredentialType.php',
|
||||
'PassphraseCredentialTypeTestCase' => 'applications/passphrase/credentialtype/__tests__/PassphraseCredentialTypeTestCase.php',
|
||||
'PassphraseCredentialUsernameTransaction' => 'applications/passphrase/xaction/PassphraseCredentialUsernameTransaction.php',
|
||||
'PassphraseCredentialViewController' => 'applications/passphrase/controller/PassphraseCredentialViewController.php',
|
||||
'PassphraseDAO' => 'applications/passphrase/storage/PassphraseDAO.php',
|
||||
'PassphraseDefaultEditCapability' => 'applications/passphrase/capability/PassphraseDefaultEditCapability.php',
|
||||
|
@ -1847,9 +1875,12 @@ phutil_register_library_map(array(
|
|||
'PhabricatorApplicationDatasource' => 'applications/meta/typeahead/PhabricatorApplicationDatasource.php',
|
||||
'PhabricatorApplicationDetailViewController' => 'applications/meta/controller/PhabricatorApplicationDetailViewController.php',
|
||||
'PhabricatorApplicationEditController' => 'applications/meta/controller/PhabricatorApplicationEditController.php',
|
||||
'PhabricatorApplicationEditEngine' => 'applications/meta/editor/PhabricatorApplicationEditEngine.php',
|
||||
'PhabricatorApplicationEditHTTPParameterHelpView' => 'applications/transactions/view/PhabricatorApplicationEditHTTPParameterHelpView.php',
|
||||
'PhabricatorApplicationEditor' => 'applications/meta/editor/PhabricatorApplicationEditor.php',
|
||||
'PhabricatorApplicationEmailCommandsController' => 'applications/meta/controller/PhabricatorApplicationEmailCommandsController.php',
|
||||
'PhabricatorApplicationPanelController' => 'applications/meta/controller/PhabricatorApplicationPanelController.php',
|
||||
'PhabricatorApplicationPolicyChangeTransaction' => 'applications/meta/xactions/PhabricatorApplicationPolicyChangeTransaction.php',
|
||||
'PhabricatorApplicationProfileMenuItem' => 'applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php',
|
||||
'PhabricatorApplicationQuery' => 'applications/meta/query/PhabricatorApplicationQuery.php',
|
||||
'PhabricatorApplicationSchemaSpec' => 'applications/meta/storage/PhabricatorApplicationSchemaSpec.php',
|
||||
|
@ -2389,6 +2420,8 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConpherenceNotificationsSetting' => 'applications/settings/setting/PhabricatorConpherenceNotificationsSetting.php',
|
||||
'PhabricatorConpherencePreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php',
|
||||
'PhabricatorConpherenceProfileMenuItem' => 'applications/search/menuitem/PhabricatorConpherenceProfileMenuItem.php',
|
||||
'PhabricatorConpherenceRoomContextFreeGrammar' => 'applications/conpherence/lipsum/PhabricatorConpherenceRoomContextFreeGrammar.php',
|
||||
'PhabricatorConpherenceRoomTestDataGenerator' => 'applications/conpherence/lipsum/PhabricatorConpherenceRoomTestDataGenerator.php',
|
||||
'PhabricatorConpherenceSoundSetting' => 'applications/settings/setting/PhabricatorConpherenceSoundSetting.php',
|
||||
'PhabricatorConpherenceThreadPHIDType' => 'applications/conpherence/phid/PhabricatorConpherenceThreadPHIDType.php',
|
||||
'PhabricatorConpherenceWidgetVisibleSetting' => 'applications/settings/setting/PhabricatorConpherenceWidgetVisibleSetting.php',
|
||||
|
@ -2968,26 +3001,32 @@ phutil_register_library_map(array(
|
|||
'PhabricatorLogoutController' => 'applications/auth/controller/PhabricatorLogoutController.php',
|
||||
'PhabricatorLunarPhasePolicyRule' => 'applications/policy/rule/PhabricatorLunarPhasePolicyRule.php',
|
||||
'PhabricatorMacroApplication' => 'applications/macro/application/PhabricatorMacroApplication.php',
|
||||
'PhabricatorMacroAudioBehaviorTransaction' => 'applications/macro/xaction/PhabricatorMacroAudioBehaviorTransaction.php',
|
||||
'PhabricatorMacroAudioController' => 'applications/macro/controller/PhabricatorMacroAudioController.php',
|
||||
'PhabricatorMacroCommentController' => 'applications/macro/controller/PhabricatorMacroCommentController.php',
|
||||
'PhabricatorMacroAudioTransaction' => 'applications/macro/xaction/PhabricatorMacroAudioTransaction.php',
|
||||
'PhabricatorMacroConfigOptions' => 'applications/macro/config/PhabricatorMacroConfigOptions.php',
|
||||
'PhabricatorMacroController' => 'applications/macro/controller/PhabricatorMacroController.php',
|
||||
'PhabricatorMacroDatasource' => 'applications/macro/typeahead/PhabricatorMacroDatasource.php',
|
||||
'PhabricatorMacroDisableController' => 'applications/macro/controller/PhabricatorMacroDisableController.php',
|
||||
'PhabricatorMacroDisabledTransaction' => 'applications/macro/xaction/PhabricatorMacroDisabledTransaction.php',
|
||||
'PhabricatorMacroEditController' => 'applications/macro/controller/PhabricatorMacroEditController.php',
|
||||
'PhabricatorMacroEditEngine' => 'applications/macro/editor/PhabricatorMacroEditEngine.php',
|
||||
'PhabricatorMacroEditor' => 'applications/macro/editor/PhabricatorMacroEditor.php',
|
||||
'PhabricatorMacroFileTransaction' => 'applications/macro/xaction/PhabricatorMacroFileTransaction.php',
|
||||
'PhabricatorMacroListController' => 'applications/macro/controller/PhabricatorMacroListController.php',
|
||||
'PhabricatorMacroMacroPHIDType' => 'applications/macro/phid/PhabricatorMacroMacroPHIDType.php',
|
||||
'PhabricatorMacroMailReceiver' => 'applications/macro/mail/PhabricatorMacroMailReceiver.php',
|
||||
'PhabricatorMacroManageCapability' => 'applications/macro/capability/PhabricatorMacroManageCapability.php',
|
||||
'PhabricatorMacroMemeController' => 'applications/macro/controller/PhabricatorMacroMemeController.php',
|
||||
'PhabricatorMacroMemeDialogController' => 'applications/macro/controller/PhabricatorMacroMemeDialogController.php',
|
||||
'PhabricatorMacroNameTransaction' => 'applications/macro/xaction/PhabricatorMacroNameTransaction.php',
|
||||
'PhabricatorMacroQuery' => 'applications/macro/query/PhabricatorMacroQuery.php',
|
||||
'PhabricatorMacroReplyHandler' => 'applications/macro/mail/PhabricatorMacroReplyHandler.php',
|
||||
'PhabricatorMacroSearchEngine' => 'applications/macro/query/PhabricatorMacroSearchEngine.php',
|
||||
'PhabricatorMacroTransaction' => 'applications/macro/storage/PhabricatorMacroTransaction.php',
|
||||
'PhabricatorMacroTransactionComment' => 'applications/macro/storage/PhabricatorMacroTransactionComment.php',
|
||||
'PhabricatorMacroTransactionQuery' => 'applications/macro/query/PhabricatorMacroTransactionQuery.php',
|
||||
'PhabricatorMacroTransactionType' => 'applications/macro/xaction/PhabricatorMacroTransactionType.php',
|
||||
'PhabricatorMacroViewController' => 'applications/macro/controller/PhabricatorMacroViewController.php',
|
||||
'PhabricatorMailEmailHeraldField' => 'applications/metamta/herald/PhabricatorMailEmailHeraldField.php',
|
||||
'PhabricatorMailEmailHeraldFieldGroup' => 'applications/metamta/herald/PhabricatorMailEmailHeraldFieldGroup.php',
|
||||
|
@ -3873,10 +3912,12 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSlowvoteApplication' => 'applications/slowvote/application/PhabricatorSlowvoteApplication.php',
|
||||
'PhabricatorSlowvoteChoice' => 'applications/slowvote/storage/PhabricatorSlowvoteChoice.php',
|
||||
'PhabricatorSlowvoteCloseController' => 'applications/slowvote/controller/PhabricatorSlowvoteCloseController.php',
|
||||
'PhabricatorSlowvoteCloseTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteCloseTransaction.php',
|
||||
'PhabricatorSlowvoteCommentController' => 'applications/slowvote/controller/PhabricatorSlowvoteCommentController.php',
|
||||
'PhabricatorSlowvoteController' => 'applications/slowvote/controller/PhabricatorSlowvoteController.php',
|
||||
'PhabricatorSlowvoteDAO' => 'applications/slowvote/storage/PhabricatorSlowvoteDAO.php',
|
||||
'PhabricatorSlowvoteDefaultViewCapability' => 'applications/slowvote/capability/PhabricatorSlowvoteDefaultViewCapability.php',
|
||||
'PhabricatorSlowvoteDescriptionTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteDescriptionTransaction.php',
|
||||
'PhabricatorSlowvoteEditController' => 'applications/slowvote/controller/PhabricatorSlowvoteEditController.php',
|
||||
'PhabricatorSlowvoteEditor' => 'applications/slowvote/editor/PhabricatorSlowvoteEditor.php',
|
||||
'PhabricatorSlowvoteListController' => 'applications/slowvote/controller/PhabricatorSlowvoteListController.php',
|
||||
|
@ -3886,12 +3927,16 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSlowvotePollController' => 'applications/slowvote/controller/PhabricatorSlowvotePollController.php',
|
||||
'PhabricatorSlowvotePollPHIDType' => 'applications/slowvote/phid/PhabricatorSlowvotePollPHIDType.php',
|
||||
'PhabricatorSlowvoteQuery' => 'applications/slowvote/query/PhabricatorSlowvoteQuery.php',
|
||||
'PhabricatorSlowvoteQuestionTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteQuestionTransaction.php',
|
||||
'PhabricatorSlowvoteReplyHandler' => 'applications/slowvote/mail/PhabricatorSlowvoteReplyHandler.php',
|
||||
'PhabricatorSlowvoteResponsesTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteResponsesTransaction.php',
|
||||
'PhabricatorSlowvoteSchemaSpec' => 'applications/slowvote/storage/PhabricatorSlowvoteSchemaSpec.php',
|
||||
'PhabricatorSlowvoteSearchEngine' => 'applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php',
|
||||
'PhabricatorSlowvoteShuffleTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteShuffleTransaction.php',
|
||||
'PhabricatorSlowvoteTransaction' => 'applications/slowvote/storage/PhabricatorSlowvoteTransaction.php',
|
||||
'PhabricatorSlowvoteTransactionComment' => 'applications/slowvote/storage/PhabricatorSlowvoteTransactionComment.php',
|
||||
'PhabricatorSlowvoteTransactionQuery' => 'applications/slowvote/query/PhabricatorSlowvoteTransactionQuery.php',
|
||||
'PhabricatorSlowvoteTransactionType' => 'applications/slowvote/xactions/PhabricatorSlowvoteTransactionType.php',
|
||||
'PhabricatorSlowvoteVoteController' => 'applications/slowvote/controller/PhabricatorSlowvoteVoteController.php',
|
||||
'PhabricatorSlug' => 'infrastructure/util/PhabricatorSlug.php',
|
||||
'PhabricatorSlugTestCase' => 'infrastructure/util/__tests__/PhabricatorSlugTestCase.php',
|
||||
|
@ -3909,13 +3954,18 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSpacesInterface' => 'applications/spaces/interface/PhabricatorSpacesInterface.php',
|
||||
'PhabricatorSpacesListController' => 'applications/spaces/controller/PhabricatorSpacesListController.php',
|
||||
'PhabricatorSpacesNamespace' => 'applications/spaces/storage/PhabricatorSpacesNamespace.php',
|
||||
'PhabricatorSpacesNamespaceArchiveTransaction' => 'applications/spaces/xaction/PhabricatorSpacesNamespaceArchiveTransaction.php',
|
||||
'PhabricatorSpacesNamespaceDatasource' => 'applications/spaces/typeahead/PhabricatorSpacesNamespaceDatasource.php',
|
||||
'PhabricatorSpacesNamespaceDefaultTransaction' => 'applications/spaces/xaction/PhabricatorSpacesNamespaceDefaultTransaction.php',
|
||||
'PhabricatorSpacesNamespaceDescriptionTransaction' => 'applications/spaces/xaction/PhabricatorSpacesNamespaceDescriptionTransaction.php',
|
||||
'PhabricatorSpacesNamespaceEditor' => 'applications/spaces/editor/PhabricatorSpacesNamespaceEditor.php',
|
||||
'PhabricatorSpacesNamespaceNameTransaction' => 'applications/spaces/xaction/PhabricatorSpacesNamespaceNameTransaction.php',
|
||||
'PhabricatorSpacesNamespacePHIDType' => 'applications/spaces/phid/PhabricatorSpacesNamespacePHIDType.php',
|
||||
'PhabricatorSpacesNamespaceQuery' => 'applications/spaces/query/PhabricatorSpacesNamespaceQuery.php',
|
||||
'PhabricatorSpacesNamespaceSearchEngine' => 'applications/spaces/query/PhabricatorSpacesNamespaceSearchEngine.php',
|
||||
'PhabricatorSpacesNamespaceTransaction' => 'applications/spaces/storage/PhabricatorSpacesNamespaceTransaction.php',
|
||||
'PhabricatorSpacesNamespaceTransactionQuery' => 'applications/spaces/query/PhabricatorSpacesNamespaceTransactionQuery.php',
|
||||
'PhabricatorSpacesNamespaceTransactionType' => 'applications/spaces/xaction/PhabricatorSpacesNamespaceTransactionType.php',
|
||||
'PhabricatorSpacesNoAccessController' => 'applications/spaces/controller/PhabricatorSpacesNoAccessController.php',
|
||||
'PhabricatorSpacesRemarkupRule' => 'applications/spaces/remarkup/PhabricatorSpacesRemarkupRule.php',
|
||||
'PhabricatorSpacesSchemaSpec' => 'applications/spaces/storage/PhabricatorSpacesSchemaSpec.php',
|
||||
|
@ -4222,24 +4272,34 @@ phutil_register_library_map(array(
|
|||
'PhameBlogController' => 'applications/phame/controller/blog/PhameBlogController.php',
|
||||
'PhameBlogCreateCapability' => 'applications/phame/capability/PhameBlogCreateCapability.php',
|
||||
'PhameBlogDatasource' => 'applications/phame/typeahead/PhameBlogDatasource.php',
|
||||
'PhameBlogDescriptionTransaction' => 'applications/phame/xaction/PhameBlogDescriptionTransaction.php',
|
||||
'PhameBlogEditConduitAPIMethod' => 'applications/phame/conduit/PhameBlogEditConduitAPIMethod.php',
|
||||
'PhameBlogEditController' => 'applications/phame/controller/blog/PhameBlogEditController.php',
|
||||
'PhameBlogEditEngine' => 'applications/phame/editor/PhameBlogEditEngine.php',
|
||||
'PhameBlogEditor' => 'applications/phame/editor/PhameBlogEditor.php',
|
||||
'PhameBlogFeedController' => 'applications/phame/controller/blog/PhameBlogFeedController.php',
|
||||
'PhameBlogFullDomainTransaction' => 'applications/phame/xaction/PhameBlogFullDomainTransaction.php',
|
||||
'PhameBlogFulltextEngine' => 'applications/phame/search/PhameBlogFulltextEngine.php',
|
||||
'PhameBlogHeaderImageTransaction' => 'applications/phame/xaction/PhameBlogHeaderImageTransaction.php',
|
||||
'PhameBlogHeaderPictureController' => 'applications/phame/controller/blog/PhameBlogHeaderPictureController.php',
|
||||
'PhameBlogListController' => 'applications/phame/controller/blog/PhameBlogListController.php',
|
||||
'PhameBlogListView' => 'applications/phame/view/PhameBlogListView.php',
|
||||
'PhameBlogManageController' => 'applications/phame/controller/blog/PhameBlogManageController.php',
|
||||
'PhameBlogNameTransaction' => 'applications/phame/xaction/PhameBlogNameTransaction.php',
|
||||
'PhameBlogParentDomainTransaction' => 'applications/phame/xaction/PhameBlogParentDomainTransaction.php',
|
||||
'PhameBlogParentSiteTransaction' => 'applications/phame/xaction/PhameBlogParentSiteTransaction.php',
|
||||
'PhameBlogProfileImageTransaction' => 'applications/phame/xaction/PhameBlogProfileImageTransaction.php',
|
||||
'PhameBlogProfilePictureController' => 'applications/phame/controller/blog/PhameBlogProfilePictureController.php',
|
||||
'PhameBlogQuery' => 'applications/phame/query/PhameBlogQuery.php',
|
||||
'PhameBlogReplyHandler' => 'applications/phame/mail/PhameBlogReplyHandler.php',
|
||||
'PhameBlogSearchConduitAPIMethod' => 'applications/phame/conduit/PhameBlogSearchConduitAPIMethod.php',
|
||||
'PhameBlogSearchEngine' => 'applications/phame/query/PhameBlogSearchEngine.php',
|
||||
'PhameBlogSite' => 'applications/phame/site/PhameBlogSite.php',
|
||||
'PhameBlogStatusTransaction' => 'applications/phame/xaction/PhameBlogStatusTransaction.php',
|
||||
'PhameBlogSubtitleTransaction' => 'applications/phame/xaction/PhameBlogSubtitleTransaction.php',
|
||||
'PhameBlogTransaction' => 'applications/phame/storage/PhameBlogTransaction.php',
|
||||
'PhameBlogTransactionQuery' => 'applications/phame/query/PhameBlogTransactionQuery.php',
|
||||
'PhameBlogTransactionType' => 'applications/phame/xaction/PhameBlogTransactionType.php',
|
||||
'PhameBlogViewController' => 'applications/phame/controller/blog/PhameBlogViewController.php',
|
||||
'PhameConstants' => 'applications/phame/constants/PhameConstants.php',
|
||||
'PhameController' => 'applications/phame/controller/PhameController.php',
|
||||
|
@ -4251,12 +4311,15 @@ phutil_register_library_map(array(
|
|||
'PhameNextPostView' => 'applications/phame/view/PhameNextPostView.php',
|
||||
'PhamePost' => 'applications/phame/storage/PhamePost.php',
|
||||
'PhamePostArchiveController' => 'applications/phame/controller/post/PhamePostArchiveController.php',
|
||||
'PhamePostBlogTransaction' => 'applications/phame/xaction/PhamePostBlogTransaction.php',
|
||||
'PhamePostBodyTransaction' => 'applications/phame/xaction/PhamePostBodyTransaction.php',
|
||||
'PhamePostController' => 'applications/phame/controller/post/PhamePostController.php',
|
||||
'PhamePostEditConduitAPIMethod' => 'applications/phame/conduit/PhamePostEditConduitAPIMethod.php',
|
||||
'PhamePostEditController' => 'applications/phame/controller/post/PhamePostEditController.php',
|
||||
'PhamePostEditEngine' => 'applications/phame/editor/PhamePostEditEngine.php',
|
||||
'PhamePostEditor' => 'applications/phame/editor/PhamePostEditor.php',
|
||||
'PhamePostFulltextEngine' => 'applications/phame/search/PhamePostFulltextEngine.php',
|
||||
'PhamePostHeaderImageTransaction' => 'applications/phame/xaction/PhamePostHeaderImageTransaction.php',
|
||||
'PhamePostHeaderPictureController' => 'applications/phame/controller/post/PhamePostHeaderPictureController.php',
|
||||
'PhamePostHistoryController' => 'applications/phame/controller/post/PhamePostHistoryController.php',
|
||||
'PhamePostListController' => 'applications/phame/controller/post/PhamePostListController.php',
|
||||
|
@ -4269,10 +4332,14 @@ phutil_register_library_map(array(
|
|||
'PhamePostReplyHandler' => 'applications/phame/mail/PhamePostReplyHandler.php',
|
||||
'PhamePostSearchConduitAPIMethod' => 'applications/phame/conduit/PhamePostSearchConduitAPIMethod.php',
|
||||
'PhamePostSearchEngine' => 'applications/phame/query/PhamePostSearchEngine.php',
|
||||
'PhamePostSubtitleTransaction' => 'applications/phame/xaction/PhamePostSubtitleTransaction.php',
|
||||
'PhamePostTitleTransaction' => 'applications/phame/xaction/PhamePostTitleTransaction.php',
|
||||
'PhamePostTransaction' => 'applications/phame/storage/PhamePostTransaction.php',
|
||||
'PhamePostTransactionComment' => 'applications/phame/storage/PhamePostTransactionComment.php',
|
||||
'PhamePostTransactionQuery' => 'applications/phame/query/PhamePostTransactionQuery.php',
|
||||
'PhamePostTransactionType' => 'applications/phame/xaction/PhamePostTransactionType.php',
|
||||
'PhamePostViewController' => 'applications/phame/controller/post/PhamePostViewController.php',
|
||||
'PhamePostVisibilityTransaction' => 'applications/phame/xaction/PhamePostVisibilityTransaction.php',
|
||||
'PhameSchemaSpec' => 'applications/phame/storage/PhameSchemaSpec.php',
|
||||
'PhameSite' => 'applications/phame/site/PhameSite.php',
|
||||
'PhluxController' => 'applications/phlux/controller/PhluxController.php',
|
||||
|
@ -4547,18 +4614,22 @@ phutil_register_library_map(array(
|
|||
'PonderAddAnswerView' => 'applications/ponder/view/PonderAddAnswerView.php',
|
||||
'PonderAnswer' => 'applications/ponder/storage/PonderAnswer.php',
|
||||
'PonderAnswerCommentController' => 'applications/ponder/controller/PonderAnswerCommentController.php',
|
||||
'PonderAnswerContentTransaction' => 'applications/ponder/xaction/PonderAnswerContentTransaction.php',
|
||||
'PonderAnswerEditController' => 'applications/ponder/controller/PonderAnswerEditController.php',
|
||||
'PonderAnswerEditor' => 'applications/ponder/editor/PonderAnswerEditor.php',
|
||||
'PonderAnswerHistoryController' => 'applications/ponder/controller/PonderAnswerHistoryController.php',
|
||||
'PonderAnswerMailReceiver' => 'applications/ponder/mail/PonderAnswerMailReceiver.php',
|
||||
'PonderAnswerPHIDType' => 'applications/ponder/phid/PonderAnswerPHIDType.php',
|
||||
'PonderAnswerQuery' => 'applications/ponder/query/PonderAnswerQuery.php',
|
||||
'PonderAnswerQuestionIDTransaction' => 'applications/ponder/xaction/PonderAnswerQuestionIDTransaction.php',
|
||||
'PonderAnswerReplyHandler' => 'applications/ponder/mail/PonderAnswerReplyHandler.php',
|
||||
'PonderAnswerSaveController' => 'applications/ponder/controller/PonderAnswerSaveController.php',
|
||||
'PonderAnswerStatus' => 'applications/ponder/constants/PonderAnswerStatus.php',
|
||||
'PonderAnswerStatusTransaction' => 'applications/ponder/xaction/PonderAnswerStatusTransaction.php',
|
||||
'PonderAnswerTransaction' => 'applications/ponder/storage/PonderAnswerTransaction.php',
|
||||
'PonderAnswerTransactionComment' => 'applications/ponder/storage/PonderAnswerTransactionComment.php',
|
||||
'PonderAnswerTransactionQuery' => 'applications/ponder/query/PonderAnswerTransactionQuery.php',
|
||||
'PonderAnswerTransactionType' => 'applications/ponder/xaction/PonderAnswerTransactionType.php',
|
||||
'PonderAnswerView' => 'applications/ponder/view/PonderAnswerView.php',
|
||||
'PonderConstants' => 'applications/ponder/constants/PonderConstants.php',
|
||||
'PonderController' => 'applications/ponder/controller/PonderController.php',
|
||||
|
@ -4568,9 +4639,13 @@ phutil_register_library_map(array(
|
|||
'PonderFooterView' => 'applications/ponder/view/PonderFooterView.php',
|
||||
'PonderModerateCapability' => 'applications/ponder/capability/PonderModerateCapability.php',
|
||||
'PonderQuestion' => 'applications/ponder/storage/PonderQuestion.php',
|
||||
'PonderQuestionAnswerTransaction' => 'applications/ponder/xaction/PonderQuestionAnswerTransaction.php',
|
||||
'PonderQuestionAnswerWikiTransaction' => 'applications/ponder/xaction/PonderQuestionAnswerWikiTransaction.php',
|
||||
'PonderQuestionCommentController' => 'applications/ponder/controller/PonderQuestionCommentController.php',
|
||||
'PonderQuestionContentTransaction' => 'applications/ponder/xaction/PonderQuestionContentTransaction.php',
|
||||
'PonderQuestionCreateMailReceiver' => 'applications/ponder/mail/PonderQuestionCreateMailReceiver.php',
|
||||
'PonderQuestionEditController' => 'applications/ponder/controller/PonderQuestionEditController.php',
|
||||
'PonderQuestionEditEngine' => 'applications/ponder/editor/PonderQuestionEditEngine.php',
|
||||
'PonderQuestionEditor' => 'applications/ponder/editor/PonderQuestionEditor.php',
|
||||
'PonderQuestionFulltextEngine' => 'applications/ponder/search/PonderQuestionFulltextEngine.php',
|
||||
'PonderQuestionHistoryController' => 'applications/ponder/controller/PonderQuestionHistoryController.php',
|
||||
|
@ -4582,9 +4657,12 @@ phutil_register_library_map(array(
|
|||
'PonderQuestionSearchEngine' => 'applications/ponder/query/PonderQuestionSearchEngine.php',
|
||||
'PonderQuestionStatus' => 'applications/ponder/constants/PonderQuestionStatus.php',
|
||||
'PonderQuestionStatusController' => 'applications/ponder/controller/PonderQuestionStatusController.php',
|
||||
'PonderQuestionStatusTransaction' => 'applications/ponder/xaction/PonderQuestionStatusTransaction.php',
|
||||
'PonderQuestionTitleTransaction' => 'applications/ponder/xaction/PonderQuestionTitleTransaction.php',
|
||||
'PonderQuestionTransaction' => 'applications/ponder/storage/PonderQuestionTransaction.php',
|
||||
'PonderQuestionTransactionComment' => 'applications/ponder/storage/PonderQuestionTransactionComment.php',
|
||||
'PonderQuestionTransactionQuery' => 'applications/ponder/query/PonderQuestionTransactionQuery.php',
|
||||
'PonderQuestionTransactionType' => 'applications/ponder/xaction/PonderQuestionTransactionType.php',
|
||||
'PonderQuestionViewController' => 'applications/ponder/controller/PonderQuestionViewController.php',
|
||||
'PonderRemarkupRule' => 'applications/ponder/remarkup/PonderRemarkupRule.php',
|
||||
'PonderSchemaSpec' => 'applications/ponder/storage/PonderSchemaSpec.php',
|
||||
|
@ -5074,13 +5152,14 @@ phutil_register_library_map(array(
|
|||
'ConpherenceCreateThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
|
||||
'ConpherenceDAO' => 'PhabricatorLiskDAO',
|
||||
'ConpherenceDurableColumnView' => 'AphrontTagView',
|
||||
'ConpherenceEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||
'ConpherenceEditEngine' => 'PhabricatorEditEngine',
|
||||
'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'ConpherenceFulltextQuery' => 'PhabricatorOffsetPagedQuery',
|
||||
'ConpherenceIndex' => 'ConpherenceDAO',
|
||||
'ConpherenceLayoutView' => 'AphrontTagView',
|
||||
'ConpherenceListController' => 'ConpherenceController',
|
||||
'ConpherenceMenuItemView' => 'AphrontTagView',
|
||||
'ConpherenceNewRoomController' => 'ConpherenceController',
|
||||
'ConpherenceNotificationPanelController' => 'ConpherenceController',
|
||||
'ConpherenceParticipant' => 'ConpherenceDAO',
|
||||
'ConpherenceParticipantController' => 'ConpherenceController',
|
||||
|
@ -5090,6 +5169,7 @@ phutil_register_library_map(array(
|
|||
'ConpherenceQueryThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
|
||||
'ConpherenceQueryTransactionConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
|
||||
'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
|
||||
'ConpherenceRoomEditController' => 'ConpherenceController',
|
||||
'ConpherenceRoomListController' => 'ConpherenceController',
|
||||
'ConpherenceRoomPictureController' => 'ConpherenceController',
|
||||
'ConpherenceRoomPreferencesController' => 'ConpherenceController',
|
||||
|
@ -5997,9 +6077,12 @@ phutil_register_library_map(array(
|
|||
'FundBackerPHIDType' => 'PhabricatorPHIDType',
|
||||
'FundBackerProduct' => 'PhortuneProductImplementation',
|
||||
'FundBackerQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'FundBackerRefundTransaction' => 'FundBackerTransactionType',
|
||||
'FundBackerSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'FundBackerTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'FundBackerStatusTransaction' => 'FundBackerTransactionType',
|
||||
'FundBackerTransaction' => 'PhabricatorModularTransaction',
|
||||
'FundBackerTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'FundBackerTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'FundController' => 'PhabricatorController',
|
||||
'FundCreateInitiativesCapability' => 'PhabricatorPolicyCapability',
|
||||
'FundDAO' => 'PhabricatorLiskDAO',
|
||||
|
@ -6017,20 +6100,28 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFulltextInterface',
|
||||
),
|
||||
'FundInitiativeBackController' => 'FundController',
|
||||
'FundInitiativeBackerTransaction' => 'FundInitiativeTransactionType',
|
||||
'FundInitiativeCloseController' => 'FundController',
|
||||
'FundInitiativeCommentController' => 'FundController',
|
||||
'FundInitiativeDescriptionTransaction' => 'FundInitiativeTransactionType',
|
||||
'FundInitiativeEditController' => 'FundController',
|
||||
'FundInitiativeEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'FundInitiativeFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||
'FundInitiativeListController' => 'FundController',
|
||||
'FundInitiativeMerchantTransaction' => 'FundInitiativeTransactionType',
|
||||
'FundInitiativeNameTransaction' => 'FundInitiativeTransactionType',
|
||||
'FundInitiativePHIDType' => 'PhabricatorPHIDType',
|
||||
'FundInitiativeQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'FundInitiativeRefundTransaction' => 'FundInitiativeTransactionType',
|
||||
'FundInitiativeRemarkupRule' => 'PhabricatorObjectRemarkupRule',
|
||||
'FundInitiativeReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||
'FundInitiativeRisksTransaction' => 'FundInitiativeTransactionType',
|
||||
'FundInitiativeSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'FundInitiativeTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'FundInitiativeStatusTransaction' => 'FundInitiativeTransactionType',
|
||||
'FundInitiativeTransaction' => 'PhabricatorModularTransaction',
|
||||
'FundInitiativeTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'FundInitiativeTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'FundInitiativeTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'FundInitiativeViewController' => 'FundController',
|
||||
'FundSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
'HarbormasterArcLintBuildStepImplementation' => 'HarbormasterBuildStepImplementation',
|
||||
|
@ -6343,8 +6434,10 @@ phutil_register_library_map(array(
|
|||
'LegalpadDocumentEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'LegalpadDocumentListController' => 'LegalpadController',
|
||||
'LegalpadDocumentManageController' => 'LegalpadController',
|
||||
'LegalpadDocumentPreambleTransaction' => 'LegalpadDocumentTransactionType',
|
||||
'LegalpadDocumentQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'LegalpadDocumentRemarkupRule' => 'PhabricatorObjectRemarkupRule',
|
||||
'LegalpadDocumentRequireSignatureTransaction' => 'LegalpadDocumentTransactionType',
|
||||
'LegalpadDocumentSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'LegalpadDocumentSignController' => 'LegalpadController',
|
||||
'LegalpadDocumentSignature' => array(
|
||||
|
@ -6355,15 +6448,19 @@ phutil_register_library_map(array(
|
|||
'LegalpadDocumentSignatureListController' => 'LegalpadController',
|
||||
'LegalpadDocumentSignatureQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'LegalpadDocumentSignatureSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'LegalpadDocumentSignatureTypeTransaction' => 'LegalpadDocumentTransactionType',
|
||||
'LegalpadDocumentSignatureVerificationController' => 'LegalpadController',
|
||||
'LegalpadDocumentSignatureViewController' => 'LegalpadController',
|
||||
'LegalpadDocumentTextTransaction' => 'LegalpadDocumentTransactionType',
|
||||
'LegalpadDocumentTitleTransaction' => 'LegalpadDocumentTransactionType',
|
||||
'LegalpadDocumentTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'LegalpadMailReceiver' => 'PhabricatorObjectMailReceiver',
|
||||
'LegalpadObjectNeedsSignatureEdgeType' => 'PhabricatorEdgeType',
|
||||
'LegalpadReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||
'LegalpadRequireSignatureHeraldAction' => 'HeraldAction',
|
||||
'LegalpadSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
'LegalpadSignatureNeededByObjectEdgeType' => 'PhabricatorEdgeType',
|
||||
'LegalpadTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'LegalpadTransaction' => 'PhabricatorModularTransaction',
|
||||
'LegalpadTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'LegalpadTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'LegalpadTransactionView' => 'PhabricatorApplicationTransactionView',
|
||||
|
@ -6758,23 +6855,32 @@ phutil_register_library_map(array(
|
|||
),
|
||||
'PassphraseCredentialAuthorPolicyRule' => 'PhabricatorPolicyRule',
|
||||
'PassphraseCredentialConduitController' => 'PassphraseController',
|
||||
'PassphraseCredentialConduitTransaction' => 'PassphraseCredentialTransactionType',
|
||||
'PassphraseCredentialControl' => 'AphrontFormControl',
|
||||
'PassphraseCredentialCreateController' => 'PassphraseController',
|
||||
'PassphraseCredentialDescriptionTransaction' => 'PassphraseCredentialTransactionType',
|
||||
'PassphraseCredentialDestroyController' => 'PassphraseController',
|
||||
'PassphraseCredentialDestroyTransaction' => 'PassphraseCredentialTransactionType',
|
||||
'PassphraseCredentialEditController' => 'PassphraseController',
|
||||
'PassphraseCredentialFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||
'PassphraseCredentialListController' => 'PassphraseController',
|
||||
'PassphraseCredentialLockController' => 'PassphraseController',
|
||||
'PassphraseCredentialLockTransaction' => 'PassphraseCredentialTransactionType',
|
||||
'PassphraseCredentialLookedAtTransaction' => 'PassphraseCredentialTransactionType',
|
||||
'PassphraseCredentialNameTransaction' => 'PassphraseCredentialTransactionType',
|
||||
'PassphraseCredentialPHIDType' => 'PhabricatorPHIDType',
|
||||
'PassphraseCredentialPublicController' => 'PassphraseController',
|
||||
'PassphraseCredentialQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PassphraseCredentialRevealController' => 'PassphraseController',
|
||||
'PassphraseCredentialSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PassphraseCredentialTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'PassphraseCredentialSecretIDTransaction' => 'PassphraseCredentialTransactionType',
|
||||
'PassphraseCredentialTransaction' => 'PhabricatorModularTransaction',
|
||||
'PassphraseCredentialTransactionEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PassphraseCredentialTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PassphraseCredentialTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'PassphraseCredentialType' => 'Phobject',
|
||||
'PassphraseCredentialTypeTestCase' => 'PhabricatorTestCase',
|
||||
'PassphraseCredentialUsernameTransaction' => 'PassphraseCredentialTransactionType',
|
||||
'PassphraseCredentialViewController' => 'PassphraseController',
|
||||
'PassphraseDAO' => 'PhabricatorLiskDAO',
|
||||
'PassphraseDefaultEditCapability' => 'PhabricatorPolicyCapability',
|
||||
|
@ -6849,9 +6955,12 @@ phutil_register_library_map(array(
|
|||
'PhabricatorApplicationDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhabricatorApplicationDetailViewController' => 'PhabricatorApplicationsController',
|
||||
'PhabricatorApplicationEditController' => 'PhabricatorApplicationsController',
|
||||
'PhabricatorApplicationEditEngine' => 'PhabricatorEditEngine',
|
||||
'PhabricatorApplicationEditHTTPParameterHelpView' => 'AphrontView',
|
||||
'PhabricatorApplicationEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhabricatorApplicationEmailCommandsController' => 'PhabricatorApplicationsController',
|
||||
'PhabricatorApplicationPanelController' => 'PhabricatorApplicationsController',
|
||||
'PhabricatorApplicationPolicyChangeTransaction' => 'PhabricatorApplicationTransactionType',
|
||||
'PhabricatorApplicationProfileMenuItem' => 'PhabricatorProfileMenuItem',
|
||||
'PhabricatorApplicationQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorApplicationSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
|
@ -7487,6 +7596,8 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConpherenceNotificationsSetting' => 'PhabricatorSelectSetting',
|
||||
'PhabricatorConpherencePreferencesSettingsPanel' => 'PhabricatorEditEngineSettingsPanel',
|
||||
'PhabricatorConpherenceProfileMenuItem' => 'PhabricatorProfileMenuItem',
|
||||
'PhabricatorConpherenceRoomContextFreeGrammar' => 'PhutilContextFreeGrammar',
|
||||
'PhabricatorConpherenceRoomTestDataGenerator' => 'PhabricatorTestDataGenerator',
|
||||
'PhabricatorConpherenceSoundSetting' => 'PhabricatorSelectSetting',
|
||||
'PhabricatorConpherenceThreadPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorConpherenceWidgetVisibleSetting' => 'PhabricatorInternalSetting',
|
||||
|
@ -8144,26 +8255,32 @@ phutil_register_library_map(array(
|
|||
'PhabricatorLogoutController' => 'PhabricatorAuthController',
|
||||
'PhabricatorLunarPhasePolicyRule' => 'PhabricatorPolicyRule',
|
||||
'PhabricatorMacroApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorMacroAudioBehaviorTransaction' => 'PhabricatorMacroTransactionType',
|
||||
'PhabricatorMacroAudioController' => 'PhabricatorMacroController',
|
||||
'PhabricatorMacroCommentController' => 'PhabricatorMacroController',
|
||||
'PhabricatorMacroAudioTransaction' => 'PhabricatorMacroTransactionType',
|
||||
'PhabricatorMacroConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
'PhabricatorMacroController' => 'PhabricatorController',
|
||||
'PhabricatorMacroDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhabricatorMacroDisableController' => 'PhabricatorMacroController',
|
||||
'PhabricatorMacroEditController' => 'PhabricatorMacroController',
|
||||
'PhabricatorMacroDisabledTransaction' => 'PhabricatorMacroTransactionType',
|
||||
'PhabricatorMacroEditController' => 'PhameBlogController',
|
||||
'PhabricatorMacroEditEngine' => 'PhabricatorEditEngine',
|
||||
'PhabricatorMacroEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhabricatorMacroFileTransaction' => 'PhabricatorMacroTransactionType',
|
||||
'PhabricatorMacroListController' => 'PhabricatorMacroController',
|
||||
'PhabricatorMacroMacroPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorMacroMailReceiver' => 'PhabricatorObjectMailReceiver',
|
||||
'PhabricatorMacroManageCapability' => 'PhabricatorPolicyCapability',
|
||||
'PhabricatorMacroMemeController' => 'PhabricatorMacroController',
|
||||
'PhabricatorMacroMemeDialogController' => 'PhabricatorMacroController',
|
||||
'PhabricatorMacroNameTransaction' => 'PhabricatorMacroTransactionType',
|
||||
'PhabricatorMacroQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorMacroReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||
'PhabricatorMacroSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PhabricatorMacroTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'PhabricatorMacroTransaction' => 'PhabricatorModularTransaction',
|
||||
'PhabricatorMacroTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'PhabricatorMacroTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PhabricatorMacroTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'PhabricatorMacroViewController' => 'PhabricatorMacroController',
|
||||
'PhabricatorMailEmailHeraldField' => 'HeraldField',
|
||||
'PhabricatorMailEmailHeraldFieldGroup' => 'HeraldFieldGroup',
|
||||
|
@ -9238,10 +9355,12 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSlowvoteApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorSlowvoteChoice' => 'PhabricatorSlowvoteDAO',
|
||||
'PhabricatorSlowvoteCloseController' => 'PhabricatorSlowvoteController',
|
||||
'PhabricatorSlowvoteCloseTransaction' => 'PhabricatorSlowvoteTransactionType',
|
||||
'PhabricatorSlowvoteCommentController' => 'PhabricatorSlowvoteController',
|
||||
'PhabricatorSlowvoteController' => 'PhabricatorController',
|
||||
'PhabricatorSlowvoteDAO' => 'PhabricatorLiskDAO',
|
||||
'PhabricatorSlowvoteDefaultViewCapability' => 'PhabricatorPolicyCapability',
|
||||
'PhabricatorSlowvoteDescriptionTransaction' => 'PhabricatorSlowvoteTransactionType',
|
||||
'PhabricatorSlowvoteEditController' => 'PhabricatorSlowvoteController',
|
||||
'PhabricatorSlowvoteEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhabricatorSlowvoteListController' => 'PhabricatorSlowvoteController',
|
||||
|
@ -9261,12 +9380,16 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSlowvotePollController' => 'PhabricatorSlowvoteController',
|
||||
'PhabricatorSlowvotePollPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorSlowvoteQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorSlowvoteQuestionTransaction' => 'PhabricatorSlowvoteTransactionType',
|
||||
'PhabricatorSlowvoteReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||
'PhabricatorSlowvoteResponsesTransaction' => 'PhabricatorSlowvoteTransactionType',
|
||||
'PhabricatorSlowvoteSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
'PhabricatorSlowvoteSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PhabricatorSlowvoteTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'PhabricatorSlowvoteShuffleTransaction' => 'PhabricatorSlowvoteTransactionType',
|
||||
'PhabricatorSlowvoteTransaction' => 'PhabricatorModularTransaction',
|
||||
'PhabricatorSlowvoteTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'PhabricatorSlowvoteTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PhabricatorSlowvoteTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'PhabricatorSlowvoteVoteController' => 'PhabricatorSlowvoteController',
|
||||
'PhabricatorSlug' => 'Phobject',
|
||||
'PhabricatorSlugTestCase' => 'PhabricatorTestCase',
|
||||
|
@ -9289,13 +9412,18 @@ phutil_register_library_map(array(
|
|||
'PhabricatorApplicationTransactionInterface',
|
||||
'PhabricatorDestructibleInterface',
|
||||
),
|
||||
'PhabricatorSpacesNamespaceArchiveTransaction' => 'PhabricatorSpacesNamespaceTransactionType',
|
||||
'PhabricatorSpacesNamespaceDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhabricatorSpacesNamespaceDefaultTransaction' => 'PhabricatorSpacesNamespaceTransactionType',
|
||||
'PhabricatorSpacesNamespaceDescriptionTransaction' => 'PhabricatorSpacesNamespaceTransactionType',
|
||||
'PhabricatorSpacesNamespaceEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhabricatorSpacesNamespaceNameTransaction' => 'PhabricatorSpacesNamespaceTransactionType',
|
||||
'PhabricatorSpacesNamespacePHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorSpacesNamespaceQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorSpacesNamespaceSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PhabricatorSpacesNamespaceTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'PhabricatorSpacesNamespaceTransaction' => 'PhabricatorModularTransaction',
|
||||
'PhabricatorSpacesNamespaceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PhabricatorSpacesNamespaceTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'PhabricatorSpacesNoAccessController' => 'PhabricatorSpacesController',
|
||||
'PhabricatorSpacesRemarkupRule' => 'PhabricatorObjectRemarkupRule',
|
||||
'PhabricatorSpacesSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
|
@ -9660,24 +9788,34 @@ phutil_register_library_map(array(
|
|||
'PhameBlogController' => 'PhameController',
|
||||
'PhameBlogCreateCapability' => 'PhabricatorPolicyCapability',
|
||||
'PhameBlogDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhameBlogDescriptionTransaction' => 'PhameBlogTransactionType',
|
||||
'PhameBlogEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||
'PhameBlogEditController' => 'PhameBlogController',
|
||||
'PhameBlogEditEngine' => 'PhabricatorEditEngine',
|
||||
'PhameBlogEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhameBlogFeedController' => 'PhameBlogController',
|
||||
'PhameBlogFullDomainTransaction' => 'PhameBlogTransactionType',
|
||||
'PhameBlogFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||
'PhameBlogHeaderImageTransaction' => 'PhameBlogTransactionType',
|
||||
'PhameBlogHeaderPictureController' => 'PhameBlogController',
|
||||
'PhameBlogListController' => 'PhameBlogController',
|
||||
'PhameBlogListView' => 'AphrontTagView',
|
||||
'PhameBlogManageController' => 'PhameBlogController',
|
||||
'PhameBlogNameTransaction' => 'PhameBlogTransactionType',
|
||||
'PhameBlogParentDomainTransaction' => 'PhameBlogTransactionType',
|
||||
'PhameBlogParentSiteTransaction' => 'PhameBlogTransactionType',
|
||||
'PhameBlogProfileImageTransaction' => 'PhameBlogTransactionType',
|
||||
'PhameBlogProfilePictureController' => 'PhameBlogController',
|
||||
'PhameBlogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhameBlogReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||
'PhameBlogSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
|
||||
'PhameBlogSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PhameBlogSite' => 'PhameSite',
|
||||
'PhameBlogTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'PhameBlogStatusTransaction' => 'PhameBlogTransactionType',
|
||||
'PhameBlogSubtitleTransaction' => 'PhameBlogTransactionType',
|
||||
'PhameBlogTransaction' => 'PhabricatorModularTransaction',
|
||||
'PhameBlogTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PhameBlogTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'PhameBlogViewController' => 'PhameLiveController',
|
||||
'PhameConstants' => 'Phobject',
|
||||
'PhameController' => 'PhabricatorController',
|
||||
|
@ -9701,12 +9839,15 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFulltextInterface',
|
||||
),
|
||||
'PhamePostArchiveController' => 'PhamePostController',
|
||||
'PhamePostBlogTransaction' => 'PhamePostTransactionType',
|
||||
'PhamePostBodyTransaction' => 'PhamePostTransactionType',
|
||||
'PhamePostController' => 'PhameController',
|
||||
'PhamePostEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||
'PhamePostEditController' => 'PhamePostController',
|
||||
'PhamePostEditEngine' => 'PhabricatorEditEngine',
|
||||
'PhamePostEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhamePostFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||
'PhamePostHeaderImageTransaction' => 'PhamePostTransactionType',
|
||||
'PhamePostHeaderPictureController' => 'PhamePostController',
|
||||
'PhamePostHistoryController' => 'PhamePostController',
|
||||
'PhamePostListController' => 'PhamePostController',
|
||||
|
@ -9719,10 +9860,14 @@ phutil_register_library_map(array(
|
|||
'PhamePostReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||
'PhamePostSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
|
||||
'PhamePostSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PhamePostTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'PhamePostSubtitleTransaction' => 'PhamePostTransactionType',
|
||||
'PhamePostTitleTransaction' => 'PhamePostTransactionType',
|
||||
'PhamePostTransaction' => 'PhabricatorModularTransaction',
|
||||
'PhamePostTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'PhamePostTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PhamePostTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'PhamePostViewController' => 'PhameLiveController',
|
||||
'PhamePostVisibilityTransaction' => 'PhamePostTransactionType',
|
||||
'PhameSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
'PhameSite' => 'PhabricatorSite',
|
||||
'PhluxController' => 'PhabricatorController',
|
||||
|
@ -10085,18 +10230,22 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDestructibleInterface',
|
||||
),
|
||||
'PonderAnswerCommentController' => 'PonderController',
|
||||
'PonderAnswerContentTransaction' => 'PonderAnswerTransactionType',
|
||||
'PonderAnswerEditController' => 'PonderController',
|
||||
'PonderAnswerEditor' => 'PonderEditor',
|
||||
'PonderAnswerHistoryController' => 'PonderController',
|
||||
'PonderAnswerMailReceiver' => 'PhabricatorObjectMailReceiver',
|
||||
'PonderAnswerPHIDType' => 'PhabricatorPHIDType',
|
||||
'PonderAnswerQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PonderAnswerQuestionIDTransaction' => 'PonderAnswerTransactionType',
|
||||
'PonderAnswerReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||
'PonderAnswerSaveController' => 'PonderController',
|
||||
'PonderAnswerStatus' => 'PonderConstants',
|
||||
'PonderAnswerTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'PonderAnswerStatusTransaction' => 'PonderAnswerTransactionType',
|
||||
'PonderAnswerTransaction' => 'PhabricatorModularTransaction',
|
||||
'PonderAnswerTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'PonderAnswerTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PonderAnswerTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'PonderAnswerView' => 'AphrontTagView',
|
||||
'PonderConstants' => 'Phobject',
|
||||
'PonderController' => 'PhabricatorController',
|
||||
|
@ -10118,9 +10267,13 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSpacesInterface',
|
||||
'PhabricatorFulltextInterface',
|
||||
),
|
||||
'PonderQuestionAnswerTransaction' => 'PonderQuestionTransactionType',
|
||||
'PonderQuestionAnswerWikiTransaction' => 'PonderQuestionTransactionType',
|
||||
'PonderQuestionCommentController' => 'PonderController',
|
||||
'PonderQuestionContentTransaction' => 'PonderQuestionTransactionType',
|
||||
'PonderQuestionCreateMailReceiver' => 'PhabricatorMailReceiver',
|
||||
'PonderQuestionEditController' => 'PonderController',
|
||||
'PonderQuestionEditEngine' => 'PhabricatorEditEngine',
|
||||
'PonderQuestionEditor' => 'PonderEditor',
|
||||
'PonderQuestionFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||
'PonderQuestionHistoryController' => 'PonderController',
|
||||
|
@ -10132,9 +10285,12 @@ phutil_register_library_map(array(
|
|||
'PonderQuestionSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PonderQuestionStatus' => 'PonderConstants',
|
||||
'PonderQuestionStatusController' => 'PonderController',
|
||||
'PonderQuestionTransaction' => 'PhabricatorApplicationTransaction',
|
||||
'PonderQuestionStatusTransaction' => 'PonderQuestionTransactionType',
|
||||
'PonderQuestionTitleTransaction' => 'PonderQuestionTransactionType',
|
||||
'PonderQuestionTransaction' => 'PhabricatorModularTransaction',
|
||||
'PonderQuestionTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'PonderQuestionTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PonderQuestionTransactionType' => 'PhabricatorModularTransactionType',
|
||||
'PonderQuestionViewController' => 'PonderController',
|
||||
'PonderRemarkupRule' => 'PhabricatorObjectRemarkupRule',
|
||||
'PonderSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
|
|
|
@ -284,7 +284,6 @@ abstract class PhabricatorApplication
|
|||
throw new PhutilMethodNotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/* -( Fact Integration )--------------------------------------------------- */
|
||||
|
||||
|
||||
|
|
|
@ -127,6 +127,9 @@ final class PhabricatorCalendarEventEditor
|
|||
// Clear the availability caches for users whose availability is affected
|
||||
// by this edit.
|
||||
|
||||
$phids = mpull($object->getInvitees(), 'getInviteePHID');
|
||||
$phids = array_fuse($phids);
|
||||
|
||||
$invalidate_all = false;
|
||||
$invalidate_phids = array();
|
||||
foreach ($xactions as $xaction) {
|
||||
|
@ -146,16 +149,21 @@ final class PhabricatorCalendarEventEditor
|
|||
$invalidate_phids[$acting_phid] = $acting_phid;
|
||||
break;
|
||||
case PhabricatorCalendarEventInviteTransaction::TRANSACTIONTYPE:
|
||||
foreach ($xaction->getNewValue() as $phid => $ignored) {
|
||||
foreach ($xaction->getOldValue() as $phid) {
|
||||
// Add the possibly un-invited user to the list of potentially
|
||||
// affected users if they are't already present.
|
||||
$phids[$phid] = $phid;
|
||||
|
||||
$invalidate_phids[$phid] = $phid;
|
||||
}
|
||||
|
||||
foreach ($xaction->getNewValue() as $phid) {
|
||||
$invalidate_phids[$phid] = $phid;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$phids = mpull($object->getInvitees(), 'getInviteePHID');
|
||||
$phids = array_fuse($phids);
|
||||
|
||||
if (!$invalidate_all) {
|
||||
$phids = array_select_keys($phids, $invalidate_phids);
|
||||
}
|
||||
|
@ -168,10 +176,9 @@ final class PhabricatorCalendarEventEditor
|
|||
queryfx(
|
||||
$conn_w,
|
||||
'UPDATE %T SET availabilityCacheTTL = NULL
|
||||
WHERE phid IN (%Ls) AND availabilityCacheTTL >= %d',
|
||||
WHERE phid IN (%Ls)',
|
||||
$user->getTableName(),
|
||||
$phids,
|
||||
$object->getStartDateTimeEpochForCache());
|
||||
$phids);
|
||||
}
|
||||
|
||||
return $xactions;
|
||||
|
|
|
@ -45,8 +45,10 @@ final class PhabricatorConpherenceApplication extends PhabricatorApplication {
|
|||
=> 'ConpherenceViewController',
|
||||
'columnview/'
|
||||
=> 'ConpherenceColumnViewController',
|
||||
'new/'
|
||||
=> 'ConpherenceNewRoomController',
|
||||
$this->getEditRoutePattern('new/')
|
||||
=> 'ConpherenceRoomEditController',
|
||||
$this->getEditRoutePattern('edit/')
|
||||
=> 'ConpherenceRoomEditController',
|
||||
'picture/(?P<id>[1-9]\d*)/'
|
||||
=> 'ConpherenceRoomPictureController',
|
||||
'search/(?:query/(?P<queryKey>[^/]+)/)?'
|
||||
|
|
|
@ -11,6 +11,16 @@ final class ConpherenceCreateThreadConduitAPIMethod
|
|||
return pht('Create a new conpherence thread.');
|
||||
}
|
||||
|
||||
public function getMethodStatus() {
|
||||
return self::METHOD_STATUS_FROZEN;
|
||||
}
|
||||
|
||||
public function getMethodStatusDescription() {
|
||||
return pht(
|
||||
'This method is frozen and will eventually be deprecated. New code '.
|
||||
'should use "conpherence.edit" instead.');
|
||||
}
|
||||
|
||||
protected function defineParamTypes() {
|
||||
return array(
|
||||
'title' => 'required string',
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
final class ConpherenceEditConduitAPIMethod
|
||||
extends PhabricatorEditEngineAPIMethod {
|
||||
|
||||
public function getAPIMethodName() {
|
||||
return 'conpherence.edit';
|
||||
}
|
||||
|
||||
public function newEditEngine() {
|
||||
return new ConpherenceEditEngine();
|
||||
}
|
||||
|
||||
public function getMethodSummary() {
|
||||
return pht(
|
||||
'Apply transactions to create a new room or edit an existing one.');
|
||||
}
|
||||
|
||||
}
|
|
@ -11,6 +11,16 @@ final class ConpherenceUpdateThreadConduitAPIMethod
|
|||
return pht('Update an existing conpherence room.');
|
||||
}
|
||||
|
||||
public function getMethodStatus() {
|
||||
return self::METHOD_STATUS_FROZEN;
|
||||
}
|
||||
|
||||
public function getMethodStatusDescription() {
|
||||
return pht(
|
||||
'This method is frozen and will eventually be deprecated. New code '.
|
||||
'should use "conpherence.edit" instead.');
|
||||
}
|
||||
|
||||
protected function defineParamTypes() {
|
||||
return array(
|
||||
'id' => 'optional int',
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
final class ConpherenceUpdateActions extends ConpherenceConstants {
|
||||
|
||||
const METADATA = 'metadata';
|
||||
const MESSAGE = 'message';
|
||||
const DRAFT = 'draft';
|
||||
const JOIN_ROOM = 'join_room';
|
||||
|
|
|
@ -91,7 +91,8 @@ abstract class ConpherenceController extends PhabricatorController {
|
|||
|
||||
$header->addActionItem(
|
||||
id(new PHUIIconCircleView())
|
||||
->setHref($this->getApplicationURI("update/{$id}/"))
|
||||
->setHref(
|
||||
$this->getApplicationURI('edit/'.$conpherence->getID()).'/')
|
||||
->setIcon('fa-pencil')
|
||||
->addClass('hide-on-device')
|
||||
->setColor('violet')
|
||||
|
|
|
@ -1,117 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class ConpherenceNewRoomController extends ConpherenceController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$user = $request->getUser();
|
||||
|
||||
$title = pht('New Room');
|
||||
$e_title = true;
|
||||
$validation_exception = null;
|
||||
|
||||
$conpherence = ConpherenceThread::initializeNewRoom($user);
|
||||
$participants = array();
|
||||
if ($request->isFormPost()) {
|
||||
$editor = new ConpherenceEditor();
|
||||
$xactions = array();
|
||||
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($request->getStr('title'));
|
||||
|
||||
$participants = $request->getArr('participants');
|
||||
$participants[] = $user->getPHID();
|
||||
$participants = array_unique($participants);
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(
|
||||
ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue(array('+' => $participants));
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($request->getStr('topic'));
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
|
||||
->setNewValue($request->getStr('viewPolicy'));
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)
|
||||
->setNewValue($request->getStr('editPolicy'));
|
||||
|
||||
try {
|
||||
$editor
|
||||
->setContentSourceFromRequest($request)
|
||||
->setContinueOnNoEffect(true)
|
||||
->setActor($user)
|
||||
->applyTransactions($conpherence, $xactions);
|
||||
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setURI('/'.$conpherence->getMonogram());
|
||||
} catch (PhabricatorApplicationTransactionValidationException $ex) {
|
||||
$validation_exception = $ex;
|
||||
|
||||
$e_title = $ex->getShortMessage(
|
||||
ConpherenceThreadTitleTransaction::TRANSACTIONTYPE);
|
||||
|
||||
$conpherence->setViewPolicy($request->getStr('viewPolicy'));
|
||||
$conpherence->setEditPolicy($request->getStr('editPolicy'));
|
||||
}
|
||||
} else {
|
||||
if ($request->getStr('participant')) {
|
||||
$participants[] = $request->getStr('participant');
|
||||
}
|
||||
}
|
||||
|
||||
$policies = id(new PhabricatorPolicyQuery())
|
||||
->setViewer($user)
|
||||
->setObject($conpherence)
|
||||
->execute();
|
||||
|
||||
$submit_uri = $this->getApplicationURI('new/');
|
||||
$cancel_uri = $this->getApplicationURI('search/');
|
||||
|
||||
$dialog = $this->newDialog()
|
||||
->setWidth(AphrontDialogView::WIDTH_FORM)
|
||||
->setValidationException($validation_exception)
|
||||
->setUser($user)
|
||||
->setTitle($title)
|
||||
->addCancelButton($cancel_uri)
|
||||
->addSubmitButton(pht('Create Room'));
|
||||
|
||||
$form = id(new PHUIFormLayoutView())
|
||||
->setUser($user)
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setError($e_title)
|
||||
->setLabel(pht('Name'))
|
||||
->setName('title')
|
||||
->setValue($request->getStr('title')))
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel(pht('Topic'))
|
||||
->setName('topic')
|
||||
->setValue($request->getStr('topic')))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setName('participants')
|
||||
->setUser($user)
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setValue($participants)
|
||||
->setLabel(pht('Other Participants')))
|
||||
->appendChild(
|
||||
id(new AphrontFormPolicyControl())
|
||||
->setName('viewPolicy')
|
||||
->setPolicyObject($conpherence)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
|
||||
->setPolicies($policies))
|
||||
->appendChild(
|
||||
id(new AphrontFormPolicyControl())
|
||||
->setName('editPolicy')
|
||||
->setPolicyObject($conpherence)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
|
||||
->setPolicies($policies));
|
||||
|
||||
$dialog->appendChild($form);
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
final class ConpherenceRoomEditController
|
||||
extends ConpherenceController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
return id(new ConpherenceEditEngine())
|
||||
->setController($this)
|
||||
->buildResponse();
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@ final class ConpherenceUpdateController
|
|||
|
||||
$need_participants = false;
|
||||
$needed_capabilities = array(PhabricatorPolicyCapability::CAN_VIEW);
|
||||
$action = $request->getStr('action', ConpherenceUpdateActions::METADATA);
|
||||
$action = $request->getStr('action');
|
||||
switch ($action) {
|
||||
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||
$person_phid = $request->getStr('remove_person');
|
||||
|
@ -21,7 +21,6 @@ final class ConpherenceUpdateController
|
|||
}
|
||||
break;
|
||||
case ConpherenceUpdateActions::ADD_PERSON:
|
||||
case ConpherenceUpdateActions::METADATA:
|
||||
$needed_capabilities[] = PhabricatorPolicyCapability::CAN_EDIT;
|
||||
break;
|
||||
case ConpherenceUpdateActions::LOAD:
|
||||
|
@ -110,35 +109,6 @@ final class ConpherenceUpdateController
|
|||
$response_mode = 'go-home';
|
||||
}
|
||||
break;
|
||||
case ConpherenceUpdateActions::METADATA:
|
||||
$title = $request->getStr('title');
|
||||
$topic = $request->getStr('topic');
|
||||
|
||||
// all other metadata updates are continue requests
|
||||
if (!$request->isContinueRequest()) {
|
||||
break;
|
||||
}
|
||||
|
||||
$title = $request->getStr('title');
|
||||
$topic = $request->getStr('topic');
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(
|
||||
ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($title);
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(
|
||||
ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($topic);
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
|
||||
->setNewValue($request->getStr('viewPolicy'));
|
||||
$xactions[] = id(new ConpherenceTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)
|
||||
->setNewValue($request->getStr('editPolicy'));
|
||||
if (!$request->getExists('force_ajax')) {
|
||||
$response_mode = 'redirect';
|
||||
}
|
||||
break;
|
||||
case ConpherenceUpdateActions::LOAD:
|
||||
$updated = false;
|
||||
$response_mode = 'ajax';
|
||||
|
@ -208,10 +178,6 @@ final class ConpherenceUpdateController
|
|||
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||
$dialog = $this->renderRemovePersonDialog($conpherence);
|
||||
break;
|
||||
case ConpherenceUpdateActions::METADATA:
|
||||
default:
|
||||
$dialog = $this->renderMetadataDialog($conpherence, $error_view);
|
||||
break;
|
||||
}
|
||||
|
||||
return
|
||||
|
@ -332,62 +298,6 @@ final class ConpherenceUpdateController
|
|||
return $dialog;
|
||||
}
|
||||
|
||||
private function renderMetadataDialog(
|
||||
ConpherenceThread $conpherence,
|
||||
$error_view) {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$user = $request->getUser();
|
||||
|
||||
$title = pht('Update Room');
|
||||
$form = id(new PHUIFormLayoutView())
|
||||
->appendChild($error_view)
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel(pht('Title'))
|
||||
->setName('title')
|
||||
->setValue($conpherence->getTitle()))
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel(pht('Topic'))
|
||||
->setName('topic')
|
||||
->setValue($conpherence->getTopic()));
|
||||
|
||||
$policies = id(new PhabricatorPolicyQuery())
|
||||
->setViewer($user)
|
||||
->setObject($conpherence)
|
||||
->execute();
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormPolicyControl())
|
||||
->setName('viewPolicy')
|
||||
->setPolicyObject($conpherence)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
|
||||
->setPolicies($policies))
|
||||
->appendChild(
|
||||
id(new AphrontFormPolicyControl())
|
||||
->setName('editPolicy')
|
||||
->setPolicyObject($conpherence)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
|
||||
->setPolicies($policies));
|
||||
|
||||
$view = id(new AphrontDialogView())
|
||||
->setTitle($title)
|
||||
->addHiddenInput('action', 'metadata')
|
||||
->addHiddenInput(
|
||||
'latest_transaction_id',
|
||||
$request->getInt('latest_transaction_id'))
|
||||
->addHiddenInput('__continue__', true)
|
||||
->appendChild($form);
|
||||
|
||||
if ($request->getExists('force_ajax')) {
|
||||
$view->addHiddenInput('force_ajax', true);
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function loadAndRenderUpdates(
|
||||
$action,
|
||||
$conpherence_id,
|
||||
|
@ -395,7 +305,6 @@ final class ConpherenceUpdateController
|
|||
|
||||
$need_transactions = false;
|
||||
switch ($action) {
|
||||
case ConpherenceUpdateActions::METADATA:
|
||||
case ConpherenceUpdateActions::LOAD:
|
||||
$need_transactions = true;
|
||||
break;
|
||||
|
@ -444,15 +353,6 @@ final class ConpherenceUpdateController
|
|||
$header = null;
|
||||
$people_widget = null;
|
||||
switch ($action) {
|
||||
case ConpherenceUpdateActions::METADATA:
|
||||
$header = $this->buildHeaderPaneContent($conpherence);
|
||||
$header = hsprintf('%s', $header);
|
||||
$nav_item = id(new ConpherenceThreadListView())
|
||||
->setUser($user)
|
||||
->setBaseURI($this->getApplicationURI())
|
||||
->renderThreadItem($conpherence);
|
||||
$nav_item = hsprintf('%s', $nav_item);
|
||||
break;
|
||||
case ConpherenceUpdateActions::ADD_PERSON:
|
||||
$people_widget = id(new ConpherenceParticipantView())
|
||||
->setUser($user)
|
||||
|
|
118
src/applications/conpherence/editor/ConpherenceEditEngine.php
Normal file
118
src/applications/conpherence/editor/ConpherenceEditEngine.php
Normal file
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
|
||||
final class ConpherenceEditEngine
|
||||
extends PhabricatorEditEngine {
|
||||
|
||||
const ENGINECONST = 'conpherence.thread';
|
||||
|
||||
public function getEngineName() {
|
||||
return pht('Conpherence');
|
||||
}
|
||||
|
||||
public function getEngineApplicationClass() {
|
||||
return 'PhabricatorConpherenceApplication';
|
||||
}
|
||||
|
||||
public function getSummaryHeader() {
|
||||
return pht('Configure Conpherence Forms');
|
||||
}
|
||||
|
||||
public function getSummaryText() {
|
||||
return pht('Configure creation and editing forms in Conpherence.');
|
||||
}
|
||||
|
||||
protected function newEditableObject() {
|
||||
return ConpherenceThread::initializeNewRoom($this->getViewer());
|
||||
}
|
||||
|
||||
protected function newObjectQuery() {
|
||||
return new ConpherenceThreadQuery();
|
||||
}
|
||||
|
||||
protected function getObjectCreateTitleText($object) {
|
||||
return pht('Create New Room');
|
||||
}
|
||||
|
||||
protected function getObjectEditTitleText($object) {
|
||||
return pht('Edit Room: %s', $object->getTitle());
|
||||
}
|
||||
|
||||
protected function getObjectEditShortText($object) {
|
||||
return $object->getTitle();
|
||||
}
|
||||
|
||||
protected function getObjectCreateShortText() {
|
||||
return pht('Create Room');
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Room');
|
||||
}
|
||||
|
||||
protected function getObjectCreateCancelURI($object) {
|
||||
return $this->getApplication()->getApplicationURI('/');
|
||||
}
|
||||
|
||||
protected function getEditorURI() {
|
||||
return $this->getApplication()->getApplicationURI('edit/');
|
||||
}
|
||||
|
||||
protected function getObjectViewURI($object) {
|
||||
return $object->getURI();
|
||||
}
|
||||
|
||||
public function isEngineConfigurable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function buildCustomEditFields($object) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
if ($this->getIsCreate()) {
|
||||
$participant_phids = array($viewer->getPHID());
|
||||
$initial_phids = array();
|
||||
} else {
|
||||
$participant_phids = $object->getParticipantPHIDs();
|
||||
$initial_phids = $participant_phids;
|
||||
}
|
||||
|
||||
// Only show participants on create or conduit, not edit
|
||||
$conduit_only = !$this->getIsCreate();
|
||||
|
||||
return array(
|
||||
id(new PhabricatorTextEditField())
|
||||
->setKey('name')
|
||||
->setLabel(pht('Name'))
|
||||
->setDescription(pht('Room name.'))
|
||||
->setConduitTypeDescription(pht('New Room name.'))
|
||||
->setIsRequired(true)
|
||||
->setTransactionType(
|
||||
ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getTitle()),
|
||||
|
||||
id(new PhabricatorTextEditField())
|
||||
->setKey('topic')
|
||||
->setLabel(pht('Topic'))
|
||||
->setDescription(pht('Room topic.'))
|
||||
->setConduitTypeDescription(pht('New Room topic.'))
|
||||
->setTransactionType(
|
||||
ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getTopic()),
|
||||
|
||||
id(new PhabricatorUsersEditField())
|
||||
->setKey('participants')
|
||||
->setValue($participant_phids)
|
||||
->setInitialValue($initial_phids)
|
||||
->setIsConduitOnly($conduit_only)
|
||||
->setAliases(array('users', 'members', 'participants', 'userPHID'))
|
||||
->setDescription(pht('Room participants.'))
|
||||
->setUseEdgeTransactions(true)
|
||||
->setConduitTypeDescription(pht('New Room participants.'))
|
||||
->setTransactionType(
|
||||
ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE)
|
||||
->setLabel(pht('Initial Participants')),
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorConpherenceRoomContextFreeGrammar
|
||||
extends PhutilContextFreeGrammar {
|
||||
protected function getRules() {
|
||||
return array(
|
||||
'start' => array(
|
||||
'[dept]',
|
||||
'[dept]',
|
||||
'[dept]',
|
||||
'[dept]',
|
||||
'[dept]',
|
||||
'[dept]',
|
||||
'[dept]',
|
||||
'[dept] ([city])',
|
||||
'[dept] ([city])',
|
||||
'[dept] - [city]',
|
||||
'[dept] - [room]',
|
||||
'[dept] / [room]',
|
||||
'[dept] [room]',
|
||||
'[city] ([dept]) - [room]',
|
||||
'[dept] ([city]) - [room]',
|
||||
'[dept] ([city]) [room]',
|
||||
),
|
||||
'dept' => array(
|
||||
'Eng',
|
||||
'Engineering',
|
||||
'User Interface',
|
||||
'Design',
|
||||
'Data Science',
|
||||
'Database',
|
||||
'Marketing',
|
||||
'Content',
|
||||
'Ads',
|
||||
'Operations',
|
||||
'Network Ops',
|
||||
'Ops',
|
||||
'Server Ops',
|
||||
'IT',
|
||||
'Information Technology',
|
||||
'i18n',
|
||||
'Internationalization',
|
||||
'Human Resources',
|
||||
'HR',
|
||||
'Research & Development',
|
||||
'R&D',
|
||||
'Management',
|
||||
'Directors',
|
||||
'Managers',
|
||||
'Support',
|
||||
'Customer Support',
|
||||
'Finance',
|
||||
'Sales',
|
||||
'Purchasing',
|
||||
'Education',
|
||||
'Hardware Engineering',
|
||||
'Software',
|
||||
'Supply Management',
|
||||
'Logistics',
|
||||
'Growth',
|
||||
'Content Strategy',
|
||||
'Developer Relations',
|
||||
'Accounting',
|
||||
'Production',
|
||||
),
|
||||
'city' => array(
|
||||
'Palo Alto',
|
||||
'Mtn View',
|
||||
'Cupertino',
|
||||
'Los Altos',
|
||||
'Menlo Park',
|
||||
'Santa Cruz',
|
||||
'S.F.',
|
||||
'San Francisco',
|
||||
'Seattle',
|
||||
'London',
|
||||
'New York',
|
||||
'Dublin',
|
||||
'Tokyo',
|
||||
),
|
||||
'room' => array(
|
||||
'General',
|
||||
'Announcements',
|
||||
'Staff',
|
||||
'Interns',
|
||||
'Managers',
|
||||
'Book Club',
|
||||
'Parking',
|
||||
'Sports',
|
||||
'Social',
|
||||
'Commuting',
|
||||
'For Sale',
|
||||
'Parents@',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorConpherenceRoomTestDataGenerator
|
||||
extends PhabricatorTestDataGenerator {
|
||||
|
||||
const GENERATORKEY = 'conpherence';
|
||||
|
||||
public function getGeneratorName() {
|
||||
return pht('Conpherence');
|
||||
}
|
||||
|
||||
public function generateObject() {
|
||||
$author = $this->loadRandomUser();
|
||||
|
||||
$name = $this->newRoomName();
|
||||
|
||||
$participants = array();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
$participants[] = $this->loadRandomUser();
|
||||
|
||||
$rando_phids = array();
|
||||
$rando_phids[] = $author->getPHID();
|
||||
foreach ($participants as $actor) {
|
||||
$rando_phids[] = $actor->getPHID();
|
||||
}
|
||||
|
||||
$xactions = array();
|
||||
|
||||
$xactions[] = array(
|
||||
'type' => 'name',
|
||||
'value' => $name,
|
||||
);
|
||||
|
||||
$xactions[] = array(
|
||||
'type' => 'participants.set',
|
||||
'value' => $rando_phids,
|
||||
);
|
||||
|
||||
$xactions[] = array(
|
||||
'type' => 'view',
|
||||
'value' => 'users',
|
||||
);
|
||||
|
||||
$xactions[] = array(
|
||||
'type' => 'edit',
|
||||
'value' => 'users',
|
||||
);
|
||||
|
||||
$params = array(
|
||||
'transactions' => $xactions,
|
||||
);
|
||||
|
||||
$result = id(new ConduitCall('conpherence.edit', $params))
|
||||
->setUser($author)
|
||||
->execute();
|
||||
|
||||
return $result['object']['phid'];
|
||||
}
|
||||
|
||||
protected function newRoomName() {
|
||||
$generator = new PhabricatorConpherenceRoomContextFreeGrammar();
|
||||
$name = $generator->generate();
|
||||
return $name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -363,9 +363,9 @@ final class ConpherenceDurableColumnView extends AphrontTagView {
|
|||
$actions[] = array(
|
||||
'name' => pht('Edit Room'),
|
||||
'disabled' => !$can_edit,
|
||||
'href' => '/conpherence/update/'.$conpherence->getID().'/?nopic',
|
||||
'href' => '/conpherence/edit/'.$conpherence->getID().'/',
|
||||
'icon' => 'fa-pencil',
|
||||
'key' => ConpherenceUpdateActions::METADATA,
|
||||
'key' => 'go_edit',
|
||||
);
|
||||
$actions[] = array(
|
||||
'name' => pht('View in Conpherence'),
|
||||
|
|
|
@ -117,7 +117,7 @@ final class ConpherenceThreadListView extends AphrontView {
|
|||
$new_icon = id(new PHUIIconView())
|
||||
->setIcon('fa-plus-square')
|
||||
->addSigil('has-tooltip')
|
||||
->setHref('/conpherence/new/')
|
||||
->setHref('/conpherence/edit/')
|
||||
->setWorkflow(true)
|
||||
->setMetaData(array(
|
||||
'tip' => pht('New Room'),
|
||||
|
|
|
@ -1191,12 +1191,23 @@ final class DifferentialTransactionEditor
|
|||
array $changes,
|
||||
PhutilMarkupEngine $engine) {
|
||||
|
||||
$flat_blocks = mpull($changes, 'getNewValue');
|
||||
$huge_block = implode("\n\n", $flat_blocks);
|
||||
|
||||
// For "Fixes ..." and "Depends on ...", we're only going to look at
|
||||
// content blocks which are part of the revision itself (like "Summary"
|
||||
// and "Test Plan"), not comments.
|
||||
$content_parts = array();
|
||||
foreach ($changes as $change) {
|
||||
if ($change->getTransaction()->isCommentTransaction()) {
|
||||
continue;
|
||||
}
|
||||
$content_parts[] = $change->getNewValue();
|
||||
}
|
||||
if (!$content_parts) {
|
||||
return array();
|
||||
}
|
||||
$content_block = implode("\n\n", $content_parts);
|
||||
$task_map = array();
|
||||
$task_refs = id(new ManiphestCustomFieldStatusParser())
|
||||
->parseCorpus($huge_block);
|
||||
->parseCorpus($content_block);
|
||||
foreach ($task_refs as $match) {
|
||||
foreach ($match['monograms'] as $monogram) {
|
||||
$task_id = (int)trim($monogram, 'tT');
|
||||
|
@ -1206,7 +1217,7 @@ final class DifferentialTransactionEditor
|
|||
|
||||
$rev_map = array();
|
||||
$rev_refs = id(new DifferentialCustomFieldDependsOnParser())
|
||||
->parseCorpus($huge_block);
|
||||
->parseCorpus($content_block);
|
||||
foreach ($rev_refs as $match) {
|
||||
foreach ($match['monograms'] as $monogram) {
|
||||
$rev_id = (int)trim($monogram, 'dD');
|
||||
|
|
|
@ -96,7 +96,7 @@ final class FundInitiativeBackController
|
|||
$xactions = array();
|
||||
|
||||
$xactions[] = id(new FundBackerTransaction())
|
||||
->setTransactionType(FundBackerTransaction::TYPE_STATUS)
|
||||
->setTransactionType(FundBackerStatusTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue(FundBacker::STATUS_IN_CART);
|
||||
|
||||
$editor = id(new FundBackerEditor())
|
||||
|
|
|
@ -25,7 +25,7 @@ final class FundInitiativeCloseController
|
|||
$is_close = !$initiative->isClosed();
|
||||
|
||||
if ($request->isFormPost()) {
|
||||
$type_status = FundInitiativeTransaction::TYPE_STATUS;
|
||||
$type_status = FundInitiativeStatusTransaction::TRANSACTIONTYPE;
|
||||
|
||||
if ($is_close) {
|
||||
$new_status = FundInitiative::STATUS_CLOSED;
|
||||
|
|
|
@ -68,10 +68,10 @@ final class FundInitiativeEditController
|
|||
$v_merchant = $request->getStr('merchantPHID');
|
||||
$v_projects = $request->getArr('projects');
|
||||
|
||||
$type_name = FundInitiativeTransaction::TYPE_NAME;
|
||||
$type_desc = FundInitiativeTransaction::TYPE_DESCRIPTION;
|
||||
$type_risk = FundInitiativeTransaction::TYPE_RISKS;
|
||||
$type_merchant = FundInitiativeTransaction::TYPE_MERCHANT;
|
||||
$type_name = FundInitiativeNameTransaction::TRANSACTIONTYPE;
|
||||
$type_desc = FundInitiativeDescriptionTransaction::TRANSACTIONTYPE;
|
||||
$type_risk = FundInitiativeRisksTransaction::TRANSACTIONTYPE;
|
||||
$type_merchant = FundInitiativeMerchantTransaction::TRANSACTIONTYPE;
|
||||
$type_view = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
||||
$type_edit = PhabricatorTransactions::TYPE_EDIT_POLICY;
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ final class FundInitiativeViewController
|
|||
$initiative->getName());
|
||||
|
||||
if ($initiative->isClosed()) {
|
||||
$status_icon = 'fa-times';
|
||||
$status_color = 'bluegrey';
|
||||
$status_icon = 'fa-ban';
|
||||
$status_color = 'indigo';
|
||||
} else {
|
||||
$status_icon = 'fa-check';
|
||||
$status_color = 'bluegrey';
|
||||
|
|
|
@ -11,67 +11,4 @@ final class FundBackerEditor
|
|||
return pht('Fund Backing');
|
||||
}
|
||||
|
||||
public function getTransactionTypes() {
|
||||
$types = parent::getTransactionTypes();
|
||||
|
||||
$types[] = FundBackerTransaction::TYPE_STATUS;
|
||||
$types[] = FundBackerTransaction::TYPE_REFUND;
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
protected function getCustomTransactionOldValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case FundBackerTransaction::TYPE_STATUS:
|
||||
return $object->getStatus();
|
||||
case FundBackerTransaction::TYPE_REFUND:
|
||||
return null;
|
||||
}
|
||||
|
||||
return parent::getCustomTransactionOldValue($object, $xaction);
|
||||
}
|
||||
|
||||
protected function getCustomTransactionNewValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case FundBackerTransaction::TYPE_STATUS:
|
||||
case FundBackerTransaction::TYPE_REFUND:
|
||||
return $xaction->getNewValue();
|
||||
}
|
||||
|
||||
return parent::getCustomTransactionNewValue($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyCustomInternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case FundBackerTransaction::TYPE_STATUS:
|
||||
$object->setStatus($xaction->getNewValue());
|
||||
return;
|
||||
case FundBackerTransaction::TYPE_REFUND:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyCustomExternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case FundBackerTransaction::TYPE_STATUS:
|
||||
case FundBackerTransaction::TYPE_REFUND:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,16 +11,16 @@ final class FundInitiativeEditor
|
|||
return pht('Fund Initiatives');
|
||||
}
|
||||
|
||||
public function getCreateObjectTitle($author, $object) {
|
||||
return pht('%s created this initiative.', $author);
|
||||
}
|
||||
|
||||
public function getCreateObjectTitleForFeed($author, $object) {
|
||||
return pht('%s created %s.', $author, $object);
|
||||
}
|
||||
|
||||
public function getTransactionTypes() {
|
||||
$types = parent::getTransactionTypes();
|
||||
|
||||
$types[] = FundInitiativeTransaction::TYPE_NAME;
|
||||
$types[] = FundInitiativeTransaction::TYPE_DESCRIPTION;
|
||||
$types[] = FundInitiativeTransaction::TYPE_RISKS;
|
||||
$types[] = FundInitiativeTransaction::TYPE_STATUS;
|
||||
$types[] = FundInitiativeTransaction::TYPE_BACKER;
|
||||
$types[] = FundInitiativeTransaction::TYPE_REFUND;
|
||||
$types[] = FundInitiativeTransaction::TYPE_MERCHANT;
|
||||
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
||||
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
|
||||
$types[] = PhabricatorTransactions::TYPE_COMMENT;
|
||||
|
@ -28,204 +28,6 @@ final class FundInitiativeEditor
|
|||
return $types;
|
||||
}
|
||||
|
||||
protected function getCustomTransactionOldValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case FundInitiativeTransaction::TYPE_NAME:
|
||||
return $object->getName();
|
||||
case FundInitiativeTransaction::TYPE_DESCRIPTION:
|
||||
return $object->getDescription();
|
||||
case FundInitiativeTransaction::TYPE_RISKS:
|
||||
return $object->getRisks();
|
||||
case FundInitiativeTransaction::TYPE_STATUS:
|
||||
return $object->getStatus();
|
||||
case FundInitiativeTransaction::TYPE_BACKER:
|
||||
case FundInitiativeTransaction::TYPE_REFUND:
|
||||
return null;
|
||||
case FundInitiativeTransaction::TYPE_MERCHANT:
|
||||
return $object->getMerchantPHID();
|
||||
}
|
||||
|
||||
return parent::getCustomTransactionOldValue($object, $xaction);
|
||||
}
|
||||
|
||||
protected function getCustomTransactionNewValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case FundInitiativeTransaction::TYPE_NAME:
|
||||
case FundInitiativeTransaction::TYPE_DESCRIPTION:
|
||||
case FundInitiativeTransaction::TYPE_RISKS:
|
||||
case FundInitiativeTransaction::TYPE_STATUS:
|
||||
case FundInitiativeTransaction::TYPE_BACKER:
|
||||
case FundInitiativeTransaction::TYPE_REFUND:
|
||||
case FundInitiativeTransaction::TYPE_MERCHANT:
|
||||
return $xaction->getNewValue();
|
||||
}
|
||||
|
||||
return parent::getCustomTransactionNewValue($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyCustomInternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
$type = $xaction->getTransactionType();
|
||||
switch ($type) {
|
||||
case FundInitiativeTransaction::TYPE_NAME:
|
||||
$object->setName($xaction->getNewValue());
|
||||
return;
|
||||
case FundInitiativeTransaction::TYPE_DESCRIPTION:
|
||||
$object->setDescription($xaction->getNewValue());
|
||||
return;
|
||||
case FundInitiativeTransaction::TYPE_RISKS:
|
||||
$object->setRisks($xaction->getNewValue());
|
||||
return;
|
||||
case FundInitiativeTransaction::TYPE_MERCHANT:
|
||||
$object->setMerchantPHID($xaction->getNewValue());
|
||||
return;
|
||||
case FundInitiativeTransaction::TYPE_STATUS:
|
||||
$object->setStatus($xaction->getNewValue());
|
||||
return;
|
||||
case FundInitiativeTransaction::TYPE_BACKER:
|
||||
case FundInitiativeTransaction::TYPE_REFUND:
|
||||
$amount = $xaction->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
|
||||
if ($type == FundInitiativeTransaction::TYPE_REFUND) {
|
||||
$total = $object->getTotalAsCurrency()->subtract($amount);
|
||||
} else {
|
||||
$total = $object->getTotalAsCurrency()->add($amount);
|
||||
}
|
||||
|
||||
$object->setTotalAsCurrency($total);
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyCustomExternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
$type = $xaction->getTransactionType();
|
||||
switch ($type) {
|
||||
case FundInitiativeTransaction::TYPE_NAME:
|
||||
case FundInitiativeTransaction::TYPE_DESCRIPTION:
|
||||
case FundInitiativeTransaction::TYPE_RISKS:
|
||||
case FundInitiativeTransaction::TYPE_STATUS:
|
||||
case FundInitiativeTransaction::TYPE_MERCHANT:
|
||||
return;
|
||||
case FundInitiativeTransaction::TYPE_BACKER:
|
||||
case FundInitiativeTransaction::TYPE_REFUND:
|
||||
$backer = id(new FundBackerQuery())
|
||||
->setViewer($this->requireActor())
|
||||
->withPHIDs(array($xaction->getNewValue()))
|
||||
->executeOne();
|
||||
if (!$backer) {
|
||||
throw new Exception(pht('Unable to load %s!', 'FundBacker'));
|
||||
}
|
||||
|
||||
$subx = array();
|
||||
|
||||
if ($type == FundInitiativeTransaction::TYPE_BACKER) {
|
||||
$subx[] = id(new FundBackerTransaction())
|
||||
->setTransactionType(FundBackerTransaction::TYPE_STATUS)
|
||||
->setNewValue(FundBacker::STATUS_PURCHASED);
|
||||
} else {
|
||||
$amount = $xaction->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT);
|
||||
$subx[] = id(new FundBackerTransaction())
|
||||
->setTransactionType(FundBackerTransaction::TYPE_STATUS)
|
||||
->setNewValue($amount);
|
||||
}
|
||||
|
||||
$editor = id(new FundBackerEditor())
|
||||
->setActor($this->requireActor())
|
||||
->setContentSource($this->getContentSource())
|
||||
->setContinueOnMissingFields(true)
|
||||
->setContinueOnNoEffect(true);
|
||||
|
||||
$editor->applyTransactions($backer, $subx);
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function validateTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
$type,
|
||||
array $xactions) {
|
||||
|
||||
$errors = parent::validateTransaction($object, $type, $xactions);
|
||||
|
||||
switch ($type) {
|
||||
case FundInitiativeTransaction::TYPE_NAME:
|
||||
$missing = $this->validateIsEmptyTextField(
|
||||
$object->getName(),
|
||||
$xactions);
|
||||
|
||||
if ($missing) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Required'),
|
||||
pht('Initiative name is required.'),
|
||||
nonempty(last($xactions), null));
|
||||
|
||||
$error->setIsMissingFieldError(true);
|
||||
$errors[] = $error;
|
||||
}
|
||||
break;
|
||||
case FundInitiativeTransaction::TYPE_MERCHANT:
|
||||
$missing = $this->validateIsEmptyTextField(
|
||||
$object->getName(),
|
||||
$xactions);
|
||||
if ($missing) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Required'),
|
||||
pht('Payable merchant is required.'),
|
||||
nonempty(last($xactions), null));
|
||||
|
||||
$error->setIsMissingFieldError(true);
|
||||
$errors[] = $error;
|
||||
} else if ($xactions) {
|
||||
$merchant_phid = last($xactions)->getNewValue();
|
||||
|
||||
// Make sure the actor has permission to edit the merchant they're
|
||||
// selecting. You aren't allowed to send payments to an account you
|
||||
// do not control.
|
||||
$merchants = id(new PhortuneMerchantQuery())
|
||||
->setViewer($this->requireActor())
|
||||
->withPHIDs(array($merchant_phid))
|
||||
->requireCapabilities(
|
||||
array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
PhabricatorPolicyCapability::CAN_EDIT,
|
||||
))
|
||||
->execute();
|
||||
if (!$merchants) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Invalid'),
|
||||
pht(
|
||||
'You must specify a merchant account you control as the '.
|
||||
'recipient of funds from this initiative.'),
|
||||
last($xactions));
|
||||
$errors[] = $error;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
|
|
|
@ -105,7 +105,7 @@ final class FundBackerProduct extends PhortuneProductImplementation {
|
|||
|
||||
$xactions = array();
|
||||
$xactions[] = id(new FundInitiativeTransaction())
|
||||
->setTransactionType(FundInitiativeTransaction::TYPE_BACKER)
|
||||
->setTransactionType(FundInitiativeBackerTransaction::TRANSACTIONTYPE)
|
||||
->setMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT,
|
||||
$backer->getAmountAsCurrency()->serializeForStorage())
|
||||
|
@ -134,7 +134,7 @@ final class FundBackerProduct extends PhortuneProductImplementation {
|
|||
|
||||
$xactions = array();
|
||||
$xactions[] = id(new FundInitiativeTransaction())
|
||||
->setTransactionType(FundInitiativeTransaction::TYPE_REFUND)
|
||||
->setTransactionType(FundInitiativeRefundTransaction::TRANSACTIONTYPE)
|
||||
->setMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT,
|
||||
$amount->serializeForStorage())
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class FundBackerTransaction
|
||||
extends PhabricatorApplicationTransaction {
|
||||
|
||||
const TYPE_STATUS = 'fund:backer:status';
|
||||
const TYPE_REFUND = 'fund:backer:refund';
|
||||
extends PhabricatorModularTransaction {
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'fund';
|
||||
|
@ -18,4 +15,8 @@ final class FundBackerTransaction
|
|||
return null;
|
||||
}
|
||||
|
||||
public function getBaseTransactionClass() {
|
||||
return 'FundBackerTransactionType';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class FundInitiativeTransaction
|
||||
extends PhabricatorApplicationTransaction {
|
||||
|
||||
const TYPE_NAME = 'fund:name';
|
||||
const TYPE_DESCRIPTION = 'fund:description';
|
||||
const TYPE_RISKS = 'fund:risks';
|
||||
const TYPE_STATUS = 'fund:status';
|
||||
const TYPE_BACKER = 'fund:backer';
|
||||
const TYPE_REFUND = 'fund:refund';
|
||||
const TYPE_MERCHANT = 'fund:merchant';
|
||||
extends PhabricatorModularTransaction {
|
||||
|
||||
const MAILTAG_BACKER = 'fund.backer';
|
||||
const MAILTAG_STATUS = 'fund.status';
|
||||
|
@ -30,185 +22,25 @@ final class FundInitiativeTransaction
|
|||
return new FundInitiativeTransactionComment();
|
||||
}
|
||||
|
||||
public function getRequiredHandlePHIDs() {
|
||||
$phids = parent::getRequiredHandlePHIDs();
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
$type = $this->getTransactionType();
|
||||
switch ($type) {
|
||||
case self::TYPE_MERCHANT:
|
||||
if ($old) {
|
||||
$phids[] = $old;
|
||||
}
|
||||
if ($new) {
|
||||
$phids[] = $new;
|
||||
}
|
||||
break;
|
||||
case self::TYPE_REFUND:
|
||||
$phids[] = $this->getMetadataValue(self::PROPERTY_BACKER);
|
||||
break;
|
||||
public function getBaseTransactionClass() {
|
||||
return 'FundInitiativeTransactionType';
|
||||
}
|
||||
|
||||
return $phids;
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$author_phid = $this->getAuthorPHID();
|
||||
$object_phid = $this->getObjectPHID();
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
$type = $this->getTransactionType();
|
||||
switch ($type) {
|
||||
case self::TYPE_NAME:
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s created this initiative.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
} else {
|
||||
return pht(
|
||||
'%s renamed this initiative from "%s" to "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$old,
|
||||
$new);
|
||||
}
|
||||
break;
|
||||
case self::TYPE_RISKS:
|
||||
return pht(
|
||||
'%s edited the risks for this initiative.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case self::TYPE_DESCRIPTION:
|
||||
return pht(
|
||||
'%s edited the description of this initiative.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case self::TYPE_STATUS:
|
||||
switch ($new) {
|
||||
case FundInitiative::STATUS_OPEN:
|
||||
return pht(
|
||||
'%s reopened this initiative.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case FundInitiative::STATUS_CLOSED:
|
||||
return pht(
|
||||
'%s closed this initiative.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
}
|
||||
break;
|
||||
case self::TYPE_BACKER:
|
||||
$amount = $this->getMetadataValue(self::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
return pht(
|
||||
'%s backed this initiative with %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$amount->formatForDisplay());
|
||||
case self::TYPE_REFUND:
|
||||
$amount = $this->getMetadataValue(self::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
|
||||
$backer_phid = $this->getMetadataValue(self::PROPERTY_BACKER);
|
||||
|
||||
return pht(
|
||||
'%s refunded %s to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$amount->formatForDisplay(),
|
||||
$this->renderHandleLink($backer_phid));
|
||||
case self::TYPE_MERCHANT:
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s set this initiative to pay to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($new));
|
||||
} else {
|
||||
return pht(
|
||||
'%s changed the merchant receiving funds from this '.
|
||||
'initiative from %s to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($old),
|
||||
$this->renderHandleLink($new));
|
||||
}
|
||||
}
|
||||
|
||||
return parent::getTitle();
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$author_phid = $this->getAuthorPHID();
|
||||
$object_phid = $this->getObjectPHID();
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
$type = $this->getTransactionType();
|
||||
switch ($type) {
|
||||
case self::TYPE_NAME:
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s created %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
|
||||
} else {
|
||||
return pht(
|
||||
'%s renamed %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
}
|
||||
break;
|
||||
case self::TYPE_DESCRIPTION:
|
||||
return pht(
|
||||
'%s updated the description for %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
case self::TYPE_STATUS:
|
||||
switch ($new) {
|
||||
case FundInitiative::STATUS_OPEN:
|
||||
return pht(
|
||||
'%s reopened %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
case FundInitiative::STATUS_CLOSED:
|
||||
return pht(
|
||||
'%s closed %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
}
|
||||
break;
|
||||
case self::TYPE_BACKER:
|
||||
$amount = $this->getMetadataValue(self::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
return pht(
|
||||
'%s backed %s with %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid),
|
||||
$amount->formatForDisplay());
|
||||
case self::TYPE_REFUND:
|
||||
$amount = $this->getMetadataValue(self::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
|
||||
$backer_phid = $this->getMetadataValue(self::PROPERTY_BACKER);
|
||||
|
||||
return pht(
|
||||
'%s refunded %s to %s for %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$amount->formatForDisplay(),
|
||||
$this->renderHandleLink($backer_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
}
|
||||
|
||||
return parent::getTitleForFeed();
|
||||
protected function shouldPublishFeedStory(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getMailTags() {
|
||||
$tags = parent::getMailTags();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_STATUS:
|
||||
case FundInitiativeStatusTransaction::TRANSACTIONTYPE:
|
||||
$tags[] = self::MAILTAG_STATUS;
|
||||
break;
|
||||
case self::TYPE_BACKER:
|
||||
case self::TYPE_REFUND:
|
||||
case FundInitiativeBackerTransaction::TRANSACTIONTYPE:
|
||||
case FundInitiativeRefundTransaction::TRANSACTIONTYPE:
|
||||
$tags[] = self::MAILTAG_BACKER;
|
||||
break;
|
||||
default:
|
||||
|
@ -219,31 +51,4 @@ final class FundInitiativeTransaction
|
|||
return $tags;
|
||||
}
|
||||
|
||||
|
||||
public function shouldHide() {
|
||||
$old = $this->getOldValue();
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_DESCRIPTION:
|
||||
case self::TYPE_RISKS:
|
||||
return ($old === null);
|
||||
}
|
||||
return parent::shouldHide();
|
||||
}
|
||||
|
||||
public function hasChangeDetails() {
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_DESCRIPTION:
|
||||
case self::TYPE_RISKS:
|
||||
return ($this->getOldValue() !== null);
|
||||
}
|
||||
|
||||
return parent::hasChangeDetails();
|
||||
}
|
||||
|
||||
public function renderChangeDetails(PhabricatorUser $viewer) {
|
||||
return $this->renderTextCorpusChangeDetails(
|
||||
$viewer,
|
||||
$this->getOldValue(),
|
||||
$this->getNewValue());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
final class FundBackerRefundTransaction
|
||||
extends FundBackerTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'fund:backer:refund';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
final class FundBackerStatusTransaction
|
||||
extends FundBackerTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'fund:backer:status';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getStatus();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setStatus($value);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
abstract class FundBackerTransactionType
|
||||
extends PhabricatorModularTransactionType {}
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
final class FundInitiativeBackerTransaction
|
||||
extends FundInitiativeTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'fund:backer';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$amount = $this->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
$total = $object->getTotalAsCurrency()->add($amount);
|
||||
$object->setTotalAsCurrency($total);
|
||||
}
|
||||
|
||||
public function applyExternalEffects($object, $value) {
|
||||
$backer = id(new FundBackerQuery())
|
||||
->setViewer($this->getActor())
|
||||
->withPHIDs(array($value))
|
||||
->executeOne();
|
||||
if (!$backer) {
|
||||
throw new Exception(pht('Unable to load %s!', 'FundBacker'));
|
||||
}
|
||||
|
||||
$subx = array();
|
||||
$subx[] = id(new FundBackerTransaction())
|
||||
->setTransactionType(FundBackerStatusTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue(FundBacker::STATUS_PURCHASED);
|
||||
|
||||
$content_source = $this->getEditor()->getContentSource();
|
||||
|
||||
$editor = id(new FundBackerEditor())
|
||||
->setActor($this->getActor())
|
||||
->setContentSource($content_source)
|
||||
->setContinueOnMissingFields(true)
|
||||
->setContinueOnNoEffect(true);
|
||||
|
||||
$editor->applyTransactions($backer, $subx);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$amount = $this->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
return pht(
|
||||
'%s backed this initiative with %s.',
|
||||
$this->renderAuthor(),
|
||||
$amount->formatForDisplay());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$amount = $this->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
return pht(
|
||||
'%s backed %s with %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$amount->formatForDisplay());
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-heart';
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
return 'red';
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
final class FundInitiativeDescriptionTransaction
|
||||
extends FundInitiativeTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'fund:description';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getDescription();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setDescription($value);
|
||||
}
|
||||
|
||||
public function shouldHide() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
if (!strlen($old) && !strlen($new)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s set the initiative description.',
|
||||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s updated the initiative description.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s updated the initiative description for %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
public function hasChangeDetailView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getMailDiffSectionHeader() {
|
||||
return pht('CHANGES TO INITIATIVE DESCRIPTION');
|
||||
}
|
||||
|
||||
public function newChangeDetailView() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
return id(new PhabricatorApplicationTransactionTextDiffDetailView())
|
||||
->setViewer($viewer)
|
||||
->setOldText($this->getOldValue())
|
||||
->setNewText($this->getNewValue());
|
||||
}
|
||||
|
||||
public function newRemarkupChanges() {
|
||||
$changes = array();
|
||||
|
||||
$changes[] = $this->newRemarkupChange()
|
||||
->setOldValue($this->getOldValue())
|
||||
->setNewValue($this->getNewValue());
|
||||
|
||||
return $changes;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
<?php
|
||||
|
||||
final class FundInitiativeMerchantTransaction
|
||||
extends FundInitiativeTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'fund:merchant';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getMerchantPHID();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setMerchantPHID($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$new = $this->getNewValue();
|
||||
$new_merchant = $this->renderHandleList(array($new));
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$old_merchant = $this->renderHandleList(array($old));
|
||||
|
||||
if ($old) {
|
||||
return pht(
|
||||
'%s changed the merchant receiving funds from this '.
|
||||
'initiative from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$old_merchant,
|
||||
$new_merchant);
|
||||
} else {
|
||||
return pht(
|
||||
'%s set the merchant receiving funds from this '.
|
||||
'initiative to %s.',
|
||||
$this->renderAuthor(),
|
||||
$new_merchant);
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$new = $this->getNewValue();
|
||||
$new_merchant = $this->renderHandleList(array($new));
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$old_merchant = $this->renderHandleList(array($old));
|
||||
|
||||
return pht(
|
||||
'%s changed the merchant receiving funds from %s '.
|
||||
'initiative from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$old_merchant,
|
||||
$new_merchant);
|
||||
}
|
||||
|
||||
public function validateTransactions($object, array $xactions) {
|
||||
$errors = array();
|
||||
|
||||
if ($this->isEmptyTextTransaction($object->getMerchantPHID(), $xactions)) {
|
||||
$errors[] = $this->newRequiredError(
|
||||
pht('Initiatives must have a payable merchant.'));
|
||||
}
|
||||
|
||||
foreach ($xactions as $xaction) {
|
||||
$merchant_phid = $xaction->getNewValue();
|
||||
|
||||
// Make sure the actor has permission to edit the merchant they're
|
||||
// selecting. You aren't allowed to send payments to an account you
|
||||
// do not control.
|
||||
$merchants = id(new PhortuneMerchantQuery())
|
||||
->setViewer($this->getActor())
|
||||
->withPHIDs(array($merchant_phid))
|
||||
->requireCapabilities(
|
||||
array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
PhabricatorPolicyCapability::CAN_EDIT,
|
||||
))
|
||||
->execute();
|
||||
if (!$merchants) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('You must specify a merchant account you control as the '.
|
||||
'recipient of funds from this initiative.'));
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-bank';
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
final class FundInitiativeNameTransaction
|
||||
extends FundInitiativeTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'fund:name';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getName();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setName($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$old = $this->getOldValue();
|
||||
if (!strlen($old)) {
|
||||
return pht(
|
||||
'%s created this initiative.',
|
||||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s renamed this initiative from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$old = $this->getOldValue();
|
||||
if (!strlen($old)) {
|
||||
return pht(
|
||||
'%s created initiative %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
} else {
|
||||
return pht(
|
||||
'%s renamed %s initiative from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
}
|
||||
|
||||
public function validateTransactions($object, array $xactions) {
|
||||
$errors = array();
|
||||
|
||||
if ($this->isEmptyTextTransaction($object->getName(), $xactions)) {
|
||||
$errors[] = $this->newRequiredError(
|
||||
pht('Initiatives must have a name.'));
|
||||
}
|
||||
|
||||
$max_length = $object->getColumnMaximumByteLength('name');
|
||||
foreach ($xactions as $xaction) {
|
||||
$new_value = $xaction->getNewValue();
|
||||
$new_length = strlen($new_value);
|
||||
if ($new_length > $max_length) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('The name can be no longer than %s characters.',
|
||||
new PhutilNumber($max_length)));
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
final class FundInitiativeRefundTransaction
|
||||
extends FundInitiativeTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'fund:refund';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$amount = $this->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
$total = $object->getTotalAsCurrency()->subtract($amount);
|
||||
$object->setTotalAsCurrency($total);
|
||||
}
|
||||
|
||||
public function applyExternalEffects($object, $value) {
|
||||
$backer = id(new FundBackerQuery())
|
||||
->setViewer($this->getActor())
|
||||
->withPHIDs(array($value))
|
||||
->executeOne();
|
||||
if (!$backer) {
|
||||
throw new Exception(pht('Unable to load %s!', 'FundBacker'));
|
||||
}
|
||||
|
||||
$subx = array();
|
||||
$amount = $this->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT);
|
||||
$subx[] = id(new FundBackerTransaction())
|
||||
->setTransactionType(FundBackerStatusTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($amount);
|
||||
|
||||
$content_source = $this->getEditor()->getContentSource();
|
||||
|
||||
$editor = id(new FundBackerEditor())
|
||||
->setActor($this->getActor())
|
||||
->setContentSource($content_source)
|
||||
->setContinueOnMissingFields(true)
|
||||
->setContinueOnNoEffect(true);
|
||||
|
||||
$editor->applyTransactions($backer, $subx);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$amount = $this->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
$backer_phid = $this->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_BACKER);
|
||||
|
||||
return pht(
|
||||
'%s refunded %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$amount->formatForDisplay(),
|
||||
$this->renderHandleLink($backer_phid));
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$amount = $this->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_AMOUNT);
|
||||
$amount = PhortuneCurrency::newFromString($amount);
|
||||
$backer_phid = $this->getMetadataValue(
|
||||
FundInitiativeTransaction::PROPERTY_BACKER);
|
||||
|
||||
return pht(
|
||||
'%s refunded %s to %s for %s.',
|
||||
$this->renderAuthor(),
|
||||
$amount->formatForDisplay(),
|
||||
$this->renderHandleLink($backer_phid),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
final class FundInitiativeRisksTransaction
|
||||
extends FundInitiativeTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'fund:risks';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getRisks();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setRisks($value);
|
||||
}
|
||||
|
||||
public function shouldHide() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
if (!strlen($old) && !strlen($new)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s set the initiative risks/challenges.',
|
||||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s updated the initiative risks/challenges.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s updated the initiative risks/challenges for %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
public function hasChangeDetailView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getMailDiffSectionHeader() {
|
||||
return pht('CHANGES TO INITIATIVE RISKS/CHALLENGES');
|
||||
}
|
||||
|
||||
public function newChangeDetailView() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
return id(new PhabricatorApplicationTransactionTextDiffDetailView())
|
||||
->setViewer($viewer)
|
||||
->setOldText($this->getOldValue())
|
||||
->setNewText($this->getNewValue());
|
||||
}
|
||||
|
||||
public function newRemarkupChanges() {
|
||||
$changes = array();
|
||||
|
||||
$changes[] = $this->newRemarkupChange()
|
||||
->setOldValue($this->getOldValue())
|
||||
->setNewValue($this->getNewValue());
|
||||
|
||||
return $changes;
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-ambulance';
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
final class FundInitiativeStatusTransaction
|
||||
extends FundInitiativeTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'fund:status';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getStatus();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setStatus($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
if ($this->getNewValue() == FundInitiative::STATUS_CLOSED) {
|
||||
return pht(
|
||||
'%s closed this initiative.',
|
||||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s reopened this initiative.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
if ($this->getNewValue() == FundInitiative::STATUS_CLOSED) {
|
||||
return pht(
|
||||
'%s closed the initiative %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
} else {
|
||||
return pht(
|
||||
'%s reopened the initiative %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
if ($this->getNewValue() == FundInitiative::STATUS_CLOSED) {
|
||||
return 'fa-ban';
|
||||
} else {
|
||||
return 'fa-check';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
abstract class FundInitiativeTransactionType
|
||||
extends PhabricatorModularTransactionType {}
|
|
@ -57,7 +57,8 @@ final class LegalpadDocumentEditController extends LegalpadController {
|
|||
$errors[] = pht('The document title may not be blank.');
|
||||
} else {
|
||||
$xactions[] = id(new LegalpadTransaction())
|
||||
->setTransactionType(LegalpadTransaction::TYPE_TITLE)
|
||||
->setTransactionType(
|
||||
LegalpadDocumentTitleTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($title);
|
||||
}
|
||||
|
||||
|
@ -67,7 +68,8 @@ final class LegalpadDocumentEditController extends LegalpadController {
|
|||
$errors[] = pht('The document may not be blank.');
|
||||
} else {
|
||||
$xactions[] = id(new LegalpadTransaction())
|
||||
->setTransactionType(LegalpadTransaction::TYPE_TEXT)
|
||||
->setTransactionType(
|
||||
LegalpadDocumentTextTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($text);
|
||||
}
|
||||
|
||||
|
@ -83,13 +85,15 @@ final class LegalpadDocumentEditController extends LegalpadController {
|
|||
if ($is_create) {
|
||||
$v_signature_type = $request->getStr('signatureType');
|
||||
$xactions[] = id(new LegalpadTransaction())
|
||||
->setTransactionType(LegalpadTransaction::TYPE_SIGNATURE_TYPE)
|
||||
->setTransactionType(
|
||||
LegalpadDocumentSignatureTypeTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($v_signature_type);
|
||||
}
|
||||
|
||||
$v_preamble = $request->getStr('preamble');
|
||||
$xactions[] = id(new LegalpadTransaction())
|
||||
->setTransactionType(LegalpadTransaction::TYPE_PREAMBLE)
|
||||
->setTransactionType(
|
||||
LegalpadDocumentPreambleTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($v_preamble);
|
||||
|
||||
$v_require_signature = $request->getBool('requireSignature', 0);
|
||||
|
@ -106,7 +110,8 @@ final class LegalpadDocumentEditController extends LegalpadController {
|
|||
}
|
||||
if ($viewer->getIsAdmin()) {
|
||||
$xactions[] = id(new LegalpadTransaction())
|
||||
->setTransactionType(LegalpadTransaction::TYPE_REQUIRE_SIGNATURE)
|
||||
->setTransactionType(
|
||||
LegalpadDocumentRequireSignatureTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($v_require_signature);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
final class LegalpadDocumentEditor
|
||||
extends PhabricatorApplicationTransactionEditor {
|
||||
|
||||
private $isContribution = false;
|
||||
|
||||
public function getEditorApplicationClass() {
|
||||
return 'PhabricatorLegalpadApplication';
|
||||
}
|
||||
|
@ -13,15 +11,6 @@ final class LegalpadDocumentEditor
|
|||
return pht('Legalpad Documents');
|
||||
}
|
||||
|
||||
private function setIsContribution($is_contribution) {
|
||||
$this->isContribution = $is_contribution;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function isContribution() {
|
||||
return $this->isContribution;
|
||||
}
|
||||
|
||||
public function getTransactionTypes() {
|
||||
$types = parent::getTransactionTypes();
|
||||
|
||||
|
@ -29,99 +18,25 @@ final class LegalpadDocumentEditor
|
|||
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
||||
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
|
||||
|
||||
$types[] = LegalpadTransaction::TYPE_TITLE;
|
||||
$types[] = LegalpadTransaction::TYPE_TEXT;
|
||||
$types[] = LegalpadTransaction::TYPE_SIGNATURE_TYPE;
|
||||
$types[] = LegalpadTransaction::TYPE_PREAMBLE;
|
||||
$types[] = LegalpadTransaction::TYPE_REQUIRE_SIGNATURE;
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
protected function getCustomTransactionOldValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case LegalpadTransaction::TYPE_TITLE:
|
||||
return $object->getDocumentBody()->getTitle();
|
||||
case LegalpadTransaction::TYPE_TEXT:
|
||||
return $object->getDocumentBody()->getText();
|
||||
case LegalpadTransaction::TYPE_SIGNATURE_TYPE:
|
||||
return $object->getSignatureType();
|
||||
case LegalpadTransaction::TYPE_PREAMBLE:
|
||||
return $object->getPreamble();
|
||||
case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
|
||||
return (bool)$object->getRequireSignature();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getCustomTransactionNewValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case LegalpadTransaction::TYPE_TITLE:
|
||||
case LegalpadTransaction::TYPE_TEXT:
|
||||
case LegalpadTransaction::TYPE_SIGNATURE_TYPE:
|
||||
case LegalpadTransaction::TYPE_PREAMBLE:
|
||||
return $xaction->getNewValue();
|
||||
case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
|
||||
return (bool)$xaction->getNewValue();
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyCustomInternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case LegalpadTransaction::TYPE_TITLE:
|
||||
$object->setTitle($xaction->getNewValue());
|
||||
$body = $object->getDocumentBody();
|
||||
$body->setTitle($xaction->getNewValue());
|
||||
$this->setIsContribution(true);
|
||||
break;
|
||||
case LegalpadTransaction::TYPE_TEXT:
|
||||
$body = $object->getDocumentBody();
|
||||
$body->setText($xaction->getNewValue());
|
||||
$this->setIsContribution(true);
|
||||
break;
|
||||
case LegalpadTransaction::TYPE_SIGNATURE_TYPE:
|
||||
$object->setSignatureType($xaction->getNewValue());
|
||||
break;
|
||||
case LegalpadTransaction::TYPE_PREAMBLE:
|
||||
$object->setPreamble($xaction->getNewValue());
|
||||
break;
|
||||
case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
|
||||
$object->setRequireSignature((int)$xaction->getNewValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyCustomExternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
|
||||
if ($xaction->getNewValue()) {
|
||||
$session = new PhabricatorAuthSession();
|
||||
queryfx(
|
||||
$session->establishConnection('w'),
|
||||
'UPDATE %T SET signedLegalpadDocuments = 0',
|
||||
$session->getTableName());
|
||||
}
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
protected function applyFinalEffects(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
|
||||
if ($this->isContribution()) {
|
||||
$is_contribution = false;
|
||||
|
||||
foreach ($xactions as $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case LegalpadDocumentTitleTransaction::TRANSACTIONTYPE:
|
||||
case LegalpadDocumentTextTransaction::TRANSACTIONTYPE:
|
||||
$is_contribution = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_contribution) {
|
||||
$object->setVersions($object->getVersions() + 1);
|
||||
$body = $object->getDocumentBody();
|
||||
$body->setVersion($object->getVersions());
|
||||
|
@ -149,22 +64,6 @@ final class LegalpadDocumentEditor
|
|||
return $xactions;
|
||||
}
|
||||
|
||||
protected function mergeTransactions(
|
||||
PhabricatorApplicationTransaction $u,
|
||||
PhabricatorApplicationTransaction $v) {
|
||||
|
||||
$type = $u->getTransactionType();
|
||||
switch ($type) {
|
||||
case LegalpadTransaction::TYPE_TITLE:
|
||||
case LegalpadTransaction::TYPE_TEXT:
|
||||
case LegalpadTransaction::TYPE_SIGNATURE_TYPE:
|
||||
case LegalpadTransaction::TYPE_PREAMBLE:
|
||||
case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
|
||||
return $v;
|
||||
}
|
||||
|
||||
return parent::mergeTransactions($u, $v);
|
||||
}
|
||||
|
||||
/* -( Sending Mail )------------------------------------------------------- */
|
||||
|
||||
|
@ -201,10 +100,10 @@ final class LegalpadDocumentEditor
|
|||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case LegalpadTransaction::TYPE_TEXT:
|
||||
case LegalpadTransaction::TYPE_TITLE:
|
||||
case LegalpadTransaction::TYPE_PREAMBLE:
|
||||
case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
|
||||
case LegalpadDocumentTextTransaction::TRANSACTIONTYPE:
|
||||
case LegalpadDocumentTitleTransaction::TRANSACTIONTYPE:
|
||||
case LegalpadDocumentPreambleTransaction::TRANSACTIONTYPE:
|
||||
case LegalpadDocumentRequireSignatureTransaction::TRANSACTIONTYPE:
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class LegalpadTransaction extends PhabricatorApplicationTransaction {
|
||||
|
||||
const TYPE_TITLE = 'title';
|
||||
const TYPE_TEXT = 'text';
|
||||
const TYPE_SIGNATURE_TYPE = 'legalpad:signature-type';
|
||||
const TYPE_PREAMBLE = 'legalpad:premable';
|
||||
const TYPE_REQUIRE_SIGNATURE = 'legalpad:require-signature';
|
||||
final class LegalpadTransaction extends PhabricatorModularTransaction {
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'legalpad';
|
||||
|
@ -24,73 +18,8 @@ final class LegalpadTransaction extends PhabricatorApplicationTransaction {
|
|||
return new LegalpadTransactionView();
|
||||
}
|
||||
|
||||
public function shouldHide() {
|
||||
$old = $this->getOldValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_TITLE:
|
||||
case self::TYPE_TEXT:
|
||||
return ($old === null);
|
||||
case self::TYPE_SIGNATURE_TYPE:
|
||||
return true;
|
||||
}
|
||||
|
||||
return parent::shouldHide();
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$author_phid = $this->getAuthorPHID();
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
$type = $this->getTransactionType();
|
||||
switch ($type) {
|
||||
case self::TYPE_TITLE:
|
||||
return pht(
|
||||
'%s renamed this document from "%s" to "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$old,
|
||||
$new);
|
||||
case self::TYPE_TEXT:
|
||||
return pht(
|
||||
"%s updated the document's text.",
|
||||
$this->renderHandleLink($author_phid));
|
||||
case self::TYPE_PREAMBLE:
|
||||
return pht(
|
||||
'%s updated the preamble.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case self::TYPE_REQUIRE_SIGNATURE:
|
||||
if ($new) {
|
||||
$text = pht(
|
||||
'%s set the document to require signatures.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
} else {
|
||||
$text = pht(
|
||||
'%s set the document to not require signatures.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
return parent::getTitle();
|
||||
}
|
||||
|
||||
public function hasChangeDetails() {
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_TITLE:
|
||||
case self::TYPE_TEXT:
|
||||
case self::TYPE_PREAMBLE:
|
||||
return true;
|
||||
}
|
||||
return parent::hasChangeDetails();
|
||||
}
|
||||
|
||||
public function renderChangeDetails(PhabricatorUser $viewer) {
|
||||
return $this->renderTextCorpusChangeDetails(
|
||||
$viewer,
|
||||
$this->getOldValue(),
|
||||
$this->getNewValue());
|
||||
public function getBaseTransactionClass() {
|
||||
return 'LegalpadDocumentTransactionType';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
final class LegalpadDocumentPreambleTransaction
|
||||
extends LegalpadDocumentTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'legalpad:premable';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getPreamble();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setPreamble($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s updated the document preamble.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s updated the document preamble for %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
public function hasChangeDetailView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getMailDiffSectionHeader() {
|
||||
return pht('CHANGES TO DOCUMENT PREAMBLE');
|
||||
}
|
||||
|
||||
public function newChangeDetailView() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
return id(new PhabricatorApplicationTransactionTextDiffDetailView())
|
||||
->setViewer($viewer)
|
||||
->setOldText($this->getOldValue())
|
||||
->setNewText($this->getNewValue());
|
||||
}
|
||||
|
||||
public function newRemarkupChanges() {
|
||||
$changes = array();
|
||||
|
||||
$changes[] = $this->newRemarkupChange()
|
||||
->setOldValue($this->getOldValue())
|
||||
->setNewValue($this->getNewValue());
|
||||
|
||||
return $changes;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
final class LegalpadDocumentRequireSignatureTransaction
|
||||
extends LegalpadDocumentTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'legalpad:require-signature';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getRequireSignature();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setRequireSignature($value);
|
||||
}
|
||||
|
||||
public function applyExternalEffects($object, $value) {
|
||||
if (strlen($value)) {
|
||||
$session = new PhabricatorAuthSession();
|
||||
queryfx(
|
||||
$session->establishConnection('w'),
|
||||
'UPDATE %T SET signedLegalpadDocuments = 0',
|
||||
$session->getTableName());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$new = $this->getNewValue();
|
||||
if ($new) {
|
||||
return pht(
|
||||
'%s set the document to require signatures.',
|
||||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s set the document to not require signatures.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$new = $this->getNewValue();
|
||||
if ($new) {
|
||||
return pht(
|
||||
'%s set the document %s to require signatures.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
} else {
|
||||
return pht(
|
||||
'%s set the document %s to not require signatures.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-pencil-square';
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
final class LegalpadDocumentSignatureTypeTransaction
|
||||
extends LegalpadDocumentTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'legalpad:signature-type';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getSignatureType();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setSignatureType($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s set the document signature type.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s set the document signature type for %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
final class LegalpadDocumentTextTransaction
|
||||
extends LegalpadDocumentTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'text';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
$body = $object->getDocumentBody();
|
||||
return $body->getText();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$body = $object->getDocumentBody();
|
||||
$body->setText($value);
|
||||
$object->attachDocumentBody($body);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s updated the document text.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s updated the document text for %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
public function hasChangeDetailView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getMailDiffSectionHeader() {
|
||||
return pht('CHANGES TO DOCUMENT TEXT');
|
||||
}
|
||||
|
||||
public function newChangeDetailView() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
return id(new PhabricatorApplicationTransactionTextDiffDetailView())
|
||||
->setViewer($viewer)
|
||||
->setOldText($this->getOldValue())
|
||||
->setNewText($this->getNewValue());
|
||||
}
|
||||
|
||||
public function newRemarkupChanges() {
|
||||
$changes = array();
|
||||
|
||||
$changes[] = $this->newRemarkupChange()
|
||||
->setOldValue($this->getOldValue())
|
||||
->setNewValue($this->getNewValue());
|
||||
|
||||
return $changes;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
final class LegalpadDocumentTitleTransaction
|
||||
extends LegalpadDocumentTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'title';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getTitle();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setTitle($value);
|
||||
$body = $object->getDocumentBody();
|
||||
$body->setTitle($value);
|
||||
$object->attachDocumentBody($body);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s renamed this document from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s renamed document %s from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
|
||||
public function validateTransactions($object, array $xactions) {
|
||||
$errors = array();
|
||||
|
||||
if ($this->isEmptyTextTransaction($object->getTitle(), $xactions)) {
|
||||
$errors[] = $this->newRequiredError(
|
||||
pht('Documents must have a title.'));
|
||||
}
|
||||
|
||||
$max_length = $object->getColumnMaximumByteLength('title');
|
||||
foreach ($xactions as $xaction) {
|
||||
$new_value = $xaction->getNewValue();
|
||||
$new_length = strlen($new_value);
|
||||
if ($new_length > $max_length) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('The title can be no longer than %s characters.',
|
||||
new PhutilNumber($max_length)));
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
abstract class LegalpadDocumentTransactionType
|
||||
extends PhabricatorModularTransactionType {}
|
|
@ -32,8 +32,8 @@ final class PhabricatorMacroApplication extends PhabricatorApplication {
|
|||
'(query/(?P<key>[^/]+)/)?' => 'PhabricatorMacroListController',
|
||||
'create/' => 'PhabricatorMacroEditController',
|
||||
'view/(?P<id>[1-9]\d*)/' => 'PhabricatorMacroViewController',
|
||||
'comment/(?P<id>[1-9]\d*)/' => 'PhabricatorMacroCommentController',
|
||||
'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorMacroEditController',
|
||||
$this->getEditRoutePattern('edit/')
|
||||
=> 'PhabricatorMacroEditController',
|
||||
'audio/(?P<id>[1-9]\d*)/' => 'PhabricatorMacroAudioController',
|
||||
'disable/(?P<id>[1-9]\d*)/' => 'PhabricatorMacroDisableController',
|
||||
'meme/' => 'PhabricatorMacroMemeController',
|
||||
|
|
|
@ -34,7 +34,7 @@ final class PhabricatorMacroAudioController extends PhabricatorMacroController {
|
|||
if ($request->getBool('behaviorForm')) {
|
||||
$xactions[] = id(new PhabricatorMacroTransaction())
|
||||
->setTransactionType(
|
||||
PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR)
|
||||
PhabricatorMacroAudioBehaviorTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($request->getStr('audioBehavior'));
|
||||
} else {
|
||||
$file = null;
|
||||
|
@ -54,7 +54,8 @@ final class PhabricatorMacroAudioController extends PhabricatorMacroController {
|
|||
$e_file = pht('Invalid');
|
||||
} else {
|
||||
$xactions[] = id(new PhabricatorMacroTransaction())
|
||||
->setTransactionType(PhabricatorMacroTransaction::TYPE_AUDIO)
|
||||
->setTransactionType(
|
||||
PhabricatorMacroAudioTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($file->getPHID());
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMacroCommentController
|
||||
extends PhabricatorMacroController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$id = $request->getURIData('id');
|
||||
|
||||
if (!$request->isFormPost()) {
|
||||
return new Aphront400Response();
|
||||
}
|
||||
|
||||
$macro = id(new PhabricatorMacroQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($id))
|
||||
->executeOne();
|
||||
if (!$macro) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$is_preview = $request->isPreviewRequest();
|
||||
$draft = PhabricatorDraft::buildFromRequest($request);
|
||||
|
||||
$view_uri = $this->getApplicationURI('/view/'.$macro->getID().'/');
|
||||
|
||||
$xactions = array();
|
||||
$xactions[] = id(new PhabricatorMacroTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
|
||||
->attachComment(
|
||||
id(new PhabricatorMacroTransactionComment())
|
||||
->setContent($request->getStr('comment')));
|
||||
|
||||
$editor = id(new PhabricatorMacroEditor())
|
||||
->setActor($viewer)
|
||||
->setContinueOnNoEffect($request->isContinueRequest())
|
||||
->setContentSourceFromRequest($request)
|
||||
->setIsPreview($is_preview);
|
||||
|
||||
try {
|
||||
$xactions = $editor->applyTransactions($macro, $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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -22,7 +22,8 @@ final class PhabricatorMacroDisableController
|
|||
|
||||
if ($request->isDialogFormPost() || $macro->getIsDisabled()) {
|
||||
$xaction = id(new PhabricatorMacroTransaction())
|
||||
->setTransactionType(PhabricatorMacroTransaction::TYPE_DISABLED)
|
||||
->setTransactionType(
|
||||
PhabricatorMacroDisabledTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($macro->getIsDisabled() ? 0 : 1);
|
||||
|
||||
$editor = id(new PhabricatorMacroEditor())
|
||||
|
|
|
@ -1,302 +1,10 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMacroEditController extends PhabricatorMacroController {
|
||||
final class PhabricatorMacroEditController extends PhameBlogController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$id = $request->getURIData('id');
|
||||
|
||||
$this->requireApplicationCapability(
|
||||
PhabricatorMacroManageCapability::CAPABILITY);
|
||||
|
||||
if ($id) {
|
||||
$macro = id(new PhabricatorMacroQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($id))
|
||||
->needFiles(true)
|
||||
->executeOne();
|
||||
if (!$macro) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
} else {
|
||||
$macro = new PhabricatorFileImageMacro();
|
||||
$macro->setAuthorPHID($viewer->getPHID());
|
||||
}
|
||||
|
||||
$errors = array();
|
||||
$e_name = true;
|
||||
$e_file = null;
|
||||
$file = null;
|
||||
|
||||
if ($request->isFormPost()) {
|
||||
$original = clone $macro;
|
||||
|
||||
$new_name = null;
|
||||
if ($request->getBool('name_form') || !$macro->getID()) {
|
||||
$new_name = $request->getStr('name');
|
||||
|
||||
$macro->setName($new_name);
|
||||
|
||||
if (!strlen($macro->getName())) {
|
||||
$errors[] = pht('Macro name is required.');
|
||||
$e_name = pht('Required');
|
||||
} else if (!preg_match('/^[a-z0-9:_-]{3,}\z/', $macro->getName())) {
|
||||
$errors[] = pht(
|
||||
'Macro must be at least three characters long and contain only '.
|
||||
'lowercase letters, digits, hyphens, colons and underscores.');
|
||||
$e_name = pht('Invalid');
|
||||
} else {
|
||||
$e_name = null;
|
||||
return id(new PhabricatorMacroEditEngine())
|
||||
->setController($this)
|
||||
->buildResponse();
|
||||
}
|
||||
}
|
||||
|
||||
$uri = $request->getStr('url');
|
||||
|
||||
$engine = new PhabricatorDestructionEngine();
|
||||
|
||||
$file = null;
|
||||
if ($request->getFileExists('file')) {
|
||||
$file = PhabricatorFile::newFromPHPUpload(
|
||||
$_FILES['file'],
|
||||
array(
|
||||
'name' => $request->getStr('name'),
|
||||
'authorPHID' => $viewer->getPHID(),
|
||||
'isExplicitUpload' => true,
|
||||
'canCDN' => true,
|
||||
));
|
||||
} else if ($uri) {
|
||||
try {
|
||||
// Rate limit outbound fetches to make this mechanism less useful for
|
||||
// scanning networks and ports.
|
||||
PhabricatorSystemActionEngine::willTakeAction(
|
||||
array($viewer->getPHID()),
|
||||
new PhabricatorFilesOutboundRequestAction(),
|
||||
1);
|
||||
|
||||
$file = PhabricatorFile::newFromFileDownload(
|
||||
$uri,
|
||||
array(
|
||||
'name' => $request->getStr('name'),
|
||||
'viewPolicy' => PhabricatorPolicies::POLICY_NOONE,
|
||||
'isExplicitUpload' => true,
|
||||
'canCDN' => true,
|
||||
));
|
||||
|
||||
if (!$file->isViewableInBrowser()) {
|
||||
$mime_type = $file->getMimeType();
|
||||
$engine->destroyObject($file);
|
||||
$file = null;
|
||||
throw new Exception(
|
||||
pht(
|
||||
'The URI "%s" does not correspond to a valid image file, got '.
|
||||
'a file with MIME type "%s". You must specify the URI of a '.
|
||||
'valid image file.',
|
||||
$uri,
|
||||
$mime_type));
|
||||
} else {
|
||||
$file
|
||||
->setAuthorPHID($viewer->getPHID())
|
||||
->save();
|
||||
}
|
||||
} catch (HTTPFutureHTTPResponseStatus $status) {
|
||||
$errors[] = pht(
|
||||
'The URI "%s" could not be loaded, got %s error.',
|
||||
$uri,
|
||||
$status->getStatusCode());
|
||||
} catch (Exception $ex) {
|
||||
$errors[] = $ex->getMessage();
|
||||
}
|
||||
} else if ($request->getStr('phid')) {
|
||||
$file = id(new PhabricatorFileQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($request->getStr('phid')))
|
||||
->executeOne();
|
||||
}
|
||||
|
||||
if ($file) {
|
||||
if (!$file->isViewableInBrowser()) {
|
||||
$errors[] = pht('You must upload an image.');
|
||||
$e_file = pht('Invalid');
|
||||
} else {
|
||||
$macro->setFilePHID($file->getPHID());
|
||||
$macro->attachFile($file);
|
||||
$e_file = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$macro->getID() && !$file) {
|
||||
$errors[] = pht('You must upload an image to create a macro.');
|
||||
$e_file = pht('Required');
|
||||
}
|
||||
|
||||
if (!$errors) {
|
||||
try {
|
||||
$xactions = array();
|
||||
|
||||
if ($new_name !== null) {
|
||||
$xactions[] = id(new PhabricatorMacroTransaction())
|
||||
->setTransactionType(PhabricatorMacroTransaction::TYPE_NAME)
|
||||
->setNewValue($new_name);
|
||||
}
|
||||
|
||||
if ($file) {
|
||||
$xactions[] = id(new PhabricatorMacroTransaction())
|
||||
->setTransactionType(PhabricatorMacroTransaction::TYPE_FILE)
|
||||
->setNewValue($file->getPHID());
|
||||
}
|
||||
|
||||
$editor = id(new PhabricatorMacroEditor())
|
||||
->setActor($viewer)
|
||||
->setContinueOnNoEffect(true)
|
||||
->setContentSourceFromRequest($request);
|
||||
|
||||
$xactions = $editor->applyTransactions($original, $xactions);
|
||||
|
||||
$view_uri = $this->getApplicationURI('/view/'.$original->getID().'/');
|
||||
return id(new AphrontRedirectResponse())->setURI($view_uri);
|
||||
} catch (AphrontDuplicateKeyQueryException $ex) {
|
||||
throw $ex;
|
||||
$errors[] = pht('Macro name is not unique!');
|
||||
$e_name = pht('Duplicate');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$current_file = null;
|
||||
if ($macro->getFilePHID()) {
|
||||
$current_file = $macro->getFile();
|
||||
}
|
||||
|
||||
$form = new AphrontFormView();
|
||||
$form->addHiddenInput('name_form', 1);
|
||||
$form->setUser($request->getUser());
|
||||
|
||||
$form
|
||||
->setEncType('multipart/form-data')
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel(pht('Name'))
|
||||
->setName('name')
|
||||
->setValue($macro->getName())
|
||||
->setCaption(
|
||||
pht('This word or phrase will be replaced with the image.'))
|
||||
->setError($e_name));
|
||||
|
||||
if (!$macro->getID()) {
|
||||
if ($current_file) {
|
||||
$current_file_view = id(new PhabricatorFileLinkView())
|
||||
->setViewer($viewer)
|
||||
->setFilePHID($current_file->getPHID())
|
||||
->setFileName($current_file->getName())
|
||||
->setFileViewable(true)
|
||||
->setFileViewURI($current_file->getBestURI())
|
||||
->render();
|
||||
$form->addHiddenInput('phid', $current_file->getPHID());
|
||||
$form->appendChild(
|
||||
id(new AphrontFormMarkupControl())
|
||||
->setLabel(pht('Selected File'))
|
||||
->setValue($current_file_view));
|
||||
|
||||
$other_label = pht('Change File');
|
||||
} else {
|
||||
$other_label = pht('File');
|
||||
}
|
||||
|
||||
$form->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel(pht('URL'))
|
||||
->setName('url')
|
||||
->setValue($request->getStr('url'))
|
||||
->setError($request->getFileExists('file') ? false : $e_file));
|
||||
|
||||
$form->appendChild(
|
||||
id(new AphrontFormFileControl())
|
||||
->setLabel($other_label)
|
||||
->setName('file')
|
||||
->setError($request->getStr('url') ? false : $e_file));
|
||||
}
|
||||
|
||||
|
||||
$view_uri = $this->getApplicationURI('/view/'.$macro->getID().'/');
|
||||
|
||||
if ($macro->getID()) {
|
||||
$cancel_uri = $view_uri;
|
||||
} else {
|
||||
$cancel_uri = $this->getApplicationURI();
|
||||
}
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue(pht('Save Image Macro'))
|
||||
->addCancelButton($cancel_uri));
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
|
||||
if ($macro->getID()) {
|
||||
$title = pht('Edit Macro: %s', $macro->getName());
|
||||
$crumb = pht('Edit Macro');
|
||||
$header_icon = 'fa-pencil';
|
||||
|
||||
$crumbs->addTextCrumb(pht('Macro: %s', $macro->getName()), $view_uri);
|
||||
} else {
|
||||
$title = pht('Create Image Macro');
|
||||
$crumb = pht('Create Macro');
|
||||
$header_icon = 'fa-plus-square';
|
||||
}
|
||||
|
||||
$crumbs->addTextCrumb($crumb, $request->getRequestURI());
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$upload = null;
|
||||
if ($macro->getID()) {
|
||||
$upload_form = id(new AphrontFormView())
|
||||
->setEncType('multipart/form-data')
|
||||
->setUser($request->getUser());
|
||||
|
||||
$upload_form->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel(pht('URL'))
|
||||
->setName('url')
|
||||
->setValue($request->getStr('url')));
|
||||
|
||||
$upload_form
|
||||
->appendChild(
|
||||
id(new AphrontFormFileControl())
|
||||
->setLabel(pht('File'))
|
||||
->setName('file'))
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue(pht('Upload File')));
|
||||
|
||||
$upload = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Upload New File'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($upload_form);
|
||||
}
|
||||
|
||||
$form_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Macro'))
|
||||
->setFormErrors($errors)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setForm($form);
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setHeaderIcon($header_icon);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$form_box,
|
||||
$upload,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ final class PhabricatorMacroViewController
|
|||
$macro,
|
||||
new PhabricatorMacroTransactionQuery());
|
||||
|
||||
$comment_form = $this->buildCommentForm($macro, $timeline);
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setUser($viewer)
|
||||
->setPolicyObject($macro)
|
||||
|
@ -45,32 +47,16 @@ final class PhabricatorMacroViewController
|
|||
if (!$macro->getIsDisabled()) {
|
||||
$header->setStatus('fa-check', 'bluegrey', pht('Active'));
|
||||
} else {
|
||||
$header->setStatus('fa-ban', 'red', pht('Archived'));
|
||||
$header->setStatus('fa-ban', 'indigo', pht('Archived'));
|
||||
}
|
||||
|
||||
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
|
||||
|
||||
$comment_header = $is_serious
|
||||
? pht('Add Comment')
|
||||
: pht('Grovel in Awe');
|
||||
|
||||
$draft = PhabricatorDraft::newFromUserAndKey($viewer, $macro->getPHID());
|
||||
|
||||
$add_comment_form = id(new PhabricatorApplicationTransactionCommentView())
|
||||
->setUser($viewer)
|
||||
->setObjectPHID($macro->getPHID())
|
||||
->setDraft($draft)
|
||||
->setHeaderText($comment_header)
|
||||
->setAction($this->getApplicationURI('/comment/'.$macro->getID().'/'))
|
||||
->setSubmitButtonName(pht('Add Comment'));
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setSubheader($subheader)
|
||||
->setCurtain($curtain)
|
||||
->setMainColumn(array(
|
||||
$timeline,
|
||||
$add_comment_form,
|
||||
$comment_form,
|
||||
))
|
||||
->addPropertySection(pht('Macro'), $file)
|
||||
->addPropertySection(pht('Details'), $details);
|
||||
|
@ -82,6 +68,16 @@ final class PhabricatorMacroViewController
|
|||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildCommentForm(
|
||||
PhabricatorFileImageMacro $macro, $timeline) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
return id(new PhabricatorMacroEditEngine())
|
||||
->setViewer($viewer)
|
||||
->buildEditEngineCommentView($macro)
|
||||
->setTransactionTimeline($timeline);
|
||||
}
|
||||
|
||||
private function buildCurtain(
|
||||
PhabricatorFileImageMacro $macro) {
|
||||
$can_manage = $this->hasApplicationCapability(
|
||||
|
|
88
src/applications/macro/editor/PhabricatorMacroEditEngine.php
Normal file
88
src/applications/macro/editor/PhabricatorMacroEditEngine.php
Normal file
|
@ -0,0 +1,88 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMacroEditEngine
|
||||
extends PhabricatorEditEngine {
|
||||
|
||||
const ENGINECONST = 'macro.image';
|
||||
|
||||
public function getEngineName() {
|
||||
return pht('Macro Imagea');
|
||||
}
|
||||
|
||||
public function getSummaryHeader() {
|
||||
return pht('Configure Macro Image Forms');
|
||||
}
|
||||
|
||||
public function getSummaryText() {
|
||||
return pht('Configure creation and editing of Macro images.');
|
||||
}
|
||||
|
||||
public function getEngineApplicationClass() {
|
||||
return 'PhabricatorMacroApplication';
|
||||
}
|
||||
|
||||
protected function newEditableObject() {
|
||||
$viewer = $this->getViewer();
|
||||
return PhabricatorFileImageMacro::initializeNewFileImageMacro($viewer);
|
||||
}
|
||||
|
||||
protected function newObjectQuery() {
|
||||
return new PhabricatorMacroQuery();
|
||||
}
|
||||
|
||||
protected function getObjectCreateTitleText($object) {
|
||||
return pht('Create New Macro');
|
||||
}
|
||||
|
||||
protected function getObjectEditTitleText($object) {
|
||||
return pht('Edit %s', $object->getName());
|
||||
}
|
||||
|
||||
protected function getObjectEditShortText($object) {
|
||||
return $object->getName();
|
||||
}
|
||||
|
||||
protected function getObjectCreateShortText() {
|
||||
return pht('Create Macro');
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Macro');
|
||||
}
|
||||
|
||||
protected function getObjectViewURI($object) {
|
||||
return $object->getViewURI();
|
||||
}
|
||||
|
||||
protected function getEditorURI() {
|
||||
return $this->getApplication()->getApplicationURI('edit/');
|
||||
}
|
||||
|
||||
protected function getCreateNewObjectPolicy() {
|
||||
return $this->getApplication()->getPolicy(
|
||||
PhabricatorMacroManageCapability::CAPABILITY);
|
||||
}
|
||||
|
||||
protected function buildCustomEditFields($object) {
|
||||
|
||||
return array(
|
||||
id(new PhabricatorTextEditField())
|
||||
->setKey('name')
|
||||
->setLabel(pht('Name'))
|
||||
->setDescription(pht('Macro name.'))
|
||||
->setConduitDescription(pht('Rename the macro.'))
|
||||
->setConduitTypeDescription(pht('New macro name.'))
|
||||
->setTransactionType(PhabricatorMacroNameTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getName()),
|
||||
id(new PhabricatorFileEditField())
|
||||
->setKey('filePHID')
|
||||
->setLabel(pht('Image File'))
|
||||
->setDescription(pht('Image file to import.'))
|
||||
->setTransactionType(PhabricatorMacroFileTransaction::TRANSACTIONTYPE)
|
||||
->setConduitDescription(pht('File PHID to import.'))
|
||||
->setConduitTypeDescription(pht('File PHID.')),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -11,72 +11,12 @@ final class PhabricatorMacroEditor
|
|||
return pht('Macros');
|
||||
}
|
||||
|
||||
public function getTransactionTypes() {
|
||||
$types = parent::getTransactionTypes();
|
||||
|
||||
$types[] = PhabricatorTransactions::TYPE_COMMENT;
|
||||
$types[] = PhabricatorMacroTransaction::TYPE_NAME;
|
||||
$types[] = PhabricatorMacroTransaction::TYPE_DISABLED;
|
||||
$types[] = PhabricatorMacroTransaction::TYPE_FILE;
|
||||
$types[] = PhabricatorMacroTransaction::TYPE_AUDIO;
|
||||
$types[] = PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR;
|
||||
|
||||
return $types;
|
||||
public function getCreateObjectTitle($author, $object) {
|
||||
return pht('%s created this macro.', $author);
|
||||
}
|
||||
|
||||
protected function getCustomTransactionOldValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorMacroTransaction::TYPE_NAME:
|
||||
return $object->getName();
|
||||
case PhabricatorMacroTransaction::TYPE_DISABLED:
|
||||
return $object->getIsDisabled();
|
||||
case PhabricatorMacroTransaction::TYPE_FILE:
|
||||
return $object->getFilePHID();
|
||||
case PhabricatorMacroTransaction::TYPE_AUDIO:
|
||||
return $object->getAudioPHID();
|
||||
case PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR:
|
||||
return $object->getAudioBehavior();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getCustomTransactionNewValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorMacroTransaction::TYPE_NAME:
|
||||
case PhabricatorMacroTransaction::TYPE_DISABLED:
|
||||
case PhabricatorMacroTransaction::TYPE_FILE:
|
||||
case PhabricatorMacroTransaction::TYPE_AUDIO:
|
||||
case PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR:
|
||||
return $xaction->getNewValue();
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyCustomInternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorMacroTransaction::TYPE_NAME:
|
||||
$object->setName($xaction->getNewValue());
|
||||
break;
|
||||
case PhabricatorMacroTransaction::TYPE_DISABLED:
|
||||
$object->setIsDisabled($xaction->getNewValue());
|
||||
break;
|
||||
case PhabricatorMacroTransaction::TYPE_FILE:
|
||||
$object->setFilePHID($xaction->getNewValue());
|
||||
break;
|
||||
case PhabricatorMacroTransaction::TYPE_AUDIO:
|
||||
$object->setAudioPHID($xaction->getNewValue());
|
||||
break;
|
||||
case PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR:
|
||||
$object->setAudioBehavior($xaction->getNewValue());
|
||||
break;
|
||||
}
|
||||
public function getCreateObjectTitleForFeed($author, $object) {
|
||||
return pht('%s created %s.', $author, $object);
|
||||
}
|
||||
|
||||
protected function applyCustomExternalTransaction(
|
||||
|
@ -84,8 +24,8 @@ final class PhabricatorMacroEditor
|
|||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorMacroTransaction::TYPE_FILE:
|
||||
case PhabricatorMacroTransaction::TYPE_AUDIO:
|
||||
case PhabricatorMacroFileTransaction::TRANSACTIONTYPE:
|
||||
case PhabricatorMacroAudioTransaction::TRANSACTIONTYPE:
|
||||
// When changing a macro's image or audio, attach the underlying files
|
||||
// to the macro (and detach the old files).
|
||||
$old = $xaction->getOldValue();
|
||||
|
@ -117,34 +57,9 @@ final class PhabricatorMacroEditor
|
|||
}
|
||||
}
|
||||
|
||||
protected function mergeTransactions(
|
||||
PhabricatorApplicationTransaction $u,
|
||||
PhabricatorApplicationTransaction $v) {
|
||||
|
||||
$type = $u->getTransactionType();
|
||||
switch ($type) {
|
||||
case PhabricatorMacroTransaction::TYPE_NAME:
|
||||
case PhabricatorMacroTransaction::TYPE_DISABLED:
|
||||
case PhabricatorMacroTransaction::TYPE_FILE:
|
||||
case PhabricatorMacroTransaction::TYPE_AUDIO:
|
||||
case PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR:
|
||||
return $v;
|
||||
}
|
||||
|
||||
return parent::mergeTransactions($u, $v);
|
||||
}
|
||||
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
foreach ($xactions as $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorMacroTransaction::TYPE_NAME;
|
||||
return ($xaction->getOldValue() !== null);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,12 @@ final class PhabricatorFileImageMacro extends PhabricatorFileDAO
|
|||
return $this->assertAttached($this->audio);
|
||||
}
|
||||
|
||||
public static function initializeNewFileImageMacro(PhabricatorUser $actor) {
|
||||
$macro = id(new self())
|
||||
->setAuthorPHID($actor->getPHID());
|
||||
return $macro;
|
||||
}
|
||||
|
||||
protected function getConfiguration() {
|
||||
return array(
|
||||
self::CONFIG_AUX_PHID => true,
|
||||
|
@ -80,6 +86,10 @@ final class PhabricatorFileImageMacro extends PhabricatorFileDAO
|
|||
return parent::save();
|
||||
}
|
||||
|
||||
public function getViewURI() {
|
||||
return '/macro/view/'.$this->getID().'/';
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
|
||||
|
||||
|
@ -128,11 +138,19 @@ final class PhabricatorFileImageMacro extends PhabricatorFileDAO
|
|||
public function getCapabilities() {
|
||||
return array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
PhabricatorPolicyCapability::CAN_EDIT,
|
||||
);
|
||||
}
|
||||
|
||||
public function getPolicy($capability) {
|
||||
switch ($capability) {
|
||||
case PhabricatorPolicyCapability::CAN_VIEW:
|
||||
return PhabricatorPolicies::getMostOpenPolicy();
|
||||
case PhabricatorPolicyCapability::CAN_EDIT:
|
||||
$app = PhabricatorApplication::getByClass(
|
||||
'PhabricatorMacroApplication');
|
||||
return $app->getPolicy(PhabricatorMacroManageCapability::CAPABILITY);
|
||||
}
|
||||
}
|
||||
|
||||
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMacroTransaction
|
||||
extends PhabricatorApplicationTransaction {
|
||||
|
||||
const TYPE_NAME = 'macro:name';
|
||||
const TYPE_DISABLED = 'macro:disabled';
|
||||
const TYPE_FILE = 'macro:file';
|
||||
|
||||
const TYPE_AUDIO = 'macro:audio';
|
||||
const TYPE_AUDIO_BEHAVIOR = 'macro:audiobehavior';
|
||||
extends PhabricatorModularTransaction {
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'file';
|
||||
|
@ -26,284 +19,8 @@ final class PhabricatorMacroTransaction
|
|||
return new PhabricatorMacroTransactionComment();
|
||||
}
|
||||
|
||||
public function getRequiredHandlePHIDs() {
|
||||
$phids = parent::getRequiredHandlePHIDs();
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_FILE:
|
||||
case self::TYPE_AUDIO:
|
||||
if ($old !== null) {
|
||||
$phids[] = $old;
|
||||
}
|
||||
$phids[] = $new;
|
||||
break;
|
||||
}
|
||||
|
||||
return $phids;
|
||||
}
|
||||
|
||||
public function shouldHide() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_NAME:
|
||||
return ($old === null);
|
||||
}
|
||||
|
||||
return parent::shouldHide();
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$author_phid = $this->getAuthorPHID();
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_NAME:
|
||||
return pht(
|
||||
'%s renamed this macro from "%s" to "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$old,
|
||||
$new);
|
||||
break;
|
||||
case self::TYPE_DISABLED:
|
||||
if ($new) {
|
||||
return pht(
|
||||
'%s disabled this macro.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
} else {
|
||||
return pht(
|
||||
'%s restored this macro.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
}
|
||||
break;
|
||||
|
||||
case self::TYPE_AUDIO:
|
||||
if (!$old) {
|
||||
return pht(
|
||||
'%s attached audio: %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($new));
|
||||
} else {
|
||||
return pht(
|
||||
'%s changed the audio for this macro from %s to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($old),
|
||||
$this->renderHandleLink($new));
|
||||
}
|
||||
|
||||
case self::TYPE_AUDIO_BEHAVIOR:
|
||||
switch ($new) {
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
|
||||
return pht(
|
||||
'%s set the audio to play once.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_LOOP:
|
||||
return pht(
|
||||
'%s set the audio to loop.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
default:
|
||||
return pht(
|
||||
'%s disabled the audio for this macro.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
}
|
||||
|
||||
case self::TYPE_FILE:
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s created this macro.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
} else {
|
||||
return pht(
|
||||
'%s changed the image for this macro from %s to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($old),
|
||||
$this->renderHandleLink($new));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return parent::getTitle();
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$author_phid = $this->getAuthorPHID();
|
||||
$object_phid = $this->getObjectPHID();
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_NAME:
|
||||
return pht(
|
||||
'%s renamed %s from "%s" to "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid),
|
||||
$old,
|
||||
$new);
|
||||
case self::TYPE_DISABLED:
|
||||
if ($new) {
|
||||
return pht(
|
||||
'%s disabled %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
} else {
|
||||
return pht(
|
||||
'%s restored %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
}
|
||||
case self::TYPE_FILE:
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s created %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
} else {
|
||||
return pht(
|
||||
'%s updated the image for %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
}
|
||||
|
||||
case self::TYPE_AUDIO:
|
||||
if (!$old) {
|
||||
return pht(
|
||||
'%s attached audio to %s: %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid),
|
||||
$this->renderHandleLink($new));
|
||||
} else {
|
||||
return pht(
|
||||
'%s changed the audio for %s from %s to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid),
|
||||
$this->renderHandleLink($old),
|
||||
$this->renderHandleLink($new));
|
||||
}
|
||||
|
||||
case self::TYPE_AUDIO_BEHAVIOR:
|
||||
switch ($new) {
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
|
||||
return pht(
|
||||
'%s set the audio for %s to play once.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_LOOP:
|
||||
return pht(
|
||||
'%s set the audio for %s to loop.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
default:
|
||||
return pht(
|
||||
'%s disabled the audio for %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return parent::getTitleForFeed();
|
||||
}
|
||||
|
||||
public function getActionName() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_NAME:
|
||||
if ($old === null) {
|
||||
return pht('Created');
|
||||
} else {
|
||||
return pht('Renamed');
|
||||
}
|
||||
case self::TYPE_DISABLED:
|
||||
if ($new) {
|
||||
return pht('Disabled');
|
||||
} else {
|
||||
return pht('Restored');
|
||||
}
|
||||
case self::TYPE_FILE:
|
||||
if ($old === null) {
|
||||
return pht('Created');
|
||||
} else {
|
||||
return pht('Edited Image');
|
||||
}
|
||||
|
||||
case self::TYPE_AUDIO:
|
||||
return pht('Audio');
|
||||
|
||||
case self::TYPE_AUDIO_BEHAVIOR:
|
||||
return pht('Audio Behavior');
|
||||
|
||||
}
|
||||
|
||||
return parent::getActionName();
|
||||
}
|
||||
|
||||
public function getActionStrength() {
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_DISABLED:
|
||||
return 2.0;
|
||||
case self::TYPE_FILE:
|
||||
return 1.5;
|
||||
}
|
||||
return parent::getActionStrength();
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_NAME:
|
||||
return 'fa-pencil';
|
||||
case self::TYPE_FILE:
|
||||
if ($old === null) {
|
||||
return 'fa-plus';
|
||||
} else {
|
||||
return 'fa-pencil';
|
||||
}
|
||||
case self::TYPE_DISABLED:
|
||||
if ($new) {
|
||||
return 'fa-times';
|
||||
} else {
|
||||
return 'fa-undo';
|
||||
}
|
||||
case self::TYPE_AUDIO:
|
||||
return 'fa-headphones';
|
||||
}
|
||||
|
||||
return parent::getIcon();
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_NAME:
|
||||
return PhabricatorTransactions::COLOR_BLUE;
|
||||
case self::TYPE_FILE:
|
||||
if ($old === null) {
|
||||
return PhabricatorTransactions::COLOR_GREEN;
|
||||
} else {
|
||||
return PhabricatorTransactions::COLOR_BLUE;
|
||||
}
|
||||
case self::TYPE_DISABLED:
|
||||
if ($new) {
|
||||
return PhabricatorTransactions::COLOR_RED;
|
||||
} else {
|
||||
return PhabricatorTransactions::COLOR_SKY;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::getColor();
|
||||
public function getBaseTransactionClass() {
|
||||
return 'PhabricatorMacroTransactionType';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMacroAudioBehaviorTransaction
|
||||
extends PhabricatorMacroTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'macro:audiobehavior';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getAudioBehavior();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setAudioBehavior($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$new = $this->getNewValue();
|
||||
$old = $this->getOldValue();
|
||||
switch ($new) {
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
|
||||
return pht(
|
||||
'%s set the audio to play once.',
|
||||
$this->renderAuthor());
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_LOOP:
|
||||
return pht(
|
||||
'%s set the audio to loop.',
|
||||
$this->renderAuthor());
|
||||
default:
|
||||
return pht(
|
||||
'%s disabled the audio for this macro.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$new = $this->getNewValue();
|
||||
$old = $this->getOldValue();
|
||||
switch ($new) {
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
|
||||
return pht(
|
||||
'%s set the audio for %s to play once.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_LOOP:
|
||||
return pht(
|
||||
'%s set the audio for %s to loop.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
default:
|
||||
return pht(
|
||||
'%s disabled the audio for %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
$new = $this->getNewValue();
|
||||
switch ($new) {
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
|
||||
return 'fa-play-circle';
|
||||
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_LOOP:
|
||||
return 'fa-repeat';
|
||||
default:
|
||||
return 'fa-pause-circle';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMacroAudioTransaction
|
||||
extends PhabricatorMacroTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'macro:audio';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getAudioPHID();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setAudioPHID($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$new = $this->getNewValue();
|
||||
$old = $this->getOldValue();
|
||||
if (!$old) {
|
||||
return pht(
|
||||
'%s attached audio: %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderHandle($new));
|
||||
} else {
|
||||
return pht(
|
||||
'%s changed the audio for this macro from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderHandle($old),
|
||||
$this->renderHandle($new));
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$new = $this->getNewValue();
|
||||
$old = $this->getOldValue();
|
||||
if (!$old) {
|
||||
return pht(
|
||||
'%s attached audio to %s: %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$this->renderHandle($new));
|
||||
} else {
|
||||
return pht(
|
||||
'%s changed the audio for %s from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$this->renderHandle($old),
|
||||
$this->renderHandle($new));
|
||||
}
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-music';
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMacroDisabledTransaction
|
||||
extends PhabricatorMacroTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'macro:disabled';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getIsDisabled();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setIsDisabled($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
if ($this->getNewValue()) {
|
||||
return pht(
|
||||
'%s disabled this macro.',
|
||||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s restored this macro.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
if ($this->getNewValue()) {
|
||||
return pht(
|
||||
'%s disabled %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
} else {
|
||||
return pht(
|
||||
'%s restored %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
if ($this->getNewValue()) {
|
||||
return 'fa-ban';
|
||||
} else {
|
||||
return 'fa-check';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMacroFileTransaction
|
||||
extends PhabricatorMacroTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'macro:file';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getFilePHID();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setFilePHID($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s changed the image for this macro.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s changed the image for macro %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
public function validateTransactions($object, array $xactions) {
|
||||
$errors = array();
|
||||
$viewer = $this->getActor();
|
||||
|
||||
foreach ($xactions as $xaction) {
|
||||
$file_phid = $xaction->getNewValue();
|
||||
|
||||
if ($this->isEmptyTextTransaction($file_phid, $xactions)) {
|
||||
$errors[] = $this->newRequiredError(
|
||||
pht('Image macros must have a file.'));
|
||||
}
|
||||
|
||||
$file = id(new PhabricatorFileQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($file_phid))
|
||||
->executeOne();
|
||||
|
||||
if (!$file) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('"%s" is not a valid file PHID.',
|
||||
$file_phid));
|
||||
} else {
|
||||
if (!$file->isViewableInBrowser()) {
|
||||
$mime_type = $file->getMimeType();
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('File mime type of "%s" is not a valid viewable image.',
|
||||
$mime_type));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-file-image-o';
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorMacroNameTransaction
|
||||
extends PhabricatorMacroTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'macro:name';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getName();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setName($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s renamed this macro from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s renamed %s macro %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
|
||||
public function validateTransactions($object, array $xactions) {
|
||||
$errors = array();
|
||||
$viewer = $this->getActor();
|
||||
|
||||
if ($this->isEmptyTextTransaction($object->getName(), $xactions)) {
|
||||
$errors[] = $this->newRequiredError(
|
||||
pht('Macros must have a name.'));
|
||||
}
|
||||
|
||||
$max_length = $object->getColumnMaximumByteLength('name');
|
||||
foreach ($xactions as $xaction) {
|
||||
$old_value = $this->generateOldValue($object);
|
||||
$new_value = $xaction->getNewValue();
|
||||
|
||||
$new_length = strlen($new_value);
|
||||
if ($new_length > $max_length) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('The name can be no longer than %s characters.',
|
||||
new PhutilNumber($max_length)));
|
||||
}
|
||||
|
||||
if (!preg_match('/^[a-z0-9:_-]{3,}\z/', $new_value)) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('Macro name "%s" be at least three characters long and contain '.
|
||||
'only lowercase letters, digits, hyphens, colons and '.
|
||||
'underscores.',
|
||||
$new_value));
|
||||
}
|
||||
|
||||
// Check name is unique when updating / creating
|
||||
if ($old_value != $new_value) {
|
||||
$macro = id(new PhabricatorMacroQuery())
|
||||
->setViewer($viewer)
|
||||
->withNames(array($new_value))
|
||||
->executeOne();
|
||||
|
||||
if ($macro) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('Macro "%s" already exists.', $new_value));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
abstract class PhabricatorMacroTransactionType
|
||||
extends PhabricatorModularTransactionType {}
|
|
@ -38,6 +38,11 @@ final class PhabricatorApplicationDetailViewController
|
|||
$header->setStatus('fa-ban', 'dark', pht('Uninstalled'));
|
||||
}
|
||||
|
||||
$timeline = $this->buildTransactionTimeline(
|
||||
$selected,
|
||||
new PhabricatorApplicationApplicationTransactionQuery());
|
||||
$timeline->setShouldTerminate(true);
|
||||
|
||||
$curtain = $this->buildCurtain($selected);
|
||||
$details = $this->buildPropertySectionView($selected);
|
||||
$policies = $this->buildPolicyView($selected);
|
||||
|
@ -61,6 +66,7 @@ final class PhabricatorApplicationDetailViewController
|
|||
->setMainColumn(array(
|
||||
$policies,
|
||||
$panels,
|
||||
$timeline,
|
||||
))
|
||||
->addPropertySection(pht('Details'), $details);
|
||||
|
||||
|
|
|
@ -30,8 +30,15 @@ final class PhabricatorApplicationEditController
|
|||
->execute();
|
||||
|
||||
if ($request->isFormPost()) {
|
||||
$xactions = array();
|
||||
|
||||
$result = array();
|
||||
$template = $application->getApplicationTransactionTemplate();
|
||||
foreach ($application->getCapabilities() as $capability) {
|
||||
if (!$application->isCapabilityEditable($capability)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$old = $application->getPolicy($capability);
|
||||
$new = $request->getStr('policy:'.$capability);
|
||||
|
||||
|
@ -40,67 +47,36 @@ final class PhabricatorApplicationEditController
|
|||
continue;
|
||||
}
|
||||
|
||||
if (empty($policies[$new])) {
|
||||
// Not a standard policy, check for a custom policy.
|
||||
$policy = id(new PhabricatorPolicyQuery())
|
||||
->setViewer($user)
|
||||
->withPHIDs(array($new))
|
||||
->executeOne();
|
||||
if (!$policy) {
|
||||
// Not a custom policy either. Can't set the policy to something
|
||||
// invalid, so skip this.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ($new == PhabricatorPolicies::POLICY_PUBLIC) {
|
||||
$capobj = PhabricatorPolicyCapability::getCapabilityByKey(
|
||||
$capability);
|
||||
if (!$capobj || !$capobj->shouldAllowPublicPolicySetting()) {
|
||||
// Can't set non-public policies to public.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$result[$capability] = $new;
|
||||
|
||||
$xactions[] = id(clone $template)
|
||||
->setTransactionType(
|
||||
PhabricatorApplicationPolicyChangeTransaction::TRANSACTIONTYPE)
|
||||
->setMetadataValue(
|
||||
PhabricatorApplicationPolicyChangeTransaction::METADATA_ATTRIBUTE,
|
||||
$capability)
|
||||
->setNewValue($new);
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
$key = 'phabricator.application-settings';
|
||||
$config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
|
||||
$value = $config_entry->getValue();
|
||||
|
||||
$phid = $application->getPHID();
|
||||
if (empty($value[$phid])) {
|
||||
$value[$application->getPHID()] = array();
|
||||
}
|
||||
if (empty($value[$phid]['policy'])) {
|
||||
$value[$phid]['policy'] = array();
|
||||
}
|
||||
|
||||
$value[$phid]['policy'] = $result + $value[$phid]['policy'];
|
||||
|
||||
// Don't allow users to make policy edits which would lock them out of
|
||||
// applications, since they would be unable to undo those actions.
|
||||
PhabricatorEnv::overrideConfig($key, $value);
|
||||
PhabricatorPolicyFilter::mustRetainCapability(
|
||||
$user,
|
||||
$application,
|
||||
PhabricatorPolicyCapability::CAN_VIEW);
|
||||
|
||||
PhabricatorPolicyFilter::mustRetainCapability(
|
||||
$user,
|
||||
$application,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
PhabricatorConfigEditor::storeNewValue(
|
||||
$user,
|
||||
$config_entry,
|
||||
$value,
|
||||
PhabricatorContentSource::newFromRequest($request));
|
||||
}
|
||||
$editor = id(new PhabricatorApplicationEditor())
|
||||
->setActor($user)
|
||||
->setContentSourceFromRequest($request)
|
||||
->setContinueOnNoEffect(true)
|
||||
->setContinueOnMissingFields(true);
|
||||
|
||||
try {
|
||||
$editor->applyTransactions($application, $xactions);
|
||||
return id(new AphrontRedirectResponse())->setURI($view_uri);
|
||||
} catch (PhabricatorApplicationTransactionValidationException $ex) {
|
||||
$validation_exception = $ex;
|
||||
}
|
||||
|
||||
return $this->newDialog()
|
||||
->setTitle('Validation Failed')
|
||||
->setValidationException($validation_exception)
|
||||
->addCancelButton($view_uri);
|
||||
}
|
||||
}
|
||||
|
||||
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorApplicationEditEngine
|
||||
extends PhabricatorEditEngine {
|
||||
|
||||
const ENGINECONST = 'application.application';
|
||||
|
||||
public function getEngineApplicationClass() {
|
||||
return 'PhabricatorApplicationsApplication';
|
||||
}
|
||||
|
||||
public function getEngineName() {
|
||||
return pht('Applications');
|
||||
}
|
||||
|
||||
public function getSummaryHeader() {
|
||||
return pht('Configure Application Forms');
|
||||
}
|
||||
|
||||
public function getSummaryText() {
|
||||
return pht('Configure creation and editing forms in Applications.');
|
||||
}
|
||||
|
||||
public function isEngineConfigurable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function newEditableObject() {
|
||||
throw new PhutilMethodNotImplementedException();
|
||||
}
|
||||
|
||||
protected function newObjectQuery() {
|
||||
return new PhabricatorApplicationQuery();
|
||||
}
|
||||
|
||||
protected function getObjectCreateTitleText($object) {
|
||||
return pht('Create New Application');
|
||||
}
|
||||
|
||||
protected function getObjectEditTitleText($object) {
|
||||
return pht('Edit Application: %s', $object->getName());
|
||||
}
|
||||
|
||||
protected function getObjectEditShortText($object) {
|
||||
return $object->getName();
|
||||
}
|
||||
|
||||
protected function getObjectCreateShortText() {
|
||||
return pht('Create Application');
|
||||
}
|
||||
|
||||
protected function getObjectName() {
|
||||
return pht('Application');
|
||||
}
|
||||
|
||||
protected function getObjectViewURI($object) {
|
||||
return $object->getViewURI();
|
||||
}
|
||||
|
||||
protected function buildCustomEditFields($object) {
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorApplicationEditor
|
||||
extends PhabricatorApplicationTransactionEditor {
|
||||
|
||||
public function getEditorApplicationClass() {
|
||||
return 'PhabricatorApplicationsApplication';
|
||||
}
|
||||
|
||||
public function getEditorObjectsDescription() {
|
||||
return pht('Application');
|
||||
}
|
||||
|
||||
protected function supportsSearch() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getTransactionTypes() {
|
||||
$types = parent::getTransactionTypes();
|
||||
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
||||
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function shouldPublishFeedStory(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getMailTo(PhabricatorLiskDAO $object) {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function getMailCC(PhabricatorLiskDAO $object) {
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
|
@ -11,10 +11,6 @@ final class PhabricatorApplicationApplicationTransaction
|
|||
return PhabricatorApplicationApplicationPHIDType::TYPECONST;
|
||||
}
|
||||
|
||||
public function getApplicationTransactionCommentObject() {
|
||||
return new PhabricatorApplicationTransactionComment();
|
||||
}
|
||||
|
||||
public function getBaseTransactionClass() {
|
||||
return 'PhabricatorApplicationTransactionType';
|
||||
}
|
||||
|
|
|
@ -0,0 +1,197 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorApplicationPolicyChangeTransaction
|
||||
extends PhabricatorApplicationTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'application.policy';
|
||||
const METADATA_ATTRIBUTE = 'capability.name';
|
||||
|
||||
private $policies;
|
||||
|
||||
public function generateOldValue($object) {
|
||||
$application = $object;
|
||||
$capability = $this->getCapabilityName();
|
||||
return $application->getPolicy($capability);
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$application = $object;
|
||||
$user = $this->getActor();
|
||||
|
||||
$key = 'phabricator.application-settings';
|
||||
$config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
|
||||
$current_value = $config_entry->getValue();
|
||||
|
||||
$phid = $application->getPHID();
|
||||
if (empty($current_value[$phid])) {
|
||||
$current_value[$application->getPHID()] = array();
|
||||
}
|
||||
if (empty($current_value[$phid]['policy'])) {
|
||||
$current_value[$phid]['policy'] = array();
|
||||
}
|
||||
|
||||
$new = array($this->getCapabilityName() => $value);
|
||||
$current_value[$phid]['policy'] = $new + $current_value[$phid]['policy'];
|
||||
|
||||
$editor = $this->getEditor();
|
||||
$content_source = $editor->getContentSource();
|
||||
PhabricatorConfigEditor::storeNewValue(
|
||||
$user,
|
||||
$config_entry,
|
||||
$current_value,
|
||||
$content_source);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$old = $this->renderPolicy($this->getOldValue());
|
||||
$new = $this->renderPolicy($this->getNewValue());
|
||||
|
||||
return pht(
|
||||
'%s changed the "%s" policy from "%s" to "%s".',
|
||||
$this->renderAuthor(),
|
||||
$this->renderCapability(),
|
||||
$old,
|
||||
$new);
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$old = $this->renderPolicy($this->getOldValue());
|
||||
$new = $this->renderPolicy($this->getNewValue());
|
||||
|
||||
return pht(
|
||||
'%s changed the "%s" policy for application %s from "%s" to "%s".',
|
||||
$this->renderAuthor(),
|
||||
$this->renderCapability(),
|
||||
$this->renderObject(),
|
||||
$old,
|
||||
$new);
|
||||
}
|
||||
|
||||
public function validateTransactions($object, array $xactions) {
|
||||
$user = $this->getActor();
|
||||
$application = $object;
|
||||
$policies = id(new PhabricatorPolicyQuery())
|
||||
->setViewer($user)
|
||||
->setObject($application)
|
||||
->execute();
|
||||
|
||||
$errors = array();
|
||||
foreach ($xactions as $xaction) {
|
||||
$new = $xaction->getNewValue();
|
||||
$capability = $xaction->getMetadataValue(self::METADATA_ATTRIBUTE);
|
||||
|
||||
if (empty($policies[$new])) {
|
||||
// Not a standard policy, check for a custom policy.
|
||||
$policy = id(new PhabricatorPolicyQuery())
|
||||
->setViewer($user)
|
||||
->withPHIDs(array($new))
|
||||
->executeOne();
|
||||
if (!$policy) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('Policy does not exist.'));
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$policy = idx($policies, $new);
|
||||
}
|
||||
|
||||
if (!$policy->isValidPolicyForEdit()) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('Can\'t set the policy to a policy you can\'t view!'));
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($new == PhabricatorPolicies::POLICY_PUBLIC) {
|
||||
$capobj = PhabricatorPolicyCapability::getCapabilityByKey(
|
||||
$capability);
|
||||
if (!$capobj || !$capobj->shouldAllowPublicPolicySetting()) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('Can\'t set non-public policies to public.'));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$application->isCapabilityEditable($capability)) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('Capability "%s" is not editable for this application.',
|
||||
$capability));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// If we're changing these policies, the viewer needs to still be able to
|
||||
// view or edit the application under the new policy.
|
||||
$validate_map = array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
PhabricatorPolicyCapability::CAN_EDIT,
|
||||
);
|
||||
$validate_map = array_fill_keys($validate_map, array());
|
||||
|
||||
foreach ($xactions as $xaction) {
|
||||
$capability = $xaction->getMetadataValue(self::METADATA_ATTRIBUTE);
|
||||
if (!isset($validate_map[$capability])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$validate_map[$capability][] = $xaction;
|
||||
}
|
||||
|
||||
foreach ($validate_map as $capability => $cap_xactions) {
|
||||
if (!$cap_xactions) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$editor = $this->getEditor();
|
||||
$policy_errors = $editor->validatePolicyTransaction(
|
||||
$object,
|
||||
$cap_xactions,
|
||||
self::TRANSACTIONTYPE,
|
||||
$capability);
|
||||
|
||||
foreach ($policy_errors as $error) {
|
||||
$errors[] = $error;
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
private function renderPolicy($name) {
|
||||
$policies = $this->getAllPolicies();
|
||||
if (empty($policies[$name])) {
|
||||
// Not a standard policy, check for a custom policy.
|
||||
$policy = id(new PhabricatorPolicyQuery())
|
||||
->setViewer($this->getViewer())
|
||||
->withPHIDs(array($name))
|
||||
->executeOne();
|
||||
$policies[$name] = $policy;
|
||||
}
|
||||
|
||||
$policy = idx($policies, $name);
|
||||
return $this->renderValue($policy->getFullName());
|
||||
}
|
||||
|
||||
private function getAllPolicies() {
|
||||
if (!$this->policies) {
|
||||
$viewer = $this->getViewer();
|
||||
$application = $this->getObject();
|
||||
$this->policies = id(new PhabricatorPolicyQuery())
|
||||
->setViewer($viewer)
|
||||
->setObject($application)
|
||||
->execute();
|
||||
}
|
||||
|
||||
return $this->policies;
|
||||
}
|
||||
|
||||
private function renderCapability() {
|
||||
$application = $this->getObject();
|
||||
$capability = $this->getCapabilityName();
|
||||
return $application->getCapabilityLabel($capability);
|
||||
}
|
||||
|
||||
private function getCapabilityName() {
|
||||
return $this->getMetadataValue(self::METADATA_ATTRIBUTE);
|
||||
}
|
||||
|
||||
}
|
|
@ -50,7 +50,8 @@ final class PassphraseCredentialConduitController
|
|||
$xactions = array();
|
||||
|
||||
$xactions[] = id(new PassphraseCredentialTransaction())
|
||||
->setTransactionType(PassphraseCredentialTransaction::TYPE_CONDUIT)
|
||||
->setTransactionType(
|
||||
PassphraseCredentialConduitTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue(!$credential->getAllowConduit());
|
||||
|
||||
$editor = id(new PassphraseCredentialTransactionEditor())
|
||||
|
|
|
@ -32,7 +32,8 @@ final class PassphraseCredentialDestroyController
|
|||
|
||||
$xactions = array();
|
||||
$xactions[] = id(new PassphraseCredentialTransaction())
|
||||
->setTransactionType(PassphraseCredentialTransaction::TYPE_DESTROY)
|
||||
->setTransactionType(
|
||||
PassphraseCredentialDestroyTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue(1);
|
||||
|
||||
$editor = id(new PassphraseCredentialTransactionEditor())
|
||||
|
|
|
@ -117,12 +117,19 @@ final class PassphraseCredentialEditController extends PassphraseController {
|
|||
}
|
||||
|
||||
if (!$errors) {
|
||||
$type_name = PassphraseCredentialTransaction::TYPE_NAME;
|
||||
$type_desc = PassphraseCredentialTransaction::TYPE_DESCRIPTION;
|
||||
$type_username = PassphraseCredentialTransaction::TYPE_USERNAME;
|
||||
$type_destroy = PassphraseCredentialTransaction::TYPE_DESTROY;
|
||||
$type_secret_id = PassphraseCredentialTransaction::TYPE_SECRET_ID;
|
||||
$type_is_locked = PassphraseCredentialTransaction::TYPE_LOCK;
|
||||
$type_name =
|
||||
PassphraseCredentialNameTransaction::TRANSACTIONTYPE;
|
||||
$type_desc =
|
||||
PassphraseCredentialDescriptionTransaction::TRANSACTIONTYPE;
|
||||
$type_username =
|
||||
PassphraseCredentialUsernameTransaction::TRANSACTIONTYPE;
|
||||
$type_destroy =
|
||||
PassphraseCredentialDestroyTransaction::TRANSACTIONTYPE;
|
||||
$type_secret_id =
|
||||
PassphraseCredentialSecretIDTransaction::TRANSACTIONTYPE;
|
||||
$type_is_locked =
|
||||
PassphraseCredentialLockTransaction::TRANSACTIONTYPE;
|
||||
|
||||
$type_view_policy = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
||||
$type_edit_policy = PhabricatorTransactions::TYPE_EDIT_POLICY;
|
||||
$type_space = PhabricatorTransactions::TYPE_SPACE;
|
||||
|
|
|
@ -40,11 +40,13 @@ final class PassphraseCredentialLockController
|
|||
$xactions = array();
|
||||
|
||||
$xactions[] = id(new PassphraseCredentialTransaction())
|
||||
->setTransactionType(PassphraseCredentialTransaction::TYPE_CONDUIT)
|
||||
->setTransactionType(
|
||||
PassphraseCredentialConduitTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue(0);
|
||||
|
||||
$xactions[] = id(new PassphraseCredentialTransaction())
|
||||
->setTransactionType(PassphraseCredentialTransaction::TYPE_LOCK)
|
||||
->setTransactionType(
|
||||
PassphraseCredentialLockTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue(1);
|
||||
|
||||
$editor = id(new PassphraseCredentialTransactionEditor())
|
||||
|
|
|
@ -67,7 +67,7 @@ final class PassphraseCredentialRevealController
|
|||
->setDisableWorkflowOnCancel(true)
|
||||
->addCancelButton($view_uri, pht('Done'));
|
||||
|
||||
$type_secret = PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET;
|
||||
$type_secret = PassphraseCredentialLookedAtTransaction::TRANSACTIONTYPE;
|
||||
$xactions = array(
|
||||
id(new PassphraseCredentialTransaction())
|
||||
->setTransactionType($type_secret)
|
||||
|
|
|
@ -17,185 +17,15 @@ final class PassphraseCredentialTransactionEditor
|
|||
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
||||
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
|
||||
|
||||
$types[] = PassphraseCredentialTransaction::TYPE_NAME;
|
||||
$types[] = PassphraseCredentialTransaction::TYPE_DESCRIPTION;
|
||||
$types[] = PassphraseCredentialTransaction::TYPE_USERNAME;
|
||||
$types[] = PassphraseCredentialTransaction::TYPE_SECRET_ID;
|
||||
$types[] = PassphraseCredentialTransaction::TYPE_DESTROY;
|
||||
$types[] = PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET;
|
||||
$types[] = PassphraseCredentialTransaction::TYPE_LOCK;
|
||||
$types[] = PassphraseCredentialTransaction::TYPE_CONDUIT;
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
protected function getCustomTransactionOldValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PassphraseCredentialTransaction::TYPE_NAME:
|
||||
if ($this->getIsNewObject()) {
|
||||
return null;
|
||||
}
|
||||
return $object->getName();
|
||||
case PassphraseCredentialTransaction::TYPE_DESCRIPTION:
|
||||
return $object->getDescription();
|
||||
case PassphraseCredentialTransaction::TYPE_USERNAME:
|
||||
return $object->getUsername();
|
||||
case PassphraseCredentialTransaction::TYPE_SECRET_ID:
|
||||
return $object->getSecretID();
|
||||
case PassphraseCredentialTransaction::TYPE_DESTROY:
|
||||
return (int)$object->getIsDestroyed();
|
||||
case PassphraseCredentialTransaction::TYPE_LOCK:
|
||||
return (int)$object->getIsLocked();
|
||||
case PassphraseCredentialTransaction::TYPE_CONDUIT:
|
||||
return (int)$object->getAllowConduit();
|
||||
case PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET:
|
||||
return null;
|
||||
public function getCreateObjectTitle($author, $object) {
|
||||
return pht('%s created this credential.', $author);
|
||||
}
|
||||
|
||||
return parent::getCustomTransactionOldValue($object, $xaction);
|
||||
}
|
||||
|
||||
protected function getCustomTransactionNewValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PassphraseCredentialTransaction::TYPE_NAME:
|
||||
case PassphraseCredentialTransaction::TYPE_DESCRIPTION:
|
||||
case PassphraseCredentialTransaction::TYPE_USERNAME:
|
||||
case PassphraseCredentialTransaction::TYPE_SECRET_ID:
|
||||
case PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET:
|
||||
return $xaction->getNewValue();
|
||||
case PassphraseCredentialTransaction::TYPE_DESTROY:
|
||||
case PassphraseCredentialTransaction::TYPE_LOCK:
|
||||
return (int)$xaction->getNewValue();
|
||||
case PassphraseCredentialTransaction::TYPE_CONDUIT:
|
||||
return (int)$xaction->getNewValue();
|
||||
}
|
||||
return parent::getCustomTransactionNewValue($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyCustomInternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PassphraseCredentialTransaction::TYPE_NAME:
|
||||
$object->setName($xaction->getNewValue());
|
||||
return;
|
||||
case PassphraseCredentialTransaction::TYPE_DESCRIPTION:
|
||||
$object->setDescription($xaction->getNewValue());
|
||||
return;
|
||||
case PassphraseCredentialTransaction::TYPE_USERNAME:
|
||||
$object->setUsername($xaction->getNewValue());
|
||||
return;
|
||||
case PassphraseCredentialTransaction::TYPE_SECRET_ID:
|
||||
$old_id = $object->getSecretID();
|
||||
if ($old_id) {
|
||||
$this->destroySecret($old_id);
|
||||
}
|
||||
$object->setSecretID($xaction->getNewValue());
|
||||
return;
|
||||
case PassphraseCredentialTransaction::TYPE_DESTROY:
|
||||
// When destroying a credential, wipe out its secret.
|
||||
$is_destroyed = $xaction->getNewValue();
|
||||
$object->setIsDestroyed($is_destroyed);
|
||||
if ($is_destroyed) {
|
||||
$secret_id = $object->getSecretID();
|
||||
if ($secret_id) {
|
||||
$this->destroySecret($secret_id);
|
||||
$object->setSecretID(null);
|
||||
}
|
||||
}
|
||||
return;
|
||||
case PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET:
|
||||
return;
|
||||
case PassphraseCredentialTransaction::TYPE_LOCK:
|
||||
$object->setIsLocked((int)$xaction->getNewValue());
|
||||
return;
|
||||
case PassphraseCredentialTransaction::TYPE_CONDUIT:
|
||||
$object->setAllowConduit((int)$xaction->getNewValue());
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyCustomExternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PassphraseCredentialTransaction::TYPE_NAME:
|
||||
case PassphraseCredentialTransaction::TYPE_DESCRIPTION:
|
||||
case PassphraseCredentialTransaction::TYPE_USERNAME:
|
||||
case PassphraseCredentialTransaction::TYPE_SECRET_ID:
|
||||
case PassphraseCredentialTransaction::TYPE_DESTROY:
|
||||
case PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET:
|
||||
case PassphraseCredentialTransaction::TYPE_LOCK:
|
||||
case PassphraseCredentialTransaction::TYPE_CONDUIT:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
private function destroySecret($secret_id) {
|
||||
$table = new PassphraseSecret();
|
||||
queryfx(
|
||||
$table->establishConnection('w'),
|
||||
'DELETE FROM %T WHERE id = %d',
|
||||
$table->getTableName(),
|
||||
$secret_id);
|
||||
}
|
||||
|
||||
protected function validateTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
$type,
|
||||
array $xactions) {
|
||||
|
||||
$errors = parent::validateTransaction($object, $type, $xactions);
|
||||
|
||||
switch ($type) {
|
||||
case PassphraseCredentialTransaction::TYPE_NAME:
|
||||
$missing = $this->validateIsEmptyTextField(
|
||||
$object->getName(),
|
||||
$xactions);
|
||||
|
||||
if ($missing) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Required'),
|
||||
pht('Credential name is required.'),
|
||||
nonempty(last($xactions), null));
|
||||
|
||||
$error->setIsMissingFieldError(true);
|
||||
$errors[] = $error;
|
||||
}
|
||||
break;
|
||||
case PassphraseCredentialTransaction::TYPE_USERNAME:
|
||||
$credential_type = $object->getImplementation();
|
||||
if (!$credential_type->shouldRequireUsername()) {
|
||||
break;
|
||||
}
|
||||
$missing = $this->validateIsEmptyTextField(
|
||||
$object->getUsername(),
|
||||
$xactions);
|
||||
|
||||
if ($missing) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Required'),
|
||||
pht('Username is required.'),
|
||||
nonempty(last($xactions), null));
|
||||
|
||||
$error->setIsMissingFieldError(true);
|
||||
$errors[] = $error;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return $errors;
|
||||
public function getCreateObjectTitleForFeed($author, $object) {
|
||||
return pht('%s created %s.', $author, $object);
|
||||
}
|
||||
|
||||
protected function supportsSearch() {
|
||||
|
|
|
@ -1,16 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredentialTransaction
|
||||
extends PhabricatorApplicationTransaction {
|
||||
|
||||
const TYPE_NAME = 'passphrase:name';
|
||||
const TYPE_DESCRIPTION = 'passphrase:description';
|
||||
const TYPE_USERNAME = 'passphrase:username';
|
||||
const TYPE_SECRET_ID = 'passphrase:secretID';
|
||||
const TYPE_DESTROY = 'passphrase:destroy';
|
||||
const TYPE_LOOKEDATSECRET = 'passphrase:lookedAtSecret';
|
||||
const TYPE_LOCK = 'passphrase:lock';
|
||||
const TYPE_CONDUIT = 'passphrase:conduit';
|
||||
extends PhabricatorModularTransaction {
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'passphrase';
|
||||
|
@ -24,116 +15,8 @@ final class PassphraseCredentialTransaction
|
|||
return null;
|
||||
}
|
||||
|
||||
public function shouldHide() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_DESCRIPTION:
|
||||
return ($old === null);
|
||||
case self::TYPE_LOCK:
|
||||
return ($old === null);
|
||||
case self::TYPE_USERNAME:
|
||||
return !strlen($old);
|
||||
case self::TYPE_LOOKEDATSECRET:
|
||||
return false;
|
||||
case self::TYPE_DESTROY:
|
||||
// Don't show "undestroy" transactions because they're a bit confusing
|
||||
// and redundant with restoring a secret.
|
||||
if (!$new) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return parent::shouldHide();
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
$author_phid = $this->getAuthorPHID();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_NAME:
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s created this credential.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
} else {
|
||||
return pht(
|
||||
'%s renamed this credential from "%s" to "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$old,
|
||||
$new);
|
||||
}
|
||||
break;
|
||||
case self::TYPE_DESCRIPTION:
|
||||
return pht(
|
||||
'%s updated the description for this credential.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case self::TYPE_USERNAME:
|
||||
if (strlen($old)) {
|
||||
return pht(
|
||||
'%s changed the username for this credential from "%s" to "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$old,
|
||||
$new);
|
||||
} else {
|
||||
return pht(
|
||||
'%s set the username for this credential to "%s".',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$new);
|
||||
}
|
||||
break;
|
||||
case self::TYPE_SECRET_ID:
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s attached a new secret to this credential.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
} else {
|
||||
return pht(
|
||||
'%s updated the secret for this credential.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
}
|
||||
case self::TYPE_DESTROY:
|
||||
return pht(
|
||||
'%s destroyed the secret for this credential.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case self::TYPE_LOOKEDATSECRET:
|
||||
return pht(
|
||||
'%s examined the secret plaintext for this credential.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case self::TYPE_LOCK:
|
||||
return pht(
|
||||
'%s locked this credential.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
case self::TYPE_CONDUIT:
|
||||
if ($old) {
|
||||
return pht(
|
||||
'%s disallowed Conduit API access to this credential.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
} else {
|
||||
return pht(
|
||||
'%s allowed Conduit API access to this credential.',
|
||||
$this->renderHandleLink($author_phid));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return parent::getTitle();
|
||||
}
|
||||
|
||||
public function hasChangeDetails() {
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_DESCRIPTION:
|
||||
return true;
|
||||
}
|
||||
return parent::hasChangeDetails();
|
||||
}
|
||||
|
||||
public function renderChangeDetails(PhabricatorUser $viewer) {
|
||||
return $this->renderTextCorpusChangeDetails(
|
||||
$viewer,
|
||||
json_encode($this->getOldValue()),
|
||||
json_encode($this->getNewValue()));
|
||||
public function getBaseTransactionClass() {
|
||||
return 'PassphraseCredentialTransactionType';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredentialConduitTransaction
|
||||
extends PassphraseCredentialTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'passphrase:conduit';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getAllowConduit();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setAllowConduit((int)$value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$new = $this->getNewValue();
|
||||
if ($new) {
|
||||
return pht(
|
||||
'%s allowed Conduit API access to this credential.',
|
||||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s disallowed Conduit API access to this credential.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$new = $this->getNewValue();
|
||||
if ($new) {
|
||||
return pht(
|
||||
'%s allowed Conduit API access to credential %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
} else {
|
||||
return pht(
|
||||
'%s disallowed Conduit API access to credential %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
$new = $this->getNewValue();
|
||||
if ($new) {
|
||||
return 'fa-tty';
|
||||
} else {
|
||||
return 'fa-ban';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredentialDescriptionTransaction
|
||||
extends PassphraseCredentialTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'passphrase:description';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getDescription();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setDescription($value);
|
||||
}
|
||||
|
||||
public function shouldHide() {
|
||||
$old = $this->getOldValue();
|
||||
if (!strlen($old)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s updated the description for this credential.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s updated the description for credential %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
public function hasChangeDetailView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getMailDiffSectionHeader() {
|
||||
return pht('CHANGES TO CREDENTIAL DESCRIPTION');
|
||||
}
|
||||
|
||||
public function newChangeDetailView() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
return id(new PhabricatorApplicationTransactionTextDiffDetailView())
|
||||
->setViewer($viewer)
|
||||
->setOldText($this->getOldValue())
|
||||
->setNewText($this->getNewValue());
|
||||
}
|
||||
|
||||
public function newRemarkupChanges() {
|
||||
$changes = array();
|
||||
|
||||
$changes[] = $this->newRemarkupChange()
|
||||
->setOldValue($this->getOldValue())
|
||||
->setNewValue($this->getNewValue());
|
||||
|
||||
return $changes;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredentialDestroyTransaction
|
||||
extends PassphraseCredentialTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'passphrase:destroy';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getIsDestroyed();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$is_destroyed = $value;
|
||||
$object->setIsDestroyed($is_destroyed);
|
||||
if ($is_destroyed) {
|
||||
$secret_id = $object->getSecretID();
|
||||
if ($secret_id) {
|
||||
$this->destroySecret($secret_id);
|
||||
$object->setSecretID(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function shouldHide() {
|
||||
$new = $this->getNewValue();
|
||||
if (!$new) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s destroyed the secret for this credential.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s destroyed the secret for credential %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-ban';
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
return 'red';
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredentialLockTransaction
|
||||
extends PassphraseCredentialTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'passphrase:lock';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getIsLocked();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setIsLocked((int)$value);
|
||||
}
|
||||
|
||||
public function shouldHide() {
|
||||
$new = $this->getNewValue();
|
||||
if ($new === null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s locked this credential.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s locked credential %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-lock';
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredentialLookedAtTransaction
|
||||
extends PassphraseCredentialTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'passphrase:lookedAtSecret';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s examined the secret plaintext for this credential.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s examined the secret plaintext for credential %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-eye';
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
return 'blue';
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredentialNameTransaction
|
||||
extends PassphraseCredentialTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'passphrase:name';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getName();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setName($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$old = $this->getOldValue();
|
||||
if (!strlen($old)) {
|
||||
return pht(
|
||||
'%s created this credential.',
|
||||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s renamed this credential from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$old = $this->getOldValue();
|
||||
if (!strlen($old)) {
|
||||
return pht(
|
||||
'%s created %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
} else {
|
||||
return pht(
|
||||
'%s renamed %s credential %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
}
|
||||
|
||||
public function validateTransactions($object, array $xactions) {
|
||||
$errors = array();
|
||||
|
||||
if ($this->isEmptyTextTransaction($object->getName(), $xactions)) {
|
||||
$errors[] = $this->newRequiredError(
|
||||
pht('Credentials must have a name.'));
|
||||
}
|
||||
|
||||
$max_length = $object->getColumnMaximumByteLength('name');
|
||||
foreach ($xactions as $xaction) {
|
||||
$new_value = $xaction->getNewValue();
|
||||
|
||||
$new_length = strlen($new_value);
|
||||
if ($new_length > $max_length) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('The name can be no longer than %s characters.',
|
||||
new PhutilNumber($max_length)));
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredentialSecretIDTransaction
|
||||
extends PassphraseCredentialTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'passphrase:secretID';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getSecretID();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$old_id = $object->getSecretID();
|
||||
if ($old_id) {
|
||||
$this->destroySecret($old_id);
|
||||
}
|
||||
$object->setSecretID($value);
|
||||
}
|
||||
|
||||
public function shouldHide() {
|
||||
if (!$this->getOldValue()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$old = $this->getOldValue();
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s attached a new secret to this credential.',
|
||||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s updated the secret for this credential.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
$old = $this->getOldValue();
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s attached a new secret to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
} else {
|
||||
return pht(
|
||||
'%s updated the secret for %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
abstract class PassphraseCredentialTransactionType
|
||||
extends PhabricatorModularTransactionType {
|
||||
|
||||
public function destroySecret($secret_id) {
|
||||
$table = new PassphraseSecret();
|
||||
queryfx(
|
||||
$table->establishConnection('w'),
|
||||
'DELETE FROM %T WHERE id = %d',
|
||||
$table->getTableName(),
|
||||
$secret_id);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredentialUsernameTransaction
|
||||
extends PassphraseCredentialTransactionType {
|
||||
|
||||
const TRANSACTIONTYPE = 'passphrase:username';
|
||||
|
||||
public function generateOldValue($object) {
|
||||
return $object->getUsername();
|
||||
}
|
||||
|
||||
public function applyInternalEffects($object, $value) {
|
||||
$object->setUsername($value);
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
'%s set the username for this credential to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
return pht(
|
||||
'%s set the username for credential %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$this->renderNewValue());
|
||||
}
|
||||
|
||||
public function validateTransactions($object, array $xactions) {
|
||||
$errors = array();
|
||||
|
||||
$credential_type = $object->getImplementation();
|
||||
if ($credential_type->shouldRequireUsername()) {
|
||||
if ($this->isEmptyTextTransaction($object->getUsername(), $xactions)) {
|
||||
$errors[] = $this->newRequiredError(
|
||||
pht('This credential must have a username.'));
|
||||
}
|
||||
}
|
||||
|
||||
$max_length = $object->getColumnMaximumByteLength('username');
|
||||
foreach ($xactions as $xaction) {
|
||||
$new_value = $xaction->getNewValue();
|
||||
$new_length = strlen($new_value);
|
||||
if ($new_length > $max_length) {
|
||||
$errors[] = $this->newInvalidError(
|
||||
pht('The username can be no longer than %s characters.',
|
||||
new PhutilNumber($max_length)));
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
}
|
|
@ -150,7 +150,9 @@ final class PhabricatorMentionRemarkupRule extends PhutilRemarkupRule {
|
|||
$tag->addClass('phabricator-remarkup-mention-nopermission');
|
||||
}
|
||||
|
||||
if (!$user->isResponsive()) {
|
||||
if ($user->getIsDisabled()) {
|
||||
$tag->setDotColor(PHUITagView::COLOR_GREY);
|
||||
} else if (!$user->isResponsive()) {
|
||||
$tag->setDotColor(PHUITagView::COLOR_VIOLET);
|
||||
} else {
|
||||
if ($user->getAwayUntil()) {
|
||||
|
|
|
@ -61,7 +61,9 @@ final class PhabricatorPeopleUserPHIDType extends PhabricatorPHIDType {
|
|||
}
|
||||
|
||||
$availability = null;
|
||||
if (!$user->isResponsive()) {
|
||||
if ($user->getIsDisabled()) {
|
||||
$availability = PhabricatorObjectHandle::AVAILABILITY_DISABLED;
|
||||
} else if (!$user->isResponsive()) {
|
||||
$availability = PhabricatorObjectHandle::AVAILABILITY_NOEMAIL;
|
||||
} else {
|
||||
$until = $user->getAwayUntil();
|
||||
|
|
|
@ -32,7 +32,7 @@ final class PhameBlogArchiveController
|
|||
$xactions = array();
|
||||
|
||||
$xactions[] = id(new PhameBlogTransaction())
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_STATUS)
|
||||
->setTransactionType(PhameBlogStatusTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($new_status);
|
||||
|
||||
id(new PhameBlogEditor())
|
||||
|
|
|
@ -61,7 +61,7 @@ final class PhameBlogHeaderPictureController
|
|||
|
||||
$xactions = array();
|
||||
$xactions[] = id(new PhameBlogTransaction())
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_HEADERIMAGE)
|
||||
->setTransactionType(PhameBlogHeaderImageTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($new_value);
|
||||
|
||||
$editor = id(new PhameBlogEditor())
|
||||
|
|
|
@ -76,7 +76,8 @@ final class PhameBlogProfilePictureController
|
|||
|
||||
$xactions = array();
|
||||
$xactions[] = id(new PhameBlogTransaction())
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_PROFILEIMAGE)
|
||||
->setTransactionType(
|
||||
PhameBlogProfileImageTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($new_value);
|
||||
|
||||
$editor = id(new PhameBlogEditor())
|
||||
|
|
|
@ -26,7 +26,7 @@ final class PhamePostArchiveController extends PhamePostController {
|
|||
|
||||
$new_value = PhameConstants::VISIBILITY_ARCHIVED;
|
||||
$xactions[] = id(new PhamePostTransaction())
|
||||
->setTransactionType(PhamePostTransaction::TYPE_VISIBILITY)
|
||||
->setTransactionType(PhamePostVisibilityTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($new_value);
|
||||
|
||||
id(new PhamePostEditor())
|
||||
|
|
|
@ -61,7 +61,7 @@ final class PhamePostHeaderPictureController
|
|||
|
||||
$xactions = array();
|
||||
$xactions[] = id(new PhamePostTransaction())
|
||||
->setTransactionType(PhamePostTransaction::TYPE_HEADERIMAGE)
|
||||
->setTransactionType(PhamePostHeaderImageTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($new_value);
|
||||
|
||||
$editor = id(new PhamePostEditor())
|
||||
|
|
|
@ -28,7 +28,7 @@ final class PhamePostMoveController extends PhamePostController {
|
|||
|
||||
$xactions = array();
|
||||
$xactions[] = id(new PhamePostTransaction())
|
||||
->setTransactionType(PhamePostTransaction::TYPE_BLOG)
|
||||
->setTransactionType(PhamePostBlogTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($v_blog);
|
||||
|
||||
$editor = id(new PhamePostEditor())
|
||||
|
|
|
@ -34,7 +34,7 @@ final class PhamePostPublishController extends PhamePostController {
|
|||
}
|
||||
|
||||
$xactions[] = id(new PhamePostTransaction())
|
||||
->setTransactionType(PhamePostTransaction::TYPE_VISIBILITY)
|
||||
->setTransactionType(PhamePostVisibilityTransaction::TRANSACTIONTYPE)
|
||||
->setNewValue($new_value);
|
||||
|
||||
id(new PhamePostEditor())
|
||||
|
|
|
@ -75,7 +75,7 @@ final class PhameBlogEditEngine
|
|||
->setDescription(pht('Blog name.'))
|
||||
->setConduitDescription(pht('Retitle the blog.'))
|
||||
->setConduitTypeDescription(pht('New blog title.'))
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_NAME)
|
||||
->setTransactionType(PhameBlogNameTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getName()),
|
||||
id(new PhabricatorTextEditField())
|
||||
->setKey('subtitle')
|
||||
|
@ -83,7 +83,7 @@ final class PhameBlogEditEngine
|
|||
->setDescription(pht('Blog subtitle.'))
|
||||
->setConduitDescription(pht('Change the blog subtitle.'))
|
||||
->setConduitTypeDescription(pht('New blog subtitle.'))
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_SUBTITLE)
|
||||
->setTransactionType(PhameBlogSubtitleTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getSubtitle()),
|
||||
id(new PhabricatorRemarkupEditField())
|
||||
->setKey('description')
|
||||
|
@ -91,7 +91,7 @@ final class PhameBlogEditEngine
|
|||
->setDescription(pht('Blog description.'))
|
||||
->setConduitDescription(pht('Change the blog description.'))
|
||||
->setConduitTypeDescription(pht('New blog description.'))
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_DESCRIPTION)
|
||||
->setTransactionType(PhameBlogDescriptionTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getDescription()),
|
||||
id(new PhabricatorTextEditField())
|
||||
->setKey('domainFullURI')
|
||||
|
@ -104,7 +104,7 @@ final class PhameBlogEditEngine
|
|||
->setConduitDescription(pht('Change the blog full domain URI.'))
|
||||
->setConduitTypeDescription(pht('New blog full domain URI.'))
|
||||
->setValue($object->getDomainFullURI())
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_FULLDOMAIN),
|
||||
->setTransactionType(PhameBlogFullDomainTransaction::TRANSACTIONTYPE),
|
||||
id(new PhabricatorTextEditField())
|
||||
->setKey('parentSite')
|
||||
->setLabel(pht('Parent Site Name'))
|
||||
|
@ -112,7 +112,7 @@ final class PhameBlogEditEngine
|
|||
->setConduitDescription(pht('Change the blog parent site name.'))
|
||||
->setConduitTypeDescription(pht('New blog parent site name.'))
|
||||
->setValue($object->getParentSite())
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_PARENTSITE),
|
||||
->setTransactionType(PhameBlogParentSiteTransaction::TRANSACTIONTYPE),
|
||||
id(new PhabricatorTextEditField())
|
||||
->setKey('parentDomain')
|
||||
->setLabel(pht('Parent Site URI'))
|
||||
|
@ -120,11 +120,11 @@ final class PhameBlogEditEngine
|
|||
->setConduitDescription(pht('Change the blog parent domain.'))
|
||||
->setConduitTypeDescription(pht('New blog parent domain.'))
|
||||
->setValue($object->getParentDomain())
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_PARENTDOMAIN),
|
||||
->setTransactionType(PhameBlogParentDomainTransaction::TRANSACTIONTYPE),
|
||||
id(new PhabricatorSelectEditField())
|
||||
->setKey('status')
|
||||
->setLabel(pht('Status'))
|
||||
->setTransactionType(PhameBlogTransaction::TYPE_STATUS)
|
||||
->setTransactionType(PhameBlogStatusTransaction::TRANSACTIONTYPE)
|
||||
->setIsConduitOnly(true)
|
||||
->setOptions(PhameBlog::getStatusNameMap())
|
||||
->setDescription(pht('Active or archived status.'))
|
||||
|
|
|
@ -11,251 +11,22 @@ final class PhameBlogEditor
|
|||
return pht('Phame Blogs');
|
||||
}
|
||||
|
||||
public function getCreateObjectTitle($author, $object) {
|
||||
return pht('%s created this blog.', $author);
|
||||
}
|
||||
|
||||
public function getCreateObjectTitleForFeed($author, $object) {
|
||||
return pht('%s created %s.', $author, $object);
|
||||
}
|
||||
|
||||
public function getTransactionTypes() {
|
||||
$types = parent::getTransactionTypes();
|
||||
|
||||
$types[] = PhameBlogTransaction::TYPE_NAME;
|
||||
$types[] = PhameBlogTransaction::TYPE_SUBTITLE;
|
||||
$types[] = PhameBlogTransaction::TYPE_DESCRIPTION;
|
||||
$types[] = PhameBlogTransaction::TYPE_FULLDOMAIN;
|
||||
$types[] = PhameBlogTransaction::TYPE_PARENTSITE;
|
||||
$types[] = PhameBlogTransaction::TYPE_PARENTDOMAIN;
|
||||
$types[] = PhameBlogTransaction::TYPE_STATUS;
|
||||
$types[] = PhameBlogTransaction::TYPE_HEADERIMAGE;
|
||||
$types[] = PhameBlogTransaction::TYPE_PROFILEIMAGE;
|
||||
|
||||
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
|
||||
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
protected function getCustomTransactionOldValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhameBlogTransaction::TYPE_NAME:
|
||||
return $object->getName();
|
||||
case PhameBlogTransaction::TYPE_SUBTITLE:
|
||||
return $object->getSubtitle();
|
||||
case PhameBlogTransaction::TYPE_DESCRIPTION:
|
||||
return $object->getDescription();
|
||||
case PhameBlogTransaction::TYPE_FULLDOMAIN:
|
||||
return $object->getDomainFullURI();
|
||||
case PhameBlogTransaction::TYPE_PARENTSITE:
|
||||
return $object->getParentSite();
|
||||
case PhameBlogTransaction::TYPE_PARENTDOMAIN:
|
||||
return $object->getParentDomain();
|
||||
case PhameBlogTransaction::TYPE_PROFILEIMAGE:
|
||||
return $object->getProfileImagePHID();
|
||||
case PhameBlogTransaction::TYPE_HEADERIMAGE:
|
||||
return $object->getHeaderImagePHID();
|
||||
case PhameBlogTransaction::TYPE_STATUS:
|
||||
return $object->getStatus();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getCustomTransactionNewValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhameBlogTransaction::TYPE_NAME:
|
||||
case PhameBlogTransaction::TYPE_SUBTITLE:
|
||||
case PhameBlogTransaction::TYPE_DESCRIPTION:
|
||||
case PhameBlogTransaction::TYPE_STATUS:
|
||||
case PhameBlogTransaction::TYPE_PARENTSITE:
|
||||
case PhameBlogTransaction::TYPE_PARENTDOMAIN:
|
||||
case PhameBlogTransaction::TYPE_PROFILEIMAGE:
|
||||
case PhameBlogTransaction::TYPE_HEADERIMAGE:
|
||||
return $xaction->getNewValue();
|
||||
case PhameBlogTransaction::TYPE_FULLDOMAIN:
|
||||
$domain = $xaction->getNewValue();
|
||||
if (!strlen($xaction->getNewValue())) {
|
||||
return null;
|
||||
}
|
||||
return $domain;
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyCustomInternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhameBlogTransaction::TYPE_NAME:
|
||||
return $object->setName($xaction->getNewValue());
|
||||
case PhameBlogTransaction::TYPE_SUBTITLE:
|
||||
return $object->setSubtitle($xaction->getNewValue());
|
||||
case PhameBlogTransaction::TYPE_DESCRIPTION:
|
||||
return $object->setDescription($xaction->getNewValue());
|
||||
case PhameBlogTransaction::TYPE_FULLDOMAIN:
|
||||
$new_value = $xaction->getNewValue();
|
||||
if (strlen($new_value)) {
|
||||
$uri = new PhutilURI($new_value);
|
||||
$domain = $uri->getDomain();
|
||||
$object->setDomain($domain);
|
||||
} else {
|
||||
$object->setDomain(null);
|
||||
}
|
||||
$object->setDomainFullURI($new_value);
|
||||
return;
|
||||
case PhameBlogTransaction::TYPE_PROFILEIMAGE:
|
||||
return $object->setProfileImagePHID($xaction->getNewValue());
|
||||
case PhameBlogTransaction::TYPE_HEADERIMAGE:
|
||||
return $object->setHeaderImagePHID($xaction->getNewValue());
|
||||
case PhameBlogTransaction::TYPE_STATUS:
|
||||
return $object->setStatus($xaction->getNewValue());
|
||||
case PhameBlogTransaction::TYPE_PARENTSITE:
|
||||
return $object->setParentSite($xaction->getNewValue());
|
||||
case PhameBlogTransaction::TYPE_PARENTDOMAIN:
|
||||
return $object->setParentDomain($xaction->getNewValue());
|
||||
}
|
||||
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyCustomExternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhameBlogTransaction::TYPE_NAME:
|
||||
case PhameBlogTransaction::TYPE_SUBTITLE:
|
||||
case PhameBlogTransaction::TYPE_DESCRIPTION:
|
||||
case PhameBlogTransaction::TYPE_FULLDOMAIN:
|
||||
case PhameBlogTransaction::TYPE_PARENTSITE:
|
||||
case PhameBlogTransaction::TYPE_PARENTDOMAIN:
|
||||
case PhameBlogTransaction::TYPE_HEADERIMAGE:
|
||||
case PhameBlogTransaction::TYPE_PROFILEIMAGE:
|
||||
case PhameBlogTransaction::TYPE_STATUS:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function validateTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
$type,
|
||||
array $xactions) {
|
||||
|
||||
$errors = parent::validateTransaction($object, $type, $xactions);
|
||||
|
||||
|
||||
switch ($type) {
|
||||
case PhameBlogTransaction::TYPE_NAME:
|
||||
$missing = $this->validateIsEmptyTextField(
|
||||
$object->getName(),
|
||||
$xactions);
|
||||
|
||||
if ($missing) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Required'),
|
||||
pht('Name is required.'),
|
||||
nonempty(last($xactions), null));
|
||||
|
||||
$error->setIsMissingFieldError(true);
|
||||
$errors[] = $error;
|
||||
}
|
||||
|
||||
foreach ($xactions as $xaction) {
|
||||
$new = $xaction->getNewValue();
|
||||
if (phutil_utf8_strlen($new) > 64) {
|
||||
$errors[] = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Invalid'),
|
||||
pht(
|
||||
'The selected blog title is too long. The maximum length '.
|
||||
'of a blog title is 64 characters.'),
|
||||
$xaction);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PhameBlogTransaction::TYPE_SUBTITLE:
|
||||
foreach ($xactions as $xaction) {
|
||||
$new = $xaction->getNewValue();
|
||||
if (phutil_utf8_strlen($new) > 64) {
|
||||
$errors[] = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Invalid'),
|
||||
pht(
|
||||
'The selected blog subtitle is too long. The maximum length '.
|
||||
'of a blog subtitle is 64 characters.'),
|
||||
$xaction);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PhameBlogTransaction::TYPE_PARENTDOMAIN:
|
||||
if (!$xactions) {
|
||||
continue;
|
||||
}
|
||||
$parent_domain = last($xactions)->getNewValue();
|
||||
if (empty($parent_domain)) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
PhabricatorEnv::requireValidRemoteURIForLink($parent_domain);
|
||||
} catch (Exception $ex) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Invalid URI'),
|
||||
pht('Parent Domain must be set to a valid Remote URI.'),
|
||||
nonempty(last($xactions), null));
|
||||
$errors[] = $error;
|
||||
}
|
||||
break;
|
||||
case PhameBlogTransaction::TYPE_FULLDOMAIN:
|
||||
if (!$xactions) {
|
||||
continue;
|
||||
}
|
||||
$custom_domain = last($xactions)->getNewValue();
|
||||
if (empty($custom_domain)) {
|
||||
continue;
|
||||
}
|
||||
list($error_label, $error_text) =
|
||||
$object->validateCustomDomain($custom_domain);
|
||||
if ($error_label) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
$error_label,
|
||||
$error_text,
|
||||
nonempty(last($xactions), null));
|
||||
$errors[] = $error;
|
||||
}
|
||||
if ($object->getViewPolicy() != PhabricatorPolicies::POLICY_PUBLIC) {
|
||||
$error_text = pht(
|
||||
'For custom domains to work, the blog must have a view policy of '.
|
||||
'public.');
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
PhabricatorTransactions::TYPE_VIEW_POLICY,
|
||||
pht('Invalid Policy'),
|
||||
$error_text,
|
||||
nonempty(last($xactions), null));
|
||||
$errors[] = $error;
|
||||
}
|
||||
$domain = new PhutilURI($custom_domain);
|
||||
$domain = $domain->getDomain();
|
||||
$duplicate_blog = id(new PhameBlogQuery())
|
||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||
->withDomain($domain)
|
||||
->executeOne();
|
||||
if ($duplicate_blog && $duplicate_blog->getID() != $object->getID()) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Not Unique'),
|
||||
pht('Domain must be unique; another blog already has this domain.'),
|
||||
nonempty(last($xactions), null));
|
||||
$errors[] = $error;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
|
|
|
@ -84,7 +84,7 @@ final class PhamePostEditEngine
|
|||
pht('Choose a blog to create a post on (or move a post to).'))
|
||||
->setConduitTypeDescription(pht('PHID of the blog.'))
|
||||
->setAliases(array('blogPHID'))
|
||||
->setTransactionType(PhamePostTransaction::TYPE_BLOG)
|
||||
->setTransactionType(PhamePostBlogTransaction::TRANSACTIONTYPE)
|
||||
->setHandleParameterType(new AphrontPHIDListHTTPParameterType())
|
||||
->setSingleValue($blog_phid)
|
||||
->setIsReorderable(false)
|
||||
|
@ -97,7 +97,7 @@ final class PhamePostEditEngine
|
|||
->setDescription(pht('Post title.'))
|
||||
->setConduitDescription(pht('Retitle the post.'))
|
||||
->setConduitTypeDescription(pht('New post title.'))
|
||||
->setTransactionType(PhamePostTransaction::TYPE_TITLE)
|
||||
->setTransactionType(PhamePostTitleTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getTitle()),
|
||||
id(new PhabricatorTextEditField())
|
||||
->setKey('subtitle')
|
||||
|
@ -105,7 +105,7 @@ final class PhamePostEditEngine
|
|||
->setDescription(pht('Post subtitle.'))
|
||||
->setConduitDescription(pht('Change the post subtitle.'))
|
||||
->setConduitTypeDescription(pht('New post subtitle.'))
|
||||
->setTransactionType(PhamePostTransaction::TYPE_SUBTITLE)
|
||||
->setTransactionType(PhamePostSubtitleTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getSubtitle()),
|
||||
id(new PhabricatorSelectEditField())
|
||||
->setKey('visibility')
|
||||
|
@ -113,7 +113,7 @@ final class PhamePostEditEngine
|
|||
->setDescription(pht('Post visibility.'))
|
||||
->setConduitDescription(pht('Change post visibility.'))
|
||||
->setConduitTypeDescription(pht('New post visibility constant.'))
|
||||
->setTransactionType(PhamePostTransaction::TYPE_VISIBILITY)
|
||||
->setTransactionType(PhamePostVisibilityTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getVisibility())
|
||||
->setOptions(PhameConstants::getPhamePostStatusMap()),
|
||||
id(new PhabricatorRemarkupEditField())
|
||||
|
@ -122,7 +122,7 @@ final class PhamePostEditEngine
|
|||
->setDescription(pht('Post body.'))
|
||||
->setConduitDescription(pht('Change post body.'))
|
||||
->setConduitTypeDescription(pht('New post body.'))
|
||||
->setTransactionType(PhamePostTransaction::TYPE_BODY)
|
||||
->setTransactionType(PhamePostBodyTransaction::TRANSACTIONTYPE)
|
||||
->setValue($object->getBody())
|
||||
->setPreviewPanel(
|
||||
id(new PHUIRemarkupPreviewPanel())
|
||||
|
|
|
@ -11,177 +11,21 @@ final class PhamePostEditor
|
|||
return pht('Phame Posts');
|
||||
}
|
||||
|
||||
public function getCreateObjectTitle($author, $object) {
|
||||
return pht('%s created this post.', $author);
|
||||
}
|
||||
|
||||
public function getCreateObjectTitleForFeed($author, $object) {
|
||||
return pht('%s created %s.', $author, $object);
|
||||
}
|
||||
|
||||
public function getTransactionTypes() {
|
||||
$types = parent::getTransactionTypes();
|
||||
|
||||
$types[] = PhamePostTransaction::TYPE_BLOG;
|
||||
$types[] = PhamePostTransaction::TYPE_TITLE;
|
||||
$types[] = PhamePostTransaction::TYPE_SUBTITLE;
|
||||
$types[] = PhamePostTransaction::TYPE_BODY;
|
||||
$types[] = PhamePostTransaction::TYPE_VISIBILITY;
|
||||
$types[] = PhamePostTransaction::TYPE_HEADERIMAGE;
|
||||
$types[] = PhabricatorTransactions::TYPE_COMMENT;
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
protected function getCustomTransactionOldValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhamePostTransaction::TYPE_BLOG:
|
||||
return $object->getBlogPHID();
|
||||
case PhamePostTransaction::TYPE_TITLE:
|
||||
return $object->getTitle();
|
||||
case PhamePostTransaction::TYPE_SUBTITLE:
|
||||
return $object->getSubtitle();
|
||||
case PhamePostTransaction::TYPE_BODY:
|
||||
return $object->getBody();
|
||||
case PhamePostTransaction::TYPE_VISIBILITY:
|
||||
return $object->getVisibility();
|
||||
case PhamePostTransaction::TYPE_HEADERIMAGE:
|
||||
return $object->getHeaderImagePHID();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getCustomTransactionNewValue(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhamePostTransaction::TYPE_TITLE:
|
||||
case PhamePostTransaction::TYPE_SUBTITLE:
|
||||
case PhamePostTransaction::TYPE_BODY:
|
||||
case PhamePostTransaction::TYPE_VISIBILITY:
|
||||
case PhamePostTransaction::TYPE_HEADERIMAGE:
|
||||
case PhamePostTransaction::TYPE_BLOG:
|
||||
return $xaction->getNewValue();
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyCustomInternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhamePostTransaction::TYPE_TITLE:
|
||||
return $object->setTitle($xaction->getNewValue());
|
||||
case PhamePostTransaction::TYPE_SUBTITLE:
|
||||
return $object->setSubtitle($xaction->getNewValue());
|
||||
case PhamePostTransaction::TYPE_BODY:
|
||||
return $object->setBody($xaction->getNewValue());
|
||||
case PhamePostTransaction::TYPE_BLOG:
|
||||
return $object->setBlogPHID($xaction->getNewValue());
|
||||
case PhamePostTransaction::TYPE_HEADERIMAGE:
|
||||
return $object->setHeaderImagePHID($xaction->getNewValue());
|
||||
case PhamePostTransaction::TYPE_VISIBILITY:
|
||||
if ($xaction->getNewValue() == PhameConstants::VISIBILITY_DRAFT) {
|
||||
$object->setDatePublished(0);
|
||||
} else if ($xaction->getNewValue() ==
|
||||
PhameConstants::VISIBILITY_ARCHIVED) {
|
||||
$object->setDatePublished(0);
|
||||
} else {
|
||||
$object->setDatePublished(PhabricatorTime::getNow());
|
||||
}
|
||||
return $object->setVisibility($xaction->getNewValue());
|
||||
}
|
||||
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyCustomExternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhamePostTransaction::TYPE_TITLE:
|
||||
case PhamePostTransaction::TYPE_SUBTITLE:
|
||||
case PhamePostTransaction::TYPE_BODY:
|
||||
case PhamePostTransaction::TYPE_VISIBILITY:
|
||||
case PhamePostTransaction::TYPE_HEADERIMAGE:
|
||||
case PhamePostTransaction::TYPE_BLOG:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function validateTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
$type,
|
||||
array $xactions) {
|
||||
|
||||
$errors = parent::validateTransaction($object, $type, $xactions);
|
||||
|
||||
switch ($type) {
|
||||
case PhamePostTransaction::TYPE_TITLE:
|
||||
$missing = $this->validateIsEmptyTextField(
|
||||
$object->getTitle(),
|
||||
$xactions);
|
||||
|
||||
if ($missing) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Required'),
|
||||
pht('Title is required.'),
|
||||
nonempty(last($xactions), null));
|
||||
|
||||
$error->setIsMissingFieldError(true);
|
||||
$errors[] = $error;
|
||||
}
|
||||
break;
|
||||
case PhamePostTransaction::TYPE_BLOG:
|
||||
if ($this->getIsNewObject()) {
|
||||
if (!$xactions) {
|
||||
$error = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Required'),
|
||||
pht(
|
||||
'When creating a post, you must specify which blog it '.
|
||||
'should belong to.'),
|
||||
null);
|
||||
|
||||
$error->setIsMissingFieldError(true);
|
||||
|
||||
$errors[] = $error;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($xactions as $xaction) {
|
||||
$new_phid = $xaction->getNewValue();
|
||||
|
||||
$blog = id(new PhameBlogQuery())
|
||||
->setViewer($this->getActor())
|
||||
->withPHIDs(array($new_phid))
|
||||
->requireCapabilities(
|
||||
array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
PhabricatorPolicyCapability::CAN_EDIT,
|
||||
))
|
||||
->execute();
|
||||
|
||||
if ($blog) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$errors[] = new PhabricatorApplicationTransactionValidationError(
|
||||
$type,
|
||||
pht('Invalid'),
|
||||
pht(
|
||||
'The specified blog PHID ("%s") is not valid. You can only '.
|
||||
'create a post on (or move a post into) a blog which you '.
|
||||
'have permission to see and edit.',
|
||||
$new_phid),
|
||||
$xaction);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue