Commit 42b6610a authored by sylvieg's avatar sylvieg

[MOD]tracker: be able to chose another filename by default when exporting

parent de1aea08
......@@ -149,11 +149,20 @@ if (empty($_REQUEST['CR'])) {
}
$smarty->assign_by_ref('CR', $_REQUEST['CR']);
if (!empty($_REQUEST['file'])) {
if (!empty($_REQUEST['debug'])) {
$fp = fopen($prefs['tmpDir'].'/'.tra('tracker')."_".$_REQUEST['trackerId'].".csv", 'w');
} else {
header("Content-type: text/comma-separated-values; charset:".$_REQUEST['encoding']);
header("Content-Disposition: attachment; filename=".tra('tracker')."_".$_REQUEST['trackerId'].".csv");
if (!empty($_REQUEST['file'])) {
if (preg_match('/.csv$/', $_REQUEST['file'])) {
$file = $_REQUEST['file'];
} else {
$file = $_REQUEST['file'].'.csv';
}
} else {
$file = tra('tracker').'_'.$_REQUEST['trackerId'].'.csv';
}
header("Content-Disposition: attachment; filename=$file");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment