A free open source IT asset/license management system
Updated categories view
snipe5a0affcd8e7d
diff --git a/app/Helpers/IconHelper.php b/app/Helpers/IconHelper.phpindex c3c7e068f9..be1feb70c7 100644--- a/app/Helpers/IconHelper.php+++ b/app/Helpers/IconHelper.php@@ -246,7 +246,11 @@ class IconHelperreturn 'fa-regular fa-square-caret-right';case 'square-left':return 'fa-regular fa-square-caret-left';-+ case 'square':+ return 'fa-solid fa-square-full';+ case 'models':+ case 'model':+ return 'fa-solid fa-boxes-stacked';}}diff --git a/resources/views/blade/box/info-panel.blade.php b/resources/views/blade/box/info-panel.blade.phpindex 6cbf4bf5a3..2884d6fbc1 100644--- a/resources/views/blade/box/info-panel.blade.php+++ b/resources/views/blade/box/info-panel.blade.php@@ -59,6 +59,7 @@@endcan@endif+@if ($contact->license_name)<x-info-element icon_type="contact-card" title="{{ trans('admin/licenses/form.to_name') }}">{{ trans('admin/licenses/form.to_name') }}@@ -130,6 +131,14 @@</x-info-element>@endif+ @if ($contact->category_type)+ <x-info-element icon_type="{{ $contact->category_type }}" title="{{ trans('general.type') }}">+ {{ $contact->category_type }}+ </x-info-element>+ @endif+++@if ($contact->location)<x-info-element icon_type="location" icon_color="{{ $contact->location->tag_color }}" title="{{ trans('general.location') }}">{!! $contact->location->present()->nameUrl !!}@@ -308,6 +317,7 @@</x-info-element>@endif+@if ($contact->months)<x-info-element title="{{ trans('general.months') }}">{{ $contact->months }}@@ -342,7 +352,7 @@@endif- @if ($contact->maintained)+ @if (isset($contact->maintained))<x-info-element title="{{ trans('general.maintained') }}">@if ($contact->maintained == 1)<x-icon type="checkmark" class="fa-fw text-success" />@@ -354,7 +364,7 @@</x-info-element>@endif- @if ($contact->reassignable)+ @if (isset($contact->reassignable))<x-info-element title="{{ trans('admin/licenses/form.reassignable') }}">@if ($contact->reassignable == 1)<x-icon type="checkmark" class="fa-fw text-success" />@@ -366,7 +376,7 @@</x-info-element>@endif- @if ($contact->requestable)+ @if (isset($contact->requestable))<x-info-element title="{{ trans('general.requestable') }}">@if ($contact->requestable == 1)<x-icon type="checkmark" class="fa-fw text-success" />@@ -378,7 +388,59 @@</x-info-element>@endif+ @if (isset($contact->use_default_eula))+ <x-info-element>+ @if ($contact->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($contact->require_acceptance))+ <x-info-element>+ @if ($contact->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($contact->checkin_email))+ <x-info-element>+ @if ($contact->checkin_email == 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_user_upon_checkin') }}+ </x-info-element>+ @endif++ @if (isset($contact->alert_on_response))+ <x-info-element>+ @if ($contact->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 ($contact->tag_color)+ <x-info-element>+ <x-icon type="square" class="fa-fw" style="color: {{ $contact->tag_color }}" title="{{ trans('general.tag_color') }} }"/>+ {{ $contact->tag_color }}+ </x-info-element>+ @endif@if ($contact->adminuser)<x-info-element title="{{ trans('general.created_by') }}">diff --git a/resources/views/categories/view.blade.php b/resources/views/categories/view.blade.phpindex 8673c9e32f..c4f0a2ff37 100644--- a/resources/views/categories/view.blade.php+++ b/resources/views/categories/view.blade.php@@ -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')+ <x-container columns="2">+ <x-page-column class="col-md-9 main-panel">+ <x-tabs>+ <x-slot:tabnav>+ @if ($category->category_type=='asset')+ @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- <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+ @elseif ($category->category_type=='accessory')- </a>- </li>+ @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')- <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- </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+ @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 :contact="$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>+ @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')@stopdiff --git a/resources/views/suppliers/view.blade.php b/resources/views/suppliers/view.blade.phpindex efadb502da..b18f8a10da 100755--- a/resources/views/suppliers/view.blade.php+++ b/resources/views/suppliers/view.blade.php@@ -102,7 +102,7 @@</x-slot:header><x-slot:bulkactions>- <x-table.bulk-users />+ <x-table.bulk-assets /></x-slot:bulkactions><x-slot:content>