Commit graph

688 commits

Author SHA1 Message Date
snipe
58b1ac5f0f Some route/transformer edits 2017-01-13 00:13:57 -08:00
snipe
d2f84a2329 Added some hidden fields 2017-01-13 00:12:26 -08:00
snipe
4f35c8af3e Docblock edits 2017-01-12 23:43:45 -08:00
snipe
fbd6dcbfbb Fixed path to query builder in docblocks 2017-01-12 23:42:59 -08:00
snipe
9c41881d99 Use transformers for API response
This is experimental
2017-01-12 23:42:39 -08:00
snipe
f52680b971 Masde response formatting a little nicer 2017-01-12 23:41:45 -08:00
snipe
6d7c226acd Experimental transformers 2017-01-12 23:40:35 -08:00
snipe
2f43f78e62 Validated category_id on accessories, name model_number fillable 2017-01-12 19:40:42 -08:00
snipe
b11a951e95 Starter API controllers 2017-01-12 19:40:20 -08:00
snipe
ed325d2fe5 Let whatever the other error is fall through 2017-01-12 19:38:40 -08:00
snipe
3c6010679a Nicer handler for JSON model not found errors 2017-01-12 19:06:39 -08:00
snipe
d9d048f90d Fixed #2303 - redirect correctly after login 2017-01-12 07:09:44 -08:00
snipe
b7a650e986 Switched ordering of status labels and status label types to more user-friednly config 2017-01-12 06:50:54 -08:00
snipe
534e40feb8 Fixed bad fieldset call 2017-01-12 03:55:54 -08:00
snipe
a283b13069 Handled bad model id 2017-01-12 03:53:52 -08:00
snipe
41b864cc49 Added update method for assets 2017-01-12 03:48:18 -08:00
snipe
03874a5481 Validate asset model and status on the model level 2017-01-12 03:47:45 -08:00
snipe
7d2d6a3c1b Removed unused use statements 2017-01-12 02:53:43 -08:00
snipe
29b5678a8d Format destroy responses 2017-01-12 02:50:55 -08:00
snipe
93542f3478 Make sure the model_id and status_id actually exist 2017-01-12 02:41:02 -08:00
snipe
fddcc0fefd Added better form request handling
This will break a ton of things
2017-01-12 02:20:20 -08:00
snipe
15373d5f4a Fixed a few asset API issues 2017-01-12 02:19:55 -08:00
snipe
704ee59541 WTF why is name required?? 2017-01-12 02:19:36 -08:00
snipe
5a848566f9 Helper method to standardize JSON responses 2017-01-12 02:19:17 -08:00
snipe
268308004c Fixed number of results returned 2017-01-11 23:45:03 -08:00
snipe
0cf4014b75 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2017-01-11 23:41:02 -08:00
snipe
95f2d94e01 Added create/destroy methods for asset API 2017-01-11 23:40:56 -08:00
Richard Hofman
c506f30562 Add support for location-specific LDAP OUs. (#3176)
* Add support for location-specific LDAP OUs.

* Shortened variable names as suggested by Codacy review.
2017-01-11 23:37:14 -08:00
snipe
2c695cf7e5 404 JSON response if the asset is not found
(Brady and I will argue about this forever)
2017-01-11 19:12:25 -08:00
snipe
74696d5ded View asset API 2017-01-11 19:00:34 -08:00
snipe
7a124e85d6 Cleaned up unused use statements 2017-01-11 18:26:05 -08:00
snipe
b8d81c0734 Added order_number to presenter 2017-01-11 18:25:53 -08:00
snipe
900e6e2419 Starter asset API 2017-01-11 18:14:06 -08:00
snipe
15bab7fa9e Test Auth::guard('api')->user() as user_id 2017-01-11 14:55:04 -08:00
snipe
9e4a391b8b Updated auth:api in kernel 2017-01-11 14:54:11 -08:00
snipe
c08fe196c4 Fix api middleware call 2017-01-11 14:50:38 -08:00
snipe
93a087b29a Set longer token expiration 2017-01-11 14:50:26 -08:00
snipe
4590054c75 Fixed path in comments 2017-01-11 14:50:13 -08:00
snipe
80e047f679 Removed poop 2017-01-11 14:45:47 -08:00
Daniel Meltzer
9bbfb64f17 Add a use declaration to Userscontroller to prevent assigning the wrong item_type. Should fix/prevent #3160 (#3168) 2017-01-11 04:27:05 -08:00
snipe
b5ddd9ab0a More vue/api work 2017-01-11 03:38:55 -08:00
snipe
b7bbc44052 Removed unneeded use statement 2017-01-10 23:21:47 -08:00
Daniel Meltzer
44683c784f Importer: Add License Importer and refactor (#3143)
* Major code simplification of the importers.

Move towards using Model::fill and Model::update rather than reinventing
the wheel.  This makes the updating/creating logic a lot clearer, and
allows for the deletion of a lot of code.  Also allows for supporting of
more fields in the future really easily.

* Cleanup constructors and use setters instead.

* Set the LC_MONETARY locale, and use it to strip currency symbols in Helper::parseFloat()

* Move licenseseat creation/deletion logic into an event handler on the model rather than the controller.

* Move the logging of parsed values to array_smart_fetch rather than writing it out everywhere

* Move to storing dates as carbon rather than strings.  Allows for the parsing of more arbitrary strings from the importer

* Add a license importer with support for checking out to users or assets.

* Make a directory for sample/mock import csvs and populate it

* Adjust how we store/retrieve dates to fix some issues the tests found.
2017-01-10 16:19:18 -08:00
snipe
57d2b88900 Remove number formatting 2017-01-06 03:14:32 -08:00
snipe
208ccab4c1 Fixes #3104, #2914 and #2918 - auto-increment incorrectly generating next ID 2017-01-06 02:54:06 -08:00
Daniel Meltzer
6ce20c32b1 Component Importer and various Importer Fixes (#3132)
* Importer fix: we were trimming the wrong part of the classname when creating a category.  This led to categories not being recognized.

* Add a component importer.  Uses same fields as consumable importer.  Only trick: If an asset_tag is present, we checkout a component to that asset on import

Enable component importer.  Also calculate the importer classname in a cleaner fashion.

* Fix comparisons.  find can return an index of 0, which is falsy.
2017-01-05 15:45:12 -08:00
Daniel Meltzer
816d2fd095 More minor fixes (#3126)
* Update composer phpcs

* Minor Fixes found while working.
ALlow user_id to be nullable in category model validation

Point to the correct route in accessoriespresenter datatable.  Also add name() method

Add a translated category name

Fix typo in translation

* Add a method to the asset presenter to show deployed when asset is deployed.  Fixes #3114
2017-01-03 16:55:43 -08:00
Bob Clough
f999c797e5 Allow a license to be pre-checked-out to an asset. (#3124)
Some licenses, such as windows licenses, are machine specific.  This
commit allows an extra field to be added to the license importer to
allow these licenses to be imported and attached directly to an asset
2017-01-03 16:55:21 -08:00
Daniel Meltzer
3a6bbcc615 More improvements (#3116)
* Restore display of deleted items in the logs

* Fix functional tests.
2016-12-30 11:44:47 -08:00
Daniel Meltzer
8a782bf34a Present assetlogs (#3112)
* Set user if asset is checked out to user.  fixes email problems.

* Use sometimes validation to ignore this when no values are present.

* Move Actionlog details to a presenter and port the activity table to use it.  Still need to port other parts of the application, but this consolidates a lot of logic.

* Attempt test fix

* Port users,licenses, and assets view to use the presenter to generate table values.
2016-12-29 22:23:36 -08:00