Commit graph

350 commits

Author SHA1 Message Date
snipe 6ea74f9fc3 Merge pull request #2203 from dmeltzer/display-error-if-import-upload-fails
If the move of the uploaded import file fails, return an error message.
2016-06-27 20:55:51 -07:00
Daniel Meltzer 278be52f7b Show the exception message if APP_DEBUG is enabled. 2016-06-27 23:54:45 -04:00
Daniel Meltzer ee1f983114 If the move of the uploaded import file fails, return a message. Fixes an issue reported on gitter today where bad permissions on the upload directory didn't provide any feedback. 2016-06-27 23:37:15 -04:00
snipe e3fe80e2a5 Merge pull request #2202 from dmeltzer/sqlite-fix-asset-edit
Fix integrity constraint violation on sqlite.
2016-06-27 20:20:01 -07:00
Daniel Meltzer d3b035cfe9 Fix integrity constraint violation on sqlite.
If the requestable checkbox was not checked, it did not exist in the request.
Setting requestable to null in such a case would cause a violation because it should be 0/1.

Also fix a copy/paste where we reset requestable after checking for rtd_location_id.
2016-06-27 23:16:03 -04:00
Daniel Meltzer cf29a4a319 Extract common data from UserController postCreate and postEdit into a helper method. Use this method to store data about user. Fixes #2200 2016-06-27 22:48:09 -04:00
Daniel Meltzer 5bc52a9425 Link to user on asset checkout as well as checkin. 2016-06-23 09:39:50 -04:00
snipe 2867cd523d Fixes #2192 2016-06-22 17:14:49 -07:00
snipe 0cf563ae5b Show admin in maintenances 2016-06-22 17:04:47 -07:00
snipe 95beddf613 Use helper library for asset list 2016-06-22 16:58:36 -07:00
snipe e5a5de6a0d Just use inline validation instead of form request, since it's a one-off 2016-06-22 15:59:00 -07:00
snipe 0ca85f8a8a Updates to components 2016-06-22 14:55:17 -07:00
Daniel Meltzer 25b916afeb Show the name of the item with errors in the table. 2016-06-22 17:09:04 -04:00
snipe f753783ca0 Smaller miminums for model and category name 2016-06-22 12:50:21 -07:00
snipe 4ed8ff5576 Formatting fixes for coding standards 2016-06-22 12:27:41 -07:00
snipe 70aefdc9c0 Merge pull request #2190 from dmeltzer/fix-asset-creation
Flash input on model validation errors when creating/editing assets.
2016-06-22 12:23:13 -07:00
Daniel Meltzer f6d47887c4 Flash input on model validation errors when creating/editing assets. 2016-06-22 15:20:49 -04:00
snipe 8942e085c3 Merge pull request #2189 from dmeltzer/importer-improvements
Two more importer fixes.
2016-06-22 12:20:13 -07:00
snipe 3470fd57ef Merge pull request #2188 from dmeltzer/paveit-syntax-fix
Add a space to the signature to make the --soft option work.
2016-06-22 12:16:25 -07:00
Daniel Meltzer eba6574047 Add a space to the signature to make the --soft option work. 2016-06-22 15:13:43 -04:00
Daniel Meltzer 43e64a5f8c Store a list of errors associated with each field instead of overwriting the error if multiple occur. Also Adjust the importer to extract the asset tag earlier in the process so all asset related errors are associated with the asset tag rather than some being tied to the name. 2016-06-22 15:13:01 -04:00
Daniel Meltzer b9f72a2afa Flash errors to session on edit as well. 2016-06-22 12:55:09 -04:00
Daniel Meltzer 560115e758 If we survive form request validation but fail model validation, ensure that the errors are actually flashed to the session. Another thing that will be better fixed in the future when handling json nicer. 2016-06-22 12:55:09 -04:00
snipe dcdc1a6e7b Merge pull request #2185 from dmeltzer/slack-fixes
A few slack fixes
2016-06-21 15:45:22 -07:00
snipe 508e7acb54 Bump up memory for LDAP import of large number of users 2016-06-21 12:22:10 -07:00
snipe 49bf9f8b5b Switch null to lowercase for code style adherence 2016-06-21 11:06:53 -07:00
snipe afc3cfa16a Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-06-21 10:06:19 -07:00
snipe 37d22d6d21 Merge remote-tracking branch 'origin/v3-master' into v3 2016-06-21 10:03:45 -07:00
Daniel Meltzer f004facb06 A few slack fixes
1) Missing $admin_user in AccessoriesController::postCheckout().  Fixes #2183
2) AssetsController::postCheckin used the hardware url for the user link, not the user url
2016-06-21 09:43:32 -04:00
Daniel Meltzer d6dd449445 Only show importer progress if on command line. It broke error display from web. 2016-06-20 00:09:17 -04:00
Daniel Meltzer 8c00bad6d0 Add a check to ensure custom fields exist before iterating through them 2016-06-20 00:09:17 -04:00
Daniel Meltzer 4715cc6447 Pass user id to importer. This shows items imported through web interface as created by the appropriate user. Also save warranty_months to item, not just read it from csv. Fixes #2175 2016-06-20 00:09:17 -04:00
Daniel Meltzer 5a45ec708b Use the model validation trait to validate asset maintences. Might be better to add a form request as well, but this at least makes the model validation occur. fixes #2170 2016-06-16 22:22:07 -04:00
Nikolai Prokoschenko 8d03668d78 Fix reverse proxy support
Reintroducing trusted proxies via fideloper/proxy:

