From c11e93b72fa864b716aa8f6c1823a75062c22b1c Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Sat, 9 Mar 2019 11:14:24 +0300
Subject: [PATCH 01/16] Update web.php
---
routes/web.php | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/routes/web.php b/routes/web.php
index aa96314757..f52d7d03f7 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -22,6 +22,16 @@ Route::group(['middleware' => 'auth'], function () {
Route::resource('locations', 'LocationsController', [
'parameters' => ['location' => 'location_id']
]);
+
+ Route::get(
+ '{locationId}/printonlyassignedtolocation',
+ [ 'as' => 'locations.printonlyassignedtolocation', 'uses' => 'LocationsController@printOnlyAssignedToLocation' ]
+ );
+
+ Route::get(
+ '{locationId}/printallassignedtolocation',
+ [ 'as' => 'locations.printallassignedtolocation', 'uses' => 'LocationsController@printAllAssignedToLocation' ]
+ );
/*
* Manufacturers
From a958d56590500b7df86a834207a227f689c542f1 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Sat, 9 Mar 2019 11:29:06 +0300
Subject: [PATCH 02/16] Update view.blade.php
---
resources/views/locations/view.blade.php | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/resources/views/locations/view.blade.php b/resources/views/locations/view.blade.php
index 932765dfc1..e5453a4999 100644
--- a/resources/views/locations/view.blade.php
+++ b/resources/views/locations/view.blade.php
@@ -9,10 +9,6 @@
@parent
@stop
-@section('header_right')
-{{ trans('admin/locations/table.update') }}
-@stop
-
{{-- Page content --}}
@section('content')
@@ -155,18 +151,23 @@
@endif
-
+
+
+
+
+
-
-
-
-
-
@stop
@section('moar_scripts')
From 311dd18443e7e4d3ccc4ee25f5951e6f95dd8ed7 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Sat, 9 Mar 2019 11:34:47 +0300
Subject: [PATCH 03/16] Update LocationsController.php
---
app/Http/Controllers/LocationsController.php | 22 ++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php
index 5f3de56fb8..a6ed370fd4 100755
--- a/app/Http/Controllers/LocationsController.php
+++ b/app/Http/Controllers/LocationsController.php
@@ -264,5 +264,27 @@ class LocationsController extends Controller
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist', compact('id')));
}
+
+ public function printOnlyAssignedToLocation($id)
+ {
+
+ $show_location = Location::where('id',$id)->withTrashed()->first();
+ $manager = User::where('id',$show_location->manager_id)->withTrashed()->first();
+ $assets = Asset::where('assigned_to', $id)->where('assigned_type', Location::class)->with('model', 'model.category')->get();
+ $users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
+ return view('locations/print')->with('assets', $assets)->with('users',$users)->with('show_location', $show_location)->with('manager', $manager);
+
+ }
+
+ public function printAllAssignedToLocation($id)
+ {
+
+ $show_location = Location::where('id',$id)->withTrashed()->first();
+ $manager = User::where('id',$show_location->manager_id)->withTrashed()->first();
+ $assets = Asset::where('location_id', $id)->with('model', 'model.category')->get();
+ $users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
+ return view('locations/print')->with('assets', $assets)->with('users',$users)->with('show_location', $show_location)->with('manager', $manager);
+
+ }
}
From 03c5b8e4abe5ae6052befef967708d65e45afe18 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Sat, 9 Mar 2019 11:36:42 +0300
Subject: [PATCH 04/16] Create print.blade.php
---
resources/views/locations/print.blade.php | 183 ++++++++++++++++++++++
1 file changed, 183 insertions(+)
create mode 100644 resources/views/locations/print.blade.php
diff --git a/resources/views/locations/print.blade.php b/resources/views/locations/print.blade.php
new file mode 100644
index 0000000000..d904d77087
--- /dev/null
+++ b/resources/views/locations/print.blade.php
@@ -0,0 +1,183 @@
+
+
+
+
+ Assigned to {{ $show_location->present()->fullName() }} Location
+
+
+
+
+@if ($snipeSettings->logo_print_assets=='1')
+ @if ($snipeSettings->brand == '3')
+
+
+ @if ($snipeSettings->logo!='')
+
+ @endif
+ {{ $snipeSettings->site_name }}
+
+ @elseif ($snipeSettings->brand == '2')
+ @if ($snipeSettings->logo!='')
+
+ @endif
+ @else
+ {{ $snipeSettings->site_name }}
+ @endif
+@endif
+
+Asset Management System
+
+Assigned To: {{ $show_location->present()->fullName() }}
+Manager: {{ $manager->present()->fullName() }}
+Current Date: {{ date("d/m/Y h:i:s A") }}
+
+@if ($users->count() > 0)
+ @php
+ $counter = 1;
+ @endphp
+
+
+
+ {{ trans('general.users') }} |
+
+
+
+
+ |
+ Company |
+ User Name |
+ Employee No. |
+ Department |
+ Location |
+
+
+ @foreach ($users as $user)
+
+
+ {{ $counter }} |
+ {{ $user->company->name }} |
+ {{ $user->first_name }} {{ $user->last_name }} |
+ {{ $user->employee_num }} |
+ {{ $user->department->name }} |
+ {{ $user->location->name }} |
+
+ @php
+ $counter++
+ @endphp
+ @endforeach
+
+@endif
+
+
+
+@if ($assets->count() > 0)
+
+
+
+
+ {{ trans('general.assets') }} |
+
+
+
+
+ |
+ Asset Tag |
+ Name |
+ Category |
+ Manufacturer |
+ Model |
+ Serial |
+ Location |
+ Checked Out |
+
+
+ @php
+ $counter = 1;
+ @endphp
+
+ @foreach ($assets as $asset)
+
+
+ {{ $counter }} |
+ {{ $asset->asset_tag }} |
+ {{ $asset->name }} |
+ {{ $asset->model->category->name }} |
+ {{ $asset->model->manufacturer->name }} |
+ {{ $asset->model->name }} {{ $asset->model->model_number }} |
+ {{ $asset->serial }} |
+ {{ $asset->location->name }} |
+ {{ $asset->last_checkout }} |
+
+ @php
+ $counter++
+ @endphp
+ @endforeach
+
+@endif
+
+
+
+
+
+
+
+
+ Signed By (Asset Auditor): |
+ ___________________________ |
+ |
+ Date: |
+ ____________________ |
+
+
+
+
+
+
+
+ Signed By (Finance Asset Auditor): |
+ ____________________ |
+ |
+ Date: |
+ ____________________ |
+
+
+
+
+
+
+
+ Signed By (Location Manager): |
+ _______________________ |
+ |
+ Date: |
+ ____________________ |
+
+
+
+
+
+
From 57c0f69286e087b40b72091e95305b8f17ddb8dc Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Sat, 9 Mar 2019 13:45:19 +0300
Subject: [PATCH 05/16] Update LocationsController.php
---
app/Http/Controllers/LocationsController.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php
index a6ed370fd4..01c16d58cd 100755
--- a/app/Http/Controllers/LocationsController.php
+++ b/app/Http/Controllers/LocationsController.php
@@ -269,9 +269,9 @@ class LocationsController extends Controller
{
$show_location = Location::where('id',$id)->withTrashed()->first();
- $manager = User::where('id',$show_location->manager_id)->withTrashed()->first();
+ $manager = User::where('id',$show_location->manager_id)->withTrashed()->first();
+ $users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
$assets = Asset::where('assigned_to', $id)->where('assigned_type', Location::class)->with('model', 'model.category')->get();
- $users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
return view('locations/print')->with('assets', $assets)->with('users',$users)->with('show_location', $show_location)->with('manager', $manager);
}
@@ -281,8 +281,8 @@ class LocationsController extends Controller
$show_location = Location::where('id',$id)->withTrashed()->first();
$manager = User::where('id',$show_location->manager_id)->withTrashed()->first();
+ $users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
$assets = Asset::where('location_id', $id)->with('model', 'model.category')->get();
- $users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
return view('locations/print')->with('assets', $assets)->with('users',$users)->with('show_location', $show_location)->with('manager', $manager);
}
From 7a68187466a172a6618f6b7f339b6cd45cc4d420 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Fri, 19 Apr 2019 13:20:31 +0300
Subject: [PATCH 06/16] Update table.php
---
resources/lang/en/admin/locations/table.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/resources/lang/en/admin/locations/table.php b/resources/lang/en/admin/locations/table.php
index ffa69307d5..1cbe540749 100644
--- a/resources/lang/en/admin/locations/table.php
+++ b/resources/lang/en/admin/locations/table.php
@@ -11,6 +11,8 @@ return array(
'country' => 'Country',
'create' => 'Create Location',
'update' => 'Update Location',
+ 'print_assigned' => 'Print Assigned',
+ 'print_all_assigned' => 'Print All Assigned',
'name' => 'Location Name',
'address' => 'Address',
'zip' => 'Postal Code',
From 38e80283004b81d6473c3abcf4df094d80ee2d73 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Fri, 19 Apr 2019 13:20:37 +0300
Subject: [PATCH 07/16] Update LocationsController.php
---
app/Http/Controllers/LocationsController.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php
index 01c16d58cd..c51dfd28b1 100755
--- a/app/Http/Controllers/LocationsController.php
+++ b/app/Http/Controllers/LocationsController.php
@@ -265,7 +265,7 @@ class LocationsController extends Controller
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist', compact('id')));
}
- public function printOnlyAssignedToLocation($id)
+ public function print_assigned($id)
{
$show_location = Location::where('id',$id)->withTrashed()->first();
@@ -276,7 +276,7 @@ class LocationsController extends Controller
}
- public function printAllAssignedToLocation($id)
+ public function print_all_assigned($id)
{
$show_location = Location::where('id',$id)->withTrashed()->first();
From f2242fa32e000515c05c141bde3db505790ae35d Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Fri, 19 Apr 2019 13:20:41 +0300
Subject: [PATCH 08/16] Update view.blade.php
---
resources/views/locations/view.blade.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/resources/views/locations/view.blade.php b/resources/views/locations/view.blade.php
index e5453a4999..0a92a57f20 100644
--- a/resources/views/locations/view.blade.php
+++ b/resources/views/locations/view.blade.php
@@ -157,10 +157,10 @@
{{ trans('admin/locations/table.update') }}
From 5dcf9fbb504b7859653c7f48d990d1c9fac6e6c3 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Fri, 19 Apr 2019 13:20:44 +0300
Subject: [PATCH 09/16] Update web.php
---
routes/web.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/routes/web.php b/routes/web.php
index f52d7d03f7..05747377d3 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -25,12 +25,12 @@ Route::group(['middleware' => 'auth'], function () {
Route::get(
'{locationId}/printonlyassignedtolocation',
- [ 'as' => 'locations.printonlyassignedtolocation', 'uses' => 'LocationsController@printOnlyAssignedToLocation' ]
+ [ 'as' => 'locations.print_assigned', 'uses' => 'LocationsController@print_assigned' ]
);
Route::get(
'{locationId}/printallassignedtolocation',
- [ 'as' => 'locations.printallassignedtolocation', 'uses' => 'LocationsController@printAllAssignedToLocation' ]
+ [ 'as' => 'locations.print_all_assigned', 'uses' => 'LocationsController@print_all_assigned' ]
);
/*
From c9749688214f29b06eee027e08d1f82de4241368 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Fri, 19 Apr 2019 14:03:09 +0300
Subject: [PATCH 10/16] Update view.blade.php
---
resources/views/locations/view.blade.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/resources/views/locations/view.blade.php b/resources/views/locations/view.blade.php
index 0a92a57f20..b4f7945381 100644
--- a/resources/views/locations/view.blade.php
+++ b/resources/views/locations/view.blade.php
@@ -154,13 +154,13 @@
From 52add03e568149c06c06200a786628d1e5e0e0f0 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Fri, 19 Apr 2019 15:43:40 +0300
Subject: [PATCH 11/16] Update print.blade.php
replace string in serial number with x except last five character
---
resources/views/users/print.blade.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php
index 974f32d997..76b7dab57f 100644
--- a/resources/views/users/print.blade.php
+++ b/resources/views/users/print.blade.php
@@ -117,7 +117,7 @@
{{ $lcounter }} |
{{ $license->name }} |
- {{ $license->serial }} |
+ {{ preg_replace ('/[a-zA-Z\d-]/', 'x', $license->serial, strlen($license->serial) -5) }} |
{{ $license->assetlog->first()->created_at }} |
@php
From a0721412fa77f153ca01b6c8d739feacad66328c Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Fri, 19 Apr 2019 15:50:05 +0300
Subject: [PATCH 12/16] Delete print.blade.php
---
resources/views/users/print.blade.php | 216 --------------------------
1 file changed, 216 deletions(-)
delete mode 100644 resources/views/users/print.blade.php
diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php
deleted file mode 100644
index 76b7dab57f..0000000000
--- a/resources/views/users/print.blade.php
+++ /dev/null
@@ -1,216 +0,0 @@
-
-
-
-
- Assigned to {{ $show_user->present()->fullName() }}
-
-
-
-
-@if ($snipeSettings->logo_print_assets=='1')
- @if ($snipeSettings->brand == '3')
-
-
- @if ($snipeSettings->logo!='')
-
- @endif
- {{ $snipeSettings->site_name }}
-
- @elseif ($snipeSettings->brand == '2')
- @if ($snipeSettings->logo!='')
-
- @endif
- @else
- {{ $snipeSettings->site_name }}
- @endif
-@endif
-
-Assigned to {{ $show_user->present()->fullName() }}
-
-@if ($assets->count() > 0)
- @php
- $counter = 1;
- @endphp
-
-
-
- {{ trans('general.assets') }} |
-
-
-
-
- |
- Asset Tag |
- Name |
- Category |
- Model |
- Serial |
- Checked Out |
-
-
-
- @foreach ($assets as $asset)
-
-
- {{ $counter }} |
- {{ $asset->asset_tag }} |
- {{ $asset->name }} |
- {{ $asset->model->category->name }} |
- {{ $asset->model->name }} |
- {{ $asset->serial }} |
-
- {{ $asset->last_checkout }} |
-
- @php
- $counter++
- @endphp
- @endforeach
-
-@endif
-
-@if ($licenses->count() > 0)
-
-
-
-
- {{ trans('general.licenses') }} |
-
-
-
-
- |
- Name |
- Serial/Product Key |
- Checked Out |
-
-
- @php
- $lcounter = 1;
- @endphp
-
- @foreach ($licenses as $license)
-
-
- {{ $lcounter }} |
- {{ $license->name }} |
- {{ preg_replace ('/[a-zA-Z\d-]/', 'x', $license->serial, strlen($license->serial) -5) }} |
- {{ $license->assetlog->first()->created_at }} |
-
- @php
- $lcounter++
- @endphp
- @endforeach
-
-@endif
-
-
-@if ($accessories->count() > 0)
-
-
-
-
- {{ trans('general.accessories') }} |
-
-
-
-
- |
- Name |
- Category |
- Checked Out |
-
-
- @php
- $acounter = 1;
- @endphp
-
- @foreach ($accessories as $accessory)
-
-
- {{ $acounter }} |
- {{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }} |
- {{ $accessory->category->name }} |
- {{ $accessory->assetlog->first()->created_at }} |
-
- @php
- $acounter++
- @endphp
- @endforeach
-
-@endif
-
-@if ($consumables->count() > 0)
-
-
-
-
- {{ trans('general.consumables') }} |
-
-
-
-
- |
- Name |
- Category |
- Checked Out |
-
-
- @php
- $ccounter = 1;
- @endphp
-
- @foreach ($consumables as $consumable)
-
-
- {{ $ccounter }} |
- {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }} |
- {{ $consumable->category->name }} |
- {{ $consumable->assetlog->first()->created_at }} |
-
- @php
- $ccounter++
- @endphp
- @endforeach
-
-@endif
-
-
-
-
-
-
- Signed Off By: |
- ________________________________________________________ |
- |
- Date: |
- ________________________________________________________ |
-
-
-
-
-
-
From 878cfee5a2a7f5c17292cc9b57d0b420c58e0cec Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Sat, 20 Apr 2019 09:28:48 +0300
Subject: [PATCH 13/16] Revert "Delete print.blade.php"
This reverts commit a0721412fa77f153ca01b6c8d739feacad66328c.
---
resources/views/users/print.blade.php | 216 ++++++++++++++++++++++++++
1 file changed, 216 insertions(+)
create mode 100644 resources/views/users/print.blade.php
diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php
new file mode 100644
index 0000000000..76b7dab57f
--- /dev/null
+++ b/resources/views/users/print.blade.php
@@ -0,0 +1,216 @@
+
+
+
+
+ Assigned to {{ $show_user->present()->fullName() }}
+
+
+
+
+@if ($snipeSettings->logo_print_assets=='1')
+ @if ($snipeSettings->brand == '3')
+
+
+ @if ($snipeSettings->logo!='')
+
+ @endif
+ {{ $snipeSettings->site_name }}
+
+ @elseif ($snipeSettings->brand == '2')
+ @if ($snipeSettings->logo!='')
+
+ @endif
+ @else
+ {{ $snipeSettings->site_name }}
+ @endif
+@endif
+
+Assigned to {{ $show_user->present()->fullName() }}
+
+@if ($assets->count() > 0)
+ @php
+ $counter = 1;
+ @endphp
+
+
+
+ {{ trans('general.assets') }} |
+
+
+
+
+ |
+ Asset Tag |
+ Name |
+ Category |
+ Model |
+ Serial |
+ Checked Out |
+
+
+
+ @foreach ($assets as $asset)
+
+
+ {{ $counter }} |
+ {{ $asset->asset_tag }} |
+ {{ $asset->name }} |
+ {{ $asset->model->category->name }} |
+ {{ $asset->model->name }} |
+ {{ $asset->serial }} |
+
+ {{ $asset->last_checkout }} |
+
+ @php
+ $counter++
+ @endphp
+ @endforeach
+
+@endif
+
+@if ($licenses->count() > 0)
+
+
+
+
+ {{ trans('general.licenses') }} |
+
+
+
+
+ |
+ Name |
+ Serial/Product Key |
+ Checked Out |
+
+
+ @php
+ $lcounter = 1;
+ @endphp
+
+ @foreach ($licenses as $license)
+
+
+ {{ $lcounter }} |
+ {{ $license->name }} |
+ {{ preg_replace ('/[a-zA-Z\d-]/', 'x', $license->serial, strlen($license->serial) -5) }} |
+ {{ $license->assetlog->first()->created_at }} |
+
+ @php
+ $lcounter++
+ @endphp
+ @endforeach
+
+@endif
+
+
+@if ($accessories->count() > 0)
+
+
+
+
+ {{ trans('general.accessories') }} |
+
+
+
+
+ |
+ Name |
+ Category |
+ Checked Out |
+
+
+ @php
+ $acounter = 1;
+ @endphp
+
+ @foreach ($accessories as $accessory)
+
+
+ {{ $acounter }} |
+ {{ ($accessory->manufacturer) ? $accessory->manufacturer->name : '' }} {{ $accessory->name }} {{ $accessory->model_number }} |
+ {{ $accessory->category->name }} |
+ {{ $accessory->assetlog->first()->created_at }} |
+
+ @php
+ $acounter++
+ @endphp
+ @endforeach
+
+@endif
+
+@if ($consumables->count() > 0)
+
+
+
+
+ {{ trans('general.consumables') }} |
+
+
+
+
+ |
+ Name |
+ Category |
+ Checked Out |
+
+
+ @php
+ $ccounter = 1;
+ @endphp
+
+ @foreach ($consumables as $consumable)
+
+
+ {{ $ccounter }} |
+ {{ ($consumable->manufacturer) ? $consumable->manufacturer->name : '' }} {{ $consumable->name }} {{ $consumable->model_number }} |
+ {{ $consumable->category->name }} |
+ {{ $consumable->assetlog->first()->created_at }} |
+
+ @php
+ $ccounter++
+ @endphp
+ @endforeach
+
+@endif
+
+
+
+
+
+
+ Signed Off By: |
+ ________________________________________________________ |
+ |
+ Date: |
+ ________________________________________________________ |
+
+
+
+
+
+
From 9b3a8c046c09eab98334f4474e712792b004dfc9 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Fri, 3 May 2019 15:21:57 +0300
Subject: [PATCH 14/16] Update LocationsController.php
---
app/Http/Controllers/LocationsController.php | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php
index c51dfd28b1..abe7ee43ad 100755
--- a/app/Http/Controllers/LocationsController.php
+++ b/app/Http/Controllers/LocationsController.php
@@ -265,26 +265,28 @@ class LocationsController extends Controller
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist', compact('id')));
}
- public function print_assigned($id)
+public function print_assigned($id)
{
- $show_location = Location::where('id',$id)->withTrashed()->first();
- $manager = User::where('id',$show_location->manager_id)->withTrashed()->first();
+ $location = Location::where('id',$id)->first();
+ $parent = Location::where('id',$location->parent_id)->first();
+ $manager = User::where('id',$location->manager_id)->first();
$users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
$assets = Asset::where('assigned_to', $id)->where('assigned_type', Location::class)->with('model', 'model.category')->get();
- return view('locations/print')->with('assets', $assets)->with('users',$users)->with('show_location', $show_location)->with('manager', $manager);
+ return view('locations/print')->with('assets', $assets)->with('users',$users)->with('location', $location)->with('parent', $parent)->with('manager', $manager);
}
public function print_all_assigned($id)
{
- $show_location = Location::where('id',$id)->withTrashed()->first();
- $manager = User::where('id',$show_location->manager_id)->withTrashed()->first();
- $users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
+ $location = Location::where('id',$id)->first();
+ $parent = Location::where('id',$location->parent_id)->first();
+ $manager = User::where('id',$location->manager_id)->first();
+ $users = User::where('location_id', $id)->with('company', 'department', 'location')->get();
$assets = Asset::where('location_id', $id)->with('model', 'model.category')->get();
- return view('locations/print')->with('assets', $assets)->with('users',$users)->with('show_location', $show_location)->with('manager', $manager);
+ return view('locations/print')->with('assets', $assets)->with('users',$users)->with('location', $location)->with('parent', $parent)->with('manager', $manager);
}
-}
+}
\ No newline at end of file
From 0cdc7af6119445dccdeaecf986d3bd29e2a02378 Mon Sep 17 00:00:00 2001
From: ajsy <35658596+ajsy@users.noreply.github.com>
Date: Fri, 3 May 2019 15:22:01 +0300
Subject: [PATCH 15/16] Update print.blade.php
---
resources/views/locations/print.blade.php | 41 +++++++++++++----------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/resources/views/locations/print.blade.php b/resources/views/locations/print.blade.php
index d904d77087..3d20a6ce11 100644
--- a/resources/views/locations/print.blade.php
+++ b/resources/views/locations/print.blade.php
@@ -2,7 +2,7 @@
- Assigned to {{ $show_location->present()->fullName() }} Location
+ Assigned to {{ $location->present()->fullName() }} Location