fix file name adding more information
This commit is contained in:
parent
01bbae8d54
commit
784c620012
|
@ -77,7 +77,6 @@ class GiteaApiController extends Controller
|
|||
header('Content-Type: text/csv');
|
||||
// tell the browser we want to save it instead of displaying it
|
||||
header('Content-Disposition: attachment; filename="' . $file_name . '.csv";');
|
||||
exit();
|
||||
}
|
||||
|
||||
private function date_to_datetime(string $date)
|
||||
|
@ -103,13 +102,12 @@ class GiteaApiController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if (count($data) > 0 && $data[0]['Chiuso_il'] != '') {
|
||||
$file_name = date('Y_F', strtotime(explode(' ', $data[0]['Chiuso_il'])[0]));
|
||||
if (count($data) > 0) {
|
||||
$file_name = $issues_params['state']."_issues_from_".$from_date."_to_".$to_date;
|
||||
$this->create_csv($file_name, $data);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function export_closed_issues(Request $req)
|
||||
|
@ -119,9 +117,10 @@ class GiteaApiController extends Controller
|
|||
}
|
||||
$from = $req->input('from_year') . '-' . $req->input('from_month') . '-01';
|
||||
$to = $req->input('to_year') . '-' . $req->input('to_month') . '-31';
|
||||
$this->export_issues($from, $to, ['state' => $req->input('issues_type')]);
|
||||
$res = $this->export_issues($from, $to, ['state' => $req->input('issues_type')]);
|
||||
return view('backend', [
|
||||
'token' => getenv('GITEA_TOKEN')
|
||||
'token' => getenv('GITEA_TOKEN'),
|
||||
'download' => $res
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue