mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
keeps example values in the example preview, fixes indent
This commit is contained in:
parent
69317fb403
commit
bee016e0be
|
@ -6,6 +6,7 @@ use App\Models\Asset;
|
||||||
use App\Models\AssetModel;
|
use App\Models\AssetModel;
|
||||||
use App\Models\Category;
|
use App\Models\Category;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
|
use App\Models\CustomField;
|
||||||
use App\Models\Labels\Label;
|
use App\Models\Labels\Label;
|
||||||
use App\Models\Location;
|
use App\Models\Location;
|
||||||
use App\Models\Manufacturer;
|
use App\Models\Manufacturer;
|
||||||
|
@ -65,11 +66,15 @@ class LabelsController extends Controller
|
||||||
$exampleAsset->model->category->id = 999999;
|
$exampleAsset->model->category->id = 999999;
|
||||||
$exampleAsset->model->category->name = trans('admin/labels/table.example_category');
|
$exampleAsset->model->category->name = trans('admin/labels/table.example_category');
|
||||||
|
|
||||||
|
$customFieldColumns = CustomField::all()->pluck('db_column');
|
||||||
|
|
||||||
collect(explode(';', Setting::getSettings()->label2_fields))
|
collect(explode(';', Setting::getSettings()->label2_fields))
|
||||||
->each(function ($item) use ($exampleAsset){
|
->each(function ($item) use ($customFieldColumns, $exampleAsset) {
|
||||||
$pair = explode('=', $item);
|
$pair = explode('=', $item);
|
||||||
|
|
||||||
|
if ($customFieldColumns->contains($pair[1])) {
|
||||||
$exampleAsset->{$pair[1]} = "{{$pair[0]}}";
|
$exampleAsset->{$pair[1]} = "{{$pair[0]}}";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$settings = Setting::getSettings();
|
$settings = Setting::getSettings();
|
||||||
|
|
Loading…
Reference in a new issue