Merge remote-tracking branch 'origin/develop'
# Conflicts: # Dockerfile
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:wily
|
||||
FROM ubuntu:trusty
|
||||
MAINTAINER Brady Wetherington <uberbrady@gmail.com>
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
|
||||
@@ -267,7 +267,7 @@ class CategoriesController extends AdminController
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getDataView($categoryID) {
|
||||
public function getDataViewAssets($categoryID) {
|
||||
|
||||
$category = Category::with('assets.company')->find($categoryID);
|
||||
$category_assets = $category->assets;
|
||||
@@ -335,4 +335,115 @@ class CategoriesController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getDataViewAccessories($categoryID) {
|
||||
|
||||
$category = Category::with('accessories.company')->find($categoryID);
|
||||
$category_assets = $category->accessories;
|
||||
|
||||
if (Input::has('search')) {
|
||||
$category_assets = $category_assets->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;
|
||||
}
|
||||
|
||||
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
|
||||
|
||||
$allowed_columns = ['id','name','serial','asset_tag'];
|
||||
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
|
||||
$count = $category_assets->count();
|
||||
|
||||
$rows = array();
|
||||
|
||||
foreach ($category_assets as $asset) {
|
||||
|
||||
$actions = '';
|
||||
$inout='';
|
||||
|
||||
if ($asset->deleted_at=='') {
|
||||
$actions = '<div style=" white-space: nowrap;"><a href="'.route('update/accessory', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/accessory', $asset->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($asset->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
|
||||
} elseif ($asset->deleted_at!='') {
|
||||
$actions = '<a href="'.route('restore/accessory', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$rows[] = array(
|
||||
'id' => $asset->id,
|
||||
'name' => link_to_route('view/accessory', $asset->name, [$asset->id]),
|
||||
'actions' => $actions,
|
||||
'companyName' => Company::getName($asset),
|
||||
);
|
||||
}
|
||||
|
||||
$data = array('total' => $count, 'rows' => $rows);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function getDataViewConsumables($categoryID) {
|
||||
|
||||
$category = Category::with('accessories.company')->find($categoryID);
|
||||
$category_assets = $category->consumables;
|
||||
|
||||
if (Input::has('search')) {
|
||||
$category_assets = $category_assets->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;
|
||||
}
|
||||
|
||||
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
|
||||
|
||||
$allowed_columns = ['id','name','serial','asset_tag'];
|
||||
$sort = in_array(Input::get('sort'), $allowed_columns) ? Input::get('sort') : 'created_at';
|
||||
$count = $category_assets->count();
|
||||
|
||||
$rows = array();
|
||||
|
||||
foreach ($category_assets as $asset) {
|
||||
|
||||
$actions = '';
|
||||
$inout='';
|
||||
|
||||
if ($asset->deleted_at=='') {
|
||||
$actions = '<div style=" white-space: nowrap;"><a href="'.route('update/consumable', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/consumable', $asset->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($asset->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
|
||||
} elseif ($asset->deleted_at!='') {
|
||||
$actions = '<a href="'.route('restore/consumable', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$rows[] = array(
|
||||
'id' => $asset->id,
|
||||
'name' => link_to_route('view/consumable', $asset->name, [$asset->id]),
|
||||
'actions' => $actions,
|
||||
'companyName' => Company::getName($asset),
|
||||
);
|
||||
}
|
||||
|
||||
$data = array('total' => $count, 'rows' => $rows);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -124,6 +124,14 @@
|
||||
Route::get( 'list', [ 'as' => 'api.categories.list', 'uses' => 'CategoriesController@getDatatable' ] );
|
||||
Route::get( '{categoryID}/view',
|
||||
[ 'as' => 'api.categories.view', 'uses' => 'CategoriesController@getDataView' ] );
|
||||
Route::get( '{categoryID}/asset/view',
|
||||
[ 'as' => 'api.categories.asset.view', 'uses' => 'CategoriesController@getDataViewAssets' ] );
|
||||
Route::get( '{categoryID}/accessory/view',
|
||||
[ 'as' => 'api.categories.accessory.view', 'uses' => 'CategoriesController@getDataViewAccessories' ] );
|
||||
Route::get( '{categoryID}/consumable/view',
|
||||
[ 'as' => 'api.categories.consumable.view', 'uses' => 'CategoriesController@getDataViewConsumables' ] );
|
||||
Route::get( '{categoryID}/component/view',
|
||||
[ 'as' => 'api.categories.component.view', 'uses' => 'CategoriesController@getDataViewComponent' ] );
|
||||
} );
|
||||
|
||||
/*-- Suppliers API (mostly for creating new ones in-line while creating an asset) --*/
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<table
|
||||
name="category_assets"
|
||||
id="table"
|
||||
data-url="{{ route('api.categories.view', $category->id) }}"
|
||||
data-url="{{ route('api.categories.'.$category->category_type.'.view', [$category->id, $category->category_type]) }}"
|
||||
data-cookie="true"
|
||||
data-click-to-select="true"
|
||||
data-cookie-id-table="categoryAssetsTable">
|
||||
@@ -47,11 +47,14 @@
|
||||
</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="id" data-visible="false">@lang('general.id')</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="name">@lang('general.name')</th>
|
||||
@if ($category->category_type=='asset')
|
||||
<th data-searchable="false" data-sortable="false" data-field="model">@lang('admin/hardware/form.model')</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="asset_tag">@lang('general.asset_tag')</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="serial">@lang('admin/hardware/form.serial')</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="assigned_to">@lang('general.user')</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="change" data-switchable="false">@lang('admin/hardware/table.change')</th>
|
||||
@endif
|
||||
|
||||
<th data-searchable="false" data-sortable="false" data-field="actions" data-switchable="false">@lang('table.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -71,7 +74,7 @@
|
||||
iconsPrefix: 'fa',
|
||||
showRefresh: true,
|
||||
//search: true,
|
||||
pageSize: {{{ Setting::getSettings()->per_page }}},
|
||||
pageSize: {{ Setting::getSettings()->per_page }},
|
||||
pagination: true,
|
||||
sidePagination: 'server',
|
||||
sortable: true,
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
@if ($asset->model->fieldset)
|
||||
<hr>
|
||||
<div class="col-md-12" style="padding-bottom: 5px;"><strong>FIELDSET:</strong>
|
||||
<div class="col-md-12" style="padding-bottom: 5px;"><strong>FIELDSET:</strong>
|
||||
{{{ $asset->model->fieldset->name }}}</div>
|
||||
@foreach($asset->model->fieldset->fields as $field)
|
||||
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{{ $field->name }}}:</strong>
|
||||
@@ -379,9 +379,10 @@
|
||||
<tr>
|
||||
<td>{{ $asset->created_at }}</td>
|
||||
<td>
|
||||
@if (isset($asset->adminuser->id)) {{{ $asset->adminuser->fullName() }}}
|
||||
@if ($asset->adminuser)
|
||||
{{{ $asset->adminuser->fullName() }}}
|
||||
@else
|
||||
@lang('general.unknown_admin')
|
||||
@lang('general.unknown_admin')
|
||||
@endif
|
||||
</td>
|
||||
<td>@lang('general.created_asset')</td>
|
||||
|
||||
Reference in New Issue
Block a user