mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Add custom fields as options
This commit is contained in:
parent
a4a25ab9d0
commit
a47e36c1e5
|
@ -7,6 +7,7 @@ use App\Helpers\StorageHelper;
|
||||||
use App\Http\Requests\ImageUploadRequest;
|
use App\Http\Requests\ImageUploadRequest;
|
||||||
use App\Http\Requests\SettingsSamlRequest;
|
use App\Http\Requests\SettingsSamlRequest;
|
||||||
use App\Http\Requests\SetupUserRequest;
|
use App\Http\Requests\SetupUserRequest;
|
||||||
|
use App\Models\CustomField;
|
||||||
use App\Models\Group;
|
use App\Models\Group;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
|
@ -809,9 +810,10 @@ class SettingsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function getLabels()
|
public function getLabels()
|
||||||
{
|
{
|
||||||
$setting = Setting::getSettings();
|
return view('settings.labels', [
|
||||||
|
'setting' => Setting::getSettings(),
|
||||||
return view('settings.labels', compact('setting'));
|
'customFields' => CustomField::all(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -346,6 +346,11 @@
|
||||||
<option value="location.name">Location Name</option>
|
<option value="location.name">Location Name</option>
|
||||||
<option value="location.phone">Location Phone</option>
|
<option value="location.phone">Location Phone</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
|
<optgroup label="Custom Fields">
|
||||||
|
@foreach($customFields as $customField)
|
||||||
|
<option value="{{ $customField->db_column }}">{{ $customField->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -216,7 +216,7 @@
|
||||||
{{ Form::label('label2_fields', trans('admin/settings/general.label2_fields')) }}
|
{{ Form::label('label2_fields', trans('admin/settings/general.label2_fields')) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
@include('partials.label2-field-definitions', [ 'name' => 'label2_fields', 'value' => old('label2_fields', $setting->label2_fields) ])
|
@include('partials.label2-field-definitions', [ 'name' => 'label2_fields', 'value' => old('label2_fields', $setting->label2_fields), 'customFields' => $customFields ])
|
||||||
{!! $errors->first('label2_fields', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
{!! $errors->first('label2_fields', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||||
<p class="help-block">{{ trans('admin/settings/general.label2_fields_help') }}</p>
|
<p class="help-block">{{ trans('admin/settings/general.label2_fields_help') }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue