Merge remote-tracking branch 'origin/develop'

# Conflicts:
#	public/css/build/app.css
#	public/css/build/app.css.map
#	public/css/build/overrides.css
#	public/css/build/overrides.css.map
#	public/css/dist/all.css
#	public/js/dist/all.js
#	public/js/dist/all.js.map
#	public/mix-manifest.json
This commit is contained in:
snipe
2025-11-17 13:37:16 +00:00
88 changed files with 890 additions and 242 deletions

View File

@@ -43,6 +43,7 @@ class CategoriesController extends Controller
'created_at',
'updated_at',
'image',
'tag_color',
'notes',
];
@@ -57,6 +58,7 @@ class CategoriesController extends Controller
'require_acceptance',
'checkin_email',
'image',
'tag_color',
'notes',
])
->with('adminuser')

View File

@@ -38,6 +38,7 @@ class CompaniesController extends Controller
'accessories_count',
'consumables_count',
'components_count',
'tag_color',
'notes',
];
@@ -64,6 +65,11 @@ class CompaniesController extends Controller
$companies->where('created_by', '=', $request->input('created_by'));
}
if ($request->filled('tag_color')) {
$companies->where('tag_color', '=', $request->input('tag_color'));
}
// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $companies->count()) ? $companies->count() : app('api_offset_value');
@@ -191,6 +197,7 @@ class CompaniesController extends Controller
'companies.name',
'companies.email',
'companies.image',
'companies.tag_color',
]);

View File

@@ -24,7 +24,7 @@ class DepartmentsController extends Controller
public function index(Request $request) : JsonResponse | array
{
$this->authorize('view', Department::class);
$allowed_columns = ['id', 'name', 'image', 'users_count', 'notes'];
$allowed_columns = ['id', 'name', 'image', 'users_count', 'notes', 'tag_color'];
$departments = Department::select(
[
@@ -38,6 +38,7 @@ class DepartmentsController extends Controller
'departments.created_at',
'departments.updated_at',
'departments.image',
'departments.tag_color',
'departments.notes'
])->with('users')->with('location')->with('manager')->with('company')->withCount('users as users_count');
@@ -61,6 +62,10 @@ class DepartmentsController extends Controller
$departments->where('location_id', '=', $request->input('location_id'));
}
if ($request->filled('tag_color')) {
$departments->where('tag_color', '=', $request->input('departments.tag_color'));
}
// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $departments->count()) ? $departments->count() : app('api_offset_value');
$limit = app('api_limit_value');
@@ -186,6 +191,7 @@ class DepartmentsController extends Controller
'id',
'name',
'image',
'tag_color',
]);
if ($request->filled('search')) {

View File

@@ -59,6 +59,7 @@ class LocationsController extends Controller
'state',
'updated_at',
'zip',
'tag_color',
'notes',
];
@@ -81,6 +82,8 @@ class LocationsController extends Controller
'locations.ldap_ou',
'locations.currency',
'locations.company_id',
'locations.tag_color',
'locations.tag_color',
'locations.notes',
'locations.created_by',
'locations.deleted_at',
@@ -145,6 +148,10 @@ class LocationsController extends Controller
$locations->onlyTrashed();
}
if ($request->filled('tag_color')) {
$locations->where('tag_color', '=', $request->input('locations.tag_color'));
}
// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $locations->count()) ? $locations->count() : app('api_offset_value');
$limit = app('api_limit_value');
@@ -402,6 +409,7 @@ class LocationsController extends Controller
'locations.name',
'locations.parent_id',
'locations.image',
'locations.tag_color',
]);
// Only scope locations if the setting is enabled

View File

