1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 10:22:42 +01:00
phorge-phorge/src/applications/maniphest/export/ManiphestExcelFormat.php
James Rhodes 8ba593b3f3 Implemented support for different export formats.
Summary:
This adds support for different export formats to Excel
via a drop-down on the Export page as per the discussion
in D5443.

Test Plan:
Export some things from Maniphest.  Do a simple implementation
of ManiphestExcelFormat just for testing and make sure that
it appears in the list after you run `arc liberate`.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2575

Differential Revision: https://secure.phabricator.com/D5642

Conflicts:

	src/applications/maniphest/controller/ManiphestExportController.php
2013-04-11 11:27:36 -07:00

47 lines
975 B
PHP

<?php
/**
* @group maniphest
*/
abstract class ManiphestExcelFormat {
final public static function loadAllFormats() {
$classes = id(new PhutilSymbolLoader())
->setAncestorClass(__CLASS__)
->setConcreteOnly(true)
->selectAndLoadSymbols();
$objects = array();
foreach ($classes as $class) {
$objects[$class['name']] = newv($class['name'], array());
}
$objects = msort($objects, 'getOrder');
return $objects;
}
public abstract function getName();
public abstract function getFileName();
public function getOrder() {
return 0;
}
protected function computeExcelDate($epoch) {
$seconds_per_day = (60 * 60 * 24);
$offset = ($seconds_per_day * 25569);
return ($epoch + $offset) / $seconds_per_day;
}
/**
* @phutil-external-symbol class PHPExcel
*/
public abstract function buildWorkbook(
PHPExcel $workbook,
array $tasks,
array $handles,
PhabricatorUser $user);
}