Commit graph

2729 commits

Author SHA1 Message Date
snipe dfd9fcc5e0
Merge pull request #12599 from inietov/fixes/unknown_column_0_in_field_list
Fixed Column not found: 1054 Unknown column '0' in 'field list' [sc-20004]
2023-03-14 09:51:42 -07:00
Ivan Nieto Vivanco 67471a3a77 Evaluate if the collection is empty before access the array index 2023-03-13 21:44:06 -06:00
Godfrey M 1bd37b49e9 adds translations for webhook names 2023-03-13 16:13:02 -07:00
Ivan Nieto Vivanco d224f3177e Delete a rule that was breaking validation 2023-03-13 16:43:10 -06:00
Godfrey M 6474249ea8 uppercased names 2023-03-13 15:29:53 -07:00
Godfrey M 7612c5d852 lowercases variables 2023-03-13 15:26:51 -07:00
Ivan Nieto Vivanco e7b3daa80c Adjust validator to only receive valid groups id's 2023-03-13 16:10:08 -06:00
Ivan Nieto Vivanco e4204a6dd1 Adds validator to PATCH request in the API UsersController 2023-03-13 15:49:05 -06:00
Godfrey M 576b8f8c48 adds translations to edit and index of categories 2023-03-13 13:33:03 -07:00
Godfrey M 542332ea0c removes discord from rules 2023-03-13 10:54:18 -07:00
Godfrey M 27a2ed5c79 Merge branch 'develop' into generalize_webhooks 2023-03-13 10:41:08 -07:00
snipe 88eb73d160 Use Carbon’s diffForHumans() method instead of our own home-grown stuff
Signed-off-by: snipe <snipe@snipe.net>
2023-03-08 16:47:54 -08:00
Brady Wetherington 087fe19ae7 Merge branch 'livewire_importer_2_squashed_and_rebased' of github.com:uberbrady/snipe-it into livewire_importer_2_squashed_and_rebased 2023-03-08 13:57:21 -08:00
Brady Wetherington 22d7d2a04e Aliases could get selected when they weren't for an import_type 2023-03-08 13:56:29 -08:00
snipe b8887bd3e3 Translated strings
Signed-off-by: snipe <snipe@snipe.net>
2023-03-08 13:47:56 -08:00
snipe 65c2d75c04 Added aliases
Signed-off-by: snipe <snipe@snipe.net>
2023-03-08 13:47:38 -08:00
snipe dccd6fd4b1 Duplicate withCount
Signed-off-by: snipe <snipe@snipe.net>
2023-03-08 13:06:14 -08:00
snipe 7f8bdbd252 Added showableAssets() relationship to Category model
Signed-off-by: snipe <snipe@snipe.net>
2023-03-08 13:01:38 -08:00
Godfrey M 15c19a7ab7 silenced Discord option and validation, more translations 2023-03-08 10:35:45 -08:00
snipe 094859cfe8 Merge branch 'livewire_importer_2_squashed_and_rebased' of https://github.com/uberbrady/snipe-it into uberbrady-livewire_importer_2_squashed_and_rebased 2023-03-07 21:38:04 -08:00
Brady Wetherington 037489a6c0 If fields were already mapped, they would cause a 500 on re-mapping on import 2023-03-07 21:33:20 -08:00
Brady Wetherington 942bedaf06 Re-add VIP and BYOD to importer, but in Livewire 2023-03-07 18:53:32 -08:00
Brady Wetherington 09c1298e03 Merge branch 'develop' into livewire_importer_2_squashed_and_rebased
I'll be taking in the changes to the importer front-end elsewhere
2023-03-07 18:51:05 -08:00
Brady Wetherington fe699737eb Add improved field-guessing logic; make sure 'do not map' fields work 2023-03-07 18:26:59 -08:00
Godfrey M 69944853f9 more translations 2023-03-07 15:57:58 -08:00
snipe 45b5a8b6ab Catch exception if the file can’t be handled via Intervention
Signed-off-by: snipe <snipe@snipe.net>
2023-03-07 15:56:36 -08:00
Godfrey M 35dd0d8def adds generalized webhooks, updates settings page, translations, validation 2023-03-07 15:48:21 -08:00
akemidx ec5836dab4 cloning accessories first bit 2023-03-07 16:41:48 -05:00
snipe 1ebbc767f1
Merge pull request #12624 from snipe/features/added_vip_and_byod_to_importer
Added `vip` and `byod` to importer
2023-03-06 17:11:28 -08:00
snipe e1069ac234 Return a file not found error if it doesn’t appear on disk
Signed-off-by: snipe <snipe@snipe.net>
2023-03-06 15:09:37 -08:00
snipe 8b6e8898c1 Fixed hardcoded string
Signed-off-by: snipe <snipe@snipe.net>
2023-03-06 15:09:12 -08:00
snipe 2cb06165c4 Added missing vip field to transformer and request
Signed-off-by: snipe <snipe@snipe.net>
2023-03-06 15:00:04 -08:00
snipe cc7325074e Check that the file exists before trying to stat it for filesize
Signed-off-by: snipe <snipe@snipe.net>
2023-03-06 10:47:28 -08:00
snipe f54d83ed59
Merge pull request #12612 from manuteleco/add_path_in_preflight_url_message
Fixed #11800: Include path in the expected URL during Pre-Flight
2023-03-06 09:36:15 -08:00
Manuel Rodríguez Guimeráns 548ae7ad22 Add Reverse Proxy support to Pre-Flight URL check
Before this change, the Pre-Flight URL check would inevitably fail
whenever Snipe-IT was running behind a reverse proxy or load balancer.

The URL check tries to ensure that the configured application URL
matches the URL that is actually used to reach the application. However,
when running behind an HTTP intermediary (like a reverse proxy or a load
balancer) the HTTP connection that Snipe-IT receives is not the _real_
connection from the user anymore, but a connection from the HTTP
intermediary. The scheme, host and port that Snipe-IT would obtain from
that incoming intermediary connection wouldn't match what is configured
as application URL and, therefore, the URL check would fail.

This commit solves the situation by making Snipe-IT's Pre-Flight URL
check aware of the `X-Forwarded-Proto` and `X-Forwarded-Host` HTTP
headers. These headers represent the _de-facto_ standard used by reverse
proxies and other HTTP intermediary components to convey information
about the incoming HTTP connection to the upstream application. Being
the upstream application, Snipe-IT can then make use of this information
to correctly evaluate the validity of the configured application URL.
2023-03-05 18:15:16 +01:00
Manuel Rodríguez Guimeráns 1d4f4b92de Include path in the expected URL during Pre-Flight
So that the message displayed to the user when the URL Pre-Flight check
fails is:

> Snipe-IT thinks your URL is SCHEME://DOMAIN, but your real
  URL is SCHEME://DOMAIN/setup

instead of:

> Snipe-IT thinks your URL is SCHEME://DOMAIN/setup, but your real
  URL is SCHEME://DOMAIN/setup

Having a missing "/setup" in the expected URL might confuse the user
into thinking that it is an additional configuration problem they need
to fix.

With this change, the comparison between the expected and actual URL
will not contain any accidental difference anymore. Only those that the
user really needs to be aware of and fix in their setup.
2023-03-05 17:52:45 +01:00
Ivan Nieto Vivanco 95f568b934 Remove unnecessary try/catch 2023-03-02 19:50:47 -06:00
Ivan Nieto Vivanco 8a5d426ccd Use correct LicenseSeat property 2023-03-02 19:33:32 -06:00
Ivan Nieto Vivanco e0b2dc043a Adds try/catch to users API 2023-03-02 11:13:56 -06:00
Godfrey M aae178a606 gets select working, placeholders update dynamically 2023-03-01 17:10:10 -08:00
snipe b8231f420b Remove name from blanking paroperties
Signed-off-by: snipe <snipe@snipe.net>
2023-03-01 14:12:33 -08:00
snipe 84a14918bb Updated comments
Signed-off-by: snipe <snipe@snipe.net>
2023-03-01 14:03:33 -08:00
snipe 473553c464 Moved gate
Signed-off-by: snipe <snipe@snipe.net>
2023-03-01 14:01:40 -08:00
snipe dac877f184 Added location clone
Signed-off-by: snipe <snipe@snipe.net>
2023-03-01 13:51:35 -08:00
Godfrey M 354f04534e add multi array, migration, still having issues 2023-03-01 12:30:32 -08:00
Brady Wetherington ca849db316 The 'download activity report' displayed the wrong value for 'admin' 2023-03-01 12:23:13 -08:00
snipe 562546a853 Updated comment
Signed-off-by: snipe <snipe@snipe.net>
2023-02-28 23:37:30 -08:00
snipe 4860440306 Check that it’s an array (versus checking that it’s not a bool)
Signed-off-by: snipe <snipe@snipe.net>
2023-02-28 23:32:10 -08:00
snipe b72a9cc6fd Check if the $owner is boolean
Signed-off-by: snipe <snipe@snipe.net>
2023-02-28 23:31:26 -08:00
Brady Wetherington 54cb38603b Cleaned up the last of the FIXME's (or downgraded them to TODO's) 2023-02-28 22:34:44 -08:00
Brady Wetherington 5cf66851f7 Finalizing the Livewire Importer! Just going to do some testing now 2023-02-28 21:58:02 -08:00
snipe 463ef02fae
Merge pull request #12578 from inietov/fixes/undefined_variable_total
Fixed Undefined variable `$total`
2023-02-28 20:50:00 -08:00
Brady Wetherington 2f94bf96ff Everything's all wired up; just need to clean up all the FIXME's and stuff 2023-02-28 18:36:52 -08:00
snipe 1f7ae08d76
Merge branch 'develop' into features/make_eol_sortable 2023-02-28 18:05:09 -08:00
Ivan Nieto Vivanco 1be0a8d911 Declare variable as an empty array 2023-02-28 10:22:49 -06:00
Ivan Nieto Vivanco 9d94bd6567 Validate if the license seat is not checked out, it can't be checked in 2023-02-27 18:57:38 -06:00
Brady Wetherington 53db266b69 WIP: cleaning up extraneous gunk and trying to standardize on one single Livewire Select2 implementation 2023-02-27 14:29:02 -08:00
Brady Wetherington fb201e61f3 More wiring up Livewire to the back-end. 2023-02-27 14:29:02 -08:00
Brady Wetherington e1c8f155bb Wiring up more bits to Livewire 2023-02-27 14:29:02 -08:00
Brady Wetherington 8009ee79db I think I have, now, full parity on the base Importer level
Meaning that you can upload new files, delete old files, have error
messages, have status updates - and all of them seem to work.
2023-02-27 14:29:02 -08:00
Brady Wetherington 0a085af0a0 Getting the basic wiring of the importer over into Livewire
WIP: Wiring up more and more of the actions on the importer

Files now upload okay, a little glitchy on the display-side though