@@ -47,6 +47,7 @@ class ManufacturersController extends Controller
'consumables_count',
'components_count',
'licenses_count',
'tag_color',
'notes',
];
@@ -63,6 +64,7 @@ class ManufacturersController extends Controller
'updated_at',
'image',
'deleted_at',
'tag_color',
'notes',
])
->with('adminuser')
@@ -104,6 +106,10 @@ class ManufacturersController extends Controller
$manufacturers->where('support_email', '=', $request->input('support_email'));
}
if ($request->filled('tag_color')) {
$manufacturers->where('tag_color', '=', $request->input('manufacturers.tag_color'));
}
// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $manufacturers->count()) ? $manufacturers->count() : app('api_offset_value');
$limit = app('api_limit_value');
@@ -258,6 +264,7 @@ class ManufacturersController extends Controller
'id',
'name',
'image',
'tag_color',
]);
if ($request->filled('search')) {

View File

@@ -50,12 +50,13 @@ class SuppliersController extends Controller
'accessories_count',
'components_count',
'consumables_count',
'tag_color',
'url',
'notes',
];
$suppliers = Supplier::select(
['id', 'name', 'address', 'address2', 'city', 'state', 'country', 'fax', 'phone', 'email', 'contact', 'created_at', 'created_by', 'updated_at', 'deleted_at', 'image', 'notes', 'url', 'zip'])
['id', 'name', 'address', 'address2', 'city', 'state', 'country', 'fax', 'phone', 'email', 'contact', 'created_at', 'created_by', 'updated_at', 'deleted_at', 'image', 'notes', 'url', 'zip', 'tag_color'])
->withCount('assets as assets_count')
->withCount('licenses as licenses_count')
->withCount('accessories as accessories_count')
@@ -251,6 +252,7 @@ class SuppliersController extends Controller
'id',
'name',
'image',
'tag_color',
]);
if ($request->filled('search')) {

View File

@@ -78,6 +78,7 @@ class CategoriesController extends Controller
$category->require_acceptance = $request->input('require_acceptance', '0');
$category->alert_on_response = $request->input('alert_on_response', '0');
$category->checkin_email = $request->input('checkin_email', '0');
$category->tag_color = $request->input('tag_color');
$category->notes = $request->input('notes');
$category->created_by = auth()->id();
@@ -132,6 +133,7 @@ class CategoriesController extends Controller
$category->require_acceptance = $request->input('require_acceptance', '0');
$category->alert_on_response = $request->input('alert_on_response', '0');
$category->checkin_email = $request->input('checkin_email', '0');
$category->tag_color = $request->input('tag_color');
$category->notes = $request->input('notes');
$category = $request->handleImages($category);

View File

@@ -60,6 +60,7 @@ final class CompaniesController extends Controller
$company->phone = $request->input('phone');
$company->fax = $request->input('fax');
$company->email = $request->input('email');
$company->tag_color = $request->input('tag_color');
$company->notes = $request->input('notes');
$company->created_by = auth()->id();
@@ -102,6 +103,7 @@ final class CompaniesController extends Controller
$company->phone = $request->input('phone');
$company->fax = $request->input('fax');
$company->email = $request->input('email');
$company->tag_color = $request->input('tag_color');
$company->notes = $request->input('notes');
$company = $request->handleImages($company);

View File

@@ -55,6 +55,7 @@ class DepartmentsController extends Controller
$department->manager_id = ($request->filled('manager_id') ? $request->input('manager_id') : null);
$department->location_id = ($request->filled('location_id') ? $request->input('location_id') : null);
$department->company_id = ($request->filled('company_id') ? $request->input('company_id') : null);
$department->tag_color = $request->input('tag_color');
$department->notes = $request->input('notes');
$department = $request->handleImages($department);
@@ -157,6 +158,7 @@ class DepartmentsController extends Controller
$department->company_id = ($request->filled('company_id') ? $request->input('company_id') : null);
$department->phone = $request->input('phone');
$department->fax = $request->input('fax');
$department->tag_color = $request->input('tag_color');
$department->notes = $request->input('notes');
$department = $request->handleImages($department);

View File

@@ -82,6 +82,7 @@ class LocationsController extends Controller
$location->created_by = auth()->id();
$location->phone = request('phone');
$location->fax = request('fax');
$location->tag_color = $request->input('tag_color');
$location->notes = $request->input('notes');
$location->company_id = Company::getIdForCurrentUser($request->input('company_id'));
@@ -156,6 +157,7 @@ class LocationsController extends Controller
$location->fax = request('fax');
$location->ldap_ou = $request->input('ldap_ou');
$location->manager_id = $request->input('manager_id');
$location->tag_color = $request->input('tag_color');
$location->notes = $request->input('notes');
// Only scope the location if the setting is enabled

View File

@@ -101,6 +101,7 @@ class ManufacturersController extends Controller
$manufacturer->support_email = $request->input('support_email');
$manufacturer->notes = $request->input('notes');
$manufacturer = $request->handleImages($manufacturer);
$manufacturer->tag_color = $request->input('tag_color');
if ($manufacturer->save()) {
return redirect()->route('manufacturers.index')->with('success', trans('admin/manufacturers/message.create.success'));
@@ -142,6 +143,7 @@ class ManufacturersController extends Controller
$manufacturer->warranty_lookup_url = $request->input('warranty_lookup_url');
$manufacturer->support_phone = $request->input('support_phone');
$manufacturer->support_email = $request->input('support_email');
$manufacturer->tag_color = $request->input('tag_color');
$manufacturer->notes = $request->input('notes');
// Set the model's image property to null if the image is being deleted

View File

@@ -67,6 +67,7 @@ class SuppliersController extends Controller
$supplier->phone = request('phone');
$supplier->fax = request('fax');
$supplier->email = request('email');
$supplier->tag_color = $request->input('tag_color');
$supplier->notes = request('notes');
$supplier->url = $supplier->addhttp(request('url'));
$supplier->created_by = auth()->id();
@@ -111,6 +112,7 @@ class SuppliersController extends Controller
$supplier->fax = request('fax');
$supplier->email = request('email');
$supplier->url = $supplier->addhttp(request('url'));
$supplier->tag_color = $request->input('tag_color');
$supplier->notes = request('notes');
$supplier = $request->handleImages($supplier);

View File

@@ -26,12 +26,32 @@ class AccessoriesTransformer
'id' => $accessory->id,
'name' => e($accessory->name),
'image' => ($accessory->image) ? Storage::disk('public')->url('accessories/'.e($accessory->image)) : null,
'company' => ($accessory->company) ? ['id' => $accessory->company->id, 'name'=> e($accessory->company->name)] : null,
'manufacturer' => ($accessory->manufacturer) ? ['id' => $accessory->manufacturer->id, 'name'=> e($accessory->manufacturer->name)] : null,
'supplier' => ($accessory->supplier) ? ['id' => $accessory->supplier->id, 'name'=> e($accessory->supplier->name)] : null,
'company' => ($accessory->company) ? [
'id' => $accessory->company->id,
'name'=> e($accessory->company->name),
'tag_color'=> ($accessory->company->tag_color) ? e($accessory->company->tag_color) : null,
] : null,
'manufacturer' => ($accessory->manufacturer) ? [
'id' => $accessory->manufacturer->id,
'name'=> e($accessory->manufacturer->name),
'tag_color'=> ($accessory->manufacturer->tag_color) ? e($accessory->manufacturer->tag_color) : null,
] : null,
'supplier' => ($accessory->supplier) ? [
'id' => $accessory->supplier->id,
'name'=> e($accessory->supplier->name),
'tag_color'=> ($accessory->supplier->tag_color) ? e($accessory->supplier->tag_color) : null,
] : null,
'model_number' => ($accessory->model_number) ? e($accessory->model_number) : null,
'category' => ($accessory->category) ? ['id' => $accessory->category->id, 'name'=> e($accessory->category->name)] : null,
'location' => ($accessory->location) ? ['id' => $accessory->location->id, 'name'=> e($accessory->location->name)] : null,
'category' => ($accessory->category) ? [
'id' => $accessory->category->id,
'name'=> e($accessory->category->name),
'tag_color'=> ($accessory->category->tag_color) ? e($accessory->category->tag_color) : null,
] : null,
'location' => ($accessory->location) ? [
'id' => $accessory->location->id,
'name'=> e($accessory->location->name),
'tag_color'=> ($accessory->location->tag_color) ? e($accessory->location->tag_color) : null,
] : null,
'notes' => ($accessory->notes) ? Helper::parseEscapedMarkedownInline($accessory->notes) : null,
'qty' => ($accessory->qty) ? (int) $accessory->qty : null,
'purchase_date' => ($accessory->purchase_date) ? Helper::getFormattedDateObject($accessory->purchase_date, 'date') : null,

View File

@@ -161,6 +161,7 @@ class ActionlogsTransformer
'location' => ($actionlog->location) ? [
'id' => (int) $actionlog->location->id,
'name' => e($actionlog->location->name),
'tag_color'=> ($actionlog->location->tag_color) ? e($actionlog->location->tag_color) : null,
] : null,
'created_at' => Helper::getFormattedDateObject($actionlog->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($actionlog->updated_at, 'datetime'),

View File

@@ -44,6 +44,7 @@ class AssetModelsTransformer
'manufacturer' => ($assetmodel->manufacturer) ? [
'id' => (int) $assetmodel->manufacturer->id,
'name'=> e($assetmodel->manufacturer->name),
'tag_color'=> ($assetmodel->manufacturer->tag_color) ? e($assetmodel->manufacturer->tag_color) : null,
] : null,
'image' => ($assetmodel->image != '') ? Storage::disk('public')->url('models/'.e($assetmodel->image)) : null,
'model_number' => ($assetmodel->model_number ? e($assetmodel->model_number): null),
@@ -60,6 +61,7 @@ class AssetModelsTransformer
'category' => ($assetmodel->category) ? [
'id' => (int) $assetmodel->category->id,
'name'=> e($assetmodel->category->name),
'tag_color'=> ($assetmodel->category->tag_color) ? e($assetmodel->category->tag_color) : null,
] : null,
'fieldset' => ($assetmodel->fieldset) ? [
'id' => (int) $assetmodel->fieldset->id,

View File

@@ -40,7 +40,6 @@ class AssetsTransformer
] : null,
'byod' => ($asset->byod ? true : false),
'requestable' => ($asset->requestable ? true : false),
'model_number' => (($asset->model) && ($asset->model->model_number)) ? e($asset->model->model_number) : null,
'eol' => (($asset->asset_eol_date != '') && ($asset->purchase_date != '')) ? (int) Carbon::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date, true) . ' months' : null,
'asset_eol_date' => ($asset->asset_eol_date != '') ? Helper::getFormattedDateObject($asset->asset_eol_date, 'date') : null,
@@ -53,10 +52,12 @@ class AssetsTransformer
'category' => (($asset->model) && ($asset->model->category)) ? [
'id' => (int) $asset->model->category->id,
'name'=> e($asset->model->category->name),
'tag_color'=> ($asset->model->category->tag_color) ? e($asset->model->category->tag_color) : null,
] : null,
'manufacturer' => (($asset->model) && ($asset->model->manufacturer)) ? [
'id' => (int) $asset->model->manufacturer->id,
'name'=> e($asset->model->manufacturer->name),
'tag_color'=> ($asset->model->manufacturer->tag_color) ? e($asset->model->manufacturer->tag_color) : null,
] : null,
'depreciation' => (($asset->model) && ($asset->model->depreciation)) ? [
'id' => (int) $asset->model->depreciation->id,
@@ -68,20 +69,24 @@ class AssetsTransformer
'supplier' => ($asset->supplier) ? [
'id' => (int) $asset->supplier->id,
'name'=> e($asset->supplier->name),
'tag_color'=> ($asset->supplier->tag_color) ? e($asset->supplier->tag_color) : null,
] : null,
'notes' => ($asset->notes) ? Helper::parseEscapedMarkedownInline($asset->notes) : null,
'order_number' => ($asset->order_number) ? e($asset->order_number) : null,
'company' => ($asset->company) ? [
'id' => (int) $asset->company->id,
'name'=> e($asset->company->name),
'tag_color'=> ($asset->company->tag_color) ? e($asset->company->tag_color) : null,
] : null,
'location' => ($asset->location) ? [
'id' => (int) $asset->location->id,
'name'=> e($asset->location->name),
'tag_color'=> ($asset->location->tag_color) ? e($asset->location->tag_color) : null,
] : null,
'rtd_location' => ($asset->defaultLoc) ? [
'id' => (int) $asset->defaultLoc->id,
'name'=> e($asset->defaultLoc->name),
'tag_color'=> ($asset->defaultLoc->tag_color) ? e($asset->defaultLoc->tag_color) : null,
] : null,
'image' => ($asset->getImageUrl()) ? $asset->getImageUrl() : null,
'qr' => ($setting->qr_code=='1') ? config('app.url').'/uploads/barcodes/qr-'.str_slug($asset->asset_tag).'-'.str_slug($asset->id).'.png' : null,

View File

@@ -66,6 +66,7 @@ class CategoriesTransformer
'id' => (int) $category->adminuser->id,
'name'=> e($category->adminuser->display_name),
] : null,
'tag_color' => $category->tag_color ? e($category->tag_color) : null,
'notes' => Helper::parseEscapedMarkedownInline($category->notes),
'created_at' => Helper::getFormattedDateObject($category->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($category->updated_at, 'datetime'),

View File

@@ -40,6 +40,7 @@ class CompaniesTransformer
'id' => (int) $company->adminuser->id,
'name'=> e($company->adminuser->display_name),
] : null,
'tag_color' => ($company->tag_color!='') ? e($company->tag_color): null,
'notes' => Helper::parseEscapedMarkedownInline($company->notes),
'created_at' => Helper::getFormattedDateObject($company->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($company->updated_at, 'datetime'),

View File

@@ -30,15 +30,25 @@ class ComponentsTransformer
'location' => ($component->location) ? [
'id' => (int) $component->location->id,
'name' => e($component->location->name),
'tag_color' => $component->location->tag_color ? e($component->location->tag_color) : null,
] : null,
'qty' => ($component->qty != '') ? (int) $component->qty : null,
'min_amt' => ($component->min_amt != '') ? (int) $component->min_amt : null,
'category' => ($component->category) ? [
'id' => (int) $component->category->id,
'name' => e($component->category->name),
'tag_color' => $component->category->tag_color ? e($component->category->tag_color) : null,
] : null,
'supplier' => ($component->supplier) ? [
'id' => $component->supplier->id,
'name'=> e($component->supplier->name),
'tag_color' => $component->supplier->tag_color ? e($component->supplier->tag_color) : null,
] : null,
'manufacturer' => ($component->manufacturer) ? [
'id' => $component->manufacturer->id,
'name'=> e($component->manufacturer->name),
'tag_color' => $component->manufacturer->tag_color ? e($component->manufacturer->tag_color) : null,
] : null,
'supplier' => ($component->supplier) ? ['id' => $component->supplier->id, 'name'=> e($component->supplier->name)] : null,
'manufacturer' => ($component->manufacturer) ? ['id' => $component->manufacturer->id, 'name'=> e($component->manufacturer->name)] : null,
'model_number' => ($component->model_number) ? e($component->model_number) : null,
'order_number' => e($component->order_number),
'purchase_date' => Helper::getFormattedDateObject($component->purchase_date, 'date'),
@@ -48,6 +58,7 @@ class ComponentsTransformer
'company' => ($component->company) ? [
'id' => (int) $component->company->id,
'name' => e($component->company->name),
'tag_color' => $component->company->tag_color ? e($component->company->tag_color) : null,
] : null,
'notes' => ($component->notes) ? Helper::parseEscapedMarkedownInline($component->notes) : null,
'created_by' => ($component->adminuser) ? [

View File

@@ -26,12 +26,32 @@ class ConsumablesTransformer
'id' => (int) $consumable->id,
'name' => e($consumable->name),
'image' => ($consumable->getImageUrl()) ? ($consumable->getImageUrl()) : null,
'category' => ($consumable->category) ? ['id' => $consumable->category->id, 'name' => e($consumable->category->name)] : null,
'company' => ($consumable->company) ? ['id' => (int) $consumable->company->id, 'name' => e($consumable->company->name)] : null,
'category' => ($consumable->category) ? [
'id' => $consumable->category->id,
'name' => e($consumable->category->name),
'tag_color' => $consumable->category->tag_color ? e($consumable->category->tag_color) : null,
] : null,
'company' => ($consumable->company) ? [
'id' => (int) $consumable->company->id,
'name' => e($consumable->company->name),
'tag_color' => $consumable->company->tag_color ? e($consumable->company->tag_color) : null,
] : null,
'item_no' => e($consumable->item_no),
'location' => ($consumable->location) ? ['id' => (int) $consumable->location->id, 'name' => e($consumable->location->name)] : null,
'manufacturer' => ($consumable->manufacturer) ? ['id' => (int) $consumable->manufacturer->id, 'name' => e($consumable->manufacturer->name)] : null,
'supplier' => ($consumable->supplier) ? ['id' => $consumable->supplier->id, 'name'=> e($consumable->supplier->name)] : null,
'location' => ($consumable->location) ? [
'id' => (int) $consumable->location->id,
'name' => e($consumable->location->name),
'tag_color' => $consumable->location->tag_color ? e($consumable->location->tag_color) : null,
] : null,
'manufacturer' => ($consumable->manufacturer) ? [
'id' => (int) $consumable->manufacturer->id,
'name' => e($consumable->manufacturer->name),
'tag_color' => $consumable->manufacturer->tag_color ? e($consumable->manufacturer->tag_color) : null,
] : null,
'supplier' => ($consumable->supplier) ? [
'id' => $consumable->supplier->id,
'name'=> e($consumable->supplier->name),
'tag_color' => $consumable->supplier->tag_color ? e($consumable->supplier->tag_color) : null,
] : null,
'min_amt' => (int) $consumable->min_amt,
'model_number' => ($consumable->model_number != '') ? e($consumable->model_number) : null,
'remaining' => $consumable->numRemaining(),

View File

@@ -32,6 +32,7 @@ class DepartmentsTransformer
'company' => ($department->company) ? [
'id' => (int) $department->company->id,
'name'=> e($department->company->name),
'tag_color' => $department->company->tag_color ? e($department->company->tag_color) : null,
] : null,
'manager' => ($department->manager) ? [
'id' => (int) $department->manager->id,
@@ -42,8 +43,10 @@ class DepartmentsTransformer
'location' => ($department->location) ? [
'id' => (int) $department->location->id,
'name' => e($department->location->name),
'tag_color' => $department->location->tag_color ? e($department->location->tag_color) : null,
] : null,
'users_count' => (int) ($department->users_count),
'tag_color' => $department->tag_color ? e($department->tag_color) : null,
'notes' => Helper::parseEscapedMarkedownInline($department->notes),
'created_at' => Helper::getFormattedDateObject($department->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($department->updated_at, 'datetime'),

View File

@@ -34,12 +34,14 @@ class LicenseSeatsTransformer
[
'id' => (int) $seat->user->department->id,
'name' => e($seat->user->department->name),
'tag_color' => $seat->user->department->tag_color ? e($seat->user->department->tag_color) : null,
] : null,
'company'=> ($seat->user->company) ?
[
'id' => (int) $seat->user->company->id,
'name' => e($seat->user->company->name),
'tag_color' => $seat->user->company->tag_color ? e($seat->user->company->tag_color) : null,
] : null,
'created_at' => Helper::getFormattedDateObject($seat->created_at, 'datetime'),
@@ -52,6 +54,7 @@ class LicenseSeatsTransformer
'location' => ($seat->location()) ? [
'id' => (int) $seat->location()->id,
'name'=> e($seat->location()->name),
'tag_color' => $seat->location()->tag_color ? e($seat->location()->tag_color) : null,
'created_at' => Helper::getFormattedDateObject($seat->created_at, 'datetime'),
] : null,
'reassignable' => (bool) $seat->license->reassignable,

View File

@@ -25,7 +25,11 @@ class LicensesTransformer
'id' => (int) $license->id,
'name' => e($license->name),
'company' => ($license->company) ? ['id' => (int) $license->company->id, 'name'=> e($license->company->name)] : null,
'manufacturer' => ($license->manufacturer) ? ['id' => (int) $license->manufacturer->id, 'name'=> e($license->manufacturer->name)] : null,
'manufacturer' => ($license->manufacturer) ? [
'id' => (int) $license->manufacturer->id,
'name'=> e($license->manufacturer->name),
'tag_color'=> ($license->manufacturer->tag_color) ? e($license->manufacturer->tag_color) : null,
] : null,
'product_key' => (Gate::allows('viewKeys', License::class)) ? e($license->serial) : '------------',
'order_number' => ($license->order_number) ? e($license->order_number) : null,
'purchase_order' => ($license->purchase_order) ? e($license->purchase_order) : null,
@@ -44,8 +48,16 @@ class LicensesTransformer
'license_email' => ($license->license_email) ? e($license->license_email) : null,
'reassignable' => ($license->reassignable == 1) ? true : false,
'maintained' => ($license->maintained == 1) ? true : false,
'supplier' => ($license->supplier) ? ['id' => (int) $license->supplier->id, 'name'=> e($license->supplier->name)] : null,
'category' => ($license->category) ? ['id' => (int) $license->category->id, 'name'=> e($license->category->name)] : null,
'supplier' => ($license->supplier) ? [
'id' => (int) $license->supplier->id,
'name'=> e($license->supplier->name),
'tag_color'=> ($license->supplier->tag_color) ? e($license->supplier->tag_color) : null,
] : null,
'category' => ($license->category) ? [
'id' => (int) $license->category->id,
'name'=> e($license->category->name),
'tag_color'=> ($license->category->tag_color) ? e($license->category->tag_color) : null,
] : null,
'created_by' => ($license->adminuser) ? [
'id' => (int) $license->adminuser->id,
'name'=> e($license->adminuser->display_name),

View File

@@ -58,6 +58,7 @@ class LocationsTransformer
'children_count' => (int) $location->children_count,
'currency' => ($location->currency) ? e($location->currency) : null,
'ldap_ou' => ($location->ldap_ou) ? e($location->ldap_ou) : null,
'tag_color' => $location->tag_color ? e($location->tag_color) : null,
'notes' => Helper::parseEscapedMarkedownInline($location->notes),
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
'created_by' => $location->adminuser ? [
@@ -68,11 +69,13 @@ class LocationsTransformer
'parent' => ($location->parent) ? [
'id' => (int) $location->parent->id,
'name'=> e($location->parent->name),
'tag_color' => $location->parent->tag_color ? e($location->parent->tag_color) : null,
] : null,
'manager' => ($location->manager) ? (new UsersTransformer)->transformUser($location->manager) : null,
'company' => ($location->company) ? [
'id' => (int) $location->company->id,
'name'=> e($location->company->name)
'name'=> e($location->company->name),
'tag_color' => $location->company->tag_color ? e($location->company->tag_color) : null,
] : null,
'children' => $children_arr,

View File

@@ -37,6 +37,7 @@ class ManufacturersTransformer
'consumables_count' => (int) $manufacturer->consumables_count,
'accessories_count' => (int) $manufacturer->accessories_count,
'components_count' => (int) $manufacturer->components_count,
'tag_color' => $manufacturer->tag_color ? e($manufacturer->tag_color) : null,
'notes' => Helper::parseEscapedMarkedownInline($manufacturer->notes),
'created_by' => ($manufacturer->adminuser) ? [
'id' => (int) $manufacturer->adminuser->id,

View File

@@ -26,6 +26,7 @@ class SelectlistTransformer
'id' => (int) $select_item->id,
'text' => ($select_item->use_text) ? $select_item->use_text : $select_item->name,
'image' => ($select_item->use_image) ? $select_item->use_image : null,
'tag_color' => ($select_item->tag_color) ? $select_item->tag_color : null,
];
}

View File

@@ -43,6 +43,7 @@ class SuppliersTransformer
'licenses_count' => (int) $supplier->licenses_count,
'consumables_count' => (int) $supplier->consumables_count,
'components_count' => (int) $supplier->components_count,
'tag_color' => $supplier->tag_color ? e($supplier->tag_color) : null,
'notes' => ($supplier->notes) ? Helper::parseEscapedMarkedownInline($supplier->notes) : null,
'created_at' => Helper::getFormattedDateObject($supplier->created_at, 'datetime'),
'created_by' => $supplier->adminuser ? [

View File

@@ -57,6 +57,7 @@ class UsersTransformer
'department' => ($user->department) ? [
'id' => (int) $user->department->id,
'name'=> e($user->department->name),
'tag_color' => ($user->department->tag_color) ? e($user->department->tag_color) : null,
] : null,
'department_manager' => ($user->department?->manager) ? [
'id' => (int) $user->department->manager->id,
@@ -65,6 +66,7 @@ class UsersTransformer
'location' => ($user->userloc) ? [
'id' => (int) $user->userloc->id,
'name'=> e($user->userloc->name),
'tag_color'=> ($user->userloc->tag_color) ? e($user->userloc->tag_color) : null,
] : null,
'notes'=> Helper::parseEscapedMarkedownInline($user->notes),
'role' => $role,
@@ -80,7 +82,11 @@ class UsersTransformer
'consumables_count' => (int) $user->consumables_count,
'manages_users_count' => (int) $user->manages_users_count,
'manages_locations_count' => (int) $user->manages_locations_count,
'company' => ($user->company) ? ['id' => (int) $user->company->id, 'name'=> e($user->company->name)] : null,
'company' => ($user->company) ? [
'id' => (int) $user->company->id,
'name'=> e($user->company->name),
'tag_color'=> ($user->company->tag_color) ? e($user->company->tag_color) : null,
] : null,
'created_by' => ($user->createdBy) ? [
'id' => (int) $user->createdBy->id,
'name'=> e($user->createdBy->display_name),

View File

@@ -73,6 +73,7 @@ class Category extends SnipeModel
'alert_on_response',
'use_default_eula',
'created_by',
'tag_color',
'notes',
];

View File

@@ -72,6 +72,7 @@ final class Company extends SnipeModel
'fax',
'email',
'created_by',
'tag_color',
'notes',
];

View File

@@ -5,6 +5,7 @@ namespace App\Models;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\Traits\CompanyableTrait;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Watson\Validating\ValidatingTrait;
@@ -22,7 +23,10 @@ class Department extends SnipeModel
*/
protected $injectUniqueIdentifier = true;
use ValidatingTrait, UniqueUndeletedTrait;
protected $presenter = \App\Presenters\DepartmentPresenter::class;
use ValidatingTrait, UniqueUndeletedTrait, Presentable;
protected $casts = [
'manager_id' => 'integer',
@@ -53,6 +57,7 @@ class Department extends SnipeModel
'location_id',
'company_id',
'manager_id',
'tag_color',
'notes',
];

View File

@@ -77,6 +77,7 @@ class Location extends SnipeModel
'manager_id',
'image',
'company_id',
'tag_color',
'notes',
];
protected $hidden = ['user_id'];

View File

@@ -53,6 +53,7 @@ class Manufacturer extends SnipeModel
'support_url',
'url',
'warranty_lookup_url',
'tag_color',
'notes',
];

View File

@@ -4,17 +4,21 @@ namespace App\Models;
use App\Http\Traits\UniqueUndeletedTrait;
use App\Models\Traits\HasUploads;
use App\Models\Traits\Loggable;
use App\Models\Traits\Searchable;
use App\Presenters\Presentable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
use \Illuminate\Database\Eloquent\Relations\Relation;
use App\Models\Traits\Loggable;
class Supplier extends SnipeModel
{
use HasFactory;
use SoftDeletes;
use HasUploads;
use Presentable;
protected $presenter = \App\Presenters\SupplierPresenter::class;
protected $table = 'suppliers';
@@ -66,7 +70,7 @@ class Supplier extends SnipeModel
*
* @var array
*/
protected $fillable = ['name', 'address', 'address2', 'city', 'state', 'country', 'zip', 'phone', 'fax', 'email', 'contact', 'url', 'notes'];
protected $fillable = ['name', 'address', 'address2', 'city', 'state', 'country', 'zip', 'phone', 'fax', 'email', 'contact', 'url', 'tag_color', 'notes'];
/**
* Eager load counts

View File

@@ -49,7 +49,7 @@ class AccessoryPresenter extends Presenter
'field' => 'category',
'searchable' => true,
'sortable' => true,
'title' => trans('admin/accessories/general.accessory_category'),
'title' => trans('general.category'),
'formatter' => 'categoriesLinkObjFormatter',
], [
'field' => 'model_number',

View File

@@ -301,4 +301,13 @@ class AssetModelPresenter extends Presenter
{
return route('models.show', $this->id);
}
public function formattedNameLink() {
if (auth()->user()->can('models.view', $this)) {
return '<a href="'.route('models.show', e($this->id)).'">'.e($this->name).'</a>';
}
return $this->name;
}
}

View File

@@ -82,6 +82,14 @@ class CategoryPresenter extends Presenter
"title" => trans('admin/categories/general.use_default_eula_column'),
'visible' => true,
"formatter" => 'trueFalseFormatter',
], [
'field' => 'tag_color',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.tag_color'),
'visible' => false,
'formatter' => 'colorTagFormatter',
], [
'field' => 'notes',
'searchable' => true,
@@ -142,4 +150,13 @@ class CategoryPresenter extends Presenter
{
return route('categories.show', $this->id);
}
public function formattedNameLink() {
if (auth()->user()->can('view', ['\App\Models\Category', $this])) {
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').'<a href="'.route('categories.show', e($this->id)).'">'.e($this->name).'</a>';
}
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i> " : '').$this->name;
}
}

View File

@@ -106,6 +106,15 @@ class CompanyPresenter extends Presenter
'visible' => true,
'class' => 'css-component',
], [
'field' => 'tag_color',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.tag_color'),
'visible' => false,
'formatter' => 'colorTagFormatter',
],
[
'field' => 'notes',
'searchable' => true,
'sortable' => true,
@@ -166,4 +175,13 @@ class CompanyPresenter extends Presenter
{
return route('companies.show', $this->id);
}
public function formattedNameLink() {
if (auth()->user()->can('view', ['\App\Models\Company', $this])) {
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').'<a href="'.route('companies.show', e($this->id)).'">'.e($this->name).'</a>';
}
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').$this->name;
}
}

View File

@@ -0,0 +1,130 @@
<?php
namespace App\Presenters;
/**
* Class DepartmentPresenter
*/
class DepartmentPresenter extends Presenter
{
/**
* Json Column Layout for bootstrap table
* @return string
*/
public static function dataTableLayout()
{
$layout = [
[
'field' => 'id',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('general.id'),
'visible' => false,
],
[
'field' => 'company',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.company'),
'visible' => false,
'formatter' => 'companiesLinkObjFormatter'
],
[
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'departmentsLinkFormatter',
], [
'field' => 'image',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('general.image'),
'visible' => true,
'formatter' => 'imageFormatter',
], [
'field' => 'manager',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/departments/table.manager'),
'visible' => true,
'formatter' => 'usersLinkObjFormatter',
],[
'field' => 'location',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('general.location'),
'visible' => true,
'formatter' => 'locationsLinkObjFormatter',
], [
'field' => 'users_count',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('general.people'),
'titleTooltip' => trans('general.people'),
'visible' => true,
'class' => 'css-house-user',
], [
'field' => 'tag_color',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.tag_color'),
'visible' => false,
'formatter' => 'colorTagFormatter',
], [
'field' => 'notes',
'searchable' => true,
'sortable' => true,
'visible' => false,
'title' => trans('general.notes'),
], [
'field' => 'created_at',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.created_at'),
'visible' => false,
'formatter' => 'dateDisplayFormatter',
],
[
'field' => 'created_by',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.created_by'),
'visible' => false,
'formatter' => 'usersLinkObjFormatter',
],[
'field' => 'actions',
'searchable' => false,
'sortable' => false,
'switchable' => false,
'title' => trans('table.actions'),
'visible' => true,
'formatter' => 'departmentsActionsFormatter',
],
];
return json_encode($layout);
}
public function formattedNameLink() {
if (auth()->user()->can('view', ['\App\Models\Department', $this])) {
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').'<a href="'.route('departments.show', e($this->id)).'">'.e($this->name).'</a>';
}
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').$this->name;
}
}

View File

@@ -227,7 +227,15 @@ class LocationPresenter extends Presenter
'title' => trans('admin/users/table.manager'),
'visible' => false,
'formatter' => 'usersLinkObjFormatter',
], [
], [
'field' => 'tag_color',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.tag_color'),
'visible' => false,
'formatter' => 'colorTagFormatter',
], [
'field' => 'notes',
'searchable' => true,
'sortable' => true,
@@ -367,4 +375,13 @@ class LocationPresenter extends Presenter
{
return $this->name;
}
public function formattedNameLink() {
if (auth()->user()->can('view', ['\App\Models\Location', $this])) {
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').'<a href="'.route('locations.show', e($this->id)).'">'.e($this->name).'</a>';
}
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i> " : '').$this->name;
}
}

View File

@@ -191,4 +191,14 @@ class ManufacturerPresenter extends Presenter
{
return route('manufacturers.show', $this->id);
}
public function formattedNameLink() {
if (auth()->user()->can('view', ['\App\Models\Manufacturer', $this])) {
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').'<a href="'.route('manufacturers.show', e($this->id)).'">'.e($this->name).'</a>';
}
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i> " : '').$this->name;
}
}

View File

@@ -156,6 +156,14 @@ class SupplierPresenter extends Presenter
'visible' => false,
'formatter' => 'phoneFormatter',
], [
'field' => 'tag_color',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.tag_color'),
'visible' => false,
'formatter' => 'colorTagFormatter',
],[
'field' => 'notes',
'searchable' => true,
'sortable' => true,
@@ -229,4 +237,13 @@ class SupplierPresenter extends Presenter
{
return $this->name;
}
public function formattedNameLink() {
if (auth()->user()->can('view', ['\App\Models\Supplier', $this])) {
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').'<a href="'.route('suppliers.show', e($this->id)).'">'.e($this->name).'</a>';
}
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i> " : '').$this->name;
}
}

View File

@@ -31,6 +31,7 @@ class CategoryFactory extends Factory
'use_default_eula' => false,
'created_by' => User::factory()->superuser(),
'notes' => 'Created by DB seeder',
'tag_color' => $this->faker->hexColor(),
];
}

View File

@@ -25,6 +25,7 @@ class CompanyFactory extends Factory
'name' => $this->faker->unique()->company(),
'created_by' => 1,
'notes' => 'Created by DB seeder',
'tag_color' => $this->faker->hexColor(),
];
}
}

