Merge branch 'develop'

# Conflicts:
#	README.md
#	config/version.php
This commit is contained in:
snipe 2018-02-16 13:26:53 -08:00
commit 592c62de75
71 changed files with 1839 additions and 1322 deletions

View file

@ -874,6 +874,15 @@
"contributions": [
"code"
]
},
{
"login": "seanmcilvenna",
"name": "Sean McIlvenna",
"avatar_url": "https://avatars2.githubusercontent.com/u/5384694?v=4",
"profile": "https://www.seanmcilvenna.com",
"contributions": [
"code"
]
}
]
}

View file

@ -70,7 +70,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [<img src="https://avatars2.githubusercontent.com/u/16108587?v=3" width="110px;"/><br /><sub>Jason Spriggs</sub>](http://jasonspriggs.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jasonspriggs "Code") | [<img src="https://avatars2.githubusercontent.com/u/1134568?v=3" width="110px;"/><br /><sub>Nate Felton</sub>](http://n8felton.wordpress.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=n8felton "Code") | [<img src="https://avatars2.githubusercontent.com/u/14036694?v=3" width="110px;"/><br /><sub>Manasses Ferreira</sub>](http://homepages.dcc.ufmg.br/~manassesferreira)<br />[💻](https://github.com/snipe/snipe-it/commits?author=manassesferreira "Code") | [<img src="https://avatars0.githubusercontent.com/u/15913949?v=3" width="110px;"/><br /><sub>Steve</sub>](https://github.com/steveelwood)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=steveelwood "Tests") | [<img src="https://avatars1.githubusercontent.com/u/3361683?v=3" width="110px;"/><br /><sub>matc</sub>](http://twitter.com/matc)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=matc "Tests") | [<img src="https://avatars3.githubusercontent.com/u/7405702?v=3" width="110px;"/><br /><sub>Cole R. Davis</sub>](http://www.davisracingteam.com)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=VanillaNinjaD "Tests") | [<img src="https://avatars2.githubusercontent.com/u/10167681?v=3" width="110px;"/><br /><sub>gibsonjoshua55</sub>](https://github.com/gibsonjoshua55)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gibsonjoshua55 "Code") |
| [<img src="https://avatars2.githubusercontent.com/u/2809241?v=4" width="110px;"/><br /><sub>Robin Temme</sub>](https://github.com/zwerch)<br />[💻](https://github.com/snipe/snipe-it/commits?author=zwerch "Code") | [<img src="https://avatars0.githubusercontent.com/u/6961695?v=4" width="110px;"/><br /><sub>Iman</sub>](https://github.com/imanghafoori1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=imanghafoori1 "Code") | [<img src="https://avatars1.githubusercontent.com/u/6551003?v=4" width="110px;"/><br /><sub>Richard Hofman</sub>](https://github.com/richardhofman6)<br />[💻](https://github.com/snipe/snipe-it/commits?author=richardhofman6 "Code") | [<img src="https://avatars0.githubusercontent.com/u/3697569?v=4" width="110px;"/><br /><sub>gizzmojr</sub>](https://github.com/gizzmojr)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gizzmojr "Code") | [<img src="https://avatars3.githubusercontent.com/u/404729?v=4" width="110px;"/><br /><sub>Jenny Li</sub>](https://github.com/imjennyli)<br />[📖](https://github.com/snipe/snipe-it/commits?author=imjennyli "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/869227?v=4" width="110px;"/><br /><sub>Geoff Young</sub>](https://github.com/GeoffYoung)<br />[💻](https://github.com/snipe/snipe-it/commits?author=GeoffYoung "Code") | [<img src="https://avatars3.githubusercontent.com/u/1068477?v=4" width="110px;"/><br /><sub>Elliot Blackburn</sub>](http://www.elliotblackburn.com)<br />[📖](https://github.com/snipe/snipe-it/commits?author=BlueHatbRit "Documentation") |
| [<img src="https://avatars1.githubusercontent.com/u/6357451?v=4" width="110px;"/><br /><sub>Tõnis Ormisson</sub>](http://andmemasin.eu)<br />[💻](https://github.com/snipe/snipe-it/commits?author=TonisOrmisson "Code") | [<img src="https://avatars0.githubusercontent.com/u/449411?v=4" width="110px;"/><br /><sub>Nicolai Essig</sub>](http://www.nicolai-essig.de)<br />[💻](https://github.com/snipe/snipe-it/commits?author=thakilla "Code") | [<img src="https://avatars1.githubusercontent.com/u/14809698?v=4" width="110px;"/><br /><sub>Danielle</sub>](https://github.com/techincolor)<br />[📖](https://github.com/snipe/snipe-it/commits?author=techincolor "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/18545156?v=4" width="110px;"/><br /><sub>Lawrence</sub>](https://github.com/TheVakman)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=TheVakman "Tests") [🐛](https://github.com/snipe/snipe-it/issues?q=author%3ATheVakman "Bug reports") | [<img src="https://avatars1.githubusercontent.com/u/22473767?v=4" width="110px;"/><br /><sub>uknzaeinozpas</sub>](https://github.com/uknzaeinozpas)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=uknzaeinozpas "Tests") [💻](https://github.com/snipe/snipe-it/commits?author=uknzaeinozpas "Code") | [<img src="https://avatars3.githubusercontent.com/u/422752?v=4" width="110px;"/><br /><sub>Ryan</sub>](https://github.com/Gelob)<br />[📖](https://github.com/snipe/snipe-it/commits?author=Gelob "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/10672546?v=4" width="110px;"/><br /><sub>vcordes79</sub>](https://github.com/vcordes79)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vcordes79 "Code") |
| [<img src="https://avatars3.githubusercontent.com/u/27958330?v=4" width="110px;"/><br /><sub>fordster78</sub>](https://github.com/fordster78)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fordster78 "Code") | [<img src="https://avatars0.githubusercontent.com/u/34064225?v=4" width="110px;"/><br /><sub>CronKz</sub>](https://github.com/CronKz)<br />[💻](https://github.com/snipe/snipe-it/commits?author=CronKz "Code") | [<img src="https://avatars1.githubusercontent.com/u/585486?v=4" width="110px;"/><br /><sub>Tim Bishop</sub>](https://github.com/tdb)<br />[💻](https://github.com/snipe/snipe-it/commits?author=tdb "Code") |
| [<img src="https://avatars3.githubusercontent.com/u/27958330?v=4" width="110px;"/><br /><sub>fordster78</sub>](https://github.com/fordster78)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fordster78 "Code") | [<img src="https://avatars0.githubusercontent.com/u/34064225?v=4" width="110px;"/><br /><sub>CronKz</sub>](https://github.com/CronKz)<br />[💻](https://github.com/snipe/snipe-it/commits?author=CronKz "Code") | [<img src="https://avatars1.githubusercontent.com/u/585486?v=4" width="110px;"/><br /><sub>Tim Bishop</sub>](https://github.com/tdb)<br />[💻](https://github.com/snipe/snipe-it/commits?author=tdb "Code") | [<img src="https://avatars2.githubusercontent.com/u/5384694?v=4" width="110px;"/><br /><sub>Sean McIlvenna</sub>](https://www.seanmcilvenna.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=seanmcilvenna "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

View file

@ -85,6 +85,8 @@ class LdapSync extends Command
}
/* Determine which location to assign users to by default. */
$location = NULL;
if ($this->option('location')!='') {
$location = Location::where('name', '=', $this->option('location'))->first();
LOG::debug('Location name '.$this->option('location').' passed');
@ -93,9 +95,8 @@ class LdapSync extends Command
$location = Location::where('id', '=', $this->option('location_id'))->first();
LOG::debug('Location ID '.$this->option('location_id').' passed');
LOG::debug('Importing to '.$location->name.' ('.$location->id.')');
} else {
$location = NULL;
}
if (!isset($location)) {
LOG::debug('That location is invalid or a location was not provided, so no location will be assigned by default.');
}
@ -188,7 +189,7 @@ class LdapSync extends Command
if ($item['ldap_location_override'] == true) {
$user->location_id = $item['location_id'];
} else if ($location) {
} elseif ((isset($location)) && (!empty($location))) {
$user->location_id = e($location->id);
}

View file

@ -40,10 +40,24 @@ class AssetMaintenancesController extends Controller
$maintenances = $maintenances->TextSearch(e($request->input('search')));
}
if ($request->has('asset_id')) {
$maintenances->where('asset_id', '=', $request->input('asset_id'));
}
$offset = request('offset', 0);
$limit = request('limit', 50);
$allowed_columns = ['id','title','asset_maintenance_time','asset_maintenance_type','cost','start_date','completion_date','notes','user_id'];
$allowed_columns = [
'id',
'title',
'asset_maintenance_time',
'asset_maintenance_type',
'cost',
'start_date',
'completion_date',
'notes',
'user_id'
];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';

View file

@ -557,7 +557,7 @@ class AssetsController extends Controller
$error_payload['target_type'] = 'location';
} elseif (request('checkout_to_type')=='asset') {
$target = Asset::where('id','!=',$assetId)->find(request('assigned_asset'));
$target = Asset::where('id','!=',$asset_id)->find(request('assigned_asset'));
$asset->location_id = $target->rtd_location_id;
// Override with the asset's location_id if it has one
if ($target->location_id!='') {

View file

@ -20,7 +20,7 @@ class GroupsController extends Controller
public function index(Request $request)
{
$this->authorize('view', Group::class);
$allowed_columns = ['id','name','created_at'];
$allowed_columns = ['id','name','created_at', 'users_count'];
$groups = Group::select('id','name','permissions','created_at','updated_at')->withCount('users');

View file

@ -24,7 +24,7 @@ class LocationsController extends Controller
$allowed_columns = [
'id','name','address','address2','city','state','country','zip','created_at',
'updated_at','parent_id', 'manager_id','image',
'assigned_assets_count','users_count','assets_count'];
'assigned_assets_count','users_count','assets_count','currency'];
$locations = Location::with('parent', 'manager', 'childLocations')->select([
'locations.id',

View file

@ -42,7 +42,11 @@ class ReportsController extends Controller
$allowed_columns = [
'id',
'created_at'
'created_at',
'target_id',
'user_id',
'action_type',
'note'
];
$sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';

View file

@ -63,85 +63,6 @@ class AssetMaintenancesController extends Controller
}
/**
* Generates the JSON response for asset maintenances listing view.
*
* @see AssetMaintenancesController::getIndex() method that generates view
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
* @since [v1.8]
* @return String JSON
*/
public function getDatatable(Request $request)
{
$maintenances = AssetMaintenance::with('asset', 'supplier', 'asset.company', 'admin');
if (Input::has('search')) {
$maintenances = $maintenances->TextSearch(e($request->input('search')));
}
$offset = request('offset', 0);
$limit = request('limit', 50);
$allowed_columns = ['id','title','asset_maintenance_time','asset_maintenance_type','cost','start_date','completion_date','notes','user_id'];
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array(Input::get('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';
switch ($sort) {
case 'user_id':
$maintenances = $maintenances->OrderAdmin($order);
break;
default:
$maintenances = $maintenances->orderBy($sort, $order);
break;
}
$maintenancesCount = $maintenances->count();
$maintenances = $maintenances->skip($offset)->take($limit)->get();
$rows = array();
$settings = Setting::getSettings();
foreach ($maintenances as $maintenance) {
$actions = '';
if (Gate::allows('update', Asset::class)) {
$actions .= Helper::generateDatatableButton('edit', route('maintenances.edit', $maintenance->id));
$actions .= Helper::generateDatatableButton(
'delete',
route('maintenances.destroy', $maintenance->id),
$enabled = true,
trans('admin/asset_maintenances/message.delete.confirm'),
$maintenance->title
);
}
if (($maintenance->cost) && (isset($maintenance->asset)) && ($maintenance->asset->location) && ($maintenance->asset->location->currency!='')) {
$maintenance_cost = $maintenance->asset->location->currency.$maintenance->cost;
} else {
$maintenance_cost = $settings->default_currency.$maintenance->cost;
}
$rows[] = array(
'id' => $maintenance->id,
'asset_name' => ($maintenance->asset) ? (string)link_to_route('maintenances.show', $maintenance->asset->present()->Name(), ['maintenance' => $maintenance->asset->id]) : 'Deleted Asset' ,
'title' => $maintenance->title,
'notes' => $maintenance->notes,
'supplier' => ($maintenance->supplier) ? (string)link_to_route('suppliers.show', $maintenance->supplier->name, ['maintenance'=>$maintenance->supplier->id]) : 'Deleted Supplier',
'cost' => $maintenance_cost,
'asset_maintenance_type' => e($maintenance->asset_maintenance_type),
'start_date' => $maintenance->start_date,
'asset_maintenance_time' => $maintenance->asset_maintenance_time,
'completion_date' => $maintenance->completion_date,
'user_id' => ($maintenance->admin) ? (string)link_to_route('users.show', $maintenance->admin->present()->fullName(), ['user'=>$maintenance->admin->id]) : '',
'actions' => $actions,
'company' => ($maintenance->asset->company) ? $maintenance->asset->company->name : ''
);
}
$data = array('total' => $maintenancesCount, 'rows' => $rows);
return $data;
}
/**
* Returns a form view to create a new asset maintenance.
@ -265,9 +186,7 @@ class AssetMaintenancesController extends Controller
// Get Supplier List
// Render the view
return view('asset_maintenances/edit')
->with('asset_list', Helper::detailedAssetList())
->with('selectedAsset', null)
->with('supplier_list', Helper::suppliersList())
->with('assetMaintenanceType', $assetMaintenanceType)
->with('item', $assetMaintenance);

View file

@ -316,7 +316,7 @@ class SettingsController extends Controller
$setting->modellist_displays = '';
if (($request->has('show_in_model_list')) && (count($request->has('show_in_model_list')) > 0))
if (($request->has('show_in_model_list')) && (count($request->input('show_in_model_list')) > 0))
{
$setting->modellist_displays = implode(',', $request->input('show_in_model_list'));
}

View file

@ -34,15 +34,16 @@ class LocationsTransformer
'id' => (int) $location->id,
'name' => e($location->name),
'image' => ($location->image) ? app('locations_upload_url').e($location->image) : null,
'address' => e($location->address),
'city' => e($location->city),
'state' => e($location->state),
'country' => e($location->country),
'zip' => e($location->zip),
'address' => ($location->address) ? e($location->address) : null,
'address2' => ($location->address2) ? e($location->address2) : null,
'city' => ($location->city) ? e($location->city) : null,
'state' => ($location->state) ? e($location->state) : null,
'country' => ($location->country) ? e($location->country) : null,
'zip' => ($location->zip) ? e($location->zip) : null,
'assigned_assets_count' => (int) $location->assigned_assets_count,
'assets_count' => (int) $location->assets_count,
'users_count' => (int) $location->users_count,
'currency' => ($location->currency) ? e($location->currency) : null,
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($location->updated_at, 'datetime'),
'parent' => ($location->parent) ? [

View file

@ -330,44 +330,24 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
public static function generateFormattedNameFromFullName($format = 'filastname', $users_name)
{
$name = explode(" ", $users_name);
$name = str_replace("'", '', $name);
$first_name = $name[0];
$email_last_name = '';
$email_prefix = $first_name;
list($first_name, $last_name) = explode(" ", $users_name, 2);
// If there is no last name given
if (!array_key_exists(1, $name)) {
$last_name='';
$email_last_name = $last_name;
$user_username = $first_name;
// There is a last name given
} else {
$last_name = str_replace($first_name . ' ', '', $users_name);
if ($format=='filastname') {
$email_last_name.=str_replace(' ', '', $last_name);
$email_prefix = $first_name[0].$email_last_name;
} elseif ($format=='firstname.lastname') {
$email_last_name.=str_replace(' ', '', $last_name);
$email_prefix = $first_name.'.'.$email_last_name;
} elseif ($format=='firstname') {
$email_last_name.=str_replace(' ', '', $last_name);
$email_prefix = $first_name;
}
// Assume filastname by default
$username = str_slug(substr($first_name, 0, 1).$last_name);
if ($format=='firstname.lastname') {
$username = str_slug($first_name).'.'.str_slug($last_name);
} elseif ($format=='firstname_lastname') {
$username = str_slug($first_name).'_'.str_slug($last_name);
} elseif ($format=='firstname') {
$username = str_slug($first_name);
}
$user_username = $email_prefix;
$user['first_name'] = $first_name;
$user['last_name'] = $last_name;
$user['username'] = strtolower($user_username);
$user['username'] = strtolower($username);
return $user;

View file

@ -144,6 +144,59 @@ class LicensePresenter extends Presenter
}
/**
* Json Column Layout for bootstrap table
* @return string
*/
public static function dataTableLayoutSeats()
{
$layout = [
[
"field" => "name",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => trans('admin/licenses/general.seat'),
"visible" => true,
], [
"field" => "assigned_user",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => trans('admin/licenses/general.user'),
"visible" => true,
"formatter" => "usersLinkObjFormatter"
], [
"field" => "assigned_asset",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => trans('admin/licenses/form.asset'),
"visible" => true,
"formatter" => "hardwareLinkObjFormatter"
], [
"field" => "location",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => trans('general.location'),
"visible" => true,
"formatter" => "locationsLinkObjFormatter"
], [
"field" => "checkincheckout",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => trans('general.checkin').'/'.trans('general.checkout'),
"visible" => true,
"formatter" => "licenseSeatInOutFormatter"
]
];
return json_encode($layout);
}
/**
* Link to this licenses Name
* @return string

View file

@ -11,6 +11,156 @@ use App\Helpers\Helper;
class LocationPresenter extends Presenter
{
/**
* Json Column Layout for bootstrap table
* @return string
*/
public static function dataTableLayout()
{
$layout = [
[
"field" => "id",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('general.id'),
"visible" => false
],
[
"field" => "name",
"searchable" => true,
"sortable" => true,
"title" => trans('admin/locations/table.name'),
"visible" => true,
"formatter" => "locationsLinkFormatter"
],
[
"field" => "image",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('general.image'),
"visible" => true,
"formatter" => "imageFormatter"
],
[
"field" => "parent",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/locations/table.parent'),
"visible" => true,
"formatter" => "locationsLinkObjFormatter"
],
[
"field" => "assets_count",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/locations/table.assets_rtd'),
"visible" => true,
],
[
"field" => "assigned_assets_count",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/locations/table.assets_checkedout'),
"visible" => true,
],
[
"field" => "users_count",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('general.people'),
"visible" => true,
],
[
"field" => "currency",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('general.currency'),
"visible" => true,
],
[
"field" => "address",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/locations/table.address'),
"visible" => true,
],
[
"field" => "city",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/locations/table.city'),
"visible" => true,
],
[
"field" => "state",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/locations/table.state'),
"visible" => true,
],
[
"field" => "zip",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/locations/table.zip'),
"visible" => false,
],
[
"field" => "country",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/locations/table.country'),
"visible" => false,
],[
"field" => "manager",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => trans('admin/users/table.manager'),
"visible" => false,
"formatter" => 'usersLinkObjFormatter'
],
[
"field" => "created_at",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('general.created_at'),
"visible" => false,
'formatter' => 'dateDisplayFormatter'
],
[
"field" => "actions",
"searchable" => false,
"sortable" => false,
"switchable" => false,
"title" => trans('table.actions'),
"visible" => true,
"formatter" => "locationsActionsFormatter",
]
];
return json_encode($layout);
}
/**
* Link to this locations name
* @return string

View file

@ -30,7 +30,7 @@
"predis/predis": "^1.1",
"rollbar/rollbar-laravel": "^2.2",
"schuppo/password-strength": "~1.5",
"spatie/laravel-backup": "^3.0.0",
"spatie/laravel-backup": "3.11.0",
"tecnickcom/tc-lib-barcode": "^1.15",
"tightenco/ziggy": "^0.4.1",
"unicodeveloper/laravel-password": "^1.0",

384
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,10 +1,10 @@
<?php
return array (
'app_version' => 'v4.1.11-pre',
'full_app_version' => 'v4.1.11-pre - build 3307-gf06852f',
'build_version' => '3307',
'full_app_version' => 'v4.1.11-pre - build 3319-g1359a4f',
'build_version' => '3319',
'prerelease_version' => '',
'hash_version' => 'gf06852f',
'full_hash' => 'v4.1.11-pre-55-gf06852f',
'branch' => 'master',
'hash_version' => 'g1359a4f',
'full_hash' => 'v4.1.10-67-g1359a4f',
'branch' => 'develop',
);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/js/dist/all.js vendored

Binary file not shown.

View file

@ -2,13 +2,13 @@
"/js/build/vue.js": "/js/build/vue.js?id=25049a0c0eb736e1c883",
"/css/AdminLTE.css": "/css/AdminLTE.css?id=b8be19a285eaf44eec37",
"/css/app.css": "/css/app.css?id=407edb63cc6b6dc62405",
"/css/overrides.css": "/css/overrides.css?id=1bdafb06a8609780f546",
"/css/overrides.css": "/css/overrides.css?id=33d8f8fea649acea5f9c",
"/js/build/vue.js.map": "/js/build/vue.js.map?id=6b79d08f1decca72957c",
"/css/AdminLTE.css.map": "/css/AdminLTE.css.map?id=99f5a5a03c4155cf69f6",
"/css/app.css.map": "/css/app.css.map?id=bdbe05e6ecd70ccfac72",
"/css/overrides.css.map": "/css/overrides.css.map?id=898c91d4a425b01b589b",
"/css/dist/all.css": "/css/dist/all.css?id=3a8aa974e7b09b52b18c",
"/js/dist/all.js": "/js/dist/all.js?id=722d1692756a30dc1ece",
"/css/build/all.css": "/css/build/all.css?id=3a8aa974e7b09b52b18c",
"/js/build/all.js": "/js/build/all.js?id=722d1692756a30dc1ece"
"/css/dist/all.css": "/css/dist/all.css?id=dc1449877e0f8abedc47",
"/js/dist/all.js": "/js/dist/all.js?id=4e5e7295e9a59e718567",
"/css/build/all.css": "/css/build/all.css?id=dc1449877e0f8abedc47",
"/js/build/all.js": "/js/build/all.js?id=4e5e7295e9a59e718567"
}

View file

@ -288,7 +288,41 @@ $(document).ready(function () {
}
});
});
// ------------------------------------------------
// Deep linking for Bootstrap tabs
// ------------------------------------------------
var taburl = document.location.toString();
// Allow full page URL to activate a tab's ID
// ------------------------------------------------
// This allows linking to a tab on page load via the address bar.
// So a URL such as, http://snipe-it.local/hardware/2/#my_tab will
// cause the tab on that page with an ID of “my_tab” to be active.
if (taburl.match('#') ) {
$('.nav-tabs a[href="#'+taburl.split('#')[1]+'"]').tab('show');
}
// Allow internal page links to activate a tab's ID.
// ------------------------------------------------
// This allows you to link to a tab from anywhere on the page
// including from within another tab. Also note that internal page
// links either inside or out of the tabs need to include data-toggle="tab"
// Ex: <a href="#my_tab" data-toggle="tab">Click me</a>
$('a[data-toggle="tab"]').click(function (e) {
var href = $(this).attr("href");
history.pushState(null, null, href);
e.preventDefault();
$('a[href="' + $(this).attr('href') + '"]').tab('show');
});
// ------------------------------------------------
// End Deep Linking for Bootstrap tabs
// ------------------------------------------------
});

View file

@ -326,3 +326,7 @@ img.navbar-brand-img, .navbar-brand>img {
[hidden] {
display: none !important;
}
#toolbar {
margin-top: 10px;
}

View file

@ -80,6 +80,7 @@
'email_domain_help' => 'This is used to generate email addresses when importing',
'filastname_format' => 'First Initial Last Name (jsmith@example.com)',
'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)',
'firstname_lastname_underscore_format' => 'First Name Last Name (jane_smith@example.com)',
'first' => 'First',
'first_name' => 'First Name',
'first_name_format' => 'First Name (jane@example.com)',

View file

@ -456,6 +456,7 @@ Form::macro('username_format', function ($name = "username_format", $selected =
'firstname.lastname' => trans('general.firstname_lastname_format'),
'firstname' => trans('general.first_name_format'),
'filastname' => trans('general.filastname_format'),
'firstname_lastname' => trans('general.firstname_lastname_underscore_format'),
);

View file

@ -21,14 +21,25 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="accessories"
class="table table-striped snipe-table"
id="table"
data-url="{{route('api.accessories.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="accessoriesTable-{{ config('version.hash_version') }}">
<table
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
data-cookie-id-table="accessoriesTable"
data-pagination="true"
data-id-table="accessoriesTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="accessoriesTable"
class="table table-striped snipe-table"
data-url="{{route('api.accessories.index') }}"
data-export-options='{
"fileName": "export-accessories-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div>
@ -39,10 +50,5 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', [
'search' => true,
'showFooter' => true,
'columns' => \App\Presenters\AccessoryPresenter::dataTableLayout(),
'exportFile' => 'accessories-export',
])
@include ('partials.bootstrap-table')
@stop

View file

@ -53,21 +53,32 @@
<div class="box box-default">
<div class="box-body">
<div class="table table-responsive">
<table
name="accessory_users"
class="table table-striped snipe-table"
id="table"
data-url="{{ route('api.accessories.checkedout', $accessory->id) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="accessoryUsersTable">
<thead>
<tr>
<th data-searchable="false" data-formatter="usersLinkFormatter" data-sortable="false" data-field="name">{{ trans('general.user') }}</th>
<th data-searchable="false" data-sortable="false" data-field="actions" data-formatter="accessoriesInOutFormatter">{{ trans('table.actions') }}</th>
</tr>
</thead>
</table>
<table
data-cookie-id-table="usersTable"
data-pagination="true"
data-id-table="usersTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="usersTable"
class="table table-striped snipe-table"
data-url="{{ route('api.accessories.checkedout', $accessory->id) }}"
data-export-options='{
"fileName": "export-accessories-{{ str_slug($accessory->name) }}-users-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-searchable="false" data-formatter="usersLinkFormatter" data-sortable="false" data-field="name">{{ trans('general.user') }}</th>
<th data-searchable="false" data-sortable="false" data-field="actions" data-formatter="accessoriesInOutFormatter">{{ trans('table.actions') }}</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
@ -90,9 +101,5 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', [
'exportFile' => 'accessory' .
$accessory->name . '-export',
'search' => 'false'
])
@include ('partials.bootstrap-table')
@stop

View file

@ -23,29 +23,48 @@ View Assets for {{ $user->present()->fullName() }}
<div class="box-body">
<!-- checked out assets table -->
@if (count($user->assets) > 0)
<div class="table-responsive">
<table class="table table-striped">
<table
data-cookie="true"
data-cookie-id-table="userAssets"
data-pagination="true"
data-id-table="userAssets"
data-search="true"
data-side-pagination="client"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="userAssets"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "my-assets-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th class="col-md-4">{{ trans('admin/hardware/table.asset_model') }}</th>
<th class="col-md-2">{{ trans('admin/hardware/table.asset_tag') }}</th>
<th class="col-md-3">{{ trans('admin/hardware/table.serial') }}</th>
<th class="col-md-3">{{ trans('general.name') }}</th>
<th></th>
</tr>
<tr>
<th class="col-md-3" data-switchable="true" data-visible="true">{{ trans('general.category') }}</th>
<th class="col-md-2" data-switchable="true" data-visible="true">{{ trans('admin/hardware/table.asset_tag') }}</th>
<th class="col-md-3" data-switchable="true" data-visible="true">{{ trans('general.name') }}</th>
<th class="col-md-4" data-switchable="true" data-visible="true">{{ trans('admin/hardware/table.asset_model') }}</th>
<th class="col-md-3" data-switchable="true" data-visible="true">{{ trans('admin/hardware/table.serial') }}</th>
<th>{{ trans('general.image') }}</th>
</tr>
</thead>
<tbody>
@foreach ($user->assets as $asset)
<tr>
<td>{{ $asset->model->category->name }}</td>
<td>{{ $asset->asset_tag }}</td>
<td>{{ $asset->name }}</td>
<td>
@if ($asset->physical=='1')
{{ $asset->model->name }}
{{ $asset->model->name }}
@endif
</td>
<td>{{ $asset->asset_tag }}</td>
<td>{{ $asset->serial }}</td>
<td>{{ $asset->name }}</td>
<td>
@if (($asset->image) && ($asset->image!=''))
<img src="{{ url('/') }}/uploads/assets/{{ $asset->image }}" height="50" width="50">
@ -59,15 +78,6 @@ View Assets for {{ $user->present()->fullName() }}
</tbody>
</table>
</div> <!-- .table-responsive-->
@else
<div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
</div>
@endif
</div> <!-- .box-body-->
</div><!--.box.box-default-->
</div> <!-- .col-md-12-->
@ -86,9 +96,24 @@ View Assets for {{ $user->present()->fullName() }}
<div class="box-body">
<!-- checked out licenses table -->
@if (count($user->licenses) > 0)
<div class="table-responsive">
<table class="table table-striped">
<table
data-cookie-id-table="userLicenses"
data-pagination="true"
data-id-table="userLicenses"
data-search="true"
data-side-pagination="client"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="userLicenses"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "my-licenses-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th class="col-md-5">{{ trans('general.name') }}</th>
@ -111,14 +136,6 @@ View Assets for {{ $user->present()->fullName() }}
</tbody>
</table>
</div> <!-- .table-responsive-->
@else
<div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
</div>
@endif
</div> <!-- .box-body-->
</div><!--.box.box-default-->
</div> <!-- .col-md-12-->
@ -137,9 +154,23 @@ View Assets for {{ $user->present()->fullName() }}
<div class="box-body">
<!-- checked out consumables table -->
@if (count($user->consumables) > 0)
<div class="table-responsive">
<table class="table table-striped">
<table
data-cookie-id-table="userConsumables"
data-pagination="true"
data-id-table="userConsumables"
data-search="true"
data-side-pagination="client"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="userConsumables"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "my-consumables-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th class="col-md-12">{{ trans('general.name') }}</th>
@ -154,14 +185,7 @@ View Assets for {{ $user->present()->fullName() }}
</tbody>
</table>
</div>
@else
<div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
</div>
@endif
</div> <!-- .box-body-->
</div><!--.box.box-default-->
@ -182,9 +206,24 @@ View Assets for {{ $user->present()->fullName() }}
<div class="box-body">
<!-- checked out licenses table -->
@if (count($user->accessories) > 0)
<div class="table-responsive">
<table class="table table-striped">
<table
data-cookie-id-table="userAccessories"
data-pagination="true"
data-id-table="userAccessories"
data-search="true"
data-side-pagination="client"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="userAccessories"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "my-accessories-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th class="col-md-12">Name</th>
@ -199,14 +238,7 @@ View Assets for {{ $user->present()->fullName() }}
</tbody>
</table>
</div>
@else
<div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
</div>
@endif
</div> <!-- .box-body-->
</div><!--.box.box-default-->
</div> <!-- .col-md-12-->
@ -224,37 +256,36 @@ View Assets for {{ $user->present()->fullName() }}
@endif
<div class="box-body">
@if (count($userlog) > 0)
<div class="table-responsive">
<table
class="table table-striped snipe-table"
name="userActivityReport"
id="table"
data-cookie="false"
data-cookie-id-table="userHistoryTable-{{ config('version.hash_version') }}"
data-url="{{route('api.activity.index', ['target_id' => $user->id, 'target_type' => 'User', 'order' => 'desc']) }}">
data-cookie-id-table="userActivityReport"
data-pagination="true"
data-id-table="userActivityReport"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="userActivityReport"
class="table table-striped snipe-table"
data-url="{{route('api.activity.index', ['target_id' => $user->id, 'target_type' => 'User', 'order' => 'desc']) }}"
data-export-options='{
"fileName": "my-history-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"></th>
<th class="col-sm-3" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th class="col-sm-3" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th class="col-sm-3" data-field="action_type">{{ trans('general.action') }}</th>
<th class="col-sm-3" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
<th data-switchable="true" data-visible="true" data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"></th>
<th data-switchable="true" data-visible="true" class="col-sm-3" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th data-switchable="true" data-visible="true" class="col-sm-3" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th data-switchable="true" data-visible="true" class="col-sm-3" data-field="action_type">{{ trans('general.action') }}</th>
<th data-switchable="true" data-visible="true" class="col-sm-3" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
</tr>
</thead>
<tbody>
</table>
</div> <!--.table-responsive-->
@else
<div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
</div>
@endif
</div> <!-- .box-body-->
</div><!--.box.box-default-->
</div> <!-- .col-md-12-->

View file

@ -20,29 +20,38 @@
<div class="col-md-12">
<div class="box box-default">
<div class="box-body">
<table
name="maintenances"
id="table"
class="table table-striped snipe-table"
data-url="{{route('api.maintenances.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="maintenancesTable-{{ config('version.hash_version') }}"
>
<table
data-cookie-id-table="maintenancesTable"
data-pagination="true"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-footer="true"
data-show-export="true"
data-show-refresh="true"
id="maintenancesTable"
class="table table-striped snipe-table"
data-url="{{route('api.maintenances.index') }}"
data-export-options='{
"fileName": "export-maintenances-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-field="company" data-sortable="false" data-visible="false">{{ trans('admin/companies/table.title') }}</th>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-sortable="false" data-field="asset_name" data-formatter="hardwareLinkObjFormatter">{{ trans('admin/asset_maintenances/table.asset_name') }}</th>
<th data-sortable="false" data-field="supplier" data-formatter="suppliersLinkObjFormatter">{{ trans('general.supplier') }}</th>
<th data-searchable="true" data-sortable="true" data-field="asset_maintenance_type">{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}</th>
<th data-searchable="true" data-sortable="true" data-field="title">{{ trans('admin/asset_maintenances/form.title') }}</th>
<th data-searchable="true" data-sortable="false" data-field="start_date" data-formatter="dateDisplayFormatter">{{ trans('admin/asset_maintenances/form.start_date') }}</th>
<th data-searchable="true" data-sortable="true" data-field="completion_date" data-formatter="dateDisplayFormatter">{{ trans('admin/asset_maintenances/form.completion_date') }}</th>
<th data-searchable="true" data-sortable="true" data-field="asset_maintenance_time">{{ trans('admin/asset_maintenances/form.asset_maintenance_time') }}</th>
<th data-searchable="true" data-sortable="true" data-field="cost" class="text-right">{{ trans('admin/asset_maintenances/form.cost') }}</th>
<th data-searchable="true" data-sortable="true" data-field="user_id" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th data-searchable="true" data-sortable="true" data-field="notes" data-visible="false">{{ trans('admin/asset_maintenances/form.notes') }}</th>
<th data-sortable="true" data-field="id" data-visible="true">{{ trans('general.id') }}</th>
<th data-field="company" data-sortable="false" data-visible="true">{{ trans('admin/companies/table.title') }}</th>
<th data-sortable="false" data-visible="true" data-field="asset_name" data-formatter="hardwareLinkObjFormatter">{{ trans('admin/asset_maintenances/table.asset_name') }}</th>
<th data-sortable="false" data-visible="true" data-field="supplier" data-formatter="suppliersLinkObjFormatter">{{ trans('general.supplier') }}</th>
<th data-searchable="true" data-visible="true" data-sortable="true" data-field="asset_maintenance_type">{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}</th>
<th data-searchable="true" data-visible="true" data-sortable="true" data-field="title">{{ trans('admin/asset_maintenances/form.title') }}</th>
<th data-searchable="true" data-visible="true" data-sortable="true" data-field="start_date" data-formatter="dateDisplayFormatter">{{ trans('admin/asset_maintenances/form.start_date') }}</th>
<th data-searchable="true" data-visible="true" data-sortable="true" data-field="completion_date" data-formatter="dateDisplayFormatter">{{ trans('admin/asset_maintenances/form.completion_date') }}</th>
<th class="text-right" data-searchable="true" data-visible="true" data-sortable="true" data-field="asset_maintenance_time" data-footer-formatter="sumFormatter">{{ trans('admin/asset_maintenances/form.asset_maintenance_time') }}</th>
<th data-searchable="true" data-sortable="true" data-field="cost" class="text-right" data-footer-formatter="sumFormatter">{{ trans('admin/asset_maintenances/form.cost') }}</th>
<th data-searchable="true" data-visible="true" data-sortable="true" data-field="user_id" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th data-searchable="true" data-visible="true" data-sortable="true" data-field="notes">{{ trans('admin/asset_maintenances/form.notes') }}</th>
@can('update', \App\Models\Asset::class)
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions" data-formatter="maintenanceActions">{{ trans('table.actions') }}</th>
@endcan

View file

@ -20,15 +20,26 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
class="table table-striped snipe-table"
name="categories"
id="table"
data-url="{{route('api.categories.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="categoriesTable-{{ config('version.hash_version') }}">
<table
data-columns="{{ \App\Presenters\CategoryPresenter::dataTableLayout() }}"
data-cookie-id-table="categoryTable"
data-pagination="true"
data-id-table="categoryTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="categoryTable"
class="table table-striped snipe-table"
data-url="{{ route('api.categories.index') }}"
data-export-options='{
"fileName": "export-categories-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div><!-- /.box-body -->

View file

@ -28,14 +28,59 @@
<div class="col-md-12">
<div class="box box-default">
<div class="box-body">
<table
name="category_assets"
class="snipe-table"
id="table"
data-url="{{ route('api.'.$category_type_route.'.index',['category_id'=> $category->id]) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="category{{ $category_type_route }}Table">
@if ($category->category_type=='asset')
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-cookie-id-table="categoryAssetsTable"
id="categoryAssetsTable"
data-id-table="categoryAssetsTable"
data-export-options='{
"fileName": "export-{{ str_slug($category->name) }}-assets-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
@elseif ($category->category_type=='accessory')
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
data-cookie-id-table="categoryAccessoryTable"
id="categoryAccessoryTable"
data-id-table="categoryAccessoryTable"
data-export-options='{
"fileName": "export-{{ str_slug($category->name) }}-accessories-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
@elseif ($category->category_type=='consumable')
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
data-cookie-id-table="categoryConsumableTable"
id="categoryConsumableTable"
data-id-table="categoryConsumableTable"
data-export-options='{
"fileName": "export-{{ str_slug($category->name) }}-consumables-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
@elseif ($category->category_type=='component')
data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}"
data-cookie-id-table="categoryCompomnentTable"
id="categoryCompomnentTable"
data-id-table="categoryCompomnentTable"
data-export-options='{
"fileName": "export-{{ str_slug($category->name) }}-components-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
@endif
data-pagination="true"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
class="table table-striped snipe-table"
data-url="{{ route('api.'.$category_type_route.'.index',['category_id'=> $category->id]) }}">
</table>
</div>
@ -45,32 +90,5 @@
@stop
@section('moar_scripts')
@if ($category->category_type=='asset')
@include ('partials.bootstrap-table',
[
'exportFile' => 'category-' . $category->name . '-export',
'search' => true,
'columns' => \App\Presenters\AssetPresenter::dataTableLayout()])
@elseif ($category->category_type=='accessory')
@include ('partials.bootstrap-table',
[
'exportFile' => 'category-' . $category->name . '-export',
'search' => true,
'columns' => \App\Presenters\AccessoryPresenter::dataTableLayout()])
@elseif ($category->category_type=='consumable')
@include ('partials.bootstrap-table',
[
'exportFile' => 'category-' . $category->name . '-export',
'search' => true,
'columns' => \App\Presenters\ConsumablePresenter::dataTableLayout()])
@elseif ($category->category_type=='component')
@include ('partials.bootstrap-table',
[
'exportFile' => 'category-' . $category->name . '-export',
'search' => true,
'columns' => \App\Presenters\ComponentPresenter::dataTableLayout()])
@endif
@include ('partials.bootstrap-table')
@stop

View file

@ -17,14 +17,26 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="companies"
class="table table-striped snipe-table"
id="table"
data-url="{{ route('api.companies.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="companiesTable-{{ config('version.hash_version') }}">
data-columns="{{ \App\Presenters\CompanyPresenter::dataTableLayout() }}"
data-cookie-id-table="companiesTable"
data-pagination="true"
data-id-table="companiesTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="companiesTable"
class="table table-striped snipe-table"
data-url="{{ route('api.companies.index') }}"
data-export-options='{
"fileName": "export-companies-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div>
@ -41,10 +53,5 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', [
'exportFile' => 'companies-export',
'search' => true,
'columns' => \App\Presenters\CompanyPresenter::dataTableLayout()
])
@include ('partials.bootstrap-table')
@stop

View file

@ -75,95 +75,153 @@
<!-- checked out assets table -->
<div class="table-responsive">
<table
name="companyAssets"
class="table table-striped snipe-table"
id="table"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-cookie-id-table="assetsListingTable"
data-pagination="true"
data-id-table="assetsListingTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="assetsListingTable"
class="table table-striped snipe-table"
data-url="{{route('api.assets.index',['company_id' => $company->id]) }}"
data-export-file="{{ str_slug($company->name) }}-assets"
data-cookie="true"
data-cookie-id-table="companyAssetsTable"
data-show-footer="true"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}">
data-export-options='{
"fileName": "export-companies-{{ str_slug($company->name) }}-assets-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div><!-- /asset_tab -->
<div class="tab-pane" id="licenses_tab">
<div class="table-responsive">
<table
name="companyLicenses"
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
data-cookie-id-table="licensesTable"
data-pagination="true"
data-id-table="licensesTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="licensesTable"
class="table table-striped snipe-table"
id="companyLicenses"
data-url="{{route('api.licenses.index',['company_id' => $company->id]) }}"
data-cookie="true"
data-export-file="{{ str_slug($company->name) }}-licenses"
data-cookie-id-table="companyLicenses"
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}">
data-export-options='{
"fileName": "export-companies-{{ str_slug($company->name) }}-licenses-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div><!-- /licenses-tab -->
<div class="tab-pane" id="accessories_tab">
<div class="table-responsive">
<table
name="companyAccessories"
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
data-cookie-id-table="accessoriesTable"
data-pagination="true"
data-id-table="accessoriesTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="accessoriesTable"
class="table table-striped snipe-table"
id="companyAccessories"
data-url="{{route('api.accessories.index',['company_id' => $company->id]) }}"
data-cookie="true"
data-export-file="{{ str_slug($company->name) }}-accessories"
data-cookie-id-table="companyAccessories"
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}">
</tbody>
data-export-options='{
"fileName": "export-companies-{{ str_slug($company->name) }}-accessories-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div><!-- /accessories-tab -->
<div class="tab-pane" id="consumables_tab">
<div class="table-responsive">
<table
name="companyConsumables"
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
data-cookie-id-table="consumablesTable"
data-pagination="true"
data-id-table="consumablesTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="consumablesTable"
class="table table-striped snipe-table"
id="companyConsumables"
data-url="{{route('api.consumables.index',['company_id' => $company->id]) }}"
data-cookie="true"
data-export-file="{{ str_slug($company->name) }}-consumables"
data-cookie-id-table="companyConsumables"
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}">
data-export-options='{
"fileName": "export-companies-{{ str_slug($company->name) }}-consumables-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div><!-- /consumables-tab -->
<div class="tab-pane" id="components_tab">
<div class="table-responsive">
<table
name="companyComponents"
data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}"
data-cookie-id-table="componentsTable"
data-pagination="true"
data-id-table="componentsTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="componentsTable"
class="table table-striped snipe-table"
id="companyUsers"
data-url="{{route('api.components.index',['company_id' => $company->id]) }}"
data-cookie="true"
data-export-file="{{ str_slug($company->name) }}-components"
data-cookie-id-table="companyComponents"
data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}">
data-export-options='{
"fileName": "export-companies-{{ str_slug($company->name) }}-components-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div><!-- /consumables-tab -->
<div class="tab-pane" id="users_tab">
<div class="table-responsive">
<table
name="companyUsers"
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
data-cookie-id-table="usersTable"
data-pagination="true"
data-id-table="usersTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="usersTable"
class="table table-striped snipe-table"
id="companyUsers"
data-url="{{route('api.users.index',['company_id' => $company->id]) }}"
data-cookie="true"
data-export-file="{{ str_slug($company->name) }}-users"
data-cookie-id-table="companyUsers"
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}">
data-export-options='{
"fileName": "export-companies-{{ str_slug($company->name) }}-users-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div><!-- /consumables-tab -->

View file

@ -23,8 +23,28 @@
'route' => ['component/bulk-form'],
'class' => 'form-inline' ]) }}
<div id="toolbar">
</div>
<table
data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}"
data-cookie-id-table="componentsTable"
data-pagination="true"
data-id-table="componentsTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-footer="true"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="componentsTable"
class="table table-striped snipe-table"
data-url="{{ route('api.components.index') }}"
data-export-options='{
"fileName": "export-components-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
<table
data-toolbar="#toolbar"

View file

@ -45,23 +45,36 @@
<div class="row">
<div class="col-md-12">
<div class="table table-responsive">
<table
name="component_users"
class="table table-striped snipe-table"
id="table"
data-url="{{ route('api.components.assets', $component->id)}}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="componentDetailTable-{{ config('version.hash_version') }}">
data-cookie-id-table="componentsCheckedoutTable"
data-pagination="true"
data-id-table="componentsCheckedoutTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-footer="true"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="componentsCheckedoutTable"
class="table table-striped snipe-table"
data-url="{{ route('api.components.assets', $component->id)}}"
data-export-options='{
"fileName": "export-components-{{ str_slug($component->name) }}-checkedout-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="name" data-formatter="hardwareLinkFormatter">{{ trans('general.asset') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="qty">{{ trans('general.qty') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="checkincheckout" data-formatter="componentsInOutFormatter">{{ trans('general.checkin') }}/{{ trans('general.checkout') }}</th>
</tr>
<tr>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="name" data-formatter="hardwareLinkFormatter">{{ trans('general.asset') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="qty">{{ trans('general.qty') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="checkincheckout" data-formatter="componentsInOutFormatter">{{ trans('general.checkin') }}/{{ trans('general.checkout') }}</th>
</tr>
</thead>
</table>
</div>
</div> <!-- .col-md-12-->
</div>

View file

@ -21,17 +21,28 @@
<div class="box box-default">
<div class="box-body">
<table
name="consumables"
class="table table-striped snipe-table"
id="table"
data-url="{{route('api.consumables.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="consumablesTable-{{ config('version.hash_version') }}-{{ config('version.hash_version') }}">
</tr>
</thead>
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
data-cookie-id-table="consumablesTable"
data-pagination="true"
data-id-table="consumablesTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-footer="true"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
data-toolbar="#toolbar"
id="consumablesTable"
class="table table-striped snipe-table"
data-url="{{ route('api.consumables.index') }}"
data-export-options='{
"fileName": "export-consumables-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div><!-- /.box-body -->
</div><!-- /.box -->

View file

@ -31,14 +31,26 @@
<div class="row">
<div class="col-md-12">
<div class="table table-responsive">
<table
name="consumable_users"
class="table table-striped snipe-table"
id="table"
data-url="{{route('api.consumables.showUsers', $consumable->id)}}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="consumableDetailTable-{{ config('version.hash_version') }}">
data-cookie-id-table="consumablesCheckedoutTable"
data-pagination="true"
data-id-table="consumablesCheckedoutTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-footer="true"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="consumablesCheckedoutTable"
class="table table-striped snipe-table"
data-url="{{route('api.consumables.showUsers', $consumable->id)}}"
data-export-options='{
"fileName": "export-consumables-{{ str_slug($consumable->name) }}-checkedout-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-searchable="false" data-sortable="false" data-field="name">{{ trans('general.user') }}</th>

View file

@ -163,25 +163,29 @@
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table
class="table table-striped snipe-table"
name="activityReport"
id="table"
data-height="400"
data-sort-order="desc"
data-show-export="false"
data-url="{{ route('api.activity.index', ['limit' => 25]) }}">
<thead>
<tr>
<th data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"></th>
<th class="col-sm-3" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th class="col-sm-2" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th class="col-sm-2" data-field="action_type">{{ trans('general.action') }}</th>
<th class="col-sm-3" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
<th class="col-sm-2" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
</tr>
</thead>
</table>
<table
data-cookie-id-table="dashActivityReport"
data-height="400"
data-side-pagination="server"
data-sort-order="desc"
data-sort-name="created_at"
id="dashActivityReport"
class="table table-striped snipe-table"
data-url="{{ route('api.activity.index', ['limit' => 25]) }}">
<thead>
<tr>
<th data-field="icon" data-visible="true" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"></th>
<th class="col-sm-3" data-visible="true" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th class="col-sm-2" data-visible="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th class="col-sm-2" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th>
<th class="col-sm-3" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
</tr>
</thead>
</table>
</div><!-- /.responsive -->
</div><!-- /.col -->
@ -232,19 +236,23 @@
<div class="row">
<div class="col-md-12">
<table
data-cookie-id-table="dashCategorySummary"
data-height="400"
data-side-pagination="server"
data-sort-order="desc"
data-sort-field="assets_count"
id="dashCategorySummary"
class="table table-striped snipe-table"
name="categorySummary"
id="table"
data-height="440"
data-url="{{ route('api.categories.index', ['sort' => 'assets_count', 'order' => 'asc']) }}">
<thead>
<tr>
<th class="col-sm-3" data-field="name" data-formatter="categoriesLinkFormatter" data-sortable="true">{{ trans('general.name') }}</th>
<th class="col-sm-3" data-field="category_type" data-sortable="true">{{ trans('general.type') }}</th>
<th class="col-sm-1" data-field="assets_count" data-sortable="true"><i class="fa fa-barcode"></i></th>
<th class="col-sm-1" data-field="accessories_count" data-sortable="true"><i class="fa fa-keyboard-o"></i></th>
<th class="col-sm-1" data-field="consumables_count" data-sortable="true"><i class="fa fa-tint"></i></th>
<th class="col-sm-1" data-field="components_count" data-sortable="true"><i class="fa fa-hdd-o"></i></th>
<th class="col-sm-3" data-visible="true" data-field="name" data-formatter="categoriesLinkFormatter" data-sortable="true">{{ trans('general.name') }}</th>
<th class="col-sm-3" data-visible="true" data-field="category_type" data-sortable="true">{{ trans('general.type') }}</th>
<th class="col-sm-1" data-visible="true" data-field="assets_count" data-sortable="true"><i class="fa fa-barcode"></i></th>
<th class="col-sm-1" data-visible="true" data-field="accessories_count" data-sortable="true"><i class="fa fa-keyboard-o"></i></th>
<th class="col-sm-1" data-visible="true" data-field="consumables_count" data-sortable="true"><i class="fa fa-tint"></i></th>
<th class="col-sm-1" data-visible="true" data-field="components_count" data-sortable="true"><i class="fa fa-hdd-o"></i></th>
</tr>
</thead>
</table>

View file

@ -17,14 +17,24 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="locations"
data-cookie-id-table="departmentsTable"
data-pagination="true"
data-id-table="departmentsTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="departmentsTable"
class="table table-striped snipe-table"
id="table"
data-url="{{ route('api.departments.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="departmentsTable-{{ config('version.hash_version') }}">
data-export-options='{
"fileName": "export-departments-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
@ -48,6 +58,6 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', ['exportFile' => 'locations-export', 'search' => true])
@include ('partials.bootstrap-table')
@stop

View file

@ -22,15 +22,27 @@
<div class="row">
<div class="col-md-12">
<div class="table table-responsive">
<table
name="location_users"
id="table-users"
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
data-cookie-id-table="departmentsUsersTable"
data-pagination="true"
data-id-table="departmentsUsersTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="departmentsUsersTable"
class="table table-striped snipe-table"
data-url="{{ route('api.users.index',['department_id'=> $department->id]) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="department_usersDetailTable">
<thead>
data-export-options='{
"fileName": "export-departments-{{ str_slug($department->name) }}-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>

View file

@ -20,13 +20,25 @@ Asset Depreciations
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="depreciations"
class="table table-striped snipe-table"
id="table"
data-url="{{ route('api.depreciations.index') }}"
data-cookie="true"
data-cookie-id-table="depreciationsTable-{{ config('version.hash_version') }}">
data-cookie-id-table="depreciationsTable"
data-pagination="true"
data-id-table="depreciationsTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="depreciationsTable"
class="table table-striped snipe-table"
data-url="{{ route('api.depreciations.index') }}"
data-export-options='{
"fileName": "export-depreciations-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>

View file

@ -19,20 +19,30 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="groups"
class="table table-striped snipe-table"
id="table"
data-toggle="table"
data-url="{{ route('api.groups.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="userGroupDisplay-{{ config('version.hash_version') }}">
<table
data-cookie-id-table="groupsTable"
data-pagination="true"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="groupsTable"
class="table table-striped snipe-table"
data-url="{{ route('api.groups.index') }}"
data-export-options='{
"fileName": "export-groups-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-switchable="true" data-sortable="false" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-switchable="true" data-sortable="true" data-field="name" data-formatter="groupsAdminLinkFormatter" data-visible="true">{{ trans('admin/groups/table.name') }}</th>
<th data-switchable="true" data-sortable="false" data-field="users_count" data-visible="true">{{ trans('admin/groups/table.users') }}</th>
<th data-switchable="true" data-sortable="true" data-field="users_count" data-visible="true">{{ trans('admin/groups/table.users') }}</th>
<th data-switchable="true" data-sortable="true" data-field="created_at" data-visible="true" data-formatter="dateDisplayFormatter">{{ trans('general.created_at') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions" data-formatter="groupsActionsFormatter">{{ trans('table.actions') }}</th>
</tr>

View file

@ -23,16 +23,23 @@
<div class="row">
<div class="col-md-12">
<div class="table table-responsive">
<table
name="groups_users"
id="table-users"
class="table table-striped snipe-table"
data-url="{{ route('api.users.index',['group_id'=> $group->id]) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="groups_usersDetailTable">
<thead>
<table
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
data-cookie-id-table="groupsUsersTable"
data-pagination="true"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
id="groupsUsersTable"
class="table table-striped snipe-table"
data-url="{{ route('api.users.index',['group_id'=> $group->id]) }}"
data-export-options='{
"fileName": "export-{{ str_slug($group->name) }}-group-users-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div>
@ -42,12 +49,16 @@
</div>
<div class="col-md-3">
@if (is_array($group->decodePermissions()))
<ul class="list-unstyled">
@foreach ($group->decodePermissions() as $permission_name => $permission)
<li>{!! ($permission == '1') ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>' !!} {{ e(str_replace('.', ': ', ucwords($permission_name))) }} </li>
@endforeach
</ul>
@else
<p>This group has no permissions.</p>
@endif
</div>
</div>
@ -55,10 +66,5 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', [
'exportFile' => 'groups-export',
'search' => true,
'columns' => \App\Presenters\UserPresenter::dataTableLayout()
])
@include ('partials.bootstrap-table')
@stop

View file

@ -190,7 +190,7 @@
user_add($(".status_id").val());
});
$("form").submit(function (event) {
$("#create-form").submit(function (event) {
event.preventDefault();
return sendForm();
});

View file

@ -73,25 +73,34 @@
@endif
<table
name="assets"
{{-- data-row-style="rowStyle" --}}
data-toolbar="#toolbar"
class="table table-striped snipe-table"
id="table"
data-advanced-search="true"
data-sort-order="name"
data-sort-order="asc"
data-show-export="true"
data-cookie="true"
data-id-table="advancedTable"
data-url="{{ route('api.assets.index',
array('status' => e(Input::get('status')),
'order_number'=>e(Input::get('order_number')),
'company_id'=>e(Input::get('company_id')),
'status_id'=>e(Input::get('status_id'))))}}"
data-click-to-select="true"
data-cookie-id-table="{{ e(Input::get('status')) }}assetTable">
data-advanced-search="true"
data-click-to-select="true"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-cookie-id-table="assetsListingTable"
data-pagination="true"
data-id-table="assetsListingTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-footer="true"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
data-toolbar="#toolbar"
id="assetsListingTable"
class="table table-striped snipe-table"
data-url="{{ route('api.assets.index',
array('status' => e(Input::get('status')),
'order_number'=>e(Input::get('order_number')),
'company_id'=>e(Input::get('company_id')),
'status_id'=>e(Input::get('status_id')))) }}"
data-export-options='{
"fileName": "export{{ (Input::has('status')) ? '-'.str_slug(Input::get('status')) : '' }}-assets-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div><!-- /.col -->
</div><!-- /.row -->
{{ Form::close() }}
@ -102,11 +111,6 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', [
'exportFile' => 'assets-export',
'search' => true,
'showFooter' => true,
'columns' => \App\Presenters\AssetPresenter::dataTableLayout()
])
@include('partials.bootstrap-table')
@stop

View file

@ -31,6 +31,7 @@
{{-- Page content --}}
@section('content')
<div class="row">
@if ($asset->deleted_at!='')
@ -589,7 +590,7 @@
'class' => 'form-inline',
'id' => 'bulkForm']) }}
<div id="toolbar">
<select name="bulk_actions" class="form-control select2" style="300px;">
<select name="bulk_actions" class="form-control select2" style="width: 150px;">
<option value="edit">Edit</option>
<option value="delete">Delete</option>
<option value="labels">Generate Labels</option>
@ -599,20 +600,24 @@
<!-- checked out assets table -->
<div class="table-responsive">
<table
name="assetAssetsTable"
data-toolbar="#toolbar"
class="table table-striped snipe-table"
id="assetAssetsTable"
data-toolbar="#toolbar"
data-show-export="true"
data-show-refresh="true"
data-export-options='{
"fileName": "{{ str_slug($asset->asset_tag) }}-assets-export",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
data-search="false"
data-url="{{route('api.assets.index',['assigned_to' => $asset->id, 'assigned_type' => 'App\Models\Asset']) }}"
data-show-export="true"
data-cookie="true"
data-show-footer="true"
data-cookie-id-table="assetAssetsTable"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}">
</table>
{{ Form::close() }}
</div>
</div><!-- /col -->
@ -624,78 +629,46 @@
<div class="row">
<div class="col-md-12">
@can('update', \App\Models\Asset::class)
<h6>{{ trans('general.asset_maintenances') }}
[ <a href="{{ route('maintenances.create', ['asset_id'=>$asset->id]) }}">{{ trans('button.add') }}</a> ]
</h6>
<div id="maintenance-toolbar">
<a href="{{ route('maintenances.create', ['asset_id' => $asset->id]) }}" class="btn btn-primary">Add Maintenance</a>
</div>
@endcan
<!-- Asset Maintenance table -->
@if (count($asset->assetmaintenances) > 0)
<table class="table table-striped">
<table
class="table table-striped snipe-table"
id="assetMaintenancesTable"
data-pagination="true"
data-id-table="assetMaintenancesTable"
data-search="true"
data-side-pagination="server"
data-toolbar="#maintenance-toolbar"
data-show-columns="true"
data-show-refresh="true"
data-show-export="true"
data-export-options='{
"fileName": "export-{{ $asset->asset_tag }}-maintenances",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
data-url="{{ route('api.maintenances.index', array('asset_id' => $asset->id)) }}"
data-cookie-id-table="assetMaintenancesTable">
<thead>
<tr>
<th>{{ trans('general.supplier') }}</th>
<th>{{ trans('admin/asset_maintenances/form.title') }}</th>
<th>{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}</th>
<th>{{ trans('admin/asset_maintenances/form.start_date') }}</th>
<th>{{ trans('admin/asset_maintenances/form.completion_date') }}</th>
<th>{{ trans('admin/asset_maintenances/form.notes') }}</th>
<th data-field="supplier" data-formatter="suppliersLinkObjFormatter">{{ trans('general.supplier') }}</th>
<th data-visible="true" data-field="title">{{ trans('admin/asset_maintenances/form.title') }}</th>
<th data-visible="true" data-field="asset_maintenance_type">{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}</th>
<th data-visible="true" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('admin/asset_maintenances/form.start_date') }}</th>
<th data-visible="true" data-field="completion_date" data-formatter="dateDisplayFormatter">{{ trans('admin/asset_maintenances/form.completion_date') }}</th>
<th data-visible="true" data-field="notes">{{ trans('admin/asset_maintenances/form.notes') }}</th>
<th>{{ trans('admin/asset_maintenances/table.is_warranty') }}</th>
<th>{{ trans('admin/asset_maintenances/form.cost') }}</th>
<th>{{ trans('general.admin') }}</th>
<th data-visible="true" data-field="cost">{{ trans('admin/asset_maintenances/form.cost') }}</th>
<th data-visible="true" data-field="user_id" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
@can('update', \App\Models\Asset::class)
<th>{{ trans('table.actions') }}</th>
<th data-visible="true" data-formatter="maintenanceActions">{{ trans('table.actions') }}</th>
@endcan
</tr>
</thead>
<tbody>
<?php $totalCost = 0; ?>
@foreach ($asset->assetmaintenances as $assetMaintenance)
@if (is_null($assetMaintenance->deleted_at))
<tr>
<td>
@if ($assetMaintenance->supplier)
<a href="{{ route('suppliers.show', $assetMaintenance->supplier_id) }}">{{ $assetMaintenance->supplier->name }}</a>
@else
(deleted supplier)
@endif
</td>
<td>{{ $assetMaintenance->title }}</td>
<td>{{ $assetMaintenance->asset_maintenance_type }}</td>
<td>{{ $assetMaintenance->start_date }}</td>
<td>{{ $assetMaintenance->completion_date }}</td>
<td>{{ $assetMaintenance->notes }}</td>
<td>{{ $assetMaintenance->is_warranty ? trans('admin/asset_maintenances/message.warranty') : trans('admin/asset_maintenances/message.not_warranty') }}</td>
<td class="text-right"><nobr>{{ $use_currency.$assetMaintenance->cost }}</nobr></td>
<td>
@if ($assetMaintenance->admin)
<a href="{{ route('users.show', $assetMaintenance->admin->id) }}">{{ $assetMaintenance->admin->present()->fullName() }}</a>
@endif
</td>
<?php $totalCost += $assetMaintenance->cost; ?>
@can('update', \App\Models\Asset::class)
<td>
<a href="{{ route('maintenances.edit', $assetMaintenance->id) }}" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a>
</td>
@endcan
</tr>
@endif
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="8" class="text-right">{{ is_numeric($totalCost) ? $use_currency.number_format($totalCost, 2) : $totalCost }}</td>
</tr>
</tfoot>
</table>
@else
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
@endif
</div> <!-- /.col-md-12 -->
</div> <!-- /.row -->
</div> <!-- /.tab-pane maintenances -->
@ -705,18 +678,24 @@
<div class="row">
<div class="col-md-12">
<table
name="asset-history"
id="asset-history"
class="table table-striped snipe-table"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="asset-history"
data-sort-order="desc"
data-show-columns="true"
id="assetHistory"
data-pagination="true"
data-id-table="assetHistory"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-refresh="true"
data-id-table="asset-history"
data-url="{{ route('api.activity.index', ['item_id' => $asset->id, 'item_type' => 'asset']) }}">
data-show-export="true"
data-export-options='{
"fileName": "export{{ (Input::has('status')) ? '-'.str_slug(Input::get('status')) : '' }}-assets",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
data-url="{{ route('api.activity.index', ['item_id' => $asset->id, 'item_type' => 'asset']) }}"
data-cookie-id-table="assetHistory">
<thead>
<tr>
<th data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"></th>

View file

@ -23,16 +23,28 @@
<div class="col-md-12">
<div class="box">
<div class="box-body">
<table
name="licenses"
id="table"
data-url="{{ route('api.licenses.index') }}"
class="table table-striped snipe-table"
data-cookie="true"
data-show-export="true"
data-click-to-select="true"
data-cookie-id-table="licenseTable">
</table>
<table
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
data-cookie-id-table="licensesTable"
data-pagination="true"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-footer="true"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="licensesTable"
class="table table-striped snipe-table"
data-url="{{ route('api.licenses.index') }}"
data-export-options='{
"fileName": "export-licenses-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div><!-- /.box-body -->
<div class="box-footer clearfix">
@ -43,10 +55,6 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', [
'exportFile' => 'licenses-export',
'search' => true,
'showFooter' => true,
'columns' => \App\Presenters\LicensePresenter::dataTableLayout()])
@include ('partials.bootstrap-table')
@stop

View file

@ -29,41 +29,39 @@
<!-- Custom Tabs -->
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_1" data-toggle="tab">Details</a></li>
<li><a href="#tab_2" data-toggle="tab">{{ trans('general.file_uploads') }}</a></li>
<li><a href="#tab_3" data-toggle="tab">{{ trans('admin/licenses/general.checkout_history') }}</a></li>
<li class="active"><a href="#details" data-toggle="tab">Details</a></li>
<li><a href="#uploads" data-toggle="tab">{{ trans('general.file_uploads') }}</a></li>
<li><a href="#history" data-toggle="tab">{{ trans('admin/licenses/general.checkout_history') }}</a></li>
<li class="pull-right"><a href="#" data-toggle="modal" data-target="#uploadFileModal"><i class="fa fa-paperclip"></i> {{ trans('button.upload') }}</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_1">
<div class="tab-pane active" id="details">
<div class="row">
<div class="col-md-8">
<div class="table-responsive">
<table
name="license-seats"
class="table table-striped snipe-table"
id="licenseSeats"
data-id-table="licenseSeats"
data-search="false"
data-url="{{ route('api.license.seats',['licence_id' => $license->id]) }}"
data-export="true"
data-export-options="{'fileName': 'license-seats'}"
data-cookie="true"
data-cookie-id-table="licenseSeats-Table">
<thead>
<tr>
<th class="col-md-1" data-field="name">{{ trans('admin/licenses/general.seat') }}</th>
<th class="col-md-3" data-formatter="usersLinkObjFormatter" data-field="assigned_user">{{ trans('admin/licenses/general.user') }}</th>
<th class="col-md-3" data-formatter="hardwareLinkObjFormatter" data-field="assigned_asset">{{ trans('admin/licenses/form.asset') }}</th>
<th class="col-md-3" data-formatter="locationsLinkObjFormatter" data-field="location">{{ trans('general.location') }}</th>
<th class="col-md-1" data-searchable="false" data-sortable="false" data-field="checkincheckout" data-formatter="licenseSeatInOutFormatter">{{ trans('general.checkin') }}/{{ trans('general.checkout') }}</th>
</tr>
</thead>
<tbody>
<table
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayoutSeats() }}"
data-cookie-id-table="seatsTable"
data-pagination="true"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="false"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="seatsTable"
class="table table-striped snipe-table"
data-url="{{ route('api.license.seats',['license_id' => $license->id]) }}"
data-export-options='{
"fileName": "export-seats-{{ str_slug($license->name) }}-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div>
@ -260,27 +258,53 @@
</div> <!--/.row-->
</div> <!-- /.tab-pane -->
<div class="tab-pane" id="tab_2">
<table class="table table-striped">
<div class="tab-pane" id="uploads">
<div class="table-responsive">
<div id="upload-toolbar">
<a href="#" data-toggle="modal" data-target="#uploadFileModal" class="btn btn-default"><i class="fa fa-paperclip"></i> {{ trans('button.upload') }}</a>
</div>
<table
data-cookie-id-table="licenseUploadsTable"
data-pagination="true"
data-id-table="assetsListingTable"
data-search="true"
data-side-pagination="client"
data-show-columns="true"
data-show-export="true"
data-show-footer="true"
data-toolbar="#upload-toolbar"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="licenseUploadsTable"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "export-license-uploads-{{ str_slug($license->name) }}-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
}'>
<thead>
<tr>
<th class="col-md-5">{{ trans('general.notes') }}</th>
<th class="col-md-5">{{ trans('general.file_name') }}</th>
<th class="col-md-2"></th>
<th class="col-md-2"></th>
<th class="col-md-4" data-field="file_name" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.file_name') }}</th>
<th class="col-md-4" data-field="notes" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.notes') }}</th>
<th class="col-md-4" data-field="created_at" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.created_at') }}</th>
<th class="col-md-2" data-field="download" data-visible="true" data-sortable="false" data-switchable="true">Download</th>
<th class="col-md-2" data-field="delete" data-visible="true" data-sortable="false" data-switchable="true">Delete</th>
</tr>
</thead>
<tbody>
@if (count($license->uploads) > 0)
@foreach ($license->uploads as $file)
<tr>
<td>
@if ($file->note)
{{ $file->note }}
@endif
</td>
<td>{{ $file->filename }}</td>
<td>
@if ($file->note)
{{ $file->note }}
@endif
</td>
<td>{{ $file->created_at }}</td>
<td>
@if ($file->filename)
<a href="{{ route('show/licensefile', [$license->id, $file->id]) }}" class="btn btn-default">
Download
@ -299,30 +323,41 @@
@endif
</tbody>
</table>
</div>
</div> <!-- /.tab-pane -->
<div class="tab-pane" id="tab_3">
<div class="tab-pane" id="history">
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table
class="table table-striped snipe-table"
name="assetHistory"
id="table"
id="historyTable"
data-pagination="true"
data-show-columns="true"
data-side-pagination="server"
data-show-refresh="true"
data-show-export="true"
data-sort-order="desc"
data-height="400"
data-url="{{ route('api.activity.index', ['item_id' => $license->id, 'item_type' => 'license']) }}">
data-export-options='{
"fileName": "export-{{ str_slug($license->name) }}-history-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
data-url="{{ route('api.activity.index', ['item_id' => $license->id, 'item_type' => 'license']) }}"
data-cookie-id-table="license-history">
<thead>
<tr>
<th data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"></th>
<th class="col-sm-2" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th class="col-sm-2" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th class="col-sm-2" data-field="action_type">{{ trans('general.action') }}</th>
<th class="col-sm-2" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
<th class="col-sm-2" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
<th class="col-sm-2" data-field="note">{{ trans('general.notes') }}</th>
<th class="col-sm-2" data-visible="true" data-sortable="true" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th class="col-sm-2"data-visible="true" data-sortable="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th>
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="note">{{ trans('general.notes') }}</th>
</tr>
</thead>
</table>
</div>
</div> <!-- /.col-md-12-->
</div> <!-- /.row-->
</div> <!-- /.tab-pane -->
@ -371,7 +406,5 @@
@section('moar_scripts')
@include ('partials.bootstrap-table')
@stop

View file

@ -19,41 +19,26 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="locations"
class="table table-striped snipe-table"
id="table"
data-url="{{ route('api.locations.index') }}"
data-cookie="true"
data-show-export="true"
data-click-to-select="true"
data-cookie-id-table="locationsTable-{{ config('version.hash_version') }}">
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-sortable="true" data-formatter="locationsLinkFormatter" data-field="name" data-searchable="true">{{ trans('admin/locations/table.name') }}</th>
<th data-sortable="true" data-field="image" data-visible="false" data-formatter="imageFormatter">{{ trans('general.image') }}</th>
<th data-sortable="true" data-field="parent" data-formatter="locationsLinkObjFormatter">{{ trans('admin/locations/table.parent') }}</th>
<th data-searchable="false" data-sortable="true" data-field="assets_count">{{ trans('admin/locations/table.assets_rtd') }}</th>
<th data-searchable="false" data-sortable="true" data-field="assigned_assets_count">{{ trans('admin/locations/table.assets_checkedout') }}</th>
<th data-searchable="false" data-sortable="true" data-field="users_count">{{ trans('general.people') }}</th>
<th data-searchable="true" data-sortable="true" data-field="currency">{{ trans('general.currency') }}</th>
<th data-searchable="true" data-sortable="true" data-field="address">{{ trans('admin/locations/table.address') }}</th>
<th data-searchable="true" data-sortable="true" data-field="city">{{ trans('admin/locations/table.city') }}
</th>
<th data-searchable="true" data-sortable="true" data-field="state">
{{ trans('admin/locations/table.state') }}
</th>
<th data-searchable="true" data-sortable="true" data-field="zip">
{{ trans('admin/locations/table.zip') }}
</th>
<th data-searchable="true" data-sortable="true" data-field="country">
{{ trans('admin/locations/table.country') }}
</th>
<th data-sortable="true" data-formatter="usersLinkObjFormatter" data-field="manager" data-searchable="true">{{ trans('admin/users/table.manager') }}</th>
<th data-switchable="false" data-formatter="locationsActionsFormatter" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>
data-columns="{{ \App\Presenters\LocationPresenter::dataTableLayout() }}"
data-cookie-id-table="locationTable"
data-pagination="true"
data-id-table="locationTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="locationTable"
class="table table-striped snipe-table"
data-url="{{ route('api.locations.index') }}"
data-export-options='{
"fileName": "export-locations-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
</div>

View file

@ -28,17 +28,27 @@
</div>
<div class="box-body">
<div class="table table-responsive">
<table
name="location_users"
id="location_usersDetailTable"
class="table table-striped snipe-table"
data-url="{{route('api.users.index', ['location_id' => $location->id])}}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="location_usersDetailTable"
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}">
</table>
<table
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
data-cookie-id-table="usersTable"
data-pagination="true"
data-id-table="usersTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="usersTable"
class="table table-striped snipe-table"
data-url="{{route('api.users.index', ['location_id' => $location->id])}}"
data-export-options='{
"fileName": "export-locations-{{ str_slug($location->name) }}-users-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div><!-- /.table-responsive -->
</div><!-- /.box-body -->
</div> <!--/.box-->
@ -51,15 +61,27 @@
</div>
<div class="box-body">
<div class="table table-responsive">
<table
name="location_assets"
id="location_assetsDetailTable"
data-url="{{route('api.assets.index', ['location_id' => $location->id]) }}"
class="table table-striped snipe-table"
data-show-footer="true"
data-cookie-id-table="location_assetsDetailTable"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}">
</table>
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-cookie-id-table="assetsListingTable"
data-pagination="true"
data-id-table="assetsListingTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="assetsListingTable"
class="table table-striped snipe-table"
data-url="{{route('api.assets.index', ['location_id' => $location->id]) }}"
data-export-options='{
"fileName": "export-locations-{{ str_slug($location->name) }}-assets-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div><!-- /.table-responsive -->
</div><!-- /.box-body -->
</div> <!--/.box-->

View file

@ -22,15 +22,26 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="manufacturers"
class="table table-striped snipe-table"
id="manufacturersTable"
data-url="{{route('api.manufacturers.index') }}"
data-cookie="true"
data-show-export="true"
data-click-to-select="true"
data-cookie-id-table="manufacturersTable">
data-columns="{{ \App\Presenters\ManufacturerPresenter::dataTableLayout() }}"
data-cookie-id-table="manufacturersTable"
data-pagination="true"
data-id-table="manufacturersTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="manufacturersTable"
class="table table-striped snipe-table"
data-url="{{route('api.manufacturers.index') }}"
data-export-options='{
"fileName": "export-manufacturers-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div>
@ -42,9 +53,5 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table',
['exportFile' => 'manufacturers-export',
'search' => true,
'columns' => \App\Presenters\ManufacturerPresenter::dataTableLayout()
])
@include ('partials.bootstrap-table')
@stop

View file

@ -46,53 +46,105 @@
<div class="tab-pane fade in active" id="assets">
<table
name="manufacturerDetail-assets"
id="manufacturerDetail-assets"
class="table table-striped snipe-table"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-cookie-id-table="assetsListingTable"
data-pagination="true"
data-id-table="assetsListingTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="assetsListingTable"
class="table table-striped snipe-table"
data-url="{{ route('api.assets.index', ['manufacturer_id' => $manufacturer->id, 'itemtype' => 'assets']) }}"
data-cookie-id-table="manufacturerDetail-assets"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}">
data-export-options='{
"fileName": "export-manufacturers-{{ str_slug($manufacturer->name) }}-assets-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div> <!-- /.tab-pane assets -->
<div class="tab-pane fade" id="licenses">
<table
name="manufacturerDetail-licenses"
id="manufacturerDetail-licenses"
class="table table-striped snipe-table"
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
data-cookie-id-table="licensesTable"
data-pagination="true"
data-id-table="licensesTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="licensesTable"
class="table table-striped snipe-table"
data-url="{{ route('api.licenses.index', ['manufacturer_id' => $manufacturer->id]) }}"
data-cookie-id-table="manufacturerDetail-licenses"
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}">
data-export-options='{
"fileName": "export-manufacturers-{{ str_slug($manufacturer->name) }}-licenses-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div><!-- /.tab-pan licenses-->
<div class="tab-pane fade" id="accessories">
<table
name="manufacturerDetail-accessories"
id="manufacturerDetail-accessories"
class="table table-striped snipe-table"
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
data-cookie-id-table="accessoriesTable"
data-pagination="true"
data-id-table="accessoriesTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="accessoriesTable"
class="table table-striped snipe-table"
data-url="{{ route('api.accessories.index', ['manufacturer_id' => $manufacturer->id]) }}"
data-cookie-id-table="manufacturerDetail-accessories"
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}">
data-export-options='{
"fileName": "export-manufacturers-{{ str_slug($manufacturer->name) }}-accessories-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div> <!-- /.tab-pan accessories-->
<div class="tab-pane fade" id="consumables">
<table
name="manufacturerDetail-consumables"
id="manufacturerDetail-consumables"
class="table table-striped snipe-table"
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
data-cookie-id-table="consumablesTable"
data-pagination="true"
data-id-table="consumablesTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="consumablesTable"
class="table table-striped snipe-table"
data-url="{{ route('api.consumables.index', ['manufacturer_id' => $manufacturer->id]) }}"
data-cookie-id-table="manufacturerDetail-consumables"
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}">
data-export-options='{
"fileName": "export-manufacturers-{{ str_slug($manufacturer->name) }}-consumabled-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div> <!-- /.tab-pan consumables-->
</div> <!-- /.tab-content -->

View file

@ -52,17 +52,26 @@
<button class="btn btn-primary" id="bulkEdit" disabled>Go</button>
</div>
@endif
<div class="table-responsive">
<table
data-cookie-id-table="modelsTable"
data-pagination="true"
data-id-table="modelsTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-toolbar="#toolbar"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="modelsTable"
data-url="{{ route('api.models.index', ['status'=> e(Input::get('status'))]) }}"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "export-asset-models-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<table
name="models"
class="table table-striped snipe-table"
id="table"
data-url="{{ route('api.models.index', ['status'=> e(Input::get('status'))]) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="modelsTable-{{ config('version.hash_version') }}">
<thead>
<tr>
<th data-checkbox="true" data-field="checkbox"></th>
@ -84,6 +93,7 @@
{{ Form::close() }}
</div>
</div>
</div>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div>

View file

@ -58,16 +58,25 @@
<button class="btn btn-primary" id="bulkEdit" disabled>Go</button>
</div>
<table
name="modelassets"
id="modelDetailAssets"
class="table table-striped snipe-table"
data-toolbar="#toolbar"
data-url="{{ route('api.assets.index',['model_id'=> $model->id]) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="modelDetailAssets"
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}">
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-cookie-id-table="assetListingTable"
data-pagination="true"
data-id-table="assetListingTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-toolbar="#toolbar"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="assetListingTable"
data-url="{{ route('api.assets.index',['model_id'=> $model->id]) }}"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "export-models-{{ $model->name }}-assets-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
{{ Form::close() }}
</div>
@ -184,5 +193,5 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', ['exportFile' => 'model' . $model->name . '-export', 'search' => true])
@include ('partials.bootstrap-table')
@stop

View file

@ -1,6 +1,5 @@
<script src="{{ asset('js/bootstrap-table.min.js') }}"></script>
<script src="{{ asset('js/extensions/mobile/bootstrap-table-mobile.js') }}"></script>
<script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.min.js?v=1') }}"></script>
<script src="{{ asset('js/extensions/export/bootstrap-table-export.js?v=1') }}"></script>
<script src="{{ asset('js/extensions/export/jquery.base64.js') }}"></script>
<script src="{{ asset('js/FileSaver.min.js') }}"></script>
@ -15,16 +14,14 @@
<script src="{{ asset('js/extensions/sticky-header/bootstrap-table-sticky-header.js') }}"></script>
@endif
<script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.js?v=1') }}"></script>
<script nonce="{{ csrf_token() }}">
var $table = $('.snipe-table');
$(function () {
buildTable($table, 20, 50);
});
function buildTable($el) {
var stickyHeaderOffsetY = 0;
if ( $('.navbar-fixed-top').css('height') ) {
@ -35,7 +32,6 @@
}
$('.snipe-table').bootstrapTable('destroy').bootstrapTable({
classes: 'table table-responsive table-no-bordered',
@ -44,89 +40,42 @@
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
},
stickyHeader: true,
stickyHeaderOffsetY: stickyHeaderOffsetY + 'px',
undefinedText: '',
iconsPrefix: 'fa',
{!! ((isset($search)) && ($search=='true')) ? 'search: "true",' : '' !!}
paginationVAlign: 'both',
sidePagination: '{{ (isset($clientSearch)) ? 'client' : 'server' }}',
sortable: true,
@if (!isset($nopages))
pageSize: 20,
pagination: true,
@endif
cookie: true,
cookieExpire: '2y',
cookieIdTable: '{{ Route::currentRouteName() }}',
@if (isset($columns))
columns: {!! $columns !!},
@endif
mobileResponsive: true,
maintainSelected: true,
trimOnSearch: false,
paginationFirstText: "{{ trans('general.first') }}",
paginationLastText: "{{ trans('general.last') }}",
paginationPreText: "{{ trans('general.previous') }}",
paginationNextText: "{{ trans('general.next') }}",
pageList: ['20', '30','50','100','150','200', '500'],
paginationVAlign: 'both',
formatLoadingMessage: function () {
return '<h4><i class="fa fa-spinner fa-spin" aria-hidden="true"></i> Loading... please wait.... </h4>';
},
icons: {
advancedSearchIcon: 'fa fa-search-plus',
paginationSwitchDown: 'fa-caret-square-o-down',
paginationSwitchUp: 'fa-caret-square-o-up',
columns: 'fa-columns',
@if (isset($multiSort))
sort: 'fa fa-sort-amount-desc',
plus: 'fa fa-plus',
minus: 'fa fa-minus',
@endif
refresh: 'fa-refresh'
},
exportDataType: 'all',
exportTypes: ['csv', 'excel', 'doc', 'txt','json', 'xml', 'pdf'],
exportOptions: {
fileName: '{{ ((isset($exportFile)) ? $exportFile : 'table') }}-' + (new Date()).toISOString().slice(0,10),
ignoreColumn: ['actions','image','change','checkbox','checkincheckout','icon'],
worksheetName: "Snipe-IT Export",
escape: false,
jspdf: {
orientation: 'l',
autotable: {
styles: {
rowHeight: 20,
fontSize: 10,
overflow: 'linebreak',
},
headerStyles: {fillColor: 255, textColor: 0},
//alternateRowStyles: {fillColor: [60, 69, 79], textColor: 255}
}
}
},
@if (!isset($simple_view))
showRefresh: true,
stickyHeader: true,
stickyHeaderOffsetY: stickyHeaderOffsetY + 'px',
@if (isset($showFooter))
showFooter: true,
@endif
showColumns: true,
trimOnSearch: false,
@if (isset($multiSort))
showMultiSort: true,
@endif
@endif
pageList: ['20', '30','50','100','150','200']
});
}
});
@ -220,6 +169,9 @@
if (destination=='groups') {
var dest = 'admin/groups';
}
if (destination=='maintenances') {
var dest = 'hardware/maintenances';
}
if ((row.available_actions) && (row.available_actions.clone === true)) {
actions += '<a href="{{ url('/') }}/' + dest + '/' + row.id + '/clone" class="btn btn-sm btn-info" data-tooltip="true" title="Clone"><i class="fa fa-copy"></i></a>&nbsp;';
@ -349,6 +301,7 @@
'locations',
'users',
'manufacturers',
'maintenances',
'statuslabels',
'models',
'licenses',
@ -524,11 +477,14 @@
}
function sumFormatter(data) {
var field = this.field;
var total_sum = data.reduce(function(sum, row) {
return (sum) + (parseFloat(row[field]) || 0);
}, 0);
return total_sum.toFixed(2);
if (Array.isArray(data)) {
var field = this.field;
var total_sum = data.reduce(function(sum, row) {
return (sum) + (parseFloat(row[field]) || 0);
}, 0);
return total_sum.toFixed(2);
}
return 'not an array';
}

View file

@ -2,90 +2,68 @@
{{-- Page title --}}
@section('title')
{{ trans('general.accessory_report') }}
@parent
{{ trans('general.accessory_report') }}
@parent
@stop
{{-- Page content --}}
@section('content')
<div class="row">
<div class="col-md-12">
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<div class="row">
<div class="col-md-12">
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="accessoriesReport"
id="table"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="accessoriesReportTable">
<table
data-cookie-id-table="accessoriesReport"
data-pagination="true"
data-id-table="accessoriesReport"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="accessoriesReport"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "accessory-report-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr role="row">
<thead>
<tr>
<th class="col-sm-1">{{ trans('admin/companies/table.title') }}</th>
<th class="col-sm-1">{{ trans('admin/accessories/table.title') }}</th>
<th class="col-sm-1">{{ trans('admin/accessories/general.total') }}</th>
<th class="col-sm-1">{{ trans('admin/accessories/general.remaining') }}</th>
</tr>
</thead>
<tbody>
</thead>
<tbody>
@foreach ($accessories as $accessory)
<tr>
<td>{{ is_null($accessory->company) ? '' : $accessory->company->name }}</td>
<td>{{ $accessory->name }}</td>
<td>{{ $accessory->qty }}</td>
<td>{{ $accessory->numRemaining() }}</td>
</tr>
<tr>
<td>{{ is_null($accessory->company) ? '' : $accessory->company->name }}</td>
<td>{{ $accessory->name }}</td>
<td>{{ $accessory->qty }}</td>
<td>{{ $accessory->numRemaining() }}</td>
</tr>
@endforeach
</tbody>
</table>
</tbody>
</table>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@section('moar_scripts')
<script src="{{ asset('js/bootstrap-table.js') }}"></script>
<script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.js') }}"></script>
<script src="{{ asset('js/extensions/mobile/bootstrap-table-mobile.js') }}"></script>
<script src="{{ asset('js/extensions/export/bootstrap-table-export.js') }}"></script>
<script src="{{ asset('js/extensions/export/tableExport.js') }}"></script>
<script src="{{ asset('js/extensions/export/jquery.base64.js') }}"></script>
<script type="text/javascript">
$('#table').bootstrapTable({
classes: 'table table-responsive table-no-bordered',
undefinedText: '',
iconsPrefix: 'fa',
showRefresh: true,
search: true,
pageSize: {{ $snipeSettings->per_page }},
pagination: true,
sidePagination: 'client',
sortable: true,
cookie: true,
mobileResponsive: true,
showExport: true,
showColumns: true,
exportDataType: 'all',
exportTypes: ['csv', 'txt','json', 'xml'],
maintainSelected: true,
paginationFirstText: "{{ trans('general.first') }}",
paginationLastText: "{{ trans('general.last') }}",
paginationPreText: "{{ trans('general.previous') }}",
paginationNextText: "{{ trans('general.next') }}",
pageList: ['10','25','50','100','150','200'],
icons: {
paginationSwitchDown: 'fa-caret-square-o-down',
paginationSwitchUp: 'fa-caret-square-o-up',
columns: 'fa-columns',
refresh: 'fa-refresh'
},
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table')
@stop
});
</script>
@stop
@stop

View file

@ -15,14 +15,23 @@
<div class="box-body">
<table
name="activityReport"
data-toolbar="#toolbar"
class="table table-striped snipe-table"
id="table"
data-sort-order="desc"
data-url="{{ route('api.activity.index') }}"
data-cookie="true"
data-cookie-id-table="activityReportTable">
data-cookie-id-table="activityReport"
data-pagination="true"
data-id-table="activityReport"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="activityReport"
data-url="{{ route('api.activity.index') }}"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "activity-report-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"></th>

View file

@ -14,14 +14,25 @@
<div class="box-body">
<div class="table-responsive">
<table
name="maintenancesReport"
id="table"
class="table table-striped snipe-table"
data-cookie-id-table="maintenancesReport"
data-pagination="true"
data-show-footer="true"
data-id-table="maintenancesReport"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="maintenancesReport"
data-url="{{route('api.maintenances.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="maintenancesReport-{{ config('version.hash_version') }}">
class="table table-striped snipe-table"
data-export-options='{
"fileName": "maintenance-report-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-field="company" data-sortable="false" data-visible="false">{{ trans('admin/companies/table.title') }}</th>
@ -48,8 +59,5 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table',
['exportFile' => 'maintenances-export',
'search' => true,
'showFooter' => true ])
@include ('partials.bootstrap-table')
@stop

View file

@ -15,14 +15,23 @@
<div class="box-body">
<table
name="auditReport"
data-toolbar="#toolbar"
class="table table-striped snipe-table"
id="table"
data-cookie-id-table="auditReport"
data-pagination="true"
data-id-table="auditReport"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="auditReport"
data-url="{{ route('api.activity.index', ['action_type' => 'audit']) }}"
data-cookie="true"
data-cookie-id-table="activityReportTable"
data-row-style="dateRowCheckStyle">
class="table table-striped snipe-table"
data-export-options='{
"fileName": "activity-report-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th class="col-sm-1" data-field="image" data-visible="false" data-formatter="imageFormatter">{{ trans('admin/hardware/table.image') }}</th>
@ -45,5 +54,5 @@
@section('moar_scripts')
@include ('partials.bootstrap-table', ['exportFile' => 'audit-export', 'search' => false])
@include ('partials.bootstrap-table')
@stop

View file

@ -17,13 +17,24 @@
@if (($depreciations) && ($depreciations->count() > 0))
<div class="table-responsive">
<table
class="table table-striped table-bordered table-compact"
name="depreciationReport"
id="table"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="depreciationReportTable">
<table
data-cookie-id-table="depreciationReport"
data-pagination="true"
data-id-table="depreciationReport"
data-search="true"
data-side-pagination="client"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="depreciationReport"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "depreciation-report-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr role="row">
<th class="col-sm-1" data-visible="false">{{ trans('admin/companies/table.title') }}</th>
@ -155,44 +166,5 @@
@stop
@section('moar_scripts')
<script src="{{ asset('js/bootstrap-table.js') }}"></script>
<script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.js') }}"></script>
<script src="{{ asset('js/extensions/mobile/bootstrap-table-mobile.js') }}"></script>
<script src="{{ asset('js/extensions/export/bootstrap-table-export.js') }}"></script>
<script src="{{ asset('js/extensions/export/tableExport.js') }}"></script>
<script src="{{ asset('js/extensions/export/jquery.base64.js') }}"></script>
<script type="text/javascript">
$('#table').bootstrapTable({
classes: 'table table-responsive table-striped table-bordered',
undefinedText: '',
iconsPrefix: 'fa',
showRefresh: true,
search: true,
pageSize: {{ $snipeSettings->per_page }},
pagination: true,
sidePagination: 'client',
sortable: true,
cookie: true,
mobileResponsive: true,
showExport: true,
showColumns: true,
exportDataType: 'all',
exportTypes: ['csv', 'txt','json', 'xml'],
maintainSelected: true,
paginationFirstText: "{{ trans('general.first') }}",
paginationLastText: "{{ trans('general.last') }}",
paginationPreText: "{{ trans('general.previous') }}",
paginationNextText: "{{ trans('general.next') }}",
pageList: ['10','25','50','100','150','200'],
icons: {
paginationSwitchDown: 'fa-caret-square-o-down',
paginationSwitchUp: 'fa-caret-square-o-up',
columns: 'fa-columns',
refresh: 'fa-refresh'
},
});
</script>
@include ('partials.bootstrap-table')
@stop

View file

@ -13,13 +13,23 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="licensesReport"
id="table"
class="table table-striped"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="licensesReportTable">
data-cookie-id-table="licensesReport"
data-pagination="true"
data-id-table="licensesReport"
data-search="true"
data-side-pagination="client"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="licensesReport"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "license-report-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr role="row">
<th class="col-sm-1">{{ trans('admin/companies/table.title') }}</th>
@ -71,42 +81,5 @@
@stop
@section('moar_scripts')
<script src="{{ asset('js/bootstrap-table.js') }}"></script>
<script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.js') }}"></script>
<script src="{{ asset('js/extensions/mobile/bootstrap-table-mobile.js') }}"></script>
<script src="{{ asset('js/extensions/export/bootstrap-table-export.js') }}"></script>
<script src="{{ asset('js/extensions/export/tableExport.js') }}"></script>
<script src="{{ asset('js/extensions/export/jquery.base64.js') }}"></script>
<script type="text/javascript">
$('#table').bootstrapTable({
classes: 'table table-responsive table-no-bordered',
undefinedText: '',
iconsPrefix: 'fa',
showRefresh: true,
search: true,
pageSize: {{ $snipeSettings->per_page }},
pagination: true,
sidePagination: 'client',
sortable: true,
cookie: true,
mobileResponsive: true,
showExport: true,
showColumns: true,
exportDataType: 'all',
exportTypes: ['csv', 'txt','json', 'xml'],
maintainSelected: true,
paginationFirstText: "{{ trans('general.first') }}",
paginationLastText: "{{ trans('general.last') }}",
paginationPreText: "{{ trans('general.previous') }}",
paginationNextText: "{{ trans('general.next') }}",
pageList: ['10','25','50','100','150','200'],
icons: {
paginationSwitchDown: 'fa-caret-square-o-down',
paginationSwitchUp: 'fa-caret-square-o-up',
columns: 'fa-columns',
refresh: 'fa-refresh'
},
});
</script>
@include ('partials.bootstrap-table')
@stop

View file

@ -16,12 +16,24 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="unacceptedAssetsReport"
id="table"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="unacceptedAssets">
<table
data-cookie-id-table="unacceptedAssetsReport"
data-pagination="true"
data-id-table="unacceptedAssetsReport"
data-search="true"
data-side-pagination="client"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="unacceptedAssetsReport"
data-url="{{route('api.maintenances.index') }}"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "maintenance-report-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr role="row">
<th class="col-sm-1">{{ trans('admin/companies/table.title') }}</th>
@ -60,42 +72,5 @@
@stop
@section('moar_scripts')
<script src="{{ asset('js/bootstrap-table.js') }}"></script>
<script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.js') }}"></script>
<script src="{{ asset('js/extensions/mobile/bootstrap-table-mobile.js') }}"></script>
<script src="{{ asset('js/extensions/export/bootstrap-table-export.js') }}"></script>
<script src="{{ asset('js/extensions/export/tableExport.js') }}"></script>
<script src="{{ asset('js/extensions/export/jquery.base64.js') }}"></script>
<script type="text/javascript">
$('#table').bootstrapTable({
classes: 'table table-responsive table-no-bordered',
undefinedText: '',
iconsPrefix: 'fa',
showRefresh: true,
search: true,
pageSize: {{ $snipeSettings->per_page }},
pagination: true,
sidePagination: 'client',
sortable: true,
cookie: true,
mobileResponsive: true,
showExport: true,
showColumns: true,
exportDataType: 'all',
exportTypes: ['csv', 'txt','json', 'xml'],
maintainSelected: true,
paginationFirstText: "{{ trans('general.first') }}",
paginationLastText: "{{ trans('general.last') }}",
paginationPreText: "{{ trans('general.previous') }}",
paginationNextText: "{{ trans('general.next') }}",
pageList: ['10','25','50','100','150','200'],
icons: {
paginationSwitchDown: 'fa-caret-square-o-down',
paginationSwitchUp: 'fa-caret-square-o-up',
columns: 'fa-columns',
refresh: 'fa-refresh'
},
});
</script>
@include ('partials.bootstrap-table')
@stop

View file

@ -21,14 +21,23 @@
<div class="box-body">
<div class="table-responsive">
<table
name="statuslabels"
id="table"
class="snipe-table"
data-url="{{ route('api.statuslabels.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="statuslabelsTable-{{ config('version.hash_version') }}">
<table
data-cookie-id-table="statuslabelsTable"
data-pagination="true"
data-id-table="statuslabelsTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="statuslabelsTable"
class="table table-striped snipe-table"
data-url="{{ route('api.statuslabels.index') }}"
data-export-options='{
"fileName": "export-statuslabels-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
@ -79,7 +88,7 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', ['exportFile' => 'statuslabels-export', 'search' => true])
@include ('partials.bootstrap-table')
<script nonce="{{ csrf_token() }}">
function colorSqFormatter(value, row) {

View file

@ -21,14 +21,24 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="suppliers"
id="table"
class="table table-striped snipe-table"
data-url="{{ route('api.suppliers.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="suppliersTable-{{ config('version.hash_version') }}">
<table
data-cookie-id-table="suppliersTable"
data-pagination="true"
data-id-table="suppliersTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="suppliersTable"
class="table table-striped snipe-table"
data-url="{{ route('api.suppliers.index') }}"
data-export-options='{
"fileName": "export-suppliers-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('admin/suppliers/table.id') }}</th>

View file

@ -32,15 +32,26 @@
<div class="box-body">
<!-- checked out suppliers table -->
<div class="table-responsive">
<table
name="suppliers_assets"
id="table-users"
class="table table-striped snipe-table"
data-url="{{route('api.assets.index', ['supplier_id' => $supplier->id])}}"
data-cookie="true"
data-click-to-select="true"
data-search="true"
data-cookie-id-table="assets_by_supplierTable">
data-cookie-id-table="suppliersAssetsTable"
data-pagination="true"
data-id-table="suppliersAssetsTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="suppliersAssetsTable"
class="table table-striped snipe-table"
data-url="{{route('api.assets.index', ['supplier_id' => $supplier->id])}}"
data-export-options='{
"fileName": "export-{{ str_slug($supplier->name) }}-assets-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-searchable="false" data-visible="false" data-sortable="true" data-field="id">{{ trans('general.id') }}</th>
@ -72,26 +83,24 @@
<div class="table-responsive">
<table
name="suppliers_accessories"
id="table-users"
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
data-cookie-id-table="suppliersAccessoriesTable"
data-pagination="true"
data-id-table="suppliersAccessoriesTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="suppliersAccessoriesTable"
class="table table-striped snipe-table"
data-url="{{route('api.accessories.index', ['supplier_id' => $supplier->id])}}"
data-search="true"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="accessories_by_supplierTable">
<thead>
<tr>
<th data-searchable="false" data-visible="false" data-sortable="true" data-field="id">{{ trans('general.id') }}</th>
<th data-searchable="false" data-sortable="true" data-formatter="accessoriesLinkFormatter" data-field="name">{{ trans('general.name') }}</th>
<th data-searchable="false" data-sortable="false" data-field="model_number">{{ trans('admin/models/table.modelnumber') }}</th>
<th data-searchable="false" data-sortable="false" data-field="asset_tag">{{ trans('admin/hardware/form.tag') }}</th>
<th data-searchable="false" data-sortable="false" data-field="serial">{{ trans('admin/hardware/form.serial') }}</th>
<th data-searchable="false" data-visible="false" data-sortable="true" data-field="category" data-formatter="categoriesLinkObjFormatter">{{ trans('general.category') }}</th>
<th data-field="purchase_cost" data-footer-formatter="sumFormatter">{{ trans('general.purchase_cost') }}</th>
<th data-searchable="false" data-sortable="false" data-field="actions" data-formatter="accessoriesActionsFormatter">{{ trans('table.actions') }}</th>
</tr>
</thead>
data-export-options='{
"fileName": "export-{{ str_slug($supplier->name) }}-accessories-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div><!-- /.table-responsive -->
</div><!-- /.box-body -->
@ -111,28 +120,29 @@
<div class="box-body">
<div class="table-responsive">
<table
name="suppliers_licenses"
id="table-users"
class="table table-striped snipe-table"
data-url="{{route('api.licenses.index', ['supplier_id' => $supplier->id])}}"
data-cookie="true"
data-search="true"
data-click-to-select="true"
data-cookie-id-table="licenses_by_supplierTable">
<thead>
<tr>
<th data-searchable="false" data-visible="false" data-sortable="true" data-field="id">{{ trans('general.id') }}</th>
<th data-searchable="true" data-sortable="true" data-formatter="licensesLinkFormatter" data-field="name">{{ trans('general.name') }}</th>
<th data-searchable="true" data-sortable="true" data-formatter="licensesLinkFormatter" data-field="product_key">{{ trans('admin/licenses/form.license_key') }}</th>
<th data-searchable="true" data-sortable="true" data-formatter="licensesLinkFormatter" data-field="license_email">{{ trans('admin/licenses/form.to_email') }}</th>
<th data-searchable="true" data-sortable="false" data-field="seats">{{ trans('admin/licenses/form.seats') }}</th>
<th data-searchable="true" data-sortable="false" data-field="free_seats_count">{{ trans('admin/accessories/general.remaining') }}</th>
<th data-field="purchase_cost" data-footer-formatter="sumFormatter">{{ trans('general.purchase_cost') }}</th>
<th data-searchable="false" data-sortable="false" data-field="actions" data-formatter="licensesActionsFormatter">{{ trans('table.actions') }}</th>
<th data-searchable="false" data-sortable="false" data-field="checkincheckout" data-formatter="licensesActionsFormatter">{{ trans('table.actions') }}</th>
</tr>
</thead>
<table
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
data-cookie-id-table="suppliersLicensesTable"
data-pagination="true"
data-id-table="suppliersLicensesTable"
data-search="true"
data-show-footer="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
id="suppliersLicensesTable"
class="table table-striped snipe-table"
data-url="{{route('api.licenses.index', ['supplier_id' => $supplier->id])}}"
data-export-options='{
"fileName": "export-{{ str_slug($supplier->name) }}-licenses-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div><!-- /.table-responsive -->
</div><!-- /.box-body -->

View file

@ -57,21 +57,30 @@
@endcan
@endif
<table
name="users"
data-toolbar="#toolbar"
data-toggle="table"
data-sort-order="name"
data-sort-order="asc"
class="table table-striped snipe-table"
id="table"
data-url="{{ route('api.users.index',
array('deleted'=> (Input::get('status')=='deleted') ? 'true' : 'false','company_id'=>e(Input::get('company_id')))) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="userTableDisplay-{{ config('version.hash_version') }}">
</table>
<table
data-click-to-select="true"
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
data-cookie-id-table="usersTable"
data-pagination="true"
data-id-table="usersTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
data-toolbar="#toolbar"
id="usersTable"
class="table table-striped snipe-table"
data-url="{{ route('api.users.index',
array('deleted'=> (Input::get('status')=='deleted') ? 'true' : 'false','company_id'=>e(Input::get('company_id')))) }}"
data-export-options='{
"fileName": "export-users-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
{{ Form::close() }}
</div><!-- /.box-body -->
@ -82,11 +91,7 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table',
['exportFile' => 'users-export',
'search' => true,
'columns' => \App\Presenters\UserPresenter::dataTableLayout()
])
@include ('partials.bootstrap-table')
@stop

View file

@ -15,7 +15,7 @@
<ul class="nav nav-tabs hidden-print">
<li class="active">
<a href="#info_tab" data-toggle="tab">
<a href="#details" data-toggle="tab">
<span class="hidden-lg hidden-md">
<i class="fa fa-info-circle"></i>
</span>
@ -101,7 +101,7 @@
</ul>
<div class="tab-content">
<div class="tab-pane active" id="info_tab">
<div class="tab-pane active" id="details">
<div class="row">
@if ($user->deleted_at!='')
<div class="col-md-12">
@ -114,7 +114,7 @@
</div>
</div>
@endif
<div class="col-md-1">
<div class="col-md-2 text-center">
@if ($user->avatar)
<img src="/uploads/avatars/{{ $user->avatar }}" class="avatar img-thumbnail hidden-print">
@else
@ -470,11 +470,24 @@
<div class="table-responsive">
<table
class="table table-striped snipe-table"
name="userActivityReport"
id="table4
data-click-to-select="true"
data-cookie-id-table="usersHistoryTable"
data-pagination="true"
data-id-table="usersHistoryTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="desc"
data-url="{{ route('api.activity.index', ['target_id' => $user->id, 'target_type' => 'user']) }}">
data-toolbar="#toolbar"
id="usersHistoryTable"
class="table table-striped snipe-table"
data-url="{{ route('api.activity.index', ['target_id' => $user->id, 'target_type' => 'user']) }}"
data-export-options='{
"fileName": "export-{{ str_slug($user->present()->fullName ) }}-history-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"></th>

View file

@ -27,4 +27,49 @@ class UserTest extends BaseTest
$this->tester->seeRecord('users', $values);
}
public function testFirstNameSplit()
{
$fullname = "Natalia Allanovna Romanova-O'Shostakova";
$expected_firstname = 'Natalia';
$expected_lastname = "Allanovna Romanova-O'Shostakova";
$user = User::generateFormattedNameFromFullName('firstname', $fullname);
$this->assertEquals($expected_firstname, $user['first_name']);
$this->assertEquals($expected_lastname, $user['last_name']);
}
public function testFirstName()
{
$fullname = "Natalia Allanovna Romanova-O'Shostakova";
$expected_username = 'natalia';
$user = User::generateFormattedNameFromFullName('firstname', $fullname);
$this->assertEquals($expected_username, $user['username']);
}
public function testFirstNameDotLastName()
{
$fullname = "Natalia Allanovna Romanova-O'Shostakova";
$expected_username = 'natalia.allanovna-romanova-oshostakova';
$user = User::generateFormattedNameFromFullName('firstname.lastname', $fullname);
$this->assertEquals($expected_username, $user['username']);
}
public function testFirstInitialLastName()
{
$fullname = "Natalia Allanovna Romanova-O'Shostakova";
$expected_username = 'nallanovna-romanova-oshostakova';
$user = User::generateFormattedNameFromFullName('filastname', $fullname);
$this->assertEquals($expected_username, $user['username']);
}
public function testFirstInitialUnderscoreLastName()
{
$fullname = "Natalia Allanovna Romanova-O'Shostakova";
$expected_username = 'natalia_allanovna-romanova-oshostakova';
$user = User::generateFormattedNameFromFullName('firstname_lastname', $fullname);
$this->assertEquals($expected_username, $user['username']);
}
}