add to readmes so i dont forget
2023-02-27 14:28:59 -08:00
snipe 96c851468c Added max results limit to report index
Signed-off-by: snipe <snipe@snipe.net>
2023-02-27 12:04:46 -08:00
Godfrey M e8fc895e51 "adds variables, but still not working" 2023-02-27 09:19:59 -08:00
snipe 3e47d9e689 Pass the existing asset name to the bulk checkout form
Signed-off-by: snipe <snipe@snipe.net>
2023-02-24 09:54:46 -08:00
snipe 5e6ebb9a65
Merge pull request #12410 from uberbrady/paginate_accessories_report
Paginate accessories report
2023-02-23 12:26:17 -08:00
snipe 8e72da42e8
Merge pull request #12406 from akemidx/vip_tag
Added a checkbox to notate VIP status
2023-02-23 12:23:29 -08:00
snipe eb6357636a
Merge pull request #12467 from marcusmoore/fix/scope-people-with-full-multiple-companies
Fix full company scoping in user selects
2023-02-23 10:36:33 -08:00
akemidx 690970b4aa fixing ff error 2023-02-22 18:18:20 -05:00
Marcus Moore f63710fb5c
Remove unused import 2023-02-22 12:34:56 -08:00
Marcus Moore 7667b0a216
Remove extra line 2023-02-22 12:34:35 -08:00
Marcus Moore 931ca98c02
Remove middleware bypass 2023-02-22 12:33:55 -08:00
snipe 4bf1566d2a
Merge pull request #12124 from Godmartinz/feature/sc-16946/add-checkbox-to-allow-skipping-a-user-during
Adds Boolean to Users Table for Auto Assigning Licenses
2023-02-21 20:10:46 -08:00
snipe 0c3115553e
Merge branch 'develop' into vip_tag 2023-02-21 20:03:49 -08:00
Godfrey M 58801dbb0b allows users to clear their slack settings 2023-02-16 08:43:12 -08:00
Godfrey M 7b510d5f2b greys out submit button conditionally 2023-02-15 15:46:05 -08:00
snipe 27e5832a28 Use existing slack translations
Signed-off-by: snipe <snipe@snipe.net>
2023-02-15 14:06:52 -08:00
snipe ff895739f4
Merge pull request #12446 from Godmartinz/livewire_slack_inputs
Adds Livewire slack inputs
2023-02-15 13:27:07 -08:00
snipe 057f0be20a
Merge pull request #12473 from inietov/fixes/rollbar_attempt_to_read_property_on_null
Fixed ErrorException:  Attempt to read property "id" on null [sc-19855]
2023-02-15 12:32:53 -08:00
snipe 3800cdd0da
Merge pull request #12466 from snipe/fixes/style_fixes
Style fixes
2023-02-15 11:07:59 -08:00
Ivan Nieto Vivanco 6936efd387 Remove e() function from customfield format input 2023-02-12 16:27:37 -06:00
snipe b0b1c96ab5
Merge pull request #12514 from marcusmoore/fixes/preserve-asset-name-during-api-checkout
Fix asset names being removed during API checkout requests
2023-02-14 12:22:03 -08:00
Marcus Moore 8e00191b69
Add comment 2023-02-14 12:19:16 -08:00
Marcus Moore a94f19a68e
Use name if provided by asset checkout request 2023-02-14 12:08:20 -08:00
Marcus Moore 2349f54013
Use translation strings for importer exceptions 2023-02-13 13:30:36 -08:00
Marcus Moore 73f355f3a8
Return 422 instead of 500 when import is invalid 2023-02-08 12:39:42 -08:00
Marcus Moore b3881a43a7
Fix return type 2023-02-08 12:34:25 -08:00
Marcus Moore c2c666aef0
Formatting 2023-02-08 12:32:57 -08:00
Marcus Moore 5962f1b627
Catch json encoding exceptions and display them to the user 2023-02-08 12:21:51 -08:00
snipe c1d484b5df Fixed mismatched field/fieldset
Signed-off-by: snipe <snipe@snipe.net>
2023-02-07 13:31:50 -08:00
snipe dd5f256450 We shouldn’t need this because aliases??
Signed-off-by: snipe <snipe@snipe.net>
2023-02-07 11:02:02 -08:00
Ivan Nieto Vivanco d4c838a979 Add condition in activity report to only access assigned item id if it exist 2023-02-07 11:26:49 -06:00
snipe cd5546e4a1 Fixed wonky switch statement indenting
Signed-off-by: snipe <snipe@snipe.net>
2023-02-06 12:44:17 -08:00
snipe d52d32fed9 Fixed visibility for constants and methods
Signed-off-by: snipe <snipe@snipe.net>
2023-02-06 12:44:02 -08:00
snipe 7363d4e223 FIxed yoda operator
Signed-off-by: snipe <snipe@snipe.net>
2023-02-06 12:43:35 -08:00
snipe c8c5dddcc1 Removed unused else condition
Signed-off-by: snipe <snipe@snipe.net>
2023-02-06 12:43:19 -08:00
Marcus Moore 38cdcdf064
Eager load company 2023-02-06 10:59:51 -08:00
Godfrey M 74c64c1fc5 adds validation to the update hook, removes typos and deadlines 2023-02-06 09:40:57 -08:00
Marcus Moore 0cefc7de15
Skip security headers middleware when testing 2023-02-02 18:37:35 -08:00
snipe 51f3857a31 Fixed something I think I broke
Signed-off-by: snipe <snipe@snipe.net>
2023-02-02 15:32:45 -08:00
akemidx b8951e2b54 fixing name from vipuser to vip 2023-02-02 15:58:05 -05:00
Godfrey M 17f1772143 removes postslack from settings controller 2023-02-01 16:58:08 -08:00
Godfrey M 3a86547ef5 fixes messages for integration test, removes slack request file, rehouses ajax method 2023-02-01 16:51:05 -08:00
snipe d9cdb92014
Merge branch 'develop' into vip_tag 2023-02-01 16:03:23 -08:00
snipe 1a8fb5bcfe
Merge pull request #12423 from snipe/features/edit_fieldset_name
Fixed #12418 - added ability to edit custom field names via GUI
2023-02-01 13:39:39 -08:00
Godfrey M f95a904d90 adds integration button, working on its functionality 2023-02-01 12:08:13 -08:00
snipe f7ae5db4f3
Merge branch 'develop' into features/fixed_12382_added_checked_out_count_to_accessories 2023-01-31 19:56:43 -08:00
snipe 2d45ebe103
Merge pull request #12433 from inietov/fixes/asset_declined_date_issues
Fixed Invalid date value on assets acceptance mail notification
2023-01-31 19:14:51 -08:00
Godfrey M 1e0c58c3cf saves data correctly now 2023-01-31 11:32:05 -08:00
lukasfehling cddae4869f fixed the endpoint for user notification with all their assigned assets 2023-01-31 18:27:25 +01:00
Godfrey M fc044528b8 validation is working, success message appears, database is not updating 2023-01-30 16:10:02 -08:00
Ivan Nieto Vivanco ccc7b78f62 Store the acceptance dates with format YYY-mm-dd 2023-01-30 15:11:41 -06:00
snipe 22b0b9b090 Fixed gates on fieldsets
Signed-off-by: snipe <snipe@snipe.net>
2023-01-26 17:05:41 -08:00
snipe 583a0412fe Added edit fieldsets translations
Signed-off-by: snipe <snipe@snipe.net>
2023-01-26 17:03:23 -08:00
Godfrey M a63ea560ae adds submit button, getting setAttribute error 2023-01-26 15:17:08 -08:00
Brady Wetherington 4a54586690 Add to Accessories#index an additional gate-check against reports.view 2023-01-26 11:56:06 -08:00
Godfrey M 62b4c79150 adds a couple error messages 2023-01-25 16:38:08 -08:00
Godfrey M a69cb6204a adds rest of inputs, and corrects Data binding 2023-01-25 16:22:34 -08:00
Godfrey M 2e22eeade5 adds one input 2023-01-25 14:29:20 -08:00
akemidx 53d8008a5f Merge branch 'vip_tag' of github.com:akemidx/snipe-it into vip_tag 2023-01-25 17:14:29 -05:00
akemidx b363524305 vipuser label updated to vip 2023-01-25 15:58:44 -05:00
snipe 4c3354b778
Merge branch 'develop' into vip_tag 2023-01-24 20:29:43 -08:00
Brady Wetherington b00333c9f5 Merge remote-tracking branch 'upstream/develop' into develop 2023-01-24 17:36:39 -08:00
Brady Wetherington c9f0f5fe8b Change Accessories report to use server-side pagination from URL 2023-01-24 17:35:44 -08:00
akemidx 596846a94a Add VIP Checkbox 2023-01-24 15:29:27 -05:00
Marcus Moore b92d1d3ec7
Logically group query when searching users to scope to company 2023-01-24 11:54:56 -08:00
Godfrey M 0f8ee22053 Creates Slack Setting Form 2023-01-24 09:25:05 -08:00
snipe dc155846ca Hoist the autorization higher in the stack so we’re not doing logic or math when the user isn’t authorized to touch this
Signed-off-by: snipe <snipe@snipe.net>
2023-01-23 21:49:17 -08:00
snipe 7a9ea91be0
Merge pull request #12387 from snipe/fixes/inconsistent_UI_for_image_delete
Updated - Refactored ImageHandler request to be more re-usable, and checkboxes with missing `minimal` class for iCheck
2023-01-23 21:39:55 -08:00
snipe 02dcb0fbd7 Shorten the additiona form request invocation to just ImageUploadRequest
We already have the `use App\Http\Requests\ImageUploadRequest` clause at the top of this file.

Signed-off-by: snipe <snipe@snipe.net>
2023-01-23 21:37:35 -08:00
Jeremy Price d3bcc48ae5 [imports] fix "Backup before importing?" checkbox on import page
We were always taking backups before import, no matter the status of
this box.

Turns out we were testing for the presence of the property defined by
the checkbox, rather than the value of the property, and as such were
always doing a backup.

We're now checking the status, and it behaves as expected
2023-01-23 15:08:59 -08:00
snipe 41537a2449 Added field to the API controller endpoints
Signed-off-by: snipe <snipe@snipe.net>
2023-01-22 00:56:44 -08:00
snipe 5f9af7d509 Updated API response
Signed-off-by: snipe <snipe@snipe.net>
2023-01-22 00:56:28 -08:00
snipe cd8cb445ba Corrected fieldname for user fieldname for avatar in Controller
Signed-off-by: snipe <snipe@snipe.net>
2023-01-21 18:20:53 -08:00
snipe a0aed19f95 Refactor image handler
Signed-off-by: snipe <snipe@snipe.net>
2023-01-21 18:05:55 -08:00
snipe f77d871dff Use the imageHandler for profile avatar changes
Signed-off-by: snipe <snipe@snipe.net>
2023-01-21 18:05:20 -08:00
snipe 60eab08735 Added ->with(‘users as users_count’) in Accessory query
Signed-off-by: snipe <snipe@snipe.net>
2023-01-21 14:41:07 -08:00
snipe 90c1631820 Added users_count to transformer for API
Signed-off-by: snipe <snipe@snipe.net>
2023-01-21 14:40:35 -08:00
snipe 378dc968b7 Derp. Copypasta
Signed-off-by: snipe <snipe@snipe.net>
2023-01-18 15:44:28 -08:00
snipe 0c39c7a53d Updated blades to add byod as a “status”
Signed-off-by: snipe <snipe@snipe.net>
2023-01-18 13:25:46 -08:00
snipe f626413502 Added byod to API transformer
Signed-off-by: snipe <snipe@snipe.net>
2023-01-18 13:04:02 -08:00
snipe b80d52a9c3 Added byod to asset controller for create and update methods
Signed-off-by: snipe <snipe@snipe.net>
2023-01-18 13:03:51 -08:00
snipe ee4b8f4694 Added byod to API controller
Signed-off-by: snipe <snipe@snipe.net>
2023-01-18 13:03:31 -08:00
Godfrey M 7ce230fadc missed a few renames 2023-01-18 08:57:59 -08:00
snipe 4ef0005e7c BREAKING: changed API fieldname result for 2FA
Signed-off-by: snipe <snipe@snipe.net>
2023-01-17 17:21:40 -08:00
snipe dbda288a44 Formatting changes only for readability
Signed-off-by: snipe <snipe@snipe.net>
2023-01-17 17:21:20 -08:00
snipe eaf9332096 Added filterability to 2FA fields
Signed-off-by: snipe <snipe@snipe.net>
2023-01-17 17:21:03 -08:00
snipe 9d0a15990e Check that the $use_db_field has a value before attempting a delete
Signed-off-by: snipe <snipe@snipe.net>
2023-01-13 11:26:11 -08:00
snipe 8f3a237ea0 More comments
Signed-off-by: snipe <snipe@snipe.net>
2023-01-10 16:29:51 -08:00
snipe 151719a91c Added comments
Signed-off-by: snipe <snipe@snipe.net>
2023-01-10 16:24:46 -08:00
snipe 825df2cf75 Load up the item counts with the individual API methods for accurate numbers without n+1
Signed-off-by: snipe <snipe@snipe.net>
2023-01-10 16:17:03 -08:00