View File

@@ -28,6 +28,7 @@ class DepartmentFactory extends Factory
'created_by' => User::factory()->superuser(),
'location_id' => Location::factory(),
'notes' => 'Created by DB seeder',
'tag_color' => $this->faker->hexColor(),
];
}

View File

@@ -24,6 +24,7 @@ class LocationFactory extends Factory
'zip' => $this->faker->postcode(),
'image' => rand(1, 9).'.jpg',
'notes' => 'Created by DB seeder',
'tag_color' => $this->faker->hexColor(),
];
}

View File

@@ -29,6 +29,7 @@ class ManufacturerFactory extends Factory
'url' => $this->faker->url(),
'support_email' => $this->faker->safeEmail(),
'notes' => 'Created by DB seeder',
'tag_color' => $this->faker->hexColor(),
];
}

View File

@@ -35,6 +35,7 @@ class SupplierFactory extends Factory
'email' => $this->faker->safeEmail(),
'url' => $this->faker->url(),
'notes' => $this->faker->text(191), // Supplier notes can be a max of 255 characters.
'tag_color' => $this->faker->hexColor(),
];
}
}

View File

@@ -0,0 +1,68 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('companies', function (Blueprint $table) {
$table->string('tag_color', )->after('name')->nullable()->default(null);
});
Schema::table('categories', function (Blueprint $table) {
$table->string('tag_color', )->after('name')->nullable()->default(null);
});
Schema::table('manufacturers', function (Blueprint $table) {
$table->string('tag_color', )->after('name')->nullable()->default(null);
});
Schema::table('suppliers', function (Blueprint $table) {
$table->string('tag_color', )->after('name')->nullable()->default(null);
});
Schema::table('locations', function (Blueprint $table) {
$table->string('tag_color', )->after('name')->nullable()->default(null);
});
Schema::table('departments', function (Blueprint $table) {
$table->string('tag_color', )->after('name')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('companies', function ($table) {
$table->dropColumn('tag_color');
});
Schema::table('categories', function ($table) {
$table->dropColumn('tag_color');
});
Schema::table('manufacturers', function ($table) {
$table->dropColumn('tag_color');
});
Schema::table('suppliers', function ($table) {
$table->dropColumn('tag_color');
});
Schema::table('locations', function ($table) {
$table->dropColumn('tag_color');
});
Schema::table('departments', function ($table) {
$table->dropColumn('tag_color');
});
}
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,9 @@
{
"/js/dist/all.js": "/js/dist/all.js?id=a84550e1cfe57870332e6a2e1b605707",
"/js/dist/all.js": "/js/dist/all.js?id=e7498a0c6acede90c6e2c770e397c3a0",
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=8d861085664e18a1407cce2d29762fa4",
"/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=2fea629e70002a51fb241703dd09371c",
"/css/build/overrides.css": "/css/build/overrides.css?id=dee88c73824aa75c0a01ecdc744b3095",
"/css/build/app.css": "/css/build/app.css?id=de48355100918a6ea593b6152964f15e",
"/css/build/overrides.css": "/css/build/overrides.css?id=c2679c0551574d049e93c6ff33e2b79d",
"/css/build/app.css": "/css/build/app.css?id=0130fb82be0348b461c42bedebaab50e",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=bdf169bc2141f453390614c138cdce95",
"/css/dist/skins/skin-yellow.css": "/css/dist/skins/skin-yellow.css?id=e1e6e1c64cf14fc350585aaeb0e42f6b",
"/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=69b5b9e2ae359f2871b8d6676d0a63f1",
@@ -19,7 +19,7 @@
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=68a92d85c8e351dfb38a835307f126ec",
"/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=ed9df5188fc923bf67fa194b5dcf5c0c",
"/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=84e2ee950ae04444988b37038e5a3951",
"/css/dist/all.css": "/css/dist/all.css?id=09fd1dac7d534c75004d7cd15382f756",
"/css/dist/all.css": "/css/dist/all.css?id=0c01aa4f9ef664b9b54ebefdd6a28adf",
"/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/js/select2/i18n/af.js": "/js/select2/i18n/af.js?id=4f6fcd73488ce79fae1b7a90aceaecde",

View File

@@ -347,8 +347,7 @@ $(function () {
}
function formatDatalistSafe(datalist) {
// console.warn("What in the hell is going on with Select2?!?!!?!?");
// console.warn($.select2);
if (datalist.loading) {
return $('<i class="fas fa-spinner fa-spin" aria-hidden="true"></i> Loading...');
}
@@ -356,28 +355,29 @@ $(function () {
var root_div = $("<div class='clearfix'>") ;
var left_pull = $("<div class='pull-left' style='padding-right: 10px;'>");
if (datalist.image) {
var inner_div = $("<div style='width: 30px;'>");
var inner_div = $("<div style='width: 20px;'>");
/******************************************************************
*
* We are specifically chosing empty alt-text below, because this
*
* We are specifically chosing empty alt-text below, because this
* image conveys no additional information, relative to the text
* that will *always* be there in any select2 list that is in use
* in Snipe-IT. If that changes, we would probably want to change
* some signatures of some functions, but right now, we don't want
* screen readers to say "HP SuperJet 5000, .... picture of HP
* screen readers to say "HP SuperJet 5000, .... picture of HP
* SuperJet 5000..." and so on, for every single row in a list of
* assets or models or whatever.
*
*
*******************************************************************/
var img = $("<img src='' style='max-height: 20px; max-width: 30px;' alt=''>");
// console.warn("Img is: ");
// console.dir(img);
// console.warn("Strigularly, that's: ");
// console.log(img);
img.attr("src", datalist.image );
var img = $("<img src='' style='max-height: 20px; max-width: 20px;' alt=''>");
img.attr("src", datalist.image);
inner_div.append(img)
} else if (datalist.tag_color) {
var inner_div = $("<div style='width: 20px;'>");
var icon = $('<i class="fa-solid fa-square" style="font-size: 20px;" aria-hidden="true"></i>');
icon.css("color", datalist.tag_color );
inner_div.append(icon)
} else {
var inner_div=$("<div style='height: 20px; width: 30px;'></div>");
var inner_div=$("<div style='height: 20px; width: 20px;'></div>");
}
left_pull.append(inner_div);
root_div.append(left_pull);

View File

@@ -1364,4 +1364,8 @@ Radio toggle styles for permission settings and check/uncheck all
.js-copy-link {
color: grey;
}
.deleted {
text-decoration: line-through;
}

View File

@@ -79,6 +79,7 @@ return [
'generate_backup' => 'Generate Backup',
'google_workspaces' => 'Google Workspaces',
'header_color' => 'Header Color',
'header_color_help' => 'Scroll up to the top of the screen to preview the header color.',
'info' => 'These settings let you customize certain aspects of your installation.',
'label_logo_size' => 'Square logos look best - will be displayed in the top right of each asset label. ',
'laravel' => 'Laravel Version',

View File

@@ -68,6 +68,8 @@ return [
'change' => 'In/Out',
'changeemail' => 'Change Email Address',
'changepassword' => 'Change Password',
'tag_color' => 'Tag Color',
'tag_color_help' => 'If you wish to use a custom color indicator for this entry, enter a hex color code (e.g., #ffffff for white). Make sure the text color you select is readable against the background color. Otherwise, you can leave these blank for the default appearance.',
'checkin' => 'Checkin',
'checkin_from' => 'Checkin from',
'checkin_note' => 'Checkin Note',

View File

@@ -44,7 +44,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.company') }}</label>
<div class="col-md-6">
<p class="form-control-static">{{ $accessory->company->name }}</p>
<p class="form-control-static">{!! $accessory->company->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
@@ -53,9 +53,9 @@
@if ($accessory->category)
<!-- accessory name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('admin/accessories/general.accessory_category') }}</label>
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-6">
<p class="form-control-static">{{ $accessory->category->name }}</p>
<p class="form-control-static">{!! $accessory->category->present()->formattedNameLink !!}</p>
</div>
</div>
@endif

View File

@@ -166,7 +166,7 @@
<strong> {{ trans('general.company')}}</strong>
</div>
<div class="col-md-9">
<a href="{{ route('companies.show', $accessory->company->id) }}">{{ $accessory->company->name }} </a>
{!! $accessory->company->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -177,7 +177,7 @@
<strong>{{ trans('general.location')}}</strong>
</div>
<div class="col-md-9">
<a href="{{ route('locations.show', $accessory->location->id) }}">{{ $accessory->location->name }} </a>
{!! $accessory->location->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -188,7 +188,7 @@
<strong>{{ trans('general.category')}}</strong>
</div>
<div class="col-md-9">
<a href="{{ route('categories.show', $accessory->category->id) }}">{{ $accessory->category->name }} </a>
{!! $accessory->category->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -199,7 +199,7 @@
<strong>{{ trans('general.manufacturer')}}</strong>
</div>
<div class="col-md-9">
<a href="{{ route('manufacturers.show', $accessory->manufacturer->id) }}">{{ $accessory->manufacturer->name }} </a>
{!! $accessory->manufacturer->present()->formattedNameLink !!}
</div>
</div>
@endif

View File

@@ -219,7 +219,7 @@
{{ trans('general.company') }}
</div>
<div class="col-md-9">
{{ $user->company->name }}
{!! $user->company->present()->formattedNameLink !!}
</div>
</div>
@@ -324,7 +324,7 @@
{{ trans('admin/users/table.email') }}
</div>
<div class="col-md-9">
<a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
<a href="mailto:{{ $user->email }}"><x-icon type="email" /> {{ $user->email }}</a>
</div>
</div>
@endif
@@ -336,7 +336,7 @@
{{ trans('general.website') }}
</div>
<div class="col-md-9">
<a href="{{ $user->website }}" target="_blank">{{ $user->website }}</a>
<a href="{{ $user->website }}" target="_blank"><x-icon type="external-link" /> {{ $user->website }}</a>
</div>
</div>
@endif
@@ -348,11 +348,25 @@
{{ trans('admin/users/table.phone') }}
</div>
<div class="col-md-9">
<a href="tel:{{ $user->phone }}">{{ $user->phone }}</a>
<a href="tel:{{ $user->phone }}"><x-icon type="phone" /> {{ $user->phone }}</a>
</div>
</div>
@endif
@if ($user->mobile)
<!-- phone -->
<div class="row">
<div class="col-md-3">
{{ trans('admin/users/table.mobile') }}
</div>
<div class="col-md-9">
<a href="tel:{{ $user->mobile }}" data-tooltip="true" title="{{ trans('general.call') }}">
<x-icon type="mobile" />
{{ $user->mobile }}</a>
</div>
</div>
@endif
@if ($user->userloc)
<!-- location -->
<div class="row">
@@ -360,7 +374,7 @@
{{ trans('admin/users/table.location') }}
</div>
<div class="col-md-9">
{{ link_to_route('locations.show', $user->userloc->name, [$user->userloc->id]) }}
{!! $user->userloc->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -383,7 +397,7 @@
{{ trans('general.department') }}
</div>
<div class="col-md-9">
{{ $user->department->name }}
{!! $user->department->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -504,7 +518,7 @@
</td>
<td>
@if (($asset->model) && ($asset->model->category))
{{ $asset->model->category->name }}
{!! $asset->model->category->present()->formattedNameLink !!}
@endif
</td>
<td>
@@ -519,7 +533,7 @@
<label class="label label-default">{{ trans('general.deployed') }}</label>
</td>
<td>
{{ $asset->model->name }}
{!! ($asset->model) ? $asset->model->present()->formattedNameLink : trans('general.deleted') !!}
</td>
<td>
{{ $asset->model->model_number }}
@@ -528,10 +542,11 @@
{{ $asset->serial }}
</td>
<td>
{{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }}
{!! ($asset->defaultLoc) ? $asset->defaultLoc->present()->formattedNameLink : '' !!}
</td>
<td>
{{ ($asset->location) ? $asset->location->name : '' }}
{!! ($asset->location) ? $asset->location->present()->formattedNameLink : '' !!}
</td>
<td>
{{ ($asset->expected_checkin) ? $asset->expected_checkin_formatted_date : '' }}
@@ -568,6 +583,8 @@
</tbody>
</table>
</div><!-- /asset -->
<div class="tab-pane" id="licenses">
<table
@@ -595,7 +612,6 @@
<th class="col-md-2">{{ trans('admin/licenses/form.to_name') }}</th>
<th class="col-md-2">{{ trans('admin/licenses/form.to_email') }}</th>
<th class="col-md-2">{{ trans('general.category') }}</th>
</tr>
</thead>
<tbody>
@@ -607,7 +623,6 @@
<td>
@can('viewKeys', $license)
<code class="single-line"><span class="js-copy-link" data-clipboard-target=".js-copy-key-{{ $license->id }}" aria-hidden="true" data-tooltip="true" data-placement="top" title="{{ trans('general.copy_to_clipboard') }}"><span class="js-copy-key-{{ $license->id }}">{{ $license->serial }}</span></span></code>
@else
------------
@endcan
@@ -619,12 +634,15 @@
------------
@endcan
</td>
@can('viewKeys', $license)
<td>{{$license->license_email}}</td>
@else
------------
@endcan
<td>{{ ($license->category) ? $license->category->name : trans('general.deleted') }}</td>
<td>
@can('viewKeys', $license)
{{$license->license_email}}
@else
------------
@endcan
</td>
<td>{!! ($license->category) ? $license->category->present()->formattedNameLink : trans('general.deleted') !!}</td>
</tr>
@endforeach
</tbody>

View File

@@ -0,0 +1,13 @@
@props([
'item' => null,
'name' => 'color',
'id' => 'color',
])
<!-- Colorpicker -->
<div id="color" class="input-group colorpicker-component row col-md-5">
<input class="form-control" placeholder="#FF0000" aria-label="{{ $name }}" name="{{ $name }}" type="text" id="{{ $id }}" value="{{ old($name, ($item->{$name} ?? '')) }}">
<span class="input-group-addon"><i></i></span>
</div>
<!-- /.input group -->

View File

@@ -63,11 +63,6 @@
</div>
@stop
@section('content')
@parent
@if ($snipeSettings->default_eula_text!='')
<!-- Modal -->
@@ -89,6 +84,21 @@
</div>
@endif
<fieldset name="color-preferences">
<x-form-legend help_text="{{ trans('general.tag_color_help') }}">
{{ trans('general.tag_color') }}
</x-form-legend>
<!-- color -->
<div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">
<label for="tag_color" class="col-md-3 control-label">
{{ trans('general.tag_color') }}
</label>
<div class="col-md-9">
<x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />
{!! $errors->first('tag_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
</fieldset>
@stop

View File

@@ -30,4 +30,21 @@
</div>
</div>
<fieldset name="color-preferences">
<x-form-legend help_text="{{ trans('general.tag_color_help') }}">
{{ trans('general.tag_color') }}
</x-form-legend>
<!-- color -->
<div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">
<label for="tag_color" class="col-md-3 control-label">
{{ trans('general.tag_color') }}
</label>
<div class="col-md-9">
<x-input.colorpicker :item="$item" id="tag_color" :value="old('tag_color', ($item->tag_color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />
{!! $errors->first('tag_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
</fieldset>
@stop

View File

@@ -25,6 +25,28 @@
@endif
<div class="box-body">
@if ($component->company)
<!-- accessory name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.company') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $component->company->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
@if ($component->category)
<!-- accessory name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $component->category->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
<!-- Asset -->
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.select_asset'), 'fieldname' => 'asset_id', 'company_id' => $component->company_id, 'required' => 'true', 'value' => old('asset_id')])

View File

@@ -190,6 +190,28 @@
@endif
@if ($component->company)
<div class="col-md-12" style="padding-bottom: 5px;">
<strong>{{ trans('general.company') }}: </strong>
{!! $component->company->present()->formattedNameLink !!}
</div>
@endif
@if ($component->category)
<div class="col-md-12" style="padding-bottom: 5px;">
<strong>{{ trans('general.category') }}: </strong>
{!! $component->category->present()->formattedNameLink !!}
</div>
@endif
@if ($component->location)
<div class="col-md-12" style="padding-bottom: 5px;">
<strong>{{ trans('general.location') }}: </strong>
{!! $component->location->present()->formattedNameLink !!}
</div>
@endif
@if ($component->serial!='')
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('admin/hardware/form.serial') }}: </strong>
{{ $component->serial }} </div>

View File

@@ -36,16 +36,29 @@
</div>
</div>
@endif
@if ($consumable->category)
<!-- consumable name -->
@if ($consumable->company)
<!-- accessory name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<label class="col-sm-3 control-label">{{ trans('general.company') }}</label>
<div class="col-md-6">
<p class="form-control-static">{{ $consumable->category->name }}</p>
<p class="form-control-static">{!! $consumable->company->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
@if ($consumable->category)
<!-- category name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $consumable->category->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
<!-- total -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('admin/components/general.total') }}</label>

View File

@@ -172,7 +172,7 @@
{{ trans('general.company') }}
</div>
<div class="col-md-9">
{{ $consumable->company->name }}
{!! $consumable->company->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -184,7 +184,7 @@
{{ trans('general.category') }}
</div>
<div class="col-md-9">
{{ $consumable->category->name }}
{!! $consumable->category->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -240,7 +240,7 @@
{{ trans('general.location') }}
</div>
<div class="col-md-9">
{{ $consumable->location->name }}
{!! $consumable->location->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -252,7 +252,7 @@
{{ trans('general.supplier') }}
</div>
<div class="col-md-9">
{{ $consumable->supplier->name }}
{!! $consumable->supplier->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -264,7 +264,7 @@
{{ trans('general.manufacturer') }}
</div>
<div class="col-md-9">
{{ $consumable->manufacturer->name }}
{!! $consumable->manufacturer->present()->formattedNameLink !!}
</div>
</div>
@endif

View File

@@ -26,6 +26,7 @@
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
@include ('partials.forms.edit.image-upload', ['image_path' => app('departments_upload_path')])
<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
<div class="col-md-8">
@@ -41,5 +42,22 @@
</div>
</div>
<fieldset name="color-preferences">
<x-form-legend help_text="{{ trans('general.tag_color_help') }}">
{{ trans('general.tag_color') }}
</x-form-legend>
<!-- color -->
<div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">
<label for="tag_color" class="col-md-3 control-label">
{{ trans('general.tag_color') }}
</label>
<div class="col-md-9">
<x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />
{!! $errors->first('tag_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
</fieldset>
@stop

View File

@@ -13,6 +13,7 @@
<div class="box box-default">
<div class="box-body">
<table
data-columns="{{ \App\Presenters\DepartmentPresenter::dataTableLayout() }}"
data-cookie-id-table="departmentsTable"
data-id-table="departmentsTable"
data-side-pagination="server"
@@ -26,20 +27,7 @@
"fileName": "export-departments-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-sortable="true" data-field="company" data-visible="false" data-formatter="companiesLinkObjFormatter">{{ trans('general.company') }}</th>
<th data-sortable="true" data-formatter="departmentsLinkFormatter" data-field="name" data-searchable="false">{{ trans('admin/departments/table.name') }}</th>
<th data-sortable="true" data-field="image" data-visible="false" data-formatter="imageFormatter">{{ trans('general.image') }}</th>
<th data-sortable="true" data-formatter="usersLinkObjFormatter" data-field="manager" data-searchable="false">{{ trans('admin/departments/table.manager') }}</th>
<th data-sortable="true" data-field="users_count" data-searchable="false">{{ trans('general.users') }}</th>
<th data-sortable="true" data-formatter="locationsLinkObjFormatter" data-field="location" data-searchable="false">{{ trans('admin/departments/table.location') }}</th>
<th data-sortable="true" data-field="notes" data-searchable="true">{{ trans('general.notes') }}</th>
<th data-sortable="false" data-formatter="departmentsActionsFormatter" data-field="actions" data-searchable="false">{{ trans('table.actions') }}</th>
</tr>
</thead>
</table>
</div>
</div>

View File

@@ -41,6 +41,27 @@
@endif
{{csrf_field()}}
@if ($asset->company)
<!-- accessory name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.company') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $asset->company->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
@if ($asset->model->category)
<!-- category name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $asset->model->category->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
<!-- AssetModel name -->
<div class="form-group">
<label for="model" class="col-sm-3 control-label">

View File

@@ -26,15 +26,23 @@
</div>
<div class="box-body">
{{csrf_field()}}
@if ($asset->company && $asset->company->name)
@if ($asset->company)
<!-- accessory name -->
<div class="form-group">
<label for="company" class="col-md-3 control-label">
{{ trans('general.company') }}
</label>
<div class="col-md-8">
<p class="form-control-static" style="padding-top: 7px;">
{{ $asset->company->name }}
</p>
<label class="col-sm-3 control-label">{{ trans('general.company') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $asset->company->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
@if ($asset->model->category)
<!-- category name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $asset->model->category->present()->formattedNameLink !!}</p>
</div>
</div>
@endif

View File

@@ -386,7 +386,8 @@
@if ($asset->location->parent)
<i class="fas fa-long-arrow-alt-right" aria-hidden="true"></i>
@endif
{{ $asset->location->name }}</li>
{!! $asset->location->present()->formattedNameLink !!}
</li>
<li>{{ $asset->location->address }}
@if ($asset->location->address2!='')
{{ $asset->location->address2 }}
@@ -498,7 +499,7 @@
<strong>{{ trans('general.company') }}</strong>
</div>
<div class="col-md-9">
<a href="{{ url('/companies/' . $asset->company->id) }}">{{ $asset->company->name }}</a>
{!! $asset->company->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -554,7 +555,7 @@
{!! $asset->checkInvalidNextAuditDate() ? '<i class="fas fa-exclamation-triangle text-orange" aria-hidden="true"></i>' : '' !!}
{{ Helper::getFormattedDateObject($audit_log->created_at, 'datetime', false) }}
@if ($audit_log->user)
(by {{ link_to_route('users.show', $audit_log->user->display_name, [$audit_log->user->id]) }})
({{ link_to_route('users.show', $audit_log->user->display_name, [$audit_log->user->id]) }})
@endif
</div>
@@ -584,17 +585,10 @@
</div>
<div class="col-md-9">
<ul class="list-unstyled">
@can('view', \App\Models\Manufacturer::class)
<li>
<a href="{{ route('manufacturers.show', $asset->model->manufacturer->id) }}">
{{ $asset->model->manufacturer->name }}
</a>
</li>
@else
<li> {{ $asset->model->manufacturer->name }}</li>
@endcan
<li>
<x-copy-to-clipboard copy_what="manufacturer">{!! $asset->model->manufacturer->present()->formattedNameLink !!}</x-copy-to-clipboard>
</li>
@if (($asset->model) && ($asset->model->manufacturer) && ($asset->model->manufacturer->url!=''))
<li>
@@ -658,17 +652,7 @@
</div>
<div class="col-md-9">
@if (($asset->model) && ($asset->model->category))
<x-copy-to-clipboard copy_what="category">
@can('view', \App\Models\Category::class)
<a href="{{ route('categories.show', $asset->model->category->id) }}">
{{ $asset->model->category->name }}
</a>
@else
{{ $asset->model->category->name }}
@endcan
</x-copy-to-clipboard>
<x-copy-to-clipboard copy_what="category">{!! $asset->model->category->present()->formattedNameLink !!}</x-copy-to-clipboard>
@else
Invalid category
@endif
@@ -684,15 +668,7 @@
</div>
<div class="col-md-9">
@if ($asset->model)
<x-copy-to-clipboard copy_what="model">
@can('view', \App\Models\AssetModel::class)
<a href="{{ route('models.show', $asset->model->id) }}">
{{ $asset->model->name }}
</a>
@else
{{ $asset->model->name }}
@endcan
</x-copy-to-clipboard>
<x-copy-to-clipboard copy_what="model">{!! $asset->model->present()->formattedNameLink !!}</x-copy-to-clipboard>
@endif
</div>
@@ -707,9 +683,7 @@
</div>
<div class="col-md-9">
@if (($asset->model) && ($asset->model->model_number!=''))
<x-copy-to-clipboard copy_what="model_number">
{{ ($asset->model) ? $asset->model->model_number : ''}}
</x-copy-to-clipboard>
<x-copy-to-clipboard copy_what="model_number">{{ ($asset->model) ? $asset->model->model_number : ''}}</x-copy-to-clipboard>
@endif
</div>
</div>
@@ -904,9 +878,7 @@
</strong>
</div>
<div class="col-md-9">
<x-copy-to-clipboard copy_what="order_number">
<a href="{{ route('hardware.index', ['order_number' => $asset->order_number]) }}">{{ $asset->order_number }}</a>
</x-copy-to-clipboard>
<x-copy-to-clipboard copy_what="order_number"><a href="{{ route('hardware.index', ['order_number' => $asset->order_number]) }}">{{ $asset->order_number }}</a></x-copy-to-clipboard>
</div>
</div>
@endif
@@ -919,15 +891,7 @@
</strong>
</div>
<div class="col-md-9">
<x-copy-to-clipboard copy_what="supplier">
@can ('superuser')
<a href="{{ route('suppliers.show', $asset->supplier_id) }}">
{{ $asset->supplier->name }}
</a>
@else
{{ $asset->supplier->name }}
@endcan
</x-copy-to-clipboard>
<x-copy-to-clipboard copy_what="supplier">{!! $asset->supplier->present()->formattedNameLink !!}</x-copy-to-clipboard>
</div>
</div>
@endif

View File

@@ -1086,6 +1086,10 @@ dir="{{ Helper::determineLanguageDirection() }}">
<script nonce="{{ csrf_token() }}">
//color picker with addon
$("#color").colorpicker();
$.fn.datepicker.dates['{{ app()->getLocale() }}'] = {
days: [
"{{ trans('datepicker.days.sunday') }}",
@@ -1151,14 +1155,12 @@ dir="{{ Helper::determineLanguageDirection() }}">
var clipboard = new ClipboardJS('.js-copy-link');
clipboard.on('success', function(e) {
// Get the clicked element
e.text = e.text.replace(/^\s/, '').trim();
var clickedElement = $(e.trigger);
// Get the target element selector from data attribute
var targetSelector = clickedElement.data('data-clipboard-target');
// Show the alert that the content was copied
clickedElement.tooltip('hide').attr('data-original-title', '{{ trans('general.copied') }}').tooltip('show');
});
// Reference: https://jqueryvalidation.org/validate/
var validator = $('#create-form').validate({
ignore: 'input[type=hidden]',

View File

@@ -28,19 +28,32 @@
<!-- license name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('admin/hardware/form.name') }}</label>
<label class="col-sm-3 control-label">{{ trans('general.name') }}</label>
<div class="col-md-8">
<p class="form-control-static">{{ $licenseSeat->license->name }}</p>
</div>
</div>
<!-- Category -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-9">
<p class="form-control-static">{{ $licenseSeat->license->category->name }}</p>
@if ($licenseSeat->license->company)
<!-- accessory name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.company') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $licenseSeat->license->company->present()->formattedNameLink !!}</p>
</div>
</div>
</div>
@endif
@if ($licenseSeat->license->category)
<!-- category name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $licenseSeat->license->category->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
<!-- Serial -->
@can('viewKeys', $licenseSeat->license)

View File

@@ -33,13 +33,27 @@
<p class="form-control-static">{{ $license->name }}</p>
</div>
</div>
<!-- Category -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-9">
<p class="form-control-static">{{ $license->category->name }}</p>
@if ($license->company)
<!-- company name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.company') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $license->company->present()->formattedNameLink !!}</p>
</div>
</div>
</div>
@endif
@if ($license->category)
<!-- category name -->
<div class="form-group">
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-6">
<p class="form-control-static">{!! $license->category->present()->formattedNameLink !!}</p>
</div>
</div>
@endif
<!-- Serial -->
@can('viewKeys', $license)

View File

@@ -89,7 +89,7 @@
<strong>{{ trans('general.company') }}</strong>
</div>
<div class="col-md-9">
<a href="{{ route('companies.show', $license->company->id) }}">{{ $license->company->name }}</a>
{!! $license->company->present()->formattedNameLink !!}
</div>
</div>
@endif
@@ -100,13 +100,7 @@
<strong>{{ trans('admin/hardware/form.manufacturer') }}</strong>
</div>
<div class="col-md-9">
@can('view', \App\Models\Manufacturer::class)
<a href="{{ route('manufacturers.show', $license->manufacturer->id) }}">
{{ $license->manufacturer->name }}
</a>
@else
{{ $license->manufacturer->name }}
@endcan
{!! $license->manufacturer->present()->formattedNameLink !!}
@if ($license->manufacturer->url)
<br><x-icon type="globe-us" /> <a href="{{ $license->manufacturer->url }}" rel="noopener">{{ $license->manufacturer->url }}</a>
@@ -196,13 +190,7 @@
</div>
<div class="col-md-9">
@if ($license->supplier->deleted_at=='')
@can('view', \App\Models\Supplier::class)
<a href="{{ route('suppliers.show', $license->supplier->id) }}">
{{ $license->supplier->name }}
</a>
@else
{{ $license->supplier->name }}
@endcan
{!! $license->supplier->present()->formattedNameLink !!}
@if ($license->supplier->url)
<br><x-icon type="globe-us" /> <a href="{{ $license->supplier->url }}" rel="noopener">{{ $license->supplier->url }}</a>

View File

@@ -78,5 +78,20 @@
</div>
</div>
<fieldset name="color-preferences">
<x-form-legend help_text="{{ trans('general.tag_color_help') }}">
{{ trans('general.tag_color') }}
</x-form-legend>
<!-- color -->
<div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">
<label for="tag_color" class="col-md-3 control-label">
{{ trans('general.tag_color') }}
</label>
<div class="col-md-9">
<x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />
{!! $errors->first('tag_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
</fieldset>
@stop

View File

@@ -93,5 +93,20 @@
placeholder="{{ trans('general.placeholders.notes') }}"
/>
<fieldset name="color-preferences">
<x-form-legend help_text="{{ trans('general.tag_color_help') }}">
{{ trans('general.tag_color') }}
</x-form-legend>
<!-- color -->
<div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">
<label for="tag_color" class="col-md-3 control-label">
{{ trans('general.tag_color') }}
</label>
<div class="col-md-9">
<x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />
{!! $errors->first('tag_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
</fieldset>
@stop

View File

@@ -904,8 +904,15 @@
// This only works for model index pages because it uses the row's model ID
function genericRowLinkFormatter(destination) {
return function (value,row) {
if ((row) && (row.tag_color) && (row.tag_color!='') && (row.tag_color!=undefined)) {
var tag_icon = '<i class="fa-solid fa-square" style="color: ' + row.tag_color + ';" aria-hidden="true"></i> ';
} else {
var tag_icon = '';
}
if (value) {
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '">' + value + '</a>';
return tag_icon + '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '">' + value + '</a>';
}
};
}
@@ -972,16 +979,41 @@
// Add some overrides for any funny urls we have
var dest = destination;
var tag_color;
var polymorphicItemFormatterDest = '';
if (destination == 'fieldsets') {
var polymorphicItemFormatterDest = 'fields/';
}
}
return '<nobr><a href="{{ config('app.url') }}/' + polymorphicItemFormatterDest + dest + '/' + value.id + '">' + value.name + '</a></span>';
// Handle the preceding icon if a tag_color is given in the API response
if ((value.tag_color) && (value.tag_color!='')) {
var tag_icon = '<i class="fa-solid fa-square" style="color: ' + value.tag_color + ';" aria-hidden="true"></i>';
} else {
var tag_icon = '';
}
return '<nobr>'+ tag_icon + ' <a href="{{ config('app.url') }}/' + polymorphicItemFormatterDest + dest + '/' + value.id + '">' + value.name + '</a></span>';
}
};
}
function colorSqFormatter(value, row) {
if (value) {
return '<span class="label" style="background-color: ' + value + ';">&nbsp;</span> ' + value;
}
}
function colorTagFormatter(value, row) {
if (value) {
return '<i class="fa-solid fa-square" style="color: ' + value + ';" aria-hidden="true"></i> ' + value;
}
}
function licenseKeyFormatter(value, row) {
if (value) {
@@ -1414,7 +1446,14 @@
function deployedLocationFormatter(row, value) {
if ((row) && (row!=undefined)) {
return '<a href="{{ config('app.url') }}/locations/' + row.id + '">' + row.name + '</a>';
// Handle the preceding icon if a tag_color is given in the API response
if ((row.tag_color) && (row.tag_color!='')) {
var tag_icon = '<i class="fa-solid fa-square" style="color: ' + row.tag_color + ';" aria-hidden="true"></i> ';
} else {
var tag_icon = '';
}
return '<nobr>' + tag_icon +'<a href="{{ config('app.url') }}/locations/' + row.id + '">' + row.name + '</a></nobr>';
} else if (value.rtd_location) {
return '<a href="{{ config('app.url') }}/locations/' + value.rtd_location.id + '">' + value.rtd_location.name + '</a>';
}

View File

@@ -228,16 +228,15 @@
<!-- Header color -->
<div class="form-group {{ $errors->has('header_color') ? 'error' : '' }}">
<label for="header_color" class="col-md-3 control-label">{{ trans('admin/settings/general.header_color') }}</label>
<div class="col-md-9">
<div id="header-color" class="input-group colorpicker-component row col-md-5">
<input type="text" class="form-control" placeholder="#FF0000" aria-label="header_color" name="header_color" id="header_color" value="{{ old('header_color', ($setting->header_color ?? '#3c8dbc')) }}" />
<span class="input-group-addon"><i></i></span>
</div>
<p class="help-block">{{ trans('admin/settings/general.header_color_help') }}</p>
<div class="col-md-5 col-xs-5 col-sm-3 col-md-4 col-lg-3 col-xl-3">
<div class="input-group header-color">
<input class="form-control" placeholder="#FF0000" aria-label="header_color" name="header_color" type="text" id="header_color" value="{{ old('header_color', ($setting->header_color ?? '#3c8dbc')) }}">
<div class="input-group-addon">
<i class="fa-solid fa-square" style="color: {{ old('header_color', ($setting->header_color ?? '#3c8dbc')) }}"></i>
</div>
</div><!-- /.input group -->
{!! $errors->first('header_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
@@ -423,9 +422,17 @@
@section('moar_scripts')
<!-- bootstrap color picker -->
<script nonce="{{ csrf_token() }}">
//color picker with addon
$(".header-color").colorpicker();
$(function() {
$('#header-color').colorpicker().on('changeColor', function(e) {
$('.main-header .navbar')[0].style.backgroundColor = e.color
.toString('rgba');
});
});
// toggle the disabled state of asset id prefix
$('#auto_increment_assets').on('ifChecked', function(){
$('#auto_increment_prefix').prop('disabled', false).focus();

View File

@@ -42,10 +42,7 @@
<div class="form-group{{ $errors->has('color') ? ' has-error' : '' }}">
<label for="color" class="col-md-3 control-label">{{ trans('admin/statuslabels/table.color') }}</label>
<div class="col-md-9">
<div class="input-group color">
<input class="form-control col-md-10" maxlength="20" name="color" type="text" id="color" value="{{ old('color', $item->color) }}">
<div class="input-group-addon"><i></i></div>
</div><!-- /.input group -->
<x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="color" id="color" />
{!! $errors->first('color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
@@ -75,17 +72,3 @@
@stop
@section('moar_scripts')
<!-- bootstrap color picker -->
<script nonce="{{ csrf_token() }}">
$(function() {
$('.color').colorpicker({
color: `{{ old('color', $item->color) ?: '#AA3399' }}`,
format: 'hex'
});
});
</script>
@stop

View File

@@ -79,7 +79,7 @@
<script nonce="{{ csrf_token() }}">
function colorSqFormatter(value, row) {
if (value) {
return '<span class="label" style="background-color: ' + value + ';">&nbsp;</span> ' + value;
return '<i class="fa-solid fa-square" style="color: ' + value + ';" aria-hidden="true"></i> ' + value;
}
}

View File

@@ -36,4 +36,20 @@
@include ('partials.forms.edit.notes')
@include ('partials.forms.edit.image-upload', ['image_path' => app('suppliers_upload_path')])
<fieldset name="color-preferences">
<x-form-legend help_text="{{ trans('general.tag_color_help') }}">
{{ trans('general.tag_color') }}
</x-form-legend>
<!-- color -->
<div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">
<label for="tag_color" class="col-md-3 control-label">
{{ trans('general.tag_color') }}
</label>
<div class="col-md-9">
<x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />
{!! $errors->first('tag_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
</fieldset>
@stop

View File

@@ -405,13 +405,7 @@
{{ trans('general.company') }}
</div>
<div class="col-md-9">
@can('view', 'App\Models\Company')
<a href="{{ route('companies.show', $user->company->id) }}">
{{ $user->company->name }}
</a>
@else
{{ $user->company->name }}
@endcan
{!! $user->company->present()->formattedNameLink !!}
</div>
</div>
@@ -572,21 +566,11 @@
{{ trans('admin/users/table.location') }}
</div>
<div class="col-md-9">
{{ link_to_route('locations.show', $user->userloc->name, [$user->userloc->id]) }}
{!! $user->userloc->present()->formattedNameLink !!}
</div>
</div>
@endif
<!-- last login -->
<div class="row">
<div class="col-md-3">
{{ trans('general.last_login') }}
</div>
<div class="col-md-9">
{{ \App\Helpers\Helper::getFormattedDateObject($user->last_login, 'datetime', false) }}
</div>
</div>
@if ($user->department)
<!-- empty -->
@@ -596,7 +580,7 @@
</div>
<div class="col-md-9">
<a href="{{ route('departments.show', $user->department) }}">
{{ $user->department->name }}
{!! $user->department->present()->formattedNameLink !!}
</a>
</div>
</div>
@@ -614,6 +598,17 @@
@endif
@endif
<!-- last login -->
<div class="row">
<div class="col-md-3">
{{ trans('general.last_login') }}
</div>
<div class="col-md-9">
{{ \App\Helpers\Helper::getFormattedDateObject($user->last_login, 'datetime', false) }}
</div>
</div>
@if ($user->created_at)
<!-- created at -->
<div class="row">