1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 08:20:57 +01:00

Despecialize status handling in Maniphest Reports

Summary: Ref T1812. This is mega gross but Facts is too far away to do this right for now.

Test Plan:
bleh gross

Looked at reports, saw same data as before.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1812

Differential Revision: https://secure.phabricator.com/D8580
This commit is contained in:
epriestley 2014-03-25 13:49:33 -07:00
parent 33bda2d590
commit 2a6d930480
2 changed files with 36 additions and 28 deletions

View file

@ -382,7 +382,7 @@ return array(
'rsrc/js/application/herald/HeraldRuleEditor.js' => '4173dbd8',
'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec',
'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3',
'rsrc/js/application/maniphest/behavior-batch-editor.js' => '391457d7',
'rsrc/js/application/maniphest/behavior-batch-editor.js' => 'fe80fb6d',
'rsrc/js/application/maniphest/behavior-batch-selector.js' => 'ead554ec',
'rsrc/js/application/maniphest/behavior-line-chart.js' => '64ef2fd2',
'rsrc/js/application/maniphest/behavior-list-edit.js' => 'cf76cfd5',
@ -573,7 +573,7 @@ return array(
'javelin-behavior-lightbox-attachments' => '3aa45ad9',
'javelin-behavior-line-chart' => '64ef2fd2',
'javelin-behavior-load-blame' => '42126667',
'javelin-behavior-maniphest-batch-editor' => '391457d7',
'javelin-behavior-maniphest-batch-editor' => 'fe80fb6d',
'javelin-behavior-maniphest-batch-selector' => 'ead554ec',
'javelin-behavior-maniphest-list-editor' => 'cf76cfd5',
'javelin-behavior-maniphest-subpriority-editor' => '84845b5b',
@ -1049,15 +1049,6 @@ return array(
3 => 'javelin-dom',
4 => 'phabricator-draggable-list',
),
'391457d7' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
2 => 'javelin-util',
3 => 'phabricator-prefab',
4 => 'multirow-row-manager',
5 => 'javelin-json',
),
'3aa45ad9' =>
array(
0 => 'javelin-behavior',
@ -1234,11 +1225,6 @@ return array(
2 => 'javelin-util',
3 => 'phabricator-shaped-request',
),
'7319e029' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
),
'62e18640' =>
array(
0 => 'javelin-install',
@ -1274,6 +1260,11 @@ return array(
1 => 'javelin-stratcom',
2 => 'javelin-dom',
),
'7319e029' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
),
'75903ee1' =>
array(
0 => 'javelin-behavior',
@ -1972,6 +1963,15 @@ return array(
4 => 'phabricator-keyboard-shortcut',
5 => 'phabricator-notification',
),
'fe80fb6d' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
2 => 'javelin-util',
3 => 'phabricator-prefab',
4 => 'multirow-row-manager',
5 => 'javelin-json',
),
28497740 =>
array(
0 => 'javelin-behavior',

View file

@ -111,8 +111,13 @@ final class ManiphestReportController extends ManiphestController {
$oldv = trim($row['oldValue'], '"');
$newv = trim($row['newValue'], '"');
$old_is_open = ($oldv === (string)ManiphestTaskStatus::STATUS_OPEN);
$new_is_open = ($newv === (string)ManiphestTaskStatus::STATUS_OPEN);
if ($oldv == 'null') {
$old_is_open = false;
} else {
$old_is_open = ManiphestTaskStatus::isOpenStatus($oldv);
}
$new_is_open = ManiphestTaskStatus::isOpenStatus($newv);
$is_open = ($new_is_open && !$old_is_open);
$is_close = ($old_is_open && !$new_is_open);
@ -650,24 +655,27 @@ final class ManiphestReportController extends ManiphestController {
$xtable = new ManiphestTransaction();
$conn_r = $table->establishConnection('r');
// TODO: Gross. This table is not meant to be queried like this. Build
// real stats tables.
$open_status_list = array();
foreach (ManiphestTaskStatus::getOpenStatusConstants() as $constant) {
$open_status_list[] = json_encode((int)$constant);
$open_status_list[] = json_encode((string)$constant);
}
$tasks = queryfx_all(
$conn_r,
'SELECT t.* FROM %T t JOIN %T x ON x.objectPHID = t.phid
WHERE t.status != 0
AND x.oldValue IN (null, %s, %s)
AND x.newValue NOT IN (%s, %s)
AND x.oldValue IN (null, %Ls)
AND x.newValue NOT IN (%Ls)
AND t.dateModified >= %d
AND x.dateCreated >= %d',
$table->getTableName(),
$xtable->getTableName(),
// TODO: Gross. This table is not meant to be queried like this. Build
// real stats tables.
json_encode((int)ManiphestTaskStatus::STATUS_OPEN),
json_encode((string)ManiphestTaskStatus::STATUS_OPEN),
json_encode((int)ManiphestTaskStatus::STATUS_OPEN),
json_encode((string)ManiphestTaskStatus::STATUS_OPEN),
$open_status_list,
$open_status_list,
$window_epoch,
$window_epoch);