Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net> # Conflicts: # public/js/dist/all.js # public/js/dist/all.js.map # public/js/dist/bootstrap-table.js # public/mix-manifest.json
This commit is contained in:
@@ -27,6 +27,35 @@ class StorageHelper
|
||||
}
|
||||
}
|
||||
|
||||
public static function getMediaType($file_with_path) {
|
||||
|
||||
// The file exists and is allowed to be displayed inline
|
||||
if (Storage::exists($file_with_path)) {
|
||||
$fileinfo = pathinfo($file_with_path);
|
||||
$extension = strtolower($fileinfo['extension']);
|
||||
switch ($extension) {
|
||||
case 'jpg':
|
||||
case 'png':
|
||||
case 'gif':
|
||||
case 'svg':
|
||||
case 'webp':
|
||||
return 'image';
|
||||
case 'pdf':
|
||||
return 'pdf';
|
||||
case 'mp3':
|
||||
case 'wav':
|
||||
case 'ogg':
|
||||
return 'audio';
|
||||
case 'mp4':
|
||||
case 'webm':
|
||||
case 'mov':
|
||||
return 'video';
|
||||
default:
|
||||
return $extension; // Default for unknown types
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This determines the file types that should be allowed inline and checks their fileinfo extension
|
||||
@@ -52,7 +81,6 @@ class StorageHelper
|
||||
'pdf',
|
||||
'png',
|
||||
'svg',
|
||||
'svg',
|
||||
'wav',
|
||||
'webm',
|
||||
'webp',
|
||||
|
||||
@@ -98,15 +98,22 @@ class UploadedFilesController extends Controller
|
||||
'created_at',
|
||||
];
|
||||
|
||||
$uploads = $object->uploads();
|
||||
$offset = ($request->input('offset') > $object->count()) ? $object->count() : abs($request->input('offset'));
|
||||
|
||||
$uploads = Actionlog::select('action_logs.*')
|
||||
->whereNotNull('filename')
|
||||
->where('item_type', self::$map_object_type[$object_type])
|
||||
->where('item_id', $object->id)
|
||||
->where('action_type', '=', 'uploaded')
|
||||
->with('adminuser');
|
||||
|
||||
$offset = ($request->input('offset') > $uploads->count()) ? $uploads->count() : abs($request->input('offset'));
|
||||
$limit = app('api_limit_value');
|
||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
||||
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'action_logs.created_at';
|
||||
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
|
||||
|
||||
// Text search on action_logs fields
|
||||
// We could use the normal Actionlogs text scope, but it's a very heavy query since it's searcghing across all relations
|
||||
// And we generally won't need that here
|
||||
// We could use the normal Actionlogs text scope, but it's a very heavy query since it's searching across all relations
|
||||
// and we generally won't need that here
|
||||
if ($request->filled('search')) {
|
||||
|
||||
$uploads->where(
|
||||
@@ -117,8 +124,10 @@ class UploadedFilesController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
$total = $uploads->count();
|
||||
$uploads = $uploads->skip($offset)->take($limit)->orderBy($sort, $order)->get();
|
||||
return (new UploadedFilesTransformer())->transformFiles($uploads, $uploads->count());
|
||||
|
||||
return (new UploadedFilesTransformer())->transformFiles($uploads, $total);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -108,6 +108,14 @@ class UsersController extends Controller
|
||||
$users = $users->where('users.activated', '=', $request->input('activated'));
|
||||
}
|
||||
|
||||
if ($request->input('admins') == 'true') {
|
||||
$users = $users->OnlyAdminsAndSuperAdmins();
|
||||
}
|
||||
|
||||
if ($request->input('superadmins') == 'true') {
|
||||
$users = $users->OnlySuperAdmins();
|
||||
}
|
||||
|
||||
if ($request->filled('company_id')) {
|
||||
$users = $users->where('users.company_id', '=', $request->input('company_id'));
|
||||
}
|
||||
|
||||
@@ -304,13 +304,16 @@ class LicensesController extends Controller
|
||||
$response = new StreamedResponse(function () {
|
||||
// Open output stream
|
||||
$handle = fopen('php://output', 'w');
|
||||
$licenses= License::with('company',
|
||||
$licenses = License::with('company',
|
||||
'manufacturer',
|
||||
'category',
|
||||
'supplier',
|
||||
'adminuser',
|
||||
'assignedusers')
|
||||
->orderBy('created_at', 'DESC');
|
||||
'assignedusers');
|
||||
if (request()->filled('category_id')) {
|
||||
$licenses = $licenses->where('category_id', request()->input('category_id'));
|
||||
}
|
||||
$licenses = $licenses->orderBy('created_at', 'DESC');
|
||||
Company::scopeCompanyables($licenses)
|
||||
->chunk(500, function ($licenses) use ($handle) {
|
||||
$headers = [
|
||||
|
||||
@@ -25,32 +25,22 @@ class UserFilesController extends Controller
|
||||
public function store(UploadFileRequest $request, User $user)
|
||||
{
|
||||
$this->authorize('update', $user);
|
||||
$files = $request->file('file');
|
||||
|
||||
if (is_null($files)) {
|
||||
return redirect()->back()->with('error', trans('admin/users/message.upload.nofiles'));
|
||||
}
|
||||
foreach ($files as $file) {
|
||||
$file_name = $request->handleFile('private_uploads/users/', 'user-'.$user->id, $file);
|
||||
|
||||
//Log the uploaded file to the log
|
||||
$logAction = new Actionlog();
|
||||
$logAction->item_id = $user->id;
|
||||
$logAction->item_type = User::class;
|
||||
$logAction->created_by = auth()->id();
|
||||
$logAction->note = $request->input('notes');
|
||||
$logAction->target_id = null;
|
||||
$logAction->created_at = date("Y-m-d H:i:s");
|
||||
$logAction->filename = $file_name;
|
||||
$logAction->action_type = 'uploaded';
|
||||
|
||||
if (! $logAction->save()) {
|
||||
return JsonResponse::create(['error' => 'Failed validation: '.print_r($logAction->getErrors(), true)], 500);
|
||||
if ($request->hasFile('file')) {
|
||||
if (! Storage::exists('private_uploads/users')) {
|
||||
Storage::makeDirectory('private_uploads/users', 775);
|
||||
}
|
||||
|
||||
return redirect()->back()->withFragment('files')->with('success', trans('admin/users/message.upload.success'));
|
||||
foreach ($request->file('file') as $file) {
|
||||
$file_name = $request->handleFile('private_uploads/users/','user-'.$user->id, $file);
|
||||
$user->logUpload($file_name, $request->get('notes'));
|
||||
}
|
||||
|
||||
return redirect()->back()->withFragment('files')->with('success', trans('admin/users/message.upload.success'));
|
||||
}
|
||||
|
||||
return redirect()->back()->with('error', trans('admin/users/message.upload.nofiles'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
namespace App\Http\Transformers;
|
||||
|
||||
use App\Helpers\Helper;
|
||||
use App\Helpers\StorageHelper;
|
||||
use App\Models\Actionlog;
|
||||
use App\Models\Asset;
|
||||
use App\Models\CustomField;
|
||||
@@ -16,6 +17,7 @@ use Illuminate\Contracts\Encryption\DecryptException;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ActionlogsTransformer
|
||||
{
|
||||
@@ -133,24 +135,6 @@ class ActionlogsTransformer
|
||||
$clean_meta= $this->changedInfo($clean_meta);
|
||||
}
|
||||
|
||||
$file_url = '';
|
||||
if($actionlog->filename!='') {
|
||||
if ($actionlog->action_type == 'accepted') {
|
||||
$file_url = route('log.storedeula.download', ['filename' => $actionlog->filename]);
|
||||
} else {
|
||||
if ($actionlog->item) {
|
||||
if ($actionlog->itemType() == 'asset') {
|
||||
$file_url = route('show/assetfile', ['asset' => $actionlog->item->id, 'fileId' => $actionlog->id]);
|
||||
} elseif ($actionlog->itemType() == 'accessory') {
|
||||
$file_url = route('show.accessoryfile', ['accessoryId' => $actionlog->item->id, 'fileId' => $actionlog->id]);
|
||||
} elseif ($actionlog->itemType() == 'license') {
|
||||
$file_url = route('show.licensefile', ['licenseId' => $actionlog->item->id, 'fileId' => $actionlog->id]);
|
||||
} elseif ($actionlog->itemType() == 'user') {
|
||||
$file_url = route('show/userfile', ['user' => $actionlog->item->id, 'fileId' => $actionlog->id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$array = [
|
||||
'id' => (int) $actionlog->id,
|
||||
@@ -158,8 +142,10 @@ class ActionlogsTransformer
|
||||
'file' => ($actionlog->filename!='')
|
||||
?
|
||||
[
|
||||
'url' => $file_url,
|
||||
'url' => $actionlog->uploads_file_url(),
|
||||
'filename' => $actionlog->filename,
|
||||
'inlineable' => StorageHelper::allowSafeInline($actionlog->uploads_file_url()),
|
||||
'exists_on_disk' => Storage::exists($actionlog->uploads_file_path()) ? true : false,
|
||||
] : null,
|
||||
|
||||
'item' => ($actionlog->item) ? [
|
||||
|
||||
@@ -62,7 +62,7 @@ class LicensesTransformer
|
||||
'checkin' => Gate::allows('checkin', License::class),
|
||||
'clone' => Gate::allows('create', License::class),
|
||||
'update' => Gate::allows('update', License::class),
|
||||
'delete' => (Gate::allows('delete', License::class) && ($license->free_seats_count > 0)) ? true : false,
|
||||
'delete' => (Gate::allows('delete', License::class) && ($license->free_seats_count == $license->seats)) ? true : false,
|
||||
];
|
||||
|
||||
$array += $permissions_array;
|
||||
|
||||
@@ -32,10 +32,11 @@ class UploadedFilesTransformer
|
||||
'name' => e($file->filename),
|
||||
'item' => ($file->item_type) ? [
|
||||
'id' => (int) $file->item_id,
|
||||
'type' => strtolower(class_basename($file->item_type)),
|
||||
'type' => str_plural(strtolower(class_basename($file->item_type))),
|
||||
] : null,
|
||||
'filename' => e($file->filename),
|
||||
'filetype' => StorageHelper::getFiletype($file->uploads_file_path()),
|
||||
'mediatype' => StorageHelper::getMediaType($file->uploads_file_path()),
|
||||
'url' => $file->uploads_file_url(),
|
||||
'note' => ($file->note) ? e($file->note) : null,
|
||||
'created_by' => ($file->adminuser) ? [
|
||||
@@ -44,7 +45,7 @@ class UploadedFilesTransformer
|
||||
] : null,
|
||||
'created_at' => Helper::getFormattedDateObject($file->created_at, 'datetime'),
|
||||
'deleted_at' => Helper::getFormattedDateObject($file->deleted_at, 'datetime'),
|
||||
'inline' => StorageHelper::allowSafeInline($file->uploads_file_path()),
|
||||
'inlineable' => StorageHelper::allowSafeInline($file->uploads_file_path()),
|
||||
'exists_on_disk' => (Storage::exists($file->uploads_file_path()) ? true : false),
|
||||
];
|
||||
|
||||
|
||||
@@ -22,6 +22,12 @@ class UsersTransformer
|
||||
public function transformUser(User $user)
|
||||
{
|
||||
|
||||
$role = '';
|
||||
if ($user->isSuperUser()) {
|
||||
$role = 'superadmin';
|
||||
} elseif ($user->isAdmin()) {
|
||||
$role = 'admin';
|
||||
}
|
||||
$array = [
|
||||
'id' => (int) $user->id,
|
||||
'avatar' => e($user->present()->gravatar) ?? null,
|
||||
@@ -59,6 +65,7 @@ class UsersTransformer
|
||||
'name'=> e($user->userloc->name),
|
||||
] : null,
|
||||
'notes'=> Helper::parseEscapedMarkedownInline($user->notes),
|
||||
'role' => $role,
|
||||
'permissions' => $user->decodePermissions(),
|
||||
'activated' => ($user->activated == '1') ? true : false,
|
||||
'autoassign_licenses' => ($user->autoassign_licenses == '1') ? true : false,
|
||||
|
||||
@@ -457,6 +457,11 @@ class Actionlog extends SnipeModel
|
||||
public function uploads_file_url()
|
||||
{
|
||||
|
||||
|
||||
if (($this->action_type == 'accepted') || ($this->action_type == 'declined')) {
|
||||
return route('log.storedeula.download', ['filename' => $this->filename]);
|
||||
}
|
||||
|
||||
switch ($this->item_type) {
|
||||
case Accessory::class:
|
||||
return route('show.accessoryfile', [$this->item_id, $this->id]);
|
||||
@@ -465,7 +470,7 @@ class Actionlog extends SnipeModel
|
||||
case AssetModel::class:
|
||||
return route('show/modelfile', [$this->item_id, $this->id]);
|
||||
case Consumable::class:
|
||||
return route('show/locationsfile', [$this->item_id, $this->id]);
|
||||
return route('show.consumablefile', [$this->item_id, $this->id]);
|
||||
case Component::class:
|
||||
return route('show.componentfile', [$this->item_id, $this->id]);
|
||||
case License::class:
|
||||
@@ -482,6 +487,10 @@ class Actionlog extends SnipeModel
|
||||
public function uploads_file_path()
|
||||
{
|
||||
|
||||
if (($this->action_type == 'accepted') || ($this->action_type == 'declined')) {
|
||||
return 'private_uploads/eula-pdfs/'.$this->filename;
|
||||
}
|
||||
|
||||
switch ($this->item_type) {
|
||||
case Accessory::class:
|
||||
return 'private_uploads/accessories/'.$this->filename;
|
||||
|
||||
+43
-5
@@ -891,6 +891,49 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return only admins and superusers
|
||||
*
|
||||
* @param \Illuminate\Database\Query\Builder $query Query builder instance
|
||||
*/
|
||||
public function scopeOnlySuperAdmins($query)
|
||||
{
|
||||
|
||||
return $query->where('users.permissions', 'LIKE', '%"superuser":"1"%')
|
||||
->orWhere('users.permissions', 'LIKE', '%"superuser":1%')
|
||||
->orWhereHas(
|
||||
'groups', function ($query) {
|
||||
$query->where('permission_groups.permissions', 'LIKE', '%"superuser":"1"%')
|
||||
->orWhere('permission_groups.permissions', 'LIKE', '%"superuser":1%');
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Return only admins and superusers
|
||||
*
|
||||
* @param \Illuminate\Database\Query\Builder $query Query builder instance
|
||||
*/
|
||||
public function scopeOnlyAdminsAndSuperAdmins($query)
|
||||
{
|
||||
|
||||
return $query->where('users.permissions', 'LIKE', '%"superuser":"1"%')
|
||||
->orWhere('users.permissions', 'LIKE', '%"superuser":1%')
|
||||
->orWhere('users.permissions', 'LIKE', '%"admin":1%')
|
||||
->orWhere('users.permissions', 'LIKE', '%"admin":"1"%')
|
||||
->orWhereHas(
|
||||
'groups', function ($query) {
|
||||
$query->where('permission_groups.permissions', 'LIKE', '%"superuser":"1"%')
|
||||
->orWhere('permission_groups.permissions', 'LIKE', '%"superuser":1%')
|
||||
->orWhere('permission_groups.permissions', 'LIKE', '%"admin":1%')
|
||||
->orWhere('permission_groups.permissions', 'LIKE', '%"admin":"1"%');
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Query builder scope to order on manager
|
||||
@@ -964,7 +1007,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the preferred locale for the user.
|
||||
*
|
||||
@@ -1003,7 +1045,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||
public function scopeUserLocation($query, $location, $search)
|
||||
{
|
||||
|
||||
|
||||
return $query->where('location_id', '=', $location)
|
||||
->where('users.first_name', 'LIKE', '%' . $search . '%')
|
||||
->orWhere('users.email', 'LIKE', '%' . $search . '%')
|
||||
@@ -1016,9 +1057,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||
->orWhere('users.username', 'LIKE', '%' . $search . '%')
|
||||
->orwhereRaw('CONCAT(users.first_name," ",users.last_name) LIKE \''.$search.'%\'');
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -106,7 +106,7 @@ class HistoryPresenter extends Presenter
|
||||
'switchable' => true,
|
||||
'title' => trans('general.file_name'),
|
||||
'visible' => true,
|
||||
'formatter' => 'fileUploadNameFormatter',
|
||||
'formatter' => 'fileNameFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'file_download',
|
||||
@@ -115,7 +115,7 @@ class HistoryPresenter extends Presenter
|
||||
'switchable' => true,
|
||||
'title' => trans('general.download'),
|
||||
'visible' => true,
|
||||
'formatter' => 'fileUploadFormatter',
|
||||
'formatter' => 'fileDownloadButtonsFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'note',
|
||||
|
||||
@@ -18,7 +18,7 @@ class UploadedFilesPresenter extends Presenter
|
||||
$layout = [
|
||||
[
|
||||
'field' => 'id',
|
||||
'searchable' => false,
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'switchable' => true,
|
||||
'title' => trans('general.id'),
|
||||
@@ -30,6 +30,7 @@ class UploadedFilesPresenter extends Presenter
|
||||
'sortable' => false,
|
||||
'switchable' => false,
|
||||
'title' => trans('general.type'),
|
||||
'visible' => true,
|
||||
'formatter' => 'iconFormatter',
|
||||
],
|
||||
[
|
||||
@@ -38,16 +39,17 @@ class UploadedFilesPresenter extends Presenter
|
||||
'sortable' => false,
|
||||
'switchable' => true,
|
||||
'title' => trans('general.image'),
|
||||
'formatter' => 'inlineImageFormatter',
|
||||
'visible' => true,
|
||||
'formatter' => 'filePreviewFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'filename',
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'switchable' => true,
|
||||
'title' => trans('general.file_name'),
|
||||
'visible' => true,
|
||||
'formatter' => 'fileUploadNameFormatter',
|
||||
'formatter' => 'fileNameFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'download',
|
||||
@@ -56,7 +58,7 @@ class UploadedFilesPresenter extends Presenter
|
||||
'switchable' => true,
|
||||
'title' => trans('general.download'),
|
||||
'visible' => true,
|
||||
'formatter' => 'downloadOrOpenInNewWindowFormatter',
|
||||
'formatter' => 'fileDownloadButtonsFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'note',
|
||||
@@ -68,10 +70,10 @@ class UploadedFilesPresenter extends Presenter
|
||||
],
|
||||
[
|
||||
'field' => 'created_by',
|
||||
'searchable' => false,
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'title' => trans('general.created_by'),
|
||||
'visible' => false,
|
||||
'visible' => true,
|
||||
'formatter' => 'usersLinkObjFormatter',
|
||||
],
|
||||
[
|
||||
@@ -80,7 +82,7 @@ class UploadedFilesPresenter extends Presenter
|
||||
'sortable' => true,
|
||||
'switchable' => true,
|
||||
'title' => trans('general.created_at'),
|
||||
'visible' => false,
|
||||
'visible' => true,
|
||||
'formatter' => 'dateDisplayFormatter',
|
||||
], [
|
||||
'field' => 'available_actions',
|
||||
@@ -88,6 +90,7 @@ class UploadedFilesPresenter extends Presenter
|
||||
'sortable' => false,
|
||||
'switchable' => false,
|
||||
'title' => trans('table.actions'),
|
||||
'visible' => true,
|
||||
'formatter' => 'deleteUploadFormatter',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -180,7 +180,7 @@ class UserPresenter extends Presenter
|
||||
'switchable' => false,
|
||||
'title' => trans('admin/users/table.username'),
|
||||
'visible' => true,
|
||||
'formatter' => 'usersLinkFormatter',
|
||||
'formatter' => 'usernameRoleLinkFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'employee_num',
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"/js/dist/all.js": "/js/dist/all.js?id=1cb961c5407813a936d5a5f8827e21ce",
|
||||
"/js/dist/all.js": "/js/dist/all.js?id=de88a5fd4b026170e290344559b7fa99",
|
||||
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=bf1a348eae3e60c62b8879953f7df14c",
|
||||
"/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=146086d653897e2557af5e68f6f8c56f",
|
||||
"/css/build/overrides.css": "/css/build/overrides.css?id=86b4ba168dfdaa63adf0d004212305cf",
|
||||
@@ -110,5 +110,5 @@
|
||||
"/css/dist/skins/skin-yellow-dark.min.css": "/css/dist/skins/skin-yellow-dark.min.css?id=08ae1b3e66008966ce5d600ea3ad04a2",
|
||||
"/css/dist/skins/skin-yellow.min.css": "/css/dist/skins/skin-yellow.min.css?id=e1e6e1c64cf14fc350585aaeb0e42f6b",
|
||||
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=9def0b5d3b891ac3669b3b7aa7e805ce",
|
||||
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=07920ba19812444cc8f0ba30a6183958"
|
||||
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=ed9dc2e13cf495675067c4c7091b325a"
|
||||
}
|
||||
|
||||
@@ -113,9 +113,11 @@ pieOptions = {
|
||||
|
||||
var baseUrl = $('meta[name="baseUrl"]').attr('content');
|
||||
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
var $el = $('table');
|
||||
var $el = $('body');
|
||||
|
||||
// confirm restore modal
|
||||
|
||||
@@ -136,49 +138,28 @@ $(function () {
|
||||
});
|
||||
|
||||
// confirm delete modal
|
||||
|
||||
$el.on('click', '.delete-asset', function (evnt) {
|
||||
var $context = $(this);
|
||||
var $dataConfirmModal = $('#dataConfirmModal');
|
||||
var href = $context.attr('href');
|
||||
var message = $context.attr('data-content');
|
||||
var headericon = $context.attr('data-icon');
|
||||
var title = $context.attr('data-title');
|
||||
|
||||
$('#myModalLabel').text(title);
|
||||
$dataConfirmModal.find('.modal-body').text(message);
|
||||
// deleteForm is the ID of the modal form itself
|
||||
$('#deleteForm').attr('action', href);
|
||||
$dataConfirmModal.find('.modal-header-icon').addClass(headericon);
|
||||
$dataConfirmModal.find('.modal-title').text(title).prepend('<i class="fa ' + headericon + '"></i> ');
|
||||
$dataConfirmModal.find('.modal-body').text(message);
|
||||
$dataConfirmModal.attr('action', href);
|
||||
|
||||
// Fire the modal
|
||||
$dataConfirmModal.modal({
|
||||
show: true
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
/*
|
||||
* Slideout help menu
|
||||
*/
|
||||
$('.slideout-menu-toggle').on('click', function(event){
|
||||
event.preventDefault();
|
||||
// create menu variables
|
||||
var slideoutMenu = $('.slideout-menu');
|
||||
var slideoutMenuWidth = $('.slideout-menu').width();
|
||||
|
||||
// toggle open class
|
||||
slideoutMenu.toggleClass("open");
|
||||
|
||||
// slide menu
|
||||
if (slideoutMenu.hasClass("open")) {
|
||||
slideoutMenu.show();
|
||||
slideoutMenu.animate({
|
||||
right: "0px"
|
||||
});
|
||||
} else {
|
||||
slideoutMenu.animate({
|
||||
right: -slideoutMenuWidth
|
||||
}, "-350px");
|
||||
slideoutMenu.fadeOut();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -133,7 +133,7 @@ return [
|
||||
'example' => 'Example: ',
|
||||
|
||||
'files' => 'Files',
|
||||
'file_name' => 'File',
|
||||
'file_name' => 'File Name',
|
||||
'file_type' => 'File Type',
|
||||
'filesize' => 'File Size',
|
||||
'file_uploads' => 'File Uploads',
|
||||
@@ -336,6 +336,7 @@ return [
|
||||
'zip' => 'Zip',
|
||||
'noimage' => 'No image uploaded or image not found.',
|
||||
'file_does_not_exist' => 'The requested file does not exist on the server.',
|
||||
'open_new_window' => 'Open this file in a new window',
|
||||
'file_upload_success' => 'File upload success!',
|
||||
'no_files_uploaded' => 'File upload success!',
|
||||
'token_expired' => 'Your form session has expired. Please try again.',
|
||||
|
||||
@@ -6,11 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Accessory::class)
|
||||
<a href="{{ route('accessories.create') }}" {{$snipeSettings->shortcuts_enabled == 1 ? "accesskey=n" : ''}} class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
@@ -30,6 +25,7 @@
|
||||
data-sort-order="asc"
|
||||
data-footer-style="footerStyle"
|
||||
id="accessoriesTable"
|
||||
data-buttons="accessoryButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.accessories.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<x-icon type="files" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($accessory->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($accessory->uploads->count()).'</badge>' : '' !!}
|
||||
{!! ($accessory->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($accessory->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -125,11 +125,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<x-filestable
|
||||
filepath="private_uploads/accessories/"
|
||||
showfile_routename="show.accessoryfile"
|
||||
deletefile_routename="delete/accessoryfile"
|
||||
:object="$accessory" />
|
||||
<x-filestable object_type="accessories" :object="$accessory" />
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@@ -338,7 +334,7 @@
|
||||
@can('delete', $accessory)
|
||||
@if ($accessory->checkouts_count == 0)
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<button class="btn btn-block btn-danger btn-sm btn-social delete-asset" style="padding-top:5px;" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.delete_confirm_no_undo', ['item' => $accessory->name]) }}" data-target="#dataConfirmModal">
|
||||
<button class="btn btn-block btn-danger btn-sm btn-social delete-asset" style="padding-top:5px;" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.delete_confirm_no_undo', ['item' => $accessory->name]) }}" data-target="#dataConfirmModal" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@@ -364,17 +360,6 @@
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
<script>
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
</script>
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
@if ($assets->count() > 0)
|
||||
<li class="active">
|
||||
<a href="#assets" data-toggle="tab" title="{{ trans('general.assets') }}">{{ trans('general.assets') }}
|
||||
<badge class="badge badge-secondary"> {{ $assets->count()}}</badge>
|
||||
<span class="badge badge-secondary"> {{ $assets->count()}}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@if ($models->count() > 0)
|
||||
<li>
|
||||
<a href="#models" data-toggle="tab" title="{{ trans('general.asset_models') }}">{{ trans('general.asset_models') }}
|
||||
<badge class="badge badge-secondary"> {{ $models->count()}}</badge>
|
||||
<span class="badge badge-secondary"> {{ $models->count()}}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
@can('update', \App\Models\Asset::class)
|
||||
<a href="{{ route('maintenances.create') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@@ -24,17 +18,10 @@
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetMaintenancesPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="maintenancesTable"
|
||||
|
||||
|
||||
|
||||
|
||||
data-side-pagination="server"
|
||||
|
||||
|
||||
data-show-footer="true"
|
||||
|
||||
|
||||
id="maintenancesTable"
|
||||
data-buttons="maintenanceButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.maintenances.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -1,150 +1,35 @@
|
||||
<!-- begin redirect submit options -->
|
||||
@props([
|
||||
'filepath',
|
||||
'object',
|
||||
'showfile_routename',
|
||||
'deletefile_routename',
|
||||
'object_type' => '',
|
||||
])
|
||||
|
||||
<!-- begin non-ajaxed file listing table -->
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="{{ str_slug($object->name ?? $object->id) }}UploadsTable"
|
||||
data-id-table="{{ str_slug($object->name ?? $object->id) }}UploadsTable"
|
||||
id="{{ str_slug($object->name ?? $object->id) }}UploadsTable"
|
||||
data-side-pagination="client"
|
||||
data-show-footer="true"
|
||||
data-toolbar="#upload-toolbar"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
data-columns="{{ \App\Presenters\UploadedFilesPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="{{ $object_type }}-FileUploadsTable"
|
||||
data-id-table="{{ $object_type }}-FileUploadsTable"
|
||||
id="{{ $object_type }}-FileUploadsTable"
|
||||
data-side-pagination="server"
|
||||
data-pagination="true"
|
||||
data-sort-order="desc"
|
||||
data-sort-name="created_at"
|
||||
data-show-custom-view="true"
|
||||
data-custom-view="customViewFormatter"
|
||||
data-show-custom-view-button="true"
|
||||
data-url="{{ route('api.files.index', ['object_type' => $object_type, 'id' => $object->id]) }}"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-license-uploads-{{ str_slug($object->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||
"fileName": "export-uploads-{{ str_slug($object->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["image","delete","download","icon"]
|
||||
}'>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-visible="false" data-field="id" data-sortable="true">
|
||||
{{trans('general.id')}}
|
||||
</th>
|
||||
<th data-visible="true" data-field="type" data-sortable="true">
|
||||
{{trans('general.file_type')}}
|
||||
</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">
|
||||
{{ trans('general.preview') }}
|
||||
</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">
|
||||
{{ trans('general.file_name') }}
|
||||
</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">
|
||||
{{ trans('general.filesize') }}
|
||||
</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes" data-sortable="true">
|
||||
{{ trans('general.notes') }}
|
||||
</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="download">
|
||||
{{ trans('general.download') }}
|
||||
</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at" data-sortable="true">
|
||||
{{ trans('general.created_at') }}
|
||||
</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_by" data-sortable="true">
|
||||
{{ trans('general.created_by') }}
|
||||
</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="actions">
|
||||
{{ trans('table.actions') }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($object->uploads as $file)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $file->id }}
|
||||
</td>
|
||||
<td data-sort-value="{{ pathinfo($filepath.$file->filename, PATHINFO_EXTENSION) }}">
|
||||
@if (Storage::exists($filepath.$file->filename))
|
||||
<span class="sr-only">{{ pathinfo($filepath.$file->filename, PATHINFO_EXTENSION) }}</span>
|
||||
<i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true" data-tooltip="true" data-title="{{ pathinfo($filepath.$file->filename, PATHINFO_EXTENSION) }}"></i>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@if (($file->filename) && (Storage::exists($filepath.$file->filename)))
|
||||
@if (Helper::checkUploadIsImage($file->get_src(str_plural(strtolower(class_basename(get_class($object)))))))
|
||||
<a href="{{ route($showfile_routename, [$object->id, $file->id, 'inline' => 'true']) }}"
|
||||
data-toggle="lightbox" data-type="image">
|
||||
<img src="{{ route($showfile_routename, [$object->id, $file->id, 'inline' => 'true']) }}"
|
||||
class="img-thumbnail" style="max-width: 50px;">
|
||||
</a>
|
||||
@elseif (Helper::checkUploadIsVideo($file->get_src(str_plural(strtolower(class_basename(get_class($object)))))))
|
||||
<a href="{{ route($showfile_routename, [$object->id, $file->id, 'inline' => 'true']) }}"
|
||||
data-toggle="lightbox" data-type="video">
|
||||
<video style="max-width: 50px;">
|
||||
<source src="{{ route($showfile_routename, [$object->id, $file->id, 'inline' => 'true']) }}">
|
||||
</video>
|
||||
</a>
|
||||
@elseif (Helper::checkUploadIsAudio($file->get_src(str_plural(strtolower(class_basename(get_class($object)))))))
|
||||
<audio controls>
|
||||
<source src="{{ route($showfile_routename, [$object->id, $file->id, 'inline' => 'true']) }}" type="audio/mp3">
|
||||
Your browser does not support the audio element.
|
||||
</audio>
|
||||
@else
|
||||
{{ trans('general.preview_not_available') }}
|
||||
@endif
|
||||
@else
|
||||
<x-icon type="x" class="text-danger" />
|
||||
{{ trans('general.file_not_found') }}
|
||||
@endif
|
||||
|
||||
</td>
|
||||
<td>
|
||||
{{ $file->filename }}
|
||||
</td>
|
||||
<td data-value="{{ (Storage::exists($filepath.$file->filename)) ? Storage::size($filepath.$file->filename) : '' }}">
|
||||
{{ (Storage::exists($filepath.$file->filename)) ? Helper::formatFilesizeUnits(Storage::size($filepath.$file->filename)) : '' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td style="white-space: nowrap;">
|
||||
@if ($file->filename)
|
||||
@if (Storage::exists($filepath.$file->filename))
|
||||
<a href="{{ route($showfile_routename, [$object->id, $file->id]) }}" class="btn btn-sm btn-default">
|
||||
<x-icon type="download" />
|
||||
<span class="sr-only">
|
||||
{{ trans('general.download') }}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="{{ StorageHelper::allowSafeInline($filepath.$file->filename) ? route($showfile_routename, [$object->id, $file->id, 'inline' => 'true']) : '#' }}" class="btn btn-sm btn-default{{ StorageHelper::allowSafeInline($filepath.$file->filename) ? '' : ' disabled' }}" target="_blank">
|
||||
<x-icon type="external-link" />
|
||||
</a>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $file->created_at ? Helper::getFormattedDateObject($file->created_at, 'datetime', false) : '' }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ($file->adminuser) ? $file->adminuser->present()->getFullNameAttribute() : '' }}
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn delete-asset btn-danger btn-sm hidden-print" href="{{ route($deletefile_routename, [$object->id, $file->id]) }}" data-content="Are you sure you wish to delete this file?" data-title="{{ trans('general.delete') }} {{ $file->filename }}?">
|
||||
<x-icon type="delete" />
|
||||
<span class="sr-only">{{ trans('general.delete') }}</span>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<x-gallery-card />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- end non-ajaxed file listing table -->
|
||||
@@ -0,0 +1,38 @@
|
||||
<!-- HTML for the file gallery template -->
|
||||
<template id="fileGalleryTemplate">
|
||||
|
||||
<div class="col-md-4 col-lg-3 col-xl-2">
|
||||
|
||||
<div class="panel panel-%PANEL_CLASS%">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||
<i class="%ICON%" /></i>
|
||||
%ID% - %FILENAME%
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body" style="height: 300px; overflow: scroll !important;">
|
||||
<div class="col-md-12 text-center">
|
||||
%FILE_EMBED%
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
%NOTE%
|
||||
<br>
|
||||
%CREATED_AT% - %CREATED_BY%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<div class="row">
|
||||
<div class="text-left col-lg-2 col-md-2 col-sm-2">
|
||||
%DELETE_BUTTON%
|
||||
</div>
|
||||
<div class="text-right col-lg-10 col-md-10 col-sm-10" style="white-space: nowrap">
|
||||
%DOWNLOAD_BUTTON% %NEW_WINDOW_BUTTON%
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.panel-footer -->
|
||||
</div> <!-- /.panel panel-%PANEL_CLASS% -->
|
||||
</div><!-- /.col-md-4 col-lg-3 col-xl-1 -->
|
||||
</template>
|
||||
<!-- ./ HTML for the file gallery template -->
|
||||
@@ -6,12 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('categories.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@@ -26,6 +20,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="categoryTable"
|
||||
data-buttons="categoryButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.categories.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -8,23 +8,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary" style="margin-right: 10px;">
|
||||
{{ trans('general.back') }}</a>
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ route('categories.edit', ['category' => $category->id]) }}">{{ trans('admin/categories/general.edit') }}</a></li>
|
||||
<li><a href="{{ route('categories.create') }}">{{ trans('general.create') }}</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@@ -39,6 +22,9 @@
|
||||
<a href="#items" data-toggle="tab" title="{{ trans('general.items') }}">
|
||||
@if ($category->category_type=='asset')
|
||||
{{ trans('general.assets') }}
|
||||
@if ($category->showableAssets()->count() > 0)
|
||||
<span class="badge badge-secondary"> {{ $category->showableAssets()->count() }}</span>
|
||||
@endif
|
||||
@elseif ($category->category_type=='accessory')
|
||||
{{ trans('general.accessories') }}
|
||||
@elseif ($category->category_type=='license')
|
||||
@@ -49,16 +35,15 @@
|
||||
{{ trans('general.components') }}
|
||||
@endif
|
||||
|
||||
@if ($category->category_type=='asset')
|
||||
<badge class="badge badge-secondary"> {{ $category->showableAssets()->count() }}</badge>
|
||||
@endif
|
||||
</a>
|
||||
</li>
|
||||
@if ($category->category_type=='asset')
|
||||
<li>
|
||||
<a href="#models" data-toggle="tab" title="{{ trans('general.asset_models') }}">
|
||||
{{ trans('general.asset_models') }}
|
||||
<badge class="badge badge-secondary"> {{ $category->models->count()}}</badge>
|
||||
@if ($category->models->count() > 0)
|
||||
<span class="badge badge-secondary"> {{ $category->models->count()}}</span>
|
||||
@endif
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@@ -75,10 +60,10 @@
|
||||
<table
|
||||
|
||||
@if ($category->category_type=='asset')
|
||||
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryAssetsTable"
|
||||
id="categoryAssetsTable"
|
||||
data-buttons="assetButtons"
|
||||
data-id-table="categoryAssetsTable"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
@@ -88,9 +73,10 @@
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='accessory')
|
||||
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
|
||||
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryAccessoryTable"
|
||||
id="categoryAccessoryTable"
|
||||
data-buttons="accessoryButtons"
|
||||
data-id-table="categoryAccessoryTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-accessories-{{ date('Y-m-d') }}",
|
||||
@@ -100,31 +86,33 @@
|
||||
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryConsumableTable"
|
||||
id="categoryConsumableTable"
|
||||
data-buttons="consumableButtons"
|
||||
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-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryCompomnentTable"
|
||||
id="categoryCompomnentTable"
|
||||
data-buttons="componentButtons"
|
||||
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"]
|
||||
}'
|
||||
@elseif ($category->category_type=='license')
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryLicenseTable"
|
||||
id="categoryLicenseTable"
|
||||
data-buttons="licenseButtons"
|
||||
data-id-table="categoryLicenseTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-licenses-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@endif
|
||||
|
||||
data-show-footer="true"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
@@ -151,15 +139,16 @@
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="asssetModelsTable"
|
||||
data-id-table="asssetModelsTable"
|
||||
data-cookie-id-table="assetModelsTable"
|
||||
data-id-table="assetModelsTable"
|
||||
data-show-footer="true"
|
||||
data-side-pagination="server"
|
||||
data-toolbar="#modelsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkModelsEditButton"
|
||||
data-bulk-form-id="#modelsBulkForm"
|
||||
data-sort-order="asc"
|
||||
id="asssetModelsTable"
|
||||
id="assetModelsTable"
|
||||
data-buttons="modelButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.models.index', ['status' => request('status'), 'category_id' => $category->id]) }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('companies.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
@@ -23,6 +19,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="companiesTable"
|
||||
data-buttons="companyButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.companies.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<i class="fas fa-barcode" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.assets') }}
|
||||
{!! ($company->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($company->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
|
||||
{!! ($company->assets()->AssetsForShow()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($company->assets()->AssetsForShow()->count()).'</span>' : '' !!}
|
||||
|
||||
</span>
|
||||
</a>
|
||||
@@ -33,7 +33,7 @@
|
||||
<i class="far fa-save"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.licenses') }}
|
||||
{!! ($company->licenses->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($company->licenses->count()).'</badge>' : '' !!}
|
||||
{!! ($company->licenses->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($company->licenses->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -43,7 +43,7 @@
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-keyboard"></i>
|
||||
</span> <span class="hidden-xs hidden-sm">{{ trans('general.accessories') }}
|
||||
{!! ($company->accessories->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($company->accessories->count()).'</badge>' : '' !!}
|
||||
{!! ($company->accessories->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($company->accessories->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -53,7 +53,7 @@
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-tint"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.consumables') }}
|
||||
{!! ($company->consumables->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($company->consumables->count()).'</badge>' : '' !!}
|
||||
{!! ($company->consumables->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($company->consumables->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -63,7 +63,7 @@
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-hdd"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.components') }}
|
||||
{!! (($company->components) && ($company->components->count() > 0 )) ? '<badge class="badge badge-secondary">'.number_format($company->components->count()).'</badge>' : '' !!}
|
||||
{!! (($company->components) && ($company->components->count() > 0 )) ? '<span class="badge badge-secondary">'.number_format($company->components->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -73,7 +73,7 @@
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="users" /></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.people') }}
|
||||
{!! (($company->users) && ($company->users->count() > 0 )) ? '<badge class="badge badge-secondary">'.number_format($company->users->count()).'</badge>' : '' !!}
|
||||
{!! (($company->users) && ($company->users->count() > 0 )) ? '<span class="badge badge-secondary">'.number_format($company->users->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -6,11 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Component::class)
|
||||
<a href="{{ route('components.create') }}" {{$snipeSettings->shortcuts_enabled == 1 ? "accesskey=n" : ''}} class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
@@ -28,6 +23,7 @@
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="componentsTable"
|
||||
data-buttons="componentButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.components.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-file fa-2x" aria-hidden="true"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($component->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($component->uploads->count()).'</badge>' : '' !!}
|
||||
{!! ($component->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($component->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -169,11 +169,7 @@
|
||||
<div class="tab-pane" id="files">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<x-filestable
|
||||
filepath="private_uploads/components/"
|
||||
showfile_routename="show.componentfile"
|
||||
deletefile_routename="delete/componentfile"
|
||||
:object="$component" />
|
||||
<x-filestable object_type="components" :object="$component" />
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@@ -247,6 +243,21 @@
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@can('delete', $component)
|
||||
<div class="col-md-12 hidden-print" style="padding-top: 5px;">
|
||||
@if ($component->isDeletable())
|
||||
<button class="btn btn-sm btn-block btn-danger btn-social delete-asset" data-icon="fa fa-trash" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $component->name]) }}" data-target="#dataConfirmModal" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@else
|
||||
<a href="#" class="btn btn-block btn-sm btn-danger btn-social hidden-print disabled" data-tooltip="true" data-placement="top" data-title="{{ trans('general.cannot_be_deleted') }}" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</a>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- .row-->
|
||||
|
||||
@@ -6,12 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Consumable::class)
|
||||
<a href="{{ route('consumables.create') }}" {{$snipeSettings->shortcuts_enabled == 1 ? "accesskey=n" : ''}} class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@@ -31,6 +25,7 @@
|
||||
data-sort-name="name"
|
||||
data-toolbar="#toolbar"
|
||||
id="consumablesTable"
|
||||
data-buttons="consumableButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.consumables.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<x-icon type="users" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.assigned') }}
|
||||
{!! ($consumable->users_consumables > 0 ) ? '<badge class="badge badge-secondary">'.number_format($consumable->users_consumables).'</badge>' : '' !!}
|
||||
{!! ($consumable->users_consumables > 0 ) ? '<span class="badge badge-secondary">'.number_format($consumable->users_consumables).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -54,7 +54,7 @@
|
||||
<i class="far fa-file fa-2x" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($consumable->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($consumable->uploads->count()).'</badge>' : '' !!}
|
||||
{!! ($consumable->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($consumable->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -139,7 +139,7 @@
|
||||
@can('delete', $consumable)
|
||||
<div class="col-md-12" style="padding-top: 10px; padding-bottom: 20px">
|
||||
@if ($consumable->deleted_at=='')
|
||||
<button class="btn btn-sm btn-block btn-danger btn-social hidden-print delete-asset" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $consumable->name]) }}" data-target="#dataConfirmModal">
|
||||
<button class="btn btn-sm btn-block btn-danger btn-social hidden-print delete-asset" data-icon="fa fa-trash" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $consumable->name]) }}" data-target="#dataConfirmModal" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@@ -440,12 +440,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<x-filestable
|
||||
filepath="private_uploads/consumables/"
|
||||
showfile_routename="show.consumablefile"
|
||||
deletefile_routename="delete/consumablefile"
|
||||
:object="$consumable" />
|
||||
|
||||
<x-filestable object_type="consumables" :object="$consumable" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -487,17 +482,5 @@
|
||||
|
||||
@section('moar_scripts')
|
||||
|
||||
<script>
|
||||
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@include ('partials.bootstrap-table', ['simple_view' => true])
|
||||
@endsection
|
||||
@@ -33,7 +33,8 @@
|
||||
data-side-pagination="client"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="customFieldsTable"
|
||||
id="customFieldsetTable"
|
||||
data-buttons="customFieldsetButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-fieldsets-{{ date('Y-m-d') }}",
|
||||
@@ -89,7 +90,7 @@
|
||||
@if($fieldset->models->count() > 0)
|
||||
<button type="submit" class="btn btn-danger btn-sm disabled" data-tooltip="true" title="{{ trans('general.cannot_be_deleted') }}" disabled><i class="fas fa-trash"></i></button>
|
||||
@else
|
||||
<button type="submit" class="btn btn-danger btn-sm" data-tooltip="true" title="{{ trans('general.delete') }}"><i class="fas fa-trash"></i></button>
|
||||
<button type="submit" class="btn btn-danger btn-sm delete-asset" data-tooltip="true" title="{{ trans('general.delete') }}" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $fieldset->name]) }}" data-icon="fa fa-trash" data-target="#dataConfirmModal" onClick="return false;"><i class="fas fa-trash"></i></button>
|
||||
@endif
|
||||
</form>
|
||||
@endcan
|
||||
@@ -130,6 +131,7 @@
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="customFieldsTable"
|
||||
data-buttons="customFieldButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-fields-{{ date('Y-m-d') }}",
|
||||
@@ -252,7 +254,7 @@
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.delete') }}</span></button>
|
||||
@else
|
||||
<button type="submit" class="btn btn-danger btn-sm" data-tooltip="true" title="{{ trans('general.delete') }}">
|
||||
<button type="submit" class="btn btn-danger btn-sm delete-asset" data-tooltip="true" title="{{ trans('general.delete') }}" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $field->name]) }}" data-target="#dataConfirmModal" data-icon="fa fa-trash" onClick="return false;">
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.delete') }}</span>
|
||||
</button>
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('departments.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
@@ -22,6 +18,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="departmentsTable"
|
||||
data-buttons="departmentButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.departments.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -6,12 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('depreciations.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@@ -26,6 +20,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="depreciationsTable"
|
||||
data-buttons="depreciationButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.depreciations.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -34,21 +34,21 @@
|
||||
<a href="#assets" data-toggle="tab">
|
||||
{{ trans('general.assets') }}
|
||||
|
||||
{!! ($depreciation->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($depreciation->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
|
||||
{!! ($depreciation->assets()->AssetsForShow()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($depreciation->assets()->AssetsForShow()->count()).'</span>' : '' !!}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#licenses" data-toggle="tab">
|
||||
{{ trans('general.licenses') }}
|
||||
|
||||
{!! ($depreciation->licenses_count > 0 ) ? '<badge class="badge badge-secondary">'.number_format($depreciation->licenses_count).'</badge>' : '' !!}
|
||||
{!! ($depreciation->licenses_count > 0 ) ? '<span class="badge badge-secondary">'.number_format($depreciation->licenses_count).'</span>' : '' !!}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#models" data-toggle="tab">
|
||||
{{ trans('general.asset_models') }}
|
||||
|
||||
{!! ($depreciation->models_count > 0 ) ? '<badge class="badge badge-secondary">'.number_format($depreciation->models_count).'</badge>' : '' !!}
|
||||
{!! ($depreciation->models_count > 0 ) ? '<span class="badge badge-secondary">'.number_format($depreciation->models_count).'</span>' : '' !!}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="groupsTable"
|
||||
data-buttons="groupButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.groups.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
@elseif (Request::get('status')=='Archived')
|
||||
{{ trans('general.archived') }}
|
||||
@elseif (Request::get('status')=='Deleted')
|
||||
{{ trans('general.deleted') }}
|
||||
{{ ucfirst(trans('general.deleted')) }}
|
||||
@elseif (Request::get('status')=='byod')
|
||||
{{ trans('general.byod') }}
|
||||
{{ strtoupper(trans('general.byod')) }}
|
||||
@endif
|
||||
@else
|
||||
{{ trans('general.all') }}
|
||||
@@ -43,14 +43,6 @@
|
||||
@yield('title0') @parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('reports/custom') }}" style="margin-right: 5px;" class="btn btn-default">
|
||||
{{ trans('admin/hardware/general.custom_export') }}</a>
|
||||
@can('create', \App\Models\Asset::class)
|
||||
<a href="{{ route('hardware.create') }}" {{$snipeSettings->shortcuts_enabled == 1 ? "n" : ''}} class="btn btn-primary pull-right"></i> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
@@ -77,6 +69,7 @@
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
data-buttons="assetButtons"
|
||||
id="{{ request()->has('status') ? e(request()->input('status')) : '' }}assetsListingTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.assets.index',
|
||||
|
||||
@@ -112,19 +112,19 @@
|
||||
|
||||
|
||||
@if ($asset->audits->count() > 0)
|
||||
<li>
|
||||
<a href="#audits" data-toggle="tab" data-tooltip="true">
|
||||
<li>
|
||||
<a href="#audits" data-toggle="tab" data-tooltip="true">
|
||||
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-clipboard-check fa-2x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.audits') }}
|
||||
{!! ($asset->audits()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($asset->audits()->count()).'</span>' : '' !!}
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-clipboard-check fa-2x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.audits') }}
|
||||
{!! ($asset->audits()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($asset->audits()->count()).'</span>' : '' !!}
|
||||
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
<li>
|
||||
@@ -1329,32 +1329,20 @@
|
||||
<div class="tab-pane fade" id="maintenances">
|
||||
<div class="row{{($asset->assetmaintenances->count() > 0 ) ? '' : ' hidden-print'}}">
|
||||
<div class="col-md-12">
|
||||
@can('update', \App\Models\Asset::class)
|
||||
<div id="maintenance-toolbar">
|
||||
<a href="{{ route('maintenances.create', ['asset_id' => $asset->id]) }}" class="btn btn-primary">{{ trans('button.add_maintenance') }}</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
<!-- Asset Maintenance table -->
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetMaintenancesPresenter::dataTableLayout() }}"
|
||||
class="table table-striped snipe-table"
|
||||
id="assetMaintenancesTable"
|
||||
|
||||
data-buttons="maintenanceButtons"
|
||||
data-id-table="assetMaintenancesTable"
|
||||
|
||||
|
||||
|
||||
data-side-pagination="server"
|
||||
data-toolbar="#maintenance-toolbar"
|
||||
|
||||
|
||||
|
||||
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ $asset->asset_tag }}-maintenances",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
"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"
|
||||
data-cookie="true">
|
||||
@@ -1376,10 +1364,9 @@
|
||||
data-sort-order="desc"
|
||||
data-sort-name="created_at"
|
||||
data-export-options='{
|
||||
"fileName": "export-asset-{{ $asset->id }}-audits",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
|
||||
"fileName": "export-asset-{{ $asset->id }}-audits",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
data-url="{{ route('api.activity.index', ['item_id' => $asset->id, 'item_type' => 'asset', 'action_type' => 'audit']) }}"
|
||||
data-cookie-id-table="assetHistory"
|
||||
data-cookie="true">
|
||||
@@ -1390,7 +1377,7 @@
|
||||
<th data-visible="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.created_by') }}</th>
|
||||
<th class="col-sm-2" data-field="file" data-sortable="true" data-visible="false" data-formatter="fileUploadNameFormatter">{{ trans('general.file_name') }}</th>
|
||||
<th data-field="note">{{ trans('general.notes') }}</th>
|
||||
<th data-visible="false" data-field="file" data-visible="false" data-formatter="fileUploadFormatter">{{ trans('general.download') }}</th>
|
||||
<th data-visible="false" data-field="file" data-visible="false" data-formatter="fileDownloadButtonsFormatter">{{ trans('general.download') }}</th>
|
||||
<th data-field="log_meta" data-visible="true" data-formatter="changeLogFormatter">{{ trans('admin/hardware/table.changed')}}</th>
|
||||
<th data-field="remote_ip" data-visible="false" data-sortable="true">{{ trans('admin/settings/general.login_ip') }}</th>
|
||||
<th data-field="user_agent" data-visible="false" data-sortable="true">{{ trans('admin/settings/general.login_user_agent') }}</th>
|
||||
@@ -1411,23 +1398,14 @@
|
||||
data-columns="{{ \App\Presenters\HistoryPresenter::dataTableLayout() }}"
|
||||
class="table table-striped snipe-table"
|
||||
id="assetHistory"
|
||||
|
||||
data-id-table="assetHistory"
|
||||
|
||||
|
||||
|
||||
data-side-pagination="server"
|
||||
|
||||
|
||||
|
||||
data-sort-order="desc"
|
||||
data-sort-name="created_at"
|
||||
|
||||
data-export-options='{
|
||||
"fileName": "export-asset-{{ $asset->id }}-history",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
|
||||
"fileName": "export-asset-{{ $asset->id }}-history",
|
||||
"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"
|
||||
data-cookie="true">
|
||||
@@ -1439,11 +1417,7 @@
|
||||
<div class="tab-pane fade" id="files">
|
||||
<div class="row{{ ($asset->uploads->count() > 0 ) ? '' : ' hidden-print' }}">
|
||||
<div class="col-md-12">
|
||||
<x-filestable
|
||||
filepath="private_uploads/assets/"
|
||||
showfile_routename="show/assetfile"
|
||||
deletefile_routename="delete/assetfile"
|
||||
:object="$asset" />
|
||||
<x-filestable object_type="assets" :object="$asset" />
|
||||
</div> <!-- /.col-md-12 -->
|
||||
</div> <!-- /.row -->
|
||||
</div> <!-- /.tab-pane files -->
|
||||
@@ -1453,13 +1427,7 @@
|
||||
<div class="tab-pane fade" id="modelfiles">
|
||||
<div class="row{{ (($asset->model) && ($asset->model->uploads->count() > 0)) ? '' : ' hidden-print' }}">
|
||||
<div class="col-md-12">
|
||||
|
||||
<x-filestable
|
||||
filepath="private_uploads/assetmodels/"
|
||||
showfile_routename="show/modelfile"
|
||||
deletefile_routename="delete/modelfile"
|
||||
:object="$asset->model" />
|
||||
|
||||
<x-filestable object_type="models" :object="$asset->model" />
|
||||
</div> <!-- /.col-md-12 -->
|
||||
</div> <!-- /.row -->
|
||||
</div> <!-- /.tab-pane files -->
|
||||
@@ -1474,16 +1442,6 @@
|
||||
@endcan
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
<script>
|
||||
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
@include ('partials.bootstrap-table')
|
||||
|
||||
@stop
|
||||
|
||||
@@ -960,17 +960,18 @@ dir="{{ Helper::determineLanguageDirection() }}">
|
||||
|
||||
<!-- end main container -->
|
||||
|
||||
<div class="modal modal-danger fade" id="dataConfirmModal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal modal-danger fade" id="dataConfirmModal" tabindex="-1" role="dialog" aria-labelledby="dataConfirmModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h2 class="modal-title" id="myModalLabel"> </h2>
|
||||
<h2 class="modal-title" id="dataConfirmModalLabel">
|
||||
<span class="modal-header-icon"></span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="modal-body"></div>
|
||||
<div class="modal-footer">
|
||||
<form method="post" id="deleteForm" role="form">
|
||||
<form method="post" id="deleteForm" role="form" action="">
|
||||
{{ csrf_field() }}
|
||||
{{ method_field('DELETE') }}
|
||||
|
||||
|
||||
@@ -7,17 +7,6 @@
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\License::class)
|
||||
<a href="{{ route('licenses.create') }}" accesskey="n" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}
|
||||
</a>
|
||||
@endcan
|
||||
@can('view', \App\Models\License::class)
|
||||
<a class="btn btn-default pull-right" href="{{ route('licenses.export') }}" style="margin-right: 5px;">{{ trans('general.export') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@@ -36,6 +25,7 @@
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="licensesTable"
|
||||
data-buttons="licenseButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.licenses.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<x-icon type="files" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($license->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($license->uploads->count()).'</badge>' : '' !!}
|
||||
{!! ($license->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($license->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -459,13 +459,7 @@
|
||||
|
||||
@can('licenses.files', $license)
|
||||
<div class="tab-pane" id="files">
|
||||
|
||||
<x-filestable
|
||||
filepath="private_uploads/licenses/"
|
||||
showfile_routename="show.licensefile"
|
||||
deletefile_routename="delete/licensefile"
|
||||
:object="$license" />
|
||||
|
||||
<x-filestable object_type="licenses" :object="$license" />
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
|
||||
@@ -557,7 +551,7 @@
|
||||
</a>
|
||||
</span>
|
||||
@else
|
||||
<a href="#" class="btn btn-primary bg-purple btn-sm btn-social btn-block hidden-print" style="margin-bottom: 25px;" data-toggle="modal" data-tooltip="true" data-target="#checkinFromAllModal" data-content="{{ trans('general.sure_to_delete') }} data-title="{{ trans('general.delete') }}" onClick="return false;">
|
||||
<a href="#" class="btn btn-primary bg-purple btn-sm btn-social btn-block hidden-print" style="margin-bottom: 25px;" data-toggle="modal" data-tooltip="true" data-target="#checkinFromAllModal" data-content="{{ trans('general.sure_to_delete') }}" data-title="{{ trans('general.delete') }}" onClick="return false;">
|
||||
<x-icon type="checkin" />
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
@@ -567,13 +561,13 @@
|
||||
@can('delete', $license)
|
||||
|
||||
@if ($license->availCount()->count() == $license->seats)
|
||||
<button class="btn btn-block btn-danger btn-sm btn-social delete-license" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.delete_confirm', ['item' => $license->name]) }}" data-target="#dataConfirmModal">
|
||||
<a class="btn btn-block btn-danger btn-sm btn-social delete-asset" data-icon="fa fa trash" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.delete_confirm', ['item' => $license->name]) }}" data-target="#dataConfirmModal" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
</a>
|
||||
@else
|
||||
<span data-tooltip="true" title=" {{ trans('admin/licenses/general.delete_disabled') }}">
|
||||
<a href="#" class="btn btn-block btn-danger btn-sm btn-social delete-license disabled">
|
||||
<a href="#" class="btn btn-block btn-danger btn-sm btn-social delete-asset disabled" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</a>
|
||||
@@ -615,15 +609,5 @@
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
<script>
|
||||
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
||||
|
||||
@@ -6,12 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Location::class)
|
||||
<a href="{{ route('locations.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
@@ -29,6 +23,7 @@
|
||||
data-bulk-form-id="#locationsBulkForm"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
data-buttons="locationButtons"
|
||||
id="locationTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.locations.index', array('company_id'=>e(Request::get('company_id')))) }}"
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.files') }}
|
||||
{!! ($location->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($location->uploads->count()).'</badge>' : '' !!}
|
||||
{!! ($location->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($location->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -196,6 +196,7 @@
|
||||
data-bulk-button-id="#bulkUserEditButton"
|
||||
data-bulk-form-id="#usersBulkForm"
|
||||
id="usersTable"
|
||||
data-buttons="userButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.users.index', ['location_id' => $location->id])}}"
|
||||
data-export-options='{
|
||||
@@ -219,6 +220,7 @@
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
id="assetsListingTable"
|
||||
data-buttons="assetButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.assets.index', ['location_id' => $location->id]) }}"
|
||||
data-export-options='{
|
||||
@@ -245,6 +247,7 @@
|
||||
data-bulk-button-id="#AssignedbulkAssetEditButton"
|
||||
data-bulk-form-id="#assignedAssetsBulkForm"
|
||||
id="assetsAssignedListingTable"
|
||||
data-buttons="assetButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.assets.index', ['assigned_to' => $location->id, 'assigned_type' => 'App\Models\Location']) }}"
|
||||
data-export-options='{
|
||||
@@ -269,6 +272,7 @@
|
||||
data-bulk-button-id="#RTDbulkAssetEditButton"
|
||||
data-bulk-form-id="#RTDassetsBulkEditToolbar"
|
||||
id="RTDassetsListingTable"
|
||||
data-buttons="assetButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.assets.index', ['rtd_location_id' => $location->id]) }}"
|
||||
data-export-options='{
|
||||
@@ -290,6 +294,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="accessoriesListingTable"
|
||||
data-buttons="accessoryButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.accessories.index', ['location_id' => $location->id]) }}"
|
||||
data-export-options='{
|
||||
@@ -312,6 +317,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="accessoriesAssignedListingTable"
|
||||
data-buttons="accessoryButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.locations.assigned_accessories', ['location' => $location]) }}"
|
||||
data-export-options='{
|
||||
@@ -332,6 +338,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="consumablesListingTable"
|
||||
data-buttons="consumableButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.consumables.index', ['location_id' => $location->id]) }}"
|
||||
data-export-options='{
|
||||
@@ -351,6 +358,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="componentsTable"
|
||||
data-buttons="componentButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.components.index', ['location_id' => $location->id])}}"
|
||||
data-export-options='{
|
||||
@@ -364,13 +372,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<x-filestable
|
||||
filepath="private_uploads/locations/"
|
||||
showfile_routename="show/locationsfile"
|
||||
deletefile_routename="delete/locationsfile"
|
||||
:object="$location" />
|
||||
|
||||
<x-filestable object_type="locations" :object="$location" />
|
||||
</div> <!-- /.col-md-12 -->
|
||||
</div> <!-- /.row -->
|
||||
|
||||
@@ -382,34 +384,20 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\HistoryPresenter::dataTableLayout() }}"
|
||||
class="table table-striped snipe-table"
|
||||
id="assetHistory"
|
||||
data-id-table="assetHistory"
|
||||
id="locationHistory"
|
||||
data-id-table="locationHistory"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="desc"
|
||||
data-sort-name="created_at"
|
||||
data-export-options='{
|
||||
"fileName": "export-location-asset-{{ $location->id }}-history",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
|
||||
data-url="{{ route('api.activity.index', ['target_id' => $location->id, 'target_type' => 'location']) }}"
|
||||
data-cookie-id-table="assetHistory"
|
||||
data-cookie="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-visible="true" data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter">{{ trans('admin/hardware/table.icon') }}</th>
|
||||
<th class="col-sm-2" data-visible="true" data-field="action_date" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.created_by') }}</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th>
|
||||
<th class="col-sm-2" 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-field="note">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th>
|
||||
<th class="col-md-3" data-visible="false" data-field="file" data-visible="false" data-formatter="fileUploadFormatter">{{ trans('general.download') }}</th>
|
||||
<th class="col-sm-2" data-field="log_meta" data-visible="true" data-formatter="changeLogFormatter">{{ trans('admin/hardware/table.changed')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
"fileName": "export-location-asset-{{ $location->id }}-history",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
data-url="{{ route('api.activity.index', ['target_id' => $location->id, 'target_type' => 'location']) }}"
|
||||
data-cookie-id-table="locationHistory"
|
||||
data-cookie="true">
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- /.row -->
|
||||
@@ -512,7 +500,7 @@
|
||||
@if ($location->deleted_at=='')
|
||||
|
||||
@if ($location->isDeletable())
|
||||
<button class="btn btn-sm btn-block btn-danger btn-social delete-location" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $location->name]) }}" data-target="#dataConfirmModal">
|
||||
<button class="btn btn-sm btn-block btn-danger btn-social delete-asset" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $location->name]) }}" data-target="#dataConfirmModal">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@@ -549,14 +537,6 @@
|
||||
@include ('modals.upload-file', ['item_type' => 'locations', 'item_id' => $location->id])
|
||||
@endcan
|
||||
|
||||
<script>
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
</script>
|
||||
|
||||
@include ('partials.bootstrap-table', [
|
||||
'exportFile' => 'locations-export',
|
||||
|
||||
@@ -6,22 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Manufacturer::class)
|
||||
<a href="{{ route('manufacturers.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
|
||||
@if (Request::get('deleted')=='true')
|
||||
<a class="btn btn-default pull-right" href="{{ route('manufacturers.index') }}" style="margin-right: 5px;">{{ trans('general.show_current') }}</a>
|
||||
@else
|
||||
<a class="btn btn-default pull-right" href="{{ route('manufacturers.index', ['deleted' => 'true']) }}" style="margin-right: 5px;">
|
||||
{{ trans('general.show_deleted') }}</a>
|
||||
@endif
|
||||
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@@ -55,6 +39,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="manufacturersTable"
|
||||
data-buttons="manufacturerButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.manufacturers.index', ['deleted' => (request('deleted')=='true') ? 'true' : 'false' ]) }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.assets') }}
|
||||
{!! ($manufacturer->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($manufacturer->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
|
||||
{!! ($manufacturer->assets()->AssetsForShow()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($manufacturer->assets()->AssetsForShow()->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.licenses') }}
|
||||
{!! ($manufacturer->licenses->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($manufacturer->licenses->count()).'</badge>' : '' !!}
|
||||
{!! ($manufacturer->licenses->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($manufacturer->licenses->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
|
||||
</a>
|
||||
@@ -65,7 +65,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.accessories') }}
|
||||
{!! ($manufacturer->accessories->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($manufacturer->accessories->count()).'</badge>' : '' !!}
|
||||
{!! ($manufacturer->accessories->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($manufacturer->accessories->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -77,7 +77,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.consumables') }}
|
||||
{!! ($manufacturer->consumables->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($manufacturer->consumables->count()).'</badge>' : '' !!}
|
||||
{!! ($manufacturer->consumables->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($manufacturer->consumables->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -90,7 +90,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.components') }}
|
||||
{!! ($manufacturer->components->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($manufacturer->components->count()).'</badge>' : '' !!}
|
||||
{!! ($manufacturer->components->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($manufacturer->components->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
|
||||
</a>
|
||||
|
||||
@@ -12,21 +12,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\AssetModel::class)
|
||||
<a href="{{ route('models.create') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
|
||||
@if (Request::get('status')=='deleted')
|
||||
<a class="btn btn-default pull-right" href="{{ route('models.index') }}" style="margin-right: 5px;">{{ trans('admin/models/general.view_models') }}</a>
|
||||
@else
|
||||
<a class="btn btn-default pull-right" href="{{ route('models.index', ['status' => 'deleted']) }}" style="margin-right: 5px;">{{ trans('admin/models/general.view_deleted') }}</a>
|
||||
@endif
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@@ -49,6 +34,7 @@
|
||||
data-bulk-form-id="#modelsBulkForm"
|
||||
data-sort-order="asc"
|
||||
id="asssetModelsTable"
|
||||
data-buttons="modelButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.models.index', ['status' => request('status')]) }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.assets') }}
|
||||
{!! ($model->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($model->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
|
||||
{!! ($model->assets()->AssetsForShow()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($model->assets()->AssetsForShow()->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -67,7 +67,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.files') }}
|
||||
{!! ($model->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($model->uploads->count()).'</badge>' : '' !!}
|
||||
{!! ($model->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($model->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -110,11 +110,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<x-filestable
|
||||
filepath="private_uploads/assetmodels/"
|
||||
showfile_routename="show/modelfile"
|
||||
deletefile_routename="delete/modelfile"
|
||||
:object="$model" />
|
||||
<x-filestable object_type="models" :object="$model" />
|
||||
|
||||
</div> <!-- /.col-md-12 -->
|
||||
</div> <!-- /.row -->
|
||||
@@ -297,7 +293,7 @@
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@else
|
||||
<button class="btn btn-block btn-sm btn-danger btn-social delete-asset" data-toggle="modal" title="{{ trans('general.delete_what', ['item'=> trans('general.asset_model')]) }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $model->name]) }}" data-target="#dataConfirmModal" data-tooltip="true" data-placement="top" data-title="{{ trans('general.delete_what', ['item'=> trans('general.asset_model')]) }}">
|
||||
<button class="btn btn-block btn-sm btn-danger btn-social delete-asset" data-toggle="modal" title="{{ trans('general.delete_what', ['item'=> trans('general.asset_model')]) }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $model->name]) }}" data-target="#dataConfirmModal" data-tooltip="true" data-icon="fa fa-trash" data-placement="top" data-title="{{ trans('general.delete_what', ['item'=> trans('general.asset_model')]) }}" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@@ -315,15 +311,6 @@
|
||||
|
||||
@section('moar_scripts')
|
||||
|
||||
<script>
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
</script>
|
||||
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'manufacturer' . $model->name . '-export', 'search' => false])
|
||||
|
||||
@stop
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
paginationSwitchUp: 'fa-caret-square-o-up',
|
||||
fullscreen: 'fa-expand',
|
||||
columns: 'fa-columns',
|
||||
print: 'fa-print',
|
||||
refresh: 'fas fa-sync-alt',
|
||||
export: 'fa-download',
|
||||
clearSearch: 'fa-times'
|
||||
@@ -306,6 +307,25 @@
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
// This is a special formatter that will indicate whether a user is an admin or superadmin
|
||||
function usernameRoleLinkFormatter(value, row) {
|
||||
|
||||
if ((value) && (row)) {
|
||||
|
||||
if (row.role === 'superadmin') {
|
||||
return '<span style="white-space: nowrap" data-tooltip="true" title="{{ trans('general.superuser_tooltip') }}"><x-icon type="superadmin" title="{{ trans('general.superuser') }}" class="text-danger" /> <a href="{{ config('app.url') }}/users/' + row.id + '">' + value + '</a></span>';
|
||||
} else if (row.role === 'admin') {
|
||||
return '<span style="white-space: nowrap" data-tooltip="true" title="{{ trans('general.admin_tooltip') }}"><x-icon type="superadmin" title="{{ trans('general.admin_user') }}" class="text-warning" /> <a href="{{ config('app.url') }}/users/' + row.id + '">' + value + '</a></span>';
|
||||
}
|
||||
|
||||
// Regular user
|
||||
return '<a href="{{ config('app.url') }}/users/' + row.id + '">' + value + '</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Use this when we're introspecting into a column object and need to link
|
||||
function genericColumnObjLinkFormatter(destination) {
|
||||
return function (value,row) {
|
||||
@@ -370,6 +390,8 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Make the edit/delete buttons
|
||||
function genericActionsFormatter(owner_name, element_name) {
|
||||
if (!element_name) {
|
||||
@@ -424,7 +446,7 @@
|
||||
|
||||
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '" '
|
||||
+ ' class="actions btn btn-danger btn-sm delete-asset" data-tooltip="true" '
|
||||
+ ' data-toggle="modal" '
|
||||
+ ' data-toggle="modal" data-icon="fa-trash"'
|
||||
+ ' data-content="{{ trans('general.sure_to_delete') }}: ' + name_for_box + '?" '
|
||||
+ ' data-title="{{ trans('general.delete') }}" onClick="return false;">'
|
||||
+ '<x-icon type="delete" /><span class="sr-only">{{ trans('general.delete') }}</span></a> ';
|
||||
@@ -905,27 +927,162 @@
|
||||
return '<a href="' + value + '" data-toggle="lightbox" data-type="image"><img src="' + value + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="' + altName + '"></a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This is users in the user accounts section for EULAs
|
||||
function downloadFormatter(value) {
|
||||
if (value) {
|
||||
return '<a href="' + value + '" class="btn btn-sm btn-default"><x-icon type="download" /></a>';
|
||||
}
|
||||
}
|
||||
|
||||
function fileUploadFormatter(value) {
|
||||
// This is used by the UploadedFilesPresenter and the HistoryPresenter
|
||||
// It handles the download and inline buttons for files that are uploaded to assets, users, etc
|
||||
function fileDownloadButtonsFormatter(row, value) {
|
||||
|
||||
if (value) {
|
||||
if (value.url) {
|
||||
var inlinable = value.inlineable;
|
||||
var exists_on_disk = value.exists_on_disk;
|
||||
var download_url = value.url;
|
||||
} else if (value.file) {
|
||||
var inlinable = value.file.inlineable;
|
||||
var exists_on_disk = value.file.exists_on_disk;
|
||||
var download_url = value.file.url;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
var download_button = '<a href="' + download_url + '" class="btn btn-sm btn-default" data-tooltip="true" title="{{ trans('general.download') }}"><x-icon type="download" /></a>';
|
||||
var download_button_disabled = '<span data-tooltip="true" title="{{ trans('general.file_does_not_exist') }}"><a class="btn btn-sm btn-default disabled"><x-icon type="download" /></a></span>';
|
||||
var inline_button = '<a href="'+ download_url +'?inline=true" class="btn btn-sm btn-default" target="_blank" data-tooltip="true" title="{{ trans('general.open_new_window') }}"><x-icon type="external-link" /></a>';
|
||||
var inline_button_disabled = '<span data-tooltip="true" title="{{ trans('general.file_does_not_exist') }}"><a class="btn btn-sm btn-default disabled" target="_blank" data-tooltip="true" title="{{ trans('general.file_does_not_exist') }}"><x-icon type="external-link" /></a></span>';
|
||||
|
||||
if (exists_on_disk === true) {
|
||||
return '<span style="white-space: nowrap;">' + download_button + ' ' + inline_button + '</span>';
|
||||
} else {
|
||||
return '<span style="white-space: nowrap;">' + download_button_disabled + ' ' + inline_button_disabled + '</span>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function filePreviewFormatter(row, value) {
|
||||
|
||||
if ((value) && (value.url) && (value.inlineable)) {
|
||||
return '<a href="' + value.url + '" data-toggle="lightbox" data-type="image"><img src="' + value.url + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt=""></a>';
|
||||
} else if ((value) && (value.url)) {
|
||||
return '<a href="' + value.url + '" class="btn btn-default"><x-icon type="download" /></a>';
|
||||
|
||||
if (value.mediatype == 'image') {
|
||||
return '<a href="' + value.url + '" data-toggle="lightbox" data-type="image"><img src="' + value.url + '" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt=""></a>';
|
||||
} else if (value.mediatype == 'video') {
|
||||
return '<a href="' + value.url + '?inline=true" data-toggle="lightbox" data-type="video"><video style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"><source src="' + value.url + '?inline=true"></video></a>';
|
||||
} else if (value.mediatype == 'audio') {
|
||||
return '<audio controls><source src="' + value.url + '?inline=true" type="audio/mp3">Your browser does not support the audio element.</audio>';
|
||||
}
|
||||
return '{{ trans('general.preview_not_available') }}';
|
||||
}
|
||||
return '{{ trans('general.preview_not_available') }}';
|
||||
|
||||
}
|
||||
|
||||
|
||||
function fileUploadNameFormatter(value) {
|
||||
if ((value) && (value.filename) && (value.url)) {
|
||||
return '<a href="' + value.url + '">' + value.filename + '</a>';
|
||||
|
||||
|
||||
// This is used in the table listings
|
||||
function deleteUploadFormatter(value, row) {
|
||||
|
||||
if ((row.available_actions) && (row.available_actions.delete === true)) {
|
||||
var destination;
|
||||
|
||||
// This is kinda gross, but for right now we're posting to the GUI delete routes
|
||||
// All of these URLS and storage directories need to be updated to be more consistent :(
|
||||
if (row.item.type == 'assetmodels') {
|
||||
destination = 'models';
|
||||
} else {
|
||||
destination = row.item.type;
|
||||
}
|
||||
|
||||
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.item.id + '/showfile/' + row.id + '/delete" '
|
||||
+ ' data-target="#dataConfirmModal" class="actions btn btn-danger btn-sm delete-asset" data-tooltip="true" '
|
||||
+ ' data-toggle="modal" data-icon="fa-trash"'
|
||||
+ ' data-content="{{ trans('general.file_upload_status.confirm_delete') }}: ' + row.filename + '?" '
|
||||
+ ' data-title="{{ trans('general.delete') }}" onClick="return false;" data-icon="fa-trash">'
|
||||
+ '<x-icon type="delete" /><span class="sr-only">{{ trans('general.delete') }}</span></a> ';
|
||||
}
|
||||
}
|
||||
|
||||
// This handles the custom view for the filestable blade component gallery-card component
|
||||
window.customViewFormatter = data => {
|
||||
const template = $('#fileGalleryTemplate').html()
|
||||
let view = ''
|
||||
|
||||
$.each(data, function (i, row) {
|
||||
|
||||
delete_url = row.url +'/delete';
|
||||
|
||||
if (row.exists_on_disk === true)
|
||||
{
|
||||
if (row.mediatype === 'image') {
|
||||
embed_code = '<a href="' + row.url + '" data-toggle="lightbox" data-type="image" data-title="' + row.filename + row.filename + '" data-footer="' + row.note + '" class="embed-responsive-item"><img src="' + row.url + '?inline=true" alt="" style="max-width: 100%"></a>';
|
||||
} else if (row.mediatype === 'video') {
|
||||
embed_code = '<a href="' + row.url + '" data-toggle="lightbox" data-type="video" data-title="' + row.filename + row.filename + '" data-footer="' + row.note + '" class="embed-responsive-item"><video controls><source src="' + row.url + '?inline=true" type="video/mp4">Your browser does not support the video tag.</video></a>';
|
||||
} else if (row.mediatype === 'audio') {
|
||||
embed_code = '<audio style="width: 100%" controls><source src="' + row.url + '?inline=true" type="audio/mpeg">Your browser does not support the audio element.</audio>';
|
||||
} else if (row.mediatype === 'pdf') {
|
||||
embed_code = '<object height="200" style="width: 100%" type="application/pdf" data="' + row.url + '?inline=true">File cannot be displayed</object>';
|
||||
} else {
|
||||
embed_code = '<div class="text-center"><a href="' + row.url + '?inline=true"><i class="' + row.icon + '" style="font-size: 50px" /></i></a></div>';
|
||||
}
|
||||
} else {
|
||||
embed_code = '<div class="text-center text-danger" style="padding-top: 20px;"><i class="fa-solid fa-heart-crack" style="font-size: 80px" /></i> <br><br>{{ trans('general.file_upload_status.file_not_found') }}</div>';
|
||||
}
|
||||
|
||||
view += template.replace('%ID%', row.id)
|
||||
.replace('%ICON%', row.icon)
|
||||
.replace('%FILETYPE%', row.filetype)
|
||||
.replace('%FILE_URL%', row.url)
|
||||
.replace('%LINK_URL%', row.url)
|
||||
.replace('%FILENAME%', (row.exists_on_disk === true) ? row.filename : '<x-icon type="x" /> <del>' + row.filename + '</del>')
|
||||
.replace('%CREATED_AT%', row.created_at.formatted)
|
||||
.replace('%CREATED_BY%', (row.created_by) ? row.created_by.name : '')
|
||||
.replace('%NOTE%', (row.note) ? row.note : '')
|
||||
.replace('%PANEL_CLASS%', (row.exists_on_disk === true) ? 'default' : 'danger')
|
||||
.replace('%FILE_EMBED%', embed_code)
|
||||
.replace('%DOWNLOAD_BUTTON%', (row.exists_on_disk === true) ? '<a href="'+ row.url +'" class="btn btn-sm btn-default"><x-icon type="download" /></a> ' : '<span class="btn btn-sm btn-default disabled" data-tooltip="true" title="{{ trans('general.file_upload_status.file_not_found') }}"><x-icon type="download" /></span>')
|
||||
.replace('%NEW_WINDOW_BUTTON%', (row.exists_on_disk === true) ? '<a href="'+ row.url +'?inline=true" class="btn btn-sm btn-default" target="_blank"><x-icon type="external-link" /></a> ' : '<span class="btn btn-sm btn-default disabled" data-tooltip="true" title="{{ trans('general.file_upload_status.file_not_found') }}"><x-icon type="external-link"/></span>')
|
||||
.replace('%DELETE_BUTTON%', (row.available_actions.delete === true) ?
|
||||
'<a href="'+delete_url+'" class="delete-asset btn btn-danger btn-sm" data-icon="fa-trash" data-toggle="modal" data-content="{{ trans('general.file_upload_status.confirm_delete') }} '+ row.filename +'?" data-title="{{ trans('general.delete') }}" onClick="return false;" data-target="#dataConfirmModal"><x-icon type="delete" /><span class="sr-only">{{ trans('general.delete') }}</span></a>' :
|
||||
'<a class="btn btn-sm btn-danger disabled" data-tooltip="true" title="{{ trans('general.file_upload_status.file_not_found') }}"><x-icon type="delete" /><span class="sr-only">{{ trans('general.delete') }}</span></a>'
|
||||
);
|
||||
})
|
||||
|
||||
return `<div class="row">${view}</div>`
|
||||
}
|
||||
|
||||
|
||||
|
||||
function fileNameFormatter(row, value) {
|
||||
|
||||
if (value) {
|
||||
if ((value.file) && (value.file.filename) && (value.file.url)) {
|
||||
|
||||
if (value.file.exists_on_disk === true) {
|
||||
return '<a href="' + value.file.url + '">' + value.file.filename + '</a>';
|
||||
}
|
||||
|
||||
return '<span class="text-danger" style="text-decoration: line-through;" data-tooltip="true" title="{{ trans('general.file_does_not_exist') }}"><x-icon type="x" /> ' + value.file.filename + '</span>';
|
||||
|
||||
} else if ((value.filename) && (value.url)) {
|
||||
if (value.exists_on_disk === true) {
|
||||
return '<a href="' + value.url + '">' + value.filename + '</a>';
|
||||
}
|
||||
return '<span class="text-danger" style="text-decoration: line-through;" data-tooltip="true" title="{{ trans('general.file_does_not_exist') }}"><x-icon type="x" /> ' + value.filename + '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function linkToUserSectionBasedOnCount (count, id, section) {
|
||||
if (count) {
|
||||
return '<a href="{{ config('app.url') }}/users/' + id + '#' + section +'">' + count + '</a>';
|
||||
@@ -1068,6 +1225,501 @@
|
||||
});
|
||||
|
||||
|
||||
// User table buttons
|
||||
window.userButtons = () => ({
|
||||
@can('create', \App\Models\User::class)
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('users.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
@endcan
|
||||
|
||||
btnExport: {
|
||||
text: '{{ trans('general.export') }}',
|
||||
icon: 'fa-solid fa-file-csv',
|
||||
event () {
|
||||
window.location.href = '{{ route('users.export') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.export') }}'
|
||||
}
|
||||
},
|
||||
|
||||
btnShowAdmins: {
|
||||
text: '{{ trans('general.show_admins') }}',
|
||||
icon: 'fa-solid fa-crown{{ (request()->input('admins') == "true") ? ' text-danger' : '' }}',
|
||||
event () {
|
||||
window.location.href = '{{ (request()->input('admins') == "true") ? route('users.index') : route('users.index', ['admins' => 'true']) }}';
|
||||
},
|
||||
attributes: {
|
||||
title: 'Show only admins',
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
btnShowDeleted: {
|
||||
text: '{{ (request()->input('status') == "deleted") ?trans('admin/users/table.show_current') : trans('admin/users/table.show_deleted') }}',
|
||||
icon: 'fa-solid fa-user-slash {{ (request()->input('status') == "deleted") ? ' text-danger' : ' fa-user-slash' }}',
|
||||
event () {
|
||||
window.location.href = '{{ (request()->input('status') == "deleted") ? route('users.index') : route('users.index', ['status' => 'deleted']) }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ (request()->input('status') == "deleted") ? trans('admin/users/table.show_current') : trans('admin/users/table.show_deleted') }}',
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
}); // end user table buttons
|
||||
|
||||
|
||||
@can('create', \App\Models\Company::class)
|
||||
// Company table buttons
|
||||
window.companyButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('companies.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
|
||||
}); // End company table buttons
|
||||
@endcan
|
||||
|
||||
|
||||
// Asset table buttons
|
||||
window.assetButtons = () => ({
|
||||
@can('create', \App\Models\Asset::class)
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('hardware.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
@endcan
|
||||
|
||||
@can('update', \App\Models\Asset::class)
|
||||
btnAddMaintenance: {
|
||||
text: '{{ trans('button.add_maintenance') }}',
|
||||
icon: 'fa-solid fa-screwdriver-wrench',
|
||||
event () {
|
||||
window.location.href = '{{ route('maintenances.create', ['asset_id' => (isset($asset)) ? $asset->id :'' ]) }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
}
|
||||
},
|
||||
@endcan
|
||||
|
||||
|
||||
btnExport: {
|
||||
text: '{{ trans('admin/hardware/general.custom_export') }}',
|
||||
icon: 'fa-solid fa-file-csv',
|
||||
event () {
|
||||
window.location.href = '{{ route('reports/custom') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('admin/hardware/general.custom_export') }}'
|
||||
}
|
||||
},
|
||||
|
||||
btnShowDeleted: {
|
||||
text: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
|
||||
icon: 'fa-solid fa-trash {{ (request()->input('status') == "Deleted") ? ' text-danger' : '' }}',
|
||||
event () {
|
||||
window.location.href = '{{ (request()->input('status') == "Deleted") ? route('hardware.index') : route('hardware.index', ['status' => 'Deleted']) }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@can('create', \App\Models\Location::class)
|
||||
// Location table buttons
|
||||
window.locationButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('locations.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Accessory::class)
|
||||
// Accessory table buttons
|
||||
window.accessoryButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('accessories.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Depreciation::class)
|
||||
// Accessory table buttons
|
||||
window.depreciationButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('depreciations.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\CustomField::class)
|
||||
// Accessory table buttons
|
||||
window.customFieldButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('fields.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
|
||||
@can('create', \App\Models\CustomFieldset::class)
|
||||
// Accessory table buttons
|
||||
window.customFieldsetButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('fieldsets.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Component::class)
|
||||
// Compoment table buttons
|
||||
window.componentButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('components.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Consumable::class)
|
||||
// Consumable table buttons
|
||||
window.consumableButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('consumables.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Manufacturer::class)
|
||||
// Consumable table buttons
|
||||
window.manufacturerButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('manufacturers.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
},
|
||||
|
||||
btnShowDeleted: {
|
||||
text: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
|
||||
icon: 'fa-solid fa-trash {{ (request()->input('status') == "deleted") ? ' text-danger' : '' }}',
|
||||
event () {
|
||||
window.location.href = '{{ (request()->input('status') == "deleted") ? route('manufacturers.index') : route('manufacturers.index', ['status' => 'deleted']) }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Supplier::class)
|
||||
// Consumable table buttons
|
||||
window.supplierButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('suppliers.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Component::class)
|
||||
// License table buttons
|
||||
window.licenseButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('licenses.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Department::class)
|
||||
// Department table buttons
|
||||
window.departmentButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('departments.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\CustomField::class)
|
||||
// Custom Field table buttons
|
||||
window.departmentButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('departments.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('update', \App\Models\Asset::class)
|
||||
// Custom Field table buttons
|
||||
window.maintenanceButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('maintenances.create', ['asset_id' => (isset($asset)) ? $asset->id :'' ]) }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Category::class)
|
||||
// Custom Field table buttons
|
||||
window.categoryButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('categories.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\AssetModel::class)
|
||||
// Custom Field table buttons
|
||||
window.modelButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('models.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
btnShowDeleted: {
|
||||
text: '{{ (request()->input('status') == "deleted") ? trans('general.list_all') : trans('general.deleted') }}',
|
||||
icon: 'fa-solid fa-trash {{ (request()->input('status') == "deleted") ? ' text-danger' : '' }}',
|
||||
event () {
|
||||
window.location.href = '{{ (request()->input('status') == "deleted") ? route('models.index') : route('models.index', ['status' => 'deleted']) }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\Statuslabel::class)
|
||||
// Status label table buttons
|
||||
window.statuslabelButtons = () => ({
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('statuslabels.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
});
|
||||
@endcan
|
||||
|
||||
|
||||
// License table buttons
|
||||
window.licenseButtons = () => ({
|
||||
@can('create', \App\Models\License::class)
|
||||
btnAdd: {
|
||||
text: '{{ trans('general.create') }}',
|
||||
icon: 'fa fa-plus',
|
||||
event () {
|
||||
window.location.href = '{{ route('licenses.create') }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.create') }}',
|
||||
@if ($snipeSettings->shortcuts_enabled == 1)
|
||||
accesskey: 'n'
|
||||
@endif
|
||||
}
|
||||
},
|
||||
@endcan
|
||||
|
||||
btnExport: {
|
||||
text: '{{ trans('general.export') }}',
|
||||
icon: 'fa-solid fa-file-csv',
|
||||
event () {
|
||||
window.location.href = '{{ route('licenses.export', ['category_id' => (isset($category)) ? $category->id :'' ]) }}';
|
||||
},
|
||||
attributes: {
|
||||
title: '{{ trans('general.export') }}'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
|
||||
|
||||
@@ -823,12 +823,6 @@
|
||||
.on('select2:select', function (event) {
|
||||
window.location.href = event.params.data.element.dataset.route;
|
||||
});
|
||||
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
@stop
|
||||
|
||||
@@ -6,12 +6,6 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Statuslabel::class)
|
||||
<a href="{{ route('statuslabels.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@@ -28,6 +22,7 @@
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="statuslabelsTable"
|
||||
data-buttons="statuslabelButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.statuslabels.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
id="assetsListingTable"
|
||||
data-buttons="assetButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.assets.index', ['status_id' => $statuslabel->id]) }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -10,12 +10,6 @@
|
||||
@section('content')
|
||||
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Supplier::class)
|
||||
<a href="{{ route('suppliers.create') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
@@ -27,6 +21,7 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="suppliersTable"
|
||||
data-buttons="supplierButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.suppliers.index') }}"
|
||||
data-export-options='{
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.assets') }}
|
||||
{!! ($supplier->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($supplier->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
|
||||
{!! ($supplier->assets()->AssetsForShow()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($supplier->assets()->AssetsForShow()->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
|
||||
</a>
|
||||
@@ -48,7 +48,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.accessories') }}
|
||||
{!! ($supplier->accessories->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($supplier->accessories->count()).'</badge>' : '' !!}
|
||||
{!! ($supplier->accessories->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($supplier->accessories->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -60,7 +60,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.licenses') }}
|
||||
{!! ($supplier->licenses->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($supplier->licenses->count()).'</badge>' : '' !!}
|
||||
{!! ($supplier->licenses->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($supplier->licenses->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -72,7 +72,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.components') }}
|
||||
{!! ($supplier->components->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($supplier->components->count()).'</badge>' : '' !!}
|
||||
{!! ($supplier->components->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($supplier->components->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -84,7 +84,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.consumables') }}
|
||||
{!! ($supplier->consumables->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($supplier->consumables->count()).'</badge>' : '' !!}
|
||||
{!! ($supplier->consumables->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($supplier->consumables->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -96,7 +96,7 @@
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('admin/asset_maintenances/general.asset_maintenances') }}
|
||||
{!! ($supplier->asset_maintenances->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($supplier->asset_maintenances->count()).'</badge>' : '' !!}
|
||||
{!! ($supplier->asset_maintenances->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($supplier->asset_maintenances->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -18,16 +18,6 @@
|
||||
@if ($snipeSettings->ldap_enabled == 1)
|
||||
<a href="{{ route('ldap/user') }}" class="btn btn-default pull-right"><span class="fas fa-sitemap"></span>{{trans('general.ldap_sync')}}</a>
|
||||
@endif
|
||||
<a href="{{ route('users.create') }}" {{$snipeSettings->shortcuts_enabled == 1 ? "n" : ''}} class="btn btn-primary pull-right" style="margin-right: 5px;"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
|
||||
@if (request('status')=='deleted')
|
||||
<a class="btn btn-default pull-right" href="{{ route('users.index') }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_current') }}</a>
|
||||
@else
|
||||
<a class="btn btn-default pull-right" href="{{ route('users.index', ['status' => 'deleted']) }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_deleted') }}</a>
|
||||
@endif
|
||||
@can('view', \App\Models\User::class)
|
||||
<a class="btn btn-default pull-right" href="{{ route('users.export') }}" style="margin-right: 5px;">{{ trans('general.export') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
@@ -50,9 +40,17 @@
|
||||
data-bulk-button-id="#bulkUserEditButton"
|
||||
data-bulk-form-id="#usersBulkForm"
|
||||
id="usersTable"
|
||||
data-buttons="userButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.users.index',
|
||||
array('deleted'=> (request('status')=='deleted') ? 'true' : 'false','company_id' => e(request('company_id')))) }}"
|
||||
[
|
||||
'status' => e(request('status')),
|
||||
'deleted'=> (request('status')=='deleted') ? 'true' : 'false',
|
||||
'company_id' => e(request('company_id')),
|
||||
'manager_id' => e(request('manager_id')),
|
||||
'admins' => e(request('admins')),
|
||||
'superadmins' => e(request('superadmins'))
|
||||
]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-users-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
@@ -63,6 +61,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<x-icon type="assets" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.assets') }}
|
||||
{!! ($user->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->assets()->AssetsForShow()->withoutTrashed()->count()).'</badge>' : '' !!}
|
||||
{!! ($user->assets()->AssetsForShow()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($user->assets()->AssetsForShow()->withoutTrashed()->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -56,7 +56,7 @@
|
||||
<x-icon type="licenses" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.licenses') }}
|
||||
{!! ($user->licenses->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->licenses->count()).'</badge>' : '' !!}
|
||||
{!! ($user->licenses->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($user->licenses->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -67,7 +67,7 @@
|
||||
<x-icon type="accessories" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.accessories') }}
|
||||
{!! ($user->accessories->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->accessories->count()).'</badge>' : '' !!}
|
||||
{!! ($user->accessories->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($user->accessories->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -78,7 +78,7 @@
|
||||
<x-icon type="consumables" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.consumables') }}
|
||||
{!! ($user->consumables->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->consumables->count()).'</badge>' : '' !!}
|
||||
{!! ($user->consumables->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($user->consumables->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -89,7 +89,7 @@
|
||||
<x-icon type="files" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($user->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->uploads->count()).'</badge>' : '' !!}
|
||||
{!! ($user->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($user->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -110,7 +110,7 @@
|
||||
<x-icon type="locations" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/users/table.managed_locations') }}
|
||||
{!! ($user->managedLocations->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->managedLocations->count()).'</badge>' : '' !!}
|
||||
{!! ($user->managedLocations->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($user->managedLocations->count()).'</span>' : '' !!}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@@ -122,7 +122,7 @@
|
||||
<x-icon type="users" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/users/table.managed_users') }}
|
||||
{!! ($user->managesUsers->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->managesUsers->count()).'</badge>' : '' !!}
|
||||
{!! ($user->managesUsers->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($user->managesUsers->count()).'</span>' : '' !!}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@@ -266,7 +266,7 @@
|
||||
@if ($user->deleted_at=='')
|
||||
<div class="col-md-12" style="padding-top: 30px;">
|
||||
@if ($user->isDeletable())
|
||||
<a href="#" class="btn-block delete-asset btn btn-sm btn-danger btn-social hidden-print" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $user->present()->fullName]) }}" data-target="#dataConfirmModal">
|
||||
<a href="" class="delete-asset btn-block btn btn-sm btn-danger btn-social hidden-print" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $user->present()->fullName]) }}" data-icon="fa-trash" data-target="#dataConfirmModal" onClick="return false;" >
|
||||
<x-icon type="delete" />
|
||||
{{ trans('button.delete')}}
|
||||
</a>
|
||||
@@ -809,6 +809,7 @@
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
id="userAssetsListingTable"
|
||||
data-buttons="assetButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.assets.index',['assigned_to' => e($user->id), 'assigned_type' => 'App\Models\User']) }}"
|
||||
data-export-options='{
|
||||
@@ -827,6 +828,7 @@
|
||||
data-cookie-id-table="userLicenseTable"
|
||||
data-id-table="userLicenseTable"
|
||||
id="userLicenseTable"
|
||||
data-buttons="licenseButtons"
|
||||
data-side-pagination="client"
|
||||
data-show-footer="true"
|
||||
data-sort-name="name"
|
||||
@@ -886,6 +888,7 @@
|
||||
data-cookie-id-table="userAccessoryTable"
|
||||
data-id-table="userAccessoryTable"
|
||||
id="userAccessoryTable"
|
||||
data-buttons="accessoryButtons"
|
||||
data-side-pagination="client"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table table-hover"
|
||||
@@ -929,6 +932,7 @@
|
||||
data-cookie-id-table="userConsumableTable"
|
||||
data-id-table="userConsumableTable"
|
||||
id="userConsumableTable"
|
||||
data-buttons="consumableButtons"
|
||||
data-side-pagination="client"
|
||||
data-show-footer="true"
|
||||
data-sort-name="name"
|
||||
@@ -965,11 +969,7 @@
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<x-filestable
|
||||
filepath="private_uploads/users/"
|
||||
showfile_routename="show/userfile"
|
||||
deletefile_routename="userfile.destroy"
|
||||
:object="$user" />
|
||||
<x-filestable object_type="users" :object="$user" />
|
||||
</div>
|
||||
</div> <!--/ROW-->
|
||||
</div><!--/FILES-->
|
||||
@@ -1010,6 +1010,7 @@
|
||||
data-bulk-form-id="#locationsBulkForm"
|
||||
data-side-pagination="server"
|
||||
id="locationTable"
|
||||
data-buttons="locationButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.locations.index', ['manager_id' => $user->id]) }}"
|
||||
data-export-options='{
|
||||
@@ -1034,6 +1035,7 @@
|
||||
data-bulk-form-id="#usersBulkForm"
|
||||
data-side-pagination="server"
|
||||
id="managedUsersTable"
|
||||
data-buttons="userButtons"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.users.index', ['manager_id' => $user->id]) }}"
|
||||
data-export-options='{
|
||||
@@ -1061,12 +1063,6 @@
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
$(function () {
|
||||
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
|
||||
|
||||
$("#two_factor_reset").click(function(){
|
||||
|
||||
@@ -31,7 +31,7 @@ Route::group(['prefix' => 'components', 'middleware' => ['auth']], function () {
|
||||
)->name('upload/component');
|
||||
|
||||
Route::delete(
|
||||
'{componentId}/deletefile/{fileId}',
|
||||
'{componentId}/showfile/{fileId}/delete',
|
||||
[Components\ComponentsFilesController::class, 'destroy']
|
||||
)->name('delete/componentfile');
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Route::group(['prefix' => 'consumables', 'middleware' => ['auth']], function ()
|
||||
)->name('upload/consumable');
|
||||
|
||||
Route::delete(
|
||||
'{consumableId}/deletefile/{fileId}',
|
||||
'{consumableId}/showfile/{fileId}/delete',
|
||||
[Consumables\ConsumablesFilesController::class, 'destroy']
|
||||
)->name('delete/consumablefile');
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ Route::group(['prefix' => 'licenses', 'middleware' => ['auth']], function () {
|
||||
)->name('upload/license');
|
||||
|
||||
Route::delete(
|
||||
'{licenseId}/deletefile/{fileId}',
|
||||
'{licenseId}/showfile/{fileId}/delete',
|
||||
[Licenses\LicenseFilesController::class, 'destroy']
|
||||
)->name('delete/licensefile');
|
||||
Route::get(
|
||||
|
||||
@@ -73,7 +73,7 @@ Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () {
|
||||
)->name('upload/user')->withTrashed();
|
||||
|
||||
Route::delete(
|
||||
'{userId}/deletefile/{fileId}',
|
||||
'{userId}/showfile/{fileId}/delete',
|
||||
[
|
||||
Users\UserFilesController::class,
|
||||
'destroy'
|
||||
|
||||
@@ -134,6 +134,7 @@ mix
|
||||
'./node_modules/bootstrap-table/dist/extensions/sticky-header/bootstrap-table-sticky-header.js',
|
||||
'./node_modules/bootstrap-table/dist/extensions/addrbar/bootstrap-table-addrbar.js',
|
||||
'./node_modules/bootstrap-table/dist/extensions/print/bootstrap-table-print.min.js',
|
||||
'./node_modules/bootstrap-table/dist/extensions/custom-view/bootstrap-table-custom-view.js',
|
||||
'./resources/assets/js/extensions/jquery.base64.js',
|
||||
'./node_modules/tableexport.jquery.plugin/tableExport.min.js',
|
||||
'./node_modules/tableexport.jquery.plugin/libs/jsPDF/jspdf.umd.min.js',
|
||||
|
||||
Reference in New Issue
Block a user