A free open source IT asset/license management system
Add fieldset to asset model listing
snipeeb340b0fa9e8
diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.phpindex f45fd1c163..08553e64bf 100755--- a/app/Http/Controllers/AssetModelsController.php+++ b/app/Http/Controllers/AssetModelsController.php@@ -398,7 +398,7 @@ class AssetModelsController extends Controller*/public function getCustomFields($modelId){- $model=AssetModel::find($modelId);+ $model = AssetModel::find($modelId);return View::make("models.custom_fields_form")->with("model", $model);}@@ -467,10 +467,11 @@ class AssetModelsController extends Controller'image' => ($model->image!='') ? '<img src="'.config('app.url').'/uploads/models/'.$model->image.'" height=50 width=50>' : '','modelnumber' => $model->model_number,'numassets' => $model->assets->count(),- 'depreciation' => (($model->depreciation)&&($model->depreciation->id > 0)) ? $model->depreciation->name.' ('.$model->depreciation->months.')' : trans('general.no_depreciation'),- 'category' => ($model->category) ? $model->category->name : '',+ 'depreciation' => (($model->depreciation) && ($model->depreciation->id > 0)) ? $model->depreciation->name.' ('.$model->depreciation->months.')' : trans('general.no_depreciation'),+ 'category' => ($model->category) ? (string)link_to('admin/settings/categories/'.$model->category->id.'/view', $model->category->name) : '','eol' => ($model->eol) ? $model->eol.' '.trans('general.months') : '',- 'note' => $model->getNote(),+ 'note' => $model->getNote(),+ 'fieldset' => ($model->fieldset) ? (string)link_to('admin/custom_fields/'.$model->fieldset->id, $model->fieldset->name) : '','actions' => $actions);}diff --git a/resources/views/models/index.blade.php b/resources/views/models/index.blade.phpindex 5196d7c279..71c9a2c990 100755--- a/resources/views/models/index.blade.php+++ b/resources/views/models/index.blade.php@@ -45,6 +45,7 @@<th data-sortable="false" data-field="depreciation">{{ trans('general.depreciation') }}</th><th data-sortable="false" data-field="category">{{ trans('general.category') }}</th><th data-sortable="true" data-field="eol">{{ trans('general.eol') }}</th>+ <th data-sortable="false" data-field="fieldset">{{ trans('admin/models/general.fieldset') }}</th><th data-sortable="false" data-field="note">{{ trans('general.notes') }}</th><th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th></tr>diff --git a/resources/views/models/view.blade.php b/resources/views/models/view.blade.phpindex 0eb97022b6..44409fd221 100755--- a/resources/views/models/view.blade.php+++ b/resources/views/models/view.blade.php@@ -96,6 +96,13 @@{{ trans('general.months') }}</li>@endif+ @if ($model->fieldset)+ <li>{{ trans('admin/models/general.fieldset') }}:+ <a href="{{ config('app.url') }}/admin/custom_fields/{{ $model->fieldset->id }}">{{ $model->fieldset->name }}</a>+ </li>++ @endif+@if ($model->image)<li><br /><img src="{{ config('app.url') }}/uploads/models/{{ $model->image }}" class="img-responsive"></li>@endif