1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Nuance - get some scaffolding up there

Summary:
I updated the wiki too - https://secure.phabricator.com/w/projects/pebkac/ - with what I am thinking right now. Rough plan here is

 - next diff:
  - implement editors and transactions
  - implement "web type" for contact source
   - /pebkac/item/new/ will be the entry point for this
  - implement "actions" on a contact
  - probably some "polish" on the scaffolding laid out here; like "create" permissions maybs
 - diffs after that:
  - implement "twitter" type for source
  - implement email reply handler stuff for item and source

Probs a great time to blast huge holes in all this stuff. :D

Test Plan: these pages load and arc lint doesn't complain

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran, chad

Differential Revision: https://secure.phabricator.com/D7465
This commit is contained in:
Bob Trahan 2013-11-06 17:00:09 -08:00
parent 09be177376
commit 66ae64f7bc
65 changed files with 1809 additions and 49 deletions

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -581,6 +581,26 @@
"rule" : ".apps-new-white-large",
"hash" : "be597ce11c4d1630f67282cd7b81cc85"
},
"apps-nuance-blue-large" : {
"name" : "apps-nuance-blue-large",
"rule" : ".apps-nuance-blue-large, .phabricator-crumb-view:hover .apps-nuance-dark-large",
"hash" : "a6c11b6c091b15c93bb75e40f5014c46"
},
"apps-nuance-dark-large" : {
"name" : "apps-nuance-dark-large",
"rule" : ".apps-nuance-dark-large",
"hash" : "a179a6802048440f0c4dfd99784ad740"
},
"apps-nuance-light-large" : {
"name" : "apps-nuance-light-large",
"rule" : ".apps-nuance-light-large",
"hash" : "f6f36066f33b015e0e44e125182db158"
},
"apps-nuance-white-large" : {
"name" : "apps-nuance-white-large",
"rule" : ".apps-nuance-white-large",
"hash" : "8510afe6941a33000ca02a054a3f78e0"
},
"apps-owners-blue-large" : {
"name" : "apps-owners-blue-large",
"rule" : ".apps-owners-blue-large, .phabricator-crumb-view:hover .apps-owners-dark-large",
@ -621,26 +641,6 @@
"rule" : ".apps-paste-white-large",
"hash" : "94cf3ee0f2b15b82ad8f62cb9399ecad"
},
"apps-pebkac-blue-large" : {
"name" : "apps-pebkac-blue-large",
"rule" : ".apps-pebkac-blue-large, .phabricator-crumb-view:hover .apps-pebkac-dark-large",
"hash" : "7a1010119d4589609f364c603cd03d1b"
},
"apps-pebkac-dark-large" : {
"name" : "apps-pebkac-dark-large",
"rule" : ".apps-pebkac-dark-large",
"hash" : "617142b451eec10fe60246eec52a99d0"
},
"apps-pebkac-light-large" : {
"name" : "apps-pebkac-light-large",
"rule" : ".apps-pebkac-light-large",
"hash" : "2319b657d0fe3df60b234e8961c4869e"
},
"apps-pebkac-white-large" : {
"name" : "apps-pebkac-white-large",
"rule" : ".apps-pebkac-white-large",
"hash" : "25eb13ac78cf507b6ec66016cd477cfe"
},
"apps-people-blue-large" : {
"name" : "apps-people-blue-large",
"rule" : ".apps-people-blue-large, .phabricator-crumb-view:hover .apps-people-dark-large",

View file

@ -291,6 +291,16 @@
"rule" : ".apps-new-white",
"hash" : "dc5ce42c7d60e6ba37b07631b3c3280a"
},
"apps-nuance-dark" : {
"name" : "apps-nuance-dark",
"rule" : ".apps-nuance-dark",
"hash" : "e20c19670e1c9b9d1f9267bf7f017aba"
},
"apps-nuance-white" : {
"name" : "apps-nuance-white",
"rule" : ".apps-nuance-white",
"hash" : "368f1241b438492642520a037a1ac294"
},
"apps-owners-dark" : {
"name" : "apps-owners-dark",
"rule" : ".apps-owners-dark",
@ -311,16 +321,6 @@
"rule" : ".apps-paste-white",
"hash" : "ed5ec1ee39cc2a01f568f91c72141bfb"
},
"apps-pebkac-dark" : {
"name" : "apps-pebkac-dark",
"rule" : ".apps-pebkac-dark",
"hash" : "4adb4a8f0a8c5bc5462bb806ceafc63f"
},
"apps-pebkac-white" : {
"name" : "apps-pebkac-white",
"rule" : ".apps-pebkac-white",
"hash" : "35438c7a295df21aa2fa4771a5c3c986"
},
"apps-people-dark" : {
"name" : "apps-people-dark",
"rule" : ".apps-people-dark",

View file

@ -0,0 +1,259 @@
CREATE TABLE {$NAMESPACE}_nuance.nuance_item (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
ownerPHID VARCHAR(64) COLLATE utf8_bin,
requestorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
sourcePHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
sourceLabel VARCHAR(255),
status INT UNSIGNED NOT NULL,
data longtext NOT NULL COLLATE utf8_bin,
mailKey VARCHAR(20) NOT NULL COLLATE utf8_bin,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
dateNuanced INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
KEY `key_source` (sourcePHID, status, dateNuanced, id),
KEY `key_owner` (ownerPHID, status, dateNuanced, id),
KEY `key_contacter` (requestorPHID, status, dateNuanced, id)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_itemtransaction (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
commentPHID VARCHAR(64) COLLATE utf8_bin,
commentVersion INT UNSIGNED NOT NULL,
transactionType VARCHAR(32) NOT NULL COLLATE utf8_bin,
oldValue LONGTEXT NOT NULL COLLATE utf8_bin,
newValue LONGTEXT NOT NULL COLLATE utf8_bin,
contentSource LONGTEXT NOT NULL COLLATE utf8_bin,
metadata LONGTEXT NOT NULL COLLATE utf8_bin,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
KEY `key_object` (objectPHID)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_itemtransaction_comment (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
transactionPHID VARCHAR(64) COLLATE utf8_bin,
authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
commentVersion INT UNSIGNED NOT NULL,
content LONGTEXT NOT NULL COLLATE utf8_bin,
contentSource LONGTEXT NOT NULL COLLATE utf8_bin,
isDeleted BOOL NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
UNIQUE KEY `key_version` (transactionPHID, commentVersion)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_source (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
name VARCHAR(255),
type INT UNSIGNED NOT NULL,
data longtext NOT NULL COLLATE utf8_bin,
mailKey VARCHAR(20) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL,
editPolicy VARCHAR(64) NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
KEY `key_type` (type, dateModified)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_sourcetransaction (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
commentPHID VARCHAR(64) COLLATE utf8_bin,
commentVersion INT UNSIGNED NOT NULL,
transactionType VARCHAR(32) NOT NULL COLLATE utf8_bin,
oldValue LONGTEXT NOT NULL COLLATE utf8_bin,
newValue LONGTEXT NOT NULL COLLATE utf8_bin,
contentSource LONGTEXT NOT NULL COLLATE utf8_bin,
metadata LONGTEXT NOT NULL COLLATE utf8_bin,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
KEY `key_object` (objectPHID)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_sourcetransaction_comment (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
transactionPHID VARCHAR(64) COLLATE utf8_bin,
authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
commentVersion INT UNSIGNED NOT NULL,
content LONGTEXT NOT NULL COLLATE utf8_bin,
contentSource LONGTEXT NOT NULL COLLATE utf8_bin,
isDeleted BOOL NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
UNIQUE KEY `key_version` (transactionPHID, commentVersion)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_queue (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
name VARCHAR(255),
mailKey VARCHAR(20) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL,
editPolicy VARCHAR(64) NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_queuetransaction (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
commentPHID VARCHAR(64) COLLATE utf8_bin,
commentVersion INT UNSIGNED NOT NULL,
transactionType VARCHAR(32) NOT NULL COLLATE utf8_bin,
oldValue LONGTEXT NOT NULL COLLATE utf8_bin,
newValue LONGTEXT NOT NULL COLLATE utf8_bin,
contentSource LONGTEXT NOT NULL COLLATE utf8_bin,
metadata LONGTEXT NOT NULL COLLATE utf8_bin,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
KEY `key_object` (objectPHID)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_queuetransaction_comment (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
transactionPHID VARCHAR(64) COLLATE utf8_bin,
authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
commentVersion INT UNSIGNED NOT NULL,
content LONGTEXT NOT NULL COLLATE utf8_bin,
contentSource LONGTEXT NOT NULL COLLATE utf8_bin,
isDeleted BOOL NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
UNIQUE KEY `key_version` (transactionPHID, commentVersion)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_queueitem (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
queuePHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
itemPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
itemStatus INT UNSIGNED NOT NULL,
itemDateNuanced INT UNSIGNED NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_one_per_queue` (itemPHID, queuePHID),
KEY `key_queue` (queuePHID, itemStatus, itemDateNuanced, id)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_requestor (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
data longtext NOT NULL COLLATE utf8_bin,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_requestortransaction (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
commentPHID VARCHAR(64) COLLATE utf8_bin,
commentVersion INT UNSIGNED NOT NULL,
transactionType VARCHAR(32) NOT NULL COLLATE utf8_bin,
oldValue LONGTEXT NOT NULL COLLATE utf8_bin,
newValue LONGTEXT NOT NULL COLLATE utf8_bin,
contentSource LONGTEXT NOT NULL COLLATE utf8_bin,
metadata LONGTEXT NOT NULL COLLATE utf8_bin,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
KEY `key_object` (objectPHID)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_requestortransaction_comment (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) NOT NULL COLLATE utf8_bin,
transactionPHID VARCHAR(64) COLLATE utf8_bin,
authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin,
commentVersion INT UNSIGNED NOT NULL,
content LONGTEXT NOT NULL COLLATE utf8_bin,
contentSource LONGTEXT NOT NULL COLLATE utf8_bin,
isDeleted BOOL NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
UNIQUE KEY `key_phid` (phid),
UNIQUE KEY `key_version` (transactionPHID, commentVersion)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.nuance_requestorsource (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
requestorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
sourcePHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
sourceKey VARCHAR(128) NOT NULL COLLATE utf8_bin,
data LONGTEXT NOT NULL COLLATE utf8_bin,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
KEY `key_requestor` (requestorPHID, id),
KEY `key_source` (sourcePHID, id),
UNIQUE KEY `key_source_key` (sourcePHID, sourceKey)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.edge (
src VARCHAR(64) NOT NULL COLLATE utf8_bin,
type VARCHAR(64) NOT NULL COLLATE utf8_bin,
dst VARCHAR(64) NOT NULL COLLATE utf8_bin,
dateCreated INT UNSIGNED NOT NULL,
seq INT UNSIGNED NOT NULL,
dataID INT UNSIGNED,
PRIMARY KEY (src, type, dst),
KEY (src, type, dateCreated, seq)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_nuance.edgedata (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
data LONGTEXT NOT NULL COLLATE utf8_bin
) ENGINE=InnoDB, COLLATE utf8_general_ci;

View file

@ -830,6 +830,48 @@ phutil_register_library_map(array(
'MetaMTAConstants' => 'applications/metamta/constants/MetaMTAConstants.php',
'MetaMTANotificationType' => 'applications/metamta/constants/MetaMTANotificationType.php',
'MetaMTAReceivedMailStatus' => 'applications/metamta/constants/MetaMTAReceivedMailStatus.php',
'NuanceController' => 'applications/nuance/controller/NuanceController.php',
'NuanceDAO' => 'applications/nuance/storage/NuanceDAO.php',
'NuanceItem' => 'applications/nuance/storage/NuanceItem.php',
'NuanceItemEditController' => 'applications/nuance/controller/NuanceItemEditController.php',
'NuanceItemEditor' => 'applications/nuance/editor/NuanceItemEditor.php',
'NuanceItemQuery' => 'applications/nuance/query/NuanceItemQuery.php',
'NuanceItemTransaction' => 'applications/nuance/storage/NuanceItemTransaction.php',
'NuanceItemTransactionComment' => 'applications/nuance/storage/NuanceItemTransactionComment.php',
'NuanceItemTransactionQuery' => 'applications/nuance/query/NuanceItemTransactionQuery.php',
'NuanceItemViewController' => 'applications/nuance/controller/NuanceItemViewController.php',
'NuancePHIDTypeItem' => 'applications/nuance/phid/NuancePHIDTypeItem.php',
'NuancePHIDTypeQueue' => 'applications/nuance/phid/NuancePHIDTypeQueue.php',
'NuancePHIDTypeRequestor' => 'applications/nuance/phid/NuancePHIDTypeRequestor.php',
'NuancePHIDTypeSource' => 'applications/nuance/phid/NuancePHIDTypeSource.php',
'NuanceQuery' => 'applications/nuance/query/NuanceQuery.php',
'NuanceQueue' => 'applications/nuance/storage/NuanceQueue.php',
'NuanceQueueEditController' => 'applications/nuance/controller/NuanceQueueEditController.php',
'NuanceQueueEditor' => 'applications/nuance/editor/NuanceQueueEditor.php',
'NuanceQueueItem' => 'applications/nuance/storage/NuanceQueueItem.php',
'NuanceQueueQuery' => 'applications/nuance/query/NuanceQueueQuery.php',
'NuanceQueueTransaction' => 'applications/nuance/storage/NuanceQueueTransaction.php',
'NuanceQueueTransactionComment' => 'applications/nuance/storage/NuanceQueueTransactionComment.php',
'NuanceQueueTransactionQuery' => 'applications/nuance/query/NuanceQueueTransactionQuery.php',
'NuanceQueueViewController' => 'applications/nuance/controller/NuanceQueueViewController.php',
'NuanceRequestor' => 'applications/nuance/storage/NuanceRequestor.php',
'NuanceRequestorEditController' => 'applications/nuance/controller/NuanceRequestorEditController.php',
'NuanceRequestorEditor' => 'applications/nuance/editor/NuanceRequestorEditor.php',
'NuanceRequestorQuery' => 'applications/nuance/query/NuanceRequestorQuery.php',
'NuanceRequestorSource' => 'applications/nuance/storage/NuanceRequestorSource.php',
'NuanceRequestorTransaction' => 'applications/nuance/storage/NuanceRequestorTransaction.php',
'NuanceRequestorTransactionComment' => 'applications/nuance/storage/NuanceRequestorTransactionComment.php',
'NuanceRequestorTransactionQuery' => 'applications/nuance/query/NuanceRequestorTransactionQuery.php',
'NuanceRequestorViewController' => 'applications/nuance/controller/NuanceRequestorViewController.php',
'NuanceSource' => 'applications/nuance/storage/NuanceSource.php',
'NuanceSourceEditController' => 'applications/nuance/controller/NuanceSourceEditController.php',
'NuanceSourceEditor' => 'applications/nuance/editor/NuanceSourceEditor.php',
'NuanceSourceQuery' => 'applications/nuance/query/NuanceSourceQuery.php',
'NuanceSourceTransaction' => 'applications/nuance/storage/NuanceSourceTransaction.php',
'NuanceSourceTransactionComment' => 'applications/nuance/storage/NuanceSourceTransactionComment.php',
'NuanceSourceTransactionQuery' => 'applications/nuance/query/NuanceSourceTransactionQuery.php',
'NuanceSourceViewController' => 'applications/nuance/controller/NuanceSourceViewController.php',
'NuanceTransaction' => 'applications/nuance/storage/NuanceTransaction.php',
'OwnersPackageReplyHandler' => 'applications/owners/mail/OwnersPackageReplyHandler.php',
'PHUI' => 'view/phui/PHUI.php',
'PHUIBoxExample' => 'applications/uiexample/examples/PHUIBoxExample.php',
@ -928,6 +970,7 @@ phutil_register_library_map(array(
'PhabricatorApplicationMailingLists' => 'applications/mailinglists/application/PhabricatorApplicationMailingLists.php',
'PhabricatorApplicationManiphest' => 'applications/maniphest/application/PhabricatorApplicationManiphest.php',
'PhabricatorApplicationMetaMTA' => 'applications/metamta/application/PhabricatorApplicationMetaMTA.php',
'PhabricatorApplicationNuance' => 'applications/nuance/application/PhabricatorApplicationNuance.php',
'PhabricatorApplicationOwners' => 'applications/owners/application/PhabricatorApplicationOwners.php',
'PhabricatorApplicationPHIDTypeApplication' => 'applications/meta/phid/PhabricatorApplicationPHIDTypeApplication.php',
'PhabricatorApplicationPHPAST' => 'applications/phpast/application/PhabricatorApplicationPHPAST.php',
@ -3097,6 +3140,60 @@ phutil_register_library_map(array(
'ManiphestView' => 'AphrontView',
'MetaMTANotificationType' => 'MetaMTAConstants',
'MetaMTAReceivedMailStatus' => 'MetaMTAConstants',
'NuanceController' => 'PhabricatorController',
'NuanceDAO' => 'PhabricatorLiskDAO',
'NuanceItem' =>
array(
0 => 'NuanceDAO',
1 => 'PhabricatorPolicyInterface',
),
'NuanceItemEditController' => 'NuanceController',
'NuanceItemEditor' => 'PhabricatorApplicationTransactionEditor',
'NuanceItemQuery' => 'NuanceQuery',
'NuanceItemTransaction' => 'NuanceTransaction',
'NuanceItemTransactionComment' => 'PhabricatorApplicationTransactionComment',
'NuanceItemTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'NuanceItemViewController' => 'NuanceController',
'NuancePHIDTypeItem' => 'PhabricatorPHIDType',
'NuancePHIDTypeQueue' => 'PhabricatorPHIDType',
'NuancePHIDTypeRequestor' => 'PhabricatorPHIDType',
'NuancePHIDTypeSource' => 'PhabricatorPHIDType',
'NuanceQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'NuanceQueue' =>
array(
0 => 'NuanceDAO',
1 => 'PhabricatorPolicyInterface',
),
'NuanceQueueEditController' => 'NuanceController',
'NuanceQueueEditor' => 'PhabricatorApplicationTransactionEditor',
'NuanceQueueItem' => 'NuanceDAO',
'NuanceQueueQuery' => 'NuanceQuery',
'NuanceQueueTransaction' => 'NuanceTransaction',
'NuanceQueueTransactionComment' => 'PhabricatorApplicationTransactionComment',
'NuanceQueueTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'NuanceQueueViewController' => 'NuanceController',
'NuanceRequestor' => 'NuanceDAO',
'NuanceRequestorEditController' => 'NuanceController',
'NuanceRequestorEditor' => 'PhabricatorApplicationTransactionEditor',
'NuanceRequestorQuery' => 'NuanceQuery',
'NuanceRequestorSource' => 'NuanceDAO',
'NuanceRequestorTransaction' => 'NuanceTransaction',
'NuanceRequestorTransactionComment' => 'PhabricatorApplicationTransactionComment',
'NuanceRequestorTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'NuanceRequestorViewController' => 'NuanceController',
'NuanceSource' =>
array(
0 => 'NuanceDAO',
1 => 'PhabricatorPolicyInterface',
),
'NuanceSourceEditController' => 'NuanceController',
'NuanceSourceEditor' => 'PhabricatorApplicationTransactionEditor',
'NuanceSourceQuery' => 'NuanceQuery',
'NuanceSourceTransaction' => 'NuanceTransaction',
'NuanceSourceTransactionComment' => 'PhabricatorApplicationTransactionComment',
'NuanceSourceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'NuanceSourceViewController' => 'NuanceController',
'NuanceTransaction' => 'PhabricatorApplicationTransaction',
'OwnersPackageReplyHandler' => 'PhabricatorMailReplyHandler',
'PHUIBoxExample' => 'PhabricatorUIExample',
'PHUIBoxView' => 'AphrontTagView',
@ -3193,6 +3290,7 @@ phutil_register_library_map(array(
'PhabricatorApplicationMailingLists' => 'PhabricatorApplication',
'PhabricatorApplicationManiphest' => 'PhabricatorApplication',
'PhabricatorApplicationMetaMTA' => 'PhabricatorApplication',
'PhabricatorApplicationNuance' => 'PhabricatorApplication',
'PhabricatorApplicationOwners' => 'PhabricatorApplication',
'PhabricatorApplicationPHIDTypeApplication' => 'PhabricatorPHIDType',
'PhabricatorApplicationPHPAST' => 'PhabricatorApplication',

View file

@ -22,7 +22,7 @@ final class PhabricatorApplicationConpherence extends PhabricatorApplication {
}
public function getTitleGlyph() {
return "\xE2\x98\x8E";
return "\xE2\x9C\x86";
}
public function getApplicationGroup() {

View file

@ -0,0 +1,54 @@
<?php
final class PhabricatorApplicationNuance extends PhabricatorApplication {
public function getIconName() {
return 'nuance';
}
public function getTitleGlyph() {
return "\xE2\x98\x8E";
}
public function isBeta() {
return true;
}
public function shouldAppearInLaunchView() {
// try to hide this even more for now
return false;
}
public function canUninstall() {
return true;
}
public function getRoutes() {
return array(
'/nuance/' => array(
'item/' => array(
'view/(?P<id>[1-9]\d*)/' => 'NuanceItemViewController',
'edit/(?P<id>[1-9]\d*)/' => 'NuanceItemEditController',
'new/' => 'NuanceItemEditController',
),
'source/' => array(
'view/(?P<id>[1-9]\d*)/' => 'NuanceSourceViewController',
'edit/(?P<id>[1-9]\d*)/' => 'NuanceSourceEditController',
'new/' => 'NuanceSourceEditController',
),
'queue/' => array(
'view/(?P<id>[1-9]\d*)/' => 'NuanceQueueViewController',
'edit/(?P<id>[1-9]\d*)/' => 'NuanceQueueEditController',
'new/' => 'NuanceQueueEditController',
),
'requestor/' => array(
'view/(?P<id>[1-9]\d*)/' => 'NuanceRequestorViewController',
'edit/(?P<id>[1-9]\d*)/' => 'NuanceRequestorEditController',
'new/' => 'NuanceRequestorEditController',
),
),
);
}
}

View file

@ -0,0 +1,5 @@
<?php
abstract class NuanceController extends PhabricatorController {
}

View file

@ -0,0 +1,50 @@
<?php
final class NuanceItemEditController extends NuanceController {
private $itemID;
public function setItemID($item_id) {
$this->itemID = $item_id;
return $this;
}
public function getItemID() {
return $this->itemID;
}
public function willProcessRequest(array $data) {
$this->setItemID(idx($data, 'id'));
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$item_id = $this->getItemID();
$is_new = !$item_id;
if ($is_new) {
$item = new NuanceItem();
} else {
$item = id(new NuanceItemQuery())
->setViewer($user)
->withIDs(array($item_id))
->executeOne();
}
if (!$item) {
return new Aphront404Response();
}
$crumbs = $this->buildApplicationCrumbs();
$title = 'TODO';
return $this->buildApplicationPage(
$crumbs,
array(
'title' => $title,
'device' => true));
}
}

View file

@ -0,0 +1,42 @@
<?php
final class NuanceItemViewController extends NuanceController {
private $itemID;
public function setItemID($item_id) {
$this->itemID = $item_id;
return $this;
}
public function getItemID() {
return $this->itemID;
}
public function willProcessRequest(array $data) {
$this->setItemID($data['id']);
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$item_id = $this->getItemID();
$item = id(new NuanceItemQuery())
->setViewer($user)
->withIDs(array($item_id))
->executeOne();
if (!$item) {
return new Aphront404Response();
}
$crumbs = $this->buildApplicationCrumbs();
$title = 'TODO';
return $this->buildApplicationPage(
$crumbs,
array(
'title' => $title,
'device' => true));
}
}

View file

@ -0,0 +1,50 @@
<?php
final class NuanceQueueEditController extends NuanceController {
private $queueID;
public function setQueueID($queue_id) {
$this->queueID = $queue_id;
return $this;
}
public function getQueueID() {
return $this->queueID;
}
public function willProcessRequest(array $data) {
$this->setQueueID(idx($data, 'id'));
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$queue_id = $this->getQueueID();
$is_new = !$queue_id;
if ($is_new) {
$queue = new NuanceQueue();
} else {
$queue = id(new NuanceQueueQuery())
->setViewer($user)
->withIDs(array($queue_id))
->executeOne();
}
if (!$queue) {
return new Aphront404Response();
}
$crumbs = $this->buildApplicationCrumbs();
$title = 'TODO';
return $this->buildApplicationPage(
$crumbs,
array(
'title' => $title,
'device' => true));
}
}

View file

@ -0,0 +1,42 @@
<?php
final class NuanceQueueViewController extends NuanceController {
private $queueID;
public function setQueueID($queue_id) {
$this->queueID = $queue_id;
return $this;
}
public function getQueueID() {
return $this->queueID;
}
public function willProcessRequest(array $data) {
$this->setQueueID($data['id']);
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$queue_id = $this->getQueueID();
$queue = id(new NuanceQueueQuery())
->setViewer($user)
->withIDs(array($queue_id))
->executeOne();
if (!$queue) {
return new Aphront404Response();
}
$crumbs = $this->buildApplicationCrumbs();
$title = 'TODO';
return $this->buildApplicationPage(
$crumbs,
array(
'title' => $title,
'device' => true));
}
}

View file

@ -0,0 +1,50 @@
<?php
final class NuanceRequestorEditController extends NuanceController {
private $requestorID;
public function setRequestorID($requestor_id) {
$this->requestorID = $requestor_id;
return $this;
}
public function getRequestorID() {
return $this->requestorID;
}
public function willProcessRequest(array $data) {
$this->setRequestorID(idx($data, 'id'));
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$requestor_id = $this->getRequestorID();
$is_new = !$requestor_id;
if ($is_new) {
$requestor = new NuanceRequestor();
} else {
$requestor = id(new NuanceRequestorQuery())
->setViewer($user)
->withIDs(array($requestor_id))
->executeOne();
}
if (!$requestor) {
return new Aphront404Response();
}
$crumbs = $this->buildApplicationCrumbs();
$title = 'TODO';
return $this->buildApplicationPage(
$crumbs,
array(
'title' => $title,
'device' => true));
}
}

View file

@ -0,0 +1,42 @@
<?php
final class NuanceRequestorViewController extends NuanceController {
private $requestorID;
public function setRequestorID($requestor_id) {
$this->requestorID = $requestor_id;
return $this;
}
public function getRequestorID() {
return $this->requestorID;
}
public function willProcessRequest(array $data) {
$this->setRequestorID($data['id']);
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$requestor_id = $this->getRequestorID();
$requestor = id(new NuanceRequestorQuery())
->setViewer($user)
->withIDs(array($requestor_id))
->executeOne();
if (!$requestor) {
return new Aphront404Response();
}
$crumbs = $this->buildApplicationCrumbs();
$title = 'TODO';
return $this->buildApplicationPage(
$crumbs,
array(
'title' => $title,
'device' => true));
}
}

View file

@ -0,0 +1,49 @@
<?php
final class NuanceSourceEditController extends NuanceController {
private $sourceID;
public function setSourceID($source_id) {
$this->sourceID = $source_id;
return $this;
}
public function getSourceID() {
return $this->sourceID;
}
public function willProcessRequest(array $data) {
$this->setSourceID(idx($data, 'id'));
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$source_id = $this->getSourceID();
$is_new = !$source_id;
if ($is_new) {
$source = new NuanceSource();
} else {
$source = id(new NuanceSourceQuery())
->setViewer($user)
->withIDs(array($source_id))
->executeOne();
}
if (!$source) {
return new Aphront404Response();
}
$crumbs = $this->buildApplicationCrumbs();
$title = 'TODO';
return $this->buildApplicationPage(
$crumbs,
array(
'title' => $title,
'device' => true));
}
}

View file

@ -0,0 +1,42 @@
<?php
final class NuanceSourceViewController extends NuanceController {
private $sourceID;
public function setSourceID($source_id) {
$this->sourceID = $source_id;
return $this;
}
public function getSourceID() {
return $this->sourceID;
}
public function willProcessRequest(array $data) {
$this->setSourceID($data['id']);
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$source_id = $this->getSourceID();
$source = id(new NuanceSourceQuery())
->setViewer($user)
->withIDs(array($source_id))
->executeOne();
if (!$source) {
return new Aphront404Response();
}
$crumbs = $this->buildApplicationCrumbs();
$title = 'TODO';
return $this->buildApplicationPage(
$crumbs,
array(
'title' => $title,
'device' => true));
}
}

View file

@ -0,0 +1,17 @@
<?php
final class NuanceItemEditor
extends PhabricatorApplicationTransactionEditor {
public function getTransactionTypes() {
$types = parent::getTransactionTypes();
$types[] = PhabricatorTransactions::TYPE_EDGE;
$types[] = PhabricatorTransactions::TYPE_COMMENT;
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
return $types;
}
}

View file

@ -0,0 +1,17 @@
<?php
final class NuanceQueueEditor
extends PhabricatorApplicationTransactionEditor {
public function getTransactionTypes() {
$types = parent::getTransactionTypes();
$types[] = PhabricatorTransactions::TYPE_EDGE;
$types[] = PhabricatorTransactions::TYPE_COMMENT;
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
return $types;
}
}

View file

@ -0,0 +1,17 @@
<?php
final class NuanceRequestorEditor
extends PhabricatorApplicationTransactionEditor {
public function getTransactionTypes() {
$types = parent::getTransactionTypes();
$types[] = PhabricatorTransactions::TYPE_EDGE;
$types[] = PhabricatorTransactions::TYPE_COMMENT;
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
return $types;
}
}

View file

@ -0,0 +1,17 @@
<?php
final class NuanceSourceEditor
extends PhabricatorApplicationTransactionEditor {
public function getTransactionTypes() {
$types = parent::getTransactionTypes();
$types[] = PhabricatorTransactions::TYPE_EDGE;
$types[] = PhabricatorTransactions::TYPE_COMMENT;
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
return $types;
}
}

View file

@ -0,0 +1,46 @@
<?php
final class NuancePHIDTypeItem
extends PhabricatorPHIDType {
const TYPECONST = 'NUAI';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Item');
}
public function newObject() {
return new NuanceItem();
}
protected function buildQueryForObjects(
PhabricatorObjectQuery $query,
array $phids) {
return id(new NuanceItemQuery())
->withPHIDs($phids);
}
public function loadHandles(
PhabricatorHandleQuery $query,
array $handles,
array $objects) {
$viewer = $query->getViewer();
foreach ($handles as $phid => $handle) {
$item = $objects[$phid];
$handle->setName($item->getLabel($viewer));
$handle->setURI($item->getURI());
}
}
public function canLoadNamedObject($name) {
return false;
}
}

View file

@ -0,0 +1,46 @@
<?php
final class NuancePHIDTypeQueue
extends PhabricatorPHIDType {
const TYPECONST = 'NUAQ';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Queue');
}
public function newObject() {
return new NuanceQueue();
}
protected function buildQueryForObjects(
PhabricatorObjectQuery $query,
array $phids) {
return id(new NuanceQueueQuery())
->withPHIDs($phids);
}
public function loadHandles(
PhabricatorHandleQuery $query,
array $handles,
array $objects) {
$viewer = $query->getViewer();
foreach ($handles as $phid => $handle) {
$queue = $objects[$phid];
$handle->setName($queue->getName());
$handle->setURI($queue->getURI());
}
}
public function canLoadNamedObject($name) {
return false;
}
}

View file

@ -0,0 +1,46 @@
<?php
final class NuancePHIDTypeRequestor
extends PhabricatorPHIDType {
const TYPECONST = 'NUAR';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Requestor');
}
public function newObject() {
return new NuanceRequestor();
}
protected function buildQueryForObjects(
PhabricatorObjectQuery $query,
array $phids) {
return id(new NuanceRequestorQuery())
->withPHIDs($phids);
}
public function loadHandles(
PhabricatorHandleQuery $query,
array $handles,
array $objects) {
$viewer = $query->getViewer();
foreach ($handles as $phid => $handle) {
$requestor = $objects[$phid];
$handle->setName($requestor->getBestName());
$handle->setURI($requestor->getURI());
}
}
public function canLoadNamedObject($name) {
return false;
}
}

View file

@ -0,0 +1,46 @@
<?php
final class NuancePHIDTypeSource
extends PhabricatorPHIDType {
const TYPECONST = 'NUAS';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Source');
}
public function newObject() {
return new NuanceSource();
}
protected function buildQueryForObjects(
PhabricatorObjectQuery $query,
array $phids) {
return id(new NuanceSourceQuery())
->withPHIDs($phids);
}
public function loadHandles(
PhabricatorHandleQuery $query,
array $handles,
array $objects) {
$viewer = $query->getViewer();
foreach ($handles as $phid => $handle) {
$source = $objects[$phid];
$handle->setName($source->getName());
$handle->setURI($source->getURI());
}
}
public function canLoadNamedObject($name) {
return false;
}
}

View file

@ -0,0 +1,71 @@
<?php
final class NuanceItemQuery
extends NuanceQuery {
private $ids;
private $phids;
private $sourceIDs;
public function withIDs(array $ids) {
$this->ids = $ids;
return $this;
}
public function withPHIDs(array $phids) {
$this->phids = $phids;
return $this;
}
public function withSourceIDs($source_ids) {
$this->sourceIDs = $source_ids;
return $this;
}
public function loadPage() {
$table = new NuanceItem();
$conn_r = $table->establishConnection('r');
$data = queryfx_all(
$conn_r,
'SELECT FROM %T %Q %Q %Q',
$table->getTableName(),
$this->buildWhereClause($conn_r),
$this->buildOrderClause($conn_r),
$this->buildLimitClause($conn_r));
return $table->loadAllFromArray($data);
}
protected function buildWhereClause($conn_r) {
$where = array();
$where[] = $this->buildPagingClause($conn_r);
if ($this->sourceID) {
$where[] = qsprintf(
$conn_r,
'sourceID IN (%Ld)',
$this->sourceIDs);
}
if ($this->ids) {
$where[] = qsprintf(
$conn_r,
'id IN (%Ld)',
$this->ids);
}
if ($this->phids) {
$where[] = qsprintf(
$conn_r,
'phid IN (%Ls)',
$this->phids);
}
return $this->formatWhereClause($where);
}
}

View file

@ -0,0 +1,10 @@
<?php
final class NuanceItemTransactionQuery
extends PhabricatorApplicationTransactionQuery {
public function getTemplateApplicationTransaction() {
return new NuanceItemTransaction();
}
}

View file

@ -0,0 +1,11 @@
<?php
abstract class NuanceQuery
extends PhabricatorCursorPagedPolicyAwareQuery {
public function getQueryApplicationClass() {
return 'PhabricatorApplicationNuance';
}
}

View file

@ -0,0 +1,57 @@
<?php
final class NuanceQueueQuery
extends NuanceQuery {
private $ids;
private $phids;
public function withIDs(array $ids) {
$this->ids = $ids;
return $this;
}
public function withPHIDs(array $phids) {
$this->phids = $phids;
return $this;
}
public function loadPage() {
$table = new NuanceQueue();
$conn_r = $table->establishConnection('r');
$data = queryfx_all(
$conn_r,
'SELECT FROM %T %Q %Q %Q',
$table->getTableName(),
$this->buildWhereClause($conn_r),
$this->buildOrderClause($conn_r),
$this->buildLimitClause($conn_r));
return $table->loadAllFromArray($data);
}
protected function buildWhereClause($conn_r) {
$where = array();
$where[] = $this->buildPagingClause($conn_r);
if ($this->ids) {
$where[] = qsprintf(
$conn_r,
'id IN (%Ld)',
$this->ids);
}
if ($this->phids) {
$where[] = qsprintf(
$conn_r,
'phid IN (%Ls)',
$this->phids);
}
return $this->formatWhereClause($where);
}
}

View file

@ -0,0 +1,10 @@
<?php
final class NuanceQueueTransactionQuery
extends PhabricatorApplicationTransactionQuery {
public function getTemplateApplicationTransaction() {
return new NuanceQueueTransaction();
}
}

View file

@ -0,0 +1,57 @@
<?php
final class NuanceRequestorQuery
extends NuanceQuery {
private $ids;
private $phids;
public function withIDs(array $ids) {
$this->ids = $ids;
return $this;
}
public function withPHIDs(array $phids) {
$this->phids = $phids;
return $this;
}
public function loadPage() {
$table = new NuanceRequestor();
$conn_r = $table->establishConnection('r');
$data = queryfx_all(
$conn_r,
'SELECT FROM %T %Q %Q %Q',
$table->getTableName(),
$this->buildWhereClause($conn_r),
$this->buildOrderClause($conn_r),
$this->buildLimitClause($conn_r));
return $table->loadAllFromArray($data);
}
protected function buildWhereClause($conn_r) {
$where = array();
$where[] = $this->buildPagingClause($conn_r);
if ($this->ids) {
$where[] = qsprintf(
$conn_r,
'id IN (%Ld)',
$this->ids);
}
if ($this->phids) {
$where[] = qsprintf(
$conn_r,
'phid IN (%Ls)',
$this->phids);
}
return $this->formatWhereClause($where);
}
}

View file

@ -0,0 +1,10 @@
<?php
final class NuanceRequestorTransactionQuery
extends PhabricatorApplicationTransactionQuery {
public function getTemplateApplicationTransaction() {
return new NuanceRequestorTransaction();
}
}

View file

@ -0,0 +1,83 @@
<?php
final class NuanceSourceQuery
extends NuanceQuery {
private $ids;
private $phids;
private $creatorPHIDs;
private $types;
public function withIDs(array $ids) {
$this->ids = $ids;
return $this;
}
public function withPHIDs(array $phids) {
$this->phids = $phids;
return $this;
}
public function withCreatorPHIDs(array $phids) {
$this->CreatorPHIDs = $phids;
return $this;
}
public function withTypes($types) {
$this->types = $types;
return $this;
}
public function loadPage() {
$table = new NuanceSource();
$conn_r = $table->establishConnection('r');
$data = queryfx_all(
$conn_r,
'SELECT FROM %T %Q %Q %Q',
$table->getTableName(),
$this->buildWhereClause($conn_r),
$this->buildOrderClause($conn_r),
$this->buildLimitClause($conn_r));
return $table->loadAllFromArray($data);
}
protected function buildWhereClause($conn_r) {
$where = array();
$where[] = $this->buildPagingClause($conn_r);
if ($this->creatorPHIDs) {
$where[] = qsprintf(
$conn_r,
'creatorPHID IN (%Ls)',
$this->creatorPHIDs);
}
if ($this->types) {
$where[] = qsprintf(
$conn_r,
'type IN (%Ld)',
$this->types);
}
if ($this->ids) {
$where[] = qsprintf(
$conn_r,
'id IN (%Ld)',
$this->ids);
}
if ($this->phids) {
$where[] = qsprintf(
$conn_r,
'phid IN (%Ls)',
$this->phids);
}
return $this->formatWhereClause($where);
}
}

View file

@ -0,0 +1,10 @@
<?php
final class NuanceSourceTransactionQuery
extends PhabricatorApplicationTransactionQuery {
public function getTemplateApplicationTransaction() {
return new NuanceSourceTransaction();
}
}

View file

@ -0,0 +1,9 @@
<?php
abstract class NuanceDAO extends PhabricatorLiskDAO {
public function getApplicationName() {
return 'nuance';
}
}

View file

@ -0,0 +1,95 @@
<?php
final class NuanceItem
extends NuanceDAO
implements PhabricatorPolicyInterface {
protected $ownerPHID;
protected $requestorPHID;
protected $sourcePHID;
protected $sourceLabel;
protected $data;
protected $mailKey;
protected $dateNuanced;
public function getConfiguration() {
return array(
self::CONFIG_AUX_PHID => true,
self::CONFIG_SERIALIZATION => array(
'data' => self::SERIALIZATION_JSON,
),
) + parent::getConfiguration();
}
public function generatePHID() {
return PhabricatorPHID::generateNewPHID(
NuancePHIDTypeItem::TYPECONST);
}
public function save() {
if (!$this->getMailKey()) {
$this->setMailKey(Filesystem::readRandomCharacters(20));
}
return parent::save();
}
public function getURI() {
return '/nuance/item/view/'.$this->getID().'/';
}
public function getLabel(PhabricatorUser $viewer) {
// this is generated at the time the item is created based on
// the configuration from the item source. It is typically
// something like 'Twitter'.
$source_label = $this->getSourceLabel();
return pht(
'Item via %s @ %s.',
$source_label,
phabricator_datetime($this->getDateCreated(), $viewer));
}
public function getRequestor() {
return $this->assertAttached($this->requestor);
}
public function attachRequestor(NuanceRequestor $requestor) {
return $this->requestor = $requestor;
}
public function getSource() {
return $this->assertAttached($this->source);
}
public function attachSource(NuanceSource $source) {
$this->source = $source;
}
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
PhabricatorPolicyCapability::CAN_EDIT,
);
}
public function getPolicy($capability) {
// TODO - this should be based on the queues the item currently resides in
return PhabricatorPolicies::POLICY_NOONE;
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
// TODO - requestors should get auto access too!
return $viewer->getPHID() == $this->ownerPHID;
}
public function describeAutomaticCapability($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
return pht('Owners of an item can always view it.');
case PhabricatorPolicyCapability::CAN_EDIT:
return pht('Owners of an item can always edit it.');
}
return null;
}
}

View file

@ -0,0 +1,14 @@
<?php
final class NuanceItemTransaction
extends NuanceTransaction {
public function getApplicationTransactionType() {
return NuancePHIDTypeItem::TYPECONST;
}
public function getApplicationTransactionCommentObject() {
return new NuanceItemTransactionComment();
}
}

View file

@ -0,0 +1,10 @@
<?php
final class NuanceItemTransactionComment
extends PhabricatorApplicationTransactionComment {
public function getApplicationTransactionObject() {
return new NuanceItemTransaction();
}
}

View file

@ -0,0 +1,58 @@
<?php
final class NuanceQueue
extends NuanceDAO
implements PhabricatorPolicyInterface {
protected $name;
protected $mailKey;
protected $viewPolicy;
protected $editPolicy;
public function getConfiguration() {
return array(
self::CONFIG_AUX_PHID => true,
) + parent::getConfiguration();
}
public function generatePHID() {
return PhabricatorPHID::generateNewPHID(
NuancePHIDTypeQueue::TYPECONST);
}
public function save() {
if (!$this->getMailKey()) {
$this->setMailKey(Filesystem::readRandomCharacters(20));
}
return parent::save();
}
public function getURI() {
return '/nuance/queue/view/'.$this->getID().'/';
}
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
PhabricatorPolicyCapability::CAN_EDIT,
);
}
public function getPolicy($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
return $this->getViewPolicy();
case PhabricatorPolicyCapability::CAN_EDIT:
return $this->getEditPolicy();
}
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
return false;
}
public function describeAutomaticCapability($capability) {
return null;
}
}

View file

@ -0,0 +1,12 @@
<?php
final class NuanceQueueItem
extends NuanceDAO {
protected $queuePHID;
protected $itemPHID;
protected $itemStatus;
protected $itemDateNuanced;
}

View file

@ -0,0 +1,14 @@
<?php
final class NuanceQueueTransaction
extends NuanceTransaction {
public function getApplicationTransactionType() {
return NuancePHIDTypeQueue::TYPECONST;
}
public function getApplicationTransactionCommentObject() {
return new NuanceQueueTransactionComment();
}
}

View file

@ -0,0 +1,10 @@
<?php
final class NuanceQueueTransactionComment
extends PhabricatorApplicationTransactionComment {
public function getApplicationTransactionObject() {
return new NuanceQueueTransaction();
}
}

View file

@ -0,0 +1,37 @@
<?php
final class NuanceRequestor
extends NuanceDAO {
protected $data;
public function getConfiguration() {
return array(
self::CONFIG_AUX_PHID => true,
self::CONFIG_SERIALIZATION => array(
'data' => self::SERIALIZATION_JSON,
),
) + parent::getConfiguration();
}
public function generatePHID() {
return PhabricatorPHID::generateNewPHID(
NuancePHIDTypeRequestor::TYPECONST);
}
public function save() {
if (!$this->getMailKey()) {
$this->setMailKey(Filesystem::readRandomCharacters(20));
}
return parent::save();
}
public function getURI() {
return '/nuance/requestor/view/'.$this->getID().'/';
}
public function getPhabricatorUserPHID() {
return idx($this->getData(), 'phabricatorUserPHID');
}
}

View file

@ -0,0 +1,18 @@
<?php
final class NuanceRequestorSource
extends NuanceDAO {
protected $requestorPHID;
protected $sourcePHID;
protected $data;
public function getConfiguration() {
return array(
self::CONFIG_SERIALIZATION => array(
'data' => self::SERIALIZATION_JSON,
),
) + parent::getConfiguration();
}
}

View file

@ -0,0 +1,13 @@
<?php
final class NuanceRequestorTransaction
extends NuanceTransaction {
public function getApplicationTransactionType() {
return NuancePHIDTypeRequestor::TYPECONST;
}
public function getApplicationTransactionCommentObject() {
return new NuanceRequestorTransactionComment();
}
}

View file

@ -0,0 +1,10 @@
<?php
final class NuanceRequestorTransactionComment
extends PhabricatorApplicationTransactionComment {
public function getApplicationTransactionObject() {
return new NuanceRequestorTransaction();
}
}

View file

@ -0,0 +1,64 @@
<?php
final class NuanceSource
extends NuanceDAO
implements PhabricatorPolicyInterface {
protected $name;
protected $type;
protected $data;
protected $mailKey;
protected $viewPolicy;
protected $editPolicy;
public function getConfiguration() {
return array(
self::CONFIG_AUX_PHID => true,
self::CONFIG_SERIALIZATION => array(
'data' => self::SERIALIZATION_JSON,
),
) + parent::getConfiguration();
}
public function generatePHID() {
return PhabricatorPHID::generateNewPHID(
NuancePHIDTypeSource::TYPECONST);
}
public function save() {
if (!$this->getMailKey()) {
$this->setMailKey(Filesystem::readRandomCharacters(20));
}
return parent::save();
}
public function getURI() {
return '/nuance/source/view/'.$this->getID().'/';
}
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
PhabricatorPolicyCapability::CAN_EDIT,
);
}
public function getPolicy($capability) {
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
return $this->getViewPolicy();
case PhabricatorPolicyCapability::CAN_EDIT:
return $this->getEditPolicy();
}
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
return false;
}
public function describeAutomaticCapability($capability) {
return null;
}
}

View file

@ -0,0 +1,14 @@
<?php
final class NuanceSourceTransaction
extends NuanceTransaction {
public function getApplicationTransactionType() {
return NuancePHIDTypeSource::TYPECONST;
}
public function getApplicationTransactionCommentObject() {
return new NuanceSourceTransactionComment();
}
}

View file

@ -0,0 +1,10 @@
<?php
final class NuanceSourceTransactionComment
extends PhabricatorApplicationTransactionComment {
public function getApplicationTransactionObject() {
return new NuanceSourceTransaction();
}
}

View file

@ -0,0 +1,10 @@
<?php
abstract class NuanceTransaction
extends PhabricatorApplicationTransaction {
public function getApplicationName() {
return 'nuance';
}
}

View file

@ -208,6 +208,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
'type' => 'db',
'name' => 'policy',
),
'db.nuance' => array(
'type' => 'db',
'name' => 'nuance',
),
'0000.legacy.sql' => array(
'type' => 'sql',
'name' => $this->getPatchPath('0000.legacy.sql'),
@ -1736,6 +1740,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
'type' => 'sql',
'name' => $this->getPatchPath('20131106.diffphid.3.key.sql'),
),
'20131106.nuance-v0.sql' => array(
'type' => 'sql',
'name' => $this->getPatchPath('20131106.nuance-v0.sql'),
),
);
}
}

View file

@ -482,51 +482,51 @@ only screen and (-webkit-min-device-pixel-ratio: 1.5) {
background-position: -290px -203px;
}
.apps-owners-light-large {
.apps-nuance-light-large {
background-position: -319px -203px;
}
.apps-owners-dark-large {
.apps-nuance-dark-large {
background-position: -348px -203px;
}
.apps-owners-blue-large, .phabricator-crumb-view:hover .apps-owners-dark-large {
.apps-nuance-blue-large, .phabricator-crumb-view:hover .apps-nuance-dark-large {
background-position: -377px -203px;
}
.apps-owners-white-large {
.apps-nuance-white-large {
background-position: -406px -203px;
}
.apps-paste-light-large {
.apps-owners-light-large {
background-position: 0px -232px;
}
.apps-paste-dark-large {
.apps-owners-dark-large {
background-position: -29px -232px;
}
.apps-paste-blue-large, .phabricator-crumb-view:hover .apps-paste-dark-large {
.apps-owners-blue-large, .phabricator-crumb-view:hover .apps-owners-dark-large {
background-position: -58px -232px;
}
.apps-paste-white-large {
.apps-owners-white-large {
background-position: -87px -232px;
}
.apps-pebkac-light-large {
.apps-paste-light-large {
background-position: -116px -232px;
}
.apps-pebkac-dark-large {
.apps-paste-dark-large {
background-position: -145px -232px;
}
.apps-pebkac-blue-large, .phabricator-crumb-view:hover .apps-pebkac-dark-large {
.apps-paste-blue-large, .phabricator-crumb-view:hover .apps-paste-dark-large {
background-position: -174px -232px;
}
.apps-pebkac-white-large {
.apps-paste-white-large {
background-position: -203px -232px;
}

View file

@ -250,27 +250,27 @@ only screen and (-webkit-min-device-pixel-ratio: 1.5) {
background-position: -75px -75px;
}
.apps-owners-dark {
.apps-nuance-dark {
background-position: -90px -75px;
}
.apps-owners-white {
.apps-nuance-white {
background-position: -105px -75px;
}
.apps-paste-dark {
.apps-owners-dark {
background-position: -120px -75px;
}
.apps-paste-white {
.apps-owners-white {
background-position: -135px -75px;
}
.apps-pebkac-dark {
.apps-paste-dark {
background-position: 0px -90px;
}
.apps-pebkac-white {
.apps-paste-white {
background-position: -15px -90px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 KiB

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB