Merge branch 'develop'

This commit is contained in:
snipe 2017-11-01 23:47:36 -07:00
commit 3bc9d3f3f1
4 changed files with 54 additions and 14 deletions

View file

@ -155,7 +155,7 @@ class SuppliersController extends Controller
]); ]);
if ($request->has('search')) { 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); $suppliers = $suppliers->orderBy('name', 'ASC')->paginate(50);

View file

@ -888,14 +888,32 @@ class SettingsController extends Controller
public function postBackups() public function postBackups()
{ {
if (!config('app.lock_passwords')) { if (!config('app.lock_passwords')) {
Artisan::call('backup:run'); Artisan::call('backup:run');
return redirect()->route('settings.backups.index')->with('success', trans('admin/settings/message.backup.generated')); $output = Artisan::output();
} else {
return redirect()->to("settings.backups.index")->with('error', trans('general.feature_disabled')); // 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'));
} }

View file

@ -29,12 +29,16 @@
<div class="box-body"> <div class="box-body">
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<!-- The fileinput-button span is used to style the file input field as button --> <!-- The fileinput-button span is used to style the file input field as button -->
@if (!config('app.lock_passwords'))
<span class="btn btn-info fileinput-button"> <span class="btn btn-info fileinput-button">
<span>Select Import File...</span> <span>Select Import File...</span>
<!-- The file input field used as target for the file upload widget --> <!-- The file input field used as target for the file upload widget -->
<input id="fileupload" type="file" name="files[]" data-url="{{ route('api.imports.index') }}" accept="text/csv"> <input id="fileupload" type="file" name="files[]" data-url="{{ route('api.imports.index') }}" accept="text/csv">
</span> </span>
@endif
</div> </div>
<div class="col-md-9" v-show="progress.visible" style="padding-bottom:20px"> <div class="col-md-9" v-show="progress.visible" style="padding-bottom:20px">
<div class="col-md-11"> <div class="col-md-11">

View file

@ -13,12 +13,17 @@ Create a User
{{-- Page content --}} {{-- Page content --}}
@section('content') @section('content')
<link rel="stylesheet" type="text/css" href="{{ asset('css/lib/jquery.fileupload.css') }}">
<div class="row"> <div class="row">
<div class="col-md-8 col-md-offset-2"> <div class="col-md-8 col-md-offset-2">
<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" action=""> <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" action="">
<div class="box box-default"> <div class="box box-default">
<div class="box-body"> <div class="box-body">
@if (config('app.lock_passwords'))
<p class="alert alert-warning">CSV uploads are disabled on the demo.</p>
@endif
<!-- CSRF Token --> <!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" /> <input type="hidden" name="_token" value="{{ csrf_token() }}" />
@ -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. 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.
</p> </p>
@if (config('app.lock_passwords'))
<p>Note: Email notification for users is disabled for this installation.</p>
@endif
<div class="form-group {!! $errors->first('user_import_csv', 'has-error') }}">
<div class="form-group {!! $errors->first('user_import_csv', 'has-error') !!}">
<label for="first_name" class="col-sm-3 control-label">{{ trans('admin/users/general.usercsv') }}</label> <label for="first_name" class="col-sm-3 control-label">{{ trans('admin/users/general.usercsv') }}</label>
<div class="col-sm-5"> <div class="col-sm-5">
<input type="file" name="user_import_csv" id="user_import_csv"> <span class="btn btn-info fileinput-button">
<span>Select Import File...</span>
@if (config('app.lock_passwords'))
<input id="fileupload" type="file" name="user_import_csv" accept="text/csv" disabled="disabled" class="disabled">
@else
<input id="fileupload" type="file" name="user_import_csv" accept="text/csv">
@endif
</span>
</div> </div>
</div> </div>
@ -63,9 +76,9 @@ Create a User
<!-- Email user --> <!-- Email user -->
<div class="form-group"> <div class="form-group">
<div class="col-sm-2 "> <div class="col-sm-2">
</div> </div>
<div class="col-sm-5"> <div class="col-sm-10">
{{ Form::checkbox('email_user', '1', Input::old('email_user')) }} Email these users their credentials? (Only possible where email address is included with user data.) {{ Form::checkbox('email_user', '1', Input::old('email_user')) }} Email these users their credentials? (Only possible where email address is included with user data.)
</div> </div>
</div> </div>
@ -81,7 +94,12 @@ Create a User
</div> <!--/box-body--> </div> <!--/box-body-->
<!-- Form Actions --> <!-- Form Actions -->
<div class="box-footer text-right"> <div class="box-footer text-right">
<button type="submit" class="btn btn-default">{{ trans('button.submit') }}</button>
@if (config('app.lock_passwords'))
<button type="submit" class="btn btn-success disabled" disabled="disabled">{{ trans('button.submit') }}</button>
@else
<button type="submit" class="btn btn-success">{{ trans('button.submit') }}</button>
@endif
</div> </div>
</div> </div>
</form> </form>