Skip to content

Commit 512af90

Browse files
committed
Re-removed non-asset models from kits
These still do not work as expected.
1 parent fa5dd99 commit 512af90

File tree

3 files changed

+122
-109
lines changed

3 files changed

+122
-109
lines changed

app/Models/Accessory.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,19 @@ public function checkouts()
246246
->with('assignedTo');
247247
}
248248

249+
/**
250+
* Establishes the accessory -> users relationship
251+
*
252+
* @author [A. Gianotto] [<[email protected]>]
253+
* @since [v3.0]
254+
* @return \Illuminate\Database\Eloquent\Relations\Relation
255+
*/
256+
public function users()
257+
{
258+
return $this->belongsToMany(\App\Models\AccessoryCheckout::class, 'accessories_checkout')
259+
->with('assignedTo');
260+
}
261+
249262
/**
250263
* Establishes the accessory -> admin user relationship
251264
*

app/Models/PredefinedKit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public function consumables()
189189
*/
190190
public function accessories()
191191
{
192-
return $this->belongsToMany(\App\Models\Accessory::class, 'kits_accessories', 'kit_id', 'accessory_id')->withPivot('id', 'quantity');
192+
return $this->hasMany(\App\Models\Accessory::class, 'accessory_id', 'kit_id')->withPivot('id', 'quantity');
193193
}
194194

