diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index 584bfb90001a..49618a7abc72 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -37,7 +37,7 @@ class ImportController extends BaseController $destinationPath = storage_path() . '/import'; $extension = $file->getClientOriginalExtension(); - if (! in_array($extension, ['csv', 'xls', 'json'])) { + if (! in_array($extension, ['csv', 'xls', 'xlsx', 'json'])) { continue; } @@ -72,7 +72,7 @@ class ImportController extends BaseController 'include_settings' => $includeSettings, ]; $this->dispatch(new ImportData(Auth::user(), IMPORT_JSON, $settings)); - $message = 'started...'; + $message = trans('texts.import_started'); } } else { if (config('queue.default') === 'sync') { @@ -84,7 +84,7 @@ class ImportController extends BaseController 'source' => $source, ]; $this->dispatch(new ImportData(Auth::user(), false, $settings)); - $message = 'started...'; + $message = trans('texts.import_started'); } } return redirect('/settings/' . ACCOUNT_IMPORT_EXPORT)->withWarning($message); @@ -112,7 +112,7 @@ class ImportController extends BaseController 'headers' => $headers, ]; $this->dispatch(new ImportData(Auth::user(), IMPORT_CSV, $settings)); - $message = 'started...'; + $message = trans('texts.import_started'); } return redirect('/settings/' . ACCOUNT_IMPORT_EXPORT)->withWarning($message); diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index 5e79643adcff..f06241c95928 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -229,7 +229,7 @@ class ImportService } } - unlink($fileName); + @unlink($fileName); return $this->results; } @@ -321,7 +321,7 @@ class ImportService } } - unlink($fileName); + @unlink($fileName); return $results; } @@ -726,7 +726,7 @@ class ImportService } } - unlink($fileName); + @unlink(storage_path() . '/import/' . $fileName); return $results; } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index bd25e077eefa..498255eba8b6 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2462,6 +2462,7 @@ $LANG = array( 'bcc_email_help' => 'Privately include this address with client emails.', 'import_complete' => 'Your import has successfully completed.', 'confirm_account_to_import' => 'Please confirm your account to import data.', + 'import_started' => 'Your import has started, we\'ll send you an email once it completes.', );