Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
c745fa095b
5 changed files with 35 additions and 3 deletions
|
@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
|
||||||
use App\Services\LdapAd;
|
use App\Services\LdapAd;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Artisan;
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
use App\Models\User; // Note that this is awful close to 'Users' the namespace above; be careful
|
||||||
|
|
||||||
class LDAPImportController extends Controller
|
class LDAPImportController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -65,6 +66,7 @@ class LDAPImportController extends Controller
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
|
$this->authorize('update', User::class);
|
||||||
// Call Artisan LDAP import command.
|
// Call Artisan LDAP import command.
|
||||||
$location_id = $request->input('location_id');
|
$location_id = $request->input('location_id');
|
||||||
Artisan::call('snipeit:ldap-sync', ['--location_id' => $location_id, '--json_summary' => true]);
|
Artisan::call('snipeit:ldap-sync', ['--location_id' => $location_id, '--json_summary' => true]);
|
||||||
|
|
|
@ -287,7 +287,7 @@ class CustomField extends Model
|
||||||
{
|
{
|
||||||
$arr = preg_split("/\\r\\n|\\r|\\n/", $this->field_values);
|
$arr = preg_split("/\\r\\n|\\r|\\n/", $this->field_values);
|
||||||
|
|
||||||
if (($this->element!='checkbox') && ($this->element!='checkbox')) {
|
if (($this->element!='checkbox') && ($this->element!='radio')) {
|
||||||
$result[''] = 'Select '.strtolower($this->format);
|
$result[''] = 'Select '.strtolower($this->format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Format -->
|
<!-- Format -->
|
||||||
<div class="form-group {{ $errors->has('format') ? ' has-error' : '' }}">
|
<div class="form-group {{ $errors->has('format') ? ' has-error' : '' }}" id="format_values">
|
||||||
<label for="format" class="col-md-4 control-label">
|
<label for="format" class="col-md-4 control-label">
|
||||||
{{ trans('admin/custom_fields/general.field_format') }}
|
{{ trans('admin/custom_fields/general.field_format') }}
|
||||||
</label>
|
</label>
|
||||||
|
@ -168,6 +168,17 @@
|
||||||
});
|
});
|
||||||
}).change();
|
}).change();
|
||||||
|
|
||||||
|
// If the element is a radiobutton, doesn't show the format input box
|
||||||
|
$(".field_element").change(function(){
|
||||||
|
$(this).find("option:selected").each(function(){
|
||||||
|
if (($(this).attr("value") != "radio")){
|
||||||
|
$("#format_values").show();
|
||||||
|
} else{
|
||||||
|
$("#format_values").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).change();
|
||||||
|
|
||||||
// Only display the field element if the type is not text
|
// Only display the field element if the type is not text
|
||||||
$(".field_element").change(function(){
|
$(".field_element").change(function(){
|
||||||
$(this).find("option:selected").each(function(){
|
$(this).find("option:selected").each(function(){
|
||||||
|
|
|
@ -10,7 +10,15 @@
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
@section('header_right')
|
@section('header_right')
|
||||||
<a href="{{ route('depreciations.edit', ['depreciation' => $depreciation->id]) }}" class="btn btn-sm btn-primary pull-right">{{ trans('admin/depreciations/table.update') }} </a>
|
<div class="btn-group pull-right">
|
||||||
|
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
|
||||||
|
<span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href="{{ route('depreciations.edit', ['depreciation' => $depreciation->id]) }}">{{ trans('general.update') }}</a></li>
|
||||||
|
<li><a href="{{ route('depreciations.create') }}">{{ trans('general.create') }}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
{{-- Page content --}}
|
{{-- Page content --}}
|
||||||
|
|
|
@ -27,6 +27,17 @@
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
|
@elseif ($field->element=='radio')
|
||||||
|
@foreach ($field->formatFieldValuesAsArray() as $value)
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label>
|
||||||
|
<input type="radio" value="{{ $value }}" name="{{ $field->db_column_name() }}" class="minimal" {{ isset($item) ? ($item->{$field->db_column_name()} == $value ? ' checked="checked"' : '') : (Request::old($field->db_column_name()) != '' ? ' checked="checked"' : '') }}>
|
||||||
|
{{ $value }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue