diff --git a/app/config/version.php b/app/config/version.php index 989daa6980..5ac4781d73 100644 --- a/app/config/version.php +++ b/app/config/version.php @@ -1,5 +1,5 @@ 'v2.0-275', - 'hash_version' => 'v2.0-275-g68e7941', + 'app_version' => 'v2.0-276', + 'hash_version' => 'v2.0-276-g9c914e7', ); \ No newline at end of file diff --git a/app/controllers/admin/StatuslabelsController.php b/app/controllers/admin/StatuslabelsController.php index ced912ca5f..dfbf08d0ec 100755 --- a/app/controllers/admin/StatuslabelsController.php +++ b/app/controllers/admin/StatuslabelsController.php @@ -24,9 +24,6 @@ class StatuslabelsController extends AdminController public function getIndex() { - // Grab all the statuslabels - $statuslabels = Statuslabel::orderBy('created_at', 'DESC')->get(); - // Show the page return View::make('backend/statuslabels/index', compact('statuslabels')); } @@ -230,5 +227,67 @@ class StatuslabelsController extends AdminController } + public function getDatatable() + { + $statuslabels = Statuslabel::select(array('id','name','deployable','pending','archived')) + ->whereNull('deleted_at'); + + if (Input::has('search')) { + $statuslabels = $statuslabels->TextSearch(e(Input::get('search'))); + } + + if (Input::has('offset')) { + $offset = e(Input::get('offset')); + } else { + $offset = 0; + } + + if (Input::has('limit')) { + $limit = e(Input::get('limit')); + } else { + $limit = 50; + } + + $allowed_columns = ['id','name']; + $order = Input::get('order') === 'asc' ? 'asc' : 'desc'; + $sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at'; + + $statuslabels->orderBy($sort, $order); + + $statuslabelsCount = $statuslabels->count(); + $statuslabels = $statuslabels->skip($offset)->take($limit)->get(); + + $rows = array(); + + foreach($statuslabels as $statuslabel) { + + if ($statuslabel->deployable == 1) { + $label_type = Lang::get('admin/statuslabels/table.deployable'); + } elseif ($statuslabel->pending == 1) { + $label_type = Lang::get('admin/statuslabels/table.pending'); + } elseif ($statuslabel->archived == 1) { + $label_type = Lang::get('admin/statuslabels/table.archived'); + } else { + $label_type = Lang::get('admin/statuslabels/table.undeployable'); + } + + $actions = ''; + + $rows[] = array( + 'id' => $statuslabel->id, + 'type' => $label_type, + 'name' => e($statuslabel->name), + 'actions' => $actions + ); + } + + $data = array('total' => $statuslabelsCount, 'rows' => $rows); + + return $data; + + } + + + } diff --git a/app/views/backend/statuslabels/index.blade.php b/app/views/backend/statuslabels/index.blade.php index b34b7887dd..2cb5335546 100755 --- a/app/views/backend/statuslabels/index.blade.php +++ b/app/views/backend/statuslabels/index.blade.php @@ -21,44 +21,23 @@
| @lang('general.id') | +@lang('admin/statuslabels/table.name') | +@lang('admin/statuslabels/table.status_type') | +{{ Lang::get('table.actions') }} | +
|---|