A free open source IT asset/license management system
Merge master back down into develop
snipea937bd34f698
diff --git a/.all-contributorsrc b/.all-contributorsrcindex 412e929e4a..e07a3f24f7 100644--- a/.all-contributorsrc+++ b/.all-contributorsrc@@ -2585,6 +2585,15 @@"contributions": ["code"]+ },+ {+ "login": "QveenSi",+ "name": "Yevhenii Huzii",+ "avatar_url": "https://avatars.githubusercontent.com/u/19945501?v=4",+ "profile": "https://github.com/QveenSi",+ "contributions": [+ "code"+ ]}]}diff --git a/README.md b/README.mdindex a15e19f13c..9e6c3c981d 100644--- a/README.md+++ b/README.md@@ -128,6 +128,10 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken| [<img src="https://avatars.githubusercontent.com/u/9255772?v=4" width="110px;"/><br /><sub>Mark Stenglein</sub>](https://markstenglein.com)<br />[π»](https://github.com/snipe/snipe-it/commits?author=ocelotsloth "Code") | [<img src="https://avatars.githubusercontent.com/u/35658596?v=4" width="110px;"/><br /><sub>ajsy</sub>](https://github.com/ajsy)<br />[π»](https://github.com/snipe/snipe-it/commits?author=ajsy "Code") | [<img src="https://avatars.githubusercontent.com/u/3628035?v=4" width="110px;"/><br /><sub>Jan Kiesewetter</sub>](https://github.com/t3easy)<br />[π»](https://github.com/snipe/snipe-it/commits?author=t3easy "Code") | [<img src="https://avatars.githubusercontent.com/u/79449630?v=4" width="110px;"/><br /><sub>Tetrachloromethane250</sub>](https://github.com/Tetrachloromethane250)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Tetrachloromethane250 "Code") | [<img src="https://avatars.githubusercontent.com/u/22004482?v=4" width="110px;"/><br /><sub>Lars Kajes</sub>](https://www.kajes.se/)<br />[π»](https://github.com/snipe/snipe-it/commits?author=kajes "Code") | [<img src="https://avatars.githubusercontent.com/u/13993216?v=4" width="110px;"/><br /><sub>Joly0</sub>](https://github.com/Joly0)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Joly0 "Code") | [<img src="https://avatars.githubusercontent.com/u/1501022?v=4" width="110px;"/><br /><sub>theburger</sub>](https://github.com/limeless)<br />[π»](https://github.com/snipe/snipe-it/commits?author=limeless "Code") || [<img src="https://avatars.githubusercontent.com/u/36065681?v=4" width="110px;"/><br /><sub>David Valin Alonso</sub>](https://github.com/deivishome)<br />[π»](https://github.com/snipe/snipe-it/commits?author=deivishome "Code") | [<img src="https://avatars.githubusercontent.com/u/8290389?v=4" width="110px;"/><br /><sub>andreaci</sub>](https://github.com/andreaci)<br />[π»](https://github.com/snipe/snipe-it/commits?author=andreaci "Code") | [<img src="https://avatars.githubusercontent.com/u/1828542?v=4" width="110px;"/><br /><sub>Jelle Sebreghts</sub>](http://www.jellesebreghts.be)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Jelle-S "Code") | [<img src="https://avatars.githubusercontent.com/u/11180862?v=4" width="110px;"/><br /><sub>Michael Pietsch</sub>](https://github.com/Skywalker-11)<br /> | [<img src="https://avatars.githubusercontent.com/u/22068886?v=4" width="110px;"/><br /><sub>Masudul Haque Shihab</sub>](https://github.com/sh1hab)<br />[π»](https://github.com/snipe/snipe-it/commits?author=sh1hab "Code") | [<img src="https://avatars.githubusercontent.com/u/16099942?v=4" width="110px;"/><br /><sub>Supapong Areeprasertkul</sub>](http://www.freedomdive.com/)<br />[π»](https://github.com/snipe/snipe-it/commits?author=zybersup "Code") | [<img src="https://avatars.githubusercontent.com/u/207358?v=4" width="110px;"/><br /><sub>Peter Sarossy</sub>](https://github.com/psarossy)<br />[π»](https://github.com/snipe/snipe-it/commits?author=psarossy "Code") || [<img src="https://avatars.githubusercontent.com/u/11823649?v=4" width="110px;"/><br /><sub>Renee Margaret McConahy</sub>](https://github.com/nepella)<br />[π»](https://github.com/snipe/snipe-it/commits?author=nepella "Code") | [<img src="https://avatars.githubusercontent.com/u/5553884?v=4" width="110px;"/><br /><sub>JohnnyPicnic</sub>](https://github.com/JohnnyPicnic)<br />[π»](https://github.com/snipe/snipe-it/commits?author=JohnnyPicnic "Code") | [<img src="https://avatars.githubusercontent.com/u/8799594?v=4" width="110px;"/><br /><sub>markbrule</sub>](https://github.com/markbrule)<br />[π»](https://github.com/snipe/snipe-it/commits?author=markbrule "Code") | [<img src="https://avatars.githubusercontent.com/u/1962801?v=4" width="110px;"/><br /><sub>Mike Campbell</sub>](https://github.com/mikecmpbll)<br />[π»](https://github.com/snipe/snipe-it/commits?author=mikecmpbll "Code") | [<img src="https://avatars.githubusercontent.com/u/11973217?v=4" width="110px;"/><br /><sub>tbrconnect</sub>](https://github.com/tbrconnect)<br />[π»](https://github.com/snipe/snipe-it/commits?author=tbrconnect "Code") | [<img src="https://avatars.githubusercontent.com/u/12447225?v=4" width="110px;"/><br /><sub>kcoyo</sub>](https://github.com/kcoyo)<br />[π»](https://github.com/snipe/snipe-it/commits?author=kcoyo "Code") | [<img src="https://avatars.githubusercontent.com/u/494017?v=4" width="110px;"/><br /><sub>Travis Miller</sub>](https://travismiller.com/)<br />[π»](https://github.com/snipe/snipe-it/commits?author=travismiller "Code") |+| [<img src="https://avatars.githubusercontent.com/u/8735148?v=4" width="110px;"/><br /><sub>Petri Asikainen</sub>](https://github.com/PetriAsi)<br />[π»](https://github.com/snipe/snipe-it/commits?author=PetriAsi "Code") | [<img src="https://avatars.githubusercontent.com/u/11424540?v=4" width="110px;"/><br /><sub>derdeagle</sub>](https://github.com/derdeagle)<br />[π»](https://github.com/snipe/snipe-it/commits?author=derdeagle "Code") | [<img src="https://avatars.githubusercontent.com/u/176950?v=4" width="110px;"/><br /><sub>Mike Frysinger</sub>](https://wh0rd.org/)<br />[π»](https://github.com/snipe/snipe-it/commits?author=vapier "Code") | [<img src="https://avatars.githubusercontent.com/u/22044358?v=4" width="110px;"/><br /><sub>ALPHA</sub>](https://github.com/AL4AL)<br />[π»](https://github.com/snipe/snipe-it/commits?author=AL4AL "Code") | [<img src="https://avatars.githubusercontent.com/u/1042587?v=4" width="110px;"/><br /><sub>FliegenKLATSCH</sub>](https://www.ifern.de)<br />[π»](https://github.com/snipe/snipe-it/commits?author=FliegenKLATSCH "Code") | [<img src="https://avatars.githubusercontent.com/u/442138?v=4" width="110px;"/><br /><sub>Jeremy Price</sub>](https://github.com/jerm)<br />[π»](https://github.com/snipe/snipe-it/commits?author=jerm "Code") | [<img src="https://avatars.githubusercontent.com/u/84392209?v=4" width="110px;"/><br /><sub>Toreg87</sub>](https://github.com/Toreg87)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Toreg87 "Code") |+| [<img src="https://avatars.githubusercontent.com/u/67638596?v=4" width="110px;"/><br /><sub>Matthew Nickson</sub>](https://github.com/Computroniks)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Computroniks "Code") | [<img src="https://avatars.githubusercontent.com/u/1646397?v=4" width="110px;"/><br /><sub>Jethro Nederhof</sub>](https://jethron.id.au)<br />[π»](https://github.com/snipe/snipe-it/commits?author=jethron "Code") | [<img src="https://avatars.githubusercontent.com/u/23289826?v=4" width="110px;"/><br /><sub>Oskar Stenberg</sub>](https://github.com/01ste02)<br />[π»](https://github.com/snipe/snipe-it/commits?author=01ste02 "Code") | [<img src="https://avatars.githubusercontent.com/u/82208283?v=4" width="110px;"/><br /><sub>Robert-Azelis</sub>](https://github.com/Robert-Azelis)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Robert-Azelis "Code") | [<img src="https://avatars.githubusercontent.com/u/60648387?v=4" width="110px;"/><br /><sub>Alexander William Smith</sub>](https://github.com/alwism)<br />[π»](https://github.com/snipe/snipe-it/commits?author=alwism "Code") | [<img src="https://avatars.githubusercontent.com/u/24418301?v=4" width="110px;"/><br /><sub>LEITWERK AG</sub>](https://www.leitwerk.de/)<br />[π»](https://github.com/snipe/snipe-it/commits?author=leitwerk-ag "Code") | [<img src="https://avatars.githubusercontent.com/u/1911435?v=4" width="110px;"/><br /><sub>Adam</sub>](http://www.aboutcher.co.uk)<br />[π»](https://github.com/snipe/snipe-it/commits?author=adamboutcher "Code") |+| [<img src="https://avatars.githubusercontent.com/u/16104273?v=4" width="110px;"/><br /><sub>Ian</sub>](https://snksrv.com)<br />[π»](https://github.com/snipe/snipe-it/commits?author=sneak-it "Code") | [<img src="https://avatars.githubusercontent.com/u/4023909?v=4" width="110px;"/><br /><sub>Shao Yu-Lung (Allen)</sub>](http://blog.bestlong.idv.tw/)<br />[π»](https://github.com/snipe/snipe-it/commits?author=bestlong "Code") | [<img src="https://avatars.githubusercontent.com/u/76475453?v=4" width="110px;"/><br /><sub>Haxatron</sub>](https://github.com/Haxatron)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Haxatron "Code") | [<img src="https://avatars.githubusercontent.com/u/3842948?v=4" width="110px;"/><br /><sub>Bradley Coudriet</sub>](http://bjcpgd.cias.rit.edu)<br />[π»](https://github.com/snipe/snipe-it/commits?author=exula "Code") | [<img src="https://avatars.githubusercontent.com/u/21966173?v=4" width="110px;"/><br /><sub>Dalton Durst</sub>](https://daltondur.st)<br />[π»](https://github.com/snipe/snipe-it/commits?author=UniversalSuperBox "Code") | [<img src="https://avatars.githubusercontent.com/u/48162670?v=4" width="110px;"/><br /><sub>TenOfTens</sub>](https://github.com/TenOfTens)<br />[π»](https://github.com/snipe/snipe-it/commits?author=TenOfTens "Code") | [<img src="https://avatars.githubusercontent.com/u/917232?v=4" width="110px;"/><br /><sub>Simona Avornicesei</sub>](http://www.avornicesei.com)<br />[β οΈ](https://github.com/snipe/snipe-it/commits?author=savornicesei "Tests") |+| [<img src="https://avatars.githubusercontent.com/u/19945501?v=4" width="110px;"/><br /><sub>Yevhenii Huzii</sub>](https://github.com/QveenSi)<br />[π»](https://github.com/snipe/snipe-it/commits?author=QveenSi "Code") || [<img src="https://avatars.githubusercontent.com/u/1975640?v=4" width="110px;"/><br /><sub>Evan Taylor</sub>](https://github.com/Delta5)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Delta5 "Code") | [<img src="https://avatars.githubusercontent.com/u/8735148?v=4" width="110px;"/><br /><sub>Petri Asikainen</sub>](https://github.com/PetriAsi)<br />[π»](https://github.com/snipe/snipe-it/commits?author=PetriAsi "Code") | [<img src="https://avatars.githubusercontent.com/u/11424540?v=4" width="110px;"/><br /><sub>derdeagle</sub>](https://github.com/derdeagle)<br />[π»](https://github.com/snipe/snipe-it/commits?author=derdeagle "Code") | [<img src="https://avatars.githubusercontent.com/u/176950?v=4" width="110px;"/><br /><sub>Mike Frysinger</sub>](https://wh0rd.org/)<br />[π»](https://github.com/snipe/snipe-it/commits?author=vapier "Code") | [<img src="https://avatars.githubusercontent.com/u/22044358?v=4" width="110px;"/><br /><sub>ALPHA</sub>](https://github.com/AL4AL)<br />[π»](https://github.com/snipe/snipe-it/commits?author=AL4AL "Code") | [<img src="https://avatars.githubusercontent.com/u/1042587?v=4" width="110px;"/><br /><sub>FliegenKLATSCH</sub>](https://www.ifern.de)<br />[π»](https://github.com/snipe/snipe-it/commits?author=FliegenKLATSCH "Code") | [<img src="https://avatars.githubusercontent.com/u/442138?v=4" width="110px;"/><br /><sub>Jeremy Price</sub>](https://github.com/jerm)<br />[π»](https://github.com/snipe/snipe-it/commits?author=jerm "Code") || [<img src="https://avatars.githubusercontent.com/u/84392209?v=4" width="110px;"/><br /><sub>Toreg87</sub>](https://github.com/Toreg87)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Toreg87 "Code") | [<img src="https://avatars.githubusercontent.com/u/67638596?v=4" width="110px;"/><br /><sub>Matthew Nickson</sub>](https://github.com/Computroniks)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Computroniks "Code") | [<img src="https://avatars.githubusercontent.com/u/1646397?v=4" width="110px;"/><br /><sub>Jethro Nederhof</sub>](https://jethron.id.au)<br />[π»](https://github.com/snipe/snipe-it/commits?author=jethron "Code") | [<img src="https://avatars.githubusercontent.com/u/23289826?v=4" width="110px;"/><br /><sub>Oskar Stenberg</sub>](https://github.com/01ste02)<br />[π»](https://github.com/snipe/snipe-it/commits?author=01ste02 "Code") | [<img src="https://avatars.githubusercontent.com/u/82208283?v=4" width="110px;"/><br /><sub>Robert-Azelis</sub>](https://github.com/Robert-Azelis)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Robert-Azelis "Code") | [<img src="https://avatars.githubusercontent.com/u/60648387?v=4" width="110px;"/><br /><sub>Alexander William Smith</sub>](https://github.com/alwism)<br />[π»](https://github.com/snipe/snipe-it/commits?author=alwism "Code") | [<img src="https://avatars.githubusercontent.com/u/24418301?v=4" width="110px;"/><br /><sub>LEITWERK AG</sub>](https://www.leitwerk.de/)<br />[π»](https://github.com/snipe/snipe-it/commits?author=leitwerk-ag "Code") || [<img src="https://avatars.githubusercontent.com/u/1911435?v=4" width="110px;"/><br /><sub>Adam</sub>](http://www.aboutcher.co.uk)<br />[π»](https://github.com/snipe/snipe-it/commits?author=adamboutcher "Code") | [<img src="https://avatars.githubusercontent.com/u/16104273?v=4" width="110px;"/><br /><sub>Ian</sub>](https://snksrv.com)<br />[π»](https://github.com/snipe/snipe-it/commits?author=sneak-it "Code") | [<img src="https://avatars.githubusercontent.com/u/4023909?v=4" width="110px;"/><br /><sub>Shao Yu-Lung (Allen)</sub>](http://blog.bestlong.idv.tw/)<br />[π»](https://github.com/snipe/snipe-it/commits?author=bestlong "Code") | [<img src="https://avatars.githubusercontent.com/u/76475453?v=4" width="110px;"/><br /><sub>Haxatron</sub>](https://github.com/Haxatron)<br />[π»](https://github.com/snipe/snipe-it/commits?author=Haxatron "Code") | [<img src="https://avatars.githubusercontent.com/u/88776392?v=4" width="110px;"/><br /><sub>PlaneNuts</sub>](https://github.com/PlaneNuts)<br />[π»](https://github.com/snipe/snipe-it/commits?author=PlaneNuts "Code") | [<img src="https://avatars.githubusercontent.com/u/3842948?v=4" width="110px;"/><br /><sub>Bradley Coudriet</sub>](http://bjcpgd.cias.rit.edu)<br />[π»](https://github.com/snipe/snipe-it/commits?author=exula "Code") | [<img src="https://avatars.githubusercontent.com/u/21966173?v=4" width="110px;"/><br /><sub>Dalton Durst</sub>](https://daltondur.st)<br />[π»](https://github.com/snipe/snipe-it/commits?author=UniversalSuperBox "Code") |diff --git a/app/Console/Commands/MoveUploadsToNewDisk.php b/app/Console/Commands/MoveUploadsToNewDisk.phpindex 8fa5ddafd7..9de6781fb6 100644--- a/app/Console/Commands/MoveUploadsToNewDisk.php+++ b/app/Console/Commands/MoveUploadsToNewDisk.php@@ -46,32 +46,33 @@ class MoveUploadsToNewDisk extends Command}$delete_local = $this->argument('delete_local');- $public_uploads['accessories'] = glob('public/accessories'.'/*.*');- $public_uploads['assets'] = glob('public/assets'.'/*.*');- $public_uploads['avatars'] = glob('public/avatars'.'/*.*');- $public_uploads['categories'] = glob('public/categories'.'/*.*');- $public_uploads['companies'] = glob('public/companies'.'/*.*');- $public_uploads['components'] = glob('public/components'.'/*.*');- $public_uploads['consumables'] = glob('public/consumables'.'/*.*');- $public_uploads['departments'] = glob('public/departments'.'/*.*');- $public_uploads['locations'] = glob('public/locations'.'/*.*');- $public_uploads['manufacturers'] = glob('public/manufacturers'.'/*.*');- $public_uploads['suppliers'] = glob('public/suppliers'.'/*.*');- $public_uploads['assetmodels'] = glob('public/models'.'/*.*');+ $public_uploads['accessories'] = glob('public/uploads/accessories' . "/*.*");+ $public_uploads['assets'] = glob('public/uploads/assets' . "/*.*");+ $public_uploads['avatars'] = glob('public/uploads/avatars' . "/*.*");+ $public_uploads['categories'] = glob('public/uploads/categories' . "/*.*");+ $public_uploads['companies'] = glob('public/uploads/companies' . "/*.*");+ $public_uploads['components'] = glob('public/uploads/components' . "/*.*");+ $public_uploads['consumables'] = glob('public/uploads/consumables' . "/*.*");+ $public_uploads['departments'] = glob('public/uploads/departments' . "/*.*");+ $public_uploads['locations'] = glob('public/uploads/locations' . "/*.*");+ $public_uploads['manufacturers'] = glob('public/uploads/manufacturers' . "/*.*");+ $public_uploads['suppliers'] = glob('public/uploads/suppliers' . "/*.*");+ $public_uploads['assetmodels'] = glob('public/uploads/models' . "/*.*");+// iterate filesforeach ($public_uploads as $public_type => $public_upload) {$type_count = 0;- $this->info('- There are '.count($public_upload).' PUBLIC '.$public_type.' files.');+ $this->info('- There are ' . count($public_upload) . ' PUBLIC ' . $public_type . ' files.');for ($i = 0; $i < count($public_upload); $i++) {$type_count++;$filename = basename($public_upload[$i]);try {- Storage::disk('public')->put('uploads/'.public_type.'/'.$filename, file_get_contents($public_upload[$i]));- $new_url = Storage::disk('public')->url('uploads/'.$public_type.'/'.$filename, $filename);- $this->info($type_count.'. PUBLIC: '.$filename.' was copied to '.$new_url);+ Storage::disk('public')->put('uploads/' . $public_type . '/' . $filename, file_get_contents($public_upload[$i]));+ $new_url = Storage::disk('public')->url('uploads/' . $public_type . '/' . $filename, $filename);+ $this->info($type_count . '. PUBLIC: ' . $filename . ' was copied to ' . $new_url);} catch (\Exception $e) {\Log::debug($e);$this->error($e);@@ -80,82 +81,85 @@ class MoveUploadsToNewDisk extends Command}$logos = glob('public/uploads/setting*.*');- $this->info('- There are '.count($logos).' files that might be logos.');+ $this->info('- There are ' . count($logos) . ' files that might be logos.');$type_count = 0;foreach ($logos as $logo) {$this->info($logo);$type_count++;$filename = basename($logo);- Storage::disk('public')->put('uploads/'.$filename, file_get_contents($logo));- $this->info($type_count.'. LOGO: '.$filename.' was copied to '.env('PUBLIC_AWS_URL').'/uploads/'.$filename);+ Storage::disk('public')->put('uploads/' . $filename, file_get_contents($logo));+ $this->info($type_count . '. LOGO: ' . $filename . ' was copied to ' . env('PUBLIC_AWS_URL') . '/uploads/' . $filename);}- $private_uploads['assets'] = glob('storage/private_uploads/assets'.'/*.*');- $private_uploads['signatures'] = glob('storage/private_uploads/signatures'.'/*.*');- $private_uploads['audits'] = glob('storage/private_uploads/audits'.'/*.*');- $private_uploads['assetmodels'] = glob('storage/private_uploads/assetmodels'.'/*.*');- $private_uploads['imports'] = glob('storage/private_uploads/imports'.'/*.*');- $private_uploads['licenses'] = glob('storage/private_uploads/licenses'.'/*.*');- $private_uploads['users'] = glob('storage/private_uploads/users'.'/*.*');- $private_uploads['backups'] = glob('storage/private_uploads/users'.'/*.*');+ $private_uploads['assets'] = glob('storage/private_uploads/assets' . '/*.*');+ $private_uploads['signatures'] = glob('storage/private_uploads/signatures' . '/*.*');+ $private_uploads['audits'] = glob('storage/private_uploads/audits' . '/*.*');+ $private_uploads['assetmodels'] = glob('storage/private_uploads/assetmodels' . '/*.*');+ $private_uploads['imports'] = glob('storage/private_uploads/imports' . '/*.*');+ $private_uploads['licenses'] = glob('storage/private_uploads/licenses' . '/*.*');+ $private_uploads['users'] = glob('storage/private_uploads/users' . '/*.*');+ $private_uploads['backups'] = glob('storage/private_uploads/users' . '/*.*');foreach ($private_uploads as $private_type => $private_upload) {- $this->info('- There are '.count($private_upload).' PRIVATE '.$private_type.' files.');-- $type_count = 0;- for ($x = 0; $x < count($private_upload); $x++) {- $type_count++;- $filename = basename($private_upload[$x]);-- try {- Storage::put($private_type.'/'.$filename, file_get_contents($private_upload[$i]));- $new_url = Storage::url($private_type.'/'.$filename, $filename);- $this->info($type_count.'. PRIVATE: '.$filename.' was copied to '.$new_url);- } catch (\Exception $e) {- \Log::debug($e);- $this->error($e);+ {+ $this->info('- There are ' . count($private_upload) . ' PRIVATE ' . $private_type . ' files.');++ $type_count = 0;+ for ($x = 0; $x < count($private_upload); $x++) {+ $type_count++;+ $filename = basename($private_upload[$x]);++ try {+ Storage::put($private_type . '/' . $filename, file_get_contents($private_upload[$i]));+ $new_url = Storage::url($private_type . '/' . $filename, $filename);+ $this->info($type_count . '. PRIVATE: ' . $filename . ' was copied to ' . $new_url);+ } catch (\Exception $e) {+ \Log::debug($e);+ $this->error($e);+ }}}- }- if ($delete_local == 'true') {- $public_delete_count = 0;- $private_delete_count = 0;-- $this->info("\n\n");- $this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');- $this->warn("\nTHIS WILL DELETE ALL OF YOUR LOCAL UPLOADED FILES. \n\nThis cannot be undone, so you should take a backup of your system before you proceed.\n");- $this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');-- if ($this->confirm('Do you wish to continue?')) {- foreach ($public_uploads as $public_type => $public_upload) {- for ($i = 0; $i < count($public_upload); $i++) {- $filename = $public_upload[$i];- try {- unlink($filename);- $public_delete_count++;- } catch (\Exception $e) {- \Log::debug($e);- $this->error($e);++ if ($delete_local == 'true') {+ $public_delete_count = 0;+ $private_delete_count = 0;++ $this->info("\n\n");+ $this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');+ $this->warn("\nTHIS WILL DELETE ALL OF YOUR LOCAL UPLOADED FILES. \n\nThis cannot be undone, so you should take a backup of your system before you proceed.\n");+ $this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');++ if ($this->confirm('Do you wish to continue?')) {+ foreach ($public_uploads as $public_type => $public_upload) {+ for ($i = 0; $i < count($public_upload); $i++) {+ $filename = $public_upload[$i];+ try {+ unlink($filename);+ $public_delete_count++;+ } catch (\Exception $e) {+ \Log::debug($e);+ $this->error($e);+ }}}- }- foreach ($private_uploads as $private_type => $private_upload) {- for ($i = 0; $i < count($private_upload); $i++) {- $filename = $private_upload[$i];- try {- unlink($filename);- $private_delete_count++;- } catch (\Exception $e) {- \Log::debug($e);- $this->error($e);+ foreach ($private_uploads as $private_type => $private_upload) {+ for ($i = 0; $i < count($private_upload); $i++) {+ $filename = $private_upload[$i];+ try {+ unlink($filename);+ $private_delete_count++;+ } catch (\Exception $e) {+ \Log::debug($e);+ $this->error($e);+ }}}- }- $this->info($public_delete_count.' PUBLIC local files and '.$private_delete_count.' PRIVATE local files were deleted from your filesystem.');+ $this->info($public_delete_count . ' PUBLIC local files and ' . $private_delete_count . ' PRIVATE local files were deleted from your filesystem.');+ }}}}diff --git a/app/Console/Commands/RestoreFromBackup.php b/app/Console/Commands/RestoreFromBackup.phpindex fe778172c8..e0f4eeab16 100644--- a/app/Console/Commands/RestoreFromBackup.php+++ b/app/Console/Commands/RestoreFromBackup.php@@ -13,8 +13,8 @@ class RestoreFromBackup extends Command* @var string*/protected $signature = 'snipeit:restore- {--force : Skip the danger prompt; assuming you hit "y"}- {filename : The full path of the .zip file to be migrated}+ {--force : Skip the danger prompt; assuming you enter "y"}+ {filename : The zip file to be migrated}{--no-progress : Don\'t show a progress bar}';/**diff --git a/app/Http/Controllers/Api/StatuslabelsController.php b/app/Http/Controllers/Api/StatuslabelsController.phpindex a3734a042f..48cb20018c 100644--- a/app/Http/Controllers/Api/StatuslabelsController.php+++ b/app/Http/Controllers/Api/StatuslabelsController.php@@ -33,13 +33,13 @@ class StatuslabelsController extends Controller// if a status_type is passed, filter by thatif ($request->filled('status_type')) {- if (strtolower($request->input('status_type'))== 'pending') {+ if (strtolower($request->input('status_type')) == 'pending') {$statuslabels = $statuslabels->Pending();- } elseif (strtolower($request->input('status_type'))== 'archived') {+ } elseif (strtolower($request->input('status_type')) == 'archived') {$statuslabels = $statuslabels->Archived();- } elseif (strtolower($request->input('status_type'))== 'deployable') {+ } elseif (strtolower($request->input('status_type')) == 'deployable') {$statuslabels = $statuslabels->Deployable();- } elseif (strtolower($request->input('status_type'))== 'undeployable') {+ } elseif (strtolower($request->input('status_type')) == 'undeployable') {$statuslabels = $statuslabels->Undeployable();}}@@ -94,8 +94,8 @@ class StatuslabelsController extends Controllerif ($statuslabel->save()) {return response()->json(Helper::formatStandardApiResponse('success', $statuslabel, trans('admin/statuslabels/message.create.success')));}-return response()->json(Helper::formatStandardApiResponse('error', null, $statuslabel->getErrors()));+}/**@@ -114,6 +114,7 @@ class StatuslabelsController extends Controllerreturn (new StatuslabelsTransformer)->transformStatuslabel($statuslabel);}+/*** Update the specified resource in storage.*@@ -130,6 +131,7 @@ class StatuslabelsController extends Controller$request->except('deployable', 'pending', 'archived');+if (! $request->filled('type')) {return response()->json(Helper::formatStandardApiResponse('error', null, 'Status label type is required.'));}@@ -175,6 +177,7 @@ class StatuslabelsController extends Controllerreturn response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/statuslabels/message.assoc_assets')));}+/*** Show a count of assets by status label for pie chart*diff --git a/app/Importer/LicenseImporter.php b/app/Importer/LicenseImporter.phpindex 358164313f..894c50bbfa 100644--- a/app/Importer/LicenseImporter.php+++ b/app/Importer/LicenseImporter.php@@ -35,7 +35,7 @@ class LicenseImporter extends ItemImporter->first();if ($license) {if (! $this->updating) {- $this->log('A matching License '.$this->item['name'].'with serial '.$this->item['serial'].' already exists');+ $this->log('A matching License '.$this->item['name'].' with serial '.$this->item['serial'].' already exists');return;}diff --git a/app/Models/Asset.php b/app/Models/Asset.phpindex 4da71d3669..ac373b2ad4 100644--- a/app/Models/Asset.php+++ b/app/Models/Asset.php@@ -195,6 +195,13 @@ class Asset extends Depreciable$model = AssetModel::find($this->model_id);if (($model) && ($model->fieldset)) {++ foreach ($model->fieldset->fields as $field){+ if($field->format == 'BOOLEAN'){+ $this->{$field->db_column} = filter_var($this->{$field->db_column}, FILTER_VALIDATE_BOOLEAN);+ }+ }+$this->rules += $model->fieldset->validation_rules();foreach ($this->model->fieldset->fields as $field){@@ -205,6 +212,8 @@ class Asset extends Depreciable}}++return parent::save($params);}diff --git a/app/Models/User.php b/app/Models/User.phpindex 8f06eae6a8..f211a3c134 100755--- a/app/Models/User.php+++ b/app/Models/User.php@@ -74,7 +74,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo* @var array*/- // 'username' => 'required|string|min:1|unique:users,username,NULL,id,deleted_at,NULL',protected $rules = ['first_name' => 'required|string|min:1','username' => 'required|string|min:1|unique_undeleted',diff --git a/config/version.php b/config/version.phpindex c9ff26503d..29e2589345 100644--- a/config/version.php+++ b/config/version.php@@ -1,10 +1,10 @@<?phpreturn array (- 'app_version' => 'v6.0.0-RC-5',- 'full_app_version' => 'v6.0.0-RC-5 - build 6772-g7cbcd2d95',- 'build_version' => '6772',+ 'app_version' => 'v6.0.0-RC-6',+ 'full_app_version' => 'v6.0.0-RC-6 - build 6785-gab18ceb2f',+ 'build_version' => '6785','prerelease_version' => '',- 'hash_version' => 'g7cbcd2d95',- 'full_hash' => 'v6.0.0-RC-5-19-g7cbcd2d95',- 'branch' => 'merges/master_down_to_develop_march_16',+ 'hash_version' => 'gab18ceb2f',+ 'full_hash' => 'v6.0.0-RC-6-gab18ceb2f',+ 'branch' => 'develop',);\ No newline at end of filediff --git a/database/migrations/2018_10_18_191228_add_kits_licenses_table.php b/database/migrations/2018_10_18_191228_add_kits_licenses_table.phpindex 470f67803c..5461742022 100644--- a/database/migrations/2018_10_18_191228_add_kits_licenses_table.php+++ b/database/migrations/2018_10_18_191228_add_kits_licenses_table.php@@ -17,8 +17,8 @@ class AddKitsLicensesTable extends Migrationif (!Schema::hasTable('kits_licenses')) {Schema::create('kits_licenses', function ($table) {$table->increments('id');- $table->integer('kit_id')->nullable()->default(null);- $table->integer('license_id')->nullable()->default(null);+ $table->integer('kit_id')->nullable()->default(NULL);+ $table->integer('license_id')->nullable()->default(NULL);$table->integer('quantity')->default(1);$table->timestamps();});diff --git a/database/migrations/2018_10_19_153910_add_kits_table.php b/database/migrations/2018_10_19_153910_add_kits_table.phpindex fbc683f180..08d04d29e8 100644--- a/database/migrations/2018_10_19_153910_add_kits_table.php+++ b/database/migrations/2018_10_19_153910_add_kits_table.php@@ -16,7 +16,7 @@ class AddKitsTable extends Migrationif (!Schema::hasTable('kits')) {Schema::create('kits', function ($table) {$table->increments('id');- $table->string('name')->nullable()->default(null);+ $table->string('name')->nullable()->default(NULL);$table->timestamps();$table->engine = 'InnoDB';});@@ -34,6 +34,7 @@ class AddKitsTable extends Migrationif (Schema::hasTable('kits')) {Schema::drop('kits');}+}}diff --git a/database/migrations/2018_10_19_154013_add_kits_models_table.php b/database/migrations/2018_10_19_154013_add_kits_models_table.phpindex 3b5224c6bc..ea651085b5 100644--- a/database/migrations/2018_10_19_154013_add_kits_models_table.php+++ b/database/migrations/2018_10_19_154013_add_kits_models_table.php@@ -17,8 +17,8 @@ class AddKitsModelsTable extends Migrationif (!Schema::hasTable('kits_models')) {Schema::create('kits_models', function ($table) {$table->increments('id');- $table->integer('kit_id')->nullable()->default(null);- $table->integer('model_id')->nullable()->default(null);+ $table->integer('kit_id')->nullable()->default(NULL);+ $table->integer('model_id')->nullable()->default(NULL);$table->integer('quantity')->default(1);$table->timestamps();});@@ -36,4 +36,5 @@ class AddKitsModelsTable extends MigrationSchema::drop('kits_models');}}+}diff --git a/database/migrations/2019_02_07_185953_add_kits_consumables_table.php b/database/migrations/2019_02_07_185953_add_kits_consumables_table.phpindex 34fbb3539b..6f7595484a 100644--- a/database/migrations/2019_02_07_185953_add_kits_consumables_table.php+++ b/database/migrations/2019_02_07_185953_add_kits_consumables_table.php@@ -16,8 +16,8 @@ class AddKitsConsumablesTable extends Migrationif (!Schema::hasTable('kits_consumables')) {Schema::create('kits_consumables', function ($table) {$table->increments('id');- $table->integer('kit_id')->nullable()->default(null);- $table->integer('consumable_id')->nullable()->default(null);+ $table->integer('kit_id')->nullable()->default(NULL);+ $table->integer('consumable_id')->nullable()->default(NULL);$table->integer('quantity')->default(1);$table->timestamps();});diff --git a/database/migrations/2019_02_07_190030_add_kits_accessories_table.php b/database/migrations/2019_02_07_190030_add_kits_accessories_table.phpindex 1a4e14af94..242b283e52 100644--- a/database/migrations/2019_02_07_190030_add_kits_accessories_table.php+++ b/database/migrations/2019_02_07_190030_add_kits_accessories_table.php@@ -16,8 +16,8 @@ class AddKitsAccessoriesTable extends Migrationif (!Schema::hasTable('kits_accessories')) {Schema::create('kits_accessories', function ($table) {$table->increments('id');- $table->integer('kit_id')->nullable()->default(null);- $table->integer('accessory_id')->nullable()->default(null);+ $table->integer('kit_id')->nullable()->default(NULL);+ $table->integer('accessory_id')->nullable()->default(NULL);$table->integer('quantity')->default(1);$table->timestamps();});diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.phpindex 257718361a..98fb784a33 100644--- a/resources/views/partials/bootstrap-table.blade.php+++ b/resources/views/partials/bootstrap-table.blade.php@@ -31,6 +31,11 @@}$('.snipe-table').bootstrapTable({+ data_export_options = $(this).attr('data-export-options');+ export_options = data_export_options? JSON.parse(data_export_options): {};+ export_options['htmlContent'] = true; //always enforce this on the given data-export-options (to prevent XSS)++ $(this).bootstrapTable({classes: 'table table-responsive table-no-bordered',ajaxOptions: {headers: {@@ -76,17 +81,15 @@export: 'fa-download',clearSearch: 'fa-times'},- exportOptions: {- htmlContent: true,- },+ exportOptions: export_options,exportTypes: ['csv', 'excel', 'doc', 'txt','json', 'xml', 'pdf'],onLoadSuccess: function () {$('[data-toggle="tooltip"]').tooltip(); // Needed to attach tooltips after ajax call}+ });});-});