Compare commits
No commits in common. '8b7348cfbcf40a74e60f42669f7823c2e8c000f9' and '15ae7ec4c1786082a47d3f3603cc495972c2114b' have entirely different histories.
8b7348cfbc
...
15ae7ec4c1
@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Ae3\JasperServer\Laravel\Integrator\app\Enums;
|
|
||||||
|
|
||||||
class ContentDispositionEnum
|
|
||||||
{
|
|
||||||
public const INLINE = "inline";
|
|
||||||
public const ATTACHMENT = "attachment";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public static function all(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
self::INLINE,
|
|
||||||
self::ATTACHMENT
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,73 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Ae3\JasperServer\Laravel\Integrator\app\Enums;
|
|
||||||
|
|
||||||
class ReportFormatEnum
|
|
||||||
{
|
|
||||||
public const PDF = "pdf";
|
|
||||||
public const HTML = "html";
|
|
||||||
public const XML = "xml";
|
|
||||||
public const CSV = "csv";
|
|
||||||
public const DOCX = "docx";
|
|
||||||
public const ODT = "odt";
|
|
||||||
public const ODS = "ods";
|
|
||||||
public const XLSX = "xlsx";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public static function all(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
self::PDF,
|
|
||||||
self::HTML,
|
|
||||||
self::XML,
|
|
||||||
self::CSV,
|
|
||||||
self::DOCX,
|
|
||||||
self::ODT,
|
|
||||||
self::ODS,
|
|
||||||
self::XLSX,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string[]
|
|
||||||
*/
|
|
||||||
public static function downloadable(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
self::PDF,
|
|
||||||
self::XML,
|
|
||||||
self::CSV,
|
|
||||||
self::DOCX,
|
|
||||||
self::ODT,
|
|
||||||
self::ODS,
|
|
||||||
self::XLSX,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $format
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function getMimeType(string $format): string
|
|
||||||
{
|
|
||||||
switch ($format) {
|
|
||||||
case self::PDF:
|
|
||||||
return 'application/pdf';
|
|
||||||
case self::XML:
|
|
||||||
return 'application/xml';
|
|
||||||
case self::CSV:
|
|
||||||
return 'text/csv';
|
|
||||||
case self::DOCX:
|
|
||||||
return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
||||||
case self::ODT:
|
|
||||||
return 'application/vnd.oasis.opendocument.text';
|
|
||||||
case self::XLSX:
|
|
||||||
case self::ODS:
|
|
||||||
return 'application/vnd.oasis.opendocument.spreadsheet';
|
|
||||||
default:
|
|
||||||
return 'text/html';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue