diff --git a/app/config/version.php b/app/config/version.php index 443ef2f032..867ff3bae2 100644 --- a/app/config/version.php +++ b/app/config/version.php @@ -1,5 +1,5 @@ 'v2.0-392', - 'hash_version' => 'v2.0-392-gdc64ad5', + 'app_version' => 'v2.0-393', + 'hash_version' => 'v2.0-393-gbc8c8e4', ); \ No newline at end of file diff --git a/app/controllers/admin/ModelsController.php b/app/controllers/admin/ModelsController.php index 46a1965d8d..d92cfa5392 100755 --- a/app/controllers/admin/ModelsController.php +++ b/app/controllers/admin/ModelsController.php @@ -382,7 +382,7 @@ class ModelsController extends AdminController public function getDatatable($status = null) { - $models = Model::orderBy('created_at', 'DESC')->with('category','assets','depreciation'); + $models = Model::with('category','assets','depreciation'); ($status != 'Deleted') ?: $models->withTrashed()->Deleted();; if (Input::has('search')) { @@ -402,7 +402,7 @@ class ModelsController extends AdminController } - $allowed_columns = ['name']; + $allowed_columns = ['id','name','modelno']; $order = Input::get('order') === 'asc' ? 'asc' : 'desc'; $sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at'; @@ -415,13 +415,14 @@ class ModelsController extends AdminController foreach ($models as $model) { if ($model->deleted_at == '') { - $actions = ''; + $actions = '
'; } else { $actions = ''; } $rows[] = array( - 'manufacturer' => $model->manufacturer->name, + 'id' => $model->id, + 'manufacturer' => link_to('/admin/settings/manufacturers/'.$model->manufacturer->id.'/view', $model->manufacturer->name), 'name' => link_to('/hardware/models/'.$model->id.'/view', $model->name), 'modelnumber' => $model->modelno, 'numassets' => $model->assets->count(),