mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
Update batch edit and export to excel for "pro" queries
Summary: Point these at the new data and URIs. Test Plan: - Batch edited some tasks. - Exported some tasks to excel. {F58112} Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D6978
This commit is contained in:
parent
9864d562dd
commit
0803f5cb45
2 changed files with 20 additions and 17 deletions
|
@ -33,7 +33,7 @@ final class ManiphestBatchEditController extends ManiphestController {
|
|||
$task_ids = implode(',', mpull($tasks, 'getID'));
|
||||
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setURI('/maniphest/view/custom/?s=oc&tasks='.$task_ids);
|
||||
->setURI('/maniphest/query/?ids='.$task_ids);
|
||||
}
|
||||
|
||||
$panel = new AphrontPanelView();
|
||||
|
|
|
@ -55,10 +55,11 @@ final class ManiphestExportController extends ManiphestController {
|
|||
// TODO: PHPExcel has a dependency on the PHP zip extension. We should test
|
||||
// for that here, since it fatals if we don't have the ZipArchive class.
|
||||
|
||||
$query = id(new PhabricatorSearchQuery())->loadOneWhere(
|
||||
'queryKey = %s',
|
||||
$this->key);
|
||||
if (!$query) {
|
||||
$saved = id(new PhabricatorSavedQueryQuery())
|
||||
->setViewer($user)
|
||||
->withQueryKeys(array($this->key))
|
||||
->executeOne();
|
||||
if (!$saved) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
|
@ -88,7 +89,6 @@ final class ManiphestExportController extends ManiphestController {
|
|||
$dialog->addCancelButton('/maniphest/');
|
||||
$dialog->addSubmitButton(pht('Export to Excel'));
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
|
||||
}
|
||||
|
||||
$format = idx($formats, $request->getStr("excel-format"));
|
||||
|
@ -96,20 +96,23 @@ final class ManiphestExportController extends ManiphestController {
|
|||
throw new Exception('Excel format object not found.');
|
||||
}
|
||||
|
||||
$query->setParameter('limit', null);
|
||||
$query->setParameter('offset', null);
|
||||
$query->setParameter('order', 'p');
|
||||
$query->setParameter('group', 'n');
|
||||
$saved->makeEphemeral();
|
||||
$saved->setParameter('limit', PHP_INT_MAX);
|
||||
|
||||
list($tasks, $handles) = ManiphestTaskListController::loadTasks(
|
||||
$query,
|
||||
$user);
|
||||
// Ungroup tasks.
|
||||
$tasks = array_mergev($tasks);
|
||||
$engine = id(new ManiphestTaskSearchEngine())
|
||||
->setViewer($user);
|
||||
|
||||
$query = $engine->buildQueryFromSavedQuery($saved);
|
||||
$query->setViewer($user);
|
||||
$tasks = $query->execute();
|
||||
|
||||
$all_projects = array_mergev(mpull($tasks, 'getProjectPHIDs'));
|
||||
$project_handles = $this->loadViewerHandles($all_projects);
|
||||
$handles += $project_handles;
|
||||
$all_assigned = mpull($tasks, 'getOwnerPHID');
|
||||
|
||||
$handles = id(new PhabricatorHandleQuery())
|
||||
->setViewer($user)
|
||||
->withPHIDs(array_merge($all_projects, $all_assigned))
|
||||
->execute();
|
||||
|
||||
$workbook = new PHPExcel();
|
||||
$format->buildWorkbook($workbook, $tasks, $handles, $user);
|
||||
|
|
Loading…
Reference in a new issue