195195
/**

resources/views/kits/edit.blade.php

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -54,121 +54,121 @@ class="table table-striped snipe-table"
5454
</div> <!-- .col-md-12-->
5555
</div>
5656

57-
<div class="row">
58-
<div class="col-md-8 col-md-offset-2">
59-
<div class="box box-default">
60-
<div class="box-header with-border">
61-
<div class="row">
62-
<div class="col-md-8">
63-
<h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">
64-
{{ trans('general.licenses') }}
65-
</h3>
66-
</div>
57+
{{--<div class="row">--}}
58+
{{-- <div class="col-md-8 col-md-offset-2">--}}
59+
{{-- <div class="box box-default">--}}
60+
{{-- <div class="box-header with-border">--}}
61+
{{-- <div class="row">--}}
62+
{{-- <div class="col-md-8">--}}
63+
{{-- <h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">--}}
64+
{{-- {{ trans('general.licenses') }}--}}
65+
{{-- </h3>--}}
66+
{{-- </div>--}}
6767

68-
<div class="col-md-4 text-right">
69-
<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>
68+
{{-- <div class="col-md-4 text-right">--}}
69+
{{-- <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>--}}
7070

71-
</div>
72-
</div>
71+
{{-- </div>--}}
72+
{{-- </div>--}}
7373

74-
</div>
75-
<div class="box-body">
76-
<div class="table-responsive">
77-
<table
78-
data-cookie-id-table="kitLicensesTable"
79-
data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableLicenses() }}"
80-
data-side-pagination="server"
81-
data-sort-order="asc"
82-
data-sort-name="name"
83-
id="kitLicensesTable"
84-
class="table table-striped snipe-table"
85-
data-url="{{ route('api.kits.licenses.index', $item->id) }}"
86-
data-export-options='{
87-
"fileName": "export-kit-models-{{ date('Y-m-d') }}",
88-
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
89-
}'>
90-
</table>
91-
</div>
92-
</div> <!--.box-body-->
93-
</div> <!-- /.box.box-default-->
94-
</div> <!-- .col-md-12-->
95-
</div>
74+
{{-- </div>--}}
75+
{{-- <div class="box-body">--}}
76+
{{-- <div class="table-responsive">--}}
77+
{{-- <table--}}
78+
{{-- data-cookie-id-table="kitLicensesTable"--}}
79+
{{-- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableLicenses() }}"--}}
80+
{{-- data-side-pagination="server"--}}
81+
{{-- data-sort-order="asc"--}}
82+
{{-- data-sort-name="name"--}}
83+
{{-- id="kitLicensesTable"--}}
84+
{{-- class="table table-striped snipe-table"--}}
85+
{{-- data-url="{{ route('api.kits.licenses.index', $item->id) }}"--}}
86+
{{-- data-export-options='{--}}
87+
{{-- "fileName": "export-kit-models-{{ date('Y-m-d') }}",--}}
88+
{{-- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]--}}
89+
{{-- }'>--}}
90+
{{-- </table>--}}
91+
{{-- </div>--}}
92+
{{-- </div> <!--.box-body-->--}}
93+
{{-- </div> <!-- /.box.box-default-->--}}
94+
{{-- </div> <!-- .col-md-12-->--}}
95+
{{-- </div>--}}
9696

97-
<div class="row">
98-
<div class="col-md-8 col-md-offset-2">
99-
<div class="box box-default">
100-
<div class="box-header with-border">
101-
<div class="row">
102-
<div class="col-md-8">
103-
<h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">
104-
{{ trans('general.consumables') }}
105-
</h3>
106-
</div>
97+
{{--<div class="row">--}}
98+
{{-- <div class="col-md-8 col-md-offset-2">--}}
99+
{{-- <div class="box box-default">--}}
100+
{{-- <div class="box-header with-border">--}}
101+
{{-- <div class="row">--}}
102+
{{-- <div class="col-md-8">--}}
103+
{{-- <h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">--}}
104+
{{-- {{ trans('general.consumables') }}--}}
105+
{{-- </h3>--}}
106+
{{-- </div>--}}
107107

108-
<div class="col-md-4 text-right">
109-
<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>
110-
</div>
111-
</div>
112-
</div>
113-
<div class="box-body">
114-
<div class="table-responsive">
115-
<table
116-
data-cookie-id-table="kitConsumablesTable"
117-
data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableConsumables() }}"
118-
data-side-pagination="server"
119-
data-sort-order="asc"
120-
data-sort-name="name"
121-
id="kitConsumablesTable"
122-
class="table table-striped snipe-table"
123-
data-url="{{ route('api.kits.consumables.index', $item->id) }}"
124-
data-export-options='{
125-
"fileName": "export-kit-models-{{ date('Y-m-d') }}",
126-
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
127-
}'>
128-
</table>
129-
</div>
130-
</div> <!--.box-body-->
131-
</div> <!-- /.box.box-default-->
132-
</div> <!-- .col-md-12-->
133-
</div>
134-
<div class="row">
135-
<div class="col-md-8 col-md-offset-2">
136-
<div class="box box-default">
137-
<div class="box-header with-border">
138-
<div class="row">
139-
<div class="col-md-8">
140-
<h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">
141-
{{ trans('general.accessories') }}
142-
</h3>
143-
</div>
108+
{{-- <div class="col-md-4 text-right">--}}
109+
{{-- <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>--}}
110+
{{-- </div>--}}
111+
{{-- </div>--}}
112+
{{-- </div>--}}
113+
{{-- <div class="box-body">--}}
114+
{{-- <div class="table-responsive">--}}
115+
{{-- <table--}}
116+
{{-- data-cookie-id-table="kitConsumablesTable"--}}
117+
{{-- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableConsumables() }}"--}}
118+
{{-- data-side-pagination="server"--}}
119+
{{-- data-sort-order="asc"--}}
120+
{{-- data-sort-name="name"--}}
121+
{{-- id="kitConsumablesTable"--}}
122+
{{-- class="table table-striped snipe-table"--}}
123+
{{-- data-url="{{ route('api.kits.consumables.index', $item->id) }}"--}}
124+
{{-- data-export-options='{--}}
125+
{{-- "fileName": "export-kit-models-{{ date('Y-m-d') }}",--}}
126+
{{-- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]--}}
127+
{{-- }'>--}}
128+
{{-- </table>--}}
129+
{{-- </div>--}}
130+
{{-- </div> <!--.box-body-->--}}
131+
{{-- </div> <!-- /.box.box-default-->--}}
132+
{{-- </div> <!-- .col-md-12-->--}}
133+
{{-- </div>--}}
134+
{{--<div class="row">--}}
135+
{{-- <div class="col-md-8 col-md-offset-2">--}}
136+
{{-- <div class="box box-default">--}}
137+
{{-- <div class="box-header with-border">--}}
138+
{{-- <div class="row">--}}
139+
{{-- <div class="col-md-8">--}}
140+
{{-- <h3 class="box-title" style="padding-top: 8px; padding-left: 15px;">--}}
141+
{{-- {{ trans('general.accessories') }}--}}
142+
{{-- </h3>--}}
143+
{{-- </div>--}}
144144

145-
<div class="col-md-4 text-right">
146-
<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>
147-
</div>
148-
</div>
145+
{{-- <div class="col-md-4 text-right">--}}
146+
{{-- <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>--}}
147+
{{-- </div>--}}
148+
{{-- </div>--}}
149149

150-
</div>
151-
<div class="box-body">
152-
<div class="table-responsive">
153-
<table
154-
data-cookie-id-table="kitAccessoriesTable"
155-
data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableAccessories() }}"
156-
data-side-pagination="server"
157-
data-sort-order="asc"
158-
data-sort-name="name"
159-
id="kitAccessoriesTable"
160-
class="table table-striped snipe-table"
161-
data-url="{{ route('api.kits.accessories.index', $item->id) }}"
162-
data-export-options='{
163-
"fileName": "export-kit-models-{{ date('Y-m-d') }}",
164-
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
165-
}'>
166-
</table>
167-
</div>
168-
</div> <!--.box-body-->
169-
</div> <!-- /.box.box-default-->
170-
</div> <!-- .col-md-12-->
171-
</div>
150+
{{-- </div>--}}
151+
{{-- <div class="box-body">--}}
152+
{{-- <div class="table-responsive">--}}
153+
{{-- <table--}}
154+
{{-- data-cookie-id-table="kitAccessoriesTable"--}}
155+
{{-- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableAccessories() }}"--}}
156+
{{-- data-side-pagination="server"--}}
157+
{{-- data-sort-order="asc"--}}
158+
{{-- data-sort-name="name"--}}
159+
{{-- id="kitAccessoriesTable"--}}
160+
{{-- class="table table-striped snipe-table"--}}
161+
{{-- data-url="{{ route('api.kits.accessories.index', $item->id) }}"--}}
162+
{{-- data-export-options='{--}}
163+
{{-- "fileName": "export-kit-models-{{ date('Y-m-d') }}",--}}
164+
{{-- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]--}}
165+
{{-- }'>--}}
166+
{{-- </table>--}}
167+
{{-- </div>--}}
168+
{{-- </div> <!--.box-body-->--}}
169+
{{-- </div> <!-- /.box.box-default-->--}}
170+
{{-- </div> <!-- .col-md-12-->--}}
171+
{{-- </div>--}}
172172
@stop
173173

174174
@section('moar_scripts')

0 commit comments

Comments
 (0)