From 92afd5f232f5770fd096912551babca69ab620b4 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 11:48:59 -0800 Subject: [PATCH 01/11] Removed debugging console code --- resources/views/partials/bootstrap-table.blade.php | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index adb3c9b552..1f78566ad1 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -371,7 +371,6 @@ return '' + row.custom_fields[field_column_plain].value + ''; } } - console.log('NOT a URL!'); return row.custom_fields[field_column_plain].value; } From e25829c75900e01a550fecbbc05fc45b3ae92cb4 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 13:30:20 -0800 Subject: [PATCH 02/11] Removed extra debug logging --- app/Models/CustomField.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Models/CustomField.php b/app/Models/CustomField.php index 350b1e8408..5906fed929 100644 --- a/app/Models/CustomField.php +++ b/app/Models/CustomField.php @@ -160,7 +160,6 @@ class CustomField extends Model public function getFormatAttribute($value) { foreach (self::$PredefinedFormats as $name => $pattern) { - \Log::debug($name.'=>'.$pattern); if ($pattern === $value) { return $name; } From ece8ae3adcd3c9d80e5e4ebb7b069da8118f4392 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 13:31:46 -0800 Subject: [PATCH 03/11] Fixed #4542 and #4482 - default asset location not updating on biulk edit --- resources/views/hardware/bulk.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.php index 6cb84f6dfc..ff0c4cb8c6 100755 --- a/resources/views/hardware/bulk.blade.php +++ b/resources/views/hardware/bulk.blade.php @@ -52,7 +52,7 @@ @include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id']) - @include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.default_location'), 'fieldname' => 'location_id']) + @include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.default_location'), 'fieldname' => 'rtd_location_id']) From d3864db5e1ce16ef9a58eeb47a018ca23d6fe1f7 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 13:32:00 -0800 Subject: [PATCH 04/11] Switched to use $request from Input:: facade --- app/Http/Controllers/AssetsController.php | 77 ++++++++++++----------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index 4e020e52e0..8fbc12b5b5 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -1081,70 +1081,73 @@ class AssetsController extends Controller * @internal param array $assets * @since [v2.0] */ - public function postBulkSave() + public function postBulkSave(Request $request) { $this->authorize('update', Asset::class); - if (Input::has('ids')) { - $assets = Input::get('ids'); - if ((Input::has('purchase_date')) - || (Input::has('purchase_cost')) - || (Input::has('supplier_id')) - || (Input::has('order_number')) - || (Input::has('warranty_months')) - || (Input::has('rtd_location_id')) - || (Input::has('requestable')) - || (Input::has('company_id')) - || (Input::has('status_id')) - || (Input::has('model_id')) + + \Log::debug($request->input('ids')); + + if (($request->has('ids')) && (count($request->input('ids') > 0))) { + $assets = $request->input('ids'); + if (($request->has('purchase_date')) + || ($request->has('purchase_cost')) + || ($request->has('supplier_id')) + || ($request->has('order_number')) + || ($request->has('warranty_months')) + || ($request->has('rtd_location_id')) + || ($request->has('requestable')) + || ($request->has('company_id')) + || ($request->has('status_id')) + || ($request->has('model_id')) ) { foreach ($assets as $key => $value) { $update_array = array(); - if (Input::has('purchase_date')) { - $update_array['purchase_date'] = e(Input::get('purchase_date')); + if ($request->has('purchase_date')) { + $update_array['purchase_date'] = $request->input('purchase_date'); } - if (Input::has('purchase_cost')) { - $update_array['purchase_cost'] = Helper::ParseFloat(e(Input::get('purchase_cost'))); + if ($request->has('purchase_cost')) { + $update_array['purchase_cost'] = Helper::ParseFloat($request->has('purchase_cost')); } - if (Input::has('supplier_id')) { - $update_array['supplier_id'] = e(Input::get('supplier_id')); + if ($request->has('supplier_id')) { + $update_array['supplier_id'] = $request->input('supplier_id'); } - if (Input::has('model_id')) { - $update_array['model_id'] = e(Input::get('model_id')); + if ($request->has('model_id')) { + $update_array['model_id'] = $request->input('model_id'); } - if (Input::has('company_id')) { - if (Input::get('company_id')=="clear") { + if ($request->has('company_id')) { + if ($request->input('company_id')=="clear") { $update_array['company_id'] = null; } else { - $update_array['company_id'] = e(Input::get('company_id')); + $update_array['company_id'] = $request->input('company_id'); } } - if (Input::has('order_number')) { - $update_array['order_number'] = e(Input::get('order_number')); + if ($request->has('order_number')) { + $update_array['order_number'] = $request->input('order_number'); } - if (Input::has('warranty_months')) { - $update_array['warranty_months'] = e(Input::get('warranty_months')); + if ($request->has('warranty_months')) { + $update_array['warranty_months'] = $request->input('warranty_months'); } - if (Input::has('rtd_location_id')) { - $update_array['rtd_location_id'] = e(Input::get('rtd_location_id')); + if ($request->has('rtd_location_id')) { + $update_array['rtd_location_id'] = $request->input('rtd_location_id'); } - if (Input::has('status_id')) { - $update_array['status_id'] = e(Input::get('status_id')); + if ($request->has('status_id')) { + $update_array['status_id'] = $request->input('status_id'); } - if (Input::has('requestable')) { - $update_array['requestable'] = e(Input::get('requestable')); + if ($request->has('requestable')) { + $update_array['requestable'] = $request->input('requestable'); } DB::table('assets') ->where('id', $key) ->update($update_array); } // endforeach - return redirect()->to("hardware")->with('success', trans('admin/hardware/message.update.success')); + return redirect()->route("hardware.index")->with('success', trans('admin/hardware/message.update.success')); // no values given, nothing to update } - return redirect()->to("hardware")->with('info', trans('admin/hardware/message.update.nothing_updated')); + return redirect()->route("hardware.index")->with('warning', trans('admin/hardware/message.update.nothing_updated')); } // endif - return redirect()->to("hardware"); + return redirect()->route("hardware.index")->with('warning', trans('No assets selected, so nothing was updated.')); } /** From cc5eee1890b912c955bd55bdd391b32c4a2d200f Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 13:32:12 -0800 Subject: [PATCH 05/11] Auto-bumped hash/version --- config/version.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/version.php b/config/version.php index 89962fc935..d1f5f24cca 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v4.1.6-pre', - 'full_app_version' => 'v4.1.6-pre - build 2800-gfcc87b3', - 'build_version' => '2800', + 'full_app_version' => 'v4.1.6-pre - build 2805-gb934d2e', + 'build_version' => '2805', 'prerelease_version' => '', - 'hash_version' => 'gfcc87b3', - 'full_hash' => 'v4.1.5-62-gfcc87b3', + 'hash_version' => 'gb934d2e', + 'full_hash' => 'v4.1.5-76-gb934d2e', 'branch' => 'develop', ); \ No newline at end of file From cefdca3d220e99601dedafd570b4a81729546180 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 13:40:26 -0800 Subject: [PATCH 06/11] Fixed incorrect has vs input --- app/Http/Controllers/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index 8fbc12b5b5..ffbe5ad408 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -1107,7 +1107,7 @@ class AssetsController extends Controller $update_array['purchase_date'] = $request->input('purchase_date'); } if ($request->has('purchase_cost')) { - $update_array['purchase_cost'] = Helper::ParseFloat($request->has('purchase_cost')); + $update_array['purchase_cost'] = Helper::ParseFloat($request->input('purchase_cost')); } if ($request->has('supplier_id')) { $update_array['supplier_id'] = $request->input('supplier_id'); From 51168e8e102449d87e41f04994589a7e49265b8b Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 13:40:36 -0800 Subject: [PATCH 07/11] Auto-bumped hash/version --- config/version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/version.php b/config/version.php index d1f5f24cca..a76025bf91 100644 --- a/config/version.php +++ b/config/version.php @@ -1,8 +1,8 @@ 'v4.1.6-pre', - 'full_app_version' => 'v4.1.6-pre - build 2805-gb934d2e', - 'build_version' => '2805', + 'full_app_version' => 'v4.1.6-pre - build 2807-gb934d2e', + 'build_version' => '2807', 'prerelease_version' => '', 'hash_version' => 'gb934d2e', 'full_hash' => 'v4.1.5-76-gb934d2e', From 0a5b72e71e5091e361e8bb4189f44044ce0b950a Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 16:39:59 -0800 Subject: [PATCH 08/11] Fixed #4517 - order number not visible if no purchase cost given on asset view --- resources/views/hardware/view.blade.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 8c1f85f7c6..2dece57b15 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -233,9 +233,15 @@ @endif {{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost)}} - @if ($asset->order_number) - (Order #{{ $asset->order_number }}) - @endif + + + + @endif + @if ($asset->order_number) + + {{ trans('general.order_number') }} + + #{{ $asset->order_number }} @endif From e9fdf06bf61ccd39693130242e9ccfea28e02975 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 16:40:37 -0800 Subject: [PATCH 09/11] Improved display of asset status and meta status --- resources/views/hardware/view.blade.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 2dece57b15..a55de38396 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -82,13 +82,23 @@ {{ trans('general.status') }} - @if ($asset->assetstatus->color) - -     - + + @if (($asset->assignedTo) && ($asset->deleted_at=='')) + {{ trans('general.deployed') }} {!! $asset->assignedTo->present()->glyph() !!} + {!! $asset->assignedTo->present()->nameUrl() !!} + @else + @if (($asset->assetstatus) && ($asset->assetstatus->deployable=='1')) + + @elseif (($asset->assetstatus) && ($asset->assetstatus->pending=='1')) + + @elseif (($asset->assetstatus) && ($asset->assetstatus->archived=='1')) + + @endif + + {{ $asset->assetstatus->name }} + + @endif - {{ $asset->assetstatus->name }} - @endif From fd4a8edae9a19fcbe1de3d5bcab22cbe406629b0 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 16:40:58 -0800 Subject: [PATCH 10/11] Fixed incorrect glyphs for users/locations --- app/Presenters/LocationPresenter.php | 2 +- app/Presenters/UserPresenter.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Presenters/LocationPresenter.php b/app/Presenters/LocationPresenter.php index 8325382fc4..6189f7b328 100644 --- a/app/Presenters/LocationPresenter.php +++ b/app/Presenters/LocationPresenter.php @@ -40,7 +40,7 @@ class LocationPresenter extends Presenter public function glyph() { - return ''; + return ''; } public function fullName() { diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index 1515a76f6b..3cee47cf29 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -352,6 +352,6 @@ class UserPresenter extends Presenter public function glyph() { - return ''; + return ''; } } From 5efb803b6026500482fdef3c9cb4056f9e3fec2d Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Nov 2017 16:41:06 -0800 Subject: [PATCH 11/11] Auto-bumped hash/version --- config/version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/version.php b/config/version.php index a76025bf91..c97c32345c 100644 --- a/config/version.php +++ b/config/version.php @@ -1,8 +1,8 @@ 'v4.1.6-pre', - 'full_app_version' => 'v4.1.6-pre - build 2807-gb934d2e', - 'build_version' => '2807', + 'full_app_version' => 'v4.1.6-pre - build 2811-gb934d2e', + 'build_version' => '2811', 'prerelease_version' => '', 'hash_version' => 'gb934d2e', 'full_hash' => 'v4.1.5-76-gb934d2e',