mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-13 06:47:46 -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)
|
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")) {
|
if (!ini_get("auto_detect_line_endings")) {
|
||||||
ini_set("auto_detect_line_endings", '1');
|
ini_set("auto_detect_line_endings", '1');
|
||||||
}
|
}
|
||||||
|
|
||||||
$csv = Reader::createFromPath(Input::file('user_import_csv'));
|
$csv = Reader::createFromPath(Input::file('user_import_csv'));
|
||||||
$csv->setNewline("\r\n");
|
$csv->setHeaderOffset(0);
|
||||||
//get the first row, usually the CSV header
|
|
||||||
//$headers = $csv->fetchOne();
|
|
||||||
|
|
||||||
$results = $csv->getRecords();
|
$results = $csv->getRecords();
|
||||||
$item = array();
|
$item = array();
|
||||||
$status = array();
|
$status = array();
|
||||||
|
|
Loading…
Reference in a new issue