mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-06 09:14:36 -04:00
Standardize file names and fixed aging report export
This commit is contained in:
parent
44e7f9abbb
commit
3d95f6b8b0
@ -37,7 +37,7 @@ class ExportController extends BaseController
|
|||||||
|
|
||||||
// set the filename based on the entity types selected
|
// set the filename based on the entity types selected
|
||||||
if ($request->include == 'all') {
|
if ($request->include == 'all') {
|
||||||
$fileName = "invoice-ninja-{$date}";
|
$fileName = "{$date}-invoiceninja";
|
||||||
} else {
|
} else {
|
||||||
$fields = $request->all();
|
$fields = $request->all();
|
||||||
$fields = array_filter(array_map(function ($key) {
|
$fields = array_filter(array_map(function ($key) {
|
||||||
@ -47,7 +47,7 @@ class ExportController extends BaseController
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, array_keys($fields), $fields));
|
}, array_keys($fields), $fields));
|
||||||
$fileName = 'invoice-ninja-' . implode('-', $fields) . "-{$date}";
|
$fileName = $date. '-invoiceninja-' . implode('-', $fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($format === 'JSON') {
|
if ($format === 'JSON') {
|
||||||
|
@ -129,11 +129,14 @@ class ReportController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$output = fopen('php://output', 'w') or Utils::fatalError();
|
$output = fopen('php://output', 'w') or Utils::fatalError();
|
||||||
$reportType = trans("texts.{$reportType}s");
|
|
||||||
$date = date('Y-m-d');
|
$date = date('Y-m-d');
|
||||||
|
|
||||||
|
$columns = array_map(function($key, $val) {
|
||||||
|
return is_array($val) ? $key : $val;
|
||||||
|
}, array_keys($columns), $columns);
|
||||||
|
|
||||||
header('Content-Type:application/csv');
|
header('Content-Type:application/csv');
|
||||||
header("Content-Disposition:attachment;filename={$date}_Ninja_{$reportType}.csv");
|
header("Content-Disposition:attachment;filename={$date}-invoiceninja-{$reportType}-report.csv");
|
||||||
|
|
||||||
Utils::exportData($output, $data, Utils::trans($columns));
|
Utils::exportData($output, $data, Utils::trans($columns));
|
||||||
|
|
||||||
|
@ -1248,5 +1248,5 @@ class Utils
|
|||||||
$contents = fread($handle, 32);
|
$contents = fread($handle, 32);
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
return( ord($contents[28]) != 0 );
|
return( ord($contents[28]) != 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user