* Upgraded fideloper/proxy to 3.1
* Added fideloper/proxy to Http/Kernel.php
* Added fideloper/proxy to config/app.php
* Added environment variable APP_TRUSTED_PROXIES to env (with '*' being the default fallback)
2016-06-16 15:43:42 +02:00
snipe 973513a078 Remove unecessary log use statement 2016-06-15 21:18:40 -07:00
snipe 416cd96c94 Removed debugging loggin in middleware 2016-06-15 21:08:19 -07:00
snipe 87352470c0 Added sortable created_at to assets and users 2016-06-15 21:06:17 -07:00
snipe 27427dd26b Additional comments to clarify permissions middleware 2016-06-15 20:57:16 -07:00
snipe e2789b2951 Protect users routes 2016-06-15 20:45:57 -07:00
snipe 6a277a5391 Added inheritance back into users/groups 2016-06-15 20:45:45 -07:00
snipe 464ecc7cc6 Moved group sync 2016-06-15 11:51:10 -07:00
snipe b4d6842a7c Minor formatting changes, added DB call for custom fields 2016-06-13 21:45:52 -07:00
snipe f3e42384c5 Hardcoded higher PHP execution limits 2016-06-13 21:41:09 -07:00
snipe c29984d0df Skip superuser check if the user isn't logged in 2016-06-13 19:05:29 -07:00
snipe bfe4bc6ee5 Bypass company scoping if user is an admin 2016-06-13 11:40:22 -07:00
snipe 2df71be321 No need to update the user again 2016-06-13 11:30:47 -07:00
snipe 396446a34b Updated namespace for collection 2016-06-13 10:54:28 -07:00
snipe 2daed3c271 Fix for custom fields not saving 2016-06-10 16:36:46 -07:00
snipe c1a3592059 Fixes #2130 2016-06-10 08:29:43 -07:00
snipe 5904de8718 Remove asset tag requirement from form request
It donks the edit screen as it thinks the asset tag has already been taken
2016-06-10 05:54:20 -07:00
Daniel Meltzer e9605891f3 Merge upstream and fix changes. 2016-06-10 07:44:45 -05:00
Daniel Meltzer 9c4c91063f Merge branch 'v3' into Fix-Asset-Creation-with-old-data 2016-06-10 07:35:30 -05:00
Daniel Meltzer 4e74c553bd Fix editing of assets. This also uses the asset form request for validation. 2016-06-10 07:33:33 -05:00
snipe 9e8b76d348 Use updated $request->input methods for 5.2 2016-06-10 05:16:27 -07:00
snipe 6fa4d1252d Fixes purchase date if no purchase date given 2016-06-10 05:00:49 -07:00
snipe a0901247a3 Let superadmins through companyable trait 2016-06-10 04:07:27 -07:00
snipe 02a9394cd9 Merge remote-tracking branch 'origin/v3' into v3-master 2016-06-10 03:41:03 -07:00
snipe ec4bc6c2af Allow superadmins to print labels 2016-06-10 03:40:49 -07:00
snipe 4e1472f66d Merge remote-tracking branch 'origin/v3' into v3-master 2016-06-10 00:48:33 -07:00
Daniel Meltzer 044695cb02 Fix hardware creation error making old input disappear. This should be redone to dynamically update on the client side based on a JSON response instead of flashing and reloading, but that's a lot of change for v3 at this point. 2016-06-09 20:28:49 -05:00
snipe f44d98924d Removed erroneous call to nonexistent model 2016-06-09 14:42:13 -07:00
snipe c91c1f92cd Fixes #2132 2016-06-09 13:27:50 -07:00
snipe bbb116f29c Fixes #2142 2016-06-09 12:25:51 -07:00
snipe 845b182fdf Fixes format for users in category view 2016-06-09 02:26:43 -07:00
snipe 2b5fb04ba9 Allow admin to add user on checkout screen 2016-06-09 00:36:52 -07:00
snipe bb758d618b Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-06-08 23:28:53 -07:00
snipe 51742d66df Removed uneeded size array 2016-06-08 23:28:21 -07:00
Daniel Meltzer 9648c6f1d3 Fix license Checkout.
A mistake in the sqlite porting led to "Please select an asset"
disappearing.  This centralizes that code in Helper, and uses the code
in Licensescontroller and componentscontroller.

