Add fieldset to asset model listing

This commit is contained in:
snipe 2016-11-29 06:06:52 -08:00
parent 3acc4065ce
commit eb340b0fa9
3 changed files with 13 additions and 4 deletions

View file

@ -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(),
'fieldset' => ($model->fieldset) ? (string)link_to('admin/custom_fields/'.$model->fieldset->id, $model->fieldset->name) : '',
'actions' => $actions
);
}

View file

@ -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>

View file

@ -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