Skip to content

A free open source IT asset/license management system

Re-removed non-asset models from kits

snipe512af90d3189
diff --git a/app/Models/Accessory.php b/app/Models/Accessory.php
index 4a7f6f5f40..8edfac2115 100755
--- a/app/Models/Accessory.php
+++ b/app/Models/Accessory.php
@@ -246,6 +246,19 @@ class Accessory extends SnipeModel
->with('assignedTo');
}
+ /**
+ * Establishes the accessory -> users relationship
+ *
+ * @author [A. Gianotto] [<[email protected]>]
+ * @since [v3.0]
+ * @return \Illuminate\Database\Eloquent\Relations\Relation
+ */
+ public function users()
+ {
+ return $this->belongsToMany(\App\Models\AccessoryCheckout::class, 'accessories_checkout')
+ ->with('assignedTo');
+ }
+
/**
* Establishes the accessory -> admin user relationship
*
diff --git a/app/Models/PredefinedKit.php b/app/Models/PredefinedKit.php
index 2d0c87066e..42dfdd9377 100644
--- a/app/Models/PredefinedKit.php
+++ b/app/Models/PredefinedKit.php
@@ -189,7 +189,7 @@ class PredefinedKit extends SnipeModel
*/
public function accessories()
{
- return $this->belongsToMany(\App\Models\Accessory::class, 'kits_accessories', 'kit_id', 'accessory_id')->withPivot('id', 'quantity');
+ return $this->hasMany(\App\Models\Accessory::class, 'accessory_id', 'kit_id')->withPivot('id', 'quantity');
}
/**
diff --git a/resources/views/kits/edit.blade.php b/resources/views/kits/edit.blade.php
index 032061c060..bfbad4d688 100644
--- a/resources/views/kits/edit.blade.php
+++ b/resources/views/kits/edit.blade.php
@@ -54,121 +54,121 @@
</div> <!-- .col-md-12-->
</div>
-<div class="row">
- <div class="col-md-8 col-md-offset-2">
- <div class="box box-default">
- <div class="box-header with-border">
- <div class="row">
- <div class="col-md-8">
- <h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">
- {{ trans('general.licenses') }}
- </h3>
- </div>
+{{--<div class="row">--}}
+{{-- <div class="col-md-8 col-md-offset-2">--}}
+{{-- <div class="box box-default">--}}
+{{-- <div class="box-header with-border">--}}
+{{-- <div class="row">--}}
+{{-- <div class="col-md-8">--}}
+{{-- <h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">--}}
+{{-- {{ trans('general.licenses') }}--}}
+{{-- </h3>--}}
+{{-- </div>--}}
- <div class="col-md-4 text-right">
- <a href="{{ route('modal.show', [ 'type' => 'kit-license', 'itemId' => $item->id]) }}" data-refresh="kitLicensesTable" data-toggle="modal" data-target="#createModal" class="btn btn-theme btn-sm pull-right"><i class="fas fa-plus icon-white"></i> {{ trans('general.append') }} </a>
+{{-- <div class="col-md-4 text-right">--}}
+{{-- <a href="{{ route('modal.show', [ 'type' => 'kit-license', 'itemId' => $item->id]) }}" data-refresh="kitLicensesTable" data-toggle="modal" data-target="#createModal" class="btn btn-theme btn-sm pull-right"><i class="fas fa-plus icon-white"></i> {{ trans('general.append') }} </a>--}}
- </div>
- </div>
+{{-- </div>--}}
+{{-- </div>--}}
- </div>
- <div class="box-body">
- <div class="table-responsive">
- <table
- data-cookie-id-table="kitLicensesTable"
- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableLicenses() }}"
- data-side-pagination="server"
- data-sort-order="asc"
- data-sort-name="name"
- id="kitLicensesTable"
- class="table table-striped snipe-table"
- data-url="{{ route('api.kits.licenses.index', $item->id) }}"
- data-export-options='{
- "fileName": "export-kit-models-{{ date('Y-m-d') }}",
- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
- }'>
- </table>
- </div>
- </div> <!--.box-body-->
- </div> <!-- /.box.box-default-->
- </div> <!-- .col-md-12-->
- </div>
+{{-- </div>--}}
+{{-- <div class="box-body">--}}
+{{-- <div class="table-responsive">--}}
+{{-- <table--}}
+{{-- data-cookie-id-table="kitLicensesTable"--}}
+{{-- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableLicenses() }}"--}}
+{{-- data-side-pagination="server"--}}
+{{-- data-sort-order="asc"--}}
+{{-- data-sort-name="name"--}}
+{{-- id="kitLicensesTable"--}}
+{{-- class="table table-striped snipe-table"--}}
+{{-- data-url="{{ route('api.kits.licenses.index', $item->id) }}"--}}
+{{-- data-export-options='{--}}
+{{-- "fileName": "export-kit-models-{{ date('Y-m-d') }}",--}}
+{{-- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]--}}
+{{-- }'>--}}
+{{-- </table>--}}
+{{-- </div>--}}
+{{-- </div> <!--.box-body-->--}}
+{{-- </div> <!-- /.box.box-default-->--}}
+{{-- </div> <!-- .col-md-12-->--}}
+{{-- </div>--}}
-<div class="row">
- <div class="col-md-8 col-md-offset-2">
- <div class="box box-default">
- <div class="box-header with-border">
- <div class="row">
- <div class="col-md-8">
- <h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">
- {{ trans('general.consumables') }}
- </h3>
- </div>
+{{--<div class="row">--}}
+{{-- <div class="col-md-8 col-md-offset-2">--}}
+{{-- <div class="box box-default">--}}
+{{-- <div class="box-header with-border">--}}
+{{-- <div class="row">--}}
+{{-- <div class="col-md-8">--}}
+{{-- <h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">--}}
+{{-- {{ trans('general.consumables') }}--}}
+{{-- </h3>--}}
+{{-- </div>--}}
- <div class="col-md-4 text-right">
- <a href="{{ route('modal.show', ['type' => 'kit-consumable', 'itemId' => $item->id]) }}" data-refresh="kitConsumablesTable" data-toggle="modal" data-target="#createModal" class="btn btn-theme btn-sm pull-right"><i class="fas fa-plus icon-white"></i> {{ trans('general.append') }}</a>
- </div>
- </div>
- </div>
- <div class="box-body">
- <div class="table-responsive">
- <table
- data-cookie-id-table="kitConsumablesTable"
- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableConsumables() }}"
- data-side-pagination="server"
- data-sort-order="asc"
- data-sort-name="name"
- id="kitConsumablesTable"
- class="table table-striped snipe-table"
- data-url="{{ route('api.kits.consumables.index', $item->id) }}"
- data-export-options='{
- "fileName": "export-kit-models-{{ date('Y-m-d') }}",
- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
- }'>
- </table>
- </div>
- </div> <!--.box-body-->
- </div> <!-- /.box.box-default-->
- </div> <!-- .col-md-12-->
- </div>
-<div class="row">
- <div class="col-md-8 col-md-offset-2">
- <div class="box box-default">
- <div class="box-header with-border">
- <div class="row">
- <div class="col-md-8">
- <h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">
- {{ trans('general.accessories') }}
- </h3>
- </div>
+{{-- <div class="col-md-4 text-right">--}}
+{{-- <a href="{{ route('modal.show', ['type' => 'kit-consumable', 'itemId' => $item->id]) }}" data-refresh="kitConsumablesTable" data-toggle="modal" data-target="#createModal" class="btn btn-theme btn-sm pull-right"><i class="fas fa-plus icon-white"></i> {{ trans('general.append') }}</a>--}}
+{{-- </div>--}}
+{{-- </div>--}}
+{{-- </div>--}}
+{{-- <div class="box-body">--}}
+{{-- <div class="table-responsive">--}}
+{{-- <table--}}
+{{-- data-cookie-id-table="kitConsumablesTable"--}}
+{{-- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableConsumables() }}"--}}
+{{-- data-side-pagination="server"--}}
+{{-- data-sort-order="asc"--}}
+{{-- data-sort-name="name"--}}
+{{-- id="kitConsumablesTable"--}}
+{{-- class="table table-striped snipe-table"--}}
+{{-- data-url="{{ route('api.kits.consumables.index', $item->id) }}"--}}
+{{-- data-export-options='{--}}
+{{-- "fileName": "export-kit-models-{{ date('Y-m-d') }}",--}}
+{{-- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]--}}
+{{-- }'>--}}
+{{-- </table>--}}
+{{-- </div>--}}
+{{-- </div> <!--.box-body-->--}}
+{{-- </div> <!-- /.box.box-default-->--}}
+{{-- </div> <!-- .col-md-12-->--}}
+{{-- </div>--}}
+{{--<div class="row">--}}
+{{-- <div class="col-md-8 col-md-offset-2">--}}
+{{-- <div class="box box-default">--}}
+{{-- <div class="box-header with-border">--}}
+{{-- <div class="row">--}}
+{{-- <div class="col-md-8">--}}
+{{-- <h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">--}}
+{{-- {{ trans('general.accessories') }}--}}
+{{-- </h3>--}}
+{{-- </div>--}}
- <div class="col-md-4 text-right">
- <a href="{{ route('modal.show', ['type' => 'kit-accessory', 'itemId' => $item->id]) }}" data-refresh="kitAccessoriesTable" data-toggle="modal" data-target="#createModal" class="btn btn-theme btn-sm pull-right"><i class="fas fa-plus icon-white"></i> {{ trans('general.append') }}</a>
- </div>
- </div>
+{{-- <div class="col-md-4 text-right">--}}
+{{-- <a href="{{ route('modal.show', ['type' => 'kit-accessory', 'itemId' => $item->id]) }}" data-refresh="kitAccessoriesTable" data-toggle="modal" data-target="#createModal" class="btn btn-theme btn-sm pull-right"><i class="fas fa-plus icon-white"></i> {{ trans('general.append') }}</a>--}}
+{{-- </div>--}}
+{{-- </div>--}}
- </div>
- <div class="box-body">
- <div class="table-responsive">
- <table
- data-cookie-id-table="kitAccessoriesTable"
- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableAccessories() }}"
- data-side-pagination="server"
- data-sort-order="asc"
- data-sort-name="name"
- id="kitAccessoriesTable"
- class="table table-striped snipe-table"
- data-url="{{ route('api.kits.accessories.index', $item->id) }}"
- data-export-options='{
- "fileName": "export-kit-models-{{ date('Y-m-d') }}",
- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
- }'>
- </table>
- </div>
- </div> <!--.box-body-->
- </div> <!-- /.box.box-default-->
- </div> <!-- .col-md-12-->
- </div>
+{{-- </div>--}}
+{{-- <div class="box-body">--}}
+{{-- <div class="table-responsive">--}}
+{{-- <table--}}
+{{-- data-cookie-id-table="kitAccessoriesTable"--}}
+{{-- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableAccessories() }}"--}}
+{{-- data-side-pagination="server"--}}
+{{-- data-sort-order="asc"--}}
+{{-- data-sort-name="name"--}}
+{{-- id="kitAccessoriesTable"--}}
+{{-- class="table table-striped snipe-table"--}}
+{{-- data-url="{{ route('api.kits.accessories.index', $item->id) }}"--}}
+{{-- data-export-options='{--}}
+{{-- "fileName": "export-kit-models-{{ date('Y-m-d') }}",--}}
+{{-- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]--}}
+{{-- }'>--}}
+{{-- </table>--}}
+{{-- </div>--}}
+{{-- </div> <!--.box-body-->--}}
+{{-- </div> <!-- /.box.box-default-->--}}
+{{-- </div> <!-- .col-md-12-->--}}
+{{-- </div>--}}
@stop
@section('moar_scripts')