mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
History importer fixes
This commit is contained in:
parent
6c7e5cb9cf
commit
99cd552d5c
|
@ -570,15 +570,17 @@ class AssetsController extends Controller
|
|||
*/
|
||||
public function postImportHistory(Request $request)
|
||||
{
|
||||
|
||||
if (!$request->hasFile('user_import_csv')) {
|
||||
return back()->with('error', 'No file provided. Please select a file for import and try again. ');
|
||||
}
|
||||
|
||||
if (!ini_get("auto_detect_line_endings")) {
|
||||
ini_set("auto_detect_line_endings", '1');
|
||||
}
|
||||
|
||||
$csv = Reader::createFromPath(Input::file('user_import_csv'));
|
||||
$csv->setNewline("\r\n");
|
||||
//get the first row, usually the CSV header
|
||||
//$headers = $csv->fetchOne();
|
||||
|
||||
$csv->setHeaderOffset(0);
|
||||
$results = $csv->getRecords();
|
||||
$item = array();
|
||||
$status = array();
|
||||
|
|
Loading…
Reference in a new issue