2013-04-11 20:22:06 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2015-06-02 14:14:01 +02:00
|
|
|
abstract public function getName();
|
|
|
|
abstract public function getFileName();
|
2013-04-11 20:22:06 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
*/
|
2015-06-02 14:14:01 +02:00
|
|
|
abstract public function buildWorkbook(
|
2013-04-11 20:22:06 +02:00
|
|
|
PHPExcel $workbook,
|
|
|
|
array $tasks,
|
|
|
|
array $handles,
|
|
|
|
PhabricatorUser $user);
|
|
|
|
|
|
|
|
}
|