Commit graph

1478 commits

Author SHA1 Message Date
Tobias Regnery
651d1c735b Another slightly less ugly way for backward compatibility
Instead of using a constructor, add a special check in the boot-method for locations.
This seems to fit better in the system and does hopefully not break the existing tests.

Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
2024-11-04 10:03:38 +01:00
Tobias Regnery
1318dc6111 Add a backward compatibility setting for locations with companies
Now that locations have a company_id they get restricted to the users company with FullMultipleCompanySupport.
This breaks backward compatibility, because before everyone can handle locations without restrictions.
Add a setting right below FullMultipleCompanySupport so that everyone can switch to the desired behaviour.
The default is off and the existing behaviour is preserved.
2024-11-04 10:03:38 +01:00
Tobias Regnery
1ccbf8942c Add ability to tie locations to companies
Locations are the last big part of the application that can't be tied to companies.
This can be a problem with FullMultipleCompanySupport, because you can't restrict the visibility of locations to the company of the users.

In order to change this, add a company_id to the locations table and wire everything up in the views and controllers.
Aditionally add a new formatter to filter the locations to a specific company, like it is done for assets.

Locations are properly scoped to the users company if FullMultipleCompanySupport is enabled.
If a parent location of a location has a different company than the user, the location does not show up.
2024-11-04 10:03:37 +01:00
Marcus Moore
ae24b73b32
Fix action_type from "created" to" create" 2024-10-31 12:19:41 -07:00
Jeremy Price
69e74bbdd3 Fix ${var} deprecation warning in License model
When upgrading to php8.3 i started getting deprecation warning about
using ${var} instead of {$var} in 2 places in License.php

PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/snipe-it/app/Models/License.php on line 187
PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/snipe-it/app/Models/License.php on line 219

