From 8140bdaa88b0fad04d89d243d1af8ba688dd5309 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 1 Dec 2017 14:25:32 -0800 Subject: [PATCH 01/25] Fixed repeated header issue in asset export --- app/Http/Controllers/ReportsController.php | 49 +++++++++++----------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index c646e9e6ef..c3bc7b4136 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -141,34 +141,35 @@ class ReportsController extends Controller break; } + $headers=[ + trans('general.company'), + trans('admin/hardware/table.asset_tag'), + trans('admin/hardware/form.manufacturer'), + trans('admin/hardware/form.model'), + trans('general.model_no'), + trans('general.name'), + trans('admin/hardware/table.serial'), + trans('general.status'), + trans('admin/hardware/table.purchase_date'), + trans('admin/hardware/table.purchase_cost'), + trans('admin/hardware/form.order'), + trans('general.supplier'), + trans('admin/hardware/table.checkoutto'), + trans('general.type'), + trans('admin/hardware/table.checkout_date'), + trans('admin/hardware/table.location'), + trans('general.notes'), + ]; + foreach ($customfields as $field) { + $headers[]=$field->name; + } + fputcsv($handle, $headers); + $assets->orderBy('created_at', 'DESC')->chunk(500, function($assets) use($handle, $customfields) { - $headers=[ - trans('general.company'), - trans('admin/hardware/table.asset_tag'), - trans('admin/hardware/form.manufacturer'), - trans('admin/hardware/form.model'), - trans('general.model_no'), - trans('general.name'), - trans('admin/hardware/table.serial'), - trans('general.status'), - trans('admin/hardware/table.purchase_date'), - trans('admin/hardware/table.purchase_cost'), - trans('admin/hardware/form.order'), - trans('general.supplier'), - trans('admin/hardware/table.checkoutto'), - trans('general.type'), - trans('admin/hardware/table.checkout_date'), - trans('admin/hardware/table.location'), - trans('general.notes'), - ]; - foreach ($customfields as $field) { - $headers[]=$field->name; - } - fputcsv($handle, $headers); + foreach ($assets as $asset) { - // Add a new row with data $values=[ ($asset->company) ? $asset->company->name : '', From ee9a229c0e38548331a9e2f47324633c6dce552f Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 1 Dec 2017 14:26:01 -0800 Subject: [PATCH 02/25] Added datepicker range CSS --- public/css/build/all.css | Bin 239724 -> 239757 bytes public/css/dist/all.css | Bin 239724 -> 239757 bytes public/css/overrides.css | Bin 5200 -> 5233 bytes public/mix-manifest.json | 6 +++--- resources/assets/less/overrides.less | 3 +++ 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public/css/build/all.css b/public/css/build/all.css index b2c93cb85969d370101e8d6a7b083e8fdff628e3..1ae49d8efa5c801156b823aac924e50ecbeb3984 100644 GIT binary patch delta 49 zcmaEJfv@)>UqcIH3)2?noE3_CnRx}JCAukzC8n+a delta 15 WcmeCZ$oJ*~UqcIH3)2?noD~2$BnFKD diff --git a/public/css/dist/all.css b/public/css/dist/all.css index b2c93cb85969d370101e8d6a7b083e8fdff628e3..1ae49d8efa5c801156b823aac924e50ecbeb3984 100644 GIT binary patch delta 49 zcmaEJfv@)>UqcIH3)2?noE3_CnRx}JCAukzC8n+a delta 15 WcmeCZ$oJ*~UqcIH3)2?noD~2$BnFKD diff --git a/public/css/overrides.css b/public/css/overrides.css index 4db8c5ee3bc3bb30d9d0335022a73bd4b6e6fe44..36cdb81376b70440d63b12c1eddc9deb91518b3c 100644 GIT binary patch delta 44 zcmcbh@lj)gx`={aW?n&QiEc__NorAIUV3VEQhrfNYLRYHVoGLdv6aDOH4!ZUgJTe4 delta 11 ScmeyUaY18)y2xY?5lsLd83Yvo diff --git a/public/mix-manifest.json b/public/mix-manifest.json index e385227ab1..d0530f5098 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -2,13 +2,13 @@ "/js/build/vue.js": "/js/build/vue.js?id=e6804371942215bd1d7d", "/css/AdminLTE.css": "/css/AdminLTE.css?id=b8be19a285eaf44eec37", "/css/app.css": "/css/app.css?id=407edb63cc6b6dc62405", - "/css/overrides.css": "/css/overrides.css?id=9ae1a3c861441320c5a1", + "/css/overrides.css": "/css/overrides.css?id=a4994a56ec31f2099730", "/js/build/vue.js.map": "/js/build/vue.js.map?id=3b3d417664a61dcce3e9", "/css/AdminLTE.css.map": "/css/AdminLTE.css.map?id=99f5a5a03c4155cf69f6", "/css/app.css.map": "/css/app.css.map?id=bdbe05e6ecd70ccfac72", "/css/overrides.css.map": "/css/overrides.css.map?id=898c91d4a425b01b589b", - "/css/dist/all.css": "/css/dist/all.css?id=7c3842d2639193ac7e88", + "/css/dist/all.css": "/css/dist/all.css?id=277aaa6291c83cc8204f", "/js/dist/all.js": "/js/dist/all.js?id=7b52ead3a55086ea1f8d", - "/css/build/all.css": "/css/build/all.css?id=7c3842d2639193ac7e88", + "/css/build/all.css": "/css/build/all.css?id=277aaa6291c83cc8204f", "/js/build/all.js": "/js/build/all.js?id=7b52ead3a55086ea1f8d" } \ No newline at end of file diff --git a/resources/assets/less/overrides.less b/resources/assets/less/overrides.less index 78d47f2fde..226f388477 100644 --- a/resources/assets/less/overrides.less +++ b/resources/assets/less/overrides.less @@ -315,3 +315,6 @@ img.navbar-brand-img, .navbar-brand>img { max-height: 50px; } +.input-daterange { + border-radius: 0px; +} From 500f6d7baf9cb481945c0ee6b250dd0efcd2637e Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 1 Dec 2017 14:36:27 -0800 Subject: [PATCH 03/25] Set requiredness of select2 ajax fields --- resources/views/accessories/edit.blade.php | 2 +- resources/views/consumables/edit.blade.php | 2 +- resources/views/hardware/edit.blade.php | 2 +- resources/views/models/edit.blade.php | 2 +- resources/views/partials/forms/edit/category-select.blade.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/views/accessories/edit.blade.php b/resources/views/accessories/edit.blade.php index 2e9d278d80..611bd4e4e4 100755 --- a/resources/views/accessories/edit.blade.php +++ b/resources/views/accessories/edit.blade.php @@ -11,7 +11,7 @@ @include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id']) @include ('partials.forms.edit.name', ['translated_name' => trans('admin/accessories/general.accessory_name')]) -@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id']) +@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id', 'required' => 'true']) @include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id']) @include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id']) @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id']) diff --git a/resources/views/consumables/edit.blade.php b/resources/views/consumables/edit.blade.php index 0b391507bc..4b8cf36374 100644 --- a/resources/views/consumables/edit.blade.php +++ b/resources/views/consumables/edit.blade.php @@ -10,7 +10,7 @@ @include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id']) @include ('partials.forms.edit.name', ['translated_name' => trans('admin/consumables/table.title')]) -@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id']) +@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id', 'required' => 'true']) @include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id']) @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id']) @include ('partials.forms.edit.model_number') diff --git a/resources/views/hardware/edit.blade.php b/resources/views/hardware/edit.blade.php index 70a96386e5..a2397a687e 100755 --- a/resources/views/hardware/edit.blade.php +++ b/resources/views/hardware/edit.blade.php @@ -26,7 +26,7 @@ - @include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id']) + @include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id', 'required' => 'true'])
diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index b31050a075..a0fdbdf111 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -11,7 +11,7 @@ @include ('partials.forms.edit.name', ['translated_name' => trans('admin/models/table.name')]) @include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id']) -@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id']) +@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true']) @include ('partials.forms.edit.model_number') @include ('partials.forms.edit.depreciation') diff --git a/resources/views/partials/forms/edit/category-select.blade.php b/resources/views/partials/forms/edit/category-select.blade.php index 8a2e59b9f4..c7885dc5f0 100644 --- a/resources/views/partials/forms/edit/category-select.blade.php +++ b/resources/views/partials/forms/edit/category-select.blade.php @@ -3,9 +3,9 @@ {{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }} -
+
@if ($model_id = Input::old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
@can('create', \App\Models\AssetModel::class) - New - + @if ((!isset($hide_new)) || ($hide_new!='true')) + New + + @endif @endcan
diff --git a/resources/views/partials/forms/edit/supplier-select.blade.php b/resources/views/partials/forms/edit/supplier-select.blade.php index e05f1ccbf9..3471210391 100644 --- a/resources/views/partials/forms/edit/supplier-select.blade.php +++ b/resources/views/partials/forms/edit/supplier-select.blade.php @@ -16,7 +16,9 @@
@can('create', \App\Models\Supplier::class) - New + @if ((!isset($hide_new)) || ($hide_new!='true')) + New + @endif @endcan
diff --git a/resources/views/partials/forms/edit/user-select.blade.php b/resources/views/partials/forms/edit/user-select.blade.php index e50fad084a..a4479799f0 100644 --- a/resources/views/partials/forms/edit/user-select.blade.php +++ b/resources/views/partials/forms/edit/user-select.blade.php @@ -16,7 +16,9 @@
@can('create', \App\Models\User::class) - New + @if ((!isset($hide_new)) || ($hide_new!='true')) + New + @endif @endcan
From 14874d8e8a8d7dff83b9679f43e208007232255e Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 1 Dec 2017 14:47:52 -0800 Subject: [PATCH 05/25] Fixes #4495 - missing field in Download CSV, added filter options on custom report --- app/Http/Controllers/ReportsController.php | 4 +- resources/views/reports/custom.blade.php | 147 +++++++++++++++++---- 2 files changed, 121 insertions(+), 30 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index d8c2ca6793..f549df8c9a 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -145,6 +145,7 @@ class ReportsController extends Controller trans('general.company'), trans('admin/hardware/table.asset_tag'), trans('admin/hardware/form.manufacturer'), + trans('general.category'), trans('admin/hardware/form.model'), trans('general.model_no'), trans('general.name'), @@ -175,6 +176,7 @@ class ReportsController extends Controller ($asset->company) ? $asset->company->name : '', $asset->asset_tag, ($asset->model->manufacturer) ? $asset->model->manufacturer->name : '', + ($asset->model->category) ? $asset->model->category->name : '', ($asset->model) ? $asset->model->name : '', ($asset->model->model_number) ? $asset->model->model_number : '', ($asset->name) ? $asset->name : '', @@ -519,7 +521,7 @@ class ReportsController extends Controller fputcsv($handle, $header); - $assets = Asset::orderBy('created_at', 'DESC')->with('company', 'assignedTo', 'location', 'defaultLoc', 'model', 'supplier', 'assetstatus', 'model.manufacturer'); + $assets = Asset::with('company', 'assignedTo', 'location', 'defaultLoc', 'model', 'supplier', 'assetstatus', 'model.manufacturer'); if ($request->has('by_location_id')) { $assets->where('assets.location_id', $request->input('by_location_id')); diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php index 75802052be..1a91cfe216 100644 --- a/resources/views/reports/custom.blade.php +++ b/resources/views/reports/custom.blade.php @@ -30,147 +30,200 @@
+
+
+
+
- @foreach ($customfields as $customfield) + @if ($customfields->count() > 0)
- +

Custom Fields:

- @endforeach + @foreach ($customfields as $customfield) +
+ +
+ @endforeach + @endif +
-
-

Select the fields you'd like to include in your custom report, and click Generate. The file (YYYY-mm-dd-his-custom-asset-report.csv) will download automatically, and you can open it in Excel.

+
+ +

Select the fields you'd like to include in your custom report, and click Generate. The file (custom-asset-report-YYYY-mm-dd.csv) will download automatically, and you can open it in Excel.

+

If you'd like to export only certain assets, use the options below to fine-tune your results.

+ + @include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'by_company_id', 'hide_new' => 'true']) + @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'by_location_id', 'hide_new' => 'true']) + @include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'by_supplier_id', 'hide_new' => 'true']) + @include ('partials.forms.edit.model-select', ['translated_name' => trans('general.asset_model'), 'fieldname' => 'by_model_id', 'hide_new' => 'true']) + @include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'by_category_id', 'hide_new' => 'true', 'category_type' => 'asset']) + + +
+ +
+ +
+
+ + +
+ +
+ + to + +
+
+ + + + + +
+ + +
+
+
@stop + +@section('moar_scripts') + +@stop From c43bb670d28393f75004716e6832c167877ba517 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 1 Dec 2017 14:50:46 -0800 Subject: [PATCH 06/25] Bumped hash --- config/version.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/version.php b/config/version.php index c97c32345c..7ccd4c55cc 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 2811-gb934d2e', + 'app_version' => 'v4.1.7-pre', + 'full_app_version' => 'v4.1.7-pre - build 2811-gb934d2e', 'build_version' => '2811', 'prerelease_version' => '', 'hash_version' => 'gb934d2e', - 'full_hash' => 'v4.1.5-76-gb934d2e', + 'full_hash' => 'v4.1.6-76-gb934d2e', 'branch' => 'develop', -); \ No newline at end of file +); From 80109071a288cac4a29db0a409ff04d2ff970538 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 1 Dec 2017 14:54:02 -0800 Subject: [PATCH 07/25] Fixed version number --- config/version.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config/version.php b/config/version.php index 7ccd4c55cc..b77c0bfb4f 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v4.1.7-pre', - 'full_app_version' => 'v4.1.7-pre - build 2811-gb934d2e', - 'build_version' => '2811', - 'prerelease_version' => '', - 'hash_version' => 'gb934d2e', - 'full_hash' => 'v4.1.6-76-gb934d2e', - 'branch' => 'develop', + 'app_version' => 'v4.1.6', + 'full_app_version' => 'v4.1.6 - build 2994-g83c8449', + 'build_version' => '2994', + 'prerelease_version' => '', + 'hash_version' => 'g83c8449', + 'full_hash' => 'v4.1.5-76-gb934d2e', + 'branch' => 'master', ); From 5a3233da379c7f0581c533ca0b09d123adf731b4 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 1 Dec 2017 14:54:18 -0800 Subject: [PATCH 08/25] Grr. --- config/version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/version.php b/config/version.php index b77c0bfb4f..2227641ad1 100644 --- a/config/version.php +++ b/config/version.php @@ -6,5 +6,5 @@ return array ( 'prerelease_version' => '', 'hash_version' => 'g83c8449', 'full_hash' => 'v4.1.5-76-gb934d2e', - 'branch' => 'master', + 'branch' => 'develop', ); From c220315cb04f2ecc8862dbd523f5bb28e7a59acf Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 1 Dec 2017 16:49:51 -0800 Subject: [PATCH 09/25] Check if item is set before trying to look up selected --- .../views/partials/forms/edit/manufacturer-select.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/partials/forms/edit/manufacturer-select.blade.php b/resources/views/partials/forms/edit/manufacturer-select.blade.php index 38ddb56362..7740a5a1fc 100644 --- a/resources/views/partials/forms/edit/manufacturer-select.blade.php +++ b/resources/views/partials/forms/edit/manufacturer-select.blade.php @@ -3,9 +3,9 @@ {{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }} -
+
+ to - +
+ +
+ +
+ + to + +
+
- - +