Also use the proper name on the components checkout page.

AssetMaintencesController reuses the same underlying code as
licensescontroller, but we don't want "Please select an asset" to be an
option there, so I'm not changing that code.
2016-06-07 07:58:08 -05:00
snipe 75eb2bbe09 Janky-ass form request stuff 2016-06-06 21:02:06 -07:00
snipe d4e231d5d4 Save permissions on new user 2016-06-06 18:56:43 -07:00
snipe 75dfb87671 Use form request for user add/edit to handle password and password confirmation 2016-06-06 14:15:50 -07:00
snipe 23936e465d Merge pull request #2123 from dmeltzer/fix-setup-on-windows
Fix missing posix_getpwuid on windows.
2016-06-06 12:31:30 -07:00
snipe 13d11bfdcc Merge pull request #2121 from dmeltzer/add-soft-pave
Add a 'soft' delete option to the pave tool.
2016-06-06 12:30:06 -07:00
snipe 21506f4101 Merge pull request #2120 from dmeltzer/add-clone-to-models-index
Add clone action to Assetmodels index page.
2016-06-06 12:29:54 -07:00
Daniel Meltzer ea3e11e011 Fix missing posix_getpwuid on windows.
This isn't a perfect solution.  It basically just nullifies the check on
windows.  I'm not sure if IIS can run as a nonelevated user though, so
perhaps thats the best choice.  Regardless, this fixes the setup.
2016-06-06 07:43:05 -05:00
Daniel Meltzer 6ba37a3a8d Add a 'soft' delete option to the pave tool. This leaves db structure and migrations in place but removes everything inside the db except the first user. 2016-06-05 10:24:42 -05:00
Daniel Meltzer a89511674b Add clone icon to Assetmodels index page. 2016-06-05 10:00:31 -05:00
Daniel Meltzer cd9cca9c6b Modify Helper::categoryList() to take a category type parameter.
This allows for centralizing the category fetching code more and fixes
an error in asset model viewing (#2118).  Also add a few translated
strings and standardize on a base of 'Select a *' for the default value
in our lists.
2016-06-05 09:47:44 -05:00
snipe 9f6eb02afc Don't purge users where show_in_list = 1
This is necessary so hosted customers can't hard-delete my account :-/
2016-06-03 12:13:59 -07:00
snipe f8ac9a3f77 Fixes #2110 2016-06-03 11:48:20 -07:00
snipe c5d96812f3 Fixed erronerously removed save methods 2016-06-02 17:22:23 -07:00
snipe 95f94c1cfb Fixed error when user has no permissions values 2016-06-02 17:16:22 -07:00
snipe 2d5a0deb31 Eager loading for requestable assets account page 2016-06-02 02:57:22 -07:00
snipe 7d2ea36997 Use permission gates on routes 2016-06-02 02:50:00 -07:00
snipe 97691726f0 Updates to permissions decoding 2016-06-02 02:49:32 -07:00
snipe 049e13e365 Switch to gate for permission check 2016-06-02 02:48:52 -07:00
snipe dddb0f7267 Fixed group error message 2016-06-02 02:46:49 -07:00
snipe 5de6b8e016 Added gates to authservice provider for finer tuned permissions 2016-06-02 02:40:49 -07:00
snipe 46d3a784a2 Fixes groups for cloning users 2016-06-02 00:41:10 -07:00
snipe 1daa6abf48 Merge pull request #2101 from dmeltzer/importer-again
Case insensitive string comparison for items when importing
2016-06-01 18:13:02 -07:00
snipe 04610e7864 Just use model validation for new user 2016-06-01 18:04:11 -07:00
Daniel Meltzer da01591ab8 Case insensitive string comparison for items when comparing with existing items. Fixes some false errors. Also remove stray characters from manufacturer logging. 2016-06-01 19:31:24 -05:00
snipe cffa76e627 Find first record, instead of hardcoded id 1 2016-06-01 15:50:50 -07:00
snipe 9c4cd9c3ce Save email/username format in settings controller 2016-06-01 15:45:26 -07:00
snipe eacf70ee3f Updated validation 2016-06-01 15:45:05 -07:00
snipe f3c6275f8d Removed settings form request 2016-06-01 15:43:12 -07:00
Daniel Meltzer 1c1ef951e9 Fix a regression in Helper::usersList and ::managerList() where the "Select a User" option disappeared. Also format names the way they used to be formatted. 2016-06-01 13:47:46 -05:00
Daniel Meltzer 3ddaa88694 Fix image processing when editing an existing asset. Also reenable the image scaling on the server, but boost limit to 800x800 2016-05-31 19:50:58 -05:00
Daniel Meltzer fcc79456fd Play with a mobile friendly capture-image-from device when adding an asset. This also involved rewriting the upload to be all ajaxy and stuff 2016-05-31 19:50:58 -05:00
snipe 11c400f12b Merge pull request #2095 from dmeltzer/importer-improvements
Reduce Import error warnings in importer.
2016-05-31 17:45:29 -07:00
Daniel Meltzer f2a5337ad2 Simplify 2016-05-31 19:41:14 -05:00
Daniel Meltzer 4af5cdd64f asset_id is not allowed to be null in asset_log according to db schema. 0 it out here to make sqlite happy. 2016-05-31 19:41:14 -05:00
Daniel Meltzer 0fa82743a1 Remove remaining DB::Raw(concat) calls to make things more sqlite friendly. This adds one new method to the Asset Model to return the formatted string that was used by the license and asset maintence controller. It also fixes a potential sqlite-only issue where '' and null are different. 2016-05-31 19:41:14 -05:00
Daniel Meltzer 45d93ffa8c Use a transaction while creating license seats. Makes adding a license with a large number of seats much more managable. 2016-05-31 19:41:14 -05:00
Daniel Meltzer 4b98711e07 Replace the assorted concat() methods with a full_name method in the User model and adjust queries accordingly 2016-05-31 19:41:14 -05:00
Daniel Meltzer a729038ccd Fix typo. 2016-05-31 19:00:11 -05:00
Daniel Meltzer dab2a50982 Only display errors in import table if things actually prevent the asset from being created. Also some table formatting improvements. 2016-05-31 18:04:01 -05:00
snipe 0e0b31bba6 Company name length to 1 2016-05-31 15:04:13 -07:00
Daniel Meltzer 004c63cd5d Improve web imported. Show a list of all items with that were not imported correctly after import. Modify ObjectImporter and add a web-import parameter that causes it to spit out json errors exclusively. Long term I want to separate the console command and the logic so we aren't calling the console command directly, but rather a class that does everything. This would allow for easier progress reports and ajaxification. 2016-05-26 21:29:29 -05:00
Daniel Meltzer 715e385925 Two things. One, try to make the import uploads directory if it doesn't exist. Two, call the object importer instead of the old asset importer. TODO: Feed output from object importer back to import page. 2016-05-26 08:00:00 -05:00
Daniel Meltzer 891c37b2ed Add warranty months. Also fix a merge issue where things reverted back to comment instead of log. 2016-05-25 21:13:26 -05:00
Daniel Meltzer e353df588f Importer improvements. If user real name doesn't exist don't try to create the user. 2016-05-25 20:47:46 -05:00
Daniel Meltzer fd0d04eba4 Import status labels. 2016-05-25 20:46:01 -05:00
Daniel Meltzer 22c6f32e92 Instead of a field in the csv, set whether assets, consumables, or accessories are generated by an option on the command line. Also Adjustconsumables/accessories to function smoother. 2016-05-25 20:37:19 -05:00
Daniel Meltzer 04428d2d07 Replace console output in ObjectImporter with a logging mechanism. Also track all model/validation errors and output them at the end of the import, rather than inline. 2016-05-25 20:37:19 -05:00
snipe 37be587c39 Make regular and highlight colors the same, since we're not using highlight colors in the pie chart yet 2016-05-24 16:19:44 -07:00
snipe 0c33575962 Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-05-24 16:10:45 -07:00
snipe bfc3f69adb Better comments on model methods 2016-05-24 16:08:18 -07:00
snipe cde0d49e18 Added assets method 2016-05-24 16:06:22 -07:00
snipe abf027059f Fixed comment 2016-05-24 16:06:15 -07:00
snipe 4edc2a7a66 Route and controller for dashboard chart 2016-05-24 16:06:09 -07:00
snipe 3b838ca867 Added static colors for charts 2016-05-24 16:05:51 -07:00
Daniel Meltzer 293b8c0dea Fix strings for StatusLabels, they still referenced locations. 2016-05-24 17:54:44 -05:00
snipe 780c0e678d Changed min dimensions to 500 from 300 2016-05-24 13:21:18 -07:00
snipe de5e1ca86b Add persedown helper 2016-05-24 10:21:33 -07:00
snipe 6c6e65b8ca Fixes #2076 2016-05-24 09:46:43 -07:00
snipe 64d818e56e Fixed License and LicenseSeat namespaces for importer 2016-05-24 02:17:10 -07:00
snipe d6715914e1 Fixed supplier namespace 2016-05-24 02:13:28 -07:00
snipe f10b3b7cdb Fix for license importer 2016-05-24 01:51:47 -07:00
snipe f844bf4b41 Nicer focus handling for asset search 2016-05-24 01:10:05 -07:00
snipe cb91829729 Fixed division by zero error 2016-05-24 00:49:56 -07:00
snipe fb35e40342 Search by asset tag
Compatible with barcode scanners
2016-05-20 17:02:28 -07:00
snipe 7fd6051514 Fixes #2062 - old permissions masks to new 2016-05-20 12:23:31 -07:00
snipe 2c7b345ad2 Merge pull request #2057 from dmeltzer/fix-settings-table-for-sqlite
Fix Settings Table for Sqlite
2016-05-19 20:27:56 -07:00
Daniel Meltzer a6849fc689 Remove stray code from my commit and add a migration to fix the Settings issue the proper way. 2016-05-19 21:52:49 -05:00
snipe db6305bf1f Merge pull request #2056 from dmeltzer/make-categories-limit-work
Make limit/offset work in getDataView
2016-05-19 19:50:22 -07:00
snipe cbcc155f27 Settings tweaks 2016-05-19 19:49:25 -07:00
Daniel Meltzer 1148750c9a Make limit/offset work in getDataView 2016-05-19 21:45:48 -05:00
snipe c4a699f109 Validation for new alert settings 2016-05-19 19:43:05 -07:00
snipe 2b1bf9f7f3 Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-05-19 19:34:11 -07:00
snipe 15eb6df1db Add settings for alert interval threshold and inventory threshold 2016-05-19 19:33:53 -07:00
snipe 29e54830e1 Added 2D barcodes to labels 2016-05-19 19:12:42 -07:00
Daniel Meltzer 592ce4c2de Readd sample.csv. Also port away from Sentry in the importer to be laravel5 compliant. 2016-05-18 23:33:18 -05:00
Daniel Meltzer 4f70fa88d9 Rename to snipeit:import 2016-05-18 22:40:02 -05:00
Daniel Meltzer 173c3de36a Add the asset to the cache after creating it as well. 2016-05-18 22:40:02 -05:00
Daniel Meltzer 2a56148ec2 Remove extraneuous htmlentities() calls, now that we call it in array_smart_fetch 2016-05-18 22:40:02 -05:00
Daniel Meltzer df749f26f5 Add the company/suppliers to the cache. This fixes some issues with duplicate items existing 2016-05-18 22:40:02 -05:00
Daniel Meltzer 191ae110d0 * Alphabetize the createOrFetch methods
* Move the html escaping to array_smart_fetch to avoid duplication
* Ensure string comparisons have === everywhere
2016-05-18 22:40:02 -05:00
Daniel Meltzer 5821127a79 Update/port ObjectImportComandd to work with v3. Also change to do one big transactional commit instead of writing to db after each item. Went from a 2 minute import to a 5 second import for a 2000 item file. I still need to do some more santization of the input and work on error handling, but this seems to be in decent shape. 2016-05-18 22:40:02 -05:00
snipe 5333c7083a More dashboard fixes 2016-05-18 19:48:19 -07:00