diff --git a/.all-contributorsrc b/.all-contributorsrc index a47bf5b0ce..412e929e4a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2514,7 +2514,7 @@ "code" ] }, - { + { "login": "Haxatron", "name": "Haxatron", "avatar_url": "https://avatars.githubusercontent.com/u/76475453?v=4", @@ -2541,7 +2541,7 @@ "code" ] }, - { + { "login": "UniversalSuperBox", "name": "Dalton Durst", "avatar_url": "https://avatars.githubusercontent.com/u/21966173?v=4", diff --git a/README.md b/README.md index 837fdfcc77..a15e19f13c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ![Build Status](https://app.chipperci.com/projects/0e5f8979-31eb-4ee6-9abf-050b76ab0383/status/master) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![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-282-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev) +[![All Contributors](https://img.shields.io/badge/all_contributors-284-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev) ## Snipe-IT - Open Source Asset Management System @@ -128,10 +128,10 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken | [
Mark Stenglein](https://markstenglein.com)
[💻](https://github.com/snipe/snipe-it/commits?author=ocelotsloth "Code") | [
ajsy](https://github.com/ajsy)
[💻](https://github.com/snipe/snipe-it/commits?author=ajsy "Code") | [
Jan Kiesewetter](https://github.com/t3easy)
[💻](https://github.com/snipe/snipe-it/commits?author=t3easy "Code") | [
Tetrachloromethane250](https://github.com/Tetrachloromethane250)
[💻](https://github.com/snipe/snipe-it/commits?author=Tetrachloromethane250 "Code") | [
Lars Kajes](https://www.kajes.se/)
[💻](https://github.com/snipe/snipe-it/commits?author=kajes "Code") | [
Joly0](https://github.com/Joly0)
[💻](https://github.com/snipe/snipe-it/commits?author=Joly0 "Code") | [
theburger](https://github.com/limeless)
[💻](https://github.com/snipe/snipe-it/commits?author=limeless "Code") | | [
David Valin Alonso](https://github.com/deivishome)
[💻](https://github.com/snipe/snipe-it/commits?author=deivishome "Code") | [
andreaci](https://github.com/andreaci)
[💻](https://github.com/snipe/snipe-it/commits?author=andreaci "Code") | [
Jelle Sebreghts](http://www.jellesebreghts.be)
[💻](https://github.com/snipe/snipe-it/commits?author=Jelle-S "Code") | [
Michael Pietsch](https://github.com/Skywalker-11)
| [
Masudul Haque Shihab](https://github.com/sh1hab)
[💻](https://github.com/snipe/snipe-it/commits?author=sh1hab "Code") | [
Supapong Areeprasertkul](http://www.freedomdive.com/)
[💻](https://github.com/snipe/snipe-it/commits?author=zybersup "Code") | [
Peter Sarossy](https://github.com/psarossy)
[💻](https://github.com/snipe/snipe-it/commits?author=psarossy "Code") | | [
Renee Margaret McConahy](https://github.com/nepella)
[💻](https://github.com/snipe/snipe-it/commits?author=nepella "Code") | [
JohnnyPicnic](https://github.com/JohnnyPicnic)
[💻](https://github.com/snipe/snipe-it/commits?author=JohnnyPicnic "Code") | [
markbrule](https://github.com/markbrule)
[💻](https://github.com/snipe/snipe-it/commits?author=markbrule "Code") | [
Mike Campbell](https://github.com/mikecmpbll)
[💻](https://github.com/snipe/snipe-it/commits?author=mikecmpbll "Code") | [
tbrconnect](https://github.com/tbrconnect)
[💻](https://github.com/snipe/snipe-it/commits?author=tbrconnect "Code") | [
kcoyo](https://github.com/kcoyo)
[💻](https://github.com/snipe/snipe-it/commits?author=kcoyo "Code") | [
Travis Miller](https://travismiller.com/)
[💻](https://github.com/snipe/snipe-it/commits?author=travismiller "Code") | -| [
Petri Asikainen](https://github.com/PetriAsi)
[💻](https://github.com/snipe/snipe-it/commits?author=PetriAsi "Code") | [
derdeagle](https://github.com/derdeagle)
[💻](https://github.com/snipe/snipe-it/commits?author=derdeagle "Code") | [
Mike Frysinger](https://wh0rd.org/)
[💻](https://github.com/snipe/snipe-it/commits?author=vapier "Code") | [
ALPHA](https://github.com/AL4AL)
[💻](https://github.com/snipe/snipe-it/commits?author=AL4AL "Code") | [
FliegenKLATSCH](https://www.ifern.de)
[💻](https://github.com/snipe/snipe-it/commits?author=FliegenKLATSCH "Code") | [
Jeremy Price](https://github.com/jerm)
[💻](https://github.com/snipe/snipe-it/commits?author=jerm "Code") | [
Toreg87](https://github.com/Toreg87)
[💻](https://github.com/snipe/snipe-it/commits?author=Toreg87 "Code") | -| [
Matthew Nickson](https://github.com/Computroniks)
[💻](https://github.com/snipe/snipe-it/commits?author=Computroniks "Code") | [
Jethro Nederhof](https://jethron.id.au)
[💻](https://github.com/snipe/snipe-it/commits?author=jethron "Code") | [
Oskar Stenberg](https://github.com/01ste02)
[💻](https://github.com/snipe/snipe-it/commits?author=01ste02 "Code") | [
Robert-Azelis](https://github.com/Robert-Azelis)
[💻](https://github.com/snipe/snipe-it/commits?author=Robert-Azelis "Code") | [
Alexander William Smith](https://github.com/alwism)
[💻](https://github.com/snipe/snipe-it/commits?author=alwism "Code") | [
LEITWERK AG](https://www.leitwerk.de/)
[💻](https://github.com/snipe/snipe-it/commits?author=leitwerk-ag "Code") | [
Adam](http://www.aboutcher.co.uk)
[💻](https://github.com/snipe/snipe-it/commits?author=adamboutcher "Code") | -| [
Ian](https://snksrv.com)
[💻](https://github.com/snipe/snipe-it/commits?author=sneak-it "Code") | [
Shao Yu-Lung (Allen)](http://blog.bestlong.idv.tw/)
[💻](https://github.com/snipe/snipe-it/commits?author=bestlong "Code") | [
Haxatron](https://github.com/Haxatron)
[💻](https://github.com/snipe/snipe-it/commits?author=Haxatron "Code") | [
Bradley Coudriet](http://bjcpgd.cias.rit.edu)
[💻](https://github.com/snipe/snipe-it/commits?author=exula "Code") | [
Dalton Durst](https://daltondur.st)
[💻](https://github.com/snipe/snipe-it/commits?author=UniversalSuperBox "Code") | [
TenOfTens](https://github.com/TenOfTens)
[💻](https://github.com/snipe/snipe-it/commits?author=TenOfTens "Code") | [
Simona Avornicesei](http://www.avornicesei.com)
[⚠️](https://github.com/snipe/snipe-it/commits?author=savornicesei "Tests") | -| [
TenOfTens](https://github.com/TenOfTens)
[💻](https://github.com/snipe/snipe-it/commits?author=TenOfTens "Code") | [
waffle](https://ditisjens.be/)
[💻](https://github.com/snipe/snipe-it/commits?author=insert-waffle "Code") | +| [
Evan Taylor](https://github.com/Delta5)
[💻](https://github.com/snipe/snipe-it/commits?author=Delta5 "Code") | [
Petri Asikainen](https://github.com/PetriAsi)
[💻](https://github.com/snipe/snipe-it/commits?author=PetriAsi "Code") | [
derdeagle](https://github.com/derdeagle)
[💻](https://github.com/snipe/snipe-it/commits?author=derdeagle "Code") | [
Mike Frysinger](https://wh0rd.org/)
[💻](https://github.com/snipe/snipe-it/commits?author=vapier "Code") | [
ALPHA](https://github.com/AL4AL)
[💻](https://github.com/snipe/snipe-it/commits?author=AL4AL "Code") | [
FliegenKLATSCH](https://www.ifern.de)
[💻](https://github.com/snipe/snipe-it/commits?author=FliegenKLATSCH "Code") | [
Jeremy Price](https://github.com/jerm)
[💻](https://github.com/snipe/snipe-it/commits?author=jerm "Code") | +| [
Toreg87](https://github.com/Toreg87)
[💻](https://github.com/snipe/snipe-it/commits?author=Toreg87 "Code") | [
Matthew Nickson](https://github.com/Computroniks)
[💻](https://github.com/snipe/snipe-it/commits?author=Computroniks "Code") | [
Jethro Nederhof](https://jethron.id.au)
[💻](https://github.com/snipe/snipe-it/commits?author=jethron "Code") | [
Oskar Stenberg](https://github.com/01ste02)
[💻](https://github.com/snipe/snipe-it/commits?author=01ste02 "Code") | [
Robert-Azelis](https://github.com/Robert-Azelis)
[💻](https://github.com/snipe/snipe-it/commits?author=Robert-Azelis "Code") | [
Alexander William Smith](https://github.com/alwism)
[💻](https://github.com/snipe/snipe-it/commits?author=alwism "Code") | [
LEITWERK AG](https://www.leitwerk.de/)
[💻](https://github.com/snipe/snipe-it/commits?author=leitwerk-ag "Code") | +| [
Adam](http://www.aboutcher.co.uk)
[💻](https://github.com/snipe/snipe-it/commits?author=adamboutcher "Code") | [
Ian](https://snksrv.com)
[💻](https://github.com/snipe/snipe-it/commits?author=sneak-it "Code") | [
Shao Yu-Lung (Allen)](http://blog.bestlong.idv.tw/)
[💻](https://github.com/snipe/snipe-it/commits?author=bestlong "Code") | [
Haxatron](https://github.com/Haxatron)
[💻](https://github.com/snipe/snipe-it/commits?author=Haxatron "Code") | [
PlaneNuts](https://github.com/PlaneNuts)
[💻](https://github.com/snipe/snipe-it/commits?author=PlaneNuts "Code") | [
Bradley Coudriet](http://bjcpgd.cias.rit.edu)
[💻](https://github.com/snipe/snipe-it/commits?author=exula "Code") | [
Dalton Durst](https://daltondur.st)
[💻](https://github.com/snipe/snipe-it/commits?author=UniversalSuperBox "Code") | +| [
Alex Janes](https://adagiohealth.org)
[💻](https://github.com/snipe/snipe-it/commits?author=adagioajanes "Code") | [
Nuraeil](https://github.com/nuraeil)
[💻](https://github.com/snipe/snipe-it/commits?author=nuraeil "Code") | [
TenOfTens](https://github.com/TenOfTens)
[💻](https://github.com/snipe/snipe-it/commits?author=TenOfTens "Code") | [
waffle](https://ditisjens.be/)
[💻](https://github.com/snipe/snipe-it/commits?author=insert-waffle "Code") | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.php index bb2d00c1bb..f8d1cfabf5 100644 --- a/app/Importer/AssetImporter.php +++ b/app/Importer/AssetImporter.php @@ -68,7 +68,7 @@ class AssetImporter extends ItemImporter $this->log('No Matching Asset, Creating a new one'); $asset = new Asset; } - + $this->item['notes'] = $this->findCsvMatch($row, 'asset_notes'); $this->item['image'] = $this->findCsvMatch($row, 'image'); $this->item['requestable'] = $this->fetchHumanBoolean($this->findCsvMatch($row, 'requestable')); $asset->requestable = $this->fetchHumanBoolean($this->findCsvMatch($row, 'requestable')); diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.php index 3188a46052..5d8005ff21 100644 --- a/app/Importer/ItemImporter.php +++ b/app/Importer/ItemImporter.php @@ -221,6 +221,7 @@ class ItemImporter extends Importer $this->log('Matching Model found, updating it.'); $item = $this->sanitizeItemForStoring($asset_model, $editingModel); $item['name'] = $asset_model_name; + $item['notes'] = $this->findCsvMatch($row, 'model_notes'); if(!empty($asset_modelNumber)){ $item['model_number'] = $asset_modelNumber; @@ -238,6 +239,7 @@ class ItemImporter extends Importer $item = $this->sanitizeItemForStoring($asset_model, $editingModel); $item['name'] = $asset_model_name; $item['model_number'] = $asset_modelNumber; + $item['notes'] = $this->findCsvMatch($row, 'model_notes'); $asset_model->fill($item); $item = null; diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 7148e03f49..78120f5d49 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -174,12 +174,21 @@ class AuthServiceProvider extends ServiceProvider // to the logged in API user, but creating assets, licenses, etc won't work // if the user can't view and interact with the select lists. Gate::define('view.selectlists', function ($user) { - return $user->can(['create','update'], Asset::class) - || $user->can(['create','update'], License::class) - || $user->can(['create','update'], Component::class) - || $user->can(['create','update'], Consumable::class) - || $user->can(['create','update'], Accessory::class) - || $user->can(['create','update'], User::class); + return $user->can('update', Asset::class) + || $user->can('create', Asset::class) + || $user->can('checkout', Asset::class) + || $user->can('checkin', Asset::class) + || $user->can('audit', Asset::class) + || $user->can('update', License::class) + || $user->can('create', License::class) + || $user->can('update', Component::class) + || $user->can('create', Component::class) + || $user->can('update', Consumable::class) + || $user->can('create', Consumable::class) + || $user->can('update', Accessory::class) + || $user->can('create', Accessory::class) + || $user->can('update', User::class) + || $user->can('create', User::class); }); } } diff --git a/database/factories/AssetFactory.php b/database/factories/AssetFactory.php index e99789bfc5..24021921b3 100644 --- a/database/factories/AssetFactory.php +++ b/database/factories/AssetFactory.php @@ -8,7 +8,6 @@ use App\Models\Category; use App\Models\Location; use App\Models\Supplier; use Illuminate\Database\Eloquent\Factories\Factory; -use App\Models\StatusLabel; /* |-------------------------------------------------------------------------- @@ -39,15 +38,16 @@ class AssetFactory extends Factory { return [ 'name' => null, - 'rtd_location_id' => Location::factory()->create(), + 'rtd_location_id' => Location::all()->random()->id, 'serial' => $this->faker->uuid, - 'status_id' => $this->faker->numberBetween(1,5), + 'status_id' => 1, 'user_id' => 1, 'asset_tag' => $this->faker->unixTime('now'), 'notes' => 'Created by DB seeder', 'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()), 'purchase_cost' => $this->faker->randomFloat(2, '299.99', '2999.99'), 'order_number' => $this->faker->numberBetween(1000000, 50000000), + 'supplier_id' => Supplier::all()->random()->id, 'requestable' => $this->faker->boolean(), 'assigned_to' => null, 'assigned_type' => null, diff --git a/public/js/build/app.js b/public/js/build/app.js index ed2959015d..14ee3b59f8 100644 Binary files a/public/js/build/app.js and b/public/js/build/app.js differ diff --git a/public/js/dist/all.js b/public/js/dist/all.js index acb14d084c..1e1f1a9303 100644 Binary files a/public/js/dist/all.js and b/public/js/dist/all.js differ diff --git a/resources/assets/js/components/importer/importer-file.vue b/resources/assets/js/components/importer/importer-file.vue index b363b51a93..b7e58fecd3 100644 --- a/resources/assets/js/components/importer/importer-file.vue +++ b/resources/assets/js/components/importer/importer-file.vue @@ -130,7 +130,6 @@ {id: 'location', text: 'Location' }, {id: 'maintained', text: 'Maintained' }, {id: 'manufacturer', text: 'Manufacturer' }, - {id: 'notes', text: 'Notes' }, {id: 'order_number', text: 'Order Number' }, {id: 'purchase_cost', text: 'Purchase Cost' }, {id: 'purchase_date', text: 'Purchase Date' }, @@ -143,6 +142,7 @@ ], accessories:[ {id: 'model_number', text: 'Model Number'}, + {id: 'notes', text: 'Notes' }, ], assets: [ {id: 'asset_tag', text: 'Asset Tag' }, @@ -151,6 +151,8 @@ {id: 'checkout_location', text: 'Checkout Location' }, {id: 'image', text: 'Image Filename' }, {id: 'model_number', text: 'Model Number' }, + {id: 'asset_notes', text: 'Asset Notes' }, + {id: 'model_notes', text: 'Model Notes' }, {id: 'full_name', text: 'Full Name' }, {id: 'status', text: 'Status' }, {id: 'warranty_months', text: 'Warranty Months' }, @@ -161,11 +163,13 @@ {id: 'item_no', text: "Item Number"}, {id: 'model_number', text: "Model Number"}, {id: 'min_amt', text: "Minimum Quantity"}, + {id: 'notes', text: 'Notes' }, ], licenses: [ {id: 'asset_tag', text: 'Assigned To Asset'}, {id: 'expiration_date', text: 'Expiration Date' }, {id: 'full_name', text: 'Full Name' }, + {id: 'notes', text: 'Notes' }, {id: 'license_email', text: 'Licensed To Email' }, {id: 'license_name', text: 'Licensed To Name' }, {id: 'purchase_order', text: 'Purchase Order' }, @@ -179,6 +183,7 @@ {id: 'last_name', text: 'Last Name' }, {id: 'phone_number', text: 'Phone Number' }, {id: 'manager_first_name', text: 'Manager First Name' }, + {id: 'notes', text: 'Notes' }, {id: 'manager_last_name', text: 'Manager Last Name' }, {id: 'activated', text: 'Activated' }, {id: 'address', text: 'Address' }, diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 3a2dab4c1f..870cabb4b2 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -124,7 +124,7 @@