diff --git a/app/Http/Controllers/Api/SuppliersController.php b/app/Http/Controllers/Api/SuppliersController.php index 672858a5a..288b6b3c2 100644 --- a/app/Http/Controllers/Api/SuppliersController.php +++ b/app/Http/Controllers/Api/SuppliersController.php @@ -155,7 +155,7 @@ class SuppliersController extends Controller ]); if ($request->has('search')) { - $suppliers = $suppliers->where('locations.name', 'LIKE', '%'.$request->get('search').'%'); + $suppliers = $suppliers->where('suppliers.name', 'LIKE', '%'.$request->get('search').'%'); } $suppliers = $suppliers->orderBy('name', 'ASC')->paginate(50); diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 1d1296c4c..4223ea02c 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -888,12 +888,30 @@ class SettingsController extends Controller public function postBackups() { + if (!config('app.lock_passwords')) { Artisan::call('backup:run'); - return redirect()->route('settings.backups.index')->with('success', trans('admin/settings/message.backup.generated')); - } else { - return redirect()->to("settings.backups.index")->with('error', trans('general.feature_disabled')); - } + $output = Artisan::output(); + + // Backup completed + if (!preg_match('/failed/', $output)) { + return redirect()->route('settings.backups.index') + ->with('success', trans('admin/settings/message.backup.generated')); + } + + + $formatted_output = str_replace('Backup completed!', '', $output); + $output_split = explode('...', $formatted_output); + + if (array_key_exists(2, $output_split)) { + return redirect()->route("settings.backups.index")->with('error', $output_split[2]); + } + return redirect()->route("settings.backups.index")->with('error', $formatted_output); + + } + return redirect()->route("settings.backups.index")->with('error', trans('general.feature_disabled')); + + } diff --git a/resources/views/importer/import.blade.php b/resources/views/importer/import.blade.php index ce64f6fda..b32372833 100644 --- a/resources/views/importer/import.blade.php +++ b/resources/views/importer/import.blade.php @@ -29,12 +29,16 @@
+ + @if (!config('app.lock_passwords')) Select Import File... + @endif +
diff --git a/resources/views/users/import.blade.php b/resources/views/users/import.blade.php index 81e767b69..782fe1bcf 100644 --- a/resources/views/users/import.blade.php +++ b/resources/views/users/import.blade.php @@ -13,12 +13,17 @@ Create a User {{-- Page content --}} @section('content') - +
+ + @if (config('app.lock_passwords')) +

CSV uploads are disabled on the demo.

+ @endif + @@ -41,14 +46,22 @@ Create a User Any additional fields to the right of those fields will be ignored. Email is optional, however users will not be able to recover their passwords or receive EULAs if you do not provide an email address. If you wish to include a company association, you must reference the ID number of an existing company - companies will not be created on the fly.

- @if (config('app.lock_passwords')) -

Note: Email notification for users is disabled for this installation.

- @endif -
+ + +
- + + Select Import File... + @if (config('app.lock_passwords')) + + @else + + @endif + + +
@@ -63,9 +76,9 @@ Create a User
-
+
-
+
{{ Form::checkbox('email_user', '1', Input::old('email_user')) }} Email these users their credentials? (Only possible where email address is included with user data.)
@@ -81,7 +94,12 @@ Create a User