mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge branch 'develop' into fix/test-suite
This commit is contained in:
commit
0be882dc35
|
@ -2846,6 +2846,15 @@
|
||||||
"contributions": [
|
"contributions": [
|
||||||
"code"
|
"code"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "kenchan0130",
|
||||||
|
"name": "Tadayuki Onishi",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/1155067?v=4",
|
||||||
|
"profile": "https://kenchan0130.github.io",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
![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-313-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-314-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
|
## Snipe-IT - Open Source Asset Management System
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
|
||||||
| [<img src="https://avatars.githubusercontent.com/u/97299851?v=4" width="110px;"/><br /><sub>Christian Weirich</sub>](https://github.com/chrisweirich)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chrisweirich "Code") | [<img src="https://avatars.githubusercontent.com/u/1294403?v=4" width="110px;"/><br /><sub>denzfarid</sub>](https://github.com/denzfarid)<br /> | [<img src="https://avatars.githubusercontent.com/u/94018771?v=4" width="110px;"/><br /><sub>ntbutler-nbcs</sub>](https://github.com/ntbutler-nbcs)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ntbutler-nbcs "Code") | [<img src="https://avatars.githubusercontent.com/u/172697?v=4" width="110px;"/><br /><sub>Naveen</sub>](https://naveensrinivasan.dev)<br />[💻](https://github.com/snipe/snipe-it/commits?author=naveensrinivasan "Code") | [<img src="https://avatars.githubusercontent.com/u/55674383?v=4" width="110px;"/><br /><sub>Mike Roquemore</sub>](https://github.com/mikeroq)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mikeroq "Code") | [<img src="https://avatars.githubusercontent.com/u/7991086?v=4" width="110px;"/><br /><sub>Daniel Reeder</sub>](https://github.com/reederda)<br />[🌍](#translation-reederda "Translation") [🌍](#translation-reederda "Translation") [💻](https://github.com/snipe/snipe-it/commits?author=reederda "Code") | [<img src="https://avatars.githubusercontent.com/u/109422491?v=4" width="110px;"/><br /><sub>vickyjaura183</sub>](https://github.com/vickyjaura183)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vickyjaura183 "Code") |
|
| [<img src="https://avatars.githubusercontent.com/u/97299851?v=4" width="110px;"/><br /><sub>Christian Weirich</sub>](https://github.com/chrisweirich)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chrisweirich "Code") | [<img src="https://avatars.githubusercontent.com/u/1294403?v=4" width="110px;"/><br /><sub>denzfarid</sub>](https://github.com/denzfarid)<br /> | [<img src="https://avatars.githubusercontent.com/u/94018771?v=4" width="110px;"/><br /><sub>ntbutler-nbcs</sub>](https://github.com/ntbutler-nbcs)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ntbutler-nbcs "Code") | [<img src="https://avatars.githubusercontent.com/u/172697?v=4" width="110px;"/><br /><sub>Naveen</sub>](https://naveensrinivasan.dev)<br />[💻](https://github.com/snipe/snipe-it/commits?author=naveensrinivasan "Code") | [<img src="https://avatars.githubusercontent.com/u/55674383?v=4" width="110px;"/><br /><sub>Mike Roquemore</sub>](https://github.com/mikeroq)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mikeroq "Code") | [<img src="https://avatars.githubusercontent.com/u/7991086?v=4" width="110px;"/><br /><sub>Daniel Reeder</sub>](https://github.com/reederda)<br />[🌍](#translation-reederda "Translation") [🌍](#translation-reederda "Translation") [💻](https://github.com/snipe/snipe-it/commits?author=reederda "Code") | [<img src="https://avatars.githubusercontent.com/u/109422491?v=4" width="110px;"/><br /><sub>vickyjaura183</sub>](https://github.com/vickyjaura183)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vickyjaura183 "Code") |
|
||||||
| [<img src="https://avatars.githubusercontent.com/u/32363424?v=4" width="110px;"/><br /><sub>Peace</sub>](https://github.com/julian-piehl)<br />[💻](https://github.com/snipe/snipe-it/commits?author=julian-piehl "Code") | [<img src="https://avatars.githubusercontent.com/u/231528?v=4" width="110px;"/><br /><sub>Kyle Gordon</sub>](https://github.com/kylegordon)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kylegordon "Code") | [<img src="https://avatars.githubusercontent.com/u/53009155?v=4" width="110px;"/><br /><sub>Katharina Drexel</sub>](http://www.bfh.ch)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sunflowerbofh "Code") | [<img src="https://avatars.githubusercontent.com/u/1931963?v=4" width="110px;"/><br /><sub>David Sferruzza</sub>](https://david.sferruzza.fr/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dsferruzza "Code") | [<img src="https://avatars.githubusercontent.com/u/19511639?v=4" width="110px;"/><br /><sub>Rick Nelson</sub>](https://github.com/rnelsonee)<br />[💻](https://github.com/snipe/snipe-it/commits?author=rnelsonee "Code") | [<img src="https://avatars.githubusercontent.com/u/94169344?v=4" width="110px;"/><br /><sub>BasO12</sub>](https://github.com/BasO12)<br />[💻](https://github.com/snipe/snipe-it/commits?author=BasO12 "Code") | [<img src="https://avatars.githubusercontent.com/u/111710123?v=4" width="110px;"/><br /><sub>Vautia</sub>](https://github.com/Vautia)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Vautia "Code") |
|
| [<img src="https://avatars.githubusercontent.com/u/32363424?v=4" width="110px;"/><br /><sub>Peace</sub>](https://github.com/julian-piehl)<br />[💻](https://github.com/snipe/snipe-it/commits?author=julian-piehl "Code") | [<img src="https://avatars.githubusercontent.com/u/231528?v=4" width="110px;"/><br /><sub>Kyle Gordon</sub>](https://github.com/kylegordon)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kylegordon "Code") | [<img src="https://avatars.githubusercontent.com/u/53009155?v=4" width="110px;"/><br /><sub>Katharina Drexel</sub>](http://www.bfh.ch)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sunflowerbofh "Code") | [<img src="https://avatars.githubusercontent.com/u/1931963?v=4" width="110px;"/><br /><sub>David Sferruzza</sub>](https://david.sferruzza.fr/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dsferruzza "Code") | [<img src="https://avatars.githubusercontent.com/u/19511639?v=4" width="110px;"/><br /><sub>Rick Nelson</sub>](https://github.com/rnelsonee)<br />[💻](https://github.com/snipe/snipe-it/commits?author=rnelsonee "Code") | [<img src="https://avatars.githubusercontent.com/u/94169344?v=4" width="110px;"/><br /><sub>BasO12</sub>](https://github.com/BasO12)<br />[💻](https://github.com/snipe/snipe-it/commits?author=BasO12 "Code") | [<img src="https://avatars.githubusercontent.com/u/111710123?v=4" width="110px;"/><br /><sub>Vautia</sub>](https://github.com/Vautia)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Vautia "Code") |
|
||||||
| [<img src="https://avatars.githubusercontent.com/u/28321?v=4" width="110px;"/><br /><sub>Chris Hartjes</sub>](http://www.littlehart.net/atthekeyboard)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chartjes "Code") | [<img src="https://avatars.githubusercontent.com/u/2404584?v=4" width="110px;"/><br /><sub>geo-chen</sub>](https://github.com/geo-chen)<br />[💻](https://github.com/snipe/snipe-it/commits?author=geo-chen "Code") | [<img src="https://avatars.githubusercontent.com/u/6006620?v=4" width="110px;"/><br /><sub>Phan Nguyen</sub>](https://github.com/nh314)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nh314 "Code") | [<img src="https://avatars.githubusercontent.com/u/115993812?v=4" width="110px;"/><br /><sub>Iisakki Jaakkola</sub>](https://github.com/StarlessNights)<br />[💻](https://github.com/snipe/snipe-it/commits?author=StarlessNights "Code") | [<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="110px;"/><br /><sub>Ikko Ashimine</sub>](https://bandism.net/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=eltociear "Code") | [<img src="https://avatars.githubusercontent.com/u/56871540?v=4" width="110px;"/><br /><sub>Lukas Fehling</sub>](https://github.com/lukasfehling)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lukasfehling "Code") | [<img src="https://avatars.githubusercontent.com/u/1975990?v=4" width="110px;"/><br /><sub>Fernando Almeida</sub>](https://github.com/fernando-almeida)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fernando-almeida "Code") |
|
| [<img src="https://avatars.githubusercontent.com/u/28321?v=4" width="110px;"/><br /><sub>Chris Hartjes</sub>](http://www.littlehart.net/atthekeyboard)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chartjes "Code") | [<img src="https://avatars.githubusercontent.com/u/2404584?v=4" width="110px;"/><br /><sub>geo-chen</sub>](https://github.com/geo-chen)<br />[💻](https://github.com/snipe/snipe-it/commits?author=geo-chen "Code") | [<img src="https://avatars.githubusercontent.com/u/6006620?v=4" width="110px;"/><br /><sub>Phan Nguyen</sub>](https://github.com/nh314)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nh314 "Code") | [<img src="https://avatars.githubusercontent.com/u/115993812?v=4" width="110px;"/><br /><sub>Iisakki Jaakkola</sub>](https://github.com/StarlessNights)<br />[💻](https://github.com/snipe/snipe-it/commits?author=StarlessNights "Code") | [<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="110px;"/><br /><sub>Ikko Ashimine</sub>](https://bandism.net/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=eltociear "Code") | [<img src="https://avatars.githubusercontent.com/u/56871540?v=4" width="110px;"/><br /><sub>Lukas Fehling</sub>](https://github.com/lukasfehling)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lukasfehling "Code") | [<img src="https://avatars.githubusercontent.com/u/1975990?v=4" width="110px;"/><br /><sub>Fernando Almeida</sub>](https://github.com/fernando-almeida)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fernando-almeida "Code") |
|
||||||
| [<img src="https://avatars.githubusercontent.com/u/116301219?v=4" width="110px;"/><br /><sub>akemidx</sub>](https://github.com/akemidx)<br />[💻](https://github.com/snipe/snipe-it/commits?author=akemidx "Code") | [<img src="https://avatars.githubusercontent.com/u/144778?v=4" width="110px;"/><br /><sub>Oguz Bilgic</sub>](http://oguz.site)<br />[💻](https://github.com/snipe/snipe-it/commits?author=oguzbilgic "Code") | [<img src="https://avatars.githubusercontent.com/u/9262438?v=4" width="110px;"/><br /><sub>Scooter Crawford</sub>](https://github.com/scoo73r)<br />[💻](https://github.com/snipe/snipe-it/commits?author=scoo73r "Code") | [<img src="https://avatars.githubusercontent.com/u/5957345?v=4" width="110px;"/><br /><sub>subdriven</sub>](https://github.com/subdriven)<br />[💻](https://github.com/snipe/snipe-it/commits?author=subdriven "Code") | [<img src="https://avatars.githubusercontent.com/u/658865?v=4" width="110px;"/><br /><sub>Andrew Savinykh</sub>](https://github.com/AndrewSav)<br />[💻](https://github.com/snipe/snipe-it/commits?author=AndrewSav "Code") |
|
| [<img src="https://avatars.githubusercontent.com/u/116301219?v=4" width="110px;"/><br /><sub>akemidx</sub>](https://github.com/akemidx)<br />[💻](https://github.com/snipe/snipe-it/commits?author=akemidx "Code") | [<img src="https://avatars.githubusercontent.com/u/144778?v=4" width="110px;"/><br /><sub>Oguz Bilgic</sub>](http://oguz.site)<br />[💻](https://github.com/snipe/snipe-it/commits?author=oguzbilgic "Code") | [<img src="https://avatars.githubusercontent.com/u/9262438?v=4" width="110px;"/><br /><sub>Scooter Crawford</sub>](https://github.com/scoo73r)<br />[💻](https://github.com/snipe/snipe-it/commits?author=scoo73r "Code") | [<img src="https://avatars.githubusercontent.com/u/5957345?v=4" width="110px;"/><br /><sub>subdriven</sub>](https://github.com/subdriven)<br />[💻](https://github.com/snipe/snipe-it/commits?author=subdriven "Code") | [<img src="https://avatars.githubusercontent.com/u/658865?v=4" width="110px;"/><br /><sub>Andrew Savinykh</sub>](https://github.com/AndrewSav)<br />[💻](https://github.com/snipe/snipe-it/commits?author=AndrewSav "Code") | [<img src="https://avatars.githubusercontent.com/u/1155067?v=4" width="110px;"/><br /><sub>Tadayuki Onishi</sub>](https://kenchan0130.github.io)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kenchan0130 "Code") |
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||||
|
|
||||||
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
|
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
|
||||||
|
|
|
@ -69,6 +69,7 @@ class UsersController extends Controller
|
||||||
'users.ldap_import',
|
'users.ldap_import',
|
||||||
'users.start_date',
|
'users.start_date',
|
||||||
'users.end_date',
|
'users.end_date',
|
||||||
|
'users.vip',
|
||||||
|
|
||||||
])->with('manager', 'groups', 'userloc', 'company', 'department', 'assets', 'licenses', 'accessories', 'consumables', 'createdBy',)
|
])->with('manager', 'groups', 'userloc', 'company', 'department', 'assets', 'licenses', 'accessories', 'consumables', 'createdBy',)
|
||||||
->withCount('assets as assets_count', 'licenses as licenses_count', 'accessories as accessories_count', 'consumables as consumables_count');
|
->withCount('assets as assets_count', 'licenses as licenses_count', 'accessories as accessories_count', 'consumables as consumables_count');
|
||||||
|
@ -149,6 +150,10 @@ class UsersController extends Controller
|
||||||
$users = $users->where('remote', '=', $request->input('remote'));
|
$users = $users->where('remote', '=', $request->input('remote'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->filled('vip')) {
|
||||||
|
$users = $users->where('vip', '=', $request->input('vip'));
|
||||||
|
}
|
||||||
|
|
||||||
if ($request->filled('two_factor_enrolled')) {
|
if ($request->filled('two_factor_enrolled')) {
|
||||||
$users = $users->where('two_factor_enrolled', '=', $request->input('two_factor_enrolled'));
|
$users = $users->where('two_factor_enrolled', '=', $request->input('two_factor_enrolled'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@ use enshrined\svgSanitize\Sanitizer;
|
||||||
use Intervention\Image\Facades\Image;
|
use Intervention\Image\Facades\Image;
|
||||||
use App\Http\Traits\ConvertsBase64ToFiles;
|
use App\Http\Traits\ConvertsBase64ToFiles;
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
use Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Intervention\Image\Exception\NotReadableException;
|
||||||
|
|
||||||
|
|
||||||
class ImageUploadRequest extends Request
|
class ImageUploadRequest extends Request
|
||||||
{
|
{
|
||||||
|
@ -106,10 +108,18 @@ class ImageUploadRequest extends Request
|
||||||
\Log::debug('Not an SVG or webp - resize');
|
\Log::debug('Not an SVG or webp - resize');
|
||||||
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
|
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
|
||||||
|
|
||||||
|
try {
|
||||||
$upload = Image::make($image->getRealPath())->resize(null, $w, function ($constraint) {
|
$upload = Image::make($image->getRealPath())->resize(null, $w, function ($constraint) {
|
||||||
$constraint->aspectRatio();
|
$constraint->aspectRatio();
|
||||||
$constraint->upsize();
|
$constraint->upsize();
|
||||||
});
|
});
|
||||||
|
} catch(NotReadableException $e) {
|
||||||
|
\Log::debug($e);
|
||||||
|
$validator = \Validator::make([], []);
|
||||||
|
$validator->errors()->add($form_fieldname, trans('general.unaccepted_image_type', ['mimetype' => $image->getClientMimeType()]));
|
||||||
|
|
||||||
|
throw new \Illuminate\Validation\ValidationException($validator);
|
||||||
|
}
|
||||||
|
|
||||||
// This requires a string instead of an object, so we use ($string)
|
// This requires a string instead of an object, so we use ($string)
|
||||||
Storage::disk('public')->put($path.'/'.$file_name, (string) $upload->encode());
|
Storage::disk('public')->put($path.'/'.$file_name, (string) $upload->encode());
|
||||||
|
|
|
@ -36,6 +36,7 @@ class UsersTransformer
|
||||||
'name'=> e($user->manager->first_name).' '.e($user->manager->last_name),
|
'name'=> e($user->manager->first_name).' '.e($user->manager->last_name),
|
||||||
] : null,
|
] : null,
|
||||||
'jobtitle' => ($user->jobtitle) ? e($user->jobtitle) : null,
|
'jobtitle' => ($user->jobtitle) ? e($user->jobtitle) : null,
|
||||||
|
'vip' => ($user->vip == '1') ? true : false,
|
||||||
'phone' => ($user->phone) ? e($user->phone) : null,
|
'phone' => ($user->phone) ? e($user->phone) : null,
|
||||||
'website' => ($user->website) ? e($user->website) : null,
|
'website' => ($user->website) ? e($user->website) : null,
|
||||||
'address' => ($user->address) ? e($user->address) : null,
|
'address' => ($user->address) ? e($user->address) : null,
|
||||||
|
|
|
@ -76,10 +76,12 @@ class AssetImporter extends ItemImporter
|
||||||
}
|
}
|
||||||
$this->item['notes'] = $this->findCsvMatch($row, 'asset_notes');
|
$this->item['notes'] = $this->findCsvMatch($row, 'asset_notes');
|
||||||
$this->item['image'] = $this->findCsvMatch($row, 'image');
|
$this->item['image'] = $this->findCsvMatch($row, 'image');
|
||||||
$this->item['requestable'] = $this->fetchHumanBoolean($this->findCsvMatch($row, 'requestable'));
|
$this->item['requestable'] = ($this->fetchHumanBoolean($this->findCsvMatch($row, 'requestable')) == 1) ? '1' : 0;
|
||||||
$asset->requestable = $this->fetchHumanBoolean($this->findCsvMatch($row, 'requestable'));
|
$asset->requestable = $this->item['requestable'];
|
||||||
$this->item['warranty_months'] = intval($this->findCsvMatch($row, 'warranty_months'));
|
$this->item['warranty_months'] = intval($this->findCsvMatch($row, 'warranty_months'));
|
||||||
$this->item['model_id'] = $this->createOrFetchAssetModel($row);
|
$this->item['model_id'] = $this->createOrFetchAssetModel($row);
|
||||||
|
$this->item['byod'] = ($this->fetchHumanBoolean($this->findCsvMatch($row, 'byod')) == 1) ? '1' : 0;
|
||||||
|
|
||||||
|
|
||||||
// If no status ID is found
|
// If no status ID is found
|
||||||
if (! array_key_exists('status_id', $this->item) && ! $editingAsset) {
|
if (! array_key_exists('status_id', $this->item) && ! $editingAsset) {
|
||||||
|
@ -135,7 +137,7 @@ class AssetImporter extends ItemImporter
|
||||||
//-- user_id is a property of the abstract class Importer, which this class inherits from and it's setted by
|
//-- user_id is a property of the abstract class Importer, which this class inherits from and it's setted by
|
||||||
//-- the class that needs to use it (command importer or GUI importer inside the project).
|
//-- the class that needs to use it (command importer or GUI importer inside the project).
|
||||||
if (isset($target)) {
|
if (isset($target)) {
|
||||||
$asset->fresh()->checkOut($target, $this->user_id, date('Y-m-d H:i:s'));
|
$asset->fresh()->checkOut($target, $this->user_id, date('Y-m-d H:i:s'), null, $asset->notes, $asset->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -90,7 +90,7 @@ class ItemImporter extends Importer
|
||||||
$this->item['qty'] = $this->findCsvMatch($row, 'quantity');
|
$this->item['qty'] = $this->findCsvMatch($row, 'quantity');
|
||||||
$this->item['requestable'] = $this->findCsvMatch($row, 'requestable');
|
$this->item['requestable'] = $this->findCsvMatch($row, 'requestable');
|
||||||
$this->item['user_id'] = $this->user_id;
|
$this->item['user_id'] = $this->user_id;
|
||||||
$this->item['serial'] = $this->findCsvMatch($row, 'serial number');
|
$this->item['serial'] = $this->findCsvMatch($row, 'serial');
|
||||||
// NO need to call this method if we're running the user import.
|
// NO need to call this method if we're running the user import.
|
||||||
// TODO: Merge these methods.
|
// TODO: Merge these methods.
|
||||||
$this->item['checkout_class'] = $this->findCsvMatch($row, 'checkout_class');
|
$this->item['checkout_class'] = $this->findCsvMatch($row, 'checkout_class');
|
||||||
|
|
|
@ -58,6 +58,8 @@ class UserImporter extends ItemImporter
|
||||||
$this->item['department_id'] = $this->createOrFetchDepartment($this->findCsvMatch($row, 'department'));
|
$this->item['department_id'] = $this->createOrFetchDepartment($this->findCsvMatch($row, 'department'));
|
||||||
$this->item['manager_id'] = $this->fetchManager($this->findCsvMatch($row, 'manager_first_name'), $this->findCsvMatch($row, 'manager_last_name'));
|
$this->item['manager_id'] = $this->fetchManager($this->findCsvMatch($row, 'manager_first_name'), $this->findCsvMatch($row, 'manager_last_name'));
|
||||||
$this->item['remote'] =($this->fetchHumanBoolean($this->findCsvMatch($row, 'remote')) ==1 ) ? '1' : 0;
|
$this->item['remote'] =($this->fetchHumanBoolean($this->findCsvMatch($row, 'remote')) ==1 ) ? '1' : 0;
|
||||||
|
$this->item['vip'] =($this->fetchHumanBoolean($this->findCsvMatch($row, 'vip')) ==1 ) ? '1' : 0;
|
||||||
|
|
||||||
|
|
||||||
$user_department = $this->findCsvMatch($row, 'department');
|
$user_department = $this->findCsvMatch($row, 'department');
|
||||||
if ($this->shouldUpdateField($user_department)) {
|
if ($this->shouldUpdateField($user_department)) {
|
||||||
|
|
|
@ -40,4 +40,6 @@
|
||||||
| city | city | User |
|
| city | city | User |
|
||||||
| state | state | User |
|
| state | state | User |
|
||||||
| country | country | User |
|
| country | country | User |
|
||||||
|
| vip | vip | User |
|
||||||
|
| byod | byod | Asset |
|
||||||
|
|
||||||
|
|
|
@ -547,6 +547,28 @@ class Asset extends Depreciable
|
||||||
return strtolower(class_basename($this->assigned_type));
|
return strtolower(class_basename($this->assigned_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is annoying, but because we don't say "assets" in our route names, we have to make an exception here
|
||||||
|
* @todo - normalize the route names - API endpoint URLS can stay the same
|
||||||
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
|
* @since [v6.1.0]
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function targetShowRoute()
|
||||||
|
{
|
||||||
|
$route = str_plural($this->assignedType());
|
||||||
|
if ($route=='assets') {
|
||||||
|
return 'hardware';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $route;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the asset's location based on default RTD location
|
* Get the asset's location based on default RTD location
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
return array (
|
return array (
|
||||||
'app_version' => 'v6.0.14',
|
'app_version' => 'v6.0.14',
|
||||||
'full_app_version' => 'v6.0.14 - build 9646-g417a1e624',
|
'full_app_version' => 'v6.0.14 - build 9715-g8b70a7f21',
|
||||||
'build_version' => '9646',
|
'build_version' => '9715',
|
||||||
'prerelease_version' => '',
|
'prerelease_version' => '',
|
||||||
'hash_version' => 'g417a1e624',
|
'hash_version' => 'g8b70a7f21',
|
||||||
'full_hash' => 'v6.0.14-602-g417a1e624',
|
'full_hash' => 'v6.0.14-671-g8b70a7f21',
|
||||||
'branch' => 'develop',
|
'branch' => 'develop',
|
||||||
);
|
);
|
Binary file not shown.
BIN
public/js/dist/all.js
vendored
BIN
public/js/dist/all.js
vendored
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"/js/build/app.js": "/js/build/app.js?id=f05cc05b9000ba73e1949bcf137d4301",
|
"/js/build/app.js": "/js/build/app.js?id=da037f537476ebca094531163cb611f5",
|
||||||
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=f677207c6cf9678eb539abecb408c374",
|
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=f677207c6cf9678eb539abecb408c374",
|
||||||
"/css/build/overrides.css": "/css/build/overrides.css?id=d9175e3d9b9074397343dddebfe23888",
|
"/css/build/overrides.css": "/css/build/overrides.css?id=d9175e3d9b9074397343dddebfe23888",
|
||||||
"/css/build/app.css": "/css/build/app.css?id=dcb8aa9f4501a370214a67442e88daf0",
|
"/css/build/app.css": "/css/build/app.css?id=dcb8aa9f4501a370214a67442e88daf0",
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=ee4896df8b8f008ce73a9a0c2549aefd",
|
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=ee4896df8b8f008ce73a9a0c2549aefd",
|
||||||
"/js/build/vendor.js": "/js/build/vendor.js?id=47ecbb4bb3b0e02315f391caadbdf971",
|
"/js/build/vendor.js": "/js/build/vendor.js?id=47ecbb4bb3b0e02315f391caadbdf971",
|
||||||
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=14d9a2affec7b066d20fcba2e6e67ad2",
|
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=14d9a2affec7b066d20fcba2e6e67ad2",
|
||||||
"/js/dist/all.js": "/js/dist/all.js?id=4f9355ac85d380301f6f62e55b1a6e5e",
|
"/js/dist/all.js": "/js/dist/all.js?id=758f256419ccaf4b4266da3bbc742b0b",
|
||||||
"/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=0a82a6ae6bb4e58fe62d162c4fb50397",
|
"/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=0a82a6ae6bb4e58fe62d162c4fb50397",
|
||||||
"/css/dist/skins/skin-green-dark.min.css": "/css/dist/skins/skin-green-dark.min.css?id=c0d21166315b7c2cdd4819fa4a5e4d1e",
|
"/css/dist/skins/skin-green-dark.min.css": "/css/dist/skins/skin-green-dark.min.css?id=c0d21166315b7c2cdd4819fa4a5e4d1e",
|
||||||
"/css/dist/skins/skin-black.min.css": "/css/dist/skins/skin-black.min.css?id=76482123f6c70e866d6b971ba91de7bb",
|
"/css/dist/skins/skin-black.min.css": "/css/dist/skins/skin-black.min.css?id=76482123f6c70e866d6b971ba91de7bb",
|
||||||
|
|
|
@ -161,6 +161,7 @@
|
||||||
{id: 'warranty_months', text: 'Warranty Months' },
|
{id: 'warranty_months', text: 'Warranty Months' },
|
||||||
{id: 'last_audit_date', text: 'Last Audit Date' },
|
{id: 'last_audit_date', text: 'Last Audit Date' },
|
||||||
{id: 'next_audit_date', text: 'Audit Date' },
|
{id: 'next_audit_date', text: 'Audit Date' },
|
||||||
|
{id: 'byod', text: 'BYOD' },
|
||||||
],
|
],
|
||||||
consumables: [
|
consumables: [
|
||||||
{id: 'item_no', text: "Item Number"},
|
{id: 'item_no', text: "Item Number"},
|
||||||
|
@ -195,6 +196,7 @@
|
||||||
{id: 'country', text: 'Country' },
|
{id: 'country', text: 'Country' },
|
||||||
{id: 'zip', text: 'ZIP' },
|
{id: 'zip', text: 'ZIP' },
|
||||||
{id: 'remote', text: 'Remote'},
|
{id: 'remote', text: 'Remote'},
|
||||||
|
{id: 'vip', text: 'VIP'},
|
||||||
|
|
||||||
],
|
],
|
||||||
customFields: this.customFields,
|
customFields: this.customFields,
|
||||||
|
|
|
@ -540,10 +540,16 @@ $(document).ready(function () {
|
||||||
var id = '#' + $this.attr('id');
|
var id = '#' + $this.attr('id');
|
||||||
var status = id + '-status';
|
var status = id + '-status';
|
||||||
var $status = $(status);
|
var $status = $(status);
|
||||||
|
var delete_id = $(id + '-deleteCheckbox');
|
||||||
|
var preview_container = $(id + '-previewContainer');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$status.removeClass('text-success').removeClass('text-danger');
|
$status.removeClass('text-success').removeClass('text-danger');
|
||||||
$(status + ' .goodfile').remove();
|
$(status + ' .goodfile').remove();
|
||||||
$(status + ' .badfile').remove();
|
$(status + ' .badfile').remove();
|
||||||
$(status + ' .previewSize').hide();
|
$(status + ' .previewSize').hide();
|
||||||
|
preview_container.hide();
|
||||||
$(id + '-info').html('');
|
$(id + '-info').html('');
|
||||||
|
|
||||||
var max_size = $this.data('maxsize');
|
var max_size = $this.data('maxsize');
|
||||||
|
@ -554,17 +560,15 @@ $(document).ready(function () {
|
||||||
$(id + '-info').append('<span class="label label-default">' + htmlEntities(this.files[i].name) + ' (' + formatBytes(this.files[i].size) + ')</span> ');
|
$(id + '-info').append('<span class="label label-default">' + htmlEntities(this.files[i].name) + ' (' + formatBytes(this.files[i].size) + ')</span> ');
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Max size is: ' + max_size);
|
|
||||||
console.log('Real size is: ' + total_size);
|
|
||||||
|
|
||||||
if (total_size > max_size) {
|
if (total_size > max_size) {
|
||||||
$status.addClass('text-danger').removeClass('help-block').prepend('<i class="badfile fas fa-times"></i> ').append('<span class="previewSize"> Upload is ' + formatBytes(total_size) + '.</span>');
|
$status.addClass('text-danger').removeClass('help-block').prepend('<i class="badfile fas fa-times"></i> ').append('<span class="previewSize"> Upload is ' + formatBytes(total_size) + '.</span>');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$status.addClass('text-success').removeClass('help-block').prepend('<i class="goodfile fas fa-check"></i> ');
|
$status.addClass('text-success').removeClass('help-block').prepend('<i class="goodfile fas fa-check"></i> ');
|
||||||
var $preview = $(id + '-imagePreview');
|
var $preview = $(id + '-imagePreview');
|
||||||
readURL(this, $preview);
|
readURL(this, $preview);
|
||||||
$preview.fadeIn();
|
$preview.fadeIn();
|
||||||
|
preview_container.fadeIn();
|
||||||
|
delete_id.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,7 @@ return [
|
||||||
'filetypes_accepted_help' => 'Accepted filetype is :types. Max upload size allowed is :size.|Accepted filetypes are :types. Max upload size allowed is :size.',
|
'filetypes_accepted_help' => 'Accepted filetype is :types. Max upload size allowed is :size.|Accepted filetypes are :types. Max upload size allowed is :size.',
|
||||||
'filetypes_size_help' => 'Max upload size allowed is :size.',
|
'filetypes_size_help' => 'Max upload size allowed is :size.',
|
||||||
'image_filetypes_help' => 'Accepted filetypes are jpg, webp, png, gif, and svg. Max upload size allowed is :size.',
|
'image_filetypes_help' => 'Accepted filetypes are jpg, webp, png, gif, and svg. Max upload size allowed is :size.',
|
||||||
|
'unaccepted_image_type' => 'This image file was not readable. Accepted filetypes are jpg, webp, png, gif, and svg. The mimetype of this file is: :mimetype.',
|
||||||
'import' => 'Import',
|
'import' => 'Import',
|
||||||
'importing' => 'Importing',
|
'importing' => 'Importing',
|
||||||
'importing_help' => 'You can import assets, accessories, licenses, components, consumables, and users via CSV file. <br><br>The CSV should be comma-delimited and formatted with headers that match the ones in the <a href="https://snipe-it.readme.io/docs/importing" target="_new">sample CSVs in the documentation</a>.',
|
'importing_help' => 'You can import assets, accessories, licenses, components, consumables, and users via CSV file. <br><br>The CSV should be comma-delimited and formatted with headers that match the ones in the <a href="https://snipe-it.readme.io/docs/importing" target="_new">sample CSVs in the documentation</a>.',
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
@php
|
@php
|
||||||
$checkin = Helper::getFormattedDateObject($asset->expected_checkin, 'date');
|
$checkin = Helper::getFormattedDateObject($asset->expected_checkin, 'date');
|
||||||
@endphp
|
@endphp
|
||||||
| [{{ $asset->present()->name }}]({{ route('hardware.show', ['hardware' => $asset->id]) }}) | [{{ $asset->assigned->present()->fullName }}]({{ route('users.show', ['user'=>$asset->assigned->id]) }}) | {{ $checkin['formatted'] }}
|
| [{{ $asset->present()->name }}]({{ route('hardware.show', ['hardware' => $asset->id]) }}) | [{{ $asset->assigned->present()->fullName }}]({{ route($asset->targetShowRoute().'.show', [$asset->assigned->id]) }}) | {{ $checkin['formatted'] }}
|
||||||
@endforeach
|
@endforeach
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
|
|
|
@ -1,57 +1,66 @@
|
||||||
<div class="form-group {{ $errors->has($logoVariable) ? 'has-error' : '' }}">
|
<!-- {{ $logoVariable }}logo image upload -->
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<strong>{{ $logoLabel }}</strong>
|
<label {!! $errors->has($logoVariable) ? 'class="alert-msg"' : '' !!} for="{{ $logoVariable }}">
|
||||||
</div>
|
{{ ucwords(str_replace('_', ' ', $logoVariable)) }}
|
||||||
|
|
||||||
@if (($setting->$logoVariable!='') && (Storage::disk('public')->exists(e($snipeSettings->$logoVariable))))
|
|
||||||
<div class="col-md-9">
|
|
||||||
|
|
||||||
<label for="{{ $logoClearVariable }}" style="font-weight: normal">
|
|
||||||
{{ Form::checkbox($logoClearVariable, '1', Request::old($logoClearVariable),array('class' => 'minimal')) }}
|
|
||||||
Remove current {{ str_replace('_', ' ', $logoVariable) }} image
|
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
|
||||||
<br>
|
|
||||||
@if ($logoVariable!='favicon')
|
|
||||||
<a href="{{ Storage::disk('public')->url(e($snipeSettings->$logoVariable)) }}" data-toggle="lightbox">
|
|
||||||
<img style="max-height: 60px; padding-top: 10px; padding-bottom: 10px; " alt="" src="{{ Storage::disk('public')->url(e($snipeSettings->$logoVariable)) }}">
|
|
||||||
</a>
|
|
||||||
@else
|
|
||||||
<img style="max-height: 50px; padding-top: 10px; padding-bottom: 10px; " alt="" src="{{ Storage::disk('public')->url(e($snipeSettings->$logoVariable)) }}">
|
|
||||||
@endif
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9 col-md-offset-3">
|
|
||||||
@else
|
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
@endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label class="btn btn-default">
|
<label class="btn btn-default">
|
||||||
{{ trans('button.select_file') }}
|
{{ trans('button.select_file') }}
|
||||||
<input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}"
|
<input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}" accept="image/gif,image/jpeg,image/webp,image/png,image/svg,image/svg+xml" data-maxsize="{{ $maxSize ?? Helper::file_upload_max_size() }}"
|
||||||
data-maxsize="{{ $maxSize ?? Helper::file_upload_max_size() }}"
|
style="display:none; max-width: 90%">
|
||||||
accept="{{ $allowedTypes ?? 'image/gif,image/jpeg,image/png,image/svg,image/svg+xml'}}" style="display:none; max-width: 90%">
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<span class='label label-default' id="{{ $logoId }}-info"></span>
|
<span class='label label-default' id="{{ $logoId }}-info"></span>
|
||||||
|
|
||||||
<p class="help-block" id="{{ $logoId }}-status">
|
{!! $errors->first($logoVariable, '<span class="alert-msg">:message</span>') !!}
|
||||||
|
|
||||||
|
|
||||||
|
<p class="help-block" style="!important" id="{{ $logoId }}-status">
|
||||||
{{ $helpBlock }}
|
{{ $helpBlock }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@if (config('app.lock_passwords')===true)
|
@if (config('app.lock_passwords')===true)
|
||||||
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
|
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
|
||||||
@endif
|
@endif
|
||||||
{!! $errors->first($logoVariable, '<span class="alert-msg">:message</span>') !!}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-9 col-md-offset-3">
|
<div class="col-md-9 col-md-offset-3">
|
||||||
<img id="{{ $logoId }}-imagePreview" style="max-width: 500px; max-height: 50px;">
|
|
||||||
|
@if (($setting->$logoVariable!='') && (Storage::disk('public')->exists(e($snipeSettings->$logoVariable))))
|
||||||
|
<div class="pull-left" style="padding-right: 20px;">
|
||||||
|
<a href="{{ Storage::disk('public')->url(e($snipeSettings->$logoVariable)) }}"{!! ($logoVariable!='favicon') ? ' data-toggle="lightbox"' : '' !!}>
|
||||||
|
<img id="{{ $logoId }}-imagePreview" style="height: 80px; padding-bottom: 5px;" alt="" src="{{ Storage::disk('public')->url(e($snipeSettings->$logoVariable)) }}">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div id="{{ $logoId }}-previewContainer" style="display: none;">
|
||||||
|
<img id="{{ $logoId }}-imagePreview" style="height: 80px;">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@if (($setting->$logoVariable!='') && (Storage::disk('public')->exists(e($snipeSettings->$logoVariable))))
|
||||||
|
|
||||||
|
<div class="col-md-9 col-md-offset-3">
|
||||||
|
<label id="{{ $logoId }}-deleteCheckbox" for="{{ $logoClearVariable }}" style="font-weight: normal">
|
||||||
|
{{ Form::checkbox($logoClearVariable, '1', Request::old($logoClearVariable),array('class' => 'minimal')) }}
|
||||||
|
Remove current {{ ucwords(str_replace('_', ' ', $logoVariable)) }} image
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue