Commit graph

725 commits

Author SHA1 Message Date
snipe 41b864cc49 Added update method for assets 2017-01-12 03:48:18 -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 15373d5f4a Fixed a few asset API issues 2017-01-12 02:19:55 -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 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
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
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 d1e360d64d Fix logic to use gate instead of asking if superuser 2017-01-06 00:02:19 -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 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
snipe 6029bea2de Fixed error if user not set 2016-12-29 18:19:08 -08:00
snipe 199fdf39ec Merge branch 'dmeltzer-checkout-to-things-v1' into develop 2016-12-29 16:20:37 -08:00
snipe 221cf1f9c8 Merge branch 'checkout-to-things-v1' of https://github.com/dmeltzer/snipe-it into dmeltzer-checkout-to-things-v1
# Conflicts:
#	app/Http/Controllers/AssetsController.php
#	app/Http/Controllers/ReportsController.php
#	app/Http/Controllers/UsersController.php
#	app/Presenters/AssetPresenter.php
2016-12-29 16:20:17 -08:00
Daniel Meltzer ce8eda1325 Fix some accessory sorting (#3108)
Fixes at least some of #3045
2016-12-29 15:50:18 -08:00
snipe 51ceaedfaf Small phpcbf cleanup 2016-12-29 14:02:18 -08:00
Daniel Meltzer 62dd474d44 Update dump with new migration. 2016-12-29 14:06:16 -05:00
Daniel Meltzer aa2d3cf026 The assets method was renamed to assignedAssets in User class. Adjust places to reflect that 2016-12-29 11:45:37 -05:00
Daniel Meltzer 13b51bc934 Allow checkout of item to things on create page. Need to test validation better and maybe extract code to one place for checkout.blade and edit.blade 2016-12-29 11:10:52 -05:00
Daniel Meltzer 8cc695b65f Port more assignedUser to assignedTo. 2016-12-29 09:31:16 -05:00
Daniel Meltzer 719463ef54 Progress 2016-12-27 22:04:11 -05:00
snipe fd805bde50 Fixes #1247 - allow SVG logo upload 2016-12-27 17:31:53 -08:00
Daniel Meltzer d262aec4c3 Save Progress. 2016-12-27 19:24:41 -05:00
Daniel Meltzer 13cf11368f Reformat all view files. (#3105)
* Reformat all view files.  Check for matching tags and rearrange to make everything line up.

* Fix regression on asset create where the log was no longer saved.
2016-12-27 12:03:47 -08:00
Daniel Meltzer cafafe851c Notification rework (#3103)
* Move slack integration to laravel5.3 style notifications, part 1.

* Fix consumable tab when active.

* Move the slack notifiable to the settings model.  Move all slack notifications into logCheckout/logCheckin.  Should think about refactoring this as an event at some point still.  Move Asset checkin/checkout to use the general loggable trait rather than it's own solution.

* Fix a logic error where assets with a non deployable status would show checkin instead of no button at all.

* Fix an html formatting error that resulted in us not closing a form.  This would cause the checkin page to try to submit a delete request (related to the modal form) rather than the desired checkin request.  Also fix formatting in this file.
2016-12-26 15:19:04 -08:00
Daniel Meltzer 06af9311fc Move sanitization of input to the model attribute setters. This cleans up a lot of checks in the various controller methods and ensures data will be set in the model accurately regardless of where it's set. Add unit tests for these methods (#3102) 2016-12-26 15:17:46 -08:00
Daniel Meltzer fd450e2773 Two asset maintence related fixes (#3101)
* Fix maintenances create button, and post to the proper route in maintences edit

* Fix consumable tab when active.

* Fix an html formatting error that resulted in us not closing a form.  This would cause the checkin page to try to submit a delete request (related to the modal form) rather than the desired checkin request.  Also fix formatting in this file.

* Use log mail driver for testing, should fix the functional issue.  Disable acceptance tests on travis for now.

* Fix Category edit page.

* EOL Can be null.
2016-12-26 15:17:12 -08:00
Daniel Meltzer 57374955a8 Importer rework (#3100)
* Step 1 of refactoring importer to use separate classes.

* Port web importer.  Fix an issue with validation where index 0 would be treated as false and cause weird results.

* Farewall, AssetImport.  You've served us well.
2016-12-26 15:16:42 -08:00
Daniel Meltzer 02c1a45025 View presenters (#3099)
* Add presenters for models.  Move bootstrap table JSON generation to these presenters, which cleans up controllers a lot.  Move view specific modifications from the models to the presenters as well.

* Fix some issues found by travis and codacy

* Fix a few more issues found while testing.

* Attempt another acceptance test fix

* Try something else

* Maybe..

* Move conditionals out of the datatable method and into dedicated url methods.
2016-12-23 19:23:07 -08:00
snipe 40615f9504 Merge branch 'develop' of github.com:snipe/snipe-it into develop
# Conflicts:
#	app/Http/Controllers/StatuslabelsController.php
2016-12-23 17:53:03 -08:00
Daniel Meltzer 61543f3a04 Add presenters for models. (#3098)
* Add presenters for models.  Move bootstrap table JSON generation to these presenters, which cleans up controllers a lot.  Move view specific modifications from the models to the presenters as well.

* Fix some issues found by travis and codacy

* Fix a few more issues found while testing.

* Attempt another acceptance test fix

* Try something else

* Maybe..
2016-12-23 17:52:00 -08:00
snipe 297b9d25f0 Fixed issue with status labels 2016-12-23 16:07:58 -08:00
snipe 0cf5ad120b Removed todo 2016-12-22 21:09:01 -08:00
snipe 93dd27339b Fixed missing with clause 2016-12-22 21:08:43 -08:00
snipe fc18aa7f6d Fixes bug #3086 - unabel to create asset from asset model screen 2016-12-22 17:08:42 -08:00
snipe 2fe984013b Fixes #3092 - user location not being exported correctly 2016-12-22 15:53:34 -08:00
Daniel Meltzer 323c3807fa Cleanup controller escaping (#3084)
* Make delete routes work.  We put a little form in the modal that spoofs the delete field.

* Fix route on creating a user.

* Fix redundant id parameter.

* Port acceptance tests to new urls.

* Initial work on migrating to model based policies instead of global gates.  Will allow for much more detailed permissions bits in the future.

* This needs to stay for the dashboard checks.

* Add user states for permissions to build tests.

* Build up unit tests for gates/permissions.  Move accessories/consumables/assets to policies instead of in authserviceprovider

* Migrate various locations to new syntax.  Update test to be more specific

* Fix functional tests.

Add an artisan command for installing a settings setup on travis-ci

* Try a different id... Need to come up with a better way of passing the id for tests that need an existing one.

* Try to fix travis

* Update urls to use routes and not hardcode old paths.  Also fix some migration errors found along the way.:

* Add a environment for travis functional tests.

* Adjust config file to make travis use it.

* Use redirect()->route instead of redirect()-to

* Dump all failures in the output directory if travis fails.

* Cleanups and minor fixes.

* Adjust the supplier modelfactory to comply with new validation restrictions.

* Some test fixes.

* Locales can be longer than 5 characters according to faker... fex gez_ET.  Increase lenght in mysql and add a validation

* Update test database dump to latest migrations.

* Extend Supplier phone/fax length.

This catches issues found in testing with a phone number with a five digit extension.  fex (356) 654-3024 x36632

Also move away from escaping all values put into eloquent.  Eloquent
already uses PDO parameter binding, and this was leading to names like
Mr Ryan O'Malley turning into an html escaped version of that name when
stored.  All values should be escaped when using {{}}, we'll just have
to be more cautious when we use {!!, but I think we already are?

* Remove additional escaping here, like we did in suppliers controller.

* No need to eager load all of these relationships when we can call the count on the querybuilder directly

* Work on controller cleanup

* Always start from scrach, catches more issues this way.

* Update sql dump.  Remove old code from permissions test.

* Generate a deletable item on demand in the test, rather than relying on one existing.  I think we should probably move to mock all the database stuff at some point..

* More travis related fixes

* Break script into multiple functional lines

* Update all controllers to use the new helper, also cleanup syntax and docblocks along the way.
2016-12-19 22:00:50 -08:00
Daniel Meltzer cd8c585377 Discussion: Moving to policies for controller based authorization (#3080)
* Make delete routes work.  We put a little form in the modal that spoofs the delete field.

* Fix route on creating a user.

* Fix redundant id parameter.

* Port acceptance tests to new urls.

* Initial work on migrating to model based policies instead of global gates.  Will allow for much more detailed permissions bits in the future.

* This needs to stay for the dashboard checks.

* Add user states for permissions to build tests.

* Build up unit tests for gates/permissions.  Move accessories/consumables/assets to policies instead of in authserviceprovider

* Migrate various locations to new syntax.  Update test to be more specific

* Fix functional tests.

Add an artisan command for installing a settings setup on travis-ci

* Try a different id... Need to come up with a better way of passing the id for tests that need an existing one.

* Try to fix travis

* Update urls to use routes and not hardcode old paths.  Also fix some migration errors found along the way.:

* Add a environment for travis functional tests.

* Adjust config file to make travis use it.

* Use redirect()->route instead of redirect()-to

* Dump all failures in the output directory if travis fails.

* Cleanups and minor fixes.

* Adjust the supplier modelfactory to comply with new validation restrictions.

* Some test fixes.

* Locales can be longer than 5 characters according to faker... fex gez_ET.  Increase lenght in mysql and add a validation

* Update test database dump to latest migrations.
2016-12-19 11:04:28 -08:00
Daniel Meltzer ae2cb5fe68 Make delete routes work. (#3077)
* Make delete routes work.  We put a little form in the modal that spoofs the delete field.

* Fix route on creating a user.

* Fix redundant id parameter.

* Port acceptance tests to new urls.
2016-12-19 10:42:33 -08:00
snipe 9ea05bacf3 User resource routes 2016-12-15 20:52:39 -08:00
snipe 4751bcd002 Use redirect()->route instead of ->to 2016-12-15 20:02:47 -08:00
snipe f832b15cf3 Components routes 2016-12-15 19:59:42 -08:00
snipe e685e0f019 Cleaned up custom fields controllers, views, names, etc 2016-12-15 19:17:07 -08:00
snipe 37b4b29653 Fixed URL for statuslabels route 2016-12-15 18:23:26 -08:00
snipe 01f9deb5a6 Fixed forgotten to-> to ->route 2016-12-15 18:20:41 -08:00
snipe d6b41759f0 Updated manufacturers, suppliers, depreciations for new route resources 2016-12-15 18:18:13 -08:00
snipe e8945ad85e Fixed hardware.show for controller 2016-12-15 18:17:20 -08:00
snipe c308fbce0d Updated resources, named routes, tests for Locations 2016-12-15 17:12:22 -08:00
snipe 3e4be6671e Updated categories with resty routes 2016-12-15 16:42:47 -08:00
snipe f182a7db2a Removed leading slash for url helper 2016-12-15 16:42:14 -08:00
snipe aab0933856 Use url() helper over URL::to 2016-12-15 16:41:36 -08:00
snipe b7a2c4c26d Use Request instead of Input:: 2016-12-15 15:56:52 -08:00
snipe c6ab34faee Updated Companies for #3059 2016-12-15 15:48:30 -08:00
snipe 6c8e9327c1 Fixed Request path 2016-12-15 15:47:08 -08:00
snipe cf2b57cb15 More for #3057 2016-12-15 15:15:11 -08:00
snipe ad1bf86a08 And still more license route updates 2016-12-15 13:07:34 -08:00
snipe bea1a93e9b More license route updates 2016-12-15 12:48:15 -08:00
snipe 1ab414453f Use $request instead of Input:: 2016-12-15 12:47:12 -08:00
snipe eb9207d0fe Fixed license routes in getDataTable 2016-12-15 12:14:16 -08:00
snipe 0c5d3d1c74 Updated license routes 2016-12-15 11:57:19 -08:00
snipe a6b975b168 More updates for #3060, #3058 2016-12-15 06:11:03 -08:00
snipe e67b3e474f Use more RESTy method names, uses route names where possible (#3059, #3060) 2016-12-15 04:09:40 -08:00
snipe 37c847ea08 Clearer/updated/named custom fields routes
This is still broken
2016-12-14 09:56:23 -08:00
snipe 7c774352e5 Fix depreciated lists() method 2016-12-14 09:55:35 -08:00
snipe 863e200430 Hopefully fixes tons of PEBKAC where users have the wrong app.url 2016-12-14 08:20:05 -08:00
snipe 68ac4abe2c Updated throttling override for 5.3 2016-12-14 06:30:51 -08:00
snipe 433adb1dcb Updated traits and method names for 5.3 2016-12-14 05:06:51 -08:00
snipe 5cd7e84d98 Renamed Password controllers to new 5.3 versions 2016-12-14 05:06:15 -08:00
snipe 65db55908a Rename to AuthController to LoginController 2016-12-14 04:30:56 -08:00
Daniel Meltzer 927a12f78d Fix #2985. Missed in the field rename (#3014) 2016-12-05 15:09:14 -08:00
snipe 7ccef51a4f Removed some dumb comments 2016-12-01 02:25:53 -08:00
snipe 4c418bf622 Remove unused $request variable 2016-12-01 02:13:00 -08:00
snipe 16cfdbaa93 Redirect the lost password success back to login 2016-12-01 02:04:43 -08:00
snipe 3f8f6ad981 Fixes #2995 - adds max login attempts/duration as .env option 2016-12-01 02:04:15 -08:00
snipe d8d800bb7a Fixes #2997 - don’t include soft-deleted maintenances 2016-12-01 00:55:00 -08:00
snipe 68b9ffb908 Only allow login via LDAP if the user was already imported or created via LDAP 2016-12-01 00:29:45 -08:00
snipe 6c366eb112 Fixes potential login issue if password syncing is set to true 2016-11-30 20:39:43 -08:00
snipe f5e100a6a5 Only allow asset files to be deleted, maintenances to be added if user has assets.edit permission 2016-11-29 13:37:45 -08:00
snipe abcc01f5e0 More language string corrections 2016-11-29 12:48:00 -08:00
snipe 4dbe8fad30 More language string fixes 2016-11-29 08:46:33 -08:00
snipe 7bf1664b8f Allow XML mimetypes 2016-11-29 08:01:08 -08:00
snipe b0d8711002 Add .lic as possible license file type 2016-11-29 07:22:45 -08:00
snipe 53404f3d1c Fixes asset model clone 2016-11-29 06:16:52 -08:00
snipe f605821143 Remove unneeded use statements 2016-11-29 06:14:33 -08:00
snipe cab331f3f8 Link model name in category view 2016-11-29 06:14:20 -08:00
snipe eb340b0fa9 Add fieldset to asset model listing 2016-11-29 06:06:52 -08:00
Daniel Meltzer 263f19bdad Fix error in partializing with creating an asset maintenance. (#2987) 2016-11-29 05:02:48 -08:00
snipe 81a0e06c40 Automatically log the user in after user creation 2016-11-29 01:19:25 -08:00
Daniel Meltzer b8cbf0022e Log fixes (#2972)
* Make sure we set target_type when creating an accept asset log, and add a migration to fix older ones.

* On a declined log, we don't have an assigned user.

 Guard against this conditional (which realistically should never be hit?)
Should fix #2940

* Fix codacy issues with migration.
2016-11-24 12:48:14 -08:00
snipe 45c789021e Add employee number option to custom report 2016-11-23 05:17:54 -08:00
snipe 54dec2147c Merge branch 'develop' of github.com:snipe/snipe-it into develop 2016-11-21 18:40:38 -08:00
snipe bc84f80e20 Check if sig_filename exists 2016-11-21 18:40:26 -08:00
Daniel Meltzer ac9fd3b3bb Update LicensesController.php (#2948)
* Update LicensesController.php

Should fix #2939.  Cannot test at the moment, so please check :)

* Add delete tests.  Improve test item generation.

* Add relationship here.

* Fix some issues with seeding.
2016-11-20 19:59:57 -08:00
snipe d8eb68af83 Merge branch 'hotfixes/accessory_model_number' into develop
# Conflicts:
#	resources/views/accessories/edit.blade.php
2016-11-17 20:01:01 -08:00
snipe d0d9d82579 Add model number to accessories 2016-11-17 19:57:53 -08:00
Daniel Meltzer 55ccc000eb Fix loggable checkin (#2935)
* Log the user items are checked in from

This restores functionality that was lost in the port to loggable.
I'd still like to figure out a better term for the table, currently it says to, but I wonder if target is a better choice?

* Fix display of remaining seats on license view
2016-11-17 15:54:29 -08:00
Daniel Meltzer d722ed3823 Partialize forms (#2884)
* Consolidate edit form elements into reusable partials.

This is a large code change that doesn't do much immediately.  It
refactors all of the various edit.blade.php files to reference
standardized partials, so that they all reference the same base html
layout. This has the side effect of moving everything to the new fancy
"required" indicators, and making things look consistent.

In addition, I've gone ahead and renamed a few database fields.  We had
Assetmodel::modelno and Consumable::model_no, I've renamed both to
model_number.  We had items using ::note and ::notes, I've standardized
on ::notes.  Component used total_qty where consumables and accessories
used qty, so I've moved everything to qty (And fixed a few bugs in the
helper file in the process.

TODO includes looking at how/where to place the modal javascripts to
allow for on the fly creation from all places, rather than just the
asset page.

Rename assetmodel::modelno to model_number for clarity and consistency

Rename consumable::model_no to model_number for clarity and consistency

Rename assetmodel::note to notes for clarity and consistency

Port asset and assetmodel to new partials layout.  Adapt all code to the renamed model_number and notes database changes.  Fix some stying.

* Share a settings variable with all views.

* Allow editing the per_page setting.  We showed the value, but we never showed it on the edit page..

* use snipeSettings in all views instead of the long ugly path.

* War on partials. Centralize all bootstrap table javascript

* Use model_number instead of modelno in importer

* Codacy fix.

* More unification/deduplication.  Create an edit form template layout that we use as the base for all edit forms.  This gives the same interface for editing everything and makes the edit.blade.* files much easier to read.

* Use a ViewComposer instead of sharing the variable directly.  Fixes artisan optimize trying to hit the db--which ruins new installs

* Fix DB seeder.

* Base sql dump and csv's to import data from for tests.

* Start some functional tests for creating items.

* Add functional tests for all create methods.  Still need to do tests for edits, deletes, and lots of other things

* Improvements to functional tests.

Use the built in DB seeding mechanism instead of doing it ourselves.
Break the tests into multiple units, rather than testing everything in
each function.

* Some improvements to acceptance tests.

Make sure we're only looking at the "trs" within the bootstrap table.
Creation of assets is now tested at the functional level (and is faster)
so ignore it here.

I'm testing acceptance tests with the
IMPORT_{ASSETS,ACCESSORIES,CONSUMABLES}.csv in the tests/_data folder
imported.

* A few things to make acceptance tests work.  Add a name to the companies table, and make the locations table have the correct name

* Use a .env.tests file for testing functional and unit to allow a separate database.

* Add functional tests for compoents, groups, and licenses.

* Now that the config is in the functional.yml, this just confuses things.

* Start some functional tests for creating items.

* Add functional tests for all create methods.  Still need to do tests for edits, deletes, and lots of other things

* Improvements to functional tests.

Use the built in DB seeding mechanism instead of doing it ourselves.
Break the tests into multiple units, rather than testing everything in
each function.

* Some improvements to acceptance tests.

Make sure we're only looking at the "trs" within the bootstrap table.
Creation of assets is now tested at the functional level (and is faster)
so ignore it here.

I'm testing acceptance tests with the
IMPORT_{ASSETS,ACCESSORIES,CONSUMABLES}.csv in the tests/_data folder
imported.

* update db dump

* Update tests to new reality

* env for the test setup

* only load the database at beginning of tests, not between each Functional test.

* Fix a miss from renaming note to notes.

* Set Termination date when creating an asset.  It was only set on edit.

* Rename serial_number to serial in components for consistency.

* Update validation rules to match limits in database.  Currently we just accepted the values and they were truncated when adding to DB.

* Much more detailed functional testing of creating items.  This checks to make sure all values on form have been successfully persisted to database.
2016-11-16 16:56:57 -08:00
snipe 84e06f4642 Add postal code to locations listing 2016-11-16 08:22:54 -08:00
snipe 37a6599978 Adds expected checkin to custom reports 2016-11-15 01:55:27 -08:00
snipe 369715b7c7 Starter text search scope for activity report
(This will be messy)
2016-11-11 20:30:26 -08:00
snipe b854689d3d Urlencode username in case it has spaces 2016-11-11 20:09:22 -08:00
snipe 1543c03624 Removed stray foo 2016-11-11 20:09:07 -08:00
snipe 7667fca691 Fixes #2894 - set whether or not the user was originally a superuser 2016-11-11 19:48:39 -08:00
snipe 2ddee9b44c Fixes #2906 - adds manufacturer searching to licenses 2016-11-11 19:46:18 -08:00
snipe 2f05b83e0b Fixes #2912 - Reordering of custom fields now saving correctly 2016-11-11 18:33:59 -08:00
snipe 4747a4c03f Added urlencode to site name 2016-10-31 22:34:57 -07:00
snipe a914dacf8e Adds drawn signature to asset acceptance (#2846)
* Adds digital signature to asset acceptance

This is still a little broken - the history is displaying “Deleted user”, since there is no item type listed. Saving the item_type as App\Models\User tries to update accepted on the users table, which obviously doesn’t exist.

* Use asset facade for folks in subdirs

* Possible fix for weird accepted/declined display

* Display signature in modal popup if sigs are required

* Wrap that display file in auth middleware, just to be sure.

It shoudl fail if you’re not authorized since you’re not logged in, but better safe than sorry

* Fixed header section of layout

* Removed extra drop from migration rollback
2016-10-31 21:00:30 -07:00
snipe 6400557901 Check if the edited users permissioms are superuser before edit 2016-10-31 19:37:24 -07:00
snipe 3dac20c20f Unset superadmin by non-superadmins on user create 2016-10-31 19:08:24 -07:00
snipe 429afc6b3f Only save user permissions if the user is a superadmin 2016-10-31 19:07:55 -07:00
snipe 8323ed27c2 Do not makes group editable if the user is not an admin
This fixes a bug where the field was (correctly) disabled if the editing user isn’t a superadmin, but because the field was disabled, it would clear the permission groups.
2016-10-31 18:57:35 -07:00
snipe a4ae3b0091 Show whether device is enabled and/or 2FA is active 2016-10-31 17:16:26 -07:00
snipe cbfcf959f9 Allow certain users to override 2FA with permission 2016-10-31 16:52:25 -07:00
snipe e065d18227 Possible fix for integer weird typing 2016-10-31 13:50:00 -07:00
Frank 10ea5daabd Harden PragmaRX secret to 32 bytes (#2859)
This is needed at all but that extra security is always good.
2016-10-31 11:20:31 -07:00
snipe dce5afde78 Use config URL for links in user list 2016-10-29 07:33:33 -07:00
snipe 38b188f6ff Fixes #2448 - redirect to intended page 2016-10-29 07:32:48 -07:00
snipe fe041b66c6 Adds two-factor to users listing 2016-10-29 07:21:34 -07:00
snipe cea255995c Fixes #106 - adds Google Authenticator support (#2842)
* refactor to clean up LDAP login, and make the login method easier to handle.

* Login refactor cleanup

* Google 2FA package

* Adds Google Authenticator two-factor

* Removed unused blade

* Added optin setting in profile

* Removed dumb comments

* Made lock_passwords check more consistent

* Additional two factor strings

* Lock passwords check

* Display feature disabled text if in demo mode

* Two factor admin reset options

* Translation strings
2016-10-29 05:50:55 -07:00
Daniel Meltzer 3a8edfdf58 Eager load many more things. Fixes a lot of n+1 queries in ajax/bootstrap tables requests (#2832) 2016-10-28 14:15:13 -07:00
snipe a929b635ff Fixes #2809 - adds serial number to components 2016-10-27 15:33:48 -07:00
snipe 3e701c6dd1 Fixes #2814 - adds job title to users listing display 2016-10-27 14:29:07 -07:00
snipe e4140f4c48 Fixes #2817 - adds EOL to custom report 2016-10-27 14:20:55 -07:00
snipe 691f9b621e Fixes #2821 2016-10-26 11:27:37 -07:00
snipe f30631efb6 Fixed parens on target 2016-10-25 12:53:07 -07:00
snipe 85f3cc1762 Merge branch 'hotfixes/add_username_to_csv_export' into develop 2016-10-25 02:51:27 -07:00
snipe 1793461642 Added username, fixed duplicate company name 2016-10-25 02:50:23 -07:00
snipe d24c4b1152 Merge branch 'hotfixes/export_all_users' into develop 2016-10-25 02:42:20 -07:00
snipe 30f0f6f527 Export users to CSV
Bypasses the weird limit bug in the javascript
2016-10-25 02:41:34 -07:00
snipe b839741069 Merge branch 'hotfixes/order_number_numeric' into develop 2016-10-19 15:03:05 -07:00
Daniel Meltzer 85af8e46e3 Set a user_id of -1 if there isn't a logged in user. This fixes the CLI importer, and opens the door in the future for some sort of virtual importer user... which may fix other issues the importer currently has (#2775) 2016-10-17 11:07:08 -07:00
Daniel Meltzer e85241af6a Log checkouts (#2772)
* Ensure the log has a target before trying to fetch the associated company

* Log creation of items, both in importer and manually
2016-10-12 18:45:32 -07:00
snipe 31898d0f85 Fixes #2751 - asset tag added to asset maintenance report 2016-10-12 14:18:51 -07:00
snipe b3329135df Merge branch 'develop' of github.com:snipe/snipe-it into develop 2016-10-12 12:50:35 -07:00
snipe 2350c1c15c Fixes #2352 2016-10-12 12:50:30 -07:00
Daniel Meltzer 8e60767c00 Guard against null values in the reports generator. May fix #2758 (#2762) 2016-10-12 12:06:38 -07:00
Daniel Meltzer 2e0a7abbe9 Rework permissions view (#2756)
* Early layout work on a cleaner permissions interface

* Cleanup layout.  Make new permissions view work.  Still needs some css and javascript improvements.  Also need to do the same thing to the group view.

* Improve styling, add javascript to toggle an entire group of permissions if choosing the permission on the header row.  Would be nice to add collapsing of sections in the future.

* Toggle viewing sections.

* Special case places where we only have one item in a group to only display the item once.

* Filter getCreate the same way.
2016-10-12 12:06:28 -07:00
Matthias Frei 4b6ba6cb30 BugFix: Asset name was not included in custom report (#2733)
* BugFix: Asset name was not included in custom report

* BugFix: Custom Asset Report did not escape commas in custom fields. So the csv file is inconsistent, if a custom field containes a comma.  Added an escape function which escapes the commas with a backslash.
A csvreader can be configured to handle the escape character.
2016-10-12 12:05:49 -07:00
Daniel Meltzer 2a95a95e00 Company to logs (#2717)
* Fix the actionlog/companyables problem by adding a company_id to all actionlogs and scoping directly on that.  Works around bugs in laravel where trying to hunt down the polymorphic relationship would lead to an infinite loop

* Scope companyables in getactivityreport.  Also eager load.

* Improve reportscontroller, work on seeder to test this.

* Only show company users in checkout dialogs

* If no admin associated with log, it might be a request.  Leave blank instead of saying deleted admin

* When injecting company_id, use target instead of user if user is a superadmin

* Build up the seeder to generate users, companies, and logs.

* Eager load the log, don't scope the users log because the log should already include things only related to the user.
2016-09-29 22:20:49 -07:00
snipe b41883c125 Use user object to prevent errors on deleted users 2016-09-29 11:37:38 -07:00
snipe 0a218a37d0 Check that the user exists before trying to get location id 2016-09-29 10:32:09 -07:00
Brady Wetherington 7ca7877740 Fix mismerged code. (#2705) 2016-09-28 22:57:19 -07:00
snipe 1394424760 Merge branch 'hotfixes/customfields_in_asset_report' into develop
# Conflicts:
#	resources/views/models/custom_fields_form.blade.php
2016-09-28 19:28:55 -07:00
snipe fc07753a5c Use $customfields in closure 2016-09-28 19:18:01 -07:00
snipe 7bbe85801e Fixed typo :( 2016-09-28 15:45:05 -07:00
snipe 8774927b91 PHPStorm lag = fail 2016-09-28 15:40:51 -07:00
snipe 48b52a0ccc Merge branch 'hotfixes/p-typo' into develop 2016-09-28 08:59:07 -07:00
snipe 9ecb0e6ca1 Fixed errant typo 2016-09-28 08:58:16 -07:00
snipe 9091385182 Merge branch 'hotfixes/purchase_cost' into develop
# Conflicts:
#	app/Http/Controllers/ReportsController.php
#	config/version.php
2016-09-27 19:13:21 -07:00
snipe b90c0de822 Fix companyable reult in maintenances 2016-09-27 19:07:45 -07:00
snipe ee2522571c Fixes #2673 2016-09-27 19:07:30 -07:00
snipe 67f199b09d Added customfields to asset CSV export 2016-09-27 15:09:47 -07:00
snipe f1c458185d Client-side pagination on asset report for faster loading 2016-09-27 14:56:05 -07:00
snipe fa72e64b98 Add checkout date to asset report 2016-09-27 08:42:48 -07:00
snipe 2a8ab06ca3 Remove escaping for CSV to prevent weird encoding 2016-09-27 07:25:28 -07:00
snipe 61d07bdc7c Sigh. 2016-09-27 07:24:26 -07:00
snipe 3061ce2983 Missed delimiter for CSV 2016-09-27 07:23:30 -07:00
snipe e9f3d622f5 Add company name to custom asset report 2016-09-27 07:19:52 -07:00
snipe 1e3244b2b3 Merge branch 'hotfixes/eol' into develop
# Conflicts:
#	app/Http/Controllers/AssetModelsController.php
2016-09-27 07:04:45 -07:00
snipe a92bfe8ade Default EOL to null, not 0, if no value entered 2016-09-27 06:53:59 -07:00
snipe b6cc7e7c14 Fixes bug where 12-hour fprmat for hours was used 2016-09-26 22:35:51 -07:00
snipe 819ca2921b Fixes bug where 12-hour format was used for hours 2016-09-26 22:34:09 -07:00
Joris van Eijden 7d272e3c96 Fix pre-flight port number check. (#2681) 2016-09-26 18:23:56 -07:00
Andrés Núñez 40f00665b3 Translate emails (#2652)
* commit temporal

* final translation commit -- added email translations

* final translation commit -- removed file for spanish translations

* final translation commit -- removed file for spanish translations

* added missing translations

* method overrided and config files back to default

* config files back to default

* config files back to default
2016-09-26 14:13:07 -07:00
snipe c3cd329604 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2016-09-23 13:14:18 -07:00
snipe 2ba4986396 Updated history importer message 2016-09-23 13:14:11 -07:00
Eammon Hanlon 580091269d mkdir not recursive (#2460)
* Fix path to snipeit-ssl.crt (#2428)

* Modified 'recursive' part of the tuple to true
2016-09-21 12:05:06 -07:00
snipe 7fdd4fbe98 Updates to the history importer to make it a little less brittle and provide better feedback 2016-09-20 09:22:49 -07:00
snipe aecef2618f Add reply-to for mail 2016-09-20 07:20:40 -07:00
snipe bd5e6d8551 Add reply-to config setting 2016-09-20 07:20:10 -07:00
snipe 5b0220ac1e Fixed typo 2016-09-20 03:01:04 -07:00
snipe aa92b93bd1 Fixes #2622 - add depreciation to license report 2016-09-20 02:58:08 -07:00
snipe d3d36315d3 Hotfixes adding company name to custom report 2016-09-20 00:49:08 -07:00
snipe 0962d770cf Ajax activity report 2016-09-20 00:45:16 -07:00
snipe 5d8c06bc30 Eager loading for custom report 2016-09-19 23:52:20 -07:00
snipe 71be73781b Add company name option to reports 2016-09-19 22:27:34 -07:00
tiagom62 e5098c3ba1 missing semicolon (#2629)
Rookie mistake. Fixes missing semicolon in previous pr #2624.
2016-09-17 11:39:24 -07:00
tiagom62 46507c929a Sort backups newest to oldest (#2624)
Viewing the backup list produces a seemingly random list.

This PR sorts the files newest to oldest.
2016-09-17 00:00:39 -07:00
tiagom62 06f174adf9 Allow uploading rtf files (#2620)
Microsoft Open License Order Confirmation's are sent in RTF format. 

This change allows us to upload the RTF files under View License -> File Uploads.
2016-09-16 16:18:24 -07:00
Daniel Meltzer 2d8269ddcd Checkout Improvements, and initial support for requesting an asset model (#2573)
* Create a new action_log table to replace asset_log.  Use Polymorphism to generalize class and targets.  Port everything I can find to use it.  Add a migration to port the asset_logs table to action_logs.

* Initial work on requestable asset models

* Backend work for polymorphic requests table to store checkout requests.

* Add missing files

* Add a record to the db when requesting items.  Build up a testing route for interfacing with this.

* Users can now toggle requests of items on the request page.  Reformat page to use the same tab layout we use elsewhere

* Polymorphic request function.  Implement requesting of asset models.  Need to port mail/slack to notifications still.

* Implement requesting of asset models.  Build up emails and notifications to support it.  Allow specifying a quantity of model to request.

* Add view to show currently requested assets.  Needs some work and cleanup, but it isn't accessible from anywhere yet.
2016-09-15 19:58:27 -07:00
snipe b0a8a0427d Merge branch 'hotfix/license-clone' into develop
# Conflicts:
#	app/Http/Controllers/ReportsController.php
2016-09-14 19:08:06 -07:00
snipe f384593e19 Fix license cloning 2016-09-14 19:04:52 -07:00
snipe 91a035ec5b Text BOM text BOM, you’re my Text BOM…. 2016-09-14 18:58:52 -07:00
snipe d357326dc1 Use PHP streaming to generate asset report to prevent timeouts 2016-09-12 14:10:04 -07:00
snipe 5e2dbaffc4 Use streaming to handle large exports 2016-09-12 14:06:55 -07:00
snipe 7bde0f4f92 Fixes #2586 2016-09-08 20:01:46 -07:00
Daniel Meltzer e86adccf19 Actionlog Class: Improvements and polymorphism (#2561)
* Save progress

* Create a new action_log table to replace asset_log.  Use Polymorphism to generalize class and targets.  Port everything I can find to use it.  Add a migration to port the asset_logs table to action_logs.

* Allow accepted_id to be nullable.

* Comment out the thread_id migration, because it b0rks on a new database with the move.  I'm unsure if the thread_id does anything...It doesn't seem to be used

* Clean up all old methods from Actionlog model.  Port everything to use new cleaner interface.

* Port the actionlog factory to fix travis.

* Adjust code to work on php5.  Also fix lurking adminlog call.

* Remove weird code

* Port the pave command.  Also fix dangling adminlog
2016-09-06 19:39:42 -07:00
snipe 67315d81d6 Fixes #2134 - hide archived assets from list all 2016-09-01 13:28:15 -07:00
snipe 04e9ca0942 Fixes #2399 2016-08-30 12:34:23 -07:00
snipe ba70e5b053 A little demo-proofing of the maintenances page 2016-08-30 07:34:33 -07:00
snipe 421cbf11fc Patches PR#2500 for dev because @dmeltzer forgot that we commit to the develop branch :P 2016-08-30 06:54:04 -07:00
Daniel Meltzer 276e0a7114 Importer: Implement item update and interface improvments (#2507)
* Add support for updating assets to the importer.

If an asset with a matching asset tag is found, and the --update flag is
passed to the importer, we edit the matching asset with any
asset-specific values, and persist to the database.  Any missing/blank
values are skipped.

TODO: Add to web interface, add support in consumables/accessories

* Allow deleting of files on the import page.

* Extend web interface to allow updating of imported items.

This adds a modal dialog to the import process.  Currently the dialog
allows the choice of update vs ignore, and choosing the item type to
import (Accessory, Asset, Consumable).

Also use Helper::ParseFloat() for purchase_cost processing.  It exists,
and fixes issues on my end at least.

* Implement editing of consumables and accessories.

* Rename getProcessImportFile to postProcessImportFile to reflect how it's now used

* Fix copy-pasta error.
2016-08-29 15:49:32 -07:00
snipe 96eb832fd3 Only decrypt if the user is an admin 2016-08-25 21:03:24 -07:00
snipe 130c798c90 Only accept a new value for encrypted fields if the user is an admin 2016-08-25 20:59:54 -07:00
snipe 11b9df4b48 Use updated L5 request method 2016-08-25 17:11:52 -07:00
snipe 0c2524954f Removed unusued status_id variable 2016-08-25 17:10:09 -07:00
snipe 43fbd54a12 Store new fields in the database 2016-08-25 17:08:08 -07:00
snipe 406d270c01 Use L5 Request method for input 2016-08-25 17:07:58 -07:00
snipe ad22293f4b Added show in nav for status label views and controller 2016-08-23 18:52:42 -07:00
snipe fb402e138d Smaller dashboard number 2016-08-23 18:52:12 -07:00
snipe 85f3e7e3d4 Added filter by status type 2016-08-23 15:51:59 -07:00
snipe 014167699d Fixes #2441 - use showAssetName to avoid blank entries in link name which makes Slack do weird things 2016-08-18 13:10:31 -07:00
snipe d9f2e7bf58 If custom field is type URL, display it as a link 2016-08-18 12:44:55 -07:00
snipe 4c8c58d453 Clean up divs for gates in list view 2016-08-18 12:31:45 -07:00
snipe 4419dc7434 Merge branch 'fix-double-format' of https://github.com/dmeltzer/snipe-it into dmeltzer-fix-double-format
# Conflicts:
#	app/Http/Controllers/ConsumablesController.php
#	app/Http/Controllers/LicensesController.php
#	resources/views/hardware/view.blade.php
2016-08-16 18:53:45 -07:00
Daniel Meltzer ac63642224 Add manufacturer to licenses (#2436)
* Add manufacturer to licenses.  Shows in table and edit.  Need to improve manufacturer view to show lists beyond assets still.

* Remove extra closing tags, formatting

* Work on making the manufacturer view show more options. Need to figure out how to change the table dynamically.

* Cleanup formatting and fix a few weirdities in hardware/view.blade.php

* Standardize on two-space tabs in this file, as it seems the most
* common.

* Fix a few places where we call number_format without guaranteeing the
* item is a number and not a string.

* Show a "No Results" message on components page if there are no
* components.

* Show table of licenses on manufacturer view page.

This reworks the ManufacturersController::getDataView method to delegate
the view to a sub method (currently assets or licenses, but plan to
extend to consumables/accessories/components as well).  We then put tabs
at the top of the view to show multiple tables.  This just duplicates
the table layout from licenses/index.blade, but I wonder if theres a way
to centralize that code, maybe through partials, over time..

The only known missing part of manufacturers for licenses would be adding it
to the importer, but the license importer should probably migrate to
object importer before doing too much more...

* Add manufacturer to accessory.

* Add consumables to the manufacturer view page.
2016-08-16 18:49:54 -07:00
Daniel Meltzer 5959f83de3 Rename parseCurrencyString to formatCurrencyOutput to clarify what it does better. 2016-08-16 20:47:53 -05:00
Daniel Meltzer 0c912bcf49 Fix more number_format madness.
This does two main things:
1) The importer now imports as numbers, not parsed strings.  This allows
is to format values on output instead of input, which is what was
happening in most places.

2) Add a Helper::parseCurrencyString method and port everything to use
this.  This checks to see if the value is numeric or empty, and returns
the appropriate value in all cases.  Should fix all known occurances of
number_format expections.
2016-08-16 20:41:28 -05:00
Daniel Meltzer a852c624d3 Fix 2347 (#2394)
* Prevent multiple checkouts of the same asset.

This adds a new method to the Asset model, availableForCheckout.
Port getDataTable to use availableForCheckout instead of doing the
check manually.

Fixes Issue #2347

* Use availableForCheckout in categories controller.  Also gate the checkin/checkout actions here.

* Use gate and availableForCheckout in manufactuers as well.
2016-08-16 13:02:42 -07:00
snipe 7edf1db101 Small tweaks to history 2016-08-12 19:03:32 -07:00
snipe 41a20d8f66 Tidied up some debugging code, better explanation 2016-08-12 17:10:03 -07:00
snipe c73cbccffc Method to import CSV history 2016-08-12 16:01:59 -07:00
Daniel Meltzer dbd96a4c10 Don't try to format a formatted number string. (#2396)
The importer already formatted/parsed numbers on input into the db
(maybe it shouldn't have?) so running number_format on that string
throws an exception.  Check to make sure the value is numeric before
formatting it.
2016-08-11 19:13:49 -07:00
snipe 3a81b7e612 Eager load asset query on maintenances to prevent n+1 queries 2016-08-11 15:56:21 -07:00
snipe 1d3255a00b Allow admin to turn LDAP password sync off.
This is added to handle customers/users with a security policy that prohibits third-parties or external databases from storing LDAP passwords.
2016-08-04 14:29:28 -07:00
snipe fff2bce9e4 Added missing username in header row 2016-08-02 15:16:01 -07:00
snipe 75e0c5565c Add username and custom fields option to custom report 2016-08-02 15:04:10 -07:00
snipe ca8ca89955 Added custom color to status labels, only show status labels if there are results 2016-08-02 13:25:50 -07:00
snipe 1612562f41 Create log record and send EULA when creating a new asset that’s checked out 2016-08-02 10:33:44 -07:00
snipe 17d5e40e02 Fixes #2383 2016-08-02 09:54:31 -07:00
snipe 39929c7d89 Better handling for deleted users 2016-08-02 04:23:13 -07:00
snipe 66ad0f1d4c Better fix for location LDAP sync 2016-08-02 03:50:08 -07:00
snipe 3b247ba31f Ignore location field if no value is passed 2016-08-02 03:45:03 -07:00
snipe 39450c1fe9 Eager load throttle query 2016-08-02 01:23:53 -07:00
snipe 8246a319a2 Fixes #2363 and #1097 2016-08-02 00:54:38 -07:00
snipe 27adeb427e Generate barcodes locally and try to serve them if they exist 2016-08-01 22:56:28 -07:00
zjean fcb1d6ac15 Fixed feedback on #2349 (#2359) 2016-07-29 13:59:50 -07:00
Daniel Meltzer eef8d1609e Small fixes (#2350)
* components.view should point to view, not create

* Fix comment

* Rename variable to accurately reflect its responsibility

* Fix line breaks in serial key, remove places where adding line breaks makes no sense.  Fixes #2344
2016-07-28 20:59:42 -07:00
snipe 68b7b8f932 Fixes Carbon date 2016-07-28 08:51:01 -07:00
snipe f31637adb4 Fixes #2346 2016-07-28 08:39:28 -07:00
snipe 3e5d2b5385 Ability to remove field from fieldset 2016-07-28 08:10:15 -07:00
snipe fbd0059bbb Fixes #2317 2016-07-28 08:07:14 -07:00
snipe f53c5706f6 Fixes #2341 2016-07-28 07:36:58 -07:00
snipe 14b0a6315f Pass users path to get_src 2016-07-28 05:49:41 -07:00
snipe eb508901c5 Zerofilling for auto-increment 2016-07-27 21:28:00 -07:00
Daniel Meltzer a401986ef5 Only set the category_type in postEdit if the category is empty. (#2337)
Fixes #2333
2016-07-27 16:13:54 -07:00
snipe ad531d6d59 Merge branch 'develop' of github.com:snipe/snipe-it into develop 2016-07-25 22:10:38 -07:00
snipe 261d2f133b Only bcrypt temp passwords once for performance 2016-07-25 22:10:33 -07:00
Daniel Meltzer e0938cf82d Scope to company when viewing assets (#2315)
* If a user doesn't belong to a company, when scoping to a company we should only show items that don't belong to a company.

* Scope tables/items to the company they belong to when fetching items for the index.

* Fix asset count to also scope to company.  This fixes dashboard view

* Exempt super users from the child company check to be consistent.  Fixes license count on dashboard now that we scope everything
2016-07-25 19:46:29 -07:00
snipe eec22c5aeb Removed port stuff, since LDAP ignores it anyway :-/ 2016-07-22 16:21:16 -07:00
snipe b03330aae0 Added TLS option in settings for LDAP 2016-07-22 16:00:37 -07:00
snipe ba25972b49 Add LDAP port number option 2016-07-22 15:09:49 -07:00
snipe d4138f4364 Fixes #2299 2016-07-22 03:10:25 -07:00
snipe b2d958724b Removed commented code 2016-07-22 02:11:37 -07:00
snipe 92175eb700 Few more LDAP/AD tweaks 2016-07-14 23:49:32 -07:00
snipe 0cf8ac1d95 Add AD domain to settings 2016-07-14 15:52:52 -07:00
snipe 8fd8e747d9 Fix for missing input variable in suppliers ajax method 2016-07-13 22:35:21 -07:00
snipe e6b872299d Possible fix for #2246 - needs AD testing 2016-07-13 15:18:29 -07:00
snipe 40b56cfad7 Removed unused variables 2016-07-13 07:24:54 -07:00
snipe 5cd2c78d5e Link to location view, not edit 2016-07-13 07:16:10 -07:00
snipe ab6e2a7301 Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-07-13 05:50:45 -07:00
snipe e7038cfdc8 LDAP tester 2016-07-13 05:50:40 -07:00
snipe 4233c781ac Reworked LDAP login. Fixes #2218
LDAP no longer fails completely when the connection settings are wrong, or when app key is messed up. Rather than auth as the admin user and search, we auth as the user themselves. Admin auth is only for LDAP sync now.

This should mean much fewer problems with donked LDAP settings and login.
2016-07-13 05:50:24 -07:00
Daniel Meltzer bf88cd8233 Check for variables to exist and not null rather than assuming it does. Fixes #2247. (#2248) 2016-07-12 21:03:23 -07:00
snipe c8351ae01b Reverting back to or die 2016-07-11 18:25:29 -07:00
snipe 7a4cbce460 Use trans instead of lang:: 2016-07-10 21:07:59 -07:00
snipe f87fbbdb1d Removed unused use statement 2016-07-10 21:01:11 -07:00
snipe 4e38f96f97 Switched or and and to || and && for code quality 2016-07-10 20:55:44 -07:00
Daniel Meltzer ab3b9dcf5d Add a clone button the the user table. (#2241)
Also preserve permissions when cloning a user, instead of nulling them by default.
2016-07-10 18:43:10 -07:00
Daniel Meltzer f683c78a69 Fix adding an image to an asset when public/uploads/assets does not exist (#2240)
* Fix adding an image to an asset when public/uploads/assets does not exist.

 First check to see if we can create directory and do so.  If any errors occur, display the error string as an error on the page.

* Add the public/uploads/assets directory to new installs.

* Add some comments explaining this code so I remember what it does next time.
2016-07-10 18:43:00 -07:00
snipe a9f060e768 Removed extraneous comments 2016-07-09 18:19:19 -07:00
snipe 9f4e0491ed Fixes error in license checkout 2016-07-07 04:13:08 -07:00
snipe f2ddc7b0ae Added purchase cost and purchase date to listing 2016-07-07 02:07:21 -07:00
snipe 01b01c6479 Fixes #2149 2016-07-07 01:13:31 -07:00
snipe 0c98390eef Hide bulk actions, checkbox and checkout/in if deleted 2016-06-29 04:19:37 -07:00
snipe 6d5bc64b2b Another fix for status label types
This is a little janky, as it breaks up the errors into multiple screens if you don't have a status label type AND don't have a name. This is because the model-level validation won't work since we transmogrify that dropdown list of status label types into  boolean values for the DB. Should eventually find a less clunky way to handle this, but needed to get a fix in now.
2016-06-28 14:52:11 -07:00
snipe 483bf1b309 Merge branch 'v3' of github.com:snipe/snipe-it into v3 2016-06-28 12:19:19 -07:00
snipe e4275bd3d3 Fixes status label inline creation 2016-06-28 12:19:05 -07:00
Daniel Meltzer d484636bba Add model number column to the hardware list. (#2204)
* Add model number column to the hardware list and allow searching based on model number.   Column is hidden by default.

* Fix sorting.  Add scope to order by model number.
2016-06-27 22:32:40 -07:00
snipe 82d19fc704 Merge pull request #2201 from dmeltzer/fix-user-creation-values
UserController::postCreate - Store all request information.
2016-06-27 21:12:49 -07:00
Daniel Meltzer b1c28d7965 Move checks back into methods instead of having an extra helper method. Also remove unnecessary lock_passwords checks because there is a check at the top of the method that does this already. 2016-06-28 00:11:59 -04:00
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
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
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
snipe 4ed8ff5576 Formatting fixes for coding standards 2016-06-22 12:27:41 -07:00
Daniel Meltzer f6d47887c4 Flash input on model validation errors when creating/editing assets. 2016-06-22 15:20:49 -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
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 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
snipe 87352470c0 Added sortable created_at to assets and users 2016-06-15 21:06:17 -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 2df71be321 No need to update the user again 2016-06-13 11:30:47 -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
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 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 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 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 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 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 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 2d5a0deb31 Eager loading for requestable assets account page 2016-06-02 02:57:22 -07:00
snipe dddb0f7267 Fixed group error message 2016-06-02 02:46:49 -07:00
snipe 46d3a784a2 Fixes groups for cloning users 2016-06-02 00:41:10 -07:00
snipe 04610e7864 Just use model validation for new user 2016-06-01 18:04:11 -07: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
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
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 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
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 4edc2a7a66 Route and controller for dashboard chart 2016-05-24 16:06:09 -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 6c6e65b8ca Fixes #2076 2016-05-24 09:46:43 -07:00
snipe f844bf4b41 Nicer focus handling for asset search 2016-05-24 01:10:05 -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