Added file-specific policies
This commit is contained in:
@@ -91,7 +91,7 @@ class UploadedFilesController extends Controller
|
||||
|
||||
// Check the permissions to make sure the user can view the object
|
||||
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
|
||||
$this->authorize('update', $object);
|
||||
$this->authorize('files', $object);
|
||||
|
||||
if (! $object) {
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.file_upload_status.invalid_object')));
|
||||
@@ -186,7 +186,7 @@ class UploadedFilesController extends Controller
|
||||
|
||||
// Check the permissions to make sure the user can view the object
|
||||
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
|
||||
$this->authorize('update', $object);
|
||||
$this->authorize('files', $object);
|
||||
|
||||
if (! $object) {
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.file_upload_status.invalid_object')));
|
||||
|
||||
@@ -37,7 +37,7 @@ class UploadedFilesController extends Controller
|
||||
|
||||
// Check the permissions to make sure the user can view the object
|
||||
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
|
||||
$this->authorize('update', $object);
|
||||
$this->authorize('files', $object);
|
||||
|
||||
if (! $object) {
|
||||
return redirect()->back()->withFragment('files')->with('error', trans('general.file_upload_status.invalid_object'));
|
||||
@@ -129,7 +129,7 @@ class UploadedFilesController extends Controller
|
||||
|
||||
// Check the permissions to make sure the user can view the object
|
||||
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
|
||||
$this->authorize('update', $object);
|
||||
$this->authorize('files', $object);
|
||||
|
||||
if (! $object) {
|
||||
return redirect()->back()->withFragment('files')->with('error', trans('general.file_upload_status.invalid_object'));
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class AccessoryPolicy extends CheckoutablePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'accessories';
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class AssetModelPolicy extends SnipePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'models';
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,9 @@ class AssetPolicy extends CheckoutablePermissionsPolicy
|
||||
{
|
||||
return $user->hasAccess('assets.audit');
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class CompanyPolicy extends SnipePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'companies';
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class ComponentPolicy extends CheckoutablePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'components';
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class ConsumablePolicy extends CheckoutablePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'consumables';
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class DepartmentPolicy extends SnipePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'departments';
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,13 +40,8 @@ class LicensePolicy extends CheckoutablePermissionsPolicy
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function files(User $user, $license = null)
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
if ($user->hasAccess('licenses.files')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class LocationPolicy extends SnipePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'locations';
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class SupplierPolicy extends SnipePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'suppliers';
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class UserPolicy extends SnipePermissionsPolicy
|
||||
{
|
||||
protected function columnName()
|
||||
{
|
||||
return 'users';
|
||||
}
|
||||
|
||||
public function files(User $user, $item = null)
|
||||
{
|
||||
return $user->hasAccess($this->columnName() . '.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,23 +166,23 @@ class AuthServiceProvider extends ServiceProvider
|
||||
}
|
||||
});
|
||||
|
||||
Gate::define('accessories.files', function ($user) {
|
||||
if ($user->hasAccess('accessories.files')) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Gate::define('components.files', function ($user) {
|
||||
if ($user->hasAccess('components.files')) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Gate::define('consumables.files', function ($user) {
|
||||
if ($user->hasAccess('consumables.files')) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
// Gate::define('accessories.files', function ($user) {
|
||||
// if ($user->hasAccess('accessories.files')) {
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// Gate::define('components.files', function ($user) {
|
||||
// if ($user->hasAccess('components.files')) {
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// Gate::define('consumables.files', function ($user) {
|
||||
// if ($user->hasAccess('consumables.files')) {
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
|
||||
// Can the user import CSVs?
|
||||
Gate::define('import', function ($user) {
|
||||
|
||||
@@ -82,6 +82,10 @@ return [
|
||||
'permission' => 'assets.view.encrypted_custom_fields',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'assets.files',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
@@ -247,6 +251,10 @@ return [
|
||||
'permission' => 'users.delete',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'users.files',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
@@ -267,6 +275,10 @@ return [
|
||||
'permission' => 'models.delete',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'models.files',
|
||||
'display' => true,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
@@ -306,6 +318,10 @@ return [
|
||||
'permission' => 'departments.delete',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'departments.files',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
|
||||
'Status Labels' => [
|
||||
@@ -363,6 +379,10 @@ return [
|
||||
'permission' => 'suppliers.delete',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'suppliers.files',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
|
||||
'Manufacturers' => [
|
||||
@@ -420,6 +440,10 @@ return [
|
||||
'permission' => 'locations.delete',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'locations.files',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
|
||||
'Companies' => [
|
||||
@@ -439,6 +463,10 @@ return [
|
||||
'permission' => 'companies.delete',
|
||||
'display' => true,
|
||||
],
|
||||
[
|
||||
'permission' => 'companies.files',
|
||||
'display' => true,
|
||||
],
|
||||
],
|
||||
|
||||
'User (Self) Accounts' => [
|
||||
|
||||
@@ -107,8 +107,49 @@ return [
|
||||
],
|
||||
'accessoriesfiles' => [
|
||||
'name' => 'Manage Accessory Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with accessories.',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with accessories. (This only makes sense with view privileges or higher.)',
|
||||
],
|
||||
|
||||
'assetsfiles' => [
|
||||
'name' => 'Manage Asset Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with assets. (This only makes sense with view privileges or higher.)',
|
||||
],
|
||||
|
||||
'usersfiles' => [
|
||||
'name' => 'Manage User Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with users. (This only makes sense with view privileges or higher.)',
|
||||
],
|
||||
|
||||
'modelsfiles' => [
|
||||
'name' => 'Manage Model Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with asset models on both the model view and the asset view screens. (This only makes sense with view privileges or higher.)',
|
||||
],
|
||||
|
||||
'departmentsfiles' => [
|
||||
'name' => 'Manage Department Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with departments. (This only makes sense with view privileges or higher.)',
|
||||
],
|
||||
|
||||
'suppliersfiles' => [
|
||||
'name' => 'Manage Supplier Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with suppliers. (This only makes sense with view privileges or higher.)',
|
||||
],
|
||||
|
||||
'locationsfiles' => [
|
||||
'name' => 'Manage Location Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with locations.(This only makes sense with view privileges or higher.)',
|
||||
],
|
||||
|
||||
'companiesfiles' => [
|
||||
'name' => 'Manage Company Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with companies. (This only makes sense with view privileges or higher.)',
|
||||
],
|
||||
|
||||
'consumablesfiles' => [
|
||||
'name' => 'Manage Consumable Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with consumables. (This only makes sense with view privileges or higher.)',
|
||||
],
|
||||
|
||||
'consumables' => [
|
||||
'name' => 'Consumables',
|
||||
'note' => 'Grants access to the Consumables section of the application.',
|
||||
@@ -129,10 +170,7 @@ return [
|
||||
'name' => 'Check Out Consumables',
|
||||
'note' => 'Assign consumables in inventory by checking them out.',
|
||||
],
|
||||
'consumablesfiles' => [
|
||||
'name' => 'Manage Consumable Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with consumables.',
|
||||
],
|
||||
|
||||
'licenses' => [
|
||||
'name' => 'Licenses',
|
||||
'note' => 'Grants access to the Licenses section of the application.',
|
||||
@@ -161,6 +199,11 @@ return [
|
||||
'name' => 'Manage License Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with licenses.',
|
||||
],
|
||||
'componentsfiles' => [
|
||||
'name' => 'Manage Component Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with components.',
|
||||
],
|
||||
|
||||
'licenseskeys' => [
|
||||
'name' => 'Manage License Keys',
|
||||
'note' => 'Allows the user to view product keys associated with licenses.',
|
||||
@@ -181,10 +224,7 @@ return [
|
||||
'componentsdelete' => [
|
||||
'name' => 'Delete Components',
|
||||
],
|
||||
'componentsfiles' => [
|
||||
'name' => 'Manage Component Files',
|
||||
'note' => 'Allows the user to upload, download, and delete files associated with components.',
|
||||
],
|
||||
|
||||
'componentscheckout' => [
|
||||
'name' => 'Check Out Components',
|
||||
'note' => 'Assign components in inventory by checking them out.',
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
|
||||
<x-tabs.checkedout-tab :item="$accessory" count="{{ $accessory->checkouts_count }}" />
|
||||
<x-tabs.files-tab count="{{ $accessory->uploads()->count() }}" />
|
||||
<x-tabs.files-tab :item="$accessory" count="{{ $accessory->uploads()->count() }}"/>
|
||||
<x-tabs.history-tab count="{{ $user->history()->count() }}" :model="$accessory"/>
|
||||
<x-tabs.upload-tab :item="$accessory"/>
|
||||
</x-slot:tabnav>
|
||||
@@ -54,11 +53,9 @@
|
||||
<!-- end history tab pane -->
|
||||
|
||||
<!-- start files tab pane -->
|
||||
@can('accessories.files', $accessory)
|
||||
<x-tabs.pane name="files">
|
||||
<x-table.files object_type="accessories" :object="$accessory"/>
|
||||
</x-tabs.pane>
|
||||
@endcan
|
||||
<x-tabs.pane name="files">
|
||||
<x-table.files object_type="accessories" :object="$accessory"/>
|
||||
</x-tabs.pane>
|
||||
<!-- end files tab pane -->
|
||||
</x-slot:tabpanes>
|
||||
|
||||
@@ -81,13 +78,14 @@
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@can('accessories.files', Accessory::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'accessory', 'item_id' => $accessory->id])
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@can('files', $accessory)
|
||||
@include ('modals.upload-file', ['item_type' => 'accessories', 'item_id' => $accessory->id])
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
||||
@endsection
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
@props([
|
||||
'count' => null,
|
||||
'class' => false,
|
||||
'item' => false,
|
||||
])
|
||||
|
||||
@can('view', $item)
|
||||
<x-tabs.nav-item
|
||||
:$class
|
||||
name="files"
|
||||
@@ -10,4 +12,5 @@
|
||||
label="{{ trans('general.files') }}"
|
||||
count="{{ $count }}"
|
||||
tooltip="{{ trans('general.files') }}"
|
||||
/>
|
||||
/>
|
||||
@endcan
|
||||
@@ -2,7 +2,7 @@
|
||||
'item',
|
||||
])
|
||||
|
||||
@can('update', $item)
|
||||
@can('files', $item)
|
||||
<li class="snipetab uploadtab pull-right" role="presentation">
|
||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal" data-tooltip="true" data-placement="top" data-title="{{ trans('general.upload_files') }}">
|
||||
<x-icon type="paperclip" style="font-size: 16px"/>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<x-tabs.accessory-tab count="{{ $company->accessories->count() }}"/>
|
||||
<x-tabs.consumable-tab count="{{ $company->consumables->count() }}"/>
|
||||
<x-tabs.component-tab count="{{ $company->components->count() }}"/>
|
||||
<x-tabs.files-tab count="{{ $company->uploads()->count() }}"/>
|
||||
<x-tabs.files-tab :item="$company" count="{{ $company->uploads()->count() }}"/>
|
||||
<x-tabs.upload-tab :item="$company"/>
|
||||
</x-slot:tabnav>
|
||||
|
||||
@@ -87,16 +87,12 @@
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@endsection
|
||||
|
||||
@can('update', Company::class)
|
||||
@section('moar_scripts')
|
||||
@include ('modals.upload-file', ['item_type' => 'companies', 'item_id' => $company->id])
|
||||
@endsection
|
||||
@endcan
|
||||
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
@can('files', $company)
|
||||
@include ('modals.upload-file', ['item_type' => 'companies', 'item_id' => $company->id])
|
||||
@endcan
|
||||
@include ('partials.bootstrap-table')
|
||||
|
||||
@stop
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
count="{{ $snipe_component->numCheckedOut() }}"
|
||||
/>
|
||||
|
||||
<x-tabs.files-tab count="{{ $snipe_component->uploads()->count() }}" />
|
||||
<x-tabs.files-tab :item="$snipe_component" count="{{ $snipe_component->uploads()->count() }}"/>
|
||||
<x-tabs.history-tab count="{{ $snipe_component->history()->count() }}" :model="$snipe_component"/>
|
||||
<x-tabs.upload-tab :item="$snipe_component"/>
|
||||
|
||||
@@ -75,12 +75,13 @@
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
|
||||
@can('components.files', Component::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'component', 'item_id' => $component->id])
|
||||
@endcan
|
||||
@endsection
|
||||
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'component' . $component->name . '-export', 'search' => false])
|
||||
@stop
|
||||
@can('files', $snipe_component)
|
||||
@include ('modals.upload-file', ['item_type' => 'components', 'item_id' => $snipe_component->id])
|
||||
@endcan
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'component' . $snipe_component->name . '-export', 'search' => false])
|
||||
@endsection
|
||||
|
||||
@@ -28,15 +28,15 @@
|
||||
count="{{ $consumable->numCheckedOut() }}"
|
||||
/>
|
||||
|
||||
<x-tabs.files-tab count="{{ $consumable->uploads()->count() }}" />
|
||||
<x-tabs.history-tab model="\App\Models\Consumable::class"/>
|
||||
<x-tabs.files-tab :item="$consumable" count="{{ $consumable->uploads()->count() }}"/>
|
||||
<x-tabs.history-tab count="{{ $consumable->history()->count() }}" :model="$consumable"/>
|
||||
<x-tabs.upload-tab :item="$consumable"/>
|
||||
|
||||
</x-slot:tabnav>
|
||||
|
||||
<x-slot:tabpanes>
|
||||
|
||||
<x-tabs.pane name="assigned" class="in active">
|
||||
<x-tabs.pane name="assigned">
|
||||
|
||||
<x-table
|
||||
:presenter="\App\Presenters\ConsumablePresenter::checkedOut()"
|
||||
@@ -51,17 +51,10 @@
|
||||
|
||||
<!-- start history tab pane -->
|
||||
<x-tabs.pane name="history">
|
||||
<x-slot:table_header>
|
||||
{{ trans('general.history') }}
|
||||
</x-slot:table_header>
|
||||
|
||||
<x-table
|
||||
name="consumableHistory"
|
||||
api_url="{{ route('api.activity.index', ['item_id' => $consumable->id, 'item_type' => 'consumable']) }}"
|
||||
:presenter="\App\Presenters\HistoryPresenter::dataTableLayout()"
|
||||
export_filename="export-licenses-{{ str_slug($consumable->name) }}-{{ date('Y-m-d') }}"
|
||||
/>
|
||||
<x-table.history :model="$consumable" :route="route('api.consumables.history', $consumable)"/>
|
||||
</x-tabs.pane>
|
||||
<!-- end history tab pane -->
|
||||
|
||||
</x-slot:tabpanes>
|
||||
|
||||
</x-tabs>
|
||||
@@ -83,14 +76,13 @@
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@can('update', \App\Models\User::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'consumable', 'item_id' => $consumable->id])
|
||||
@endcan
|
||||
|
||||
|
||||
|
||||
@stop
|
||||
@endsection
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['simple_view' => true])
|
||||
@endsection
|
||||
@can('files', $consumable)
|
||||
@include ('modals.upload-file', ['item_type' => 'consumables', 'item_id' => $consumable->id])
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'consumable-' . $consumable->name . '-export', 'search' => false])
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
<x-tabs.user-tab count="{{ $department->users->count() }}"/>
|
||||
<x-tabs.files-tab count="{{ $department->uploads()->count() }}"/>
|
||||
<x-tabs.files-tab :item="$department" count="{{ $department->uploads()->count() }}"/>
|
||||
<x-tabs.upload-tab :item="$department"/>
|
||||
</x-slot:tabnav>
|
||||
|
||||
@@ -55,19 +55,13 @@
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@can('update', Department::class)
|
||||
@section('moar_scripts')
|
||||
@include ('modals.upload-file', ['item_type' => 'departments', 'item_id' => $department->id])
|
||||
@endsection
|
||||
@endcan
|
||||
|
||||
@stop
|
||||
@endsection
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table',
|
||||
['exportFile' => 'departments-users-export',
|
||||
'search' => true,
|
||||
'columns' => \App\Presenters\UserPresenter::dataTableLayout()
|
||||
])
|
||||
@can('files', $department)
|
||||
@include ('modals.upload-file', ['item_type' => 'departments', 'item_id' => $department->id])
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'department-' . $department->name . '-export', 'search' => false])
|
||||
@endsection
|
||||
|
||||
@stop
|
||||
|
||||
@@ -390,13 +390,14 @@
|
||||
</x-container>
|
||||
|
||||
|
||||
|
||||
@can('update', \App\Models\Asset::class)
|
||||
@section('moar_scripts')
|
||||
@can('files', $asset)
|
||||
@include ('modals.upload-file', ['item_type' => 'asset', 'item_id' => $asset->id])
|
||||
@endcan
|
||||
@can('update', $asset)
|
||||
@include ('modals.add-note', ['type' => 'asset', 'id' => $asset->id])
|
||||
@include ('modals.upload-file', ['item_type' => 'asset', 'item_id' => $asset->id])
|
||||
@endcan
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@endsection
|
||||
|
||||
@stop
|
||||
@stop
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
count="{{ $license->availCount()->count() }}"
|
||||
/>
|
||||
|
||||
<x-tabs.files-tab name="files" count="{{ $license->uploads()->count() }}"/>
|
||||
<x-tabs.files-tab :item="$license" count="{{ $license->uploads()->count() }}"/>
|
||||
<x-tabs.history-tab count="{{ $license->history()->count() }}" :model="$license"/>
|
||||
<x-tabs.upload-tab :item="$license"/>
|
||||
</x-slot:tabnav>
|
||||
@@ -166,15 +166,13 @@
|
||||
'body' => trans_choice('admin/licenses/general.bulk.checkout_all.modal', 2, ['available_seats_count' => $available_seats_count])
|
||||
])
|
||||
@endcan
|
||||
|
||||
|
||||
@can('update', \App\Models\License::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'license', 'item_id' => $license->id])
|
||||
@endcan
|
||||
|
||||
@stop
|
||||
|
||||
@endsection
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
||||
@can('files', $license)
|
||||
@include ('modals.upload-file', ['item_type' => 'licenses', 'item_id' => $license->id])
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table')
|
||||
@endsection
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
tooltip="{{ trans('general.child_locations') }}"
|
||||
/>
|
||||
|
||||
<x-tabs.files-tab count="{{ $location->uploads()->count() }}"/>
|
||||
<x-tabs.history-tab count="{{ $location->history()->count() }}" :model="$location"/>
|
||||
<x-tabs.files-tab :item="$location" count="{{ $location->uploads()->count() }}"/>
|
||||
<x-tabs.history-tab count="{{ $location->history()->count() }}" :model="$location"/>
|
||||
<x-tabs.upload-tab :item="$location"/>
|
||||
|
||||
</x-slot:tabnav>
|
||||
@@ -238,17 +238,14 @@
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@stop
|
||||
|
||||
@can('update', Location::class)
|
||||
@section('moar_scripts')
|
||||
@include ('modals.upload-file', ['item_type' => 'locations', 'item_id' => $location->id])
|
||||
@endsection
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table', [
|
||||
'exportFile' => 'locations-export',
|
||||
'search' => true
|
||||
])
|
||||
@endsection
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
@can('files', $location)
|
||||
@include ('modals.upload-file', ['item_type' => 'locations', 'item_id' => $location->id])
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table')
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ use Carbon\Carbon;
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
<x-tabs.details-tab/>
|
||||
<x-tabs.files-tab count="{{ $maintenance->uploads()->count() }}" />
|
||||
<x-tabs.files-tab :item="$maintenance" count="{{ $maintenance->uploads()->count() }}"/>
|
||||
<x-tabs.upload-tab :item="$maintenance"/>
|
||||
</x-slot:tabnav>
|
||||
|
||||
@@ -181,16 +181,14 @@ use Carbon\Carbon;
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
|
||||
|
||||
@can('assets.files', Asset::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'maintenance', 'item_id' => $maintenance->id])
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
||||
@can('files', $maintenance->asset)
|
||||
@include ('modals.upload-file', ['item_type' => 'maintenances', 'item_id' => $maintenance->id])
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table')
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<x-tabs>
|
||||
<x-slot:tabnav>
|
||||
<x-tabs.asset-tab count="{{ $model->assets()->AssetsForShow()->count() }}" />
|
||||
<x-tabs.files-tab name="files" count="{{ $model->uploads()->count() }}" />
|
||||
<x-tabs.files-tab :item="$model" count="{{ $model->uploads()->count() }}"/>
|
||||
<x-tabs.history-tab count="{{ $model->history()->count() }}" :model="$model"/>
|
||||
<x-tabs.upload-tab :item="$model"/>
|
||||
</x-slot:tabnav>
|
||||
@@ -68,15 +68,12 @@
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
|
||||
|
||||
@can('update', \App\Models\AssetModel::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'models', 'item_id' => $model->id])
|
||||
@endcan
|
||||
@stop
|
||||
@endsection
|
||||
|
||||
@section('moar_scripts')
|
||||
@can('files', $model)
|
||||
@include ('modals.upload-file', ['item_type' => 'models', 'item_id' => $model->id])
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'manufacturer' . $model->name . '-export', 'search' => false])
|
||||
|
||||
@stop
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'models-' . $model->name . '-export', 'search' => false])
|
||||
@endsection
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<x-tabs.consumable-tab count="{{ $supplier->consumables->count() }}" />
|
||||
<x-tabs.component-tab count="{{ $supplier->components->count() }}" />
|
||||
<x-tabs.maintenance-tab count="{{ $supplier->maintenances->count() }}"/>
|
||||
<x-tabs.files-tab count="{{ $supplier->uploads->count() }}"/>
|
||||
<x-tabs.files-tab :item="$supplier" count="{{ $supplier->uploads()->count() }}"/>
|
||||
<x-tabs.upload-tab :item="$supplier"/>
|
||||
|
||||
</x-slot:tabnav>
|
||||
@@ -143,15 +143,13 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@can('update', \App\Models\Supplier::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'supplier', 'item_id' => $supplier->id])
|
||||
@endcan
|
||||
@stop
|
||||
@endsection
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', [
|
||||
'exportFile' => 'locations-export',
|
||||
'search' => true
|
||||
])
|
||||
@can('files', $supplier)
|
||||
@include ('modals.upload-file', ['item_type' => 'suppliers', 'item_id' => $supplier->id])
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'suppliers-' . $supplier->name . '-export', 'search' => false])
|
||||
@endsection
|
||||
|
||||
@stop
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<x-tabs.license-tab count="{{ $user->licenses()->count() }}"/>
|
||||
<x-tabs.accessory-tab count="{{ $user->accessories()->count() }}"/>
|
||||
<x-tabs.consumable-tab count="{{ $user->consumables()->count() }}"/>
|
||||
<x-tabs.files-tab count="{{ $user->uploads()->count() }}"/>
|
||||
<x-tabs.files-tab :item="$user" count="{{ $supplier->uploads()->count() }}"/>
|
||||
<x-tabs.eula-tab count="{{ $user->eulas()->count() }}"/>
|
||||
<x-tabs.location-tab count="{{ $user->managedLocations()->count() }}"/>
|
||||
<x-tabs.user-tab count="{{ $user->managesUsers()->count() }}" name="managed-users" icon_type="manager" :label="trans('admin/users/table.managed_users')"/>
|
||||
@@ -565,16 +565,15 @@
|
||||
</x-page-column>
|
||||
</x-container>
|
||||
|
||||
@can('update', $user)
|
||||
@include ('modals.upload-file', ['item_type' => 'user', 'item_id' => $user->id])
|
||||
@endcan
|
||||
|
||||
@stop
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['simple_view' => true])
|
||||
@can('files', $user)
|
||||
@include ('modals.upload-file', ['item_type' => 'users', 'item_id' => $user->id])
|
||||
@endcan
|
||||
|
||||
@include ('partials.bootstrap-table', ['simple_view' => true])
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
$(function () {
|
||||
|
||||
@@ -618,5 +617,4 @@ $(function () {
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@stop
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user