This simple fix switches the offending statements to {$var} syntax.
2024-10-30 19:43:54 -07:00
Marcus Moore
d727b03d95
Implement activity log test 2024-10-30 14:25:07 -07:00
Marcus Moore
0cc3031864
Implement deleted log 2024-10-30 14:05:27 -07:00
Marcus Moore
930ef3fd11
Work on tests for activity logging 2024-10-30 12:22:59 -07:00
snipe
f68df1fa06 Made type searchable in action logs
Signed-off-by: snipe <snipe@snipe.net>
2024-10-30 13:21:13 +00:00
Marcus Moore
54b4db86d2
Revert "Add soft deletes"
This reverts commit 0eadab49f1.
2024-10-29 15:33:49 -07:00
Marcus Moore
0eadab49f1
Add soft deletes 2024-10-29 15:26:18 -07:00
Marcus Moore
45e98e0282
Merge branch 'develop' into saving_custom_report_template 2024-10-29 15:20:52 -07:00
Marcus Moore
b97c54a54b
Improve handling of old data for text inputs 2024-10-29 11:25:54 -07:00
Marcus Moore
0d58ac61bc
Make options required in model 2024-10-28 14:48:19 -07:00
Marcus Moore
2042733dc0
Switch to array syntax 2024-10-28 14:37:52 -07:00
Marcus Moore
7238238d1f
Use created_by instead of user_id 2024-10-23 16:40:03 -07:00
Godfrey M
f29a383179 Merge branch 'develop' into seperating_notification_n_mail
# Conflicts:
#	app/Notifications/CheckoutConsumableNotification.php
2024-10-23 15:15:14 -07:00
snipe
3ee76be7e3 Added manufacturer and model_number to components
Signed-off-by: snipe <snipe@snipe.net>
2024-10-23 17:50:22 +01:00
Marcus Moore
c313a78c3c
Remove outdated @since annotations 2024-10-22 17:04:23 -07:00
Marcus Moore
37d65dac3d
Add todo 2024-10-22 17:01:37 -07:00
Marcus Moore
d953519db6
Merge branch 'develop' into saving_custom_report_template 2024-10-22 15:11:18 -07:00
Marcus Moore
d10fe77ee7
Merge branch 'develop' into fixes/get-id-for-current-user 2024-10-22 09:38:31 -07:00
Marcus Moore
a20e03fce9
Merge branch 'develop' into saving_custom_report_template 2024-10-21 17:13:15 -07:00
spencerrlongg
e40849c910 this stuff works 2024-10-21 17:31:26 -05:00
Marcus Moore
979e4502ff
Have getIdForCurrentUser method return null if FMCS enabled, user is not super admin, and does not have company 2024-10-17 15:14:39 -07:00
Tobias Regnery
f50ccbcc49 Fix outdated comment in CompanyableTrait
As of commit 5800e8d the user model uses CompanyableTrait so remove this clearly outdated comment
2024-10-17 11:07:28 +02:00
akemidx
5cb940c2ee Merge branch 'refs/heads/upstream/dev' into feature/sc-26415 2024-10-16 18:32:36 -04:00
Godfrey M
9f06a0e441 handle some edge cases, null values clean up variable names 2024-10-15 14:01:28 -07:00
Marcus Moore
5306e1cd15
Merge branch 'develop' into saving_custom_report_template
# Conflicts:
#	resources/views/partials/forms/edit/location-select.blade.php
#	resources/views/partials/forms/edit/manufacturer-select.blade.php
#	resources/views/partials/forms/edit/model-select.blade.php
#	resources/views/partials/forms/edit/supplier-select.blade.php
#	resources/views/reports/custom.blade.php
2024-10-15 12:32:01 -07:00
snipe
d0d4159088 Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2024-10-15 12:42:09 +01:00
snipe
de62359c67
Merge pull request #15533 from marcusmoore/testing/fmcs-accessories
Added tests for accessory api controller
2024-10-11 11:29:34 +01:00
snipe
b054017c9f Fixed #15651 - admin user now displaying on maintenances page
Signed-off-by: snipe <snipe@snipe.net>
2024-10-11 11:16:24 +01:00
snipe
aa55fa6ff4 Switch to form requests for settings
Signed-off-by: snipe <snipe@snipe.net>
2024-10-09 18:16:34 +01:00
Marcus Moore
e213053775
Swap factory syntax 2024-10-03 13:59:58 -07:00
Marcus Moore
32551d55d7
Merge pull request #15579 from bryanlopezinc/ImportTests
Add Import data tests
2024-10-03 11:39:21 -07:00
akemidx
17706f150e requested changes 2024-10-02 18:15:53 -04:00
snipe
cae8aa7840 Added maxlengths to additional fields
Signed-off-by: snipe <snipe@snipe.net>
2024-10-01 14:02:54 +01:00
Marcus Moore
fdfea390fb
Merge branch 'develop' into testing/fmcs-accessories 2024-09-30 12:59:27 -07:00
bryanlopezinc
e807cfab86 Merge branch 'develop' into importTests 2024-09-30 12:47:52 +01:00
bryanlopezinc
0b3f458561 Added tests for Import feature 2024-09-30 12:42:41 +01:00
snipe
ba69259f2d Fixed #13396 - do not allow checkout to undeployable status types
Signed-off-by: snipe <snipe@snipe.net>
2024-09-24 15:35:00 +01:00
snipe
b84a634ec7 Corrected comment
Signed-off-by: snipe <snipe@snipe.net>
2024-09-20 14:33:35 +01:00
snipe
2fc88a0e08 Eager load adminuser
Signed-off-by: snipe <snipe@snipe.net>
2024-09-20 14:33:26 +01:00
snipe
b21c303e56 Merge remote-tracking branch 'origin/develop' into features/add_created_at_created_by 2024-09-20 13:43:50 +01:00
Marcus Moore
d609ed50a4
Merge branch 'develop' into testing/fmcs-accessories 2024-09-19 13:20:55 -07:00
snipe
b88f2054dd Refactor isDeletable on companies
Signed-off-by: snipe <snipe@snipe.net>
2024-09-19 20:38:34 +01:00
snipe
d7bde37842
Merge pull request #15507 from setpill/setpill/feat/use_explicit_attributes_in_ldap_sync
Added #15506: Explicitly request used LDAP attributes
2024-09-19 20:33:10 +01:00
snipe
74088ea581 Optimize isDeletable counts
Signed-off-by: snipe <snipe@snipe.net>
2024-09-19 20:13:38 +01:00
snipe
727806372c Added created_by to status label
Signed-off-by: snipe <snipe@snipe.net>
2024-09-19 18:22:11 +01:00
snipe
5e1c736d49 Added created_by for manufacturers
Signed-off-by: snipe <snipe@snipe.net>
2024-09-19 18:04:50 +01:00