From 9442736518c1364e9563e444fa9b93e9cf9fd0ff Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 21 Jun 2018 09:35:04 -0700 Subject: [PATCH 01/12] Adds textarea as a custom field type --- app/Helpers/Helper.php | 2 +- app/Models/CustomField.php | 1 + public/js/build/all.js | Bin 812776 -> 812950 bytes public/js/build/vue.js | Bin 676606 -> 676780 bytes public/js/build/vue.js.map | Bin 698421 -> 698609 bytes public/js/dist/all.js | Bin 812776 -> 812950 bytes public/mix-manifest.json | 8 ++++---- .../asset-models/fieldset-default-values.vue | 2 ++ resources/macros/macros.php | 1 + .../views/custom_fields/fields/edit.blade.php | 4 ++-- .../views/models/custom_fields_form.blade.php | 5 +++++ resources/views/models/edit.blade.php | 3 +-- 12 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index 87c8216320..0ba7d03c01 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -413,7 +413,7 @@ class Helper { $keys = array_keys(CustomField::$PredefinedFormats); $stuff = array_combine($keys, $keys); - return $stuff+["" => trans('admin/custom_fields/general.custom_format')]; + return $stuff; } /** diff --git a/app/Models/CustomField.php b/app/Models/CustomField.php index ad9a2ab36a..4ea44fef90 100644 --- a/app/Models/CustomField.php +++ b/app/Models/CustomField.php @@ -16,6 +16,7 @@ class CustomField extends Model public $guarded=["id"]; public static $PredefinedFormats=[ "ANY" => "", + "CUSTOM REGEX" => "", "ALPHA" => "alpha", "ALPHA-DASH" => "alpha_dash", "NUMERIC" => "numeric", diff --git a/public/js/build/all.js b/public/js/build/all.js index 3767ea093fed0dc5f559b26bd9cff0fa3a3fc46d..7d23ff6e62f1f87565d3bbf608eb143ebde19eab 100644 GIT binary patch delta 789 zcmYL{Ur19?9LKr$p0j)I-7L-2Wl4G^RG8`fZ#GR6GPTmFGbGKmd$k#EI`7=voC*<9 z5>$rg!I0j3h)kGyD9H4oOiVNp0#P5V2MH=91%rt04a~>S_xJmL&yO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K&b%NuK`V}#m-m0@BQ0`y{2)(Xloe@0p zg3W-+8P-pv@t5qG2$+s=y@akG<#uvvVe|XRbG9Wt#vCST�i_VLi7RP&^ZlIX4Yi zPdIl(q5e|M0FArTG-^mI*Yx%%5`Lt)MnmDWX4VUXR^DSE(JrE2@!l1LznAeQsu(}J zgv@a85I+`G8a_YZ84A8l@t+9I?$>UkV4*}it`NRDp?wdLN$rj<1qN-pQao3r>sKZO N=2#<~x9fIU{s0#W@`?Ze diff --git a/public/js/build/vue.js b/public/js/build/vue.js index 79892227b7eea088e974481b9adf2eb10aa0d52f..32880dc845273e628ce6a6ddcf4139797cb43e43 100644 GIT binary patch delta 366 zcmeyjRCCR8%?*r9Mg|q>B}$q)iiSFArFqFEnfZAdC7RWl8cK;N#idG`wK_^Ei6x1; zWx6IQ$(AM-mgY*+b#=I8Ci^q}V^soao_-*aMQVDF3|H{>W%eAZ%(5k^6(xy9sfkLq zwyAn0l?AExK+|A?(;vR)6rIlhi&JEKvJ=O8#%5pU?Y_*6!f%<&{k^9jOk|M+85P(b z`jHWcnYM?1WPX&leRm>DH47`qMOM=V^_j)kfhOjLhE+^&{Ji>)rtOex8*GBs7LtyR)dQi|Q4 JBf~Yx3;-cBcv=7e delta 314 zcmZ3pT=U;j%?*r9EGgPqfzvnmF^fvLXBb8(Y1Zl}r6iUl>Xzx6rI{L}rCC@^Uzo)r zJK3MX5Z&R;?vi7bBS%AU&(QTvH2qN_KVDn%s-jS{k=ivJhxCIuMTG-EFIXxzyi;n|td{I7^9fG$bpQ|3hvoGNCLhvRQa7k>R z(Zn*Fg(=B=`bR}p;pqonGqbfnXlDUpRv>2E{-B+G=O;FxCx9NCKCg*Idinz$rg!I0j3h)kGyD9H4oOiVNp0#P5V2MH=91%rt04a~>S_xJmL&yO!>bKW?(U>qBX zG^To+Wg*EBXEZdq9X8qSbR^12etV)|6+7HQQotaHR@s`|nVccoax-#rv++U~h#A<4 z`~wBmOWv5#LncO+yt36LSp}0xIw^OxNd-#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e|M0FArTG-^mI*Yx%%5`Lt)MnmDWX4VUXR^DSE(JrE2@!l1LznAeQsu(}J zgv@a85I+`G8a_YZ84A8l@t+9I?$>UkV4*}it`NRDp?wdLN$rj<1qN-pQao3r>sKZO N=2#<~x9fIU{s0#W@`?Ze diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 9fe5cd6a18..031a4e5cb3 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,14 +1,14 @@ { - "/js/build/vue.js": "/js/build/vue.js?id=992bcb968a7f2da998b5", + "/js/build/vue.js": "/js/build/vue.js?id=8e0a9017cf028e8f66a8", "/css/AdminLTE.css": "/css/AdminLTE.css?id=5e72463a66acbcc740d5", "/css/app.css": "/css/app.css?id=407edb63cc6b6dc62405", "/css/overrides.css": "/css/overrides.css?id=d85394a0b4f58e81bb78", - "/js/build/vue.js.map": "/js/build/vue.js.map?id=e0eb0edc0b761965973f", + "/js/build/vue.js.map": "/js/build/vue.js.map?id=126dccfb286c6d1f809a", "/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=0e3642f1b6a8a436d558", - "/js/dist/all.js": "/js/dist/all.js?id=39b95992f478d68c44a8", + "/js/dist/all.js": "/js/dist/all.js?id=39b69f6a05c1d81dc4bb", "/css/build/all.css": "/css/build/all.css?id=0e3642f1b6a8a436d558", - "/js/build/all.js": "/js/build/all.js?id=39b95992f478d68c44a8" + "/js/build/all.js": "/js/build/all.js?id=39b69f6a05c1d81dc4bb" } \ No newline at end of file diff --git a/resources/assets/js/components/forms/asset-models/fieldset-default-values.vue b/resources/assets/js/components/forms/asset-models/fieldset-default-values.vue index 71d7ee01ed..542f8d62e4 100644 --- a/resources/assets/js/components/forms/asset-models/fieldset-default-values.vue +++ b/resources/assets/js/components/forms/asset-models/fieldset-default-values.vue @@ -44,6 +44,8 @@
+ + + + @elseif ($field->element=='checkbox') @foreach ($field->formatFieldValuesAsArray() as $key => $value) diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index 4861b5d7a1..ae271c5835 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -49,8 +49,7 @@ + previous-input="{{ json_encode(Input::old('default_values')) }}">
From 80dda198c5b92fa3cba59444c08fd3f943bdd9e5 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 21 Jun 2018 09:44:10 -0700 Subject: [PATCH 02/12] Parse line breaks in the detail view --- resources/views/hardware/view.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 96be1daa8d..db134f7160 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -281,7 +281,7 @@ @if (($field->format=='URL') && ($asset->{$field->db_column_name()}!='')) {{ $asset->{$field->db_column_name()} }} @else - {{ $asset->{$field->db_column_name()} }} + {!! nl2br(e($asset->{$field->db_column_name()})) !!} @endif @endif From 5bb4c85ccb2d9cbf8a81c7bb54cd47b02cd5f8ec Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 27 Jun 2018 00:44:54 -0700 Subject: [PATCH 03/12] Update twitter handle --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37254d0104..2795679d44 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/snipe/snipe-it.svg?branch=master)](https://travis-ci.org/snipe/snipe-it) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/snipe/snipe-it?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeyhead.svg?style=social)](https://twitter.com/snipeyhead) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&utm_medium=referral&utm_content=snipe/snipe-it&utm_campaign=Badge_Grade) +[![Build Status](https://travis-ci.org/snipe/snipe-it.svg?branch=master)](https://travis-ci.org/snipe/snipe-it) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/snipe/snipe-it?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeitapp.svg?style=social)](https://twitter.com/snipeitapp) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&utm_medium=referral&utm_content=snipe/snipe-it&utm_campaign=Badge_Grade) [![All Contributors](https://img.shields.io/badge/all_contributors-104-orange.svg?style=flat-square)](#contributors) [![Open Source Helpers](https://www.codetriage.com/snipe/snipe-it/badges/users.svg)](https://www.codetriage.com/snipe/snipe-it) From d7dc4ae0c09a6872610624ac390d5c3cf74b7f99 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 27 Jun 2018 00:45:09 -0700 Subject: [PATCH 04/12] Added manager to custom report --- app/Http/Controllers/ReportsController.php | 12 ++++++++++++ resources/views/reports/custom.blade.php | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 7248cc6bea..d6c01b5c89 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -400,6 +400,10 @@ class ReportsController extends Controller $header[] = 'Employee No.'; } + if ($request->has('manager')) { + $header[] = trans('admin/users/table.manager'); + } + if ($request->has('department')) { $header[] = trans('general.department'); } @@ -613,6 +617,14 @@ class ReportsController extends Controller } } + if ($request->has('manager')) { + if ($asset->checkedOutToUser()) { + $row[] = (($asset->assignedto) && ($asset->assignedto->manager)) ? $asset->assignedto->manager->present()->fullName : ''; + } else { + $row[] = ''; // Empty string if unassigned + } + } + if ($request->has('department')) { if ($asset->checkedOutToUser()) { diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php index 36c6d3d262..a53cbce60c 100644 --- a/resources/views/reports/custom.blade.php +++ b/resources/views/reports/custom.blade.php @@ -221,6 +221,13 @@ +
+ +
+