Commit graph

1868 commits

Author SHA1 Message Date
snipe a516e4278e Remove company select option if the user is not an admin and FCS is enabled 2018-10-05 07:30:42 -07:00
snipe ecb8204c3c Associate serials with multiple asset creation 2018-10-05 05:30:13 -07:00
snipe 476b58632b Handle array of asset tags
TODO: figure out how to display validation errors more sanely
2018-10-05 04:34:47 -07:00
snipe b5211b2dd5 Fixed #6291 - send-welcome argument in cli importer 2018-10-04 04:44:12 -07:00
snipe 84848fabd7 Fixed #6284 - missing checkout information on Status Labels API assets endpoint 2018-10-03 10:30:24 -07:00
Wes Hulette 4a88e155c4 Fixed: #6263 V5 (develop) - Missing oauth tables when using the setup wizard (#6268)
* Fixed missing oauth tables during setup.

* Merged develop changes

Removed PHP_CS file
2018-10-03 10:06:24 -07:00
snipe c8ad45b11e Port import manager code to develop 2018-10-03 00:52:29 -07:00
snipe 8937edb97e Better validation for manager_id 2018-10-03 00:26:51 -07:00
Djamon Staal 80393d73ae Public function save() missing array. (#6276)
The class was missing as a result that the composer was unable to update and the site returned a 500 error
```
$ composer update
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In Asset.php line 30:
                                                                               
  Declaration of App\Models\Asset::save($params = Array) should be compatible  
   with Illuminate\Database\Eloquent\Model::save(array $options = Array)       
                                                                               

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
```
2018-10-02 04:40:20 -07:00
snipe 79367642b1
[WIP] Added #5957 - Flysystem support (#6262)
* Added AWS url to example env

* Upgrader - added check for new storage path and attempt to move

* Ignore symlink

* Updated paths for models

* Moved copy methods

* Added AWS_URL support

For some reasin, Flysystem was generating the wrong AWS url (with a region included)

* Switch to Flysystem for image uploads

* Nicer display of image preview

* Updated image preview on edit blades to use Flysystem

* Twiddled some more paths

* Working filesystems config

* Updated Asset Models and Departments to use Flysystem

* Janky workaround for differing S3/local urls/paths

* Try to smartly use S3 as public disk if S3 is configured

* Use public disk Storage options for public files

* Additional transformer edits for Flysystem

* Removed debugging

* Added missing use Storage directive

* Updated seeders to use Flysystem

* Default logo

* Set a default width

We can potentially override this in settings later

* Use Flysystem for logo upload

* Update downloadFile to use Flysystem

* Updated AssetFilesController to use Flysystem

* Updated acceptance signatures to use Flysystem

* Updated signature view to use Flysystem

This isn’t working 100% yet

* Use Flysystem facade for displaying asset image

* Set assets path

Should clean all these up when we’re done here

* Added Rackspace support for Flysystem

* Added Flysystem migrator console command

* Added use Storage directive for categories

* Added user avatars to Flysystem

* Added profile avatar to Flysystem

* Added the option to delete local files with the migrator

* Added a check to prevent people from trying to move from local to local

* Fixed the selectlists for Flysystem

* Fixed the getImageUrl method to reflect Flysystem

* Fixed AWS copy process

* Fixed models path

* More selectlist updates for Flysystem

* Updated example .envs with updated env variable names

* *sigh*

* Updated non-asset getImageUrl() methods to use Flysystem

* Removed S3 hardcoding

* Use Flysystem in email headers

* Fixed typo

* Removed camera support from asset file upload

We’ll find a way to add this in later (and add that support to all of the other image uploads as well)

* Fixed path for categories

* WIP - Switched to standard handleImages for asset upload.

This is currently broken as I refact the handleImages method. Because the assets store/create methods use their own Form Request, the handleImages method doesn’t exist in that Form Request so it wil error now.

* Fixed css URL error

* Updated Debugbar to latest version (#6265)

v3.2 adds support for Laravel 5.7

* Fixed: Missing CSS file in basic.blade.php (#6264)

* Fixed missing CSS file in basic.blade.php

* Added

* Changed stylesheet import for authorize.blade.php

* Updated composer lock

* Added AWS_BUCKET_ROOT as env variable

* Use nicer image preview for logo upload

* Removed AssetRequest form request

* Removed asset form request, moved custom field validation into model

* Added additional help text for logo upload

* Increased the size of the image resize - should make this a setting tho

* Few more formatting tweaks to logo section of branding blade preview

* Use Flysystem for asset/license file uploads

* Use Flysystem for removing images from models that have been deleted

* Enable backups to use Flysystem

This only handles part of the problem. This just makes it so we can ship files to S3 if we want, but does not account for how we backup files that are hosted on S3

* Use Flysystem to download license files

* Updated audits to use Flysystem
2018-09-29 21:33:52 -07:00
snipe 32951bbc90 Make CustomFieldset rules public instead of protected 2018-09-28 15:18:23 -07:00
snipe 68a04c7a23 Fixed #4151 - Undefined index: samaccountname on LDAP import 2018-09-27 16:13:27 -07:00
snipe e5d0f74ba7 Fixed #6248 - add free seats to licenses API endpoint 2018-09-27 12:07:13 -07:00
Wes Hulette 16e56646b8 Fixed #5965: Allow multiple alert email addresses (#6233)
* Fixed #5965: Allow multiple alert email addresses

* Style changes based on PR feedback.
2018-09-26 14:07:41 -07:00
snipe bcf9d2f75c Don’t require statuslabel view to check for deployable status 2018-09-25 13:39:54 -07:00
nix f85e3edfc7 fixed checking permissions for users with no permissions set (#6229)
When a user has no permissions set (=NULL) in the database (like after an
LDAP import) but is a member of a group with permissions, those group
permissions would not have be applied, effectively denying every access
regardless of group permissions.
2018-09-25 13:24:50 -07:00
snipe 9108ff8caa fixed typo 2018-09-24 19:06:12 -07:00
snipe d5cf0f1fbd Prevent deleting manufactureres via API if they have items/models 2018-09-24 19:04:00 -07:00
Brady Wetherington c97db3259f
Merge pull request #5913 from tilldeeke/refactore-checkout-checkin-notification-sending
Refactor: Decouple checkin/checkout notifications from logging
2018-09-21 18:18:27 -07:00
snipe 4b2093b485 Added counts to location show() API method 2018-09-21 15:51:26 -07:00
snipe d84366c6c5 Add empty array to groups if none filled in 2018-09-19 17:24:34 -07:00
Ivan Nieto b692f67779 Revision of #5471 (#6148)
* Search functionality in accessories/{accessory} issue #5471:
From the collection of users displayed just filtered the data with the method where() and concat()
for the user can search for first name or last name. The solution is case sensitive.

* A better fix to issue #5471. Now using the established relationship to querying for the users. Also Case-insensitive.

* Fixed previous commit that has magic number in the find method parameter of AccessoriesController.
2018-09-12 22:50:45 -07:00
Juho Taipale 05b03df600 Fix for issue #6165 (#6168)
* Fix problem when using ValidatingTrait

* Checking that email alerts are enabled when trying to send expected check-in alerts (fix for issue #6169)
2018-09-12 22:49:50 -07:00
Till Deeke 86f49d34c3 Redirects users from old acceptance screen to new overview 2018-09-10 17:13:16 +02:00
Till Deeke 007e8fbdf9 simplified checkout event handling per @uberbrady’s suggestion
This generalizes the checkout events into the CheckoutableCheckedOut and CheckoutableCheckedIn events.
2018-09-10 16:40:26 +02:00
snipe 10d19be66c Added manager ID to validation 2018-09-07 17:27:31 -07:00
snipe b903ca05f7 Added manager ID to fillable fields in Location model
This should enable the API to update manager ID
2018-09-07 17:27:19 -07:00
snipe ff879e2018 Added the ability to update asset location when auditing - per #5854 2018-09-07 05:39:41 -07:00
snipe 181e75adb4 Apply hotfix for fixed category model scope 2018-09-07 03:56:17 -07:00
snipe 827a86b2ef Only send inventory report to users if they have things checked out to them 2018-09-07 03:08:32 -07:00
snipe 77cdb2f409 Added console command to send inventory reports to users 2018-09-07 02:24:41 -07:00
snipe 26fd7f7e79 I have no idea why this was necessary suddenly 2018-09-06 14:28:04 -07:00
snipe b80b91514d Fixed Laravel 5.7 compatibility issue re: boot() method
This was causing the error: Undefined index: App\Models\CustomField (View: /Users/snipe/Sites/snipe-it/snipe-it/resources/views/hardware/index.blade.php)

and pointed to the Eloquent model library method:

```
protected function initializeTraits()
    {
        foreach (static::$traitInitializers[static::class] as $method) {
            $this->{$method}();
        }
    }
```

Thanks to https://github.com/laravel/framework/issues/25455 for the clue.
2018-09-05 19:27:37 -07:00
Ivan Nieto 0014ef054b Search functionality in accessories/{accessory} issue #5471: (#6070)
From the collection of users displayed just filtered the data with the method where() and concat()
for the user can search for first name or last name. The solution is case sensitive.
2018-08-28 13:25:16 -07:00
Wes Hulette 3831ee9f5a Fixed #5811 - Non US Characters in user export (#6132)
* Added Freebsd as vagrant machine for development

* Ran npm audit fix

Manually added peer depenencies

* Added charset=UTF-8 to content-type

Removed reference to throttle model as is is not longer included.
2018-08-28 12:37:58 -07:00
Dmitriy Minaev bc8fa31eb2 Add depreciation with half-year convention. Fixed #1237 (#6128)
* Add half-year convention in depreciation for Models/Depreciable.php

* Add a setting for the depreciation method

* Integrate half-year convention inside working output

* fix: add more checks at Depreciable.php

* depreciation value rounding

* Codestyle fix
2018-08-28 12:32:46 -07:00
snipe 5b8cbe29e1 Possible fix for #5054 - OpenLDAP (non-AD) LDAP users being deactivated 2018-08-27 14:51:37 -07:00
snipe e4f6aefdad Added self-checkout permission option 2018-08-21 23:26:12 -07:00
snipe 771265113e Added cookie serialization for Laravel v5.6.30 2018-08-21 22:40:14 -07:00
snipe aed769c0be Honor active status for forgotten password request forms 2018-08-14 20:05:57 -07:00
snipe 1543cdbc61 Set activated checkbox to 1 by default on new user 2018-08-14 18:17:37 -07:00
snipe 25097bce31 Only allow activated users to reset their password 2018-08-14 18:04:27 -07:00
Till Deeke 62195a805a Adding some comments 2018-08-06 14:47:26 +02:00
Till Deeke 8c96e8fd4b Updates asset acceptance report to show unaccepted assets 2018-08-06 14:47:26 +02:00
Till Deeke 1bdf71b584 Handle side effects of accepting/declining
When declining an asset, it gets checked in.
2018-08-06 14:47:26 +02:00
Till Deeke 8648d53d25 Adds checkout acceptances
A checkout acceptance gets generated for every item that needs to be checked out. This resource tracks the user user who can accept the item and their signature
2018-08-06 14:47:26 +02:00
Till Deeke 6b05106dcb Moves license checkout stuff to the license seat
Since we are really checking out a license seat instead of the whole license, we operate the checkin/checkout on the license seat instance.
2018-08-06 14:47:26 +02:00
Till Deeke 43437aac14 Adds acceptable contract to asset 2018-08-06 14:46:10 +02:00
Till Deeke 830a6cf67e Adds accepting/declining to new controller 2018-08-06 14:46:10 +02:00
Till Deeke 39e6b59335 Fixes some typos 2018-08-06 14:46:10 +02:00
Till Deeke 72b43b6526 Updates checkout notifications to use new routes for accepting 2018-08-06 14:46:10 +02:00
Till Deeke e0423418d2 Moves logging checkin/checkout to separate listener 2018-08-06 14:46:10 +02:00
Till Deeke e24f292a1a Updates checkout events to not depend on log 2018-08-06 14:46:10 +02:00
Till Deeke 17fc59f989 Adds back the checkin/checkout events after #5916 2018-08-06 14:46:10 +02:00
Till Deeke 775e46288e Cleanup of model attributes 2018-08-06 14:46:10 +02:00
Till Deeke 722f032895 Remove notification sending from loggable trait 2018-08-06 14:46:10 +02:00
Till Deeke 112a532618 Listen for checkout events and send appropriate notifications 2018-08-06 14:46:10 +02:00
Till Deeke ef76908fce Listen for checkin events and send the appropriate notifications 2018-08-06 14:46:10 +02:00
Till Deeke 4a71542f23 Cleanup checkin notification constructors 2018-08-06 14:46:10 +02:00
Till Deeke ea64abc607 Adds checkout events 2018-08-06 14:46:10 +02:00
Till Deeke f0acf47101 Adds checkin events 2018-08-06 14:46:10 +02:00
Till Deeke 92a2a5ccbc Adds listeners for checking/checkout events 2018-08-06 14:46:10 +02:00
Daniel Meltzer 2d0df24ef3 Check for an existing username before getting creative. Fixes #6016 (#6039) 2018-08-03 16:35:13 -07:00
snipe 1a660911e7 Check for minimum PHP version in setup 2018-08-02 21:36:18 -07:00
Daniel Meltzer e368a20427 Use filled instead of has. (#6033)
I think this merged in a weird order and was missed by the global
find/replace.  This fixes bulkassets/bulkusers editing.

At some point we should look at refactoring BulkAssetsController@edit to
only run one DB query, rather than one per item.
2018-08-02 09:54:19 -07:00
Daniel Meltzer 2637ce56a1 Allow importcontroller to return 200 for failed delete. (#6034) 2018-08-02 09:53:54 -07:00
snipe f5a5d830a5 Better handling for deleting imports where the files may have been moved 2018-08-01 20:49:55 -07:00
snipe 9168979d9e Fixed #6027 - added model to asset maintenances listing 2018-08-01 18:24:52 -07:00
snipe 3f394f42c7 Partial fix for better UI on deleting files
Still needs Vue stuff
2018-08-01 18:01:16 -07:00
snipe b2c99c88bb Fixed #6028 - added supplier url to list view 2018-08-01 17:37:58 -07:00
snipe 694166862e
Added attempted logins admin screen (#6018)
* Added attempted logins admin screen

* Smaller table spacing
2018-08-01 03:51:59 -07:00
snipe 911c2398ef Fixed #6004 - set a default next_audit_date if none provided 2018-08-01 03:04:29 -07:00
snipe 2c38036123
Improvement: Better documentation, small refactors (#6017)
* Better documentation, small refactors

* Small comment fixes
2018-08-01 00:06:41 -07:00
snipe b1b5eeecba Fixed #6013 - add accessory checkout notes to detail page 2018-07-31 16:00:38 -07:00
snipe 400913631c Use language strings for bulk password reset 2018-07-30 20:37:19 -07:00
snipe 006a3adea0 Added ability to trigger forgotten password emails for users 2018-07-30 20:31:02 -07:00
Daniel Meltzer 248fcfa869 Move findLicenseSeatToCheckout back to controller. (#5970)
* Move findLicenseSeatToCheckout back to controller.

After discussion, move findLicenseSeatToCheckout method back to
controller from form request.  Also cleanup one tiny bit more with null
coalesce operator (Yay php 7).

* Revert Earlier change.

$target only exists in the checkoutTo* methods.  Need to log the
checkout individually in each of those.
2018-07-27 12:03:04 -07:00
Daniel Meltzer b58c77c8b8 Feature: Import users department. (#5987)
Maps to the "Department" header key by default.  Bug: #5382
2018-07-27 12:02:18 -07:00
Daniel Meltzer 94c79fa69a Fixed #5964 - Feature: Group IDs can be passed to User Create. (#5990)
Also added to update, and adjusted api tests to confirm.  Long term it
might be nice to look at support for passing group names instead.

Bug: 5964
2018-07-27 12:01:59 -07:00
Daniel Meltzer a3811f632d Licence != License (#5993) 2018-07-27 12:01:25 -07:00
snipe d8f0102204 Merge branch 'features/restore_deleted_cmd' into develop
# Conflicts:
#	config/version.php
#	resources/views/layouts/basic.blade.php
2018-07-27 02:48:13 -07:00
snipe 6b013724aa Uncomment backup 2018-07-26 18:11:51 -07:00
snipe 8774f0cf45 Script to restore deleted users and put their asset assignments back 2018-07-26 18:08:49 -07:00
snipe 8762e158c4 Delete content from login attempts table 2018-07-26 18:08:25 -07:00
Daniel Meltzer 49d95892e3 Port asset history importer to league/csv9 (#5972) 2018-07-26 12:04:21 -07:00
snipe 9618878023 Restrict users asset listing to just assets checked out to users 2018-07-25 21:40:33 -07:00
snipe 614e858e44 Restrict users asset listing to just assets checked out to users 2018-07-25 21:38:14 -07:00
snipe 373885ebd1 Use Storage for file uploads (not model images) 2018-07-25 11:57:49 -07:00
snipe a9fd9c9e59 Moved gates to individual controller methods to fix “This action is unauthorized” in route:list 2018-07-25 10:45:32 -07:00
snipe 63bf71b071 Use Storage methods for asset/license files 2018-07-25 09:48:50 -07:00
snipe 7a9a78ec53 Make Codacy happy by reversing the signature params 2018-07-25 07:14:16 -07:00
snipe 91a9e410df Fixed weird whereNULL 2018-07-25 06:46:06 -07:00
snipe 501f096a2c Updated spatie backup config file for their latest version 2018-07-25 01:36:30 -07:00
snipe 47ed328f0e Change fire() to handle() for Laravel 5.5 2018-07-25 01:28:44 -07:00
snipe 7af633177a Fixed filledFile back to hasFile 2018-07-24 22:52:49 -07:00
snipe 86c1f11bec Change $request->has to $request->filled unilaterally 2018-07-24 22:51:31 -07:00
snipe 0714ac4248 Update withCounts because Laravel 5.5 :( 2018-07-24 22:40:05 -07:00
snipe e6dd90e055 Added footer settings to settings reset 2018-07-24 22:21:16 -07:00
snipe b2968ea6c6 Fixed paths to Aurhorizable/Authenticatable contracts 2018-07-24 21:29:08 -07:00
snipe 3d3ed6ab03 Logging updates for 5.6 2018-07-24 21:13:02 -07:00