mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-12 17:52:00 +08:00
Merge branch 'develop' into debugbar
This commit is contained in:
@@ -50,8 +50,8 @@ class ResetDemoSettings extends Command
|
||||
$settings->alert_email = 'service@snipe-it.io';
|
||||
$settings->login_note = 'Use `admin` / `password` to login to the demo.';
|
||||
$settings->header_color = '#3c8dbc';
|
||||
$settings->link_dark_color = '#86cbf2';
|
||||
$settings->link_light_color = '#084d73;';
|
||||
$settings->link_dark_color = '#5fa4cc';
|
||||
$settings->link_light_color = '#296282;';
|
||||
$settings->label2_2d_type = 'QRCODE';
|
||||
$settings->default_currency = 'USD';
|
||||
$settings->brand = 2;
|
||||
|
||||
@@ -55,7 +55,7 @@ class IconHelper
|
||||
case 'download':
|
||||
return 'fas fa-download';
|
||||
case 'checkmark':
|
||||
return 'fas fa-check icon-white';
|
||||
return 'fas fa-check';
|
||||
case 'x':
|
||||
return 'fas fa-times';
|
||||
case 'logout':
|
||||
@@ -212,6 +212,48 @@ class IconHelper
|
||||
return 'fa-regular fa-building';
|
||||
case 'parent':
|
||||
return 'fa-solid fa-building-flag';
|
||||
case 'number':
|
||||
return 'fa-solid fa-hashtag';
|
||||
case 'depreciation':
|
||||
return 'fa-solid fa-arrows-down-to-line';
|
||||
case 'depreciation-calendar':
|
||||
case 'expiration':
|
||||
case 'terminates':
|
||||
return 'fa-regular fa-calendar-xmark';
|
||||
case 'manufacturer':
|
||||
return 'fa-solid fa-industry';
|
||||
case 'fieldset' :
|
||||
return 'fa-regular fa-rectangle-list';
|
||||
case 'deleted-date':
|
||||
return 'fa-solid fa-calendar-xmark';
|
||||
case 'eol':
|
||||
return 'fa-regular fa-calendar-days';
|
||||
case 'category':
|
||||
return 'fa-solid fa-icons';
|
||||
case 'cost':
|
||||
return 'fa-solid fa-money-bills';
|
||||
case 'available':
|
||||
return 'fa-solid fa-box';
|
||||
case 'checkedout':
|
||||
return 'fa-solid fa-box-open';
|
||||
case 'purchase_order':
|
||||
return 'fa-solid fa-file-invoice-dollar';
|
||||
case 'order':
|
||||
return 'fa-solid fa-file-invoice';
|
||||
case 'checkout-all':
|
||||
return 'fa-solid fa-arrows-down-to-people';
|
||||
case 'square-right':
|
||||
return 'fa-regular fa-square-caret-right';
|
||||
case 'square-left':
|
||||
return 'fa-regular fa-square-caret-left';
|
||||
case 'square':
|
||||
return 'fa-solid fa-square';
|
||||
case 'models':
|
||||
case 'model':
|
||||
return 'fa-solid fa-boxes-stacked';
|
||||
case 'min-qty':
|
||||
return 'fa-solid fa-chart-pie';
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -820,7 +820,10 @@ class AssetsController extends Controller
|
||||
}
|
||||
|
||||
if (isset($target)) {
|
||||
$asset->checkOut($target, auth()->user(), date('Y-m-d H:i:s'), '', 'Checked out on asset update', e($request->input('name')), $location);
|
||||
// Using `->has` preserves the asset name if the name parameter was not included in request.
|
||||
$asset_name = request()->has('name') ? request('name') : $asset->name;
|
||||
|
||||
$asset->checkOut($target, auth()->user(), date('Y-m-d H:i:s'), '', 'Checked out on asset update', $asset_name, $location);
|
||||
}
|
||||
|
||||
if ($asset->image) {
|
||||
|
||||
@@ -59,7 +59,7 @@ class ComponentsController extends Controller
|
||||
|
||||
$components = Component::select('components.*')
|
||||
->with('company', 'location', 'category', 'supplier', 'adminuser', 'manufacturer')
|
||||
->withSum('uncontrainedAssets as sum_unconstrained_assets', 'components_assets.assigned_qty');
|
||||
->withSum('unconstrainedAssets as sum_unconstrained_assets', 'components_assets.assigned_qty');
|
||||
|
||||
$filter = [];
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Helpers\Helper;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Transformers\ProfileTransformer;
|
||||
use App\Models\CheckoutRequest;
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -182,19 +183,22 @@ class ProfileController extends Controller
|
||||
*/
|
||||
public function eulas(ProfileTransformer $transformer, Request $request)
|
||||
{
|
||||
if($request->filled('user_id') && $request->input('user_id') != 0) {
|
||||
// Return selected user's EULAs
|
||||
$eulas = User::find($request->input('user_id'))->eulas;
|
||||
}
|
||||
else {
|
||||
// Only return this user's EULAs
|
||||
|
||||
if (($request->filled('user_id')) && ($request->input( 'user_id') != 0)) {
|
||||
|
||||
$eula_user = User::find($request->input('user_id'));
|
||||
|
||||
if (($eula_user) && (Setting::getSettings()->manager_view_enabled) && (auth()->user()->isManagerOf($eula_user->id))) {
|
||||
$eulas = $eula_user->eulas;
|
||||
} else {
|
||||
return response()->json(Helper:: formatStandardApiResponse('error', null, trans('admin/users/message.user_not_found')));
|
||||
}
|
||||
} else {
|
||||
$eulas = auth()->user()->eulas;
|
||||
}
|
||||
|
||||
return response()->json(
|
||||
$transformer->transformFiles($eulas, $eulas->count())
|
||||
);
|
||||
return response()->json($transformer->transformFiles($eulas, $eulas->count()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -478,12 +478,22 @@ class UsersController extends Controller
|
||||
|
||||
}
|
||||
|
||||
if ($request->filled('groups')) {
|
||||
|
||||
if (($request->has('groups')) && (auth()->user()->isSuperUser())) {
|
||||
|
||||
$validator = Validator::make($request->only('groups'), [
|
||||
'groups.*' => 'integer|exists:permission_groups,id',
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, $validator->errors()));
|
||||
}
|
||||
|
||||
// Sync the groups since the user is a superuser and the groups pass validation
|
||||
$user->groups()->sync($request->input('groups'));
|
||||
} else {
|
||||
$user->groups()->sync([]);
|
||||
}
|
||||
|
||||
|
||||
return response()->json(Helper::formatStandardApiResponse('success', (new UsersTransformer)->transformUser($user), trans('admin/users/message.success.create')));
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ class CustomFieldsetsController extends Controller
|
||||
{
|
||||
$this->authorize('create', CustomField::class);
|
||||
|
||||
return view('custom_fields.fieldsets.edit')->with('item', new CustomFieldset());
|
||||
return view('custom_fields.fieldsets.view')->with('custom_fieldset', new CustomFieldset());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,7 +127,7 @@ class CustomFieldsetsController extends Controller
|
||||
public function edit(CustomFieldset $fieldset) : View | RedirectResponse
|
||||
{
|
||||
$this->authorize('create', CustomField::class);
|
||||
return view('custom_fields.fieldsets.edit')->with('item', $fieldset);
|
||||
return view('custom_fields.fieldsets.view')->with('custom_fieldset', $fieldset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -409,14 +409,13 @@ class Importer extends Component
|
||||
'category' => trans('general.category'),
|
||||
'eol' => trans('general.eol'),
|
||||
'fieldset' => trans('admin/models/general.fieldset'),
|
||||
'item_name' => trans('general.item_name_var', ['item' => trans('general.asset_model')]),
|
||||
'name' => trans('general.item_name_var', ['item' => trans('general.asset_model')]),
|
||||
'manufacturer' => trans('general.manufacturer'),
|
||||
'min_amt' => trans('mail.min_QTY'),
|
||||
'model_number' => trans('general.model_no'),
|
||||
'notes' => trans('general.item_notes', ['item' => trans('admin/hardware/form.model')]),
|
||||
'requestable' => trans('admin/models/general.requestable'),
|
||||
'require_serial' => trans('admin/hardware/general.require_serial'),
|
||||
|
||||
];
|
||||
|
||||
// "real fieldnames" to a list of aliases for that field
|
||||
@@ -425,6 +424,8 @@ class Importer extends Component
|
||||
[
|
||||
'item name',
|
||||
'asset name',
|
||||
'model name',
|
||||
'asset model name',
|
||||
'accessory name',
|
||||
'user name',
|
||||
'consumable name',
|
||||
|
||||
@@ -269,7 +269,7 @@ class Component extends SnipeModel
|
||||
// is *not* null - so we don't have to keep recalculating for un-checked-out components
|
||||
// NOTE: doing this will add a 'pseudo-attribute' to the component in question, so we need to _remove_ this
|
||||
// before we save - so that gets handled in the 'saving' callback defined in the 'booted' method, above.
|
||||
$this->sum_unconstrained_assets = $this->uncontrainedAssets()->sum('assigned_qty') ?? 0;
|
||||
$this->sum_unconstrained_assets = $this->unconstrainedAssets()->sum('assigned_qty') ?? 0;
|
||||
}
|
||||
return $this->sum_unconstrained_assets;
|
||||
}
|
||||
@@ -280,7 +280,7 @@ class Component extends SnipeModel
|
||||
*
|
||||
* This allows us to get the assets with assigned components without the company restriction
|
||||
*/
|
||||
public function uncontrainedAssets()
|
||||
public function unconstrainedAssets()
|
||||
{
|
||||
|
||||
return $this->belongsToMany(\App\Models\Asset::class, 'components_assets')
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\Loggable;
|
||||
use App\Presenters\Presentable;
|
||||
use App\Rules\AlphaEncrypted;
|
||||
use App\Rules\BooleanEncrypted;
|
||||
use App\Rules\DateEncrypted;
|
||||
@@ -18,10 +20,13 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
class CustomFieldset extends Model
|
||||
class CustomFieldset extends SnipeModel
|
||||
{
|
||||
use HasFactory;
|
||||
use ValidatingTrait;
|
||||
use Presentable;
|
||||
|
||||
protected $presenter = \App\Presenters\CustomFieldsetPresenter::class;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use App\Models\Traits\Searchable;
|
||||
use App\Presenters\Presentable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
class Depreciation extends SnipeModel
|
||||
@@ -52,6 +53,16 @@ class Depreciation extends SnipeModel
|
||||
*/
|
||||
protected $searchableRelations = [];
|
||||
|
||||
|
||||
public function isDeletable()
|
||||
{
|
||||
return Gate::allows('delete', $this)
|
||||
&& (($this->assets_count ?? $this->assets()->count()) === 0)
|
||||
&& (($this->licenses_count ?? $this->licenses()->count()) === 0)
|
||||
&& (($this->models_count ?? $this->models()->count()) === 0)
|
||||
&& ($this->deleted_at == '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Establishes the depreciation -> models relationship
|
||||
*
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\Traits\Searchable;
|
||||
use App\Presenters\Presentable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
use \Illuminate\Database\Eloquent\Relations\Relation;
|
||||
class Supplier extends SnipeModel
|
||||
@@ -72,6 +73,18 @@ class Supplier extends SnipeModel
|
||||
*/
|
||||
protected $fillable = ['name', 'address', 'address2', 'city', 'state', 'country', 'zip', 'phone', 'fax', 'email', 'contact', 'url', 'tag_color', 'notes'];
|
||||
|
||||
|
||||
public function isDeletable()
|
||||
{
|
||||
return Gate::allows('delete', $this)
|
||||
&& (($this->assets_count ?? $this->assets()->count()) === 0)
|
||||
&& (($this->licenses_count ?? $this->licenses()->count()) === 0)
|
||||
&& (($this->consumables_count ?? $this->consumables()->count()) === 0)
|
||||
&& (($this->accessories_count ?? $this->accessories()->count()) === 0)
|
||||
&& (($this->components_count ?? $this->components()->count()) === 0)
|
||||
&& (($this->maintenances_count ?? $this->maintenances()->count()) === 0)
|
||||
&& ($this->deleted_at == '');
|
||||
}
|
||||
/**
|
||||
* Eager load counts
|
||||
*
|
||||
|
||||
@@ -262,7 +262,11 @@ class AccessoryPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('accessories.show', $this->name, $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Accessory', $this])) {
|
||||
return (string)link_to_route('accessories.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -447,7 +447,11 @@ class AssetPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('hardware.show', e($this->name), $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Asset', $this])) {
|
||||
return (string)link_to_route('hardware.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
public function modelUrl()
|
||||
|
||||
@@ -139,7 +139,11 @@ class CategoryPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('categories.show', $this->name, $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Category', $this])) {
|
||||
return (string)link_to_route('categories.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,6 +161,6 @@ class CategoryPresenter extends Presenter
|
||||
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;
|
||||
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').e($this->name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,11 @@ class CompanyPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('companies.show', $this->name, $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Company', $this])) {
|
||||
return (string)link_to_route('companies.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,9 +183,9 @@ class CompanyPresenter extends Presenter
|
||||
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>" : '').'<a href="'.route('companies.show', e($this->id)).'">'.e($this->display_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;
|
||||
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,11 @@ class ComponentPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('consumables.show', e($this->name), $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Component', $this])) {
|
||||
return (string)link_to_route('components.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
22
app/Presenters/CustomFieldsetPresenter.php
Normal file
22
app/Presenters/CustomFieldsetPresenter.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Presenters;
|
||||
|
||||
/**
|
||||
* Class CustomFieldsetPresenter
|
||||
*/
|
||||
class CustomFieldsetPresenter extends Presenter
|
||||
{
|
||||
|
||||
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\CustomFieldset', $this])) {
|
||||
return (string)link_to_route('fieldsets.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -118,6 +118,19 @@ class DepartmentPresenter extends Presenter
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Url to view this item.
|
||||
* @return string
|
||||
*/
|
||||
public function viewUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Location', $this])) {
|
||||
return (string)link_to_route('locations.show', $this->display_name, $this->id);
|
||||
} else {
|
||||
return $this->display_name;
|
||||
}
|
||||
}
|
||||
|
||||
public function formattedNameLink() {
|
||||
|
||||
if (auth()->user()->can('view', ['\App\Models\Department', $this])) {
|
||||
|
||||
@@ -102,4 +102,17 @@ class DepreciationPresenter extends Presenter
|
||||
|
||||
return json_encode($layout);
|
||||
}
|
||||
|
||||
public function formattedNameLink() {
|
||||
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i> " : '').e($this->display_name);
|
||||
}
|
||||
|
||||
public function nameUrl()
|
||||
{
|
||||
if (auth()->user()->can('view', ['\App\Models\Depreciation', $this])) {
|
||||
return (string)link_to_route('depreciations.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,11 @@ class DepreciationReportPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('hardware.show', e($this->name), $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Depreciation', $this])) {
|
||||
return (string)link_to_route('depreciations.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
public function modelUrl()
|
||||
|
||||
@@ -319,7 +319,12 @@ class LicensePresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('licenses.show', $this->name, $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\License', $this])) {
|
||||
return (string)link_to_route('licenses.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -346,7 +346,11 @@ class LocationPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('locations.show', $this->name, $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Location', $this])) {
|
||||
return (string)link_to_route('locations.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -367,6 +371,7 @@ class LocationPresenter extends Presenter
|
||||
return route('locations.show', $this->id);
|
||||
}
|
||||
|
||||
|
||||
public function glyph()
|
||||
{
|
||||
return '<x-icon type="locations" />';
|
||||
@@ -380,9 +385,9 @@ class LocationPresenter extends Presenter
|
||||
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>" : '').'<a href="'.route('locations.show', e($this->id)).'">'.e($this->display_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;
|
||||
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i> " : '').e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,11 @@ class ManufacturerPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('manufacturers.show', $this->name, $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Manufacturer', $this])) {
|
||||
return (string)link_to_route('manufacturers.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,10 +199,10 @@ class ManufacturerPresenter extends Presenter
|
||||
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>" : '').'<a href="'.route('manufacturers.show', e($this->id)).'">'.e($this->display_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;
|
||||
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').e($this->display_name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -295,7 +295,12 @@ class PredefinedKitPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('kits.show', $this->name, $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\PredefinedKit', $this])) {
|
||||
return (string)link_to_route('kits.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -207,7 +207,11 @@ class SupplierPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('suppliers.show', $this->name, $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Supplier', $this])) {
|
||||
return (string)link_to_route('suppliers.show', e($this->display_name), $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,7 +229,11 @@ class SupplierPresenter extends Presenter
|
||||
*/
|
||||
public function viewUrl()
|
||||
{
|
||||
return route('suppliers.show', $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\Supplier', $this])) {
|
||||
return (string)link_to_route('suppliers.show', $this->display_name, $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
public function glyph()
|
||||
@@ -241,9 +249,9 @@ class SupplierPresenter extends Presenter
|
||||
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-square fa-fw' 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;
|
||||
return ($this->tag_color ? "<i class='fa-solid fa-square fa-fw' style='color: ".e($this->tag_color)."' aria-hidden='true'></i> " : '').e($this->name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +526,12 @@ class UserPresenter extends Presenter
|
||||
*/
|
||||
public function nameUrl()
|
||||
{
|
||||
return (string) link_to_route('users.show', $this->display_name, $this->id);
|
||||
if (auth()->user()->can('view', ['\App\Models\User', $this])) {
|
||||
return (string)link_to_route('users.show', $this->display_name, $this->id);
|
||||
} else {
|
||||
return e($this->display_name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -542,4 +547,13 @@ class UserPresenter extends Presenter
|
||||
{
|
||||
return '<x-icon type="user"/>';
|
||||
}
|
||||
|
||||
public function formattedNameLink() {
|
||||
|
||||
if (auth()->user()->can('view', ['\App\Models\User', $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('users.show', e($this->id)).'">'.e($this->display_name).'</a>';
|
||||
}
|
||||
|
||||
return ($this->tag_color ? "<i class='fa-solid fa-fw fa-square' style='color: ".e($this->tag_color)."' aria-hidden='true'></i>" : '').e($this->display_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,12 +21,18 @@ class LivewireServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Livewire::setUpdateRoute(function ($handle) {
|
||||
return Route::post('/' . config('livewire.url_prefix') . '/livewire/update', $handle);
|
||||
$prefix = trim((string) config('livewire.url_prefix', ''), '/');
|
||||
if ($prefix === '') {
|
||||
$prefix = trim((string) parse_url(config('app.url'), PHP_URL_PATH), '/');
|
||||
}
|
||||
$prefix = $prefix === '' ? '' : '/' . $prefix;
|
||||
|
||||
Livewire::setUpdateRoute(function ($handle) use ($prefix) {
|
||||
return Route::post($prefix . '/livewire/update', $handle);
|
||||
});
|
||||
|
||||
Livewire::setScriptRoute(function ($handle) {
|
||||
return Route::get('/' . config('livewire.url_prefix') . '/livewire/livewire.js', $handle);
|
||||
Livewire::setScriptRoute(function ($handle) use ($prefix) {
|
||||
return Route::get($prefix . '/livewire/livewire.js', $handle);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,10 @@ class SettingsServiceProvider extends ServiceProvider
|
||||
return 'models/';
|
||||
});
|
||||
|
||||
app()->singleton('licenses_upload_url', function () {
|
||||
return 'licenses/';
|
||||
});
|
||||
|
||||
// Categories
|
||||
app()->singleton('categories_upload_path', function () {
|
||||
return 'categories/';
|
||||
|
||||
@@ -86,7 +86,7 @@ return [
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', 3306),
|
||||
'port' => (int) env('DB_PORT', 3306),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
|
||||
@@ -6,5 +6,5 @@ return array (
|
||||
'prerelease_version' => '',
|
||||
'hash_version' => 'ga8c268760',
|
||||
'full_hash' => 'v8.3.7-220-ga8c268760',
|
||||
'branch' => 'develop',
|
||||
'branch' => 'master',
|
||||
);
|
||||
@@ -16,7 +16,7 @@ return array(
|
||||
'seats' => 'Seats',
|
||||
'termination_date' => 'Termination Date',
|
||||
'to_email' => 'Licensed to Email',
|
||||
'to_name' => 'Licensed to Name',
|
||||
'to_name' => 'Licensed To',
|
||||
'update' => 'Update License',
|
||||
'checkout_help' => 'You must check a license out to a hardware asset or a person. You can select both, but the owner of the asset must match the person you\'re checking the asset out to.'
|
||||
);
|
||||
|
||||
@@ -22,6 +22,7 @@ return [
|
||||
'add_maintenance' => 'Add Maintenance',
|
||||
'append' => 'Append',
|
||||
'new' => 'New',
|
||||
'show_hide_info' => 'Show/Hide More Information',
|
||||
'var' => [
|
||||
'clone' => 'Clone :item_type',
|
||||
'edit' => 'Edit :item_type',
|
||||
|
||||
@@ -102,6 +102,8 @@ return [
|
||||
'record_created' => 'Record Created',
|
||||
'updated_at' => 'Updated At',
|
||||
'updated_plain' => 'Updated',
|
||||
'deleted_plain' => 'Deleted',
|
||||
'purchased_plain' => 'Purchased',
|
||||
'created_plain' => 'Created',
|
||||
'currency' => '$', // this is deprecated
|
||||
'currency_text' => 'Currency', //
|
||||
|
||||
@@ -12,352 +12,163 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button"></i>
|
||||
@endsection
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
{{-- Page content --}}
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<x-container columns="2">
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
|
||||
<!-- Custom Tabs -->
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs hidden-print">
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
|
||||
<li class="active">
|
||||
<a href="#checkedout" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="info-circle" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/users/general.info') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#history" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="history" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.history') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<x-tabs.nav-item
|
||||
name="checkedout"
|
||||
class="active"
|
||||
icon_type="checkedout"
|
||||
label="{{ trans('general.checked_out') }}"
|
||||
count="{{ $accessory->checkouts_count }}"
|
||||
/>
|
||||
|
||||
|
||||
@can('accessories.files', $accessory)
|
||||
<li>
|
||||
<a href="#files" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="files" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($accessory->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($accessory->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
<x-tabs.nav-item
|
||||
name="history"
|
||||
icon="fa-solid fa-clock-rotate-left fa-fw"
|
||||
label="{{ trans('general.history') }}"
|
||||
tooltip="{{ trans('general.history') }}"
|
||||
/>
|
||||
|
||||
<x-tabs.nav-item
|
||||
name="files"
|
||||
icon="fa-solid fa-file-contract fa-fw"
|
||||
label="{{ trans('general.files') }}"
|
||||
count="{{ $accessory->uploads()->count() }}"
|
||||
/>
|
||||
|
||||
|
||||
@can('update', $accessory)
|
||||
<li class="pull-right">
|
||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<span class="hidden-lg hidden-xl hidden-md">
|
||||
<x-icon type="paperclip" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
<x-icon type="paperclip" />
|
||||
{{ trans('button.upload') }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<x-tabs.nav-item-upload />
|
||||
@endcan
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<x-slot:tabpanes>
|
||||
|
||||
<div class="tab-pane active" id="checkedout">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AccessoryPresenter::assignedDataTableLayout() }}"
|
||||
data-cookie-id-table="checkoutsTable"
|
||||
data-id-table="checkoutsTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="checkoutsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.accessories.checkedout', $accessory->id) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-accessories-{{ str_slug($accessory->name) }}-checkouts-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div><!--./col-md-12-->
|
||||
</div> <!-- ./row -->
|
||||
</div>
|
||||
<!-- start history tab pane -->
|
||||
<x-tabs.pane name="checkedout" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.checked_out') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
api_url="{{ route('api.accessories.checkedout', $accessory->id) }}"
|
||||
:presenter="\App\Presenters\AccessoryPresenter::assignedDataTableLayout()"
|
||||
export_filename="export-{{ str_slug($accessory->name) }}-assets-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
<!-- end history tab pane -->
|
||||
|
||||
<!-- history tab pane -->
|
||||
<div class="tab-pane fade" id="history">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\HistoryPresenter::dataTableLayout() }}"
|
||||
class="table table-striped snipe-table"
|
||||
data-cookie-id-table="AccessoryHistoryTable"
|
||||
data-id-table="AccessoryHistoryTable"
|
||||
id="AccessoryHistoryTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="desc"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($accessory->name) }}-history-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
data-url="{{ route('api.activity.index', ['item_id' => $accessory->id, 'item_type' => 'accessory']) }}">
|
||||
</table>
|
||||
</div> <!-- /.col-md-12-->
|
||||
</div> <!-- /.row-->
|
||||
</div>
|
||||
<!-- start history tab pane -->
|
||||
<x-tabs.pane name="history">
|
||||
<x-slot:header>
|
||||
{{ trans('general.history') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
name="accessoryHistory"
|
||||
api_url="{{ route('api.activity.index', ['item_id' => $accessory->id, 'item_type' => 'accessory']) }}"
|
||||
:presenter="\App\Presenters\HistoryPresenter::dataTableLayout()"
|
||||
export_filename="export-accessory-{{ str_slug($accessory->name) }}-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
<!-- end history tab pane -->
|
||||
|
||||
|
||||
|
||||
@can('accessories.files', $accessory)
|
||||
<div class="tab-pane" id="files">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- start files tab pane -->
|
||||
@can('accessories.files', $accessory)
|
||||
<x-tabs.pane name="files">
|
||||
<x-slot:header>
|
||||
{{ trans('general.files') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-filestable object_type="accessories" :object="$accessory" />
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end files tab pane -->
|
||||
|
||||
|
||||
|
||||
<!-- side address column -->
|
||||
</x-slot:tabpanes>
|
||||
|
||||
<div class="col-md-3">
|
||||
</x-slot:tabnav>
|
||||
</x-tabs>
|
||||
|
||||
@if ($accessory->image!='')
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center" style="padding-bottom: 15px;">
|
||||
<a href="{{ Storage::disk('public')->url('accessories/'.e($accessory->image)) }}" data-toggle="lightbox" data-type="image">
|
||||
<img src="{{ Storage::disk('public')->url('accessories/'.e($accessory->image)) }}" class="img-responsive img-thumbnail" alt="{{ $accessory->name }}"></a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</x-page-column>
|
||||
|
||||
@if ($accessory->model_number)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>{{ trans('general.model_no')}}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $accessory->model_number }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<x-page-column class="col-md-3">
|
||||
<x-box>
|
||||
<x-box.info-panel :infoPanelObj="$accessory" img_path="{{ app('accessories_upload_url') }}">
|
||||
|
||||
@if ($accessory->company)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 15px;">
|
||||
<strong> {{ trans('general.company')}}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $accessory->company->present()->formattedNameLink !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<x-slot:before_list>
|
||||
|
||||
@if ($accessory->location)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>{{ trans('general.location')}}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $accessory->location->present()->formattedNameLink !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@can('update', $accessory)
|
||||
<a href="{{ route('accessories.edit', $accessory->id) }}" class="btn btn-warning btn-sm btn-social btn-block hidden-print" style="margin-bottom: 5px;">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('button.edit') }}
|
||||
</a>
|
||||
<a href="{{ route('clone/accessories', $accessory->id) }}" class="btn btn-info btn-block btn-sm btn-social hidden-print" style="margin-bottom: 5px;">
|
||||
<x-icon type="clone" />
|
||||
{{ trans('button.clone') }}</a>
|
||||
@endcan
|
||||
|
||||
@if ($accessory->category)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>{{ trans('general.category')}}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $accessory->category->present()->formattedNameLink !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@can('checkout', $accessory)
|
||||
|
||||
@if ($accessory->manufacturer)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>{{ trans('general.manufacturer')}}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $accessory->manufacturer->present()->formattedNameLink !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if (($accessory->numRemaining() > 0))
|
||||
|
||||
<a href="{{ route('accessories.checkout.show', $accessory->id) }}" class="btn bg-maroon btn-sm btn-social btn-block hidden-print" style="margin-bottom: 5px;">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('general.checkout') }}
|
||||
</a>
|
||||
|
||||
@else
|
||||
<span data-tooltip="true" title="{{ ($accessory->numRemaining() == 0) ? trans('admin/accessories/general.bulk.checkout_all.disabled_tooltip') : trans('admin/accessories/message.checkout.license_is_inactive') }}" class="btn bg-maroon btn-sm btn-social btn-block hidden-print disabled" style="margin-bottom: 5px;" data-tooltip="true" title="{{ trans('general.checkout') }}">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('general.checkout') }}
|
||||
</span>
|
||||
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
|
||||
|
||||
@if ($accessory->notes)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>
|
||||
{{ trans('general.notes') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9" style="word-wrap: break-word;">
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($accessory->notes)) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@can('delete', $accessory)
|
||||
|
||||
@if ($accessory->purchase_date)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>
|
||||
{{ trans('general.purchase_date') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9" style="word-wrap: break-word;">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($accessory->purchase_date, 'date')['formatted']}}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($accessory->purchase_cost)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>
|
||||
{{ trans('general.unit_cost') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9" style="word-wrap: break-word;">
|
||||
{{ Helper::formatCurrencyOutput($accessory->purchase_cost) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if ($accessory->purchase_cost)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>
|
||||
{{ trans('general.total_cost') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9" style="word-wrap: break-word;">
|
||||
{{ Helper::formatCurrencyOutput($accessory->totalCostSum()) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>{{ trans('admin/accessories/general.remaining') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $accessory->numRemaining() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>{{ trans('general.checked_out') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $accessory->checkouts_count }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>
|
||||
{{ trans('general.created_at') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9" style="word-wrap: break-word;">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($accessory->created_at, 'datetime')['formatted']}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($accessory->created_at!=$accessory->updated_at)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>
|
||||
{{ trans('general.updated_at') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9" style="word-wrap: break-word;">
|
||||
{{ \App\Helpers\Helper::getFormattedDateObject($accessory->updated_at, 'datetime')['formatted']}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
@if ($accessory->adminuser)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>
|
||||
{{ trans('general.created_by') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9" style="word-wrap: break-word;">
|
||||
<x-full-user-name :user="$accessory->adminuser" />
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if ($accessory->numRemaining() == 0)
|
||||
<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' => $accessory->name]) }}" data-target="#dataConfirmModal" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</a>
|
||||
@else
|
||||
<span data-tooltip="true" title=" {{ trans('admin/accessories/general.delete_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>
|
||||
</span>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
|
||||
|
||||
@can('update', \App\Models\Accessory::class)
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<a href="{{ route('accessories.edit', $accessory->id) }}" style="margin-right:5px;" class="btn btn-warning btn-sm btn-social btn-block hidden-print">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('admin/accessories/general.edit') }}
|
||||
</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@can('checkout', \App\Models\Accessory::class)
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<a href="{{ route('accessories.checkout.show', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn bg-maroon btn-sm btn-social btn-block hidden-print {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('general.checkout') }}
|
||||
</a>
|
||||
</div>
|
||||
@endcan
|
||||
</x-slot:before_list>
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
|
||||
@can('create', \App\Models\Accessory::class)
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<a href="{{ route('clone/accessories', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-info btn-block btn-sm btn-social hidden-print">
|
||||
<x-icon type="clone" />
|
||||
{{ trans('admin/accessories/general.clone') }}</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@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" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<span data-tooltip="true" title=" {{ trans('admin/accessories/general.delete_disabled') }}">
|
||||
<a href="#" class="btn btn-block btn-danger btn-sm btn-social delete-asset disabled">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
@props([
|
||||
'contact' => null,
|
||||
'img_path' => null,
|
||||
])
|
||||
|
||||
<div class="box-body box-profile">
|
||||
|
||||
<h3 class="profile-username">
|
||||
@if (($contact->image) && ($img_path))
|
||||
<a href="{{ Storage::disk('public')->url($img_path.e($contact->image)) }}" data-toggle="lightbox" data-type="image">
|
||||
<img src="{{ Storage::disk('public')->url($img_path.e($contact->image)) }}" class="profile-user-img img-responsive img-thumbnail" alt="{{ $contact->name }}">
|
||||
</a>
|
||||
@endif
|
||||
|
||||
|
||||
{{ $contact->display_name }}
|
||||
</h3>
|
||||
|
||||
@if ($contact->present()->displayAddress)
|
||||
{!! nl2br($contact->present()->displayAddress) !!}
|
||||
<br><br>
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($before_list))
|
||||
{{ $before_list }}
|
||||
@endif
|
||||
|
||||
<ul class="list-group list-group-unbordered">
|
||||
|
||||
{{ $slot }}
|
||||
|
||||
@if ($contact->company)
|
||||
<x-info-element icon_type="company">
|
||||
{{ $contact->company->display_name }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
<x-info-element icon_type="contact-card">
|
||||
{{ $contact->contact }}
|
||||
</x-info-element>
|
||||
|
||||
@if ($contact->manager)
|
||||
<x-info-element icon_type="manager">
|
||||
{{ $contact->manager->display_name }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($contact->parent)
|
||||
<x-info-element icon_type="parent">
|
||||
{{ $contact->parent->display_name }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
<x-info-element icon_type="email">
|
||||
<x-info-element.email>
|
||||
{{ $contact->email }}
|
||||
</x-info-element.email>
|
||||
</x-info-element>
|
||||
|
||||
@if ($contact->phone)
|
||||
<x-info-element icon_type="phone">
|
||||
<x-info-element.phone>
|
||||
{{ $contact->phone }}
|
||||
</x-info-element.phone>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($contact->fax)
|
||||
<x-info-element icon_type="fax">
|
||||
<x-info-element.phone>
|
||||
{{ $contact->fax }}
|
||||
</x-info-element.phone>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
<x-info-element icon_type="external-link">
|
||||
<x-info-element.url>
|
||||
{{ $contact->url }}
|
||||
</x-info-element.url>
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="external-link">
|
||||
<x-info-element.url>
|
||||
{{ $contact->support_url }}
|
||||
</x-info-element.url>
|
||||
</x-info-element>
|
||||
|
||||
@if ($contact->notes)
|
||||
<x-info-element>
|
||||
<i class="fa fa-note-sticky fa-fw"></i>
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($contact->notes)) !!}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if (($contact->present()->displayAddress) && (config('services.google.maps_api_key')))
|
||||
|
||||
<x-info-element>
|
||||
<div class="text-center">
|
||||
<img src="https://maps.googleapis.com/maps/api/staticmap?markers={{ urlencode($contact->address.','.$contact->city.' '.$contact->state.' '.$contact->country.' '.$contact->zip) }}&size=500x300&maptype=roadmap&key={{ config('services.google.maps_api_key') }}" class="img-thumbnail img-responsive" style="width: 100%" alt="Map">
|
||||
</div>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ((($contact->address!='') && ($contact->city!='')) || ($contact->state!='') || ($contact->country!=''))
|
||||
<x-info-element>
|
||||
<a class="btn btn-sm btn-theme" href="https://maps.google.com/?q={{ urlencode($contact->address.','. $contact->city.','.$contact->state.','.$contact->country.','.$contact->zip) }}" target="_blank">
|
||||
{!! trans('admin/locations/message.open_map', ['map_provider_icon' => '<i class="fa-brands fa-google" aria-hidden="true"></i>']) !!}
|
||||
<x-icon type="external-link"/>
|
||||
</a>
|
||||
|
||||
<a class="btn btn-sm btn-theme" href="https://maps.apple.com/?q={{ urlencode($contact->address.','. $contact->city.','.$contact->state.','.$contact->country.','.$contact->zip) }}" target="_blank">
|
||||
{!! trans('admin/locations/message.open_map', ['map_provider_icon' => '<i class="fa-brands fa-apple" aria-hidden="true"></i>']) !!}
|
||||
<x-icon type="external-link"/>
|
||||
</a>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($contact->created_by)
|
||||
<x-info-element>
|
||||
<span class="text-muted">
|
||||
<x-icon type="user" class="fa-fw" />
|
||||
{{ trans('general.created_by') }}
|
||||
{{ $contact->adminuser->display_name }}
|
||||
</span>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($contact->created_at)
|
||||
<x-info-element>
|
||||
<span class="text-muted">
|
||||
<x-icon type="calendar" class="fa-fw" />
|
||||
{{ trans('general.created_plain') }}
|
||||
{{ $contact->created_at }}
|
||||
</span>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($contact->updated_at)
|
||||
<x-info-element>
|
||||
<span class="text-muted">
|
||||
<x-icon type="calendar" class="fa-fw" />
|
||||
{{ trans('general.updated_plain') }}
|
||||
{{ $contact->updated_at }}
|
||||
</span>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
</ul>
|
||||
@if (isset($after_list))
|
||||
{{ $after_list }}
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
<!-- Start box component -->
|
||||
<div class="box box-{{ $box_style }}">
|
||||
<div {{ $attributes->merge(['class' => 'box box-'.$box_style]) }}>
|
||||
|
||||
@if ($header)
|
||||
<div class="box-header with-border">
|
||||
|
||||
493
resources/views/blade/box/info-panel.blade.php
Normal file
493
resources/views/blade/box/info-panel.blade.php
Normal file
@@ -0,0 +1,493 @@
|
||||
@props([
|
||||
'infoPanelObj' => null,
|
||||
'img_path' => null,
|
||||
])
|
||||
|
||||
|
||||
|
||||
<div class="box-header with-border" style="padding-top: 0;">
|
||||
<h3 class="box-title side-box-header" style="line-height: 20px">
|
||||
{{ $infoPanelObj->display_name }}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body box-profile side-box expanded">
|
||||
|
||||
|
||||
@if (($infoPanelObj->image) && ($img_path))
|
||||
<a href="{{ Storage::disk('public')->url($img_path.e($infoPanelObj->image)) }}" data-toggle="lightbox" data-type="image">
|
||||
<img src="{{ Storage::disk('public')->url($img_path.e($infoPanelObj->image)) }}" class="profile-user-img img-responsive img-thumbnail" alt="{{ $infoPanelObj->name }}" style="margin-bottom: 10px;">
|
||||
</a>
|
||||
<br>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->present()->displayAddress)
|
||||
{!! nl2br($infoPanelObj->present()->displayAddress) !!}
|
||||
<br><br>
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($before_list))
|
||||
{{ $before_list }}
|
||||
@endif
|
||||
|
||||
<ul class="list-group list-group-unbordered">
|
||||
|
||||
|
||||
{{ $slot }}
|
||||
|
||||
<x-info-element icon_type="notes" title="{{ trans('general.notes') }}">
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($infoPanelObj->notes)) !!}
|
||||
</x-info-element>
|
||||
|
||||
@if ($infoPanelObj->serial)
|
||||
@can('viewKeys', $infoPanelObj)
|
||||
<x-info-element>
|
||||
<x-copy-to-clipboard copy_what="license_key">
|
||||
<code>{{ $infoPanelObj->serial }}</code>
|
||||
</x-copy-to-clipboard>
|
||||
</x-info-element>
|
||||
@else
|
||||
------------
|
||||
@endcan
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->license_name)
|
||||
<x-info-element icon_type="contact-card" title="{{ trans('admin/licenses/form.to_name') }}">
|
||||
{{ trans('admin/licenses/form.to_name') }}
|
||||
{{ $infoPanelObj->license_name }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->license_email)
|
||||
<x-info-element icon_type="email" title="{{ trans('admin/licenses/form.to_email') }}">
|
||||
{{ trans('admin/licenses/form.to_email') }}
|
||||
<x-info-element.email>
|
||||
{{ $infoPanelObj->license_email }}
|
||||
</x-info-element.email>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->termination_date)
|
||||
<x-info-element icon_type="terminates" title="{{ trans('general.termination_date') }}">
|
||||
{{ Helper::getFormattedDateObject($infoPanelObj->termination_date, 'date', false) }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->expiration_date)
|
||||
<x-info-element icon_type="expiration" title="{{ trans('general.expires') }}">
|
||||
{{ Helper::getFormattedDateObject($infoPanelObj->expiration_date, 'date', false) }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->model_number)
|
||||
<x-info-element icon_type="number" title="{{ trans('general.model_number') }}">
|
||||
{{ $infoPanelObj->model_number }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->min_amt)
|
||||
<x-info-element>
|
||||
<x-icon type="min-qty" class="fa-fw" title="{{ trans('general.min_amt') }}" />
|
||||
{{ trans('general.min_amt') }} {{ $infoPanelObj->min_amt }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->order_number)
|
||||
<x-info-element icon_type="order" title="{{ trans('general.order_number') }}">
|
||||
{{ $infoPanelObj->order_number }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->purchase_order)
|
||||
<x-info-element icon_type="purchase_order" title="{{ trans('admin/licenses/form.purchase_order') }}">
|
||||
{{ $infoPanelObj->purchase_order }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if (function_exists('numRemaining'))
|
||||
<x-info-element icon_type="available" title="{{ trans('general.remaining') }}">
|
||||
{{ $infoPanelObj->numRemaining() }}
|
||||
{{ trans('general.remaining') }}
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="checkedout" title="{{ trans('general.available') }}">
|
||||
{{ $infoPanelObj->checkouts_count }}
|
||||
{{ trans('general.checked_out') }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->company)
|
||||
<x-info-element icon_type="company" icon_color="{{ $infoPanelObj->company->tag_color }}" title="{{ trans('general.company') }}">
|
||||
{!! $infoPanelObj->company->present()->nameUrl !!}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->category)
|
||||
<x-info-element icon_type="category" icon_color="{{ $infoPanelObj->category->tag_color }}" title="{{ trans('general.category') }}">
|
||||
{!! $infoPanelObj->category->present()->nameUrl !!}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->category_type)
|
||||
<x-info-element icon_type="{{ $infoPanelObj->category_type }}" title="{{ trans('general.type') }}">
|
||||
{{ $infoPanelObj->category_type }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@if ($infoPanelObj->location)
|
||||
<x-info-element icon_type="location" icon_color="{{ $infoPanelObj->location->tag_color }}" title="{{ trans('general.location') }}">
|
||||
{!! $infoPanelObj->location->present()->nameUrl !!}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->manager)
|
||||
<x-info-element icon_type="manager" title="{{ trans('admin/users/table.manager') }}">
|
||||
{!! $infoPanelObj->manager->present()->nameUrl !!}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->fieldset)
|
||||
<x-info-element icon_type="fieldset" title="{{ trans('admin/custom_fields/general.fieldset_name') }}">
|
||||
{!! $infoPanelObj->fieldset->present()->nameUrl !!}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->manufacturer)
|
||||
<x-info-element icon_type="manufacturer" title="{{ trans('general.manufacturer') }}">
|
||||
<strong>{{ trans('general.manufacturer') }}</strong>
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element class="subitem">
|
||||
{!! $infoPanelObj->manufacturer->present()->formattedNameLink !!}
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="phone" class="subitem" title="{{ trans('general.phone') }}">
|
||||
<x-info-element.phone>
|
||||
{{ $infoPanelObj->manufacturer->support_phone }}
|
||||
</x-info-element.phone>
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="email" class="subitem" title="{{ trans('general.email') }}">
|
||||
<x-info-element.email>
|
||||
{{ $infoPanelObj->manufacturer->support_email }}
|
||||
</x-info-element.email>
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="external-link" class="subitem" title="{{ trans('general.url') }}">
|
||||
<x-info-element.url>
|
||||
{{ $infoPanelObj->manufacturer->url }}
|
||||
</x-info-element.url>
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="external-link" class="subitem" title="{{ trans('general.url') }}">
|
||||
<x-info-element.url>
|
||||
{{ $infoPanelObj->manufacturer->support_url }}
|
||||
</x-info-element.url>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->supplier)
|
||||
<x-info-element icon_type="manufacturer" title="{{ trans('general.supplier') }}">
|
||||
<strong>{{ trans('general.supplier') }}</strong>
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element class="subitem">
|
||||
{!! $infoPanelObj->supplier->present()->formattedNameLink !!}
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="contact-card" class="subitem" title="{{ trans('admin/suppliers/table.contact') }}">
|
||||
{{ $infoPanelObj->supplier->contact }}
|
||||
</x-info-element>
|
||||
|
||||
@if ($infoPanelObj->supplier->present()->displayAddress)
|
||||
<x-info-element class="subitem">
|
||||
{!! nl2br($infoPanelObj->supplier->present()->displayAddress) !!}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
<x-info-element icon_type="phone" class="subitem" title="{{ trans('general.phone') }}">
|
||||
<x-info-element.phone title="{{ trans('general.phone') }}">
|
||||
{{ $infoPanelObj->supplier->phone }}
|
||||
</x-info-element.phone>
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="email" class="subitem" title="{{ trans('general.email') }}">
|
||||
<x-info-element.email>
|
||||
{{ $infoPanelObj->supplier->email }}
|
||||
</x-info-element.email>
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="external-link" class="subitem" title="{{ trans('general.url') }}">
|
||||
<x-info-element.url>
|
||||
{{ $infoPanelObj->supplier->url }}
|
||||
</x-info-element.url>
|
||||
</x-info-element>
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@if ($infoPanelObj->parent)
|
||||
<x-info-element icon_type="parent" title="{{ trans('admin/locations/table.parent') }}">
|
||||
{{ $infoPanelObj->parent->display_name }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->depreciation && $infoPanelObj->purchase_date)
|
||||
<x-info-element icon_type="depreciation" title="{{ trans('general.depreciation') }}">
|
||||
{!! $infoPanelObj->depreciation->present()->nameUrl !!}
|
||||
({{ $infoPanelObj->depreciation->months.' '.trans('general.months')}})
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="depreciation-calendar" title="{{ trans('general.depreciates') }}">
|
||||
{{ Helper::getFormattedDateObject($infoPanelObj->depreciated_date(), 'date', false) }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->eol)
|
||||
<x-info-element icon_type="eol" title="{{ trans('general.eol') }}">
|
||||
{{ $infoPanelObj->eol .' '.trans('general.months') }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
<x-info-element icon_type="email" title="{{ trans('general.email') }}">
|
||||
<x-info-element.email title="{{ trans('general.email') }}">
|
||||
{{ $infoPanelObj->email }}
|
||||
</x-info-element.email>
|
||||
</x-info-element>
|
||||
|
||||
@if ($infoPanelObj->phone)
|
||||
<x-info-element icon_type="phone" title="{{ trans('general.phone') }}">
|
||||
<x-info-element.phone>
|
||||
{{ $infoPanelObj->phone }}
|
||||
</x-info-element.phone>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->fax)
|
||||
<x-info-element icon_type="fax" title="{{ trans('general.fax') }}">
|
||||
<x-info-element.phone>
|
||||
{{ $infoPanelObj->fax }}
|
||||
</x-info-element.phone>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
<x-info-element icon_type="external-link" title="{{ trans('general.url') }}">
|
||||
<x-info-element.url>
|
||||
{{ $infoPanelObj->url }}
|
||||
</x-info-element.url>
|
||||
</x-info-element>
|
||||
|
||||
<x-info-element icon_type="external-link" title="{{ trans('admin/manufacturers/table.support_url') }}">
|
||||
<x-info-element.url>
|
||||
{{ $infoPanelObj->support_url }}
|
||||
</x-info-element.url>
|
||||
</x-info-element>
|
||||
|
||||
|
||||
@if (($infoPanelObj->present()->displayAddress) && (config('services.google.maps_api_key')))
|
||||
|
||||
<x-info-element>
|
||||
<div class="text-center">
|
||||
<img src="https://maps.googleapis.com/maps/api/staticmap?markers={{ urlencode($infoPanelObj->address.','.$infoPanelObj->city.' '.$infoPanelObj->state.' '.$infoPanelObj->country.' '.$infoPanelObj->zip) }}&size=500x300&maptype=roadmap&key={{ config('services.google.maps_api_key') }}" class="img-thumbnail img-responsive" style="width: 100%" alt="Map">
|
||||
</div>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ((($infoPanelObj->address!='') && ($infoPanelObj->city!='')) || ($infoPanelObj->state!='') || ($infoPanelObj->country!=''))
|
||||
<x-info-element>
|
||||
<a class="btn btn-sm btn-theme" href="https://maps.google.com/?q={{ urlencode($infoPanelObj->address.','. $infoPanelObj->city.','.$infoPanelObj->state.','.$infoPanelObj->country.','.$infoPanelObj->zip) }}" target="_blank">
|
||||
{!! trans('admin/locations/message.open_map', ['map_provider_icon' => '<i class="fa-brands fa-google" aria-hidden="true"></i>']) !!}
|
||||
<x-icon type="external-link"/>
|
||||
</a>
|
||||
|
||||
<a class="btn btn-sm btn-theme" href="https://maps.apple.com/?q={{ urlencode($infoPanelObj->address.','. $infoPanelObj->city.','.$infoPanelObj->state.','.$infoPanelObj->country.','.$infoPanelObj->zip) }}" target="_blank">
|
||||
{!! trans('admin/locations/message.open_map', ['map_provider_icon' => '<i class="fa-brands fa-apple" aria-hidden="true"></i>']) !!}
|
||||
<x-icon type="external-link"/>
|
||||
</a>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->months)
|
||||
<x-info-element title="{{ trans('general.months') }}">
|
||||
{{ $infoPanelObj->months }}
|
||||
{{ trans('general.months') }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->depreciation_type)
|
||||
<x-info-element title="{{ trans('general.depreciation_type') }}">
|
||||
@if ($infoPanelObj->depreciation_type == 'amount')
|
||||
{{ trans('general.depreciation_options.amount') }}
|
||||
@elseif ($infoPanelObj->depreciation_type == 'percent')
|
||||
{{ trans('general.depreciation_options.amount') }}
|
||||
@endif
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->purchase_cost)
|
||||
<x-info-element>
|
||||
<x-icon type="cost" class="fa-fw" title="{{ trans('general.purchase_cost') }}" />
|
||||
{{ Helper::formatCurrencyOutput($infoPanelObj->purchase_cost) }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->purchase_date)
|
||||
<x-info-element>
|
||||
<x-icon type="calendar" class="fa-fw" title="{{ trans('general.purchase_date') }}" />
|
||||
{{ trans('general.purchased_plain') }}
|
||||
{{ Helper::getFormattedDateObject($infoPanelObj->purchase_date, 'datetime', false) }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($infoPanelObj->maintained))
|
||||
<x-info-element title="{{ trans('general.maintained') }}">
|
||||
@if ($infoPanelObj->maintained == 1)
|
||||
<x-icon type="checkmark" class="fa-fw text-success" />
|
||||
{{ trans('admin/licenses/form.maintained') }}
|
||||
@else
|
||||
<x-icon type="x" class="fa-fw text-danger" />
|
||||
{{ trans('admin/licenses/form.maintained') }}
|
||||
@endif
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if (isset($infoPanelObj->reassignable))
|
||||
<x-info-element title="{{ trans('admin/licenses/form.reassignable') }}">
|
||||
@if ($infoPanelObj->reassignable == 1)
|
||||
<x-icon type="checkmark" class="fa-fw text-success" />
|
||||
{{ trans('admin/licenses/form.reassignable') }}
|
||||
@else
|
||||
<x-icon type="x" class="text-danger" />
|
||||
{{ trans('admin/licenses/form.reassignable') }}
|
||||
@endif
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if (isset($infoPanelObj->requestable))
|
||||
<x-info-element title="{{ trans('general.requestable') }}">
|
||||
@if ($infoPanelObj->requestable == 1)
|
||||
<x-icon type="checkmark" class="fa-fw text-success" />
|
||||
{{ trans('admin/hardware/general.requestable') }}
|
||||
@else
|
||||
<x-icon type="x" class="fa-fw text-danger" />
|
||||
{{ trans('admin/hardware/general.requestable') }}
|
||||
@endif
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if (isset($infoPanelObj->use_default_eula))
|
||||
<x-info-element>
|
||||
@if ($infoPanelObj->eula_text=='')
|
||||
<x-icon type="checkmark" class="fa-fw text-success" title="{{ trans('general.yes') }}" />
|
||||
{{ trans('admin/settings/general.default_eula_text') }}
|
||||
@else
|
||||
<x-icon type="checkmark" class="fa-fw text-success" title="{{ trans('general.yes') }}" />
|
||||
{{ trans('admin/categories/general.eula_text') }}
|
||||
@endif
|
||||
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if (isset($infoPanelObj->require_acceptance))
|
||||
<x-info-element>
|
||||
@if ($infoPanelObj->require_acceptance == 1)
|
||||
<x-icon type="checkmark" class="fa-fw text-success" title="{{ trans('general.yes') }}" />
|
||||
@else
|
||||
<x-icon type="x" class="fa-fw text-danger" title="{{ trans('general.no') }}" />
|
||||
@endif
|
||||
{{ trans('admin/categories/table.require_acceptance') }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@if (isset($infoPanelObj->alert_on_response))
|
||||
<x-info-element>
|
||||
@if ($infoPanelObj->require_acceptance == 1)
|
||||
<x-icon type="checkmark" class="fa-fw text-success" title="{{ trans('general.yes') }}"/>
|
||||
@else
|
||||
<x-icon type="x" class="fa-fw text-danger" title="{{ trans('general.no') }}"/>
|
||||
@endif
|
||||
{{ trans('admin/categories/general.email_to_initiator') }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->tag_color)
|
||||
<x-info-element>
|
||||
<x-icon type="square" class="fa-fw" style="color: {{ $infoPanelObj->tag_color }}" title="{{ trans('general.tag_color') }}"/>
|
||||
{{ $infoPanelObj->tag_color }}
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->adminuser)
|
||||
<x-info-element title="{{ trans('general.created_by') }}">
|
||||
<span class="text-muted">
|
||||
<x-icon type="user" class="fa-fw" title="{{ trans('general.created_by') }}" />
|
||||
{{ trans('general.created_by') }}
|
||||
@can('view', $infoPanelObj->adminuser)
|
||||
<a href="{{ route('users.show', $infoPanelObj->adminuser) }}"> {{ $infoPanelObj->adminuser->display_name }}</a>
|
||||
@else
|
||||
{{ $infoPanelObj->adminuser->display_name }}
|
||||
@endcan
|
||||
|
||||
</span>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($infoPanelObj->created_at)
|
||||
<x-info-element>
|
||||
<span class="text-muted">
|
||||
<x-icon type="calendar" class="fa-fw" title="{{ trans('general.created_at') }}" />
|
||||
{{ trans('general.created_plain') }}
|
||||
{{ Helper::getFormattedDateObject($infoPanelObj->created_at, 'datetime', false) }}
|
||||
</span>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->updated_at)
|
||||
<x-info-element>
|
||||
<span class="text-muted">
|
||||
<x-icon type="calendar" class="fa-fw" title="{{ trans('general.updated_at') }}" />
|
||||
{{ trans('general.updated_plain') }}
|
||||
{{ Helper::getFormattedDateObject($infoPanelObj->updated_at, 'datetime', false) }}
|
||||
</span>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
@if ($infoPanelObj->deleted_at)
|
||||
<x-info-element>
|
||||
<span class="text-muted">
|
||||
<x-icon type="deleted-date" class="fa-fw" title="{{ trans('general.deleted_at') }}" />
|
||||
{{ trans('general.deleted_plain') }}
|
||||
{{ Helper::getFormattedDateObject($infoPanelObj->deleted_at, 'datetime', false) }}
|
||||
</span>
|
||||
</x-info-element>
|
||||
@endif
|
||||
|
||||
|
||||
</ul>
|
||||
@if (isset($after_list))
|
||||
{{ $after_list }}
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
</x-page-column>
|
||||
|
||||
@else
|
||||
|
||||
<!-- the page using this should specify column names via the page-column component -->
|
||||
{{ $slot }}
|
||||
@endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
])
|
||||
|
||||
<!-- copy to clipboard -->
|
||||
<i class="fa-regular fa-clipboard js-copy-link hidden-print" data-clipboard-target=".js-copy-{{ $copy_what }}" aria-hidden="true" data-tooltip="true" data-placement="top" title="{{ trans('general.copy_to_clipboard') }}">
|
||||
<i class="fa-regular fa-clipboard js-copy-link hidden-print fa-fw" data-clipboard-target=".js-copy-{{ $copy_what }}" aria-hidden="true" data-tooltip="true" data-placement="top" title="{{ trans('general.copy_to_clipboard') }}">
|
||||
<span class="sr-only">{{ trans('general.copy_to_clipboard') }}</span>
|
||||
</i>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{-- IMPORTANT!!! Make sure there is no newline at the end of this file, or it will break the loaders for the tables --}}
|
||||
|
||||
@props([
|
||||
'type' => '',
|
||||
'title' => false,
|
||||
])
|
||||
<i {{ $attributes->merge(['class' => Icon::icon($type)]) }} aria-hidden="true"></i>
|
||||
<i {{ $attributes->merge(['class' => Icon::icon($type)]) }} aria-hidden="true"{!! $title ? ' data-tooltip="true" data-title="'.$title.'"' : '' !!}></i>
|
||||
@@ -1,14 +1,17 @@
|
||||
@props([
|
||||
'icon' => null,
|
||||
'icon_type' => null,
|
||||
'icon_color' => null,
|
||||
'title' => null,
|
||||
])
|
||||
|
||||
@if (!$slot->isEmpty())
|
||||
<li {{ $attributes->merge(['class' => 'list-group-item']) }}>
|
||||
|
||||
@if ($icon_type)
|
||||
<x-icon type="{{ $icon_type }}" class="fa-fw" />
|
||||
<x-icon type="{{ $icon_type }}" :title="$title" class="fa-fw" style="{{ 'color: '.$icon_color.' !important' ?? '' }}" />
|
||||
@elseif ($icon)
|
||||
<i class="{{ $icon }}"></i>
|
||||
<i class="{{ $icon }}"{!! $title ? ' data-tooltip="true" data-title="'.$title.'"' : '' !!}></i>
|
||||
@endif
|
||||
{{ $slot }}
|
||||
</li>
|
||||
|
||||
@@ -5,30 +5,47 @@
|
||||
'icon' => null,
|
||||
'icon_style' => null,
|
||||
'tooltip' => null,
|
||||
'icon_type' => null,
|
||||
])
|
||||
<!-- start tab nav item -->
|
||||
<li {{ $attributes->merge(['class' => '']) }}>
|
||||
|
||||
<a href="#{{ $name ?? 'info' }}" data-toggle="tab" data-tooltip="true" title="{{ $tooltip ?? $label }}">
|
||||
|
||||
@if ($icon)
|
||||
@if ($icon_type || $icon)
|
||||
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="{{ $icon }}" style="font-size: 18px" aria-hidden="true"></i>
|
||||
</span>
|
||||
@if ($icon)
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="{{ $icon }}" style="font-size: 18px" aria-hidden="true"></i>
|
||||
</span>
|
||||
|
||||
<span class="hidden-xs hidden-sm">
|
||||
<i class="{{ $icon }}" style="font-size: 16px" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
<i class="{{ $icon }}" style="font-size: 16px" aria-hidden="true"></i>
|
||||
</span>
|
||||
|
||||
@elseif ($icon_type)
|
||||
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="{{ $icon_type }}" class="fa-fw" style="font-size: 18px;" />
|
||||
</span>
|
||||
|
||||
<span class="hidden-xs hidden-sm">
|
||||
<x-icon type="{{ $icon_type }}" class="fa-fw" style="font-size: 16px;" />
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
<span class="sr-only">
|
||||
{{ $label }}
|
||||
</span>
|
||||
{{ $label }}
|
||||
</span>
|
||||
|
||||
@elseif ($label)
|
||||
{{ $label }}
|
||||
@endif
|
||||
|
||||
|
||||
@if ($count > 0)
|
||||
<span class="badge">{{ number_format($count) }}</span>
|
||||
@endif
|
||||
|
||||
@@ -8,169 +8,254 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button" data-tooltip="true" title="{{ trans('button.show_hide_info') }}"></i>
|
||||
@endsection
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<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')
|
||||
{{ trans('general.licenses') }}
|
||||
@elseif ($category->category_type=='consumable')
|
||||
{{ trans('general.consumables') }}
|
||||
@elseif ($category->category_type=='component')
|
||||
{{ trans('general.components') }}
|
||||
@endif
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<x-container columns="2">
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
@if ($category->category_type=='asset')
|
||||
<li>
|
||||
<a href="#models" data-toggle="tab" title="{{ trans('general.asset_models') }}">
|
||||
{{ trans('general.asset_models') }}
|
||||
@if ($category->models->count() > 0)
|
||||
<span class="badge badge-secondary"> {{ $category->models->count()}}</span>
|
||||
@endif
|
||||
@can('view', \App\Models\Asset::class)
|
||||
|
||||
<x-tabs.nav-item
|
||||
name="assets"
|
||||
class="active"
|
||||
icon_type="asset"
|
||||
label="{{ trans('general.assets') }}"
|
||||
count="{{ $category->showableAssets()->count() }}"
|
||||
/>
|
||||
|
||||
<x-tabs.nav-item
|
||||
name="models"
|
||||
icon_type="models"
|
||||
label="{{ trans('general.asset_models') }}"
|
||||
count="{{ $category->models->count() }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@elseif ($category->category_type=='accessory')
|
||||
|
||||
@can('view', \App\Models\Accessory::class)
|
||||
<x-tabs.nav-item
|
||||
name="accessories"
|
||||
class="active"
|
||||
icon_type="accessory"
|
||||
label="{{ trans('general.accessories') }}"
|
||||
count="{{ $category->accessories()->count() }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@elseif ($category->category_type=='license')
|
||||
@can('view', \App\Models\License::class)
|
||||
|
||||
<x-tabs.nav-item
|
||||
name="licenses"
|
||||
class="active"
|
||||
icon_type="license"
|
||||
label="{{ trans('general.licenses') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@elseif ($category->category_type=='consumable')
|
||||
|
||||
@can('view', \App\Models\Consumable::class)
|
||||
<x-tabs.nav-item
|
||||
name="consumables"
|
||||
class="active"
|
||||
icon_type="consumable"
|
||||
label="{{ trans('general.consumables') }}"
|
||||
count="{{ $category->consumables()->count() }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@elseif ($category->category_type=='component')
|
||||
|
||||
@can('view', \App\Models\Component::class)
|
||||
<x-tabs.nav-item
|
||||
name="components"
|
||||
class="active"
|
||||
icon_type="component"
|
||||
label="{{ trans('general.components') }}"
|
||||
count="{{ $category->components()->count() }}"
|
||||
/>
|
||||
@endcan
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
|
||||
</x-slot:tabnav>
|
||||
|
||||
<x-slot:tabpanes>
|
||||
|
||||
<!-- start assets tab pane -->
|
||||
@if ($category->category_type=='asset')
|
||||
@can('view', \App\Models\Asset::class)
|
||||
<x-tabs.pane name="assets" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.assets') }}
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:bulkactions>
|
||||
<x-table.bulk-assets />
|
||||
</x-slot:bulkactions>
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
show_column_search="true"
|
||||
show_advanced_search="true"
|
||||
buttons="assetButtons"
|
||||
api_url="{{ route('api.assets.index', ['category_id' => $category->id, 'itemtype' => 'assets']) }}"
|
||||
:presenter="\App\Presenters\AssetPresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($category->name) }}-assets-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
|
||||
</x-tabs.pane>
|
||||
|
||||
<x-tabs.pane name="models">
|
||||
<x-slot:header>
|
||||
{{ trans('general.asset_models') }}
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:bulkactions>
|
||||
@include('partials.models-bulk-actions')
|
||||
</x-slot:bulkactions>
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
buttons="modelButtons"
|
||||
api_url="{{ route('api.models.index', ['status' => e(request('status')), 'category_id' => $category->id]) }}"
|
||||
:presenter="\App\Presenters\AssetModelPresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($category->name) }}-models-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
|
||||
@elseif ($category->category_type=='license')
|
||||
@can('view', \App\Models\License::class)
|
||||
<x-tabs.pane name="licenses" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.licenses') }}
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
buttons="licenseButtons"
|
||||
api_url="{{ route('api.licenses.index', ['category_id' => $category->id]) }}"
|
||||
:presenter="\App\Presenters\LicensePresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($category->name) }}-licenses-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
|
||||
@elseif ($category->category_type=='accessory')
|
||||
@can('view', \App\Models\Accessory::class)
|
||||
<x-tabs.pane name="accessories" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.accessories') }}
|
||||
</x-slot:header>
|
||||
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
buttons="accessoryButtons"
|
||||
api_url="{{ route('api.accessories.index', ['category_id' => $category->id]) }}"
|
||||
:presenter="\App\Presenters\AccessoryPresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($category->name) }}-accessories-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
|
||||
@elseif ($category->category_type=='consumable')
|
||||
@can('view', \App\Models\Consumable::class)
|
||||
<x-tabs.pane name="consumables" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.consumables') }}
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
buttons="consumableButtons"
|
||||
api_url="{{ route('api.consumables.index', ['category_id' => $category->id]) }}"
|
||||
:presenter="\App\Presenters\ConsumablePresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($category->name) }}-consumables-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
|
||||
@elseif ($category->category_type=='component')
|
||||
@can('view', \App\Models\Component::class)
|
||||
<x-tabs.pane name="components" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.components') }}
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
buttons="componentButtons"
|
||||
api_url="{{ route('api.components.index', ['category_id' => $category->id]) }}"
|
||||
:presenter="\App\Presenters\ComponentPresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($category->name) }}-components-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
@endif
|
||||
<!-- end assets tab pane -->
|
||||
|
||||
</x-slot:tabpanes>
|
||||
</x-tabs>
|
||||
</x-page-column>
|
||||
<x-page-column class="col-md-3">
|
||||
|
||||
<x-box>
|
||||
<x-box.info-panel :infoPanelObj="$category" img_path="{{ app('categories_upload_url') }}">
|
||||
|
||||
<x-slot:before_list>
|
||||
|
||||
@can('update', $category)
|
||||
<a href="{{ ($category->deleted_at=='') ? route('categories.edit', $category->id) : '#' }}" class="btn btn-block btn-sm btn-warning btn-social hidden-print{{ ($category->deleted_at!='') ? ' disabled' : '' }}">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('general.update') }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="items">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@if ($category->category_type=='asset')
|
||||
@include('partials.asset-bulk-actions')
|
||||
@endif
|
||||
|
||||
<table
|
||||
|
||||
@if ($category->category_type=='asset')
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-show-columns-search="true"
|
||||
data-cookie-id-table="categoryAssetsTable"
|
||||
id="categoryAssetsTable"
|
||||
data-buttons="assetButtons"
|
||||
data-id-table="categoryAssetsTable"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='accessory')
|
||||
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryAccessoryTable"
|
||||
id="categoryAccessoryTable"
|
||||
data-buttons="accessoryButtons"
|
||||
data-id-table="categoryAccessoryTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-accessories-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='consumable')
|
||||
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryConsumableTable"
|
||||
id="categoryConsumableTable"
|
||||
data-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-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-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"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.'.$category_type_route.'.index',['category_id'=> $category->id]) }}">
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="models">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@can('update', \App\Models\AssetModel::class)
|
||||
@if ($category->models->count() > 0)
|
||||
@if ($category->category_type=='asset')
|
||||
@include('partials.models-bulk-actions')
|
||||
@endif
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
|
||||
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="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='{
|
||||
"fileName": "export-models-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- .tab-content-->
|
||||
</div> <!-- .nav-tabs-custom -->
|
||||
</div> <!-- .col-md-12> -->
|
||||
</div> <!-- .row -->
|
||||
@stop
|
||||
|
||||
@endcan
|
||||
|
||||
@can('delete', $category)
|
||||
|
||||
@if (!$category->isDeletable())
|
||||
<button 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') }}">
|
||||
<x-icon type="delete" />
|
||||
{{ 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.category')]) }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $category->name]) }}" data-target="#dataConfirmModal" data-tooltip="true" data-icon="fa fa-trash" data-placement="top" data-title="{{ trans('general.delete_what', ['item'=> trans('general.category')]) }}" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
</x-slot:before_list>
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@endsection
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
||||
|
||||
@@ -6,208 +6,275 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button" data-tooltip="true" title="{{ trans('button.show_hide_info') }}"></i>
|
||||
@endsection
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<x-container>
|
||||
<x-box>
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<x-container columns="2">
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
|
||||
@can('view', \App\Models\Asset::class)
|
||||
<x-tabs.nav-item
|
||||
class="active"
|
||||
name="assets"
|
||||
icon_type="asset"
|
||||
label="{{ trans('general.assets') }}"
|
||||
count="{{ $company->assets()->AssetsForShow()->count() }}"
|
||||
tooltip="{{ trans('general.assets') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@can('view', \App\Models\License::class)
|
||||
<x-tabs.nav-item
|
||||
name="licenses"
|
||||
icon_type="licenses"
|
||||
label="{{ trans('general.licenses') }}"
|
||||
count="{{ $company->licenses()->count() }}"
|
||||
tooltip="{{ trans('general.licenses') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@can('view', \App\Models\Accessory::class)
|
||||
<x-tabs.nav-item
|
||||
name="accessories"
|
||||
icon_type="accessories"
|
||||
label="{{ trans('general.accessories') }}"
|
||||
count="{{ $company->accessories()->count() }}"
|
||||
tooltip="{{ trans('general.accessories') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@can('view', \App\Models\Consumable::class)
|
||||
<x-tabs.nav-item
|
||||
name="consumables"
|
||||
icon_type="consumables"
|
||||
label="{{ trans('general.consumables') }}"
|
||||
count="{{ $company->consumables()->count() }}"
|
||||
tooltip="{{ trans('general.consumables') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@can('view', \App\Models\Component::class)
|
||||
<x-tabs.nav-item
|
||||
name="components"
|
||||
icon_type="components"
|
||||
label="{{ trans('general.components') }}"
|
||||
count="{{ $company->components()->count() }}"
|
||||
tooltip="{{ trans('general.components') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
|
||||
<li class="active">
|
||||
<a href="#asset_tab" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-barcode" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.assets') }}
|
||||
{!! ($company->assets()->AssetsForShow()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($company->assets()->AssetsForShow()->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#licenses_tab" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-save"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.licenses') }}
|
||||
{!! ($company->licenses->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($company->licenses->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#accessories_tab" data-toggle="tab">
|
||||
<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 ) ? '<span class="badge badge-secondary">'.number_format($company->accessories->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#consumables_tab" data-toggle="tab">
|
||||
<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 ) ? '<span class="badge badge-secondary">'.number_format($company->consumables->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#components_tab" data-toggle="tab">
|
||||
<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 )) ? '<span class="badge badge-secondary">'.number_format($company->components->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#users_tab" data-toggle="tab">
|
||||
<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 )) ? '<span class="badge badge-secondary">'.number_format($company->users->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@can('view', \App\Models\User::class)
|
||||
<x-tabs.nav-item
|
||||
name="users"
|
||||
icon_type="users"
|
||||
label="{{ trans('general.users') }}"
|
||||
count="{{ $company->users()->count() }}"
|
||||
tooltip="{{ trans('general.users') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade in active" id="asset_tab">
|
||||
<!-- checked out assets table -->
|
||||
@include('partials.asset-bulk-actions')
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="assetsListingTable"
|
||||
data-id-table="assetsListingTable"
|
||||
data-side-pagination="server"
|
||||
data-show-columns-search="true"
|
||||
data-sort-order="asc"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
id="assetsListingTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.assets.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div><!-- /asset_tab -->
|
||||
|
||||
<div class="tab-pane" id="licenses_tab">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="licensesTable"
|
||||
data-id-table="licensesTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="licensesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.licenses.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-licenses-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div><!-- /licenses-tab -->
|
||||
|
||||
<div class="tab-pane" id="accessories_tab">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="accessoriesTable"
|
||||
data-id-table="accessoriesTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="accessoriesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.accessories.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-accessories-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div><!-- /accessories-tab -->
|
||||
|
||||
<div class="tab-pane" id="consumables_tab">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="consumablesTable"
|
||||
data-id-table="consumablesTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="consumablesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.consumables.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-consumables-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div><!-- /consumables-tab -->
|
||||
|
||||
<div class="tab-pane" id="components_tab">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="componentsTable"
|
||||
data-id-table="componentsTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="componentsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.components.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-components-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
|
||||
</table>
|
||||
|
||||
</div><!-- /consumables-tab -->
|
||||
|
||||
<div class="tab-pane" id="users_tab">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="usersTable"
|
||||
data-id-table="usersTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="usersTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.users.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-users-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div><!-- /consumables-tab -->
|
||||
@can('update', $company)
|
||||
<x-tabs.nav-item-upload />
|
||||
@endcan
|
||||
|
||||
|
||||
</x-slot:tabnav>
|
||||
|
||||
<x-slot:tabpanes>
|
||||
|
||||
<!-- start assets tab pane -->
|
||||
@can('view', \App\Models\Asset::class)
|
||||
<x-tabs.pane name="assets" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.assets') }}
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:bulkactions>
|
||||
<x-table.bulk-assets />
|
||||
</x-slot:bulkactions>
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
show_column_search="true"
|
||||
show_advanced_search="true"
|
||||
buttons="assetButtons"
|
||||
api_url="{{ route('api.assets.index', ['company_id' => $company->id]) }}"
|
||||
:presenter="\App\Presenters\AssetPresenter::dataTableLayout()"
|
||||
export_filename="export-company-{{ str_slug($company->name) }}-assets-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
<!-- end assets tab pane -->
|
||||
@endcan
|
||||
|
||||
|
||||
</div><!-- /.tab-content -->
|
||||
</div><!-- nav-tabs-custom -->
|
||||
</x-box>
|
||||
<!-- start licenses tab pane -->
|
||||
@can('view', \App\Models\License::class)
|
||||
<x-tabs.pane name="licenses">
|
||||
<x-slot:header>
|
||||
{{ trans('general.licenses') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
name="licenses"
|
||||
buttons="licenseButtons"
|
||||
api_url="{{ route('api.licenses.index', ['company_id' => $company->id]) }}"
|
||||
:presenter="\App\Presenters\LicensePresenter::dataTableLayout()"
|
||||
export_filename="export-company-{{ str_slug($company->name) }}-licences-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end licenses tab pane -->
|
||||
|
||||
|
||||
<!-- start accessory tab pane -->
|
||||
@can('view', \App\Models\Accessory::class)
|
||||
<x-tabs.pane name="accessories">
|
||||
<x-slot:header>
|
||||
{{ trans('general.accessories') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
name="accessories"
|
||||
buttons="accessoryButtons"
|
||||
api_url="{{ route('api.accessories.index', ['company_id' => $company->id]) }}"
|
||||
:presenter="\App\Presenters\AccessoryPresenter::dataTableLayout()"
|
||||
export_filename="export-company-{{ str_slug($company->name) }}-accessories-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end accessory tab pane -->
|
||||
|
||||
|
||||
<!-- start consumables tab pane -->
|
||||
@can('view', \App\Models\Consumable::class)
|
||||
<x-tabs.pane name="consumables">
|
||||
<x-slot:header>
|
||||
{{ trans('general.consumables') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
name="consumables"
|
||||
buttons="consumableButtons"
|
||||
api_url="{{ route('api.consumables.index', ['company_id' => $company->id]) }}"
|
||||
:presenter="\App\Presenters\ConsumablePresenter::dataTableLayout()"
|
||||
export_filename="export-company-{{ str_slug($company->name) }}-consumables-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end components tab pane -->
|
||||
|
||||
|
||||
<!-- start components tab pane -->
|
||||
@can('view', \App\Models\Component::class)
|
||||
<x-tabs.pane name="components">
|
||||
<x-slot:header>
|
||||
{{ trans('general.components') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
name="components"
|
||||
buttons="componentButtons"
|
||||
api_url="{{ route('api.components.index', ['company_id' => $company->id]) }}"
|
||||
:presenter="\App\Presenters\ComponentPresenter::dataTableLayout()"
|
||||
export_filename="export-company-{{ str_slug($company->name) }}-components-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end components tab pane -->
|
||||
|
||||
|
||||
<!-- start user tab pane -->
|
||||
@can('view', \App\Models\User::class)
|
||||
<x-tabs.pane name="users">
|
||||
<x-slot:header>
|
||||
{{ trans('general.users') }}
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:bulkactions>
|
||||
<x-table.bulk-users />
|
||||
</x-slot:bulkactions>
|
||||
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
name="users"
|
||||
buttons="userButtons"
|
||||
api_url="{{ route('api.users.index', ['company_id' => $company->id]) }}"
|
||||
:presenter="\App\Presenters\UserPresenter::dataTableLayout()"
|
||||
export_filename="export-company-{{ str_slug($company->name) }}-users-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end accessory tab pane -->
|
||||
|
||||
</x-slot:tabpanes>
|
||||
|
||||
</x-tabs>
|
||||
|
||||
</x-page-column>
|
||||
<x-page-column class="col-md-3">
|
||||
<x-box>
|
||||
<x-box.info-panel :infoPanelObj="$company" img_path="{{ app('companies_upload_url') }}">
|
||||
|
||||
<x-slot:before_list>
|
||||
@can('update', $company)
|
||||
@if ($company->deleted_at=='')
|
||||
<a href="{{ route('companies.edit', ['company' => $company->id]) }}" class="btn btn-block btn-sm btn-warning btn-social">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('general.update') }}
|
||||
</a>
|
||||
@else
|
||||
<a class="btn btn-block btn-sm btn-warning btn-social disabled">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('general.update') }}
|
||||
</a>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
|
||||
@can('delete', $company)
|
||||
|
||||
@if ($company->deleted_at=='')
|
||||
@if ($company->isDeletable())
|
||||
<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' => $company->name]) }}" data-target="#dataConfirmModal">
|
||||
<x-icon type="delete" /> {{ trans('general.delete') }}
|
||||
</button>
|
||||
@else
|
||||
<div data-placement="top" data-tooltip="true" data-title="{{ trans('general.cannot_be_deleted') }}" style="padding-top: 5px; padding-bottom: 5px;">
|
||||
<a href="#" class="btn btn-block btn-sm btn-danger btn-social hidden-print disabled" data-tooltip="true">
|
||||
<x-icon type="delete" /> {{ trans('general.delete') }}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
@endcan
|
||||
|
||||
</x-slot:before_list>
|
||||
|
||||
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
|
||||
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
|
||||
@section('content')
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('fields.index') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/custom_fields/general.create_fieldset') ,
|
||||
'updateText' => trans('admin/custom_fields/general.update_fieldset'),
|
||||
'helpText' => trans('admin/custom_fields/general.about_fieldsets_text'),
|
||||
'helpPosition' => 'right',
|
||||
'formAction' => (isset($item->id)) ? route('fieldsets.update', ['fieldset' => $item->id]) : route('fieldsets.store'),
|
||||
])
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')])
|
||||
@stop
|
||||
|
||||
|
||||
@@ -6,172 +6,183 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('fields.index') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ $custom_fieldset->name }} {{ trans('admin/custom_fields/general.fieldset') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<table id="sort" class="table table-responsive table-striped snipe-table table-no-bordered todo-list">
|
||||
<thead>
|
||||
<tr>
|
||||
{{-- Hide the sorting handle if we can't update the fieldset --}}
|
||||
@can('update', $custom_fieldset)
|
||||
<th class="col-md-1"><span class="sr-only">{{ trans('admin/custom_fields/general.reorder') }}</span></th>
|
||||
@endcan
|
||||
<th class="col-md-1" style="display: none;">{{ trans('admin/custom_fields/general.order') }}</th>
|
||||
<th class="col-md-3">{{ trans('admin/custom_fields/general.field_name') }}</th>
|
||||
<th class="col-md-2">{{ trans('admin/custom_fields/general.field_format') }}</th>
|
||||
<th class="col-md-2">{{ trans('admin/custom_fields/general.field_element') }}</th>
|
||||
<th class="col-md-1">{{ trans('admin/custom_fields/general.encrypted') }}</th>
|
||||
<th class="col-md-1">{{ trans('admin/custom_fields/general.required') }}</th>
|
||||
<th class="col-md-1"><span class="sr-only">{{ trans('button.remove') }}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($custom_fieldset->fields as $field)
|
||||
<tr class="{{ Auth::user()->can('update', $custom_fieldset)?'cansort':'' }}" data-index="{{ $field->pivot->custom_field_id }}" id="item_{{ $field->pivot->custom_field_id }}">
|
||||
{{-- Hide the sorting handle if we can't update the fieldset --}}
|
||||
@can('update', $custom_fieldset)
|
||||
<td>
|
||||
<!-- drag handle -->
|
||||
<span class="handle">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</span>
|
||||
</td>
|
||||
@endcan
|
||||
<td class="index" style="display: none;">{{$field->pivot->order + 1}}</td> {{--this +1 needs to exist to keep the first row from reverting to 0 if you edit/delete fields in/from a fielset--}}
|
||||
<td>{{$field->name}}</td>
|
||||
<td>{{$field->format}}</td>
|
||||
<td>{{$field->element}}</td>
|
||||
<td>{{ $field->field_encrypted=='1' ? trans('general.yes') : trans('general.no') }}</td>
|
||||
<td>
|
||||
|
||||
@if ($field->pivot->required)
|
||||
<form method="post" action="{{ route('fields.optional', [$custom_fieldset->id, $field->id]) }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link"><i class="fa fa-check text-success" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
|
||||
@else
|
||||
|
||||
<form method="post" action="{{ route('fields.required', [$custom_fieldset->id, $field->id]) }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link"><i class="fa fa-times text-danger" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
</td>
|
||||
<td>
|
||||
@can('update', $custom_fieldset)
|
||||
<form method="post" action="{{ route('fields.disassociate', [$field, $custom_fieldset->id]) }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-sm btn-danger" data-tooltip="true" title="{{ trans('general.remove_customfield_association') }}"><i class="fa fa-minus icon-white" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@can('update', $custom_fieldset)
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<form method="POST" action="{{ route('fieldsets.associate', $custom_fieldset->id) }}" accept-charset="UTF-8" class="form-inline" id="ordering">
|
||||
@csrf
|
||||
|
||||
<x-container>
|
||||
<x-box>
|
||||
<x-form :item="$custom_fieldset" route="{{ (isset($custom_fieldset->id)) ? route('fieldsets.update', ['fieldset' => $custom_fieldset->id]) : route('fieldsets.store') }}">
|
||||
<!-- Name -->
|
||||
<div class="form-group">
|
||||
<label for="field_id" class="sr-only">
|
||||
{{ trans('admin/custom-field/general.add_field_to_fieldset')}}
|
||||
</label>
|
||||
<x-input.select
|
||||
name="field_id"
|
||||
:options="$custom_fields_list"
|
||||
style="min-width:400px"
|
||||
aria-label="field_id"
|
||||
/>
|
||||
<x-form.label for="name" class="col-md-3">
|
||||
{{ trans('general.name') }}
|
||||
</x-form.label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="name" value="{{ $custom_fieldset->name }}" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<button class="btn btn-success">{{ trans('general.update') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</x-form>
|
||||
|
||||
<div class="form-group" style="display: none;">
|
||||
<input aria-label="order" maxlength="3" size="3" name="order" type="text" value="{{ $maxid }}">
|
||||
<label for="order">{{ trans('admin/custom_fields/general.order') }}</label>
|
||||
</div>
|
||||
@if((isset($custom_fieldset)) && ($custom_fieldset->id!=''))
|
||||
<table id="sort" class="table table-responsive table-striped snipe-table table-no-bordered todo-list" style="padding-top: 30px">
|
||||
<thead>
|
||||
<tr>
|
||||
{{-- Hide the sorting handle if we can't update the fieldset --}}
|
||||
@can('update', $custom_fieldset)
|
||||
<th class="col-md-1"><span class="sr-only">{{ trans('admin/custom_fields/general.reorder') }}</span></th>
|
||||
@endcan
|
||||
<th class="col-md-1" style="display: none;">{{ trans('admin/custom_fields/general.order') }}</th>
|
||||
<th class="col-md-3">{{ trans('admin/custom_fields/general.field_name') }}</th>
|
||||
<th class="col-md-2">{{ trans('admin/custom_fields/general.field_format') }}</th>
|
||||
<th class="col-md-2">{{ trans('admin/custom_fields/general.field_element') }}</th>
|
||||
<th class="col-md-1">{{ trans('admin/custom_fields/general.encrypted') }}</th>
|
||||
<th class="col-md-1">{{ trans('admin/custom_fields/general.required') }}</th>
|
||||
<th class="col-md-1"><span class="sr-only">{{ trans('button.remove') }}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($custom_fieldset->fields as $field)
|
||||
<tr class="{{ Auth::user()->can('update', $custom_fieldset)?'cansort':'' }}" data-index="{{ $field->pivot->custom_field_id }}" id="item_{{ $field->pivot->custom_field_id }}">
|
||||
{{-- Hide the sorting handle if we can't update the fieldset --}}
|
||||
@can('update', $custom_fieldset)
|
||||
<td>
|
||||
<!-- drag handle -->
|
||||
<span class="handle">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</span>
|
||||
</td>
|
||||
@endcan
|
||||
<td class="index" style="display: none;">{{$field->pivot->order + 1}}</td> {{--this +1 needs to exist to keep the first row from reverting to 0 if you edit/delete fields in/from a fielset--}}
|
||||
<td>{{$field->name}}</td>
|
||||
<td>{{$field->format}}</td>
|
||||
<td>{{$field->element}}</td>
|
||||
<td>{{ $field->field_encrypted=='1' ? trans('general.yes') : trans('general.no') }}</td>
|
||||
<td>
|
||||
|
||||
<div class="checkbox-inline">
|
||||
<label>
|
||||
<input type="checkbox" name="required" value="on" @checked(old('required'))>
|
||||
<span style="padding-left: 10px;">{{ trans('admin/custom_fields/general.required') }}</span>
|
||||
</label>
|
||||
</div>
|
||||
@if ($field->pivot->required)
|
||||
<form method="post" action="{{ route('fields.optional', [$custom_fieldset->id, $field->id]) }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link"><i class="fa fa-check text-success" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
|
||||
<span style="padding-left: 10px;">
|
||||
<button type="submit" class="btn btn-primary"> {{ trans('general.save') }}</button>
|
||||
</span>
|
||||
@else
|
||||
|
||||
</form>
|
||||
<form method="post" action="{{ route('fields.required', [$custom_fieldset->id, $field->id]) }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link"><i class="fa fa-times text-danger" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@endcan
|
||||
</table>
|
||||
</div> <!-- /.box-body-->
|
||||
</div> <!-- /.box.box-default-->
|
||||
</div> <!-- /.col-md-12-->
|
||||
</div> <!--/.row-->
|
||||
</td>
|
||||
<td>
|
||||
@can('update', $custom_fieldset)
|
||||
<form method="post" action="{{ route('fields.disassociate', [$field, $custom_fieldset->id]) }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-sm btn-danger" data-tooltip="true" title="{{ trans('general.remove_customfield_association') }}"><i class="fa fa-minus icon-white" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
@can('update', $custom_fieldset)
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<form method="POST" action="{{ route('fieldsets.associate', $custom_fieldset->id) }}" accept-charset="UTF-8" class="form-inline" id="ordering">
|
||||
@csrf
|
||||
|
||||
<div class="form-group">
|
||||
<label for="field_id" class="sr-only">
|
||||
{{ trans('admin/custom-field/general.add_field_to_fieldset')}}
|
||||
</label>
|
||||
<x-input.select
|
||||
name="field_id"
|
||||
:options="$custom_fields_list"
|
||||
style="min-width:400px"
|
||||
aria-label="field_id"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="display: none;">
|
||||
<input aria-label="order" maxlength="3" size="3" name="order" type="text" value="{{ $maxid }}">
|
||||
<label for="order">{{ trans('admin/custom_fields/general.order') }}</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-inline">
|
||||
<label>
|
||||
<input type="checkbox" name="required" value="on" @checked(old('required'))>
|
||||
<span style="padding-left: 10px;">{{ trans('admin/custom_fields/general.required') }}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<span style="padding-left: 10px;">
|
||||
<button type="submit" class="btn btn-primary"> {{ trans('general.save') }}</button>
|
||||
</span>
|
||||
|
||||
</form>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@endcan
|
||||
</table>
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
</x-box>
|
||||
</x-container>
|
||||
|
||||
@stop
|
||||
|
||||
@push('js')
|
||||
@can('update', $custom_fieldset)
|
||||
@if((isset($custom_fieldset)) && ($custom_fieldset->id!=''))
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
var fixHelperModified = function(e, tr) {
|
||||
var $originals = tr.children();
|
||||
var $helper = tr.clone();
|
||||
$helper.children().each(function(index) {
|
||||
$(this).width($originals.eq(index).width())
|
||||
});
|
||||
return $helper;
|
||||
},
|
||||
updateIndex = function(e, ui) {
|
||||
$('td.index', ui.item.parent()).each(function (i) {
|
||||
$(this).html(i + 1);
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ route('api.customfields.order', $custom_fieldset->id) }}",
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: $("#sort tbody").sortable('serialize', {
|
||||
}),
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
var fixHelperModified = function(e, tr) {
|
||||
var $originals = tr.children();
|
||||
var $helper = tr.clone();
|
||||
$helper.children().each(function(index) {
|
||||
$(this).width($originals.eq(index).width())
|
||||
});
|
||||
return $helper;
|
||||
},
|
||||
updateIndex = function(e, ui) {
|
||||
$('td.index', ui.item.parent()).each(function (i) {
|
||||
$(this).html(i + 1);
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ route('api.customfields.order', $custom_fieldset->id) }}",
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: $("#sort tbody").sortable('serialize', {
|
||||
}),
|
||||
|
||||
success: function(data) {
|
||||
//console.log('ajax fired');
|
||||
// do some stuff here
|
||||
success: function(data) {
|
||||
//console.log('ajax fired');
|
||||
// do some stuff here
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// this uses the jquery UI sortable method, NOT the query-dragtable library
|
||||
$("#sort tbody").sortable({
|
||||
helper: fixHelperModified,
|
||||
stop: updateIndex
|
||||
}).disableSelection();
|
||||
</script>
|
||||
// this uses the jquery UI sortable method, NOT the query-dragtable library
|
||||
$("#sort tbody").sortable({
|
||||
helper: fixHelperModified,
|
||||
stop: updateIndex
|
||||
}).disableSelection();
|
||||
</script>
|
||||
@endif
|
||||
@endcan
|
||||
@endpush
|
||||
|
||||
@@ -19,11 +19,6 @@
|
||||
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('admin/custom_fields/general.fieldsets') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
@can('create', \App\Models\CustomFieldset::class)
|
||||
<a href="{{ route('fieldsets.create') }}" class="btn btn-sm btn-theme" data-tooltip="true" title="{{ trans('admin/custom_fields/general.create_fieldset_title') }}">{{ trans('admin/custom_fields/general.create_fieldset') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
<div class="box-body">
|
||||
@@ -73,13 +68,8 @@
|
||||
|
||||
@can('update', $fieldset)
|
||||
|
||||
<a href="{{ route('fieldsets.show', ['fieldset' => $fieldset->id]) }}" data-tooltip="true" title="{{ trans('general.edit_fieldset') }}">
|
||||
<button type="submit" class="btn btn-info btn-sm">
|
||||
<i class="fa-regular fa-rectangle-list"></i>
|
||||
</button>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('fieldsets.edit', $fieldset->id) }}" class="btn btn-warning btn-sm" data-tooltip="true" title="{{ trans('general.update') }}">
|
||||
<a href="{{ route('fieldsets.show', $fieldset->id) }}" class="btn btn-warning btn-sm" data-tooltip="true" title="{{ trans('general.update') }}">
|
||||
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.edit') }}</span>
|
||||
</a>
|
||||
@@ -114,12 +104,6 @@
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('admin/custom_fields/general.custom_fields') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
@can('create', \App\Models\CustomField::class)
|
||||
<a href="{{ route('fields.create') }}" class="btn btn-sm btn-theme" data-tooltip="true" title="{{ trans('admin/custom_fields/general.create_field_title') }}">{{ trans('admin/custom_fields/general.create_field') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
|
||||
|
||||
@@ -235,6 +235,8 @@
|
||||
data-id-table="dashActivityReport"
|
||||
data-sort-order="desc"
|
||||
data-show-columns="false"
|
||||
data-fixed-number="false"
|
||||
data-fixed-right-number="false"
|
||||
data-sort-name="created_at"
|
||||
id="dashActivityReport"
|
||||
class="table table-striped snipe-table"
|
||||
@@ -311,6 +313,8 @@
|
||||
data-side-pagination="server"
|
||||
data-sort-order="desc"
|
||||
data-show-columns="false"
|
||||
data-fixed-number="false"
|
||||
data-fixed-right-number="false"
|
||||
data-sort-field="assets_count"
|
||||
id="dashCompanySummary"
|
||||
class="table table-striped snipe-table"
|
||||
@@ -378,6 +382,8 @@
|
||||
data-side-pagination="server"
|
||||
data-pagination="false"
|
||||
data-sort-order="desc"
|
||||
data-fixed-number="false"
|
||||
data-fixed-right-number="false"
|
||||
data-sort-field="assets_count"
|
||||
id="dashLocationSummary"
|
||||
data-show-columns="false"
|
||||
@@ -440,6 +446,8 @@
|
||||
data-pagination="false"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="false"
|
||||
data-fixed-number="false"
|
||||
data-fixed-right-number="false"
|
||||
data-sort-order="desc"
|
||||
data-sort-field="assets_count"
|
||||
id="dashCategorySummary"
|
||||
|
||||
@@ -9,33 +9,69 @@
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('departments.edit', ['department' => $department->id]) }}" class="btn btn-sm btn-theme pull-right">{{ trans('general.update') }} </a>
|
||||
@stop
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button" data-tooltip="true" title="{{ trans('button.show_hide_info') }}"></i>
|
||||
@endsection
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<x-container>
|
||||
<x-container columns="2">
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
<x-box>
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="departmentsUsersTable"
|
||||
data-id-table="departmentsUsersTable"
|
||||
data-show-footer="true"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
id="departmentsUsersTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.users.index',['department_id'=> $department->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-departments-{{ str_slug($department->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
<x-slot:bulkactions>
|
||||
<x-table.bulk-users />
|
||||
</x-slot:bulkactions>
|
||||
|
||||
<x-table
|
||||
show_column_search="true"
|
||||
show_advanced_search="true"
|
||||
fixed_right_number="1"
|
||||
fixed_number="2"
|
||||
buttons="licenseButtons"
|
||||
api_url="{{ route('api.users.index', ['department_id' => $department->id]) }}"
|
||||
:presenter="\App\Presenters\UserPresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($department->name) }}-users-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-box>
|
||||
</x-container>
|
||||
|
||||
</x-page-column>
|
||||
|
||||
<x-page-column class="col-md-3">
|
||||
<x-box>
|
||||
<x-box.info-panel :infoPanelObj="$department" img_path="{{ app('users_upload_url') }}">
|
||||
|
||||
<x-slot:before_list>
|
||||
|
||||
@can('update', \App\Models\Department::class)
|
||||
<a href="{{ ($department->deleted_at=='') ? route('departments.edit', $department->id) : '#' }}" class="btn btn-block btn-sm btn-warning btn-social hidden-print{{ ($department->deleted_at!='') ? ' disabled' : '' }}">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('general.update') }}
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('delete', \App\Models\Department::class)
|
||||
|
||||
@if ($department->users()->count() > 0)
|
||||
<button 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') }}">
|
||||
<x-icon type="delete" />
|
||||
{{ 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.department')]) }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $department->name]) }}" data-target="#dataConfirmModal" data-tooltip="true" data-icon="fa fa-trash" data-placement="top" data-title="{{ trans('general.delete_what', ['item'=> trans('general.department')]) }}" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
</x-slot:before_list>
|
||||
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
</x-page-column>
|
||||
|
||||
|
||||
</x-container>
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
@@ -9,161 +9,169 @@
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<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('depreciations.edit', ['depreciation' => $depreciation->id]) }}">{{ trans('general.update') }}</a></li>
|
||||
<li><a href="{{ route('depreciations.create') }}">{{ trans('general.create') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@stop
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button" data-tooltip="true" title="{{ trans('button.show_hide_info') }}"></i>
|
||||
@endsection
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
<!-- Custom Tabs -->
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<x-container columns="2">
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
@can('view', \App\Models\Asset::class)
|
||||
<li class="active">
|
||||
<a href="#assets" data-toggle="tab">
|
||||
{{ trans('general.assets') }}
|
||||
|
||||
{!! ($depreciation->assets()->AssetsForShow()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($depreciation->assets()->AssetsForShow()->count()).'</span>' : '' !!}
|
||||
</a>
|
||||
</li>
|
||||
<x-tabs.nav-item
|
||||
class="active"
|
||||
name="assets"
|
||||
icon_type="asset"
|
||||
label="{{ trans('general.assets') }}"
|
||||
count="{{ $depreciation->assets()->AssetsForShow()->count() }}"
|
||||
tooltip="{{ trans('general.assets') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@can('view', \App\Models\License::class)
|
||||
<li>
|
||||
<a href="#licenses" data-toggle="tab">
|
||||
{{ trans('general.licenses') }}
|
||||
|
||||
{!! ($depreciation->licenses_count > 0 ) ? '<span class="badge badge-secondary">'.number_format($depreciation->licenses_count).'</span>' : '' !!}
|
||||
</a>
|
||||
</li>
|
||||
<x-tabs.nav-item
|
||||
name="licenses"
|
||||
icon_type="licenses"
|
||||
label="{{ trans('general.licenses') }}"
|
||||
count="{{ $depreciation->licenses()->count() }}"
|
||||
tooltip="{{ trans('general.licenses') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@can('view', \App\Models\AssetModel::class)
|
||||
<li>
|
||||
<a href="#models" data-toggle="tab">
|
||||
{{ trans('general.asset_models') }}
|
||||
|
||||
{!! ($depreciation->models_count > 0 ) ? '<span class="badge badge-secondary">'.number_format($depreciation->models_count).'</span>' : '' !!}
|
||||
</a>
|
||||
</li>
|
||||
<x-tabs.nav-item
|
||||
name="models"
|
||||
icon="fa-solid fa-boxes-packing"
|
||||
label="{{ trans('general.asset_models') }}"
|
||||
count="{{ $depreciation->models_count }}"
|
||||
tooltip="{{ trans('general.asset_models') }}"
|
||||
/>
|
||||
@endcan
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
</x-slot:tabnav>
|
||||
|
||||
<div class="tab-pane active" id="assets">
|
||||
<x-slot:tabpanes>
|
||||
|
||||
@include('partials.asset-bulk-actions', [
|
||||
'id_divname' => 'assetsBulkEditToolbar',
|
||||
'id_formname' => 'assetsBulkForm',
|
||||
'id_button' => 'assetEditButton'
|
||||
])
|
||||
<!-- start assets tab pane -->
|
||||
@can('view', \App\Models\Asset::class)
|
||||
<x-tabs.pane name="assets" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.assets') }}
|
||||
</x-slot:header>
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-show-columns-search="true"
|
||||
data-cookie-id-table="depreciationsAssetTable"
|
||||
data-id-table="depreciationsAssetTable"
|
||||
id="depreciationsAssetTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#assetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.assets.index',['depreciation_id'=> $depreciation->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-depreciations-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
<x-slot:bulkactions>
|
||||
<x-table.bulk-assets />
|
||||
</x-slot:bulkactions>
|
||||
|
||||
</div> <!-- end tab-pane -->
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
show_column_search="true"
|
||||
show_advanced_search="true"
|
||||
buttons="assetButtons"
|
||||
api_url="{{ route('api.assets.index', ['depreciation_id' => $depreciation->id]) }}"
|
||||
:presenter="\App\Presenters\AssetPresenter::dataTableLayout()"
|
||||
export_filename="export-depreciation-{{ str_slug($depreciation->name) }}-assets-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
<!-- end assets tab pane -->
|
||||
@endcan
|
||||
|
||||
<!-- tab-pane -->
|
||||
<div class="tab-pane" id="licenses">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="depreciationsLicenseTable"
|
||||
data-id-table="depreciationsLicenseTable"
|
||||
id="depreciationsLicenseTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.licenses.index',['depreciation_id'=> $depreciation->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-depreciations-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div> <!--/.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
<!-- start licenses tab pane -->
|
||||
@can('view', \App\Models\License::class)
|
||||
<x-tabs.pane name="licenses">
|
||||
<x-slot:header>
|
||||
{{ trans('general.licenses') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
name="licenses"
|
||||
buttons="licenseButtons"
|
||||
api_url="{{ route('api.licenses.index', ['depreciation_id' => $depreciation->id]) }}"
|
||||
:presenter="\App\Presenters\LicensePresenter::dataTableLayout()"
|
||||
export_filename="export-depreciation-{{ str_slug($depreciation->name) }}-licences-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end licenses tab pane -->
|
||||
|
||||
<!-- tab-pane -->
|
||||
<div class="tab-pane" id="models">
|
||||
|
||||
<div class="row">
|
||||
<form method="POST" action="{{ route('models.bulkedit.index') }}" accept-charset="UTF-8" class="form-inline" id="bulkForm">
|
||||
@csrf
|
||||
<div class="col-md-12">
|
||||
|
||||
@include('partials.models-bulk-actions', [
|
||||
'id_divname' => 'assetModelsBulkEditToolbar',
|
||||
'id_formname' => 'assetModelsBulkForm',
|
||||
'id_button' => 'AssetModelsBulkEditButton'
|
||||
])
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="depreciationsModelsTable"
|
||||
data-id-table="depreciationsModelsTable"
|
||||
id="depreciationsModelsTable"
|
||||
data-toolbar="#toolbar"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
data-bulk-button-id="#AssetModelsBulkEditButton"
|
||||
data-bulk-form-id="#bulkForm"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.models.index',['depreciation_id'=> $depreciation->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-depreciations-bymodel-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div> <!--/.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
|
||||
</div> <!-- /.tab-content -->
|
||||
<!-- start models tab pane -->
|
||||
@can('view', \App\Models\AssetModel::class)
|
||||
<x-tabs.pane name="models">
|
||||
<x-slot:header>
|
||||
{{ trans('general.models') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
name="models"
|
||||
buttons="modelButtons"
|
||||
api_url="{{ route('api.models.index', ['depreciation_id' => $depreciation->id]) }}"
|
||||
:presenter="\App\Presenters\AssetModelPresenter::dataTableLayout()"
|
||||
export_filename="export-depreciation-{{ str_slug($depreciation->name) }}-models-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end licenses tab pane -->
|
||||
|
||||
|
||||
|
||||
</div> <!-- /.tab-content -->
|
||||
</div> <!-- nav-tabs-custom -->
|
||||
</x-slot:tabpanes>
|
||||
|
||||
</x-tabs>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</x-page-column>
|
||||
<x-page-column class="col-md-3">
|
||||
<x-box>
|
||||
<x-box.info-panel :infoPanelObj="$depreciation">
|
||||
|
||||
<x-slot:before_list>
|
||||
|
||||
@can('update', $depreciation)
|
||||
@if ($depreciation->deleted_at=='')
|
||||
<a href="{{ route('depreciations.edit', ['depreciation' => $depreciation->id]) }}" class="btn btn-block btn-sm btn-warning btn-social">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('general.update') }}
|
||||
</a>
|
||||
@else
|
||||
<a class="btn btn-block btn-sm btn-warning btn-social disabled">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('general.update') }}
|
||||
</a>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@can('delete', $depreciation)
|
||||
|
||||
@if ($depreciation->deleted_at=='')
|
||||
@if ($depreciation->isDeletable())
|
||||
<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' => $depreciation->name]) }}" data-target="#dataConfirmModal">
|
||||
<x-icon type="delete" /> {{ trans('general.delete') }}
|
||||
</button>
|
||||
@else
|
||||
<div data-placement="top" data-tooltip="true" data-title="{{ trans('general.cannot_be_deleted') }}" style="padding-top: 5px; padding-bottom: 5px;">
|
||||
<a href="#" class="btn btn-block btn-sm btn-danger btn-social hidden-print disabled" data-tooltip="true">
|
||||
<x-icon type="delete" /> {{ trans('general.delete') }}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
@endcan
|
||||
|
||||
</x-slot:before_list>
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
|
||||
</x-page-column>
|
||||
|
||||
</x-container>
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
data-fixed-number="2"
|
||||
data-fixed-right-number="2"
|
||||
data-search-text="{{ session()->get('search') }}"
|
||||
data-show-columns-search="true"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="kitsTable"
|
||||
data-fixed-number="1"
|
||||
data-fixed-right-number="2"
|
||||
class="table table-striped snipe-table"
|
||||
data-buttons="kitButtons"
|
||||
data-url="{{ route('api.kits.index') }}"
|
||||
|
||||
@@ -216,6 +216,7 @@
|
||||
{
|
||||
background-color: var(--table-stripe-bg) !important;
|
||||
color: var(--color-fg) !important;
|
||||
border-color: var(--text-help);
|
||||
|
||||
}
|
||||
|
||||
@@ -290,27 +291,26 @@
|
||||
}
|
||||
|
||||
|
||||
input[type="text"]:focus,
|
||||
input[type="url"]:focus,
|
||||
input[type="date"]:focus,
|
||||
input[type="email"]:focus,
|
||||
input[type="number"]:focus,
|
||||
input[type="password"]:focus,
|
||||
input[type="*"]:focus,
|
||||
textarea:focus
|
||||
{
|
||||
border-color: hsl(from var(--main-theme-color) h s calc(l - 5)) !important;
|
||||
}
|
||||
|
||||
*:disabled,
|
||||
input[type="*"]:disabled,
|
||||
input[type=checkbox]:disabled,
|
||||
input[type=radio]:disabled,
|
||||
input[readonly],
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single,
|
||||
.select2-container--default.select2-container--disabled .select2-selection__rendered,
|
||||
textarea[readonly]
|
||||
{
|
||||
background-color: light-dark(rgb(234, 232, 232), rgb(117, 116, 117)) !important;
|
||||
border: 1px solid light-dark(rgb(234, 232, 232), rgb(117, 116, 117)) !important;
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
input[type="search"].search-highlight {
|
||||
background-color: var(--search-highlight);
|
||||
border: 1px solid hsl(from var(--search-highlight) h s calc(l - 20)) !important;
|
||||
@@ -539,7 +539,7 @@
|
||||
{
|
||||
background-color: var(--table-stripe-bg) !important;
|
||||
border-top: var(--table-border-row-top) !important;
|
||||
color: var(--nav-primary-text-color) !important;
|
||||
color: var(--color-fg) !important;
|
||||
}
|
||||
|
||||
.table-striped > tbody > tr:nth-of-type(odd),
|
||||
@@ -549,6 +549,7 @@
|
||||
{
|
||||
background-color: var(--table-stripe-bg-alt) !important;
|
||||
border-top: var(--table-border-row-top) !important;
|
||||
color: var(--color-fg) !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -685,6 +686,10 @@
|
||||
background-color: #1e282c;
|
||||
}
|
||||
|
||||
.list-group-item.subitem {
|
||||
padding-left:20px !important;
|
||||
}
|
||||
|
||||
.sidebar-menu>li.active > a,
|
||||
.sidebar-menu>li:hover>a,
|
||||
.treeview-menu>li> a
|
||||
@@ -711,6 +716,10 @@
|
||||
}
|
||||
|
||||
|
||||
.list-group-item:first-child {
|
||||
border-top: 0 !important;
|
||||
}
|
||||
|
||||
.sidebar-menu > li > a:link,
|
||||
.sidebar-menu > li > a:visited,
|
||||
.treeview-menu>li> a
|
||||
@@ -2186,6 +2195,29 @@
|
||||
|
||||
$(function () {
|
||||
|
||||
|
||||
// Handle the info-panel
|
||||
$("#expand-info-panel-button").click(function () {
|
||||
|
||||
$('.side-box').parent('div').parent('div').parent('div').hide();
|
||||
$(window).on('load', function() {
|
||||
$('.side-box').parent('div').parent('div').parent('div').show();
|
||||
});
|
||||
|
||||
if($('.side-box').hasClass('expanded')) {
|
||||
$('.main-panel').removeClass('col-md-9').addClass('col-md-12');
|
||||
$('.side-box').removeClass('expanded');
|
||||
$("#expand-info-panel-button").addClass('fa-square-caret-left').removeClass('fa-square-caret-right');
|
||||
} else {
|
||||
$('.side-box').parent('div').parent('div').parent('div').fadeToggle("fast")
|
||||
$('.side-box').addClass('expanded');
|
||||
$('.main-panel').removeClass('col-md-12').addClass('col-md-9');
|
||||
$("#expand-info-panel-button").addClass('fa-square-caret-right').removeClass('fa-square-caret-left');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// This handles the show/hide for cloned items
|
||||
$('#use_cloned_image').click(function() {
|
||||
if ($('#use_cloned_image').is(':checked')) {
|
||||
|
||||
@@ -7,607 +7,208 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button" data-tooltip="true" title="{{ trans('button.show_hide_info') }}"></i>
|
||||
@endsection
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
|
||||
<!-- Custom Tabs -->
|
||||
<div class="nav-tabs-custom">
|
||||
|
||||
<ul class="nav nav-tabs hidden-print">
|
||||
|
||||
<li class="active">
|
||||
<a href="#details" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="info-circle" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/users/general.info') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#seats" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="seats" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.assigned') }}</span>
|
||||
<span class="badge badge-secondary">{{ number_format($license->assignedCount()->count()) }}</span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#available-seats" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="seats" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.available') }}</span>
|
||||
<span class="badge badge-secondary">{{ number_format($license->availCount()->count()) }}</span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@can('licenses.files', $license)
|
||||
<li>
|
||||
<a href="#files" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="files" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($license->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($license->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
<li>
|
||||
<a href="#history" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<x-icon type="history" class="fa-2x" />
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.history') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@can('update', \App\Models\License::class)
|
||||
<li class="pull-right"><a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<x-icon type="paperclip" /> {{ trans('button.upload') }}</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane active" id="details">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="container row-new-striped">
|
||||
|
||||
@if (!is_null($license->company))
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('general.company') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $license->company->present()->formattedNameLink !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->manufacturer)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('admin/hardware/form.manufacturer') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $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>
|
||||
@endif
|
||||
|
||||
@if ($license->manufacturer->support_url)
|
||||
<br><x-icon type="more-info" />
|
||||
<a href="{{ $license->manufacturer->support_url }}" rel="noopener">{{ $license->manufacturer->support_url }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->manufacturer->support_phone)
|
||||
<br><x-icon type="phone" />
|
||||
<a href="tel:{{ $license->manufacturer->support_phone }}">{{ $license->manufacturer->support_phone }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->manufacturer->support_email)
|
||||
<br><x-icon type="email" /> <a href="mailto:{{ $license->manufacturer->support_email }}">{{ $license->manufacturer->support_email }}</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<x-container columns="2">
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
|
||||
|
||||
@if (!is_null($license->serial))
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('admin/licenses/form.license_key') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@can('viewKeys', $license)
|
||||
<x-tabs.nav-item
|
||||
name="seats"
|
||||
class="active"
|
||||
icon_type="checkedout"
|
||||
label="{{ trans('general.assigned') }}"
|
||||
count="{{ $license->assignedCount()->count() }}"
|
||||
/>
|
||||
|
||||
<code>
|
||||
<x-copy-to-clipboard copy_what="license_key">
|
||||
{!! nl2br(e($license->serial)) !!}
|
||||
</x-copy-to-clipboard>
|
||||
</code>
|
||||
@else
|
||||
------------
|
||||
<x-tabs.nav-item
|
||||
name="available"
|
||||
icon_type="available"
|
||||
label="{{ trans('general.available') }}"
|
||||
count="{{ $license->availCount()->count() }}"
|
||||
/>
|
||||
|
||||
<x-tabs.nav-item
|
||||
name="files"
|
||||
icon_type="files"
|
||||
label="{{ trans('general.files') }}"
|
||||
count="{{ $license->uploads()->count() }}"
|
||||
/>
|
||||
|
||||
<x-tabs.nav-item
|
||||
name="history"
|
||||
icon_type="history"
|
||||
label="{{ trans('general.history') }}"
|
||||
tooltip="{{ trans('general.history') }}"
|
||||
/>
|
||||
|
||||
|
||||
@can('update', $license)
|
||||
<x-tabs.nav-item-upload />
|
||||
@endcan
|
||||
</x-slot:tabnav>
|
||||
|
||||
<x-slot:tabpanes>
|
||||
|
||||
<x-tabs.pane name="seats" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.assigned') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
|
||||
<x-table
|
||||
api_url="{{ route('api.licenses.seats.index', [$license->id, 'status' => 'assigned']) }}"
|
||||
:presenter="\App\Presenters\LicensePresenter::dataTableLayoutSeats()"
|
||||
export_filename="export-{{ str_slug($license->name) }}-assigned-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
|
||||
|
||||
<x-tabs.pane name="available">
|
||||
<x-slot:header>
|
||||
{{ trans('general.available') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
|
||||
<x-table
|
||||
api_url="{{ route('api.licenses.seats.index', [$license->id, 'status' => 'available']) }}"
|
||||
:presenter="\App\Presenters\LicensePresenter::dataTableLayoutSeats()"
|
||||
export_filename="export-{{ str_slug($license->name) }}-available-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
|
||||
|
||||
<!-- start history tab pane -->
|
||||
<x-tabs.pane name="history">
|
||||
<x-slot:header>
|
||||
{{ trans('general.history') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
name="locationHistory"
|
||||
api_url="{{ route('api.activity.index', ['target_id' => $license->id, 'target_type' => 'license']) }}"
|
||||
:presenter="\App\Presenters\HistoryPresenter::dataTableLayout()"
|
||||
export_filename="export-licenses-{{ str_slug($license->name) }}-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
<!-- end history tab pane -->
|
||||
|
||||
|
||||
<!-- start files tab pane -->
|
||||
@can('licenses.files', $license)
|
||||
<x-tabs.pane name="files">
|
||||
<x-slot:header>
|
||||
{{ trans('general.files') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-filestable object_type="licenses" :object="$license" />
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end files tab pane -->
|
||||
|
||||
</x-slot:tabpanes>
|
||||
</x-tabs>
|
||||
</x-page-column>
|
||||
|
||||
<x-page-column class="col-md-3">
|
||||
<x-box>
|
||||
<x-box.info-panel :infoPanelObj="$license" img_path="{{ app('licenses_upload_url') }}">
|
||||
|
||||
<x-slot:before_list>
|
||||
|
||||
@can('update', $license)
|
||||
<a href="{{ route('licenses.edit', $license->id) }}" class="btn btn-warning btn-sm btn-social btn-block hidden-print" style="margin-bottom: 5px;">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('admin/licenses/general.edit') }}
|
||||
</a>
|
||||
<a href="{{ route('clone/license', $license->id) }}" class="btn btn-info btn-block btn-sm btn-social hidden-print" style="margin-bottom: 5px;">
|
||||
<x-icon type="clone" />
|
||||
{{ trans('admin/licenses/general.clone') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($license->category)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('general.category') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<a href="{{ route('categories.show', $license->category->id) }}">{{ $license->category->name }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($license->license_name!='')
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('admin/licenses/form.to_name') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->license_name }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->license_email!='')
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.to_email') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->license_email }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($license->supplier)
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('general.supplier') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@if ($license->supplier->deleted_at=='')
|
||||
{!! $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>
|
||||
@endif
|
||||
|
||||
@if ($license->supplier->phone)
|
||||
<br><x-icon type="phone" />
|
||||
<a href="tel:{{ $license->supplier->phone }}">{{ $license->supplier->phone }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->supplier->email)
|
||||
<br><x-icon type="email" /> <a href="mailto:{{ $license->supplier->email }}">{{ $license->supplier->email }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->supplier->address)
|
||||
<br>{{ $license->supplier->address }}
|
||||
@endif
|
||||
@if ($license->supplier->address2)
|
||||
<br>{{ $license->supplier->address2 }}
|
||||
@endif
|
||||
@if ($license->supplier->city)
|
||||
<br>{{ $license->supplier->city }},
|
||||
@endif
|
||||
@if ($license->supplier->state)
|
||||
{{ $license->supplier->state }}
|
||||
@endif
|
||||
@if ($license->supplier->country)
|
||||
{{ $license->supplier->country }}
|
||||
@endif
|
||||
@if ($license->supplier->zip)
|
||||
{{ $license->supplier->zip }}
|
||||
@endif
|
||||
@else
|
||||
{{ trans('general.deleted') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($license->expiration_date))
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.expiration') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@if ($license->isExpired())
|
||||
<span class="text-danger">
|
||||
<x-icon type="warning" class="text-warning" />
|
||||
</span>
|
||||
@endif
|
||||
{{ Helper::getFormattedDateObject($license->expiration_date, 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->termination_date)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.termination_date') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@if ($license->isTerminated())
|
||||
<span class="text-danger">
|
||||
<x-icon type="warning" class="text-warning" />
|
||||
</span>
|
||||
@endif
|
||||
|
||||
{{ Helper::getFormattedDateObject($license->termination_date, 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($license->depreciation)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/hardware/form.depreciation') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->depreciation->name }}
|
||||
({{ $license->depreciation->months }}
|
||||
{{ trans('admin/hardware/form.months') }}
|
||||
)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/hardware/form.depreciates_on') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ Helper::getFormattedDateObject($license->depreciated_date(), 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/hardware/form.fully_depreciated') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@if ($license->time_until_depreciated())
|
||||
@if ($license->time_until_depreciated()->y > 0)
|
||||
{{ $license->time_until_depreciated()->y }}
|
||||
{{ trans('admin/hardware/form.years') }},
|
||||
@endif
|
||||
{{ $license->time_until_depreciated()->m }}
|
||||
{{ trans('admin/hardware/form.months') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->purchase_order)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.purchase_order') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->purchase_order }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($license->purchase_date))
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('general.purchase_date') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ Helper::getFormattedDateObject($license->purchase_date, 'date', false) }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->purchase_cost > 0)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('general.purchase_cost') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $snipeSettings->default_currency }}
|
||||
{{ Helper::formatCurrencyOutput($license->purchase_cost) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->order_number)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('general.order_number') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->order_number }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.maintained') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $license->maintained ? '<i class="fas fa-check fa-fw text-success" aria-hidden="true"></i> '.trans('general.yes') : '<i class="fas fa-times fa-fw text-danger" aria-hidden="true"></i> '.trans('general.no') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (($license->seats) && ($license->seats) > 0)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.seats') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
|
||||
@if ($license->remaincount() <= ($license->min_amt - \App\Models\Setting::getSettings()->alert_threshold))
|
||||
<span data-tooltip="true" title="{{ trans('admin/licenses/general.below_threshold', ['remaining_count' => $license->remaincount(), 'min_amt' => $license->min_amt]) }}"><i class="fas fa-exclamation-triangle text-danger" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.warning') }}</span>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
{{ $license->seats }}
|
||||
@if ($license->remaincount() <= ($license->min_amt - \App\Models\Setting::getSettings()->alert_threshold))
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.reassignable') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $license->reassignable ? '<i class="fas fa-check fa-fw text-success" aria-hidden="true"></i> '.trans('general.yes') : '<i class="fas fa-times fa-fw text-danger" aria-hidden="true"></i> '.trans('general.no') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($license->notes)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('general.notes') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($license->notes)) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div> <!-- end row-striped -->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end tab-pane -->
|
||||
|
||||
|
||||
|
||||
<div class="tab-pane" id="seats">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayoutSeats() }}"
|
||||
data-cookie-id-table="seatsTable"
|
||||
data-id-table="seatsTable"
|
||||
id="seatsTable"
|
||||
data-search="false"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.licenses.seats.index', [$license->id, 'status' => 'assigned']) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-seats-{{ str_slug($license->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div> <!--/.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
|
||||
<div class="tab-pane" id="available-seats">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayoutSeats() }}"
|
||||
data-cookie-id-table="availableSeatsTable"
|
||||
data-id-table="availableSeatsTable"
|
||||
id="availableSeatsTable"
|
||||
data-search="false"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.licenses.seats.index', [$license->id, 'status' => 'available']) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-available-seats-{{ str_slug($license->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!--/.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
|
||||
@can('licenses.files', $license)
|
||||
<div class="tab-pane" id="files">
|
||||
<x-filestable object_type="licenses" :object="$license" />
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
|
||||
<div class="tab-pane" id="history">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\HistoryPresenter::dataTableLayout() }}"
|
||||
class="table table-striped snipe-table"
|
||||
data-cookie-id-table="licenseHistoryTable"
|
||||
data-id-table="licenseHistoryTable"
|
||||
id="licenseHistoryTable"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="desc"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($license->name) }}-history-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
data-url="{{ route('api.activity.index', ['item_id' => $license->id, 'item_type' => 'license']) }}">
|
||||
</table>
|
||||
</div> <!-- /.col-md-12-->
|
||||
|
||||
|
||||
</div> <!-- /.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
|
||||
</div> <!-- /.tab-content -->
|
||||
|
||||
</div> <!-- nav-tabs-custom -->
|
||||
</div> <!-- /.col -->
|
||||
<div class="col-md-3">
|
||||
|
||||
@can('update', $license)
|
||||
<a href="{{ route('licenses.edit', $license->id) }}" class="btn btn-warning btn-sm btn-social btn-block hidden-print" style="margin-bottom: 5px;">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('admin/licenses/general.edit') }}
|
||||
</a>
|
||||
<a href="{{ route('clone/license', $license->id) }}" class="btn btn-info btn-block btn-sm btn-social hidden-print" style="margin-bottom: 5px;">
|
||||
<x-icon type="clone" />
|
||||
{{ trans('admin/licenses/general.clone') }}</a>
|
||||
@endcan
|
||||
|
||||
@can('checkout', $license)
|
||||
|
||||
@if (($license->availCount()->count() > 0) && (!$license->isInactive()))
|
||||
|
||||
<a href="{{ route('licenses.checkout', $license->id) }}" class="btn bg-maroon btn-sm btn-social btn-block hidden-print" style="margin-bottom: 5px;">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('general.checkout') }}
|
||||
</a>
|
||||
|
||||
<a href="#" class="btn bg-maroon btn-sm btn-social btn-block hidden-print" style="margin-bottom: 5px;" data-toggle="modal" data-tooltip="true" title="{{ trans('admin/licenses/general.bulk.checkout_all.enabled_tooltip') }}" data-target="#checkoutFromAllModal">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('admin/licenses/general.bulk.checkout_all.button') }}
|
||||
</a>
|
||||
|
||||
@else
|
||||
<span data-tooltip="true" title="{{ ($license->availCount()->count() == 0) ? trans('admin/licenses/general.bulk.checkout_all.disabled_tooltip') : trans('admin/licenses/message.checkout.license_is_inactive') }}" class="btn bg-maroon btn-sm btn-social btn-block hidden-print disabled" style="margin-bottom: 5px;" data-tooltip="true" title="{{ trans('general.checkout') }}">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('general.checkout') }}
|
||||
</span>
|
||||
<span data-tooltip="true" title="{{ ($license->availCount()->count() == 0) ? trans('admin/licenses/general.bulk.checkout_all.disabled_tooltip') : trans('admin/licenses/message.checkout.license_is_inactive') }}" class="btn bg-maroon btn-sm btn-social btn-block hidden-print disabled" style="margin-bottom: 5px;" data-tooltip="true" title="{{ trans('general.checkout') }}">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('admin/licenses/general.bulk.checkout_all.button') }}
|
||||
</span>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@can('checkin', $license)
|
||||
|
||||
@if (($license->seats - $license->availCount()->count()) <= 0 )
|
||||
<span data-tooltip="true" title=" {{ trans('admin/licenses/general.bulk.checkin_all.disabled_tooltip') }}">
|
||||
<a href="#" class="btn btn-primary bg-purple btn-sm btn-social btn-block hidden-print disabled" style="margin-bottom: 25px;">
|
||||
<x-icon type="checkin" />
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</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;">
|
||||
<x-icon type="checkin" />
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@can('delete', $license)
|
||||
|
||||
@if ($license->availCount()->count() == $license->seats)
|
||||
<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') }}
|
||||
</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-asset disabled" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</a>
|
||||
</span>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
</div> <!-- /.row -->
|
||||
|
||||
|
||||
@can('checkin', \App\Models\License::class)
|
||||
@include ('modals.confirm-action',
|
||||
[
|
||||
'modal_name' => 'checkinFromAllModal',
|
||||
'route' => route('licenses.bulkcheckin', $license->id),
|
||||
'title' => trans('general.modal_confirm_generic'),
|
||||
'body' => trans_choice('admin/licenses/general.bulk.checkin_all.modal', 2, ['checkedout_seats_count' => $checkedout_seats_count])
|
||||
])
|
||||
@endcan
|
||||
|
||||
@can('checkout', \App\Models\License::class)
|
||||
@can('checkout', $license)
|
||||
|
||||
@if (($license->availCount()->count() > 0) && (!$license->isInactive()))
|
||||
|
||||
<a href="{{ route('licenses.checkout', $license->id) }}" class="btn bg-maroon btn-sm btn-social btn-block hidden-print" style="margin-bottom: 5px;">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('general.checkout') }}
|
||||
</a>
|
||||
|
||||
<a href="#" class="btn bg-maroon btn-sm btn-social btn-block hidden-print" style="margin-bottom: 5px;" data-toggle="modal" data-tooltip="true" title="{{ trans('admin/licenses/general.bulk.checkout_all.enabled_tooltip') }}" data-target="#checkoutFromAllModal">
|
||||
<x-icon type="checkout-all" />
|
||||
{{ trans('admin/licenses/general.bulk.checkout_all.button') }}
|
||||
</a>
|
||||
|
||||
@else
|
||||
<span data-tooltip="true" title="{{ ($license->availCount()->count() == 0) ? trans('admin/licenses/general.bulk.checkout_all.disabled_tooltip') : trans('admin/licenses/message.checkout.license_is_inactive') }}" class="btn bg-maroon btn-sm btn-social btn-block hidden-print disabled" style="margin-bottom: 5px;" data-tooltip="true" title="{{ trans('general.checkout') }}">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('general.checkout') }}
|
||||
</span>
|
||||
<span data-tooltip="true" title="{{ ($license->availCount()->count() == 0) ? trans('admin/licenses/general.bulk.checkout_all.disabled_tooltip') : trans('admin/licenses/message.checkout.license_is_inactive') }}" class="btn bg-maroon btn-sm btn-social btn-block hidden-print disabled" style="margin-bottom: 5px;" data-tooltip="true" title="{{ trans('general.checkout') }}">
|
||||
<x-icon type="checkout" />
|
||||
{{ trans('admin/licenses/general.bulk.checkout_all.button') }}
|
||||
</span>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@can('checkin', $license)
|
||||
|
||||
@if (($license->seats - $license->availCount()->count()) <= 0 )
|
||||
<span data-tooltip="true" title=" {{ trans('admin/licenses/general.bulk.checkin_all.disabled_tooltip') }}">
|
||||
<a href="#" class="btn btn-primary bg-purple btn-sm btn-social btn-block hidden-print disabled" style="margin-bottom: 25px;">
|
||||
<x-icon type="checkin" />
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</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;">
|
||||
<x-icon type="checkin" />
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@can('delete', $license)
|
||||
|
||||
@if ($license->availCount()->count() == $license->seats)
|
||||
<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') }}
|
||||
</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-asset disabled" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</a>
|
||||
</span>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
|
||||
|
||||
|
||||
</x-slot:before_list>
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@can('checkout', \App\Models\License::class)
|
||||
@include ('modals.confirm-action',
|
||||
[
|
||||
'modal_name' => 'checkoutFromAllModal',
|
||||
@@ -615,8 +216,7 @@
|
||||
'title' => trans('general.modal_confirm_generic'),
|
||||
'body' => trans_choice('admin/licenses/general.bulk.checkout_all.modal', 2, ['available_seats_count' => $available_seats_count])
|
||||
])
|
||||
@endcan
|
||||
|
||||
@endcan
|
||||
|
||||
|
||||
@can('update', \App\Models\License::class)
|
||||
|
||||
@@ -9,10 +9,15 @@
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button" data-tooltip="true" title="{{ trans('button.show_hide_info') }}"></i>
|
||||
@endsection
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<x-container columns="2">
|
||||
<x-page-column class="col-md-9">
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
<x-tabs>
|
||||
|
||||
<x-slot:tabnav>
|
||||
@@ -100,7 +105,6 @@
|
||||
|
||||
@endcan
|
||||
|
||||
|
||||
<x-tabs.nav-item
|
||||
name="child_locations"
|
||||
icon="fa-solid fa-city fa-fw"
|
||||
@@ -370,7 +374,7 @@
|
||||
<x-page-column class="col-md-3">
|
||||
|
||||
<x-box>
|
||||
<x-box.contact :contact="$location" img_path="{{ app('locations_upload_url') }}">
|
||||
<x-box.info-panel :infoPanelObj="$location" img_path="{{ app('locations_upload_url') }}">
|
||||
|
||||
<x-slot:before_list>
|
||||
@can('update', $location)
|
||||
@@ -424,7 +428,6 @@
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
</x-slot:before_list>
|
||||
@@ -437,7 +440,7 @@
|
||||
@endif
|
||||
|
||||
|
||||
</x-box.contact>
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
|
||||
</x-page-column>
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('manufacturers.edit', $manufacturer) }}" class="btn btn-primary text-right" style="margin-right: 10px;">{{ trans('general.update') }}</a>
|
||||
@stop
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button" data-tooltip="true" title="{{ trans('button.show_hide_info') }}"></i>
|
||||
@endsection
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<x-container columns="2">
|
||||
<x-page-column class="col-md-9">
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
@can('view', \App\Models\Asset::class)
|
||||
@@ -191,9 +191,35 @@
|
||||
<x-page-column class="col-md-3">
|
||||
|
||||
<x-box>
|
||||
<x-box.contact :contact="$manufacturer" img_path="{{ app('manufacturers_upload_url') }}">
|
||||
<x-box.info-panel :infoPanelObj="$manufacturer" img_path="{{ app('manufacturers_upload_url') }}">
|
||||
|
||||
</x-box.contact>
|
||||
<x-slot:before_list>
|
||||
|
||||
@can('update', \App\Models\Manufacturer::class)
|
||||
<a href="{{ ($manufacturer->deleted_at=='') ? route('manufacturers.edit', $manufacturer->id) : '#' }}" class="btn btn-block btn-sm btn-warning btn-social hidden-print{{ ($manufacturer->deleted_at!='') ? ' disabled' : '' }}">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('general.update') }}
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('delete', \App\Models\Manufacturer::class)
|
||||
|
||||
@if ($manufacturer->assets()->count() > 0)
|
||||
<button 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') }}">
|
||||
<x-icon type="delete" />
|
||||
{{ 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.manufacturer')]) }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $manufacturer->name]) }}" data-target="#dataConfirmModal" data-tooltip="true" data-icon="fa fa-trash" data-placement="top" data-title="{{ trans('general.delete_what', ['item'=> trans('general.manufacturer')]) }}" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
</x-slot:before_list>
|
||||
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@@ -8,303 +8,141 @@
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
@can('update', \App\Models\AssetModel::class)
|
||||
<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">
|
||||
@if ($model->deleted_at=='')
|
||||
<li><a href="{{ route('models.edit', $model->id) }}">{{ trans('admin/models/table.edit') }}</a></li>
|
||||
<li><a href="{{ route('models.clone.create', $model->id) }}">{{ trans('admin/models/table.clone') }}</a></li>
|
||||
<li><a href="{{ route('hardware.create', ['model_id' => $model->id]) }}">{{ trans('admin/hardware/form.create') }}</a></li>
|
||||
@else
|
||||
<li><a href="{{ route('models.restore.store', $model->id) }}">{{ trans('admin/models/general.restore') }}</a></li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
@endcan
|
||||
@stop
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button" data-tooltip="true" title="{{ trans('button.show_hide_info') }}"></i>
|
||||
@endsection
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<x-container columns="2">
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
@if ($model->deleted_at!='')
|
||||
<div class="col-md-12">
|
||||
<div class="callout callout-warning">
|
||||
<x-icon type="warning" />
|
||||
{{ trans('admin/models/general.deleted') }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-9">
|
||||
|
||||
<div class="nav-tabs-custom">
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#assets" data-toggle="tab">
|
||||
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-barcode fa-2x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.assets') }}
|
||||
{!! ($model->assets()->AssetsForShow()->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($model->assets()->AssetsForShow()->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#files" data-toggle="tab">
|
||||
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-barcode fa-2x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.files') }}
|
||||
{!! ($model->uploads->count() > 0 ) ? '<span class="badge badge-secondary">'.number_format($model->uploads->count()).'</span>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="pull-right">
|
||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<x-icon type="paperclip" />
|
||||
{{ trans('button.upload') }}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="assets">
|
||||
|
||||
@include('partials.asset-bulk-actions')
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-show-columns-search="true"
|
||||
data-cookie-id-table="assetListingTable"
|
||||
data-id-table="assetListingTable"
|
||||
data-side-pagination="server"
|
||||
data-show-footer="true"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
data-sort-order="asc"
|
||||
id="assetListingTable"
|
||||
data-url="{{ route('api.assets.index',['model_id'=> $model->id]) }}"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-models-{{ str_slug($model->name) }}-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div> <!-- /.tab-pane assets -->
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="files">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<x-filestable object_type="models" :object="$model" />
|
||||
|
||||
</div> <!-- /.col-md-12 -->
|
||||
</div> <!-- /.row -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!-- /.tab-content -->
|
||||
</div> <!-- /.nav-tabs-custom -->
|
||||
</div><!-- /. col-md-12 -->
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="row">
|
||||
@if ($model->deleted_at!='')
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-heading">
|
||||
<h2 class="box-title"> {{ trans('general.moreinfo') }}:</h2>
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="callout callout-warning">
|
||||
<x-icon type="warning" />
|
||||
{{ trans('admin/models/general.deleted') }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
@can('view', \App\Models\Asset::class)
|
||||
<x-tabs.nav-item
|
||||
name="assets"
|
||||
class="active"
|
||||
icon="fas fa-barcode fa-fw"
|
||||
label="{{ trans('general.assets') }}"
|
||||
count="{{ $model->assets()->AssetsForShow()->count() }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
<x-tabs.nav-item
|
||||
name="files"
|
||||
icon="fa-solid fa-file-contract fa-fw"
|
||||
label="{{ trans('general.files') }}"
|
||||
count="{{ $model->uploads()->count() }}"
|
||||
/>
|
||||
|
||||
@can('update', $model)
|
||||
<x-tabs.nav-item-upload />
|
||||
@endcan
|
||||
</x-slot:tabnav>
|
||||
|
||||
|
||||
<x-slot:tabpanes>
|
||||
<!-- start assets tab pane -->
|
||||
@can('view', \App\Models\Asset::class)
|
||||
<x-tabs.pane name="assets" class="in active">
|
||||
<x-slot:header>
|
||||
{{ trans('general.assets') }}
|
||||
</x-slot:header>
|
||||
|
||||
@if ($model->image)
|
||||
<img src="{{ Storage::disk('public')->url(app('models_upload_path').e($model->image)) }}" class="img-responsive"></li>
|
||||
@endif
|
||||
<x-slot:bulkactions>
|
||||
<x-table.bulk-assets />
|
||||
</x-slot:bulkactions>
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
show_column_search="true"
|
||||
show_advanced_search="true"
|
||||
buttons="assetButtons"
|
||||
api_url="{{ route('api.assets.index', ['model_id' => $model->id]) }}"
|
||||
:presenter="\App\Presenters\AssetPresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($model->name) }}-assets-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
|
||||
<ul class="list-unstyled" style="line-height: 25px;">
|
||||
@if ($model->category)
|
||||
<li>
|
||||
<strong>{{ trans('general.category') }}</strong>:
|
||||
<a href="{{ route('categories.show', $model->category->id) }}">{{ $model->category->name }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@if ($model->deleted_at)
|
||||
<li>
|
||||
<strong>
|
||||
<span class="text-danger">
|
||||
{{ trans('general.deleted') }}:
|
||||
{{ Helper::getFormattedDateObject($model->deleted_at, 'datetime', false) }}
|
||||
</span>
|
||||
</strong>
|
||||
<!-- start files tab pane -->
|
||||
<x-tabs.pane name="files">
|
||||
<x-slot:header>
|
||||
{{ trans('general.files') }}
|
||||
</x-slot:header>
|
||||
<x-slot:content>
|
||||
<x-filestable object_type="models" :object="$model" />
|
||||
</x-slot:content>
|
||||
</x-tabs.pane>
|
||||
<!-- end files tab pane -->
|
||||
|
||||
</li>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@if ($model->min_amt)
|
||||
<li>
|
||||
<strong>{{ trans('general.min_amt') }}</strong>:
|
||||
{{$model->min_amt }}
|
||||
</li>
|
||||
@endif
|
||||
</x-slot:tabpanes>
|
||||
</x-tabs>
|
||||
|
||||
@if ($model->manufacturer)
|
||||
<li>
|
||||
<strong>{{ trans('general.manufacturer') }}</strong>:
|
||||
@can('view', \App\Models\Manufacturer::class)
|
||||
<a href="{{ route('manufacturers.show', $model->manufacturer->id) }}">
|
||||
{{ $model->manufacturer->name }}
|
||||
</x-page-column>
|
||||
<x-page-column class="col-md-3">
|
||||
<x-box>
|
||||
<x-box.info-panel :infoPanelObj="$model" img_path="{{ app('models_upload_url') }}">
|
||||
<x-slot:before_list>
|
||||
|
||||
@can('update', \App\Models\AssetModel::class)
|
||||
<a href="{{ ($model->deleted_at=='') ? route('models.edit', $model->id) : '#' }}" class="btn btn-block btn-sm btn-warning btn-social hidden-print{{ ($model->deleted_at!='') ? ' disabled' : '' }}">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('admin/models/table.edit') }}
|
||||
</a>
|
||||
@else
|
||||
{{ $model->manufacturer->name }}
|
||||
@endcan
|
||||
</li>
|
||||
|
||||
@if ($model->manufacturer->url)
|
||||
<li>
|
||||
<i class="fas fa-globe-americas"></i> <a href="{{ $model->manufacturer->url }}">{{ $model->manufacturer->url }}</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\AssetModel::class)
|
||||
<a href="{{ route('models.clone.create', $model->id) }}" class="btn btn-block btn-sm btn-warning btn-social hidden-print">
|
||||
<x-icon type="clone" />
|
||||
{{ trans('admin/models/table.clone') }}
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('delete', \App\Models\AssetModel::class)
|
||||
|
||||
@if ($model->deleted_at!='')
|
||||
<form method="POST" action="{{ route('models.restore.store', $model->id) }}" style="padding-top: 5px">
|
||||
@csrf
|
||||
<button style="width: 100%;" class="btn btn-block btn-sm btn-warning btn-social hidden-print">
|
||||
<x-icon type="restore" />
|
||||
{{ trans('button.restore') }}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@elseif ($model->assets()->count() > 0)
|
||||
<button 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') }}">
|
||||
<x-icon type="delete" />
|
||||
{{ 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-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>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@if ($model->manufacturer->support_url)
|
||||
<li>
|
||||
<x-icon type="more-info" /> <a href="{{ $model->manufacturer->support_url }}">{{ $model->manufacturer->support_url }}</a>
|
||||
</li>
|
||||
@endif
|
||||
</x-slot:before_list>
|
||||
|
||||
@if ($model->manufacturer->support_phone)
|
||||
<li>
|
||||
<i class="fas fa-phone"></i>
|
||||
<a href="tel:{{ $model->manufacturer->support_phone }}">{{ $model->manufacturer->support_phone }}</a>
|
||||
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if ($model->manufacturer->support_email)
|
||||
<li>
|
||||
<i class="far fa-envelope"></i> <a href="mailto:{{ $model->manufacturer->support_email }}">{{ $model->manufacturer->support_email }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@endif
|
||||
@if ($model->model_number)
|
||||
<li>
|
||||
<strong>{{ trans('general.model_no') }}</strong>:
|
||||
{{ $model->model_number }}
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if ($model->depreciation)
|
||||
<li>
|
||||
<strong>{{ trans('general.depreciation') }}</strong>:
|
||||
{{ $model->depreciation->name }} ({{ $model->depreciation->months.' '.trans('general.months')}})
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if ($model->eol)
|
||||
<li>
|
||||
<strong>{{ trans('general.eol') }}</strong>:
|
||||
{{ $model->eol .' '. trans('general.months') }}
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if ($model->fieldset)
|
||||
<li>
|
||||
<strong>{{ trans('admin/models/general.fieldset') }}</strong>:
|
||||
<a href="{{ route('fieldsets.show', $model->fieldset->id) }}">{{ $model->fieldset->name }}</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if ($model->notes)
|
||||
<li>
|
||||
<strong>{{ trans('general.notes') }}</strong>:
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($model->notes)) !!}
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if ($model->created_at)
|
||||
<li>
|
||||
<strong>{{ trans('general.created_at') }}</strong>:
|
||||
{{ Helper::getFormattedDateObject($model->created_at, 'datetime', false) }}
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if ($model->adminuser)
|
||||
<li>
|
||||
<strong>{{ trans('general.created_by') }}</strong>:
|
||||
{{ $model->adminuser->display_name }}
|
||||
</li>
|
||||
@endif
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('update', \App\Models\AssetModel::class)
|
||||
<div class="col-md-12" style="padding-bottom: 5px;">
|
||||
<a href="{{ ($model->deleted_at=='') ? route('models.edit', $model->id) : '#' }}" style="width: 100%;" class="btn btn-sm btn-warning btn-social hidden-print{{ ($model->deleted_at!='') ? ' disabled' : '' }}">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('admin/models/table.edit') }}
|
||||
</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\AssetModel::class)
|
||||
<div class="col-md-12" style="padding-bottom: 5px;">
|
||||
<a href="{{ route('models.clone.create', $model->id) }}" style="width: 100%;" class="btn btn-sm btn-info btn-social hidden-print">
|
||||
<x-icon type="clone" />
|
||||
{{ trans('admin/models/table.clone') }}
|
||||
</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@can('delete', \App\Models\AssetModel::class)
|
||||
<div class="col-md-12" style="padding-top: 10px;">
|
||||
|
||||
@if ($model->deleted_at!='')
|
||||
<form method="POST" action="{{ route('models.restore.store', $model->id) }}">
|
||||
@csrf
|
||||
<button style="width: 100%;" class="btn btn-sm btn-warning btn-social hidden-print">
|
||||
<x-icon type="restore" />
|
||||
{{ trans('button.restore') }}
|
||||
</button>
|
||||
</form>
|
||||
@elseif ($model->assets()->count() > 0)
|
||||
<button 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') }}">
|
||||
<x-icon type="delete" />
|
||||
{{ 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-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>
|
||||
</div>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
</div>
|
||||
</div> <!-- /.row -->
|
||||
|
||||
@can('update', \App\Models\AssetModel::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'models', 'item_id' => $model->id])
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
}'>
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="col-sm-1" data-field="created_at" data-searchable="false" data-sortable="true">{{ trans('general.date') }}</th>
|
||||
<th class="col-sm-1" data-sortable="true" >{{ trans('general.type') }}</th>
|
||||
<th class="col-sm-1" data-field="created_at" data-searchable="false" data-sortable="true">{{ trans('general.date') }}</th>
|
||||
<th class="col-sm-1" data-sortable="true" >{{ trans('general.type') }}</th>
|
||||
<th class="col-sm-1" data-sortable="true" >{{ trans('admin/companies/table.title') }}</th>
|
||||
<th class="col-sm-1" data-sortable="true" >{{ trans('general.category') }}</th>
|
||||
<th class="col-sm-1" data-sortable="true" >{{ trans('admin/hardware/form.model') }}</th>
|
||||
@@ -71,16 +71,16 @@
|
||||
{{-- Item Type --}}
|
||||
<td>{{ $item->type }}</td>
|
||||
{{-- Company name --}}
|
||||
<td>{!! $item->company !!}</td>
|
||||
<td>{{ $item->plain_text_company }}</td>
|
||||
|
||||
{{-- Category --}}
|
||||
<td>{!! $item->category !!}</td>
|
||||
<td>{{ $item->plain_text_category }}</td>
|
||||
|
||||
{{-- Model --}}
|
||||
<td>{!! $item->model !!}</td>
|
||||
<td>{{ $item->plain_text_model }}</td>
|
||||
|
||||
{{-- Name --}}
|
||||
<td>{!! $item->name !!}</td>
|
||||
<td>{{ $item->plain_text_name }}</td>
|
||||
|
||||
{{-- Asset tag or blank --}}
|
||||
<td>{{ $item->asset_tag }}</td>
|
||||
|
||||
@@ -10,15 +10,13 @@
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('suppliers.edit', $supplier->id) }}" class="btn btn-theme pull-right">
|
||||
{{ trans('general.update') }}</a>
|
||||
@stop
|
||||
|
||||
<i class="fa-regular fa-2x fa-square-caret-right pull-right" id="expand-info-panel-button" data-tooltip="true" title="{{ trans('button.show_hide_info') }}"></i>
|
||||
@endsection
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<x-container columns="2">
|
||||
<x-page-column class="col-md-9">
|
||||
<x-page-column class="col-md-9 main-panel">
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
@can('view', \App\Models\Asset::class)
|
||||
@@ -31,6 +29,17 @@
|
||||
/>
|
||||
@endcan
|
||||
|
||||
@can('view', \App\Models\License::class)
|
||||
<x-tabs.nav-item
|
||||
name="licenses"
|
||||
icon="far fa-save"
|
||||
label="{{ trans('general.licenses') }}"
|
||||
count="{{ $supplier->licenses->count() }}"
|
||||
tooltip="{{ trans('general.licenses') }}"
|
||||
/>
|
||||
@endcan
|
||||
|
||||
|
||||
@can('view', \App\Models\Accessory::class)
|
||||
<x-tabs.nav-item
|
||||
name="accessories"
|
||||
@@ -93,7 +102,7 @@
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:bulkactions>
|
||||
<x-table.bulk-users />
|
||||
<x-table.bulk-assets />
|
||||
</x-slot:bulkactions>
|
||||
|
||||
<x-slot:content>
|
||||
@@ -111,6 +120,26 @@
|
||||
@endcan
|
||||
<!-- end assets tab pane -->
|
||||
|
||||
<!-- start licenses tab pane -->
|
||||
@can('view', \App\Models\License::class)
|
||||
<x-tabs.pane name="licenses">
|
||||
<x-slot:header>
|
||||
{{ trans('general.licenses') }}
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
show_advanced_search="true"
|
||||
buttons="licenseButtons"
|
||||
api_url="{{ route('api.licenses.index', ['supplier_id' => $supplier->id]) }}"
|
||||
:presenter="\App\Presenters\LicensePresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($supplier->name) }}-licenses-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end licenses tab pane -->
|
||||
|
||||
<!-- start accessories tab pane -->
|
||||
@can('view', \App\Models\Accessory::class)
|
||||
@@ -133,26 +162,6 @@
|
||||
@endcan
|
||||
<!-- end accessories tab pane -->
|
||||
|
||||
<!-- start licenses tab pane -->
|
||||
@can('view', \App\Models\License::class)
|
||||
<x-tabs.pane name="licenses">
|
||||
<x-slot:header>
|
||||
{{ trans('general.licenses') }}
|
||||
</x-slot:header>
|
||||
|
||||
<x-slot:content>
|
||||
<x-table
|
||||
show_advanced_search="true"
|
||||
buttons="licenseButtons"
|
||||
api_url="{{ route('api.licenses.index', ['supplier_id' => $supplier->id]) }}"
|
||||
:presenter="\App\Presenters\LicensePresenter::dataTableLayout()"
|
||||
export_filename="export-{{ str_slug($supplier->name) }}-licenses-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
</x-slot:content>
|
||||
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<!-- end licenses tab pane -->
|
||||
|
||||
<!-- start components tab pane -->
|
||||
@can('view', \App\Models\Component::class)
|
||||
@@ -232,8 +241,35 @@
|
||||
<x-page-column class="col-md-3">
|
||||
|
||||
<x-box>
|
||||
<x-box.contact :contact="$supplier" img_path="{{ app('suppliers_upload_url') }}">
|
||||
</x-box.contact>
|
||||
<x-box.info-panel :infoPanelObj="$supplier" img_path="{{ app('suppliers_upload_url') }}">
|
||||
|
||||
<x-slot:before_list>
|
||||
|
||||
@can('update', \App\Models\Supplier::class)
|
||||
<a href="{{ ($supplier->deleted_at=='') ? route('suppliers.edit', $supplier->id) : '#' }}" class="btn btn-block btn-sm btn-warning btn-social hidden-print{{ ($supplier->deleted_at!='') ? ' disabled' : '' }}">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('general.update') }}
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('delete', \App\Models\Supplier::class)
|
||||
|
||||
@if ($supplier->assets()->count() > 0)
|
||||
<button 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') }}">
|
||||
<x-icon type="delete" />
|
||||
{{ 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.supplier')]) }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $supplier->name]) }}" data-target="#dataConfirmModal" data-tooltip="true" data-icon="fa fa-trash" data-placement="top" data-title="{{ trans('general.delete_what', ['item'=> trans('general.supplier')]) }}" onClick="return false;">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
</x-slot:before_list>
|
||||
|
||||
</x-box.info-panel>
|
||||
</x-box>
|
||||
</x-page-column>
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<div class="buttons">
|
||||
<!-- Authorize Button -->
|
||||
<form method="post" action="/oauth/authorize">
|
||||
<form method="post" action="{{ url('/oauth/authorize') }}">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<input type="hidden" name="state" value="{{ $request->state }}">
|
||||
@@ -73,7 +73,7 @@
|
||||
</form>
|
||||
|
||||
<!-- Cancel Button -->
|
||||
<form method="post" action="/oauth/authorize">
|
||||
<form method="post" action="{{ url('/oauth/authorize') }}">
|
||||
{{ csrf_field() }}
|
||||
{{ method_field('DELETE') }}
|
||||
|
||||
|
||||
@@ -32,18 +32,25 @@ Route::group([ 'prefix' => 'fields','middleware' => ['auth'] ], function () {
|
||||
[CustomFieldsetsController::class, 'associate']
|
||||
)->name('fieldsets.associate');
|
||||
|
||||
|
||||
|
||||
Route::resource('fieldsets', CustomFieldsetsController::class, [
|
||||
'parameters' => [
|
||||
'fieldset' => 'fieldset',
|
||||
'field' => 'field_id'
|
||||
]
|
||||
],
|
||||
'except' => ['show', 'view']
|
||||
]);
|
||||
|
||||
Route::get(
|
||||
'fieldsets/{fieldset}/edit',
|
||||
[CustomFieldsetsController::class, 'show']
|
||||
)->name('fieldsets.show');
|
||||
|
||||
});
|
||||
|
||||
Route::resource('fields', CustomFieldsController::class,
|
||||
['middleware' => ['auth'],
|
||||
'except' => ['show']
|
||||
'except' => ['show', 'view']
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user