Compare commits

...

1280 Commits

Author SHA1 Message Date
snipe
91f3e07b83 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-03-05 17:05:28 +00:00
snipe
c9f55bfd94 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2025-03-05 17:04:57 +00:00
snipe
c29bdbdacb Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/dist/skins/_all-skins.css
#	public/css/dist/skins/_all-skins.min.css
#	public/css/dist/skins/skin-blue.css
#	public/css/dist/skins/skin-blue.min.css
#	public/mix-manifest.json
2025-03-05 13:46:29 +00:00
snipe
27d98fbb93 Merge pull request #16429 from snipe/bug/sc-28609
Updated HTML label colors in blue skin
2025-03-05 13:43:53 +00:00
snipe
0e1f40626f Updated label colors in blue skin
Signed-off-by: snipe <snipe@snipe.net>
2025-03-05 13:40:36 +00:00
snipe
a20d104d2f Merge remote-tracking branch 'origin/develop' 2025-03-05 11:59:47 +00:00
snipe
7a312d075c Check for null on webhook url
Signed-off-by: snipe <snipe@snipe.net>
2025-03-05 11:59:35 +00:00
snipe
a61dd8ac17 Merge remote-tracking branch 'origin/develop' 2025-03-05 10:52:42 +00:00
snipe
e1156be919 Merge pull request #16427 from snipe/fixed_user_modal_email
Fixes user create modal - check if $item is set
2025-03-05 10:52:00 +00:00
snipe
fcf7a543fd Check if $item is set
Signed-off-by: snipe <snipe@snipe.net>
2025-03-05 10:47:33 +00:00
snipe
7ee9a690ea Merge remote-tracking branch 'origin/develop' 2025-03-05 01:12:22 +00:00
snipe
bef54983fa Merge pull request #16421 from marcusmoore/chore/migrate-label-helpers-pt8
Replace calls to Form::label pt8
2025-03-05 01:01:21 +00:00
Marcus Moore
f2b44f7002 Replace Form::label in company select partial 2025-03-04 16:46:43 -08:00
Marcus Moore
de7d32f632 Replace Form::label on ldap settings page 2025-03-04 16:44:26 -08:00
Marcus Moore
c798df2920 Replace Form::label on label settings page 2025-03-04 16:34:22 -08:00
snipe
5ba94c6c41 Merge remote-tracking branch 'origin/develop' 2025-03-05 00:12:09 +00:00
snipe
779330af14 Merge pull request #16420 from marcusmoore/fixes/report-url
Fixed custom report template route
2025-03-05 00:11:30 +00:00
Marcus Moore
f01ff1f1d7 Add dedicated named route 2025-03-04 16:07:35 -08:00
Marcus Moore
1e4daf0348 Fix route 2025-03-04 16:04:28 -08:00
snipe
9fa855c837 Prod assets
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 23:30:45 +00:00
snipe
9251007574 Merge remote-tracking branch 'origin/develop' 2025-03-04 23:29:31 +00:00
snipe
fae79a91f6 Merge pull request #16418 from marcusmoore/chore/custom-report-template-activity-log-removal
Stop reporting report template events to activity log
2025-03-04 23:28:43 +00:00
Marcus Moore
e8ee218f39 Purge activity log of report template data 2025-03-04 15:20:23 -08:00
Marcus Moore
cb5b0bd89c Stop reporting report template creates, updates, and deletes to action log 2025-03-04 15:11:37 -08:00
snipe
0ed49fa7a0 Dev assets
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 22:55:58 +00:00
snipe
f25b8379e6 Merge pull request #16413 from Godmartinz/visited_link-color-change
Changed `visited-link` and `link` colors in default theme to be more accessible
2025-03-04 22:55:17 +00:00
snipe
bc618fcef4 Merge pull request #16414 from Godmartinz/Audit_error_fix
Adds audit notification for MS Teams
2025-03-04 22:54:32 +00:00
Godfrey M
7c194422f3 Merge branch 'develop' into Audit_error_fix 2025-03-04 14:51:21 -08:00
Godfrey M
49ff47fbcf Merge branch 'develop' into visited_link-color-change 2025-03-04 14:47:48 -08:00
snipe
cc73b984cb Merge remote-tracking branch 'origin/develop' 2025-03-04 21:13:43 +00:00
snipe
77c978d29a Merge pull request #16416 from Godmartinz/expiring-asset-email-test
fix Expiring alert tests
2025-03-04 21:11:52 +00:00
Godfrey M
437b3cd865 fix conflicts 2025-03-04 13:08:53 -08:00
Godfrey M
3641016271 remove commented code 2025-03-04 13:08:03 -08:00
Godfrey Martinez
cc127c8e1e Merge branch 'develop' into expiring-asset-email-test 2025-03-04 13:06:36 -08:00
Godfrey M
4bac509341 fix Expiring alert tests 2025-03-04 12:58:04 -08:00
snipe
f4f6dcb885 Updated test
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 20:48:59 +00:00
snipe
d89f38bbfb Set defaults on save
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 20:38:33 +00:00
snipe
9351cc2252 Set default to 0
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 20:38:22 +00:00
snipe
a31a732d38 Nicer UI for invert flag
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 20:38:15 +00:00
snipe
1be420b0e9 Fixed test
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 20:37:45 +00:00
snipe
548ef97c32 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-03-04 19:57:33 +00:00
snipe
2b0127ab0c Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 19:56:58 +00:00
snipe
ed8a486726 Merge remote-tracking branch 'origin/develop' 2025-03-04 19:54:08 +00:00
snipe
8791640908 Add @Fiala06 as a contributor 2025-03-04 19:53:25 +00:00
snipe
1ab0911fc8 Merge remote-tracking branch 'origin/develop' 2025-03-04 19:52:16 +00:00
snipe
1dacd25e6d Check for purchase_cost before adding the “each”
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 19:50:11 +00:00
snipe
bdbaea7294 Merge remote-tracking branch 'origin/develop' 2025-03-04 19:43:28 +00:00
snipe
45317c0959 Merge pull request #16415 from snipe/nicer_error_message_on_model_not_found
Nicer model name formatting on RMB model not found
2025-03-04 19:42:45 +00:00
snipe
63e4c42445 Added strtolower
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 19:33:17 +00:00
snipe
d4e227f003 Whitespace
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 19:29:09 +00:00
snipe
bbabbe1b87 Nicer model name formatting on RMB model not found
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 19:21:46 +00:00
Godfrey M
15a09e5187 adds audit notification for MS Teams 2025-03-04 11:15:03 -08:00
Godfrey M
5eebdcddb2 changes visited and link colors 2025-03-04 10:12:45 -08:00
snipe
5cfd1f6fb2 Merge remote-tracking branch 'origin/develop' 2025-03-04 17:16:26 +00:00
snipe
16b97c18e0 Shim route for asset maintenances redirect on RMB not found
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 17:16:16 +00:00
snipe
5eda67381f Merge remote-tracking branch 'origin/develop' 2025-03-04 17:07:13 +00:00
snipe
fa72696a35 Removed redundent text
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 17:06:56 +00:00
snipe
2c8b8bfaf2 Merge remote-tracking branch 'origin/develop' 2025-03-04 17:05:55 +00:00
snipe
9467ec2571 Nicer env text
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 17:05:45 +00:00
snipe
8f3159751a Merge remote-tracking branch 'origin/develop' 2025-03-04 17:01:07 +00:00
snipe
ac3f61c96a Fixed extra escape character
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 17:00:44 +00:00
snipe
4b05e55b29 Merge remote-tracking branch 'origin/develop' 2025-03-04 15:56:05 +00:00
snipe
d2e0a23994 Merge pull request #16412 from snipe/#16150_fixed_regression_in_branding_page
Fixed regression from #16150
2025-03-04 15:55:24 +00:00
snipe
ccea55308b Fixed regression from #16150
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 15:53:30 +00:00
snipe
3d3c13fcd0 Merge remote-tracking branch 'origin/develop' 2025-03-04 15:38:58 +00:00
snipe
acaa3a28e7 Merge pull request #16410 from snipe/#16407_component_checkout_and_notes_fix
Fixed #16407 - weird layout on components for non super user
2025-03-04 15:38:20 +00:00
snipe
c4722898b7 Fixed #16407 - weird layout on components for non super user
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 15:37:25 +00:00
snipe
88e1d8a8cf Merge remote-tracking branch 'origin/develop' 2025-03-04 15:28:53 +00:00
snipe
e19003aea5 Merge pull request #16409 from snipe/#16386_user_dropdown_fields_not_populating_on_edit
Fixed #16386 - some fields not populating with user data on edit
2025-03-04 15:28:11 +00:00
snipe
a09a9d3cd6 Added item to payload
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 15:26:25 +00:00
snipe
759e3794df Small upgrader UI fixes
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 14:57:28 +00:00
snipe
c50b14763f Merge pull request #16403 from snipe/#16402_each_localization
Fixed #16402 - localize "each" string in components tab on asset view
2025-03-04 13:35:08 +00:00
snipe
369a68fe57 Fixed #16402 - Localize “each” in string
Signed-off-by: snipe <snipe@snipe.net>
2025-03-04 13:33:04 +00:00
snipe
83855d44d0 Merge pull request #16251 from Godmartinz/Audit_Checkin_warning_fix
refactors audit notification to mail, adds test, adds  alerts check to scheduler
2025-03-04 12:51:42 +00:00
snipe
6f847294ed Merge pull request #15911 from Fiala06/patch-1
Fixed duplicate entries preventing LDAP sync from continuing
2025-03-04 12:49:54 +00:00
snipe
d556d1c6e7 Merge pull request #16150 from Godmartinz/add-translations-to-settings
Adds Translation strings to General and Branding Settings
2025-03-04 12:48:21 +00:00
snipe
3bb94e98f0 Merge pull request #16398 from marcusmoore/bug/sc-28535
Avoid using authenticated user's email address in email partial
2025-03-04 12:47:10 +00:00
Marcus Moore
8f5f6f3502 Avoid using authenticated user's email address in email partial 2025-03-03 16:28:08 -08:00
snipe
e007db34e2 Merge remote-tracking branch 'origin/develop' 2025-03-03 22:12:26 +00:00
snipe
b3792bfa00 Merge pull request #16396 from marcusmoore/chore/migrate-checkbox-helpers-pt10
Replace calls to Form::checkbox pt10
2025-03-03 20:52:54 +00:00
Marcus Moore
40f7257723 Replace call to Form::checkbox 2025-03-03 12:44:50 -08:00
snipe
8486256142 Merge pull request #16381 from marcusmoore/chore/migrate-checkbox-helpers-pt9
Replace calls to Form::checkbox pt9
2025-03-03 20:28:21 +00:00
snipe
7f36750e33 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2025-03-03 19:54:14 +00:00
snipe
de046db106 Add @azmcnutt as a contributor 2025-03-03 19:53:30 +00:00
snipe
eb1d27a5bc Merge pull request #16379 from azmcnutt/feature/settings_ldap_invert_active_flag
Feature/settings ldap invert active flag
2025-03-03 19:52:57 +00:00
Godfrey M
cc0b9f404a merged develop, fix conflicts 2025-02-27 15:38:31 -08:00
Marcus Moore
70332696c6 Fix test by passing in required properties 2025-02-27 15:23:17 -08:00
Marcus Moore
7a9b5d61b0 Replace another Form::checkbox 2025-02-27 13:25:32 -08:00
Marcus Moore
5876259893 Replace another Form::checkbox 2025-02-27 13:19:26 -08:00
Marcus Moore
8755c54edc Replace Form::checkbox 2025-02-27 13:13:39 -08:00
Marcus Moore
014f3b7652 Cast to boolean 2025-02-27 13:12:01 -08:00
Marcus Moore
3a2579b205 WIP: replace Form::checkbox 2025-02-27 13:08:02 -08:00
James M
149474bfe3 Update general.php
FIX: Spelling error
2025-02-27 12:42:47 -07:00
James M
b2b768dede Merge branch 'snipe:develop' into develop 2025-02-27 12:25:07 -07:00
snipe
f9f06d2c02 Merge remote-tracking branch 'origin/develop' 2025-02-27 19:08:45 +00:00
snipe
a9ed9e2a7f Merge pull request #16378 from snipe/wrap_pdf_table_results
Wrap long text in PDF export in tables
2025-02-27 19:06:34 +00:00
snipe
ce8523b00a Fixed wrapping
Signed-off-by: snipe <snipe@snipe.net>
2025-02-27 18:58:18 +00:00
snipe
7076a68d35 Wrap table results in PDF
Signed-off-by: snipe <snipe@snipe.net>
2025-02-27 18:38:10 +00:00
James M
112112d258 Feat: #14926 LDAP Active Flag - Add config option to make False = Enable 2025-02-27 10:52:12 -07:00
snipe
3928c8afe9 Merge pull request #16376 from uberbrady/improve_safety_csv_charset_detection
Add some safeties around the charset-detection and transliteration
2025-02-27 16:26:44 +00:00
snipe
234f7d00c8 Merge remote-tracking branch 'origin/develop' 2025-02-27 16:18:18 +00:00
snipe
23ce54e80c Make sure we’re saving the last_login in 2FA auths
Signed-off-by: snipe <snipe@snipe.net>
2025-02-27 16:17:59 +00:00
Brady Wetherington
646e3e8df5 Complete failed-transliteration test, clean up error, new translation string 2025-02-27 16:10:56 +00:00
snipe
30c4e9dbf7 Use formatter for created_at on unaccepted assets
Signed-off-by: snipe <snipe@snipe.net>
2025-02-27 15:48:24 +00:00
snipe
9924553da5 Merge remote-tracking branch 'origin/develop' 2025-02-27 15:45:57 +00:00
snipe
27fc30a881 Nicer button layout on unaccepted assets
Signed-off-by: snipe <snipe@snipe.net>
2025-02-27 15:43:53 +00:00
snipe
8ac7cda4ee Merge pull request #16366 from marcusmoore/chore/migrate-checkbox-helpers-pt7
Replace calls to Form::checkbox pt7
2025-02-27 15:01:31 +00:00
snipe
6f04d314a8 Merge pull request #16367 from marcusmoore/chore/migrate-checkbox-helpers-pt8
Replace calls to Form::checkbox pt8
2025-02-27 15:01:19 +00:00
snipe
1051b1d16d Merge pull request #16375 from snipe/fixes_16371_name_not_included_in_reminder_emails
Fixed #16371 - incorrect count and missing name in acceptance reminder email
2025-02-27 15:00:04 +00:00
snipe
115bb94704 Merge pull request #16156 from marcusmoore/acceptance-reminder-subject
Added "Reminder" to subject line of follow up asset checkout emails
2025-02-27 14:55:59 +00:00
snipe
25807cc62f Fixed constructor
Signed-off-by: snipe <snipe@snipe.net>
2025-02-27 14:22:48 +00:00
snipe
cd1d1b2d3e Fixed count
Signed-off-by: snipe <snipe@snipe.net>
2025-02-27 14:22:40 +00:00
Brady Wetherington
6dcd3bfd30 Add some safeties around the charset-detection and transliteration 2025-02-27 13:44:31 +00:00
snipe
df38d7e3ed Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-02-27 12:22:30 +00:00
snipe
b8799f8038 Bumped bash
Signed-off-by: snipe <snipe@snipe.net>
2025-02-27 12:21:28 +00:00
Marcus Moore
a0dc056da8 Replace Form::checkbox on label settings page 2025-02-26 16:33:07 -08:00
Marcus Moore
27aeb518ff Replace Form::checkbox on general settings page 2025-02-26 16:18:00 -08:00
snipe
dc619bb0dc Merge pull request #16365 from marcusmoore/chore/migrate-checkbox-helpers-pt6
Replace calls to Form::checkbox pt6
2025-02-26 23:54:50 +00:00
Marcus Moore
245a16c377 Replace Form::checkbox on branding settings page 2025-02-26 15:37:07 -08:00
Marcus Moore
de3c1d159f Replace Form::checkbox on branding settings page 2025-02-26 15:35:17 -08:00
Marcus Moore
af6d9e4a00 Replace Form::checkbox on custom report pages 2025-02-26 15:15:48 -08:00
snipe
8c8af3062e Merge pull request #16354 from snipe/dont_checkin_for_pending_on_asset_update
Allow pending as an asset status type that does not automatically check the asset in
2025-02-26 21:05:11 +00:00
snipe
44dd061619 Merge remote-tracking branch 'origin/develop' 2025-02-26 20:55:57 +00:00
snipe
2ff47edb94 Merge pull request #16361 from Godmartinz/acceptancer_reminder_unlisted_email_info
Fixed acceptance reminder command lag on users with no associated email
2025-02-26 20:33:02 +00:00
snipe
d923d29bad Merge pull request #16360 from spencerrlongg/bug/sc-28537
Add Safety Around Bulk Status Update
2025-02-26 20:32:19 +00:00
Godfrey M
899119ae2d changes output to a table 2025-02-26 12:30:19 -08:00
snipe
7603a932b1 Merge remote-tracking branch 'origin/develop' 2025-02-26 20:29:42 +00:00
snipe
e031de8e49 Merge pull request #16363 from snipe/added_a_few_more_no_interaction_calls
Added `--no-interaction` to additional passport commands
2025-02-26 20:19:37 +00:00
snipe
a81c520d93 Follow up for #16341
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 20:15:09 +00:00
Godfrey M
8352e81228 fix unaccepted reminder test 2025-02-26 11:50:08 -08:00
Godfrey M
fd0174ff32 remove unwanted changes to livewire 2025-02-26 11:31:41 -08:00
Godfrey M
cc26aa02b2 fix acceptance reminder command no email list 2025-02-26 11:25:21 -08:00
snipe
616f3558dd Update example env
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 19:14:25 +00:00
spencerrlongg
d6e266cec1 make super safe 2025-02-26 13:11:49 -06:00
snipe
138e7acc13 Merge remote-tracking branch 'origin/develop' 2025-02-26 12:47:54 +00:00
snipe
31516d7f24 Merge pull request #16356 from snipe/added_fields_for_model_search
Added name, model_number and notes for strict search
2025-02-26 12:46:13 +00:00
snipe
e79af255aa Added name, model_number and notes for strict search
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 12:43:54 +00:00
snipe
e863d3e7e5 Merge remote-tracking branch 'origin/develop' 2025-02-26 12:02:00 +00:00
snipe
5b0d7f4064 One more chonk
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 12:01:50 +00:00
snipe
c8e401f5ed Merge remote-tracking branch 'origin/develop' 2025-02-26 11:59:53 +00:00
snipe
2f6af10c5d Bumped chunk for custom report
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 11:59:34 +00:00
snipe
3ba20a8e28 Merge remote-tracking branch 'origin/develop' 2025-02-26 11:39:10 +00:00
snipe
afabda9235 Remove greater than 0 for alert threshold - fixes FD-47040
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 11:38:33 +00:00
snipe
1618c9ae8e Changed confirmation message
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 10:53:41 +00:00
snipe
5344ef4a1a Allow pending as an asset status that does not automatically check the asset in
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 10:46:38 +00:00
snipe
ebae63752f Merge remote-tracking branch 'origin/develop' 2025-02-26 10:25:18 +00:00
snipe
16420b1e00 Audit Log Number under Days to next Audit [sc-28530]
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 10:25:07 +00:00
snipe
62f66e724e Drop errors to warnings to stop pooping on rollbar
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 09:54:13 +00:00
snipe
9b0ea51d35 Moved composer clear commands to after composer install per #16334
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 09:37:31 +00:00
snipe
8bc73901cf Merge remote-tracking branch 'origin/develop' 2025-02-26 08:25:35 +00:00
snipe
992214fc66 Check for adminuser withTrashed
Signed-off-by: snipe <snipe@snipe.net>
2025-02-26 08:25:22 +00:00
snipe
b4f70d9244 Merge remote-tracking branch 'origin/develop' 2025-02-26 07:16:59 +00:00
snipe
93dab12461 Merge pull request #16342 from snipe/nicer_upgrade_script
Nicer upgrade.php UI
2025-02-26 07:16:28 +00:00
snipe
21e9f2bba3 Merge remote-tracking branch 'origin/develop' 2025-02-26 07:11:22 +00:00
snipe
ea0f105180 Merge pull request #16347 from marcusmoore/chore/migrate-checkbox-helpers-pt4
Replace calls to Form::checkbox pt4
2025-02-26 07:05:38 +00:00
snipe
5b6da0c1e8 Merge pull request #16348 from marcusmoore/chore/migrate-checkbox-helpers-pt5
Replace calls to Form::checkbox pt5
2025-02-26 07:05:22 +00:00
snipe
4d7655bbe1 Merge pull request #16346 from marcusmoore/chore/migrate-checkbox-helpers-pt3
Replace calls to Form::checkbox pt3
2025-02-26 07:04:27 +00:00
snipe
5e3855ee5b Merge pull request #16345 from marcusmoore/fixes/update-custom-fields
Fixed renaming custom fields
2025-02-26 07:03:40 +00:00
Marcus Moore
e01226a174 Replace Form::checkbox on saml settings page 2025-02-25 17:31:05 -08:00
Marcus Moore
f9ccf32af4 Replace Form::checkbox on ldap settings page 2025-02-25 17:22:44 -08:00
Marcus Moore
2c5170a218 Replace Form::checkbox on security settings page 2025-02-25 17:09:25 -08:00
Marcus Moore
15f842e2dc Replace Form::checkbox on bulk user edit page 2025-02-25 16:00:46 -08:00
Marcus Moore
46b31dfe14 Replace Form::checkbox on user create and edit page 2025-02-25 14:32:39 -08:00
Marcus Moore
d88c79366c Replace Form::checkbox on google settings page 2025-02-25 14:27:07 -08:00
Marcus Moore
de330a47cd Replace Form::checkbox on asset tag settings page 2025-02-25 14:25:02 -08:00
Marcus Moore
ecd7dc2094 Replace Form::checkbox on alert settings page 2025-02-25 14:23:26 -08:00
Marcus Moore
510946e0eb Replace Form::checkbox in logo upload partial 2025-02-25 14:20:43 -08:00
Marcus Moore
37e4a13979 Replace Form::checkbox in image upload partial 2025-02-25 14:15:12 -08:00
Marcus Moore
c73d64cdbc Remove manual doctrine mapping for enums 2025-02-25 13:37:23 -08:00
snipe
4a0410d969 Uncomment git stash
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 16:55:39 +00:00
snipe
668b9f8fb9 Nicer upgrade.php UI
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 16:51:32 +00:00
snipe
037d2d9e84 Merge pull request #16341 from uberbrady/fix_passport_install_no_interaction
Fixes #16331 - Don't make passport:install command require user input
2025-02-25 16:43:49 +00:00
Brady Wetherington
bce2007b97 Fixes #16331 - Don't make passport:install command require user input 2025-02-25 16:38:40 +00:00
snipe
881f4e3d6a Merge remote-tracking branch 'origin/develop' 2025-02-25 14:43:57 +00:00
Brady Wetherington
09a5e5b1bd Whoops! Need minimum 8.2, not 8.1 (probably mis-merge?) 2025-02-25 14:40:45 +00:00
snipe
7b4f4b6b7f Merge pull request #16337 from joakimbergros/develop
Fixed #16173: `useraccountcontrol` was not included in the ldap query attributes
2025-02-25 13:49:38 +00:00
Joakim Bergros
5c66334017 Added a check to see if the user has specified that is an ActiveDirectory server in the configuration before adding the useraccountcontrol attribute to the ldap query. 2025-02-25 14:22:22 +01:00
Joakim Bergros
ae82051b73 Fixed #16173: useraccountcontrol was not included in the ldap query attributes.
`$results` did not include the `useraccountcontrol` and thus rendered the fallback logic void when `active_flag` was blank.

 Added a condition to check if `active_flag` is blank and only then add `useraccountcontrol` to the ldap query since it is then a requirement in accordance with "we respect the userAccountControl attribute" text in the `admin/ldap` route.

[`elseif' will become true when `active_flag` is blank](b141945add/app/Console/Commands/LdapSync.php (L364))
2025-02-25 13:55:53 +01:00
snipe
b141945add Updated branch
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 12:18:52 +00:00
snipe
c3a2e81afd Updated version
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 12:18:22 +00:00
snipe
18c7cbbbbb Merge pull request #16336 from snipe/change_order_in_upgrade_script
Fixed #16334 - Changed composer order in upgrade script
2025-02-25 12:09:15 +00:00
snipe
3718f08c72 Changed composer order in upgrade script
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 12:05:00 +00:00
snipe
b7821a69b6 Added link to the google apps script repo
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 11:07:04 +00:00
snipe
8049f21068 Updated laravel version in readme
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 11:02:00 +00:00
snipe
8140110bf9 Chnage dev docker env to en-US from en
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 10:57:38 +00:00
snipe
a4587f6322 Merge pull request #16335 from snipe/added_label_test
Added label test
2025-02-25 10:40:46 +00:00
snipe
163e19f1e9 Added label test
Signed-off-by: snipe <snipe@snipe.net>
2025-02-25 10:37:06 +00:00
snipe
8a40c3ecb4 Merge pull request #16325 from spencerrlongg/bug/sc-28520
Remove remaining hardware references in favor of new RMB
2025-02-25 10:09:35 +00:00
spencerrlongg
d949a9689f fix all 2025-02-24 22:35:47 -06:00
snipe
27a7c6fd10 Merge pull request #16324 from marcusmoore/chore/migrate-checkbox-helpers-p2
Replace calls to Form::checkbox pt2
2025-02-25 02:33:02 +00:00
Marcus Moore
4d55a67628 Merge branch 'develop' into chore/migrate-checkbox-helpers-p2 2025-02-24 16:37:59 -08:00
snipe
9d453226bd Merge pull request #16321 from spencerrlongg/bug/sc-28515
Changed Parameter Name for RMB
2025-02-25 00:17:37 +00:00
snipe
cd26694767 Merge pull request #16322 from marcusmoore/fixes/fix-test-edit-route
Fixed edit routes in tests
2025-02-25 00:17:10 +00:00
Marcus Moore
a26cc2ced1 Use .edit routes instead of .update 2025-02-24 15:55:05 -08:00
spencerrlongg
1fd81d17a3 route model binding change 2025-02-24 17:53:41 -06:00
snipe
134045f1ec Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2025-02-24 23:46:55 +00:00
snipe
b6b6a3eec7 Remove req for 0 min
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 23:46:50 +00:00
snipe
b62714d702 Merge pull request #16062 from snipe/remove_mcrypt
Removed references to mcrypt
2025-02-24 23:22:32 +00:00
Brady Wetherington
271bcc66bf Remove lib-mcrypt as a dependency 2025-02-24 23:19:08 +00:00
snipe
ced560daa9 Add @jostrander as a contributor 2025-02-24 23:16:27 +00:00
snipe
b395c9130a Merge remote-tracking branch 'origin/master' into develop 2025-02-24 23:06:46 +00:00
snipe
ed46a757fa Merge pull request #16320 from jostrander/fix/location-edit
Fixed: fix 500 on edit locations page by referencing current location
2025-02-24 23:03:01 +00:00
Jesse Ostrander
6a8a41b389 fix: reference to item location on location edit method 2025-02-24 17:34:18 -05:00
snipe
4800f4c853 Merge branch 'develop' into remove_mcrypt 2025-02-24 22:12:56 +00:00
snipe
c79ff49c85 Add @addex12 as a contributor 2025-02-24 20:30:04 +00:00
Marcus Moore
e88bba51bb Merge branch 'develop' into acceptance-reminder-subject 2025-02-24 11:55:50 -08:00
Marcus Moore
f97211f6cd Remove unused language string 2025-02-24 11:45:58 -08:00
Marcus Moore
027c2b3627 Change subject to "You have Unaccepted Assets." 2025-02-24 11:45:23 -08:00
snipe
ee85a392e7 Merge pull request #16316 from snipe/v8_final_merge
V8 final merge
2025-02-24 19:18:12 +00:00
Brady Wetherington
6c2d367124 Tweak version number and hashes 2025-02-24 18:38:53 +00:00
Brady Wetherington
982cfeca32 Merge branch 'develop' 2025-02-24 18:37:41 +00:00
snipe
5fa4f85c20 Merge pull request #16106 from marcusmoore/bug/sc-27960
Fixed asset show page erroring when asset not associated with model
2025-02-24 17:16:12 +00:00
snipe
43b8c0bf7b Merge pull request #16313 from snipe/localizations/2024-02-24
Updated strings, added Oromo
2025-02-24 14:51:45 +00:00
snipe
54b664d679 Updated strings, added Oromo
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 14:50:23 +00:00
snipe
bf2355a297 Fixed showfile path
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 14:34:10 +00:00
snipe
2bf4ec0ae8 A few more small tweaks
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 14:24:15 +00:00
Brady Wetherington
9555825a67 Update minimum PHP version 2025-02-24 14:03:57 +00:00
snipe
0bea07e2f9 Merge pull request #16312 from snipe/small_cleanups
Small cleanups before release
2025-02-24 13:53:28 +00:00
snipe
22f7a9ddd4 Fixed stray tag
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 13:46:33 +00:00
snipe
77b417bcea Passed user to showfile
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 13:43:39 +00:00
snipe
76e3c00d2d Removed footer on tables that didn’t need it
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 13:41:49 +00:00
snipe
77add8abbc Added strings
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 13:39:07 +00:00
snipe
b53957268a Added warning if deleted
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 13:38:55 +00:00
snipe
ba49fc554d Moved warning to be consistent with other FCOs
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 13:38:47 +00:00
snipe
e60462b751 Added/updated tests
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 13:38:28 +00:00
snipe
a5009aa7df Added withTrashed() to handle soft deletes with RMB
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 13:38:06 +00:00
snipe
e589adbe80 Updated model route
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 13:31:09 +00:00
snipe
0501c5f53c Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 11:15:03 +00:00
snipe
6a9247ba8a Cast token policies to int
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 11:14:49 +00:00
snipe
fcf84bf63f Fixed test namespace
Signed-off-by: snipe <snipe@snipe.net>
2025-02-24 11:09:54 +00:00
snipe
cebb9d034c Merge pull request #16305 from snipe/bug/sc-28425
Fixed #16262 - Check for quantity before allowing component deletion
2025-02-23 14:17:36 +00:00
snipe
dd2b570db5 Added tighter constraints on deleting components
Signed-off-by: snipe <snipe@snipe.net>
2025-02-23 14:11:39 +00:00
snipe
2bee4532ec Added qty error string
Signed-off-by: snipe <snipe@snipe.net>
2025-02-23 13:21:58 +00:00
snipe
96248e0023 Removed soft delete from test
Signed-off-by: snipe <snipe@snipe.net>
2025-02-23 13:21:49 +00:00
snipe
157801242d Added API test, renamed test to match filter
Signed-off-by: snipe <snipe@snipe.net>
2025-02-23 13:21:36 +00:00
snipe
7b151cf692 Added test
Signed-off-by: snipe <snipe@snipe.net>
2025-02-23 13:17:20 +00:00
snipe
50c88df4cc Merge pull request #16304 from snipe/security/snyk-updates-less-papaparse
Updated less and papaparse
2025-02-23 12:51:38 +00:00
snipe
d87a6868cc Updated less and papaparse
Signed-off-by: snipe <snipe@snipe.net>
2025-02-23 12:50:09 +00:00
snipe
201f487853 Merge pull request #16303 from snipe/chore/sc-28493
Added tooltip for currency in table
2025-02-23 12:21:04 +00:00
snipe
069860d65f Added tooltip for currency in table
Signed-off-by: snipe <snipe@snipe.net>
2025-02-23 12:19:18 +00:00
snipe
afa7391080 Merge pull request #16299 from snipe/added_checkin_checkout_indicator_for_custom_fields
Added checkin/checkout indicators on custom field table
2025-02-22 19:34:04 +00:00
snipe
07cf203018 Add checkin/checkout indicators on custom field table
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 19:32:34 +00:00
snipe
5f561452d2 Merge pull request #16298 from uberbrady/tooltips_custom_fields
Add tooltips to custom fields display, especially for icons
2025-02-22 19:17:28 +00:00
Brady Wetherington
cbe04e8514 Add tooltips to custom fields display, especially for icons 2025-02-22 19:13:09 +00:00
snipe
9b44dfd9b6 Merge pull request #16297 from snipe/add_field_to_checkin_checkout
Fixed #6188 - Added custom fields to checkin/checkout screens
2025-02-22 19:09:51 +00:00
snipe
9abf3029ef Compact the method just a little
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 19:02:41 +00:00
snipe
19fb45f488 Refactor into method
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:57:18 +00:00
snipe
e983ee4d0f Tweaked icon position
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:47:12 +00:00
snipe
40acd48eff Tweaked some style
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:19:09 +00:00
snipe
f5eedb8d23 Added RMB and include $item so the asset fields are populated
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:13:12 +00:00
snipe
172df0d220 Save new custom field values
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:12:46 +00:00
snipe
c611cb5612 Updated loggable to check for custom fields that were passed for meta
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:12:30 +00:00
snipe
da77ddd447 Added fields to custom field edit form
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:11:56 +00:00
snipe
c727633e6b Added language strings
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:11:42 +00:00
snipe
10834cf638 Added migration
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:11:35 +00:00
snipe
42eda089e2 Added include for custom fields partial
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:11:27 +00:00
snipe
2434c82a75 Added if/else for custom fields model partial
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:11:04 +00:00
snipe
1b9d046f5f Fixed test for RMB
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:08:25 +00:00
snipe
a0a0727b5c Corrected route breadcrumbs
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 18:08:13 +00:00
snipe
917b9f0293 Merge pull request #16296 from snipe/added_select_unselect_tooltip_to_presenters
Added select/unselect tooltip to presenters, added translation
2025-02-22 14:32:04 +00:00
snipe
bb70250007 Added select/unselect tooltip to presenters, added translation
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 14:30:49 +00:00
snipe
346aeeda71 Merge pull request #16287 from uberbrady/better_hover_titles
Fixes: [sc-28423] Better tooltips on lists, Bootstrap style
2025-02-22 14:24:02 +00:00
snipe
84a29378cd Merge pull request #16295 from snipe/#16282_adds_accessories_tab_to_assets
Fixed #16282 - adds accessories tab to assets
2025-02-22 14:21:32 +00:00
snipe
0cd0abe8bb Fixed #16282 - adds accessories tab to assets
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 14:20:21 +00:00
snipe
7db11dc12b Merge pull request #16277 from Godmartinz/bulk_delete_asset_bug
Fixes deletion of assigned assets through bulk delete
2025-02-22 12:59:37 +00:00
snipe
e0221301ff Increased text limit on notes
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 12:56:25 +00:00
snipe
b0fa059a28 Merge pull request #16285 from marcusmoore/bug/sc-28148
Re-added ability to add notes to assets
2025-02-22 12:55:18 +00:00
snipe
3fb00a9fa9 Merge pull request #16293 from uberbrady/fix_default_docker_image
Updated default Dockerfile to handle newer PHP versions
2025-02-22 12:52:37 +00:00
snipe
3ef8b047ba Merge pull request #16294 from snipe/bug/sc-28474
Don’t delete avatar file on soft-delete
2025-02-22 12:52:18 +00:00
snipe
7a77de6ffe Don’t delete avatar file on soft-delete
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 12:49:04 +00:00
Brady Wetherington
5e85891b10 Updated default Dockerfile to handle newer PHP versions 2025-02-22 12:43:30 +00:00
snipe
934da0f630 Merge pull request #16291 from uberbrady/fix_tests_and_migrations_v8
Fix tests and fix migrations to always explicitly include nullable()
2025-02-22 12:21:56 +00:00
snipe
cca46ea9e0 Merge pull request #16292 from snipe/add_email_list_assigned_to_bulk
Added ability to send user inventory via bulk UI
2025-02-22 12:20:01 +00:00
snipe
bde034593b Updateed string
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 12:17:04 +00:00
Brady Wetherington
7e1295bac7 Fix tests and fix migrations to always explicitly include nullable() 2025-02-22 12:15:12 +00:00
snipe
d1cc0fcfac Added ability to send user inventory via bulk UI
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 12:07:54 +00:00
snipe
056fbefb16 Merge pull request #16290 from snipe/update_php_versions_for_tests
Removed php 8.1, added 8.4
2025-02-22 11:11:53 +00:00
snipe
83a848980f Removed php 8.1, added 8.4
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 11:11:01 +00:00
snipe
7b930357e4 Cast years to int
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 10:51:27 +00:00
snipe
bdab052f40 Fixed test name
Signed-off-by: snipe <snipe@snipe.net>
2025-02-22 10:51:16 +00:00
Brady Wetherington
2d1e9b237f Better tooltips on list views, in Bootstrap style 2025-02-21 13:23:19 +00:00
Brady Wetherington
1cff49116e Bump version numbers and upgrade requirements 2025-02-21 11:49:25 +00:00
Brady Wetherington
38c5f23a52 Merge branch 'v8' into develop 2025-02-21 11:15:44 +00:00
Marcus Moore
c6bee0c47a Fix test 2025-02-20 13:24:01 -08:00
Marcus Moore
ae7d7f7d22 Merge branch 'develop' into bug/sc-28148
# Conflicts:
#	routes/web.php
2025-02-20 13:23:55 -08:00
Marcus Moore
96ab828cec Fix indent 2025-02-20 13:05:42 -08:00
Marcus Moore
43f679a554 Revert some changes from #15525 2025-02-20 12:59:16 -08:00
Marcus Moore
f1bf9fcf5c Implement test 2025-02-20 12:51:08 -08:00
Marcus Moore
992b4c7d86 Remove old comment 2025-02-20 12:50:03 -08:00
Marcus Moore
39bb2c2adb Implement tests 2025-02-20 12:49:58 -08:00
Marcus Moore
41129829e6 Add frontend required validation 2025-02-20 12:43:51 -08:00
Marcus Moore
44503fc423 Use translation 2025-02-20 12:41:56 -08:00
Marcus Moore
0190ccea27 Finish implementing test 2025-02-20 12:40:05 -08:00
snipe
5b63eb5a15 Merge pull request #16272 from snipe/experiments/breadcrumbs
Experimental WIP - added breadcrumbs, route model binding for resource routes
2025-02-20 19:21:58 +00:00
snipe
54cc427ef5 Updated tests for new RMB behavior
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 18:28:46 +00:00
snipe
e0beed0fa3 Reapplied accessory gate
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 18:28:01 +00:00
snipe
d4b24e5e57 Exception handler exceptions - exception inception!
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 18:27:45 +00:00
snipe
671b64bc6b Fixed RMB for kits and fields
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 15:01:17 +00:00
snipe
75db0d9e66 Fixed parameter for audit
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 15:00:57 +00:00
snipe
b891992351 Nice language for audit/checkin screens accounting for null
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 15:00:35 +00:00
snipe
ddb72bf4d0 Added breadcrumbs to licenses routes
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 15:00:08 +00:00
snipe
6f071722a2 Fixed kit crimbs
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 14:59:50 +00:00
snipe
be9bd93588 More crombs, removed scan route that we don’t use
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 14:59:10 +00:00
snipe
44a7bdbfb5 Moved SAML gui settings routes to web.php
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 14:58:17 +00:00
snipe
0341335d14 Additional crombs
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 14:57:48 +00:00
snipe
76f038d142 RMB for custom fields
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 14:57:18 +00:00
snipe
3150ad50c9 RMB for audits
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 14:57:07 +00:00
snipe
80394ef788 Revert delete because route model binding + resources routes + soft deletes = sux0r
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 12:29:37 +00:00
snipe
8a70f09dd3 Temp “fix” RMB for soft-deleted users
Signed-off-by: snipe <snipe@snipe.net>
2025-02-20 12:19:31 +00:00
Godfrey M
a275391557 adds test for deleting assigned asset 2025-02-19 15:59:57 -08:00
Godfrey M
eaacf29d57 fix tests 2025-02-19 15:11:16 -08:00
snipe
441fdaa54a Merge pull request #16278 from marcusmoore/bug/sc-27234
Added better error handling around rendering barcodes
2025-02-19 20:54:24 +00:00
Marcus Moore
759c8c8f5c Catch TypeError in addition to Exceptions when rendering barcodes 2025-02-19 12:36:50 -08:00
snipe
6242296930 Remove the “View” part of the breadcrumb
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 19:30:13 +00:00
snipe
d330ef9919 Added crumbs and RMB for custom fields
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 18:23:16 +00:00
snipe
0708af7d07 Made the help ring slightly less goofy looking
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 18:22:50 +00:00
Godfrey M
a534b488b2 prevents deletion of assigned assets in bulk deletion 2025-02-19 10:09:02 -08:00
snipe
3171c1b1c9 Added breadcrumbs for bulkaudit, requested, and import history
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 17:40:47 +00:00
snipe
2f2b879d98 Language refinement
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 17:40:12 +00:00
snipe
039f483ec8 Check for notes and cost before displaying them
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 16:57:24 +00:00
snipe
7f665e0005 De-uglifying the maintenances detail page
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 16:34:48 +00:00
snipe
292819afa5 Added maintenances crumbs
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:29:06 +00:00
snipe
7a94b09017 Use MLB for kit group
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:07:14 +00:00
snipe
6b46d12d67 Added breadcrumbs on kits (sort of)
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:05:29 +00:00
snipe
e264907157 Added breadcrumbs on more web routes
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:05:12 +00:00
snipe
32b89e937c Fixed routes
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:04:56 +00:00
snipe
0e1dc8745c Wider custom report
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:04:45 +00:00
snipe
129d44cc70 Made icon possible for dashboard/home
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:04:34 +00:00
snipe
11b746d801 UI tweak
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:04:19 +00:00
snipe
545445d584 Updated strings
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:04:07 +00:00
snipe
4d72fd8667 Added additional resource crumbs
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:03:53 +00:00
snipe
fca62a14f9 Fixed asset presenter to link to the company directly
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:03:29 +00:00
snipe
c8f2d9806a Use route model binding on kits
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:03:15 +00:00
snipe
1ee5f28fca Added angle-right and house icon
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 14:02:59 +00:00
snipe
24a17b09a5 Fixed a few more tests and strings
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 09:03:41 +00:00
snipe
a617c0545e WIP license checkin
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 08:39:25 +00:00
snipe
eb7e24eeb0 Asset checkout with route model binding
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 08:39:16 +00:00
snipe
22c58678c4 License checkout controller with route model binding
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 08:38:55 +00:00
snipe
4beaf6b3ec Added item
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 08:38:40 +00:00
snipe
4c1856b91f Fixed wonky quote in HTML
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 08:37:58 +00:00
snipe
9d299340da Checkout license modifications (this doesn’t work yet
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 08:37:39 +00:00
snipe
457228d033 Route model binding on more asset methods
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 08:37:06 +00:00
snipe
63f4e3cc89 More breadcrumbs
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 08:36:52 +00:00
snipe
cd7135ea77 More test fixes
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 06:19:50 +00:00
snipe
347eb2bdee Fixed route parameters and tests to match
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 05:03:56 +00:00
snipe
ecc0e76e7b Fixed route parameters for helper
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 05:03:39 +00:00
snipe
35a89de6dd Fixed handler for reports
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 05:03:26 +00:00
snipe
82d8e1b0a9 Added item back into edit
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 04:18:57 +00:00
snipe
5a7ffa5664 Sure, whatever I guess.
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 04:18:40 +00:00
snipe
55abd242f2 Don’t know why I need to compact this?
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 04:07:09 +00:00
snipe
217d65f64c More changes to the error message formatting
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 03:47:51 +00:00
snipe
fa20eb4965 Add exception for hardware vs assets :(
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 03:41:01 +00:00
snipe
560311b883 Added ->with(‘item’) back in
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 03:37:34 +00:00
snipe
3954ff20b4 More tweaks to the controllers, more breadcrumbs
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 03:29:31 +00:00
snipe
989082d719 Handle the not found errors with route model binding
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 03:26:44 +00:00
snipe
644527c5a6 More resources to breadcrumb provider
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 02:49:21 +00:00
snipe
f7d213052a Route model binding for resource groups
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 02:49:05 +00:00
snipe
972bd1ef83 Tinkering with routes for breadcrumbs
Signed-off-by: snipe <snipe@snipe.net>
2025-02-19 00:37:09 +00:00
Marcus Moore
cf0ce1c5ea Start to implement tests 2025-02-18 16:24:52 -08:00
Marcus Moore
3d69721af0 Scaffold tests 2025-02-18 16:16:00 -08:00
Marcus Moore
1995e1399e Start recording ip, user agent, and source 2025-02-18 16:04:53 -08:00
Marcus Moore
79d1147f20 Add validation 2025-02-18 15:46:52 -08:00
Marcus Moore
53c084c6c0 WIP: begin to store notes 2025-02-18 15:43:58 -08:00
Marcus Moore
c165e6f400 Formatting 2025-02-18 15:20:22 -08:00
Marcus Moore
25215fd3c9 WIP: begin migrating notes to ui controller 2025-02-18 15:20:06 -08:00
Brady Wetherington
a8231bc338 Merge branch 'develop' into v8 2025-02-18 22:40:27 +00:00
snipe
4d25e8f7f0 Merge pull request #16271 from snipe/localization/2024-02-18
Updated language strings
2025-02-18 22:26:02 +00:00
snipe
8368576dc9 Updated language strings
Signed-off-by: snipe <snipe@snipe.net>
2025-02-18 22:18:39 +00:00
snipe
071b4d1e67 Merge pull request #16245 from marcusmoore/chore/migrate-form-open-pt5
Replace Form::open and Form::close pt5
2025-02-18 21:23:15 +00:00
snipe
1fe170e6a1 Merge pull request #16040 from Godmartinz/template_validate_error
Adds a null check to label templates, adds return types for validation methods
2025-02-18 21:00:10 +00:00
snipe
612a708c8d Merge pull request #16246 from marcusmoore/chore/migrate-form-open-pt6
Replace Form::open and Form::close pt6
2025-02-18 20:43:38 +00:00
snipe
580a4c476e Merge pull request #16244 from marcusmoore/chore/migrate-form-open-pt4
Replace Form::open and Form::close pt4
2025-02-18 20:42:44 +00:00
snipe
c9de9ebbab Merge pull request #16243 from marcusmoore/chore/migrate-form-open-pt3
Replace Form::open and Form::close pt3
2025-02-18 20:41:56 +00:00
snipe
3d0770973a Merge pull request #16242 from marcusmoore/chore/migrate-form-open-pt2
Replace Form::open and Form::close pt2
2025-02-18 20:41:16 +00:00
snipe
e814cd5a9e Merge pull request #16235 from marcusmoore/chore/migrate-form-open-pt1
Replace Form::open and Form::close pt1
2025-02-18 20:23:47 +00:00
Marcus Moore
e5f426ec64 Remove unneeded multipart/form-data 2025-02-18 12:19:32 -08:00
snipe
a1b0a30351 Merge pull request #16225 from marcusmoore/chore/remove-cols-from-textarea
Removed cols property from textarea component
2025-02-18 19:56:40 +00:00
snipe
c0f0f43dd7 Merge pull request #16188 from Godmartinz/translations-for-labels-n-ldap
Adds translations to LDAP  and Label settings pages
2025-02-18 19:56:14 +00:00
snipe
57c07a3687 Merge pull request #16270 from snipe/feature/sc-28365_ldap_text_update
Updated LDAP sync text
2025-02-18 19:28:18 +00:00
snipe
6de08f46fd Few more tweaks
Signed-off-by: snipe <snipe@snipe.net>
2025-02-18 19:26:36 +00:00
snipe
3554270366 Updated LDAP sync text
Signed-off-by: snipe <snipe@snipe.net>
2025-02-18 19:25:40 +00:00
snipe
029450bcbf Merge pull request #16269 from snipe/bug/sc-28437_fix
Scope API results by location ID
2025-02-18 19:05:29 +00:00
snipe
329fbf6a7c Scope results by location ID
Signed-off-by: snipe <snipe@snipe.net>
2025-02-18 19:01:16 +00:00
snipe
b7d0fccabc Merge pull request #16268 from snipe/fixed_16259_archived_assets_in_company_scope
Fixed #16259 - mismatch in asset count if archived assets are hidden
2025-02-18 16:35:01 +00:00
snipe
48ab94c15b Fixed query duplication for AssetsForShow scope
Signed-off-by: snipe <snipe@snipe.net>
2025-02-18 16:18:12 +00:00
snipe
ac907add83 Merge pull request #16082 from marcusmoore/chore/sc-28173
Replace calls to Form::text
2025-02-18 14:58:40 +00:00
snipe
3d47a8ba50 Fixed name format tests (#16236)
Signed-off-by: snipe <snipe@snipe.net>
2025-02-18 14:52:52 +00:00
snipe
452185be45 Merge pull request #16199 from akemidx/feature/sc-28271
Adding <Last Name.First Initial> as an option for usernames
2025-02-18 14:42:54 +00:00
Brady Wetherington
14feed61d8 Merge branch 'develop' into v8 2025-02-17 16:18:02 +00:00
snipe
02a8e17704 Merge pull request #16260 from snipe/fix_for_qr_on_old_label_engine
Fix for QR code on old label engine
2025-02-17 10:45:51 +00:00
snipe
7553ec3e27 Fixed equals
Signed-off-by: snipe <snipe@snipe.net>
2025-02-17 10:44:58 +00:00
Godfrey M
4c43a06eee add overdue asset to test 2025-02-13 11:19:49 -08:00
Godfrey M
25c8449e86 remove unused 2025-02-13 11:14:18 -08:00
Godfrey M
13e1f4a127 adds mailable 2025-02-13 11:09:39 -08:00
Godfrey M
ed96fd766c refactors audit notification to mail, adds test, ads check to scheduler 2025-02-13 11:08:53 -08:00
snipe
c8f82cbc2b Merge pull request #16250 from uberbrady/improve_tls_client_side_file_caching
Instead of saving TLS cache-files on save, cache them when used
2025-02-13 15:46:22 +00:00
Brady Wetherington
b7bd56daf7 Instead of saving TLS cache-files on save, cache them when used 2025-02-13 15:09:28 +00:00
snipe
393118f083 Merge pull request #16249 from snipe/flatten_api_return
Return flat JSON instead of transformed data
2025-02-13 14:28:41 +00:00
snipe
d3210c6d40 Return flat JSON instead of transformed data
Signed-off-by: snipe <snipe@snipe.net>
2025-02-13 14:16:32 +00:00
Marcus Moore
60d7232569 Remove unneeded Form::close from users index 2025-02-12 13:50:38 -08:00
Marcus Moore
2f1212fa1a Remove unneeded Form::close on view status label page 2025-02-12 13:49:37 -08:00
Marcus Moore
cc4d8f2a5b Migrate Form::close on security settings page 2025-02-12 13:47:15 -08:00
Marcus Moore
c0a3284fad Migrate Form::open and Form::close on saml settings 2025-02-12 13:46:42 -08:00
Marcus Moore
caff608e3c Migrate Form::open and Form::close on purge deleted records page 2025-02-12 13:41:44 -08:00
Marcus Moore
c48fa7c2cb Migrate Form::open and Form::close on localization page 2025-02-12 13:39:04 -08:00
Marcus Moore
14b25949b8 Migrate Form::close on ldap settings page 2025-02-12 13:36:48 -08:00
Marcus Moore
2df995c2c7 Remove unneeded Form::open on label settings page 2025-02-12 13:29:02 -08:00
Marcus Moore
ad182a96fa Migrate Form::open and Form::close on label settings 2025-02-12 13:28:40 -08:00
Marcus Moore
a728f38bd1 Migrate Form::open and Form::close on google settings page 2025-02-12 13:21:07 -08:00
Marcus Moore
894754e8dc Migrate Form::close on general settings page 2025-02-12 13:18:55 -08:00
Marcus Moore
d141675478 Migrate Form::open and Form::close on branding settings pagee 2025-02-12 13:17:59 -08:00
Marcus Moore
8bdd80e236 Migrate Form::open and Form::close on backups page 2025-02-12 13:12:45 -08:00
Marcus Moore
c422737525 Migrate Form::open and Form::close on asset tag settings page 2025-02-12 13:11:06 -08:00
Marcus Moore
fc55786ca2 Migrate Form::close on notification settings page 2025-02-12 12:50:37 -08:00
Marcus Moore
2949fdecdd Migrate Form::open and Form::close on unaccepted assets report page 2025-02-12 12:49:19 -08:00
Marcus Moore
d32163f881 Migrate Form::open and Form::close on custom report page 2025-02-12 12:43:51 -08:00
Marcus Moore
215fe501ac Migrate Form::open and Form::close on activity report page 2025-02-12 12:14:00 -08:00
Marcus Moore
ef3112e526 Add missing @csrf 2025-02-12 12:11:36 -08:00
Marcus Moore
8aa0135afa Migrate Form::open and Form::close in bulk users partial 2025-02-12 12:10:16 -08:00
snipe
ff1157a95e Merge pull request #16232 from Godmartinz/adds-expiring-notifications
Expiration notifcation switched to use Mailable
2025-02-12 20:07:24 +00:00
Godfrey M
e66b690c93 removed unnecessary base_path changes 2025-02-12 12:01:43 -08:00
Godfrey M
242fd00e8a remove commented dd 2025-02-12 11:55:28 -08:00
Godfrey M
c77a1faa69 moar unnecssary changes removed 2025-02-12 11:54:34 -08:00
Marcus Moore
540b609591 Migrate Form::open and Form::close in models bulk actions partial 2025-02-12 11:53:23 -08:00
Marcus Moore
ac5a409cdf Migrate Form::open and Form::close in locations bulk actions partial 2025-02-12 11:51:17 -08:00
Godfrey M
4cbc751dad removed unnecessary changes 2025-02-12 11:49:36 -08:00
Marcus Moore
1dc579ce71 Migrate Form::open and Form::close in asset bulk actions partial 2025-02-12 11:49:13 -08:00
Marcus Moore
37282fffff Remove unneeded Form::close on model show page 2025-02-12 11:45:09 -08:00
Marcus Moore
b3e98cb7eb Remove unneeded Form::close on model index page 2025-02-12 11:44:14 -08:00
Godfrey M
bd03d70937 adds test for expiring licenses 2025-02-12 11:43:22 -08:00
Marcus Moore
716161e626 Migrate Form::open and Form::close in upload file modal 2025-02-12 11:42:09 -08:00
Marcus Moore
93a67847ba Migrate Form::open and Form::close on asset view 2025-02-12 11:38:19 -08:00
Godfrey M
6873244e7e adds test for expiring asset notifications 2025-02-12 11:28:36 -08:00
Marcus Moore
c569a84f87 Migrate Form::open and Form::close on requested assets page 2025-02-12 10:52:32 -08:00
akemidx
1e07927e78 test created and passing 2025-02-11 19:35:55 -05:00
Marcus Moore
c4b8b85602 Migrate Form::open and Form::close on bulk audit page 2025-02-11 15:42:20 -08:00
Marcus Moore
464e4d11e9 Migrate Form::open and Form::close on quick scan checkin page 2025-02-11 14:24:38 -08:00
Marcus Moore
85e4a19f03 Migrate Form::open on asset audit page 2025-02-11 14:22:17 -08:00
Marcus Moore
6263d01c73 Migrate Form::close in previously changed views 2025-02-11 14:10:52 -08:00
Marcus Moore
967e646989 Migrate Form::open in depreciations view 2025-02-11 14:10:52 -08:00
Marcus Moore
e9d3b9dcde Migrate Form::open and Form::close in manage custom fields view 2025-02-11 14:10:52 -08:00
Marcus Moore
3065ba851e Migrate Form::open in custom fieldset view 2025-02-11 14:10:52 -08:00
Marcus Moore
80522a2505 Migrate Form::open in custom field view 2025-02-11 14:10:52 -08:00
Marcus Moore
532e6c1c1d Migrate Form::open in profile view 2025-02-11 14:10:52 -08:00
Marcus Moore
5cf314a314 Migrate Form::open in change password view 2025-02-11 14:10:52 -08:00
snipe
c08cfb9b73 Merge pull request #16226 from snipe/add_notes_to_locations_companies_etc
Fixed #16184 - added notes to locations, companies, categories, manufacturers and groups
2025-02-11 19:25:10 +00:00
snipe
61591633f8 Fixed layout sorta
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 19:23:04 +00:00
Godfrey M
9b5b58687d removed unused 2025-02-11 11:02:25 -08:00
Godfrey M
fb7bec4be4 adds expiring asset and license mail 2025-02-11 10:55:56 -08:00
snipe
9dba03646b Pointless rename
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 18:32:51 +00:00
snipe
ddd2ce07f3 Fixed branch from weird merge down
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 01:14:35 +00:00
snipe
3de5f5882c Added/updated tests
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 01:07:41 +00:00
Marcus Moore
73e010434e Remove cols property 2025-02-10 16:43:39 -08:00
snipe
a9d6a5f618 Updated note partial to use generic notes text
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:39:46 +00:00
snipe
ef9cc4fceb Added notes to blades
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:39:26 +00:00
snipe
e104decf77 Added placeholder translation array
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:35:03 +00:00
snipe
96e38da875 Created migration
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:34:50 +00:00
snipe
ff95049f7c Added notes to factories
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:34:30 +00:00
snipe
63cb4e70bc Added notes to presenters
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:34:10 +00:00
snipe
e6ae9cae6b Added notes to searchable and fillable attributes
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:33:51 +00:00
snipe
1f1e1401cf Added location notes to importer
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:32:58 +00:00
snipe
af1159658d Added notes to transformers
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:32:37 +00:00
snipe
4e2b22135a Added notes to UI controllers
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:32:07 +00:00
snipe
4ee5a4c5c3 Added notes to API controllers
Signed-off-by: snipe <snipe@snipe.net>
2025-02-11 00:31:50 +00:00
snipe
aa14cfe18d Merge pull request #16075 from marcusmoore/chore/migrate-textarea-helper
Convert Form::textarea to blade component
2025-02-11 00:14:23 +00:00
Marcus Moore
0797c4ac97 Merge branch 'develop' into chore/sc-28173
# Conflicts:
#	resources/views/settings/saml.blade.php
#	resources/views/settings/security.blade.php
#	resources/views/setup/user.blade.php
2025-02-10 15:57:41 -08:00
snipe
b4ea75f34f Merge branch 'master' into chore/migrate-textarea-helper 2025-02-10 23:47:13 +00:00
snipe
e37a990820 Merge remote-tracking branch 'origin/develop' 2025-02-10 22:42:58 +00:00
snipe
b54d68ebf1 Merge pull request #16212 from Godmartinz/ternary-checks-on-location-in-notifications
adds ternaries on check in/out hardware notifications
2025-02-10 22:28:36 +00:00
snipe
4ae2126ded Merge pull request #16213 from marcusmoore/chore/migrate-checkbox-helpers-p1
Replace calls to Form::checkbox pt1
2025-02-10 22:27:19 +00:00
snipe
c420670ebb Small fixes to accessories files handling
Signed-off-by: snipe <snipe@snipe.net>
2025-02-10 22:26:00 +00:00
Brady Wetherington
dae1f43359 Merge branch 'develop' into v8 2025-02-10 15:14:55 +00:00
Marcus Moore
77635c3737 Migrate Form::checkboxes on license edit view 2025-02-06 17:05:35 -08:00
Marcus Moore
b937b7e767 Migrate Form::checkboxes on asset history import page 2025-02-06 17:01:09 -08:00
Marcus Moore
38df5e8b07 Replace more Form::checkboxes 2025-02-06 15:52:23 -08:00
akemidx
d1cd670af5 oop forgot the user form bit 2025-02-06 18:05:22 -05:00
Marcus Moore
04e4b6c181 Replace Form::checkbox 2025-02-06 14:16:18 -08:00
Marcus Moore
9559c5a025 Replace Form::checkbox and inline label 2025-02-06 14:08:13 -08:00
Marcus Moore
42fa2e12db Replace Form::checkbox 2025-02-06 13:55:33 -08:00
Godfrey M
f41583fd59 adds ternary checks on locations before pulling names in notifications 2025-02-06 11:34:14 -08:00
snipe
b48704b3af Merge pull request #16209 from uberbrady/eliminate_preg_split_deprecation_warnings
Fixed #16208 - don't call preg_split() with a null
2025-02-06 13:30:53 +00:00
Brady Wetherington
de3ebfecfe Ensure we don't call preg_split() with a null as the second parameter 2025-02-06 13:24:39 +00:00
snipe
29311b1b5b Merge remote-tracking branch 'origin/develop' 2025-02-06 10:34:58 +00:00
snipe
b131227b71 Merge pull request #16207 from snipe/security/upgrade_papaparse
Upgraded papaparse to 5.5.1
2025-02-06 10:34:29 +00:00
snipe
ec45833cd8 Upgraded papaparse to 5.5.1
Signed-off-by: snipe <snipe@snipe.net>
2025-02-06 10:22:17 +00:00
snipe
4c2905b1f0 Merge pull request #16176 from marcusmoore/chore/migrate-form-radio
Replaced some calls to the Form::radio helper
2025-02-06 10:19:51 +00:00
snipe
6e51be6c57 Merge pull request #16178 from marcusmoore/chore/migrate-form-radio-helpers-pt1
Replaced calls to Form::radio helper on group create and edit pages
2025-02-06 10:19:35 +00:00
snipe
b195168c83 Merge pull request #16167 from Godmartinz/asset_controller_qr_check_fix
Adds qr code type check in getQRCode method
2025-02-06 10:18:34 +00:00
snipe
a722eca6aa Merge pull request #16179 from marcusmoore/chore/migrate-form-radio-helpers-bulk-hardware
Replaced calls to Form::radio helper on bulk hardware edit page
2025-02-06 10:18:16 +00:00
snipe
1f6428ee1c Merge pull request #16180 from marcusmoore/chore/migrate-form-radio-helpers-bulk-models
Replaced calls to Form::radio helper on bulk asset model edit page
2025-02-06 10:18:05 +00:00
snipe
ab10fb466c Merge pull request #16193 from marcusmoore/chore/migrate-label-helpers-pt3
Replace calls to Form::label pt3
2025-02-06 10:17:26 +00:00
snipe
dcabf90409 Merge pull request #16192 from marcusmoore/chore/migrate-label-helpers-pt2
Replace calls to Form::label pt2
2025-02-06 10:17:11 +00:00
snipe
27752f595c Merge pull request #16194 from marcusmoore/chore/migrate-label-helpers-pt4
Replace calls to Form::label pt4
2025-02-06 10:16:33 +00:00
snipe
c17598d4b4 Merge pull request #16195 from marcusmoore/chore/migrate-label-helpers-pt5
Replace calls to Form::label pt5
2025-02-06 10:16:17 +00:00
snipe
d74d9900da Merge pull request #16190 from marcusmoore/chore/migrate-label-helpers-pt1
Replace calls to Form::label pt1
2025-02-06 10:15:43 +00:00
snipe
5505c9ab67 Merge pull request #16196 from marcusmoore/chore/migrate-label-helpers-pt6
Replace calls to Form::label pt6
2025-02-06 10:14:55 +00:00
snipe
8d2ffea7df Merge pull request #16197 from marcusmoore/chore/migrate-label-helpers-pt7
Replace calls to Form::label in QuickStart
2025-02-06 10:06:41 +00:00
snipe
1233c939f8 Merge branch 'develop' into chore/migrate-label-helpers-pt7 2025-02-06 10:03:42 +00:00
snipe
46dd83c34e Merge pull request #16168 from Godmartinz/print_all_assigned_location_null_check
Added ternary check that asset has `asset status` before checking archived
2025-02-06 10:01:10 +00:00
snipe
639aa85353 Merge pull request #16198 from marcusmoore/chore/migrate-email-helpers
Replace call to Form::email
2025-02-06 09:57:53 +00:00
akemidx
008b6f1db2 lastname.first initial 2025-02-05 20:11:33 -05:00
Marcus Moore
f46ad4811e Migrate form email helper on user setup page 2025-02-05 16:44:09 -08:00
Marcus Moore
b39b24e6b9 Migrate form labels on user setup 2025-02-05 15:01:51 -08:00
Marcus Moore
7f0133a4d6 Migrate form labels on create supplier page 2025-02-05 14:42:07 -08:00
Marcus Moore
85bc8bc8f0 Migrate form label on create status label page 2025-02-05 14:40:20 -08:00
Marcus Moore
32e1d4b2ef Migrate form labels on security settings page 2025-02-05 14:39:16 -08:00
Marcus Moore
f8d5af836f Migrate form labels on saml settings page 2025-02-05 14:35:53 -08:00
Marcus Moore
19ceb3f5b7 Migrate form label on purge page 2025-02-05 14:29:49 -08:00
Marcus Moore
f346c55cf1 Migrate form labels on localization settings page 2025-02-05 14:29:49 -08:00
Marcus Moore
e797705dad Migrate form labels on google settings page 2025-02-05 14:29:49 -08:00
Marcus Moore
a331e14ef2 Migrate form labels on general settings page 2025-02-05 14:19:34 -08:00
Marcus Moore
d6b4c27302 Migrate form label on branding settings page 2025-02-05 14:14:50 -08:00
Marcus Moore
f8d7291923 Migrate form labels on asset tag settings page 2025-02-05 14:11:36 -08:00
Marcus Moore
b59674ab77 Migrate form labels on settings alert page 2025-02-05 13:48:50 -08:00
Marcus Moore
0620b8b163 Migrate form label in checkout select partial 2025-02-05 13:44:00 -08:00
Marcus Moore
f639d82693 Migrate form label in user select partial 2025-02-05 13:40:27 -08:00
Marcus Moore
13d2d41f0c Migrate form label in supplier select partial 2025-02-05 13:39:03 -08:00
Marcus Moore
015cd44136 Migrate form label in status select partial 2025-02-05 13:34:07 -08:00
Marcus Moore
4834f60a44 Migrate form label in phone input partial 2025-02-05 13:32:06 -08:00
Marcus Moore
3327e1d8f2 Migrate form label in asset model select partial 2025-02-05 13:30:14 -08:00
Marcus Moore
40e002911c Migrate form label in manufacturer select partial 2025-02-05 13:29:06 -08:00
Marcus Moore
03bcc3b73f Migrate form label in location select partial 2025-02-05 13:27:29 -08:00
Marcus Moore
f963df0658 Migrate form label in location profile select partial 2025-02-05 13:26:08 -08:00
Marcus Moore
0aa77d281f Replace calls to Form::label in license-select partial 2025-02-05 13:24:02 -08:00
Marcus Moore
0988255693 Replace calls to Form::label in (unused?) kit select 2025-02-05 13:23:10 -08:00
Marcus Moore
fb9e7cf5e1 Migrate form label in fax input partial 2025-02-05 13:19:22 -08:00
Marcus Moore
ecc1bd69b9 Migrate form label in department select partial 2025-02-05 13:19:16 -08:00
Marcus Moore
830f095a6e Migrate form label in datepicker partial 2025-02-05 13:16:28 -08:00
Marcus Moore
288f7e4e93 Migrate form label on consumable select 2025-02-05 13:12:52 -08:00
Marcus Moore
a205ae12a4 Migrate form label on (unsed?) company select partial 2025-02-05 13:11:49 -08:00
Marcus Moore
1866426f11 Migrate form label in category select partial 2025-02-05 13:02:36 -08:00
Marcus Moore
e4ab6c0c24 Migrate form label on asset select partial 2025-02-05 12:59:00 -08:00
Marcus Moore
189c148761 Migrate labels on address partial 2025-02-05 12:47:06 -08:00
Marcus Moore
8b7c1a195c Migrate label on accessory select partial 2025-02-05 12:41:35 -08:00
Marcus Moore
d77547aecf Migrate labels on slack component 2025-02-05 12:40:00 -08:00
Marcus Moore
478a5c0e1a Migrate labels on bulk audit pag 2025-02-05 12:12:43 -08:00
Marcus Moore
5c6757ecf6 Migrate labels on quick checkin page 2025-02-05 12:07:17 -08:00
Godfrey M
f2981cf12b adds translations to label settings 2025-02-05 10:55:05 -08:00
Godfrey M
c3310a0772 adds translations to LDAP settings page 2025-02-05 10:38:16 -08:00
Marcus Moore
fe485acd4a Swap Form::radio in bulk model edit view 2025-02-04 16:18:49 -08:00
Marcus Moore
fbe19738cb Swap Form::radio in bulk hardware edit view 2025-02-04 15:49:46 -08:00
Marcus Moore
d29a62a335 Simplify @checked 2025-02-04 13:50:08 -08:00
snipe
6cc2013102 Merge remote-tracking branch 'origin/develop' 2025-02-04 21:39:27 +00:00
snipe
39ce7b75ca Merge pull request #16175 from Godmartinz/channel-not-found-warning-added 2025-02-04 21:38:15 +00:00
Marcus Moore
f3959323ff Add required attribute to name field 2025-02-04 13:33:16 -08:00
Marcus Moore
0d62ab2ad4 Fix call to @checked 2025-02-04 13:31:28 -08:00
Godfrey M
cbf9239d86 adds channel not found warning 2025-02-04 11:21:56 -08:00
Marcus Moore
295875c45e Fix and replace remaining radios on bulk user edit page 2025-02-04 11:02:40 -08:00
snipe
5e363f7dd4 Merge pull request #16166 from Godmartinz/rollbar_none-qr-code 2025-02-04 16:16:00 +00:00
Godfrey M
6bb0927f26 remove unrelated change 2025-02-03 12:30:21 -08:00
Godfrey M
24bb679305 adds check that asset has asset status before checking archived 2025-02-03 12:24:22 -08:00
Godfrey M
ddc22b4d6b adds a check to see that qr code type is not none 2025-02-03 10:38:49 -08:00
Godfrey M
9a75131a98 removed old label artifact 2025-02-03 10:18:13 -08:00
Marcus Moore
26b4063435 Convert section items 2025-01-30 16:07:46 -08:00
Marcus Moore
8dd432c3a2 Convert section headings 2025-01-30 15:56:08 -08:00
Marcus Moore
0e390f1a9b Temporarily order properties 2025-01-30 15:54:27 -08:00
Marcus Moore
6fb83d66a2 Revert "Re-order parameters"
This reverts commit bf96688aef.
2025-01-30 15:46:22 -08:00
Marcus Moore
bf96688aef Re-order parameters 2025-01-30 15:37:05 -08:00
Marcus Moore
eb4aeb47c1 Replace Form::radio in top section of group permissions page 2025-01-30 15:36:38 -08:00
Marcus Moore
7cbb3f7e07 Add assertion 2025-01-30 11:48:55 -08:00
Marcus Moore
7e9c564d0b Simplify test 2025-01-30 11:47:43 -08:00
Marcus Moore
fc88b2487f Extract method 2025-01-30 11:44:37 -08:00
Marcus Moore
e94ee48f74 Extract helper 2025-01-30 10:37:11 -08:00
Marcus Moore
6a4a5d1380 Add translation 2025-01-30 10:35:31 -08:00
Marcus Moore
ab9e9b66d2 Reduce complexity 2025-01-29 16:27:18 -08:00
Marcus Moore
c15c338ffd Merge if/else 2025-01-29 16:25:37 -08:00
Marcus Moore
d1197d015c Add another case scenario 2025-01-29 16:24:43 -08:00
Marcus Moore
ce31ce477e Inline additional variables 2025-01-29 16:16:47 -08:00
Marcus Moore
78f9292555 Inline variable 2025-01-29 16:15:27 -08:00
Marcus Moore
4e7c6bd2cf Fix relationship 2025-01-29 16:14:09 -08:00
Marcus Moore
70aed45bfe Improve naming 2025-01-29 15:56:20 -08:00
Marcus Moore
e2805f4033 Add "Reminder" to subject line 2025-01-29 15:36:45 -08:00
Marcus Moore
d254a40e0a Scaffold tests 2025-01-29 15:21:10 -08:00
Marcus Moore
fdcb891cbb Improve test case 2025-01-29 15:20:56 -08:00
snipe
d906f3cf62 Merge pull request #16148 from spencerrlongg/bug/sc-27619 2025-01-29 21:05:08 +00:00
Godfrey M
16d322d70e fix translation 2025-01-29 10:38:30 -08:00
Godfrey M
2163312997 adds translations for branding and general settings 2025-01-29 10:35:26 -08:00
spencerrlongg
0defed9abe add nullsafe 2025-01-29 11:27:02 -06:00
Godfrey M
0dfb71cfe5 added some translations to branding and general setrting 2025-01-28 11:56:10 -08:00
Marcus Moore
ac925af3d0 Replace a few radio inputs on bulk user edit page 2025-01-27 13:50:22 -08:00
Marcus Moore
4f08b2360c Migrate radios on custom report page 2025-01-27 13:36:59 -08:00
snipe
fd60ce1198 Merge pull request #16140 from marcusmoore/chore/sc-28233 2025-01-27 19:28:41 +00:00
Marcus Moore
00cdb13803 Convert remaining Form:hidden in labels view 2025-01-27 11:23:01 -08:00
Marcus Moore
ef6d747b37 Convert some Form:hidden in labels view 2025-01-27 11:15:09 -08:00
Marcus Moore
e26abb8684 Replace Form::hidden with @csrf 2025-01-27 11:07:19 -08:00
Marcus Moore
82801242d3 Merge branch 'develop' into chore/sc-28173
# Conflicts:
#	resources/views/settings/alerts.blade.php
2025-01-22 14:54:53 -08:00
snipe
e53ed2319c Merge pull request #16118 from marcusmoore/fixes/undefined-key-in-asset-observer 2025-01-22 22:30:55 +00:00
Marcus Moore
8f512e5941 Replace isset with the more appropriate array_key_exists 2025-01-22 14:28:35 -08:00
Marcus Moore
8a1b6b0684 Add isset check 2025-01-22 14:15:35 -08:00
snipe
5ac6caf257 Merge remote-tracking branch 'origin/develop' 2025-01-22 21:49:55 +00:00
snipe
36f460d32b Default to localStorage for bootstap table cookies
Signed-off-by: snipe <snipe@snipe.net>
2025-01-22 21:48:03 +00:00
snipe
802fcbafa0 Merge pull request #16116 from marcusmoore/bug/sc-20259 2025-01-22 18:50:12 +00:00
Marcus Moore
1098b8cd9d Avoid trying to divide by zero 2025-01-22 10:21:30 -08:00
Marcus Moore
da8999f59a Add failing test 2025-01-22 10:21:18 -08:00
snipe
bebc1f4d0d Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2025-01-22 17:31:17 +00:00
snipe
1212267da3 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2025-01-22 17:30:41 +00:00
snipe
d696ed8a5a Merge pull request #16107 from marcusmoore/chore/migrate-password-helper 2025-01-22 17:28:23 +00:00
Marcus Moore
c3d17c5727 Remove value for readonly 2025-01-22 09:27:40 -08:00
snipe
cb25d0f2f3 Merge pull request #16115 from snipe/localization/2025-01-22 2025-01-22 17:21:54 +00:00
snipe
be535671bc Updated language files
Signed-off-by: snipe <snipe@snipe.net>
2025-01-22 17:09:41 +00:00
snipe
63838f6e74 Merge pull request #16108 from marcusmoore/chore/migrate-form-submit-helper 2025-01-22 13:16:24 +00:00
Marcus Moore
5ddf0dd789 Migrate form submit helper 2025-01-21 16:36:22 -08:00
Marcus Moore
b003890dd2 Migrate password helpers 2025-01-21 16:14:20 -08:00
Marcus Moore
31097bdc37 Formatting 2025-01-21 10:25:53 -08:00
Marcus Moore
e733d2a5d0 Backfill test 2025-01-21 10:24:15 -08:00
Marcus Moore
6a35fa7ba3 Account for missing asset model 2025-01-21 10:14:27 -08:00
Marcus Moore
370666b5bd Fix indenting 2025-01-21 10:12:56 -08:00
snipe
8db8d4beba Merge pull request #16105 from snipe/use_url_fragment_for_file_uploads 2025-01-21 18:10:10 +00:00
snipe
d5309c7d94 Added fragment to uploads for redirect
Signed-off-by: snipe <snipe@snipe.net>
2025-01-21 18:06:00 +00:00
snipe
fb857ccf56 Merge remote-tracking branch 'origin/develop' 2025-01-20 21:07:04 +00:00
snipe
2668960bb9 Merge pull request #16102 from snipe/added_serial_search_to_activity_report 2025-01-20 21:06:23 +00:00
snipe
8e4878fac0 Added serial as relation search
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 21:00:01 +00:00
snipe
d4ef0f8aa8 Merge remote-tracking branch 'origin/develop' 2025-01-20 20:26:33 +00:00
snipe
752d89d177 Merge pull request #16101 from snipe/standarize_modelfile_api 2025-01-20 20:23:50 +00:00
snipe
0d7304eb8b Use transformer for model files
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 20:20:35 +00:00
snipe
48ff7cdbe8 Prod assets
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 17:00:02 +00:00
snipe
ca446ad7df Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/dist/all.css
#	public/css/dist/bootstrap-table.css
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
2025-01-20 16:59:55 +00:00
snipe
5afcd8ddb3 Merge pull request #16099 from snipe/add_id_to_locations_importer
Fixed #16097 - added location ID to location importer
2025-01-20 16:58:24 +00:00
snipe
5273408631 Check for matching ID
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 16:53:48 +00:00
snipe
713c9fdd6f Derp
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 16:46:22 +00:00
snipe
0a5c41ce23 Log error
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 16:42:53 +00:00
snipe
48a916ab77 Check that the ID has a value
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 16:38:31 +00:00
snipe
67ab602e3b Merge pull request #16090 from snipe/fixes/s3_support_for_eulas
Fixed #16000 - add S3 support for eula PDF downloads
2025-01-20 16:26:11 +00:00
snipe
801328ec42 Fixed #16097 - allow location update by ID in importer
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 16:23:13 +00:00
snipe
4fe83467ee Removed log error
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 16:20:31 +00:00
Brady Wetherington
dd34f07989 Fix custom translator for new Laravel 11 syntax 2025-01-20 15:24:06 +00:00
snipe
27a7a89990 Updated bootstrap tables to 1.24.0
Signed-off-by: snipe <snipe@snipe.net>
2025-01-20 15:06:00 +00:00
snipe
5dafa3c5c9 Merge remote-tracking branch 'origin/develop' 2025-01-20 15:00:01 +00:00
Brady Wetherington
6b242f47e4 Initial work at putting together a v8 branch 2025-01-20 14:54:28 +00:00
snipe
446c7fb483 Merge pull request #16096 from uberbrady/detect_csv_encodings_v2 2025-01-20 14:42:07 +00:00
Brady Wetherington
17c9c93456 Made composer changes for v8 2025-01-20 14:04:57 +00:00
Brady Wetherington
bbb2af7f53 remove log messages 2025-01-20 13:52:26 +00:00
Brady Wetherington
d65206c7fe Move tests to UI-side 2025-01-20 13:49:42 +00:00
snipe
954ffbfcaf Merge remote-tracking branch 'origin/develop' 2025-01-17 19:11:18 +00:00
snipe
327491c3a4 Merge pull request #16091 from snipe/hide_password_reset_if_ldap 2025-01-17 19:09:23 +00:00
snipe
02eeb7f916 Added extrab option in bulk edit
Signed-off-by: snipe <snipe@snipe.net>
2025-01-17 19:04:23 +00:00
snipe
e9ad43afbe Better hide reset password functionality for LDAP users
Signed-off-by: snipe <snipe@snipe.net>
2025-01-17 18:51:08 +00:00
snipe
434068a2ed Fixes #16000 - add S3 support for eula PDF downloads
Signed-off-by: snipe <snipe@snipe.net>
2025-01-17 17:49:19 +00:00
snipe
7f5ea30904 Prod assets
Signed-off-by: snipe <snipe@snipe.net>
2025-01-17 17:09:00 +00:00
snipe
53b6ccbac0 Merge remote-tracking branch 'origin/develop' 2025-01-17 17:07:44 +00:00
snipe
7e65d68392 Merge pull request #16089 from snipe/fixes/15017_card_view
Fixes #15017 - card view for mobile
2025-01-17 17:04:04 +00:00
snipe
b3d35beeb9 Fixes #15017 - card view for mobile
Signed-off-by: snipe <snipe@snipe.net>
2025-01-17 16:58:30 +00:00
snipe
eaa0e9d1fa Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2025-01-17 16:38:46 +00:00
snipe
fed7c2dc16 Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2025-01-17 16:38:04 +00:00
snipe
79951c3f17 Set support footer to on in reset demo script
Signed-off-by: snipe <snipe@snipe.net>
2025-01-17 16:37:00 +00:00
snipe
221ffb446c Fixed #15946 - added comtent type to webhook test
Signed-off-by: snipe <snipe@snipe.net>
2025-01-17 16:36:43 +00:00
Godfrey M
0eb34cb979 adds period to translation 2025-01-16 13:24:32 -08:00
Godfrey M
79a4c83879 add spaces 2025-01-16 13:23:16 -08:00
snipe
57f80290a1 Merge pull request #16081 from marcusmoore/fixes/zerofill-count-on-setup 2025-01-16 21:22:02 +00:00
Marcus Moore
4b2ede7a71 Use 0 for zerofill_count if nothing provided 2025-01-16 12:20:14 -08:00
snipe
5e465fa417 Merge remote-tracking branch 'origin/master' into develop 2025-01-16 19:06:02 +00:00
snipe
de5d66f5d2 Comment out ad-hoc note button for now
Signed-off-by: snipe <snipe@snipe.net>
2025-01-16 19:05:52 +00:00
Brady Wetherington
a50c8c6269 Automatically detect character encoding of CSV files when processsing them
to handle non-UTF-8 file types. Added a new test case and enhanced the test
rigs to be able to write non-UTF-8 files.

Final cleanup
2025-01-16 17:03:37 +00:00
Marcus Moore
cb56f89954 Merge branch 'develop' into chore/sc-28173
# Conflicts:
#	resources/views/settings/alerts.blade.php
2025-01-15 16:54:10 -08:00
Marcus Moore
96379d0a62 Use provided zerofill_count 2025-01-15 16:39:50 -08:00
Marcus Moore
68988524d6 Replace Form::text in certain views 2025-01-15 16:31:16 -08:00
Marcus Moore
c278900581 Replace Form::text in certain views 2025-01-15 15:58:33 -08:00
snipe
bbc9ed5778 Fixed audit date default on bulk audit
Signed-off-by: snipe <snipe@snipe.net>
2025-01-15 22:28:50 +00:00
snipe
1d0c156d2e Increased due for checkin warning
Signed-off-by: snipe <snipe@snipe.net>
2025-01-15 22:12:18 +00:00
snipe
7de5e2e7ef One more audot field increase
Signed-off-by: snipe <snipe@snipe.net>
2025-01-15 22:11:22 +00:00
snipe
8d935b34eb Fixed audit interval input width
Signed-off-by: snipe <snipe@snipe.net>
2025-01-15 22:07:53 +00:00
snipe
9830959f11 Fixed input width on audit interval
Signed-off-by: snipe <snipe@snipe.net>
2025-01-15 22:07:15 +00:00
Marcus Moore
8e790fdc47 Replace Form::text in certain views 2025-01-15 13:37:00 -08:00
Marcus Moore
0ef20c524f Replace Form::text in certain views 2025-01-15 13:01:32 -08:00
Marcus Moore
5ccaf2c23e Replace Form::text in certain views 2025-01-15 12:23:43 -08:00
Marcus Moore
bec9511df1 Add more spacing for input values to be displayed 2025-01-15 12:10:05 -08:00
Marcus Moore
017948c3bb Replace Form::text in certain views 2025-01-15 12:07:33 -08:00
Marcus Moore
1cb72e3e9c Replace Form::text in certain views 2025-01-15 11:53:22 -08:00
Marcus Moore
e45f563b50 Convert Form::textareas to blade component 2025-01-14 13:16:31 -08:00
Godfrey M
69d255f584 adds validation rules for label names 2025-01-14 12:07:59 -08:00
Godfrey Martinez
dd08642a7c Merge pull request #25 from Godmartinz/template_validate_error_p2
remove try catch, add validation rules for label template
2025-01-14 09:52:09 -08:00
Godfrey M
3ac0877418 remove try/catch, add rules for template 2025-01-14 09:50:43 -08:00
snipe
37b39956b5 Merge pull request #16071 from snipe/bug/sc-28149 2025-01-14 14:35:24 +00:00
snipe
9a4fd81c70 Use correct icon for ad-hoc notes on assets
Signed-off-by: snipe <snipe@snipe.net>
2025-01-14 14:34:17 +00:00
snipe
0bb2e98af3 Built assets
Signed-off-by: snipe <snipe@snipe.net>
2025-01-14 12:33:59 +00:00
snipe
1c8d94c953 Merge pull request #15525 from akemidx/updated_ad_hoc_notes 2025-01-14 11:33:21 +00:00
Marcus Moore
9573428201 Introduce textarea component 2025-01-13 16:34:12 -08:00
snipe
ca11efd3ee Merge pull request #16036 from Godmartinz/unaccepted_assets_reports_memory_fix 2025-01-13 22:23:30 +00:00
snipe
4a6a94a50e Merge pull request #16010 from AnouarTouati/dev-container-fixes 2025-01-13 22:23:13 +00:00
snipe
2d65b38155 Merge pull request #16011 from AnouarTouati/dev-docker-improv 2025-01-13 21:00:04 +00:00
snipe
99526cfc2c Remove mcrypt and legacy recrypter
Signed-off-by: snipe <snipe@snipe.net>
2025-01-13 19:54:00 +00:00
snipe
587449ef97 Merge pull request #15981 from akemidx/bug/sc-27551 2025-01-13 17:35:58 +00:00
snipe
06ffac9d7d Merge pull request #16046 from uberbrady/ldap_asset_location_switch_fix 2025-01-13 17:33:13 +00:00
snipe
e32ed03f66 Merge pull request #16061 from snipe/moved_keywords_on_admin_settings 2025-01-13 17:10:01 +00:00
snipe
a7543b407f Added a few more words
Signed-off-by: snipe <snipe@snipe.net>
2025-01-13 17:07:22 +00:00
snipe
98b1ba1e39 Moved keywords in lang file
Signed-off-by: snipe <snipe@snipe.net>
2025-01-13 17:04:48 +00:00
snipe
e03ed7567a Merge pull request #15747 from NebelKreis/feature/custom-data-options-for-2d-barcode 2025-01-13 15:20:56 +00:00
Nebel
9f0581275b Merge branch 'develop' into feature/custom-data-options-for-2d-barcode 2025-01-13 15:49:32 +01:00
snipe
3f5c166417 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2025-01-13 13:59:41 +00:00
snipe
cf091377b6 Add @brlin-tw as a contributor 2025-01-13 13:59:34 +00:00
snipe
0cc7a7014f Merge pull request #16053 from brlin-tw/patch-1
Fixed #16054: fix incorrect compose service name in the APP_KEY generation command of the Docker env file
2025-01-13 13:59:05 +00:00
snipe
4790ad53e3 Updated font-awesome to 6.7.2
Signed-off-by: snipe <snipe@snipe.net>
2025-01-13 13:57:45 +00:00
snipe
62dc075834 Add @aHVzY2g as a contributor 2025-01-13 13:55:28 +00:00
snipe
41da04cd22 Merge pull request #16018 from aHVzY2g/patch-3 2025-01-13 13:55:04 +00:00
Marlon Spangenberg
0c4fc56b80 increased label/field size to 2.5, reduced supported fields to 3 2025-01-13 12:20:56 +01:00
Marlon Spangenberg
907f0553d4 moved label value into the same line, changed label font to freemono 2025-01-13 12:14:30 +01:00
snipe
224f04db6c Merge pull request #16050 from Godmartinz/inactive-slack-hook
Adds try/catch around notification failing with an inactive webhook for better user experience
2025-01-10 11:23:41 +00:00
snipe
f0bcf78941 Merge pull request #16051 from marcusmoore/testing/checkoutable-acceptance-factory-fix
Update related asset when checkout acceptance created via factory
2025-01-10 11:22:50 +00:00
林博仁 Buo-ren Lin
c08a4a2b0a Fixed #16054: fix incorrect compose service name in the APP_KEY generation command of the Docker env file
This resolves the following error:

```
$ docker compose run --rm snipe-it php artisan key:generate --show
no such service: snipe-it
```

and is also how it is done in the documentation.

Fixes #16054.

Refer-to: APP_KEY | Docker | Snipe-IT documentation <https://snipe-it.readme.io/docs/docker#app_key>
Signed-off-by: Buo-ren Lin (OSSII) <buoren.lin@ossii.com.tw>
2025-01-10 11:29:49 +08:00
Marcus Moore
8597984787 Update asset's assigned_to and assigned_type after creating 2025-01-09 15:09:57 -08:00
Godfrey M
001ccf1ce9 adds translation string instead of hardcoded message 2025-01-09 14:47:07 -08:00
Godfrey M
082a974ee3 changed from redirect with error to with warning 2025-01-09 14:26:54 -08:00
Godfrey M
152c23b8f3 changed log from warning to error 2025-01-09 12:55:25 -08:00
Godfrey M
b635822a85 add try/catch around notification failing for inactive slack hooks 2025-01-09 12:51:54 -08:00
snipe
ec85e4b5b0 Upgrade less from 4.2.0 to 4.2.1 #15996
Signed-off-by: snipe <snipe@snipe.net>
2025-01-09 20:42:04 +00:00
snipe
1acb7e0fe4 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2025-01-09 20:38:47 +00:00
snipe
5914004a57 Add @AnouarTouati as a contributor 2025-01-09 16:13:05 +00:00
snipe
c5afc66d46 Merge pull request #16009 from AnouarTouati/prod-docker-fixes 2025-01-09 16:12:37 +00:00
snipe
bc69660247 Merge pull request #16049 from snipe/localization/update_strings-2025-01-09 2025-01-09 16:02:03 +00:00
snipe
71c7c64fde Updated language strings
Signed-off-by: snipe <snipe@snipe.net>
2025-01-09 15:54:51 +00:00
snipe
c284ac5287 Merge pull request #16047 from snipe/bug/sc-28054 2025-01-09 15:19:13 +00:00
snipe
639afe5b9b Check for blank OR null on formatter
Signed-off-by: snipe <snipe@snipe.net>
2025-01-09 15:11:22 +00:00
Brady Wetherington
049b9c542b Conditionally update assets when user's location moves via LDAP 2025-01-09 13:43:59 +00:00
Godfrey M
0118504cd3 adds redirect to render and save if template is null 2025-01-08 15:32:23 -08:00
Godfrey M
f4e69679ca add a try catch around template validation 2025-01-08 12:13:31 -08:00
Godfrey M
ce7a8ad808 add a space 2025-01-08 09:48:45 -08:00
Godfrey M
c17c011488 checks if template is null, adds return types for validation methods 2025-01-08 09:47:20 -08:00
Godfrey M
92762896ef moar removal 2025-01-07 15:10:46 -08:00
Godfrey M
c699baf519 removed commented out code, and unrelated crap 2025-01-07 15:10:00 -08:00
Godfrey M
97b765b5cc improved reports query, could be further optimized 2025-01-07 15:06:09 -08:00
snipe
40b41e646d Merge pull request #16033 from Godmartinz/barcode-fix 2025-01-07 19:59:30 +00:00
snipe
63853db450 Merge pull request #16035 from marcusmoore/fixes/unaccepted-assets-reminder 2025-01-07 19:58:23 +00:00
Marcus Moore
48dd3252cb Fix parameter order 2025-01-07 11:47:16 -08:00
snipe
ee6f60e63c Merge pull request #16034 from Godmartinz/fix-locale-check 2025-01-07 19:00:32 +00:00
Godfrey M
f6abf90ba0 fix locale check 2025-01-07 10:51:48 -08:00
Godfrey M
83ee0e0fb6 untangled code visibility from each label engine 2025-01-07 10:37:59 -08:00
Godfrey M
94f44d1b77 fix label type values in db and defaults. update help text 2025-01-07 10:00:52 -08:00
Godfrey M
e12c7473f8 tinkering with the polymorphic eager load 2025-01-07 09:08:36 -08:00
snipe
407d69b370 Merge pull request #16031 from snipe/make_backups_more_configurable 2025-01-07 11:25:17 +00:00
snipe
774e795d97 Pull backup:clean settings into config
Signed-off-by: snipe <snipe@snipe.net>
2025-01-07 11:17:43 +00:00
snipe
f698f74d3e Merge pull request #16028 from marcusmoore/fixes/report-template-column
Fixed migration causing issues with mariadb
2025-01-06 22:58:30 +00:00
Marcus Moore
80f9159f4d Change options to text type 2025-01-06 14:29:18 -08:00
Godfrey M
0ec25d55a0 Merge branch 'develop' into unaccepted_assets_reports_memory_fix 2025-01-06 12:28:17 -08:00
Godfrey M
bb03e00279 fix deprecation on asset obs get unaccept report to populate 2025-01-06 11:26:45 -08:00
snipe
4d3db2ab44 Merge pull request #15919 from Godmartinz/table_dropdownmenu-fix
Removed the `table-responsive` div from several index blades
2025-01-06 18:11:19 +00:00
snipe
c3d52af546 Merge pull request #16024 from snipe/fixes/#15977
Fixed  #15977 - Set order by on companies
2025-01-06 16:12:42 +00:00
snipe
9672a13402 Set order by on companies
Signed-off-by: snipe <snipe@snipe.net>
2025-01-06 16:11:18 +00:00
snipe
9564f7fdb8 Updated dev assets
Signed-off-by: snipe <snipe@snipe.net>
2025-01-06 12:46:17 +00:00
aHVzY2g
eba1f03363 Added: TZe_24mm_D.php modified TZe_24mm_A that includes 1D code
New label format for TZe_24mm that includes all fields of TZe_24mm_A with the addition of the 1D code at the bottom of the label.
2025-01-03 11:10:44 +01:00
snipe
c7ca4d061f Merge pull request #16013 from ubc-cpsc/bugfix/CVE-2024-56521-tcpdf
Fixes tecnickcom/tcpdf security CVEs
2024-12-30 23:22:32 +00:00
Joël Pittet
115f08ee49 Fixes tecnickcom/tcpdf security CVES: CVE-2024-56522, CVE-2024-56527, CVE-2024-56519, CVE-2024-56521 2024-12-30 13:59:03 -08:00
Anouar Touati
e33c680679 Improvement: Change the logging channel to storage/logs/laravel.log file in dev container 2024-12-29 11:13:47 -05:00
Anouar Touati
1e8ec783b4 following docs for prod docker without specifying APP_VERSION will now get latest version as doc says 2024-12-29 11:05:02 -05:00
Anouar Touati
a6ed958687 Fixed: dev dependencies are not installed in dev container 2024-12-29 11:02:09 -05:00
Anouar Touati
4354f50168 Fixed: Debug mode is not enabled in dev container 2024-12-29 11:02:09 -05:00
snipe
8fc1227974 Merge pull request #16003 from snipe/asset_maintenance_api_fix
Check for valid asset before accessing properties
2024-12-26 10:31:47 +00:00
snipe
d410f168bd Removed extra checks, since we already check higher up
Signed-off-by: snipe <snipe@snipe.net>
2024-12-26 10:28:27 +00:00
snipe
b38f9ad33c Updated return types
Signed-off-by: snipe <snipe@snipe.net>
2024-12-26 10:18:00 +00:00
snipe
f8311815ee Check for valid asset before accessing properties
Signed-off-by: snipe <snipe@snipe.net>
2024-12-26 10:17:45 +00:00
snipe
3edb501973 Fixed typo sanitze to sanitize
Signed-off-by: snipe <snipe@snipe.net>
2024-12-25 20:45:19 +00:00
snipe
49918d3302 Merge pull request #15992 from marcusmoore/fixes/reset-demo-command
Fixed reset demo command
2024-12-19 23:24:37 +00:00
Marcus Moore
876ab44a16 Update settings property keys 2024-12-19 15:18:27 -08:00
snipe
15296d2b1c Merge pull request #15714 from akemidx/saving_custom_report_template
Saved Custom Report Templates
2024-12-19 22:43:59 +00:00
snipe
1434522149 Merge pull request #15912 from marcusmoore/bug/harden-checkout-validation-v2
Harden asset checkout validation
2024-12-19 22:42:06 +00:00
snipe
23af5fb06e Merge pull request #15964 from marcusmoore/testing/accessories-ui
Added Accessory UI tests
2024-12-19 22:40:34 +00:00
snipe
6b8c1eb523 Merge branch 'develop' into testing/accessories-ui 2024-12-19 22:38:04 +00:00
snipe
0984194ec6 Merge pull request #15965 from marcusmoore/testing/consumable-ui
Added Consumable UI tests
2024-12-19 22:36:47 +00:00
snipe
26264e1d55 Merge branch 'develop' into testing/consumable-ui 2024-12-19 22:34:10 +00:00
snipe
dc5dedd5a3 Merge pull request #15975 from marcusmoore/testing/license-checkin
Added tests around license checkin
2024-12-19 22:33:03 +00:00
snipe
d49bfb562a Merge branch 'develop' into testing/license-checkin 2024-12-19 22:29:31 +00:00
snipe
f90dd9d74d Merge pull request #15976 from marcusmoore/testing/ui-render
Added simple front end render tests
2024-12-19 22:27:35 +00:00
snipe
8d24c0af0d Merge pull request #15982 from spencerrlongg/bug/sc-27228
Update Checkout Button Permission for Predefined Kits
2024-12-19 22:25:51 +00:00
snipe
174a01cb6b Merge pull request #15991 from snipe/added_some_sorting_on_audit_report
Added a few order options on audit report
2024-12-19 22:24:57 +00:00
snipe
360e0ff534 Added a few order options on audit report
Signed-off-by: snipe <snipe@snipe.net>
2024-12-19 22:19:33 +00:00
snipe
4f2721e93f Merge pull request #15986 from Godmartinz/fix-settings-seeder
Renames variables to match columns for label settings
2024-12-19 19:06:28 +00:00
snipe
0dce3b8b8c Merge pull request #15987 from spencerrlongg/bug/sc-27192
Add `string` to Password Reset Username Rules
2024-12-18 20:09:14 +00:00
spencerrlongg
5042c2b30a oops, rm dump 2024-12-18 13:58:18 -06:00
spencerrlongg
b45cf6124f add note 2024-12-18 13:57:18 -06:00
Godfrey M
c8f280ac90 change barcode column names in seeder 2024-12-18 09:50:55 -08:00
spencerrlongg
7eb936883a rm note 2024-12-17 16:38:29 -06:00
akemidx
c3b5a92a48 added builder 2024-12-17 17:11:52 -05:00
spencerrlongg
eb054897d6 Remove leftover testing logic and fix checkout permissions
Removed console logs and temporary testing code from the bootstrap-table view. Updated the transformer to correctly check checkout permissions against the Asset class instead of PredefinedKit.
2024-12-17 16:06:10 -06:00
akemidx
f6dbda4056 fixing count to not used trashed 2024-12-17 17:03:46 -05:00
akemidx
5992d2a1d2 adding to controller 2024-12-17 15:43:13 -05:00
Marcus Moore
a53976967a Use correct id 2024-12-17 10:31:35 -08:00
Marcus Moore
1be7508340 Add simple tests to ensure views render 2024-12-16 17:45:10 -08:00
Marcus Moore
af135fa42c Add permissions property to group factory 2024-12-16 17:37:58 -08:00
Marcus Moore
7aa5195e87 Add tests for license checkin 2024-12-16 14:39:24 -08:00
snipe
04c3481734 Merge pull request #15973 from uberbrady/next_try_accessories_to_locations_rebased
Next try accessories to locations rebased
2024-12-16 20:25:25 +00:00
Brady Wetherington
582b462326 Removed inadvertently added files. 2024-12-16 16:55:54 +00:00
snipe
b233715796 Fixed property
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
b93fc80011 Fixed admin -> adminuser property
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
41a6b34768 Added new test
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
17a6a871ae Updated comment
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
5fceef1dc3 Updated routes with new endpoints
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
9b04d2e51c Updated route in view
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
51b426f0b4 Added accessory transformer to assets transformer
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
021c4f2598 Added assets endpoint
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
ac96b8d4ae Added assignedAccessories method
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
bc8719e336 Specify created_by in the API call as well
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
bd38d64e66 Removed create() method
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
74b5d6d12b Updated transformer
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
ddd11939a5 No need to include assigned_to
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
3caa5f2042 Fixed user_id to created_by
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
5226d507d4 Updated route
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
274b659905 Added new route
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
a0b9714d72 Updated user_id to created_by
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
36aea52ae0 Fixed variable in test
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:34 +00:00
snipe
e0643cd744 Added currency and history icons
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:35:30 +00:00
snipe
27fab0f573 Use history icon
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:34:51 +00:00
snipe
183a4d49d8 Refactor of #15235 - added accessory checkout to locations, assets
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 16:34:49 +00:00
snipe
edacc4eb54 Merge pull request #15446 from Godmartinz/barcode_settings_hide
Refactored Barcode Settings into Label Settings
2024-12-16 16:09:34 +00:00
snipe
1e7d7a147b Merge pull request #15972 from snipe/upgrade_fontawesome
Updated font awesome
2024-12-16 15:55:14 +00:00
snipe
8ee549efbf Bumped font-awesome to 6.7.0
Signed-off-by: snipe <snipe@snipe.net>
2024-12-16 15:51:23 +00:00
Marcus Moore
699476da90 Scaffold and implement some license checkin tests 2024-12-12 17:33:34 -08:00
Marcus Moore
d763feb803 Add consumable ui tests 2024-12-12 16:41:46 -08:00
Marcus Moore
d3bfa75251 Add accessory ui tests 2024-12-12 14:30:58 -08:00
Godfrey M
833af55806 Merge branch 'develop' into barcode_settings_hide 2024-12-12 12:05:29 -08:00
snipe
d1246c65bd Merge pull request #15963 from snipe/localization/updated_strings_2024-12-12 2024-12-12 19:24:09 +00:00
snipe
38db890660 Updated strings
Signed-off-by: snipe <snipe@snipe.net>
2024-12-12 19:22:56 +00:00
snipe
01c18f6303 Merge pull request #15962 from snipe/fixes_rb-18772 2024-12-12 17:40:40 +00:00
snipe
c5e2aed164 Check for assigned (not assigned_to) before trying to present() the name on bulk delete assets
Signed-off-by: snipe <snipe@snipe.net>
2024-12-12 17:37:08 +00:00
snipe
4d1d2fedb7 Merge pull request #15960 from uberbrady/improve_restore_cleaner_utf8 2024-12-12 17:05:10 +00:00
snipe
ab6363a124 Merge pull request #15959 from snipe/remove_settings_api_endpoints 2024-12-12 16:53:15 +00:00
Brady Wetherington
a0e7dcf4ff Fixes to 'clean' mode to better handle character sets and zero-values 2024-12-12 16:50:36 +00:00
snipe
da33f1815a Removed index and destroy settinga API endpoints
Signed-off-by: snipe <snipe@snipe.net>
2024-12-12 16:46:19 +00:00
snipe
f089d1f0a4 Merge pull request #15944 from marcusmoore/bug/required-display-for-selects 2024-12-12 01:42:26 +00:00
spencerrlongg
72f58b0405 leaving this here for notes etc 2024-12-11 19:13:51 -06:00
snipe
4bd6c2171c Merge pull request #15957 from Godmartinz/fix-checkout-notif-parameters 2024-12-12 00:38:21 +00:00
Marcus Moore
67494c1b0b Fix validation messages for select2 inputs 2024-12-11 16:26:23 -08:00
Godfrey M
3264149a2c fix other mailables 2024-12-11 16:26:18 -08:00
Marcus Moore
8417fcb604 Revert "Show frontend "required" validation for model and status selects"
This reverts commit 10a7ae8d47.
2024-12-11 16:25:45 -08:00
Godfrey M
331fbb66bd fix other mailables 2024-12-11 16:25:04 -08:00
Godfrey M
400833f834 reversed order of the acceptance and note paramter 2024-12-11 16:14:06 -08:00
snipe
a7e6b8ea3f Merge pull request #15956 from marcusmoore/bug/sc-27731 2024-12-11 23:52:33 +00:00
Marcus Moore
6e31d0f2c3 Use appropriate category for licenses when seeding 2024-12-11 15:39:41 -08:00
snipe
b9a660683c Merge pull request #15955 from ubc-cpsc/bugfix/GHSA-c2pc-g5qf-rfrf 2024-12-11 20:42:13 +00:00
Joël Pittet
014350a26b Fix league/commonmark's quadratic complexity bugs may lead to a denial of service 2024-12-11 12:04:45 -08:00
snipe
06a0ac895d Fixed #15928 - updated method name to setCreatedBy from SetUserId
Signed-off-by: snipe <snipe@snipe.net>
2024-12-11 18:34:18 +00:00
snipe
34a47e9e44 Add @sgross-emlix as a contributor 2024-12-11 18:09:53 +00:00
snipe
f5a9e4bafa Fixes #15952 - fixed typo in content-type
Signed-off-by: snipe <snipe@snipe.net>
2024-12-11 18:09:19 +00:00
snipe
66339481cf Merge pull request #15954 from Godmartinz/null_fix-for-reminder-command 2024-12-11 17:38:59 +00:00
Godfrey M
2e97b56deb add null safe operator to acceptance reminder 2024-12-11 09:27:27 -08:00
akemidx
8adb62fd3a width fix 2024-12-10 19:17:01 -05:00
akemidx
43537d414b removed redundancy. 2024-12-10 16:42:55 -05:00
snipe
5014a95d9a Updated supported versions
Signed-off-by: snipe <snipe@snipe.net>
2024-12-10 13:27:59 +00:00
akemidx
f2fab57187 cancel button pull to left.
added pull right to save
2024-12-09 19:28:57 -05:00
Marcus Moore
10a7ae8d47 Show frontend "required" validation for model and status selects 2024-12-09 16:09:51 -08:00
snipe
5f0efd8cdb Merge pull request #15940 from snipe/reove_gh_templates 2024-12-09 19:35:31 +00:00
spencerrlongg
03c90d7b60 note, will come back to this once question is answered 2024-12-09 13:29:06 -06:00
snipe
31155b5351 Removed issue/PR templates
Signed-off-by: snipe <snipe@snipe.net>
2024-12-09 19:28:51 +00:00
snipe
cc8f72c3f9 Merge pull request #15914 from Godmartinz/send_reminder_emails 2024-12-09 19:23:13 +00:00
snipe
a0bab70def Merge pull request #15939 from uberbrady/fix_ldap_asset_location_updater 2024-12-09 17:56:23 +00:00
Brady Wetherington
b5c8251539 Only update asset locations to assets checked out to users. 2024-12-09 17:40:10 +00:00
snipe
0149ed75fd Merge pull request #15565 from spencerrlongg/bug/sc-25921 2024-12-09 17:00:10 +00:00
snipe
f72635955d Merge pull request #15925 from Godmartinz/refactor-unaccepted-assets-reminder-notif 2024-12-09 16:40:21 +00:00
Godfrey M
5120cddda4 delete notification version of reminder 2024-12-05 16:02:55 -08:00
Godfrey M
97398f1e68 adds testing to unaccepted reminder command 2024-12-05 12:41:33 -08:00
Godfrey M
281ff6ad5d wrap comment 2024-12-05 11:52:34 -08:00
Godfrey M
9d49b01958 cleans up the Unaccepted Asset reminder variables 2024-12-05 11:46:56 -08:00
Godfrey M
3f8916ea2e fix duplicate emails being sent in unaccepted reminder command 2024-12-05 11:37:03 -08:00
Godfrey M
f6b9ae6aee missed a spot 2024-12-05 10:18:35 -08:00
Godfrey M
de41def2b3 fixed conditionals 2024-12-05 10:15:57 -08:00
Godfrey M
52b051e940 add mail class for unaccepted assets reminders 2024-12-05 10:08:39 -08:00
snipe
a137e31797 Merge pull request #15920 from akemidx/asset-category-in-emails 2024-12-04 21:46:43 +00:00
akemidx
ca0f8ace99 fixed 2024-12-03 16:57:28 -05:00
akemidx
6252f0ac5e layout / added category id 2024-12-03 16:10:42 -05:00
Godfrey M
b85b4b1e1b remove table-responsive div from several index bladees 2024-12-03 10:26:14 -08:00
snipe
43d66a8fcc Merge pull request #15918 from Godmartinz/mail_name_fix
Adds `MAIL_FROM_NAME` to mail envelope
2024-12-03 17:17:26 +00:00
Godfrey M
e5284c03e2 fix typo 2024-12-03 09:10:50 -08:00
Godfrey M
16283b8fc0 adds mail from name to mail envelope 2024-12-03 09:08:39 -08:00
Godfrey M
983b78edd9 add property check 2024-12-02 14:27:04 -08:00
snipe
2ad1407d51 Merge pull request #15909 from Godmartinz/checkin-out-notifications
Fixed general webhook option notifications not firing
2024-12-02 22:03:32 +00:00
Godfrey M
ab67c48352 fix unaccepted assets report resend acceptance 2024-12-02 13:03:09 -08:00
Marcus Moore
1d0d14876c Harden asset checkout validation 2024-12-02 12:49:02 -08:00
Fiala06
bdb0e6c2a3 Update LdapSync.php
Fix for duplicate entries preventing the sync from continuing. 

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '13178-6' for key 'PRIMARY' (Connection: mysql, SQL: insert into users_groups (group_id, user_id) values (6, 13178))
2024-12-02 11:07:37 -08:00
snipe
14730184c9 Fixed sr-only blank text
Signed-off-by: snipe <snipe@snipe.net>
2024-12-02 18:48:02 +00:00
snipe
8ff099e802 Merge pull request #15910 from marcusmoore/chore/include-testing-variable
Included MAIL_FROM_ADDR in phpunit configuration
2024-12-02 18:34:08 +00:00
Marcus Moore
ea1f8328b9 Include MAIL_FROM_ADDR in phpunit configuration 2024-12-02 10:23:02 -08:00
Godfrey M
99464fcd86 fixes general webhook not firing 2024-12-02 10:19:24 -08:00
snipe
93d4d24194 Fixed funky layout in importer
Signed-off-by: snipe <snipe@snipe.net>
2024-12-02 17:56:15 +00:00
snipe
1bbe9bf6c9 Merge remote-tracking branch 'origin/develop' 2024-12-02 17:43:03 +00:00
snipe
6874f703bf Some CSS twiddling
Signed-off-by: snipe <snipe@snipe.net>
2024-12-02 17:42:26 +00:00
snipe
a7d5b3944e Merge pull request #15908 from snipe/revert-15892-bug/harden-checkout-validation
Revert "Hardened asset checkout validation by requiring integer"
2024-12-02 17:42:02 +00:00
Marcus Moore
b5e83899c6 Revert "Hardened asset checkout validation by requiring integer" 2024-12-02 09:37:21 -08:00
snipe
dcd586e3cd Merge remote-tracking branch 'origin/develop' 2024-12-02 17:17:20 +00:00
snipe
1246ab1de7 Fixed bulk user form in user detail view
Signed-off-by: snipe <snipe@snipe.net>
2024-12-02 17:14:36 +00:00
snipe
5a4a3aa8f3 Merge remote-tracking branch 'origin/develop' 2024-12-02 15:59:25 +00:00
snipe
2220828b00 Merge pull request #15904 from snipe/fixes/#15901
Fixed #15901 - re-added required indicator on text and select custom fields
2024-12-02 15:51:32 +00:00
snipe
716c67d4b8 Fixed #15901 - re-added required indicator on text and select custom fields
Signed-off-by: snipe <snipe@snipe.net>
2024-12-02 15:45:07 +00:00
snipe
ee4a54be24 Fixed order by notes for users
Signed-off-by: snipe <snipe@snipe.net>
2024-11-27 15:48:13 +00:00
snipe
46be1ada60 Merge pull request #15892 from marcusmoore/bug/harden-checkout-validation
Hardened asset checkout validation by requiring integer
2024-11-27 14:55:11 +00:00
snipe
e1c0a80c20 Merge remote-tracking branch 'origin/develop' 2024-11-27 13:52:03 +00:00
snipe
2cb1b6d462 Use transformer on API update
Signed-off-by: snipe <snipe@snipe.net>
2024-11-27 13:51:53 +00:00
snipe
37ac7fe25c Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2024-11-26 20:38:46 +00:00
snipe
11f83b4cd9 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2024-11-26 20:12:14 +00:00
snipe
0f1d10bd69 Dev assets
Signed-off-by: snipe <snipe@snipe.net>
2024-11-26 20:12:09 +00:00
snipe
82108f8a18 Merge pull request #15208 from akemidx/feature/sc-26415
FEATURE: Option for Notes to be Required on Asset Checkin/Checkout
2024-11-26 20:11:04 +00:00
akemidx
a7dae10a82 fixing line 2024-11-26 15:06:25 -05:00
akemidx
2727210c78 requested changes from pr 2024-11-26 15:04:54 -05:00
Marcus Moore
fcbd5dcae5 Harden asset checkout validation by requiring ints 2024-11-26 11:33:17 -08:00
snipe
fa80716320 Merge pull request #15890 from Godmartinz/mobile-view-fix
Mobile view fix
2024-11-26 19:13:39 +00:00
Godfrey M
15c9df0ab1 fix mobile view for asset and user 2024-11-26 10:59:31 -08:00
snipe
6ee0c93c87 Merge remote-tracking branch 'origin/develop' 2024-11-26 18:47:22 +00:00
snipe
37e091adbb Merge pull request #15889 from Godmartinz/Fix-user-API-location-update
Fixed Users API `update` from clearing `location_id` unnecessarily
2024-11-26 18:45:20 +00:00
Godfrey M
021e82927e fixed mobile view of assets 2024-11-26 10:42:59 -08:00
Godfrey M
60642cd902 fix user api update from clearing location_id unnecessarily 2024-11-26 09:58:17 -08:00
snipe
fd07550803 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2024-11-25 14:19:05 +00:00
snipe
30b481bc93 Updated version
Signed-off-by: snipe <snipe@snipe.net>
2024-11-25 14:18:31 +00:00
snipe
25bfd3e845 Merge remote-tracking branch 'origin/develop' 2024-11-25 13:05:28 +00:00
snipe
0f18ee86f7 Updated translations
Signed-off-by: snipe <snipe@snipe.net>
2024-11-25 13:05:05 +00:00
snipe
4a5f65616f Merge remote-tracking branch 'origin/develop' 2024-11-25 12:56:08 +00:00
snipe
f125c90c94 Merge pull request #15870 from marcusmoore/bug/sc-26857
Always call resizeCanvas
2024-11-22 00:59:36 +00:00
akemidx
0d608552ef orange bar for requirednessness 2024-11-21 19:09:54 -05:00
akemidx
dd223fc215 commit for testing 2024-11-21 19:01:27 -05:00
Marcus Moore
87756cac66 Remove debugging 2024-11-21 14:30:17 -08:00
Marcus Moore
9f49c25401 WIP: move signature pad creation up and add debugging 2024-11-21 13:12:13 -08:00
Marcus Moore
d0378070c8 Always call resizeCanvas 2024-11-21 12:38:53 -08:00
snipe
9f395d1f6a Merge remote-tracking branch 'origin/develop' 2024-11-21 19:58:49 +00:00
snipe
feba860a90 Merge pull request #15850 from akemidx/bug/sc-27448
Adding colon to password translation string
2024-11-21 19:58:04 +00:00
akemidx
424316df9f fixing colon placements 2024-11-21 14:32:22 -05:00
snipe
b7aedb7dcb Merge pull request #15818 from spencerrlongg/bug/sc-27213
Resolves Validation for Encrypted Numeric and Alpha Custom Fields
2024-11-21 19:25:27 +00:00
snipe
8b38dc83f6 Merge pull request #15851 from marcusmoore/testing/api-component-checkin
Fixed bug in component checkins via api
2024-11-21 19:24:12 +00:00
snipe
ad2b85393b Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/js/build/app.js
#	public/js/build/vendor.js
#	public/js/dist/all.js
#	public/mix-manifest.json
2024-11-21 19:23:10 +00:00
snipe
85c1b0ec57 [Snyk] Upgrade jquery-ui from 1.14.0 to 1.14.1 #15868
Signed-off-by: snipe <snipe@snipe.net>
2024-11-21 19:22:08 +00:00
snipe
b99b56b32b Merge remote-tracking branch 'origin/develop' 2024-11-21 14:41:42 +00:00
snipe
2a21cce4f5 Merge pull request #15839 from Godmartinz/fix-mail-envelope-variable
replace env with config variable for from address
2024-11-21 14:41:04 +00:00
snipe
3a683d84a7 Merge pull request #15859 from Godmartinz/remove_name_null_warning
Adds a ternary for blank emails for mail notifications
2024-11-21 14:38:03 +00:00
snipe
e05f443886 Merge pull request #15864 from marcusmoore/testing/api-component-checkout
Added tests for component checkout api endpoint
2024-11-21 14:37:45 +00:00
Marcus Moore
d65254c4ec Add tests for component checkout api endpoint 2024-11-20 15:34:08 -08:00
Godfrey M
6969b8be47 remove the changes to mail.from.address default 2024-11-20 14:25:57 -08:00
snipe
0a3bca078c Merge pull request #15860 from marcusmoore/tests/switch-to-file-for-sqlite-in-action
Improved speed of sqlite tests in GitHub Actions
2024-11-20 22:09:11 +00:00
Marcus Moore
9bbd802fce Use database file for sqlite in GitHub Action for tests 2024-11-20 12:33:58 -08:00
Marcus Moore
f932a4fc76 Always run validation on checkin 2024-11-20 12:25:06 -08:00
Godfrey M
f7c1fc852d no checked out to email doesnt trigger a 500 2024-11-20 08:29:28 -08:00
snipe
5522def054 Merge pull request #15854 from NebelKreis/feature/add-category-to-asset-mails
Added #15803: Category Field to Asset Related Mails
2024-11-20 13:51:34 +00:00
snipe
8cd4b3303e Merge pull request #15847 from NebelKreis/feature/hardware-label-generation-api
Added #15677: API Route for Generating Asset Labels
2024-11-20 11:14:28 +00:00
NebelKreis
d5c141dc59 Fix: Removed setting validation as it is not strictly necessary 2024-11-20 11:55:48 +01:00
NebelKreis
7618169d79 Feature: Added category to asset requested email 2024-11-20 11:22:19 +01:00
NebelKreis
eb026248a8 Feature: Added category to asset acceptance/decline email 2024-11-20 10:59:59 +01:00
NebelKreis
4304af0508 Feature: Added category to asset checkin email 2024-11-20 10:27:37 +01:00
NebelKreis
61eff02fcb Feature: Added category to asset checkout email 2024-11-20 10:27:22 +01:00
snipe
cca76005a2 Merge pull request #15852 from marcusmoore/testing/ui-delete-component
Added tests around deleting component via ui
2024-11-20 01:27:19 +00:00
Marcus Moore
54f5f46e31 Improve check for image existence 2024-11-19 16:44:42 -08:00
Marcus Moore
51a0767be9 Add tests around deleting component via ui 2024-11-19 16:44:19 -08:00
Marcus Moore
da4c877ed8 Use === over == 2024-11-19 16:13:53 -08:00
Marcus Moore
e8cad0df69 Formatting 2024-11-19 16:13:30 -08:00
Marcus Moore
59fe53842d Add tests around component check ins via api 2024-11-19 16:11:23 -08:00
akemidx
1e513312eb adding colon to password translation 2024-11-19 16:58:10 -05:00
Godfrey M
99de639be4 fix mail.from.address variables in config, simplify envelop[ variable 2024-11-19 09:32:11 -08:00
Godfrey M
b513575643 add testing example var MAIL_FROM_ADDR 2024-11-19 09:10:52 -08:00
spencerrlongg
22602c7997 use existing validation strings 2024-11-19 08:59:47 -06:00
snipe
d10f118128 Merge remote-tracking branch 'origin/develop' 2024-11-19 13:55:55 +00:00
snipe
5a5f1082fb Merge pull request #15848 from snipe/chore/sc-27531
Indicate requiredness on status select on bulk user checkin+delete
2024-11-19 13:55:22 +00:00
snipe
30a6a678d4 Indicate requiredness on status select on bulk user checkin+delete
Signed-off-by: snipe <snipe@snipe.net>
2024-11-19 13:50:18 +00:00
snipe
4384f8dcbb Merge remote-tracking branch 'origin/develop' 2024-11-19 13:32:02 +00:00
snipe
d576016a1c Merge pull request #15845 from snipe/bug/sc-27523
Fixed variable name to correctly log created_by and date for bulk user delete/checkin
2024-11-19 13:29:21 +00:00
snipe
15a31bd141 Fixed variable name
Signed-off-by: snipe <snipe@snipe.net>
2024-11-19 13:22:44 +00:00
NebelKreis
5639a84d90 Feature: Added API route for asset label generation 2024-11-19 14:16:58 +01:00
NebelKreis
66d6b01307 Feature: Added translations for label generation API endpoint 2024-11-19 14:16:06 +01:00
NebelKreis
889aff43c2 Feature: Added API endpoint for generating asset labels 2024-11-19 14:13:05 +01:00
snipe
8f7223128f Merge pull request #15757 from akemidx/bug/sc-26944
FIXED: Bulk Delete page not showing full information
2024-11-19 12:34:57 +00:00
snipe
53cfcb7143 Merge pull request #15843 from snipe/viclou-patch-1
Update README.md - small typo
2024-11-19 10:50:28 +00:00
snipe
d60ac0c78d Merge pull request #15840 from marcusmoore/fixes/migration-rollbacks
Fixed a couple migrate:rollback issues
2024-11-19 10:20:58 +00:00
victoria
a328c7a64c Update README.md
typo mosrt to most under Join our Community links
2024-11-18 23:03:31 -10:00
Godfrey M
f533cdc07a update default from address to alternate config variable 2024-11-18 12:39:28 -08:00
Marcus Moore
f5206078d4 Fix rollback for webhook_endpoint by using correct column type 2024-11-18 12:25:02 -08:00
Marcus Moore
0209d27081 Fix rollback for created_by 2024-11-18 12:24:47 -08:00
Godfrey M
d14f43fbbe replace env with config variable for from address 2024-11-18 10:54:03 -08:00
spencerrlongg
b71a90a3c5 this should be all it takes to fix this, i think 2024-11-18 12:44:24 -06:00
snipe
8d321edca8 Merge remote-tracking branch 'origin/develop' 2024-11-15 18:59:40 +00:00
snipe
3fb543bf03 Merge pull request #15828 from snipe/bug/sc-27500
Fixed admin user not showing in download all activity report
2024-11-15 18:59:07 +00:00
snipe
e8d1093376 Fixed admin user not showing in download all activity report
Signed-off-by: snipe <snipe@snipe.net>
2024-11-15 18:51:45 +00:00
snipe
66e82a345a Merge remote-tracking branch 'origin/develop' 2024-11-15 13:18:25 +00:00
snipe
187e231c0e Fixed #15825
Signed-off-by: snipe <snipe@snipe.net>
2024-11-15 13:18:15 +00:00
snipe
caf92748fc Merge remote-tracking branch 'origin/develop' 2024-11-14 20:57:18 +00:00
snipe
5381c4e1e3 Merge remote-tracking branch 'origin/develop' 2024-11-14 20:53:17 +00:00
spencerrlongg
124f9c84c2 oops, something went wrong translation 2024-11-14 13:45:47 -06:00
snipe
96a4391d5c Merge remote-tracking branch 'origin/develop' 2024-11-14 19:05:08 +00:00
spencerrlongg
8465806536 rm unnecessary imports 2024-11-14 11:51:41 -06:00
spencerrlongg
95cd779334 translations and attribute names 2024-11-14 11:42:35 -06:00
snipe
0a7d1a27ee Merge remote-tracking branch 'origin/develop' 2024-11-14 17:10:16 +00:00
snipe
0be123b115 Merge remote-tracking branch 'origin/develop' 2024-11-14 14:47:18 +00:00
snipe
517e923f70 Merge remote-tracking branch 'origin/develop' 2024-11-14 14:42:44 +00:00
snipe
d427d9e5af Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>
2024-11-14 12:25:10 +00:00
spencerrlongg
8c6869fd34 note and rm dump and comment 2024-11-13 21:59:32 -06:00
spencerrlongg
7e7cbc4cc8 seems to work just fine now, needs translations 2024-11-13 21:54:25 -06:00
spencerrlongg
25163d1756 working except for null 🤔 2024-11-13 21:46:23 -06:00
spencerrlongg
3982201d0e this should work in theory - local is screwy though 2024-11-13 21:38:09 -06:00
snipe
647ef6a4b7 Versioning stuff is hard - fixed v7.0.14 to v7.1.14
Signed-off-by: snipe <snipe@snipe.net>
2024-11-14 01:11:29 +00:00
snipe
a89e17212e Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2024-11-13 23:46:30 +00:00
akemidx
efeef5cdc4 removing || parts of if else 2024-11-13 18:29:58 -05:00
akemidx
9cb411c500 removing required form div container 2024-11-13 18:06:04 -05:00
snipe
eb57652548 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/css/dist/skins/_all-skins.css
#	public/css/dist/skins/_all-skins.min.css
#	public/css/dist/skins/skin-black-dark.css
#	public/css/dist/skins/skin-black-dark.min.css
#	public/css/dist/skins/skin-blue-dark.css
#	public/css/dist/skins/skin-blue-dark.min.css
#	public/css/dist/skins/skin-green-dark.css
#	public/css/dist/skins/skin-green-dark.min.css
#	public/css/dist/skins/skin-orange-dark.css
#	public/css/dist/skins/skin-orange-dark.min.css
#	public/css/dist/skins/skin-purple-dark.css
#	public/css/dist/skins/skin-purple-dark.min.css
#	public/css/dist/skins/skin-red-dark.css
#	public/css/dist/skins/skin-red-dark.min.css
#	public/css/dist/skins/skin-yellow-dark.css
#	public/css/dist/skins/skin-yellow-dark.min.css
#	public/mix-manifest.json
2024-11-13 22:57:00 +00:00
Marcus Moore
92f33c08f7 Merge branch 'develop' into saving_custom_report_template 2024-11-13 14:54:00 -08:00
snipe
3bf33aa682 Merge remote-tracking branch 'origin/develop' 2024-11-13 22:39:01 +00:00
snipe
24456f723b Merge remote-tracking branch 'origin/develop' 2024-11-13 21:21:08 +00:00
snipe
19bf549450 Merge remote-tracking branch 'origin/develop' 2024-11-13 21:17:40 +00:00
snipe
8feb9c49b0 Merge remote-tracking branch 'origin/develop' 2024-11-13 20:39:45 +00:00
spencerrlongg
4841b89109 scratch code for this issue 2024-11-13 12:45:39 -06:00
snipe
e38c2139f8 Merge remote-tracking branch 'origin/develop' 2024-11-13 01:43:17 +00:00
Marcus Moore
53de97db4e Merge branch 'develop' into saving_custom_report_template 2024-11-12 10:36:07 -08:00
Marcus Moore
5574c5fa49 Improve comments 2024-11-12 10:35:22 -08:00
Marcus Moore
7373e2019c Improve comment 2024-11-12 10:01:32 -08:00
snipe
9eed6cde43 Merge remote-tracking branch 'origin/develop' 2024-11-11 14:04:56 +00:00
snipe
5d581752af Merge remote-tracking branch 'origin/develop' 2024-11-10 18:05:52 +00:00
snipe
7596717a15 Merge remote-tracking branch 'origin/develop' 2024-11-10 17:49:30 +00:00
snipe
c6b9556f60 Merge remote-tracking branch 'origin/develop' 2024-11-08 10:28:26 +00:00
Marcus Moore
4bb19152c4 Move test 2024-11-07 17:01:47 -08:00
Marcus Moore
dc0b8c7572 Inline route helpers in tests 2024-11-07 16:54:55 -08:00
Marcus Moore
b8265d54bb Improve comment 2024-11-07 16:42:55 -08:00
Marcus Moore
0e3efdfe87 Add string to name validation 2024-11-07 16:40:54 -08:00
Marcus Moore
363ec841d1 Re-introduce soft deletes 2024-11-07 16:40:37 -08:00
Marcus Moore
f8d0ddb3f7 Improve template name input 2024-11-07 14:17:20 -08:00
Marcus Moore
4aa5961860 Update page titles 2024-11-07 12:13:20 -08:00
Marcus Moore
7862b74e99 Inline fields when updating 2024-11-07 11:03:03 -08:00
Marcus Moore
c5710b858e Add test validation test for update method and remove name uniqueness constraint 2024-11-07 11:02:10 -08:00
snipe
d489527e6d Merge remote-tracking branch 'origin/develop' 2024-11-07 13:19:52 +00:00
snipe
aa080945f6 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/dist/all.css
#	public/css/dist/bootstrap-table.css
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
2024-11-06 21:26:21 +00:00
Marcus Moore
8873137ed0 Scaffold updating template name 2024-11-06 12:29:31 -08:00
Marcus Moore
37d792352d Update page title dynamically 2024-11-06 12:11:35 -08:00
snipe
9ce1e78c5c Merge remote-tracking branch 'origin/develop' 2024-11-06 14:16:09 +00:00
NebelKreis
52e4414bc5 Feature: Added asset ID option to 2D barcode in label generation 2024-11-05 13:41:34 +01:00
NebelKreis
f96b7c5056 Feature: Added data type context for select options with "URL:" and "Data:" labels, including translations 2024-11-05 13:40:33 +01:00
akemidx
82c38a8b18 or statement for if/else 2024-11-04 20:43:18 -05:00
akemidx
2f5e468b3c this fixes the assigned to piece 2024-11-04 19:48:34 -05:00
Marcus Moore
4daa8e7c63 Indenting 2024-11-04 12:49:44 -08:00
Marcus Moore
41f25341fd Populate select with selected template 2024-11-04 12:32:05 -08:00
Godfrey M
de77eda33d another line indent 2024-10-31 14:38:32 -07:00
Godfrey M
ee58fcc898 moved lines in for labels 2024-10-31 14:37:08 -07:00
Godfrey M
ae3cb7b37b adds migration to update new with old if blank and remove old barcod variables 2024-10-31 14:35:13 -07:00
snipe
95dba6c426 Merge remote-tracking branch 'origin/develop' 2024-10-31 21:06:59 +00:00
Marcus Moore
5f83cb6a14 Use route model binding 2024-10-31 12:34:06 -07:00
Marcus Moore
ae24b73b32 Fix action_type from "created" to" create" 2024-10-31 12:19:41 -07:00
Marcus Moore
4aedbb52fa Implement activity logging transformer tests 2024-10-31 12:15:05 -07:00
Marcus Moore
20dab4d89d Simplify tests 2024-10-30 16:50:55 -07:00
Marcus Moore
e871481042 Add group 2024-10-30 16:48:42 -07:00
akemidx
f10807661d fixing bulk delete table 2024-10-30 19:26:52 -04: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
59e6874a4a Scaffold test cases 2024-10-30 13:07:51 -07:00
Marcus Moore
930ef3fd11 Work on tests for activity logging 2024-10-30 12:22:59 -07:00
snipe
931ab103c1 Merge remote-tracking branch 'origin/develop' 2024-10-30 13:21:25 +00:00
Marcus Moore
35f8a71c71 Test organization 2024-10-29 16:17:12 -07:00
Marcus Moore
86762c5e90 Remove marker test case 2024-10-29 16:12:34 -07:00
Marcus Moore
3c75fc2ced Move test 2024-10-29 16:12:13 -07:00
Marcus Moore
702edf7908 Remove x from select dropdown 2024-10-29 15:34:00 -07: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
NebelKreis
e22296fd79 Feature: Added serial number option to 2D barcode in label generation 2024-10-29 13:49:05 +01:00
NebelKreis
6c17d7d732 Fix: Corrected path in translation function
Updated the translation function to use the correct path, ensuring that instead of displaying the translation path as plain text, the appropriate translation is now shown as intended.
2024-10-29 11:45:29 +01:00
Marcus Moore
0d58ac61bc Make options required in model 2024-10-28 14:48:19 -07:00
Marcus Moore
7c08fbe144 Update test name 2024-10-28 14:43:05 -07:00
Marcus Moore
7777147af5 Add custom-reporting group 2024-10-28 14:42:44 -07:00
Marcus Moore
2042733dc0 Switch to array syntax 2024-10-28 14:37:52 -07:00
Marcus Moore
d4cf392387 Organize tests 2024-10-28 14:24:47 -07:00
Marcus Moore
c881727747 Add redirect for missing template 2024-10-28 14:12:19 -07:00
Marcus Moore
ee00699cb3 Remove unused strings 2024-10-28 13:07:29 -07:00
Marcus Moore
b45749af16 Update translation strings 2024-10-28 13:06:19 -07:00
Marcus Moore
54dec8d30d Add translations 2024-10-28 12:56:42 -07:00
NebelKreis
6f3fb47e4a Feature: Added asset tag option to barcode in label generation 2024-10-28 15:39:04 +01:00
snipe
755604677c Merge remote-tracking branch 'origin/develop' 2024-10-28 13:38:19 +00:00
snipe
65f4f3def2 Merge remote-tracking branch 'origin/develop' 2024-10-28 12:04:20 +00:00
snipe
42ec2fa05f Merge remote-tracking branch 'origin/develop' 2024-10-28 11:55:43 +00:00
snipe
3445b543ea Merge remote-tracking branch 'origin/develop' 2024-10-24 10:04:02 +01:00
snipe
15ffd69ac0 Merge remote-tracking branch 'origin/develop' 2024-10-24 01:40:10 +01:00
Marcus Moore
7238238d1f Use created_by instead of user_id 2024-10-23 16:40:03 -07:00
Marcus Moore
84f6638f50 Add authorization check 2024-10-23 16:11:10 -07:00
Marcus Moore
e390a95bd3 Improve back button behavior 2024-10-23 15:42:09 -07:00
Marcus Moore
3616c92148 Reflash template name 2024-10-23 15:40:54 -07:00
Marcus Moore
2fcc7e1188 Make template name required 2024-10-23 15:24:58 -07:00
Marcus Moore
8a06f4ad82 Improve label 2024-10-23 15:21:02 -07:00
Marcus Moore
853e14f369 Fix width 2024-10-23 13:24:06 -07:00
Marcus Moore
c1aa33862d Add error message for eol start and end fields 2024-10-23 13:22:21 -07:00
Marcus Moore
30dc5fa0cf Allow retrieving eol start and end dates 2024-10-23 13:21:44 -07:00
Marcus Moore
94e168fa15 Fix label 2024-10-23 13:17:20 -07:00
snipe
7bbe23995d Merge remote-tracking branch 'origin/develop' 2024-10-23 19:14:36 +01:00
snipe
574f2e096d Merge remote-tracking branch 'origin/develop' 2024-10-23 17:57:37 +01:00
snipe
e15e33b648 Merge remote-tracking branch 'origin/develop' 2024-10-23 15:14:29 +01:00
Marcus Moore
4217d7402b Improve tests 2024-10-22 17:50:40 -07:00
Marcus Moore
3d28a9090c Improve test 2024-10-22 17:38:22 -07:00
Marcus Moore
271de1eceb Improve tests 2024-10-22 17:37:23 -07:00
Marcus Moore
b6aae1f8a9 Group routes 2024-10-22 17:30:34 -07: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
5ebf013d4e Add comment 2024-10-22 16:54:38 -07:00
Marcus Moore
02c22c9efb Add test case 2024-10-22 16:52:59 -07:00
Marcus Moore
d953519db6 Merge branch 'develop' into saving_custom_report_template 2024-10-22 15:11:18 -07:00
Marcus Moore
dd97e4ea82 Update permission tests 2024-10-22 14:22:19 -07:00
snipe
1979ada656 Merge remote-tracking branch 'origin/develop' 2024-10-22 22:10:53 +01:00
snipe
c536dbc741 Merge remote-tracking branch 'origin/develop' 2024-10-22 22:08:59 +01:00
snipe
7774dd0b7d Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2024-10-22 16:53:47 +01:00
snipe
03b01689b5 Merge remote-tracking branch 'origin/develop' 2024-10-22 15:39:20 +01:00
Marcus Moore
a20e03fce9 Merge branch 'develop' into saving_custom_report_template 2024-10-21 17:13:15 -07:00
akemidx
f0d3a6e2d3 removing some comments/merging in develop 2024-10-16 18:35:31 -04:00
akemidx
5cb940c2ee Merge branch 'refs/heads/upstream/dev' into feature/sc-26415 2024-10-16 18:32:36 -04: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
688260c8bb Merge remote-tracking branch 'origin/develop' 2024-10-15 18:31:16 +01:00
snipe
b38c2d4660 Merge remote-tracking branch 'origin/develop' 2024-10-15 16:43:23 +01:00
snipe
b256bea000 Merge remote-tracking branch 'origin/develop' 2024-10-15 13:10:55 +01:00
snipe
0a1716382e Merge remote-tracking branch 'origin/develop' 2024-10-11 16:07:01 +01:00
snipe
6554d0c787 Merge remote-tracking branch 'origin/develop' 2024-10-11 14:24:11 +01:00
snipe
41ffd55430 Merge remote-tracking branch 'origin/develop' 2024-10-11 11:30:09 +01:00
snipe
1338eaa4fa Merge remote-tracking branch 'origin/develop' 2024-10-11 11:28:06 +01:00
snipe
b296afe050 Merge remote-tracking branch 'origin/develop' 2024-10-10 12:32:19 +01:00
snipe
14b8b3b37c Merge remote-tracking branch 'origin/develop' 2024-10-10 12:09:29 +01:00
akemidx
299e743848 weird requesting 2024-10-08 15:51:53 -04:00
snipe
5de608a6d2 Merge remote-tracking branch 'origin/develop' 2024-10-07 11:14:47 +01:00
snipe
c56a5edddc Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
2024-10-03 17:41:07 +01:00
snipe
2de3bc92eb Merge remote-tracking branch 'origin/develop' 2024-10-03 16:29:14 +01:00
snipe
f5d7b96503 Merge remote-tracking branch 'origin/develop' 2024-10-03 14:38:34 +01:00
akemidx
0c84904bf9 un'required'ing the rule. not sure what's breaking here but looking 2024-10-02 18:56:41 -04:00
akemidx
e00a1aec02 note box is now missing when unchecking setting 2024-10-02 18:52:33 -04:00
akemidx
06e3bb7fd1 requested changes 2024-10-02 18:37:11 -04:00
akemidx
492e686b7a Merge remote-tracking branch 'origin/feature/sc-26415' into feature/sc-26415
# Conflicts:
#	app/Http/Controllers/Assets/AssetCheckinController.php
#	app/Http/Controllers/Assets/AssetCheckoutController.php
#	app/Http/Requests/AssetCheckinRequest.php
2024-10-02 18:17:38 -04:00
akemidx
17706f150e requested changes 2024-10-02 18:15:53 -04:00
akemidx
6fef127cd1 missing closing ) 2024-10-02 18:15:53 -04:00
akemidx
f45b836010 backend form validation. +cleanup 2024-10-02 18:15:53 -04:00
akemidx
925aea8531 back to having tests pass. needed to comment out the notes rules() i added 2024-10-02 18:15:53 -04:00
akemidx
bd6698de2a fixing some formatting 2024-10-02 18:15:53 -04:00
akemidx
515f59fed9 more test work 2024-10-02 18:15:52 -04:00
akemidx
5e74b109d9 front end changes/updates from gh 2024-10-02 18:15:52 -04:00
akemidx
8b643cb3b9 note field optional 2024-10-02 18:15:52 -04:00
akemidx
700647c53f setting created 2024-10-02 18:15:52 -04:00
akemidx
081c5706c4 required, but not optional 2024-10-02 18:15:52 -04:00
snipe
1695b8250f Bumped version for master
Signed-off-by: snipe <snipe@snipe.net>
2024-10-02 12:41:31 +01:00
snipe
f42eeee666 Merge remote-tracking branch 'origin/develop' 2024-10-02 12:40:59 +01:00
snipe
dc0949da78 Merge remote-tracking branch 'origin/develop' 2024-10-02 11:05:06 +01:00
snipe
0470a7c946 Merge remote-tracking branch 'origin/develop' 2024-10-02 11:01:05 +01:00
akemidx
73a059c9ac missing closing ) 2024-10-01 16:37:30 -04:00
snipe
c8981f5031 Merge remote-tracking branch 'origin/develop' 2024-10-01 20:32:41 +01:00
snipe
9cf4b03f59 Merge remote-tracking branch 'origin/develop' 2024-10-01 14:33:29 +01:00
spencerrlongg
4f9f035c69 added a way to manipulate validator attribute names 2024-09-30 20:09:00 -05:00
snipe
5d5e999384 Merge remote-tracking branch 'origin/develop' 2024-10-01 01:44:24 +01:00
spencerrlongg
cd3059f790 rm numbers too. :( 2024-09-30 13:38:52 -05:00
snipe
21af36b105 Merge remote-tracking branch 'origin/develop' 2024-09-30 18:24:19 +01:00
snipe
d6d5dfb3d2 Merge remote-tracking branch 'origin/develop' 2024-09-29 14:33:50 +01:00
snipe
9e3997e0a1 Generated prod assets
Signed-off-by: snipe <snipe@snipe.net>
2024-09-29 11:25:47 +01:00
Marcus Moore
e974c96eda Update to created_by 2024-09-26 12:41:16 -07:00
Marcus Moore
2004e58b53 Merge branch 'develop' into updated_ad_hoc_notes 2024-09-26 12:29:28 -07:00
Marcus Moore
eb2d7b1f4f Move comment location 2024-09-26 12:14:00 -07:00
Marcus Moore
47763d1e1a Add tests for adding notes to assets 2024-09-26 12:13:36 -07:00
Godfrey M
44447b85c9 Merge branch 'develop' into barcode_settings_hide 2024-09-26 11:27:05 -07:00
akemidx
b813dcd9d0 requested changes from github 2024-09-25 18:54:30 -04:00
spencerrlongg
b69596a261 rm dump 2024-09-25 16:21:33 -05:00
spencerrlongg
d02b9933e5 rm comment 2024-09-25 15:38:40 -05:00
spencerrlongg
852a56fa9b should be all good now 2024-09-25 15:30:41 -05:00
spencerrlongg
9df78a9ed0 working! need formatting for error messages etc 2024-09-25 14:00:50 -05:00
spencerrlongg
f3ad89931f hm ok this kind of works 2024-09-25 13:00:35 -05:00
spencerrlongg
21906d8c27 world set up and idea in place 2024-09-25 12:47:56 -05:00
akemidx
3964296ae6 no payload 2024-09-18 17:06:21 -04:00
akemidx
da9a61c28a no payload 2024-09-18 17:01:37 -04:00
Marcus Moore
6e16f589bd Remove reference to old trait 2024-09-17 17:00:06 -07:00
Marcus Moore
6b70443515 Formatting 2024-09-17 16:58:49 -07:00
Godfrey M
c9854d43a5 fixes selection order 2024-09-17 16:56:02 -07:00
Godfrey M
04708ae2b2 only allows PDF417 for new label engine 2024-09-17 16:54:50 -07:00
Godfrey M
bbb9babf27 one more finger 2024-09-17 16:40:18 -07:00
Godfrey M
e5daf35f65 fat finger fix 2024-09-17 16:39:55 -07:00
Godfrey M
87c72953b2 udpated translation 2024-09-17 16:37:17 -07:00
Marcus Moore
89e2d03a81 Fix the deleted assets radio 2024-09-17 16:24:18 -07:00
Godfrey M
fa5651f335 remove getbarcodes, postbarcodes, barcodes settings blade 2024-09-17 16:21:26 -07:00
akemidx
443447a068 added icon to button 2024-09-17 19:16:44 -04:00
Godfrey M
b33c0fc4dd updates getbarcode method and labels view 2024-09-17 16:15:56 -07:00
Marcus Moore
8e0b718a4a Scope Select All checkbox to fields on left side of page 2024-09-17 16:00:32 -07:00
Marcus Moore
b51c505d9e Fix department, manufacturer, and category multi-selects 2024-09-17 15:29:38 -07:00
Marcus Moore
8bba11e1bb Merge branch 'develop' into saving_custom_report_template
# Conflicts:
#	app/Http/Controllers/ReportsController.php
#	resources/views/partials/forms/edit/category-select.blade.php
#	resources/views/partials/forms/edit/company-select.blade.php
#	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/status-select.blade.php
#	resources/views/reports/custom.blade.php
2024-09-17 15:26:35 -07:00
akemidx
4b54e980e2 added button 2024-09-17 17:56:22 -04:00
Godfrey M
033a56fe6d change variables in hardware labels edit post methods 2024-09-17 12:22:05 -07:00
Godfrey M
3682d9fa6c removed duplicate line from post labels 2024-09-17 11:23:59 -07:00
Godfrey M
ce987b4f6d added front end barcodes to labels 2024-09-17 11:23:38 -07:00
akemidx
74efd850af redoing branch. old branch merge onflicts were waaay too gnarly 2024-09-16 19:30:26 -04:00
akemidx
d262638a63 backend form validation. +cleanup 2024-09-04 18:23:36 -04:00
akemidx
bebb72a04f back to having tests pass. needed to comment out the notes rules() i added 2024-09-04 17:53:19 -04:00
akemidx
77c5035cac fixing some formatting 2024-09-04 17:50:52 -04:00
Godfrey M
df8b1c0240 hides barcode settings if new label engine enabled 2024-09-03 12:29:52 -07:00
akemidx
2901ecbf43 more test work 2024-09-03 15:02:27 -04:00
akemidx
27c120a55e front end changes/updates from gh 2024-08-20 19:07:47 -04:00
akemidx
4e43fa6b9f Merge remote-tracking branch 'upstream/develop' into feature/sc-26415 2024-08-19 21:06:18 -04:00
akemidx
0f0baa207d note field optional 2024-08-01 17:02:35 -04:00
akemidx
3ff1745f56 setting created 2024-08-01 16:44:02 -04:00
akemidx
552f90ae2c required, but not optional 2024-08-01 16:06:47 -04:00
Marcus Moore
d65c0c8bea Remove comma 2024-01-23 15:22:00 -08:00
Marcus Moore
2d5631284b Indent 2024-01-23 15:19:36 -08:00
Marcus Moore
3952fc10a6 Re-render order number properly 2024-01-23 15:18:02 -08:00
Marcus Moore
0881301b6d Fix language strings 2024-01-23 13:55:20 -08:00
Marcus Moore
530ea474d1 Merge branch 'develop' into saving_custom_report_template
# Conflicts:
#	resources/lang/en/admin/reports/general.php
#	resources/views/reports/custom.blade.php
2024-01-23 13:55:07 -08:00
Marcus Moore
219540281f Add trailing commas 2024-01-22 12:42:01 -08:00
Marcus Moore
b74115b604 Add docblocks 2024-01-18 15:42:52 -08:00
Marcus Moore
1630392953 Uncheck a couple boxes by default to match existing behavior 2024-01-18 13:30:51 -08:00
Marcus Moore
861ef6312e Use is_iterable for checks instead of is_array 2024-01-18 13:04:41 -08:00
Marcus Moore
f64aa4dfd4 Improve variable name 2024-01-18 11:58:34 -08:00
Marcus Moore
786c41ad79 Add some type hints 2024-01-17 17:41:03 -08:00
Marcus Moore
b24d80680e Add clarifying comments 2024-01-17 17:32:35 -08:00
Marcus Moore
1a1f417633 Change variable name to keep foreach scoped 2024-01-17 17:00:03 -08:00
Marcus Moore
bbfee27fd3 Implement test 2024-01-17 16:40:05 -08:00
Marcus Moore
691e81d827 Implement some tests 2024-01-17 16:25:28 -08:00
Marcus Moore
0ac1dd314a Organize tests 2024-01-17 13:19:54 -08:00
Marcus Moore
82f4cc799b Improve variable name 2024-01-17 11:54:37 -08:00
Marcus Moore
4d8d069bbc Update placeholder 2024-01-17 11:43:34 -08:00
Marcus Moore
5a396cc997 Add assertion 2024-01-17 11:24:50 -08:00
Marcus Moore
0883321d9e Only limit template creator scope when authenticated 2024-01-17 11:24:38 -08:00
akemidx
2768f19b7c code cleanup 2024-01-16 18:56:29 -05:00
akemidx
20bd83232e standardizing naming to use Template 2024-01-11 19:41:19 -05:00
Marcus Moore
d72970b5b6 Add global scope to limit template to current user 2024-01-11 13:59:51 -08:00
Marcus Moore
9c1bea00ad Add failing test 2024-01-11 13:51:18 -08:00
Marcus Moore
8d8bf73c1b Scaffold additional tests 2024-01-11 13:51:10 -08:00
Marcus Moore
e5fb888d67 Implement test 2024-01-11 13:34:20 -08:00
Marcus Moore
82df7a66ec Add form label and remove info box from show and edit pages 2024-01-11 13:19:36 -08:00
Marcus Moore
0202a97e97 Add missing tag 2024-01-11 13:08:08 -08:00
Marcus Moore
b34886ead6 Move box header into box 2024-01-11 13:04:46 -08:00
akemidx
6f6341bc09 about saved reports box 2024-01-10 16:33:35 -05:00
akemidx
5f8e91455f clarifying name box 2024-01-10 15:39:32 -05:00
akemidx
a5099b5163 translations/messages on report template controller 2024-01-10 15:23:42 -05:00
akemidx
27103124bf messages/translations 2024-01-09 16:49:56 -05:00
Marcus Moore
f2d34b2c03 Remove inline javascript 2024-01-02 18:23:57 -08:00
Marcus Moore
25cba65c6e Remove marker test case 2024-01-02 18:14:50 -08:00
Marcus Moore
a756d2b765 Implement test 2024-01-02 18:14:17 -08:00
Marcus Moore
740d46a50e Repopulate report after validation error 2024-01-02 17:59:30 -08:00
Marcus Moore
d8d92a6d2c Scaffold test case 2024-01-02 17:47:52 -08:00
Marcus Moore
137193ab12 Remove duplicate test 2024-01-02 17:44:22 -08:00
Marcus Moore
fcef60445c Implement radioValue properly 2023-12-21 18:07:46 -08:00
Marcus Moore
9e0897b2cb Remove old comments 2023-12-21 17:40:26 -08:00
Marcus Moore
a23a3b95d6 Partially implement test 2023-12-21 17:15:36 -08:00
Marcus Moore
1ac0be50a7 Remove test case 2023-12-21 17:06:40 -08:00
Marcus Moore
618bbc4bda Mark test as incomplete 2023-12-21 17:03:10 -08:00
Marcus Moore
8c434c7862 Implement and scaffold tests 2023-12-21 17:02:44 -08:00
Marcus Moore
7f153b32e4 Always return an array from selectValues method 2023-12-21 16:38:51 -08:00
Marcus Moore
4fc8e8dd61 Add todo 2023-12-21 14:27:31 -08:00
Marcus Moore
48e5ee2310 Add filtering to remaining selects 2023-12-21 14:19:16 -08:00
Marcus Moore
92e3a1e69e Update variable names 2023-12-21 13:46:27 -08:00
Marcus Moore
7f0e3e288e Scaffold additional test 2023-12-21 13:43:44 -08:00
Marcus Moore
dc27e67b19 Remove edit and delete buttons from edit template view 2023-12-21 13:13:28 -08:00
Marcus Moore
4c62e8ade9 Add guard against attempting to access property on unsaved template 2023-12-21 13:11:44 -08:00
Marcus Moore
87853921c3 Formatting 2023-12-21 13:07:11 -08:00
Marcus Moore
8a496ccebc Formatting 2023-12-21 13:05:56 -08:00
Marcus Moore
3e5f804791 Display "Save" on the update template page button 2023-12-21 13:05:49 -08:00
Marcus Moore
62f8353bd7 Implement model filtering for selectValue method 2023-12-21 13:03:43 -08:00
Marcus Moore
1dd9273f70 Improve readability 2023-12-21 12:50:21 -08:00
Marcus Moore
2eeaef00e1 Improve readability 2023-12-21 12:15:00 -08:00
Marcus Moore
5c0c60a5b9 Formatting 2023-12-21 12:02:54 -08:00
Marcus Moore
6fcbb108c6 Implement test for filtering out invalid models from selectValues 2023-12-21 12:02:48 -08:00
Marcus Moore
71761a48ad A few more small clean ups 2023-12-20 17:50:55 -08:00
Marcus Moore
495d74f7c9 Formatting 2023-12-20 17:11:03 -08:00
Marcus Moore
fda77179a3 Simplify url 2023-12-20 16:48:25 -08:00
Marcus Moore
578495bab6 Update tests 2023-12-20 16:37:27 -08:00
Marcus Moore
9a5c8c4ce6 Formatting and clean ups 2023-12-20 16:24:48 -08:00
Marcus Moore
0504c09a9a Implement ability to delete templates 2023-12-20 16:19:04 -08:00
Marcus Moore
9d062f9849 Make control statements more explicit 2023-12-20 16:08:25 -08:00
Marcus Moore
0527201ae5 Allow templates to be updated 2023-12-20 14:41:23 -08:00
Marcus Moore
cf5c78029c Only show template name input on default screen 2023-12-20 14:12:42 -08:00
Marcus Moore
26cc4497eb Use dedicated show route for report templates 2023-12-20 14:01:46 -08:00
Marcus Moore
c35179b098 Use existing class in place of inline styling 2023-12-20 13:48:31 -08:00
Marcus Moore
b2d0cbb264 Display validation error for report name 2023-12-20 13:44:47 -08:00
akemidx
ebf760a477 translations, UI fixes 2023-12-19 18:01:19 -05:00
Marcus Moore
9fcb1a2d0e Rename SavedReport to ReportTemplate 2023-12-18 12:55:48 -08:00
Marcus Moore
27bb938d9e WIP: add dedicated edit report page 2023-12-13 18:09:42 -08:00
Marcus Moore
75bd056bbe Display saved template name in header 2023-12-13 14:49:38 -08:00
akemidx
ad202be374 update method (WIP ver) 2023-12-13 17:31:58 -05:00
akemidx
ca35b66597 frontys 2023-12-12 19:03:09 -05:00
akemidx
e9e68171bb frontend stuff 2023-12-12 18:56:21 -05:00
Marcus Moore
e791ebbe76 Display report name in input 2023-12-11 16:36:32 -08:00
Marcus Moore
d92893b2c7 Remove old javascript 2023-12-11 16:30:44 -08:00
Marcus Moore
c68a2a36fa Add test case for saving custom reports 2023-12-11 16:25:36 -08:00
Marcus Moore
89c47c1879 Add validation for saving reports 2023-12-11 16:20:36 -08:00
Marcus Moore
b9cda88363 Alphabetize saved reports list 2023-12-11 16:20:17 -08:00
Marcus Moore
52028ddef2 Add authorization to saving saved reports route 2023-12-11 15:34:17 -08:00
Marcus Moore
c3845f4393 Add tests around loading saved reports 2023-12-11 14:29:33 -08:00
Marcus Moore
c9157dc55d Update docblock 2023-12-11 14:20:33 -08:00
Marcus Moore
c3b53b28e3 Allow saving custom reports 2023-12-11 14:19:03 -08:00
akemidx
e636d7b9d5 multiple saved reports, beginning of dynamic dropdown listing/queried url 2023-12-11 15:28:34 -05:00
Marcus Moore
bd86c5430c Add a few typehints 2023-12-11 11:27:56 -08:00
Marcus Moore
4a0bb31866 Scaffold two more test cases 2023-12-07 11:00:26 -08:00
akemidx
b7f6c7df06 html work, code comments for tomorrow's tasks 2023-12-06 18:05:58 -05:00
Marcus Moore
327d27591f Merge branch 'saved-custom-reports' into saving_custom_report_template 2023-11-30 18:15:35 -08:00
Marcus Moore
5041c07c7e WIP: implement restoring checkbox inputs 2023-11-30 18:15:04 -08:00
Marcus Moore
505d601488 Implement restoring date ranges 2023-11-30 17:07:39 -08:00
Marcus Moore
bca7f208a6 Implement restoring select values 2023-11-30 16:57:21 -08:00
Marcus Moore
4f031149e8 Scaffold a couple test cases 2023-11-30 12:12:57 -08:00
Marcus Moore
b7011d853a WIP: add methods to restore settings from saved report 2023-11-02 17:10:50 -07:00
Marcus Moore
06186c9b12 WIP: Simply post the form to a different controller 2023-10-30 16:30:53 -07:00
Marcus Moore
7a5faa9619 Adjust margin on custom report page 2023-10-30 12:03:50 -07:00
akemidx
e5792fd415 api/savereports controller 2023-10-25 14:42:23 -04:00
akemidx
45dbc02868 save commit 2023-09-05 15:01:20 -04:00
akemidx
f1cc2c8d8b submitting form after capturing/formatting fixes 2023-08-29 16:55:21 -04:00
akemidx
734af87f2f template structuring 2023-08-28 19:26:31 -04:00
akemidx
78d589fe78 beginning of migrations 2023-08-24 14:32:37 -04:00
akemidx
c9fcc906fb create saved reports migration 2023-08-23 19:32:19 -04:00
akemidx
f9fc2a44cd alphatyping for layout 2023-08-22 15:19:12 -04:00
1815 changed files with 28967 additions and 288173 deletions

View File

@@ -3235,6 +3235,78 @@
"contributions": [
"code"
]
},
{
"login": "sgross-emlix",
"name": "Sebastian Groß",
"avatar_url": "https://avatars.githubusercontent.com/u/143394709?v=4",
"profile": "https://github.com/sgross-emlix",
"contributions": [
"code"
]
},
{
"login": "AnouarTouati",
"name": "Anouar Touati",
"avatar_url": "https://avatars.githubusercontent.com/u/41107778?v=4",
"profile": "https://github.com/AnouarTouati",
"contributions": [
"code"
]
},
{
"login": "aHVzY2g",
"name": "aHVzY2g",
"avatar_url": "https://avatars.githubusercontent.com/u/25596663?v=4",
"profile": "https://github.com/aHVzY2g",
"contributions": [
"code"
]
},
{
"login": "brlin-tw",
"name": "林博仁 Buo-ren Lin",
"avatar_url": "https://avatars.githubusercontent.com/u/13408130?v=4",
"profile": "https://brlin.me",
"contributions": [
"code"
]
},
{
"login": "addex12",
"name": "Adugna Gizaw",
"avatar_url": "https://avatars.githubusercontent.com/u/18550946?v=4",
"profile": "https://orbalia.pythonanywhere.com/",
"contributions": [
"translation"
]
},
{
"login": "jostrander",
"name": "Jesse Ostrander",
"avatar_url": "https://avatars.githubusercontent.com/u/760989?v=4",
"profile": "https://github.com/jostrander",
"contributions": [
"code"
]
},
{
"login": "azmcnutt",
"name": "James M",
"avatar_url": "https://avatars.githubusercontent.com/u/31522486?v=4",
"profile": "https://github.com/azmcnutt",
"contributions": [
"code"
]
},
{
"login": "Fiala06",
"name": "Fiala06",
"avatar_url": "https://avatars.githubusercontent.com/u/5183146?v=4",
"profile": "https://github.com/Fiala06",
"contributions": [
"code"
]
}
]
}

View File

@@ -11,12 +11,12 @@ MYSQL_ROOT_PASSWORD=changeme1234
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=develop
APP_DEBUG=false
APP_DEBUG=true
# please regenerate the APP_KEY value by calling `docker-compose run --rm snipeit bash` and then `php artisan key:generate --show` and then copy paste the value here
APP_KEY=base64:3ilviXqB9u6DX1NRcyWGJ+sjySF+H18CPDGb3+IVwMQ=
APP_URL=http://localhost:8000
APP_TIMEZONE='UTC'
APP_LOCALE=en
APP_LOCALE=en-US
MAX_RESULTS=500
# --------------------------------------------
@@ -158,7 +158,7 @@ RESET_PASSWORD_LINK_EXPIRES=900
# --------------------------------------------
# OPTIONAL: MISC
# --------------------------------------------
LOG_CHANNEL=stderr
LOG_CHANNEL=single
LOG_MAX_DAYS=10
APP_LOCKED=false
APP_CIPHER=AES-256-CBC

View File

@@ -1,7 +1,7 @@
# --------------------------------------------
# REQUIRED: DOCKER SPECIFIC SETTINGS
# --------------------------------------------
APP_VERSION=v6.4.1
APP_VERSION=
APP_PORT=8000
# --------------------------------------------
@@ -9,7 +9,7 @@ APP_PORT=8000
# --------------------------------------------
APP_ENV=production
APP_DEBUG=false
# Please regenerate the APP_KEY value by calling `docker compose run --rm snipeit php artisan key:generate --show`. Copy paste the value here
# Please regenerate the APP_KEY value by calling `docker compose run --rm app php artisan key:generate --show`. Copy paste the value here
APP_KEY=base64:3ilviXqB9u6DX1NRcyWGJ+sjySF+H18CPDGb3+IVwMQ=
APP_URL=http://localhost:8000
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - TZ identifier

View File

@@ -80,6 +80,12 @@ MAIL_BACKUP_NOTIFICATION_ADDRESS=null
BACKUP_ENV=true
ALLOW_BACKUP_DELETE=false
ALLOW_DATA_PURGE=false
ALL_BACKUP_KEEP_DAYS=7
DAILY_BACKUP_KEEP_DAYS=16
WEEKLY_BACKUP_KEEP_WEEKS=8
MONTHLY_BACKUP_KEEP_MONTHS=4
YEARLY_BACKUP_KEEP_YEARS=2
BACKUP_PURGE_OLDEST_AT_MEGS=5000
# --------------------------------------------
# OPTIONAL: SESSION SETTINGS
@@ -93,7 +99,7 @@ PASSPORT_COOKIE_NAME='snipeit_passport_token'
COOKIE_DOMAIN=null
SECURE_COOKIES=false
API_TOKEN_EXPIRATION_YEARS=15
BS_TABLE_STORAGE=cookieStorage
BS_TABLE_STORAGE=localStorage
BS_TABLE_DEEPLINK=true
# --------------------------------------------

View File

@@ -1,38 +0,0 @@
#### Expected Behavior (or desired behavior if a feature request)
(what you expect to happen goes here)
-----
#### Actual Behavior
(what actually happens goes here)
-----
#### Please confirm you have done the following before posting your bug report:
- [ ] I have enabled debug mode
- [ ] I have read [checked the Common Issues page](https://snipe-it.readme.io/docs/common-issues)
-----
#### Provide answers to these questions:
- Is this a fresh install or an upgrade?
- Version of Snipe-IT you're running
- Version of PHP you're running
- Version of MySQL/MariaDB you're running
- What OS and web server you're running Snipe-IT on
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
- WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
- What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error
- If a stacktrace is provided in the error, include that too.
- Any errors that appear in your browser's error console.
- Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
- Include any additional information you can find in `storage/logs` and your webserver's logs.
- Include what you've done so far in the installation, and if you got any error messages along the way.
- Indicate whether or not you've manually edited any data directly in the database
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
https://snipe-it.readme.io/docs/getting-help

View File

@@ -1,129 +0,0 @@
name: Bug Report
description: Create a report to help us improve
body:
- type: checkboxes
attributes:
label: Debug mode
description: Please confirm you have done the following before posting your bug report
options:
- label: I have enabled debug mode
required: true
- label: I have read [checked the Common Issues page](https://snipe-it.readme.io/docs/common-issues)
required: true
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Reproduction steps
description: Steps to reproduce the behavior.
value: |
1.
2.
3.
...
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Screenshots
description: 'If applicable, add screenshots to help explain your problem.'
- type: markdown
attributes:
value: "### Server"
- type: input
attributes:
label: Snipe-IT Version
validations:
required: true
- type: input
id: server_operatingSystem
attributes:
label: Operating System
description: 'e.g. Ubuntu, Windows'
validations:
required: true
- type: input
attributes:
label: Web Server
description: 'e.g. Apache, IIS'
validations:
required: true
- type: input
attributes:
label: PHP Version
validations:
required: true
- type: markdown
attributes:
value: "### Desktop"
- type: input
id: desktop_operatingSystem
attributes:
label: Operating System
description: 'e.g. Ubuntu, Windows'
- type: input
id: desktop_browser
attributes:
label: Browser
description: 'e.g. Google Chrome, Safari'
- type: input
id: desktop_version
attributes:
label: Version
description: 'e.g. 93'
- type: markdown
attributes:
value: "### Mobile"
- type: input
attributes:
label: Device
description: 'e.g. iPhone 6, Pixel 4a'
- type: input
id: mobile_operatingSystem
attributes:
label: Operating System
description: 'e.g. iOS 8.1, Android 9'
- type: input
id: mobile_browser
attributes:
label: Browser
description: 'e.g. Google Chrome, Safari'
- type: input
id: mobile_version
attributes:
label: Version
description: 'e.g. 93'
- type: textarea
attributes:
label: Error messages
description: |
WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
If a stacktrace is provided in the error, include that too.
Any errors that appear in your browser's error console.
Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
Include any additional information you can find in `storage/logs` and your webserver's logs.
Include the output from `php -m` (this should display what modules you have enabled.)
render: shell
- type: textarea
attributes:
label: Additional context
description: |
Is this a fresh install or an upgrade?
What OS and web server you're running Snipe-IT on
What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
Include what you've done so far in the installation, and if you got any error messages along the way.
Indicate whether or not you've manually edited any data directly in the database
Add any other context about the problem here.
- type: markdown
attributes:
value: Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

View File

@@ -1 +0,0 @@
blank_issues_enabled: false

View File

@@ -1,25 +0,0 @@
name: Feature Request
description: Suggest an idea for this project
title: "[Feature Request]: "
labels: ["feature request"]
body:
- type: textarea
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is. The more information you can provide about your use-case, the more liklely we are to consider your feature.
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.

View File

@@ -1,40 +0,0 @@
# Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context, providing screenshots where practical. List any dependencies that are required for this change.
Fixes # (issue)
## Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
# How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
- [ ] Test A
- [ ] Test B
**Test Configuration**:
* PHP version:
* MySQL version
* Webserver version
* OS version
# Checklist:
- [ ] I have read the Contributing documentation available here: https://snipe-it.readme.io/docs/contributing-overview
- [ ] I have formatted this PR according to the project guidelines: https://snipe-it.readme.io/docs/contributing-overview#pull-request-guidelines
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes

View File

@@ -1 +0,0 @@
memory_limit= 2048M

View File

@@ -1,7 +0,0 @@
# Configuration for weekly-digest - https://github.com/apps/weekly-digest
publishDay: sun
canPublishIssues: true
canPublishPullRequests: true
canPublishContributors: true
canPublishStargazers: true
canPublishCommits: true

View File

@@ -25,9 +25,9 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
name: PHP ${{ matrix.php-version }}
@@ -67,7 +67,7 @@ jobs:
run: |
php artisan key:generate
php artisan migrate --force
php artisan passport:install
php artisan passport:install --no-interaction
chmod -R 777 storage bootstrap/cache
- name: Execute tests (Unit and Feature tests) via PHPUnit

View File

@@ -21,9 +21,10 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
name: PHP ${{ matrix.php-version }}
@@ -64,7 +65,7 @@ jobs:
run: |
php artisan key:generate
php artisan migrate --force
php artisan passport:install
php artisan passport:install --no-interaction
chmod -R 777 storage bootstrap/cache
- name: Execute tests (Unit and Feature tests) via PHPUnit

View File

@@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1.1"
- "8.3"
name: PHP ${{ matrix.php-version }}
@@ -43,6 +43,9 @@ jobs:
cp -v .env.testing.example .env
cp -v .env.testing.example .env.testing
- name: Create database file
run: touch database/database.sqlite
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
@@ -57,5 +60,5 @@ jobs:
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite_testing
DB_CONNECTION: sqlite
run: php artisan test

View File

@@ -3,8 +3,8 @@
"DOC2": "In other words, what you see locally are the requirements for your _current_ install",
"DOC3": "Please don't rely on these versions for planning upgrades unless you've fetched the most recent version",
"DOC4": "You should really just ignore it and run upgrade.php. Really",
"php_min_version": "8.1.0",
"php_max_major_minor": "8.3",
"php_max_wontwork": "8.4.0",
"current_snipeit_version": "7.0"
"php_min_version": "8.2.0",
"php_max_major_minor": "8.4",
"php_max_wontwork": "8.5.0",
"current_snipeit_version": "8.0"
}

View File

@@ -52,7 +52,8 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [<img src="https://avatars.githubusercontent.com/u/47315739?v=4" width="110px;"/><br /><sub>bilias</sub>](https://github.com/bilias)<br />[💻](https://github.com/snipe/snipe-it/commits?author=bilias "Code") | [<img src="https://avatars.githubusercontent.com/u/2565989?v=4" width="110px;"/><br /><sub>coach1988</sub>](https://github.com/coach1988)<br />[💻](https://github.com/snipe/snipe-it/commits?author=coach1988 "Code") | [<img src="https://avatars.githubusercontent.com/u/11910225?v=4" width="110px;"/><br /><sub>MrM</sub>](https://github.com/mauro-miatello)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mauro-miatello "Code") | [<img src="https://avatars.githubusercontent.com/u/60405354?v=4" width="110px;"/><br /><sub>koiakoia</sub>](https://github.com/koiakoia)<br />[💻](https://github.com/snipe/snipe-it/commits?author=koiakoia "Code") | [<img src="https://avatars.githubusercontent.com/u/5323832?v=4" width="110px;"/><br /><sub>Mustafa Online</sub>](https://github.com/mustafa-online)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mustafa-online "Code") | [<img src="https://avatars.githubusercontent.com/u/104601439?v=4" width="110px;"/><br /><sub>franceslui</sub>](https://github.com/franceslui)<br />[💻](https://github.com/snipe/snipe-it/commits?author=franceslui "Code") | [<img src="https://avatars.githubusercontent.com/u/125313163?v=4" width="110px;"/><br /><sub>Q4kK</sub>](https://github.com/Q4kK)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Q4kK "Code") |
| [<img src="https://avatars.githubusercontent.com/u/55590532?v=4" width="110px;"/><br /><sub>squintfox</sub>](https://github.com/squintfox)<br />[💻](https://github.com/snipe/snipe-it/commits?author=squintfox "Code") | [<img src="https://avatars.githubusercontent.com/u/1380084?v=4" width="110px;"/><br /><sub>Jeff Clay</sub>](https://github.com/jeffclay)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jeffclay "Code") | [<img src="https://avatars.githubusercontent.com/u/52716446?v=4" width="110px;"/><br /><sub>Phil J R</sub>](https://github.com/PP-JN-RL)<br />[💻](https://github.com/snipe/snipe-it/commits?author=PP-JN-RL "Code") | [<img src="https://avatars.githubusercontent.com/u/1496725?v=4" width="110px;"/><br /><sub>i_virus</sub>](https://www.corelight.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chandanchowdhury "Code") | [<img src="https://avatars.githubusercontent.com/u/1020541?v=4" width="110px;"/><br /><sub>Paul Grime</sub>](https://github.com/gitgrimbo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gitgrimbo "Code") | [<img src="https://avatars.githubusercontent.com/u/922815?v=4" width="110px;"/><br /><sub>Lee Porte</sub>](https://leeporte.co.uk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=LeePorte "Code") | [<img src="https://avatars.githubusercontent.com/u/23613427?v=4" width="110px;"/><br /><sub>BRYAN </sub>](https://github.com/bryanlopezinc)<br />[💻](https://github.com/snipe/snipe-it/commits?author=bryanlopezinc "Code") [⚠️](https://github.com/snipe/snipe-it/commits?author=bryanlopezinc "Tests") |
| [<img src="https://avatars.githubusercontent.com/u/64061710?v=4" width="110px;"/><br /><sub>U-H-T</sub>](https://github.com/U-H-T)<br />[💻](https://github.com/snipe/snipe-it/commits?author=U-H-T "Code") | [<img src="https://avatars.githubusercontent.com/u/5395363?v=4" width="110px;"/><br /><sub>Matt Tyree</sub>](https://github.com/Tyree)<br />[📖](https://github.com/snipe/snipe-it/commits?author=Tyree "Documentation") | [<img src="https://avatars.githubusercontent.com/u/292081?v=4" width="110px;"/><br /><sub>Florent Bervas</sub>](http://spoontux.net)<br />[💻](https://github.com/snipe/snipe-it/commits?author=FlorentDotMe "Code") | [<img src="https://avatars.githubusercontent.com/u/4498077?v=4" width="110px;"/><br /><sub>Daniel Albertsen</sub>](https://ditscheri.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dbakan "Code") | [<img src="https://avatars.githubusercontent.com/u/100710244?v=4" width="110px;"/><br /><sub>r-xyz</sub>](https://github.com/r-xyz)<br />[💻](https://github.com/snipe/snipe-it/commits?author=r-xyz "Code") | [<img src="https://avatars.githubusercontent.com/u/47491036?v=4" width="110px;"/><br /><sub>Steven Mainor</sub>](https://github.com/DrekiDegga)<br />[💻](https://github.com/snipe/snipe-it/commits?author=DrekiDegga "Code") | [<img src="https://avatars.githubusercontent.com/u/65785975?v=4" width="110px;"/><br /><sub>arne-kroeger</sub>](https://github.com/arne-kroeger)<br />[💻](https://github.com/snipe/snipe-it/commits?author=arne-kroeger "Code") |
| [<img src="https://avatars.githubusercontent.com/u/167117705?v=4" width="110px;"/><br /><sub>Glukose1</sub>](https://github.com/Glukose1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Glukose1 "Code") | [<img src="https://avatars.githubusercontent.com/u/1197791?v=4" width="110px;"/><br /><sub>Scarzy</sub>](https://github.com/Scarzy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Scarzy "Code") | [<img src="https://avatars.githubusercontent.com/u/37372069?v=4" width="110px;"/><br /><sub>setpill</sub>](https://github.com/setpill)<br />[💻](https://github.com/snipe/snipe-it/commits?author=setpill "Code") | [<img src="https://avatars.githubusercontent.com/u/3755203?v=4" width="110px;"/><br /><sub>swift2512</sub>](https://github.com/swift2512)<br />[🐛](https://github.com/snipe/snipe-it/issues?q=author%3Aswift2512 "Bug reports") | [<img src="https://avatars.githubusercontent.com/u/6136439?v=4" width="110px;"/><br /><sub>Darren Rainey</sub>](https://darrenraineys.co.uk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=DarrenRainey "Code") | [<img src="https://avatars.githubusercontent.com/u/133033121?v=4" width="110px;"/><br /><sub>maciej-poleszczyk</sub>](https://github.com/maciej-poleszczyk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=maciej-poleszczyk "Code") |
| [<img src="https://avatars.githubusercontent.com/u/167117705?v=4" width="110px;"/><br /><sub>Glukose1</sub>](https://github.com/Glukose1)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Glukose1 "Code") | [<img src="https://avatars.githubusercontent.com/u/1197791?v=4" width="110px;"/><br /><sub>Scarzy</sub>](https://github.com/Scarzy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Scarzy "Code") | [<img src="https://avatars.githubusercontent.com/u/37372069?v=4" width="110px;"/><br /><sub>setpill</sub>](https://github.com/setpill)<br />[💻](https://github.com/snipe/snipe-it/commits?author=setpill "Code") | [<img src="https://avatars.githubusercontent.com/u/3755203?v=4" width="110px;"/><br /><sub>swift2512</sub>](https://github.com/swift2512)<br />[🐛](https://github.com/snipe/snipe-it/issues?q=author%3Aswift2512 "Bug reports") | [<img src="https://avatars.githubusercontent.com/u/6136439?v=4" width="110px;"/><br /><sub>Darren Rainey</sub>](https://darrenraineys.co.uk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=DarrenRainey "Code") | [<img src="https://avatars.githubusercontent.com/u/133033121?v=4" width="110px;"/><br /><sub>maciej-poleszczyk</sub>](https://github.com/maciej-poleszczyk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=maciej-poleszczyk "Code") | [<img src="https://avatars.githubusercontent.com/u/143394709?v=4" width="110px;"/><br /><sub>Sebastian Groß</sub>](https://github.com/sgross-emlix)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sgross-emlix "Code") |
| [<img src="https://avatars.githubusercontent.com/u/41107778?v=4" width="110px;"/><br /><sub>Anouar Touati</sub>](https://github.com/AnouarTouati)<br />[💻](https://github.com/snipe/snipe-it/commits?author=AnouarTouati "Code") | [<img src="https://avatars.githubusercontent.com/u/25596663?v=4" width="110px;"/><br /><sub>aHVzY2g</sub>](https://github.com/aHVzY2g)<br />[💻](https://github.com/snipe/snipe-it/commits?author=aHVzY2g "Code") | [<img src="https://avatars.githubusercontent.com/u/13408130?v=4" width="110px;"/><br /><sub>林博仁 Buo-ren Lin</sub>](https://brlin.me)<br />[💻](https://github.com/snipe/snipe-it/commits?author=brlin-tw "Code") | [<img src="https://avatars.githubusercontent.com/u/18550946?v=4" width="110px;"/><br /><sub>Adugna Gizaw</sub>](https://orbalia.pythonanywhere.com/)<br />[🌍](#translation-addex12 "Translation") | [<img src="https://avatars.githubusercontent.com/u/760989?v=4" width="110px;"/><br /><sub>Jesse Ostrander</sub>](https://github.com/jostrander)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jostrander "Code") | [<img src="https://avatars.githubusercontent.com/u/31522486?v=4" width="110px;"/><br /><sub>James M</sub>](https://github.com/azmcnutt)<br />[💻](https://github.com/snipe/snipe-it/commits?author=azmcnutt "Code") | [<img src="https://avatars.githubusercontent.com/u/5183146?v=4" width="110px;"/><br /><sub>Fiala06</sub>](https://github.com/Fiala06)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Fiala06 "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

View File

@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04
LABEL maintainer="Brady Wetherington <bwetherington@grokability.com>"
# No need to add `apt-get clean` here, reference:
@@ -14,16 +14,16 @@ RUN export DEBIAN_FRONTEND=noninteractive; \
apt-utils \
apache2 \
apache2-bin \
libapache2-mod-php8.1 \
php8.1-curl \
php8.1-ldap \
php8.1-mysql \
php8.1-gd \
php8.1-xml \
php8.1-mbstring \
php8.1-zip \
php8.1-bcmath \
php8.1-redis \
libapache2-mod-php8.3 \
php8.3-curl \
php8.3-ldap \
php8.3-mysql \
php8.3-gd \
php8.3-xml \
php8.3-mbstring \
php8.3-zip \
php8.3-bcmath \
php8.3-redis \
php-memcached \
patch \
curl \
@@ -40,8 +40,7 @@ autoconf \
libc-dev \
libldap-common \
pkg-config \
libmcrypt-dev \
php8.1-dev \
php8.3-dev \
ca-certificates \
unzip \
dnsutils \
@@ -51,18 +50,13 @@ dnsutils \
RUN curl -L -O https://github.com/pear/pearweb_phars/raw/master/go-pear.phar
RUN php go-pear.phar
RUN pecl install mcrypt
RUN bash -c "echo extension=/usr/lib/php/20210902/mcrypt.so > /etc/php/8.1/mods-available/mcrypt.ini"
RUN phpenmod mcrypt
RUN phpenmod gd
RUN phpenmod bcmath
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/8.1/apache2/php.ini
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/8.1/cli/php.ini
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/8.3/apache2/php.ini
RUN sed -i 's/variables_order = .*/variables_order = "EGPCS"/' /etc/php/8.3/cli/php.ini
RUN useradd -m --uid 1000 --gid 50 docker
RUN useradd -m --uid 10000 --gid 50 docker
RUN echo export APACHE_RUN_USER=docker >> /etc/apache2/envvars
RUN echo export APACHE_RUN_GROUP=staff >> /etc/apache2/envvars

View File

@@ -73,7 +73,7 @@ RUN mkdir -p /var/www/.composer && chown apache /var/www/.composer
# Install dependencies
USER apache
RUN COMPOSER_CACHE_DIR=/dev/null composer install --no-dev --working-dir=/var/www/html
RUN COMPOSER_CACHE_DIR=/dev/null composer install --working-dir=/var/www/html
USER root

View File

@@ -7,7 +7,7 @@
This is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was purchased in order to depreciate it correctly, handling software licenses, etc.
It is built on [Laravel 10](http://laravel.com).
It is built on [Laravel 11](http://laravel.com).
Snipe-IT is actively developed and we [release quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](https://snipeitapp.com/demo/).)
@@ -94,6 +94,8 @@ Since the release of the JSON REST API, several third-party developers have been
- [SnipeAgent](https://github.com/ReticentRobot/SnipeAgent) by [@ReticentRobot](https://github.com/ReticentRobot) - Windows agent for Snipe-IT.
- [Gate Pass Generator](https://github.com/cha7uraAE/snipe-it-gate-pass-system) by [@cha7uraAE](https://github.com/cha7uraAE) - A Streamlit application for generating gate passes based on hardware data from a Snipe-IT API.
We also have a handful of [Google Apps scripts](https://github.com/grokability/google-apps-scripts-for-snipe-it) to help with various tasks.
-----
### Join the Community!
@@ -102,7 +104,7 @@ Since the release of the JSON REST API, several third-party developers have been
- **Follow us on Bluesky** at [@snipeitapp.com](https://bsky.app/profile/snipeitapp.com)
- **Follow us on Mastodon** at [hachyderm.io/@grokability](https://hachyderm.io/@grokability)
- **Follow our blog** at [Grokstar.Dev](https://grokstar.dev)
- **Subscribe here** on Github for notifications about new releases. (We recommend selecting "Releases" only for mosrt users - this repo can get noisy.)
- **Subscribe here** on Github for notifications about new releases. (We recommend selecting "Releases" only for most users - this repo can get noisy.)
-----

View File

@@ -10,10 +10,12 @@ however there are times when library dependencies and/or PHP/MySQL dependencies
make it impossible to backport security fixes on older versions.
| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
|---------| ------------------ |
| 7.x | :white_check_mark: |
| 6.x | :x: |
| 5.1.x | :x: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| 4.0.x | :x: |
| < 4.0 | :x: |
## Reporting a Vulnerability

View File

@@ -125,6 +125,10 @@ class LdapSync extends Command
*/
$attributes = array_values(array_filter($ldap_map));
if (Setting::getSettings()->is_ad === 1 && is_null($ldap_map['active_flag'])) {
$attributes[] = 'useraccountcontrol';
}
$results = Ldap::findLdapUsers($search_base, -1, $filter, $attributes);
} catch (\Exception $e) {
@@ -357,9 +361,15 @@ class LdapSync extends Command
// (Specifically, we don't handle a value of '0.0' correctly)
$raw_value = @$results[$i][$ldap_map["active_flag"]][0];
$filter_var = filter_var($raw_value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
$boolean_cast = (bool) $raw_value;
if (Setting::getSettings()->ldap_invert_active_flag === 1) {
// Because ldap_active_flag is set, if filter_var is true or boolean_cast is true, then user is suspended
$user->activated = !($filter_var ?? $boolean_cast);
}else{
$user->activated = $filter_var ?? $boolean_cast; // if filter_var() was true or false, use that. If it's null, use the $boolean_cast
}
} elseif (array_key_exists('useraccountcontrol', $results[$i])) {
// ....otherwise, (ie if no 'active' LDAP flag is defined), IF the UAC setting exists,
@@ -424,10 +434,20 @@ class LdapSync extends Command
$item['note'] = $item['createorupdate'];
$item['status'] = 'success';
if ($item['createorupdate'] === 'created' && $ldap_default_group) {
// Check if the relationship already exists
if (!$user->groups()->where('group_id', $ldap_default_group)->exists()) {
$user->groups()->attach($ldap_default_group);
}
}
//updates assets location based on user's location
Asset::where('assigned_to', '=', $user->id)->update(['location_id' => $user->location_id]);
if ($user->wasChanged('location_id')) {
foreach ($user->assets as $asset) {
$asset->location_id = $user->location_id;
// TODO: somehow add note? "Asset Location Changed because of thing"
$asset->save();
}
}
} else {
foreach ($user->getErrors()->getMessages() as $key => $err) {

View File

@@ -59,7 +59,7 @@ class ObjectImportCommand extends Command
$classString = "App\\Importer\\{$class}Importer";
$importer = new $classString($filename);
$importer->setCallbacks([$this, 'log'], [$this, 'progress'], [$this, 'errorCallback'])
->setUserId($this->option('user_id'))
->setCreatedBy($this->option('user_id'))
->setUpdating($this->option('update'))
->setShouldNotify($this->option('send-welcome'))
->setUsernameFormat($this->option('username_format'));

View File

@@ -1,157 +0,0 @@
<?php
namespace App\Console\Commands;
use App\LegacyEncrypter\McryptEncrypter;
use App\Models\Asset;
use App\Models\CustomField;
use App\Models\Setting;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
class RecryptFromMcrypt extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:legacy-recrypt
{--force : Force a re-crypt of encrypted data from MCRYPT.}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command allows upgrading users to de-encrypt their deprecated mcrypt encrypted fields and re-encrypt them using the current OpenSSL encryption.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
// Check and see if they have a legacy app key listed in their .env
// If not, we can try to use the current APP_KEY if looks like it's old
$legacy_key = env('LEGACY_APP_KEY');
$key_parts = explode(':', $legacy_key);
$legacy_cipher = env('LEGACY_CIPHER', 'rijndael-256');
$errors = [];
if (! $legacy_key) {
$this->error('ERROR: You do not have a LEGACY_APP_KEY set in your .env file. Please locate your old APP_KEY and ADD a line to your .env file like: LEGACY_APP_KEY=YOUR_OLD_APP_KEY');
return false;
}
// Do some basic legacy app key length checks
if (strlen($legacy_key) == 32) {
$legacy_length_check = true;
} elseif (array_key_exists('1', $key_parts) && (strlen($key_parts[1]) == 44)) {
$legacy_key = base64_decode($key_parts[1], true);
$legacy_length_check = true;
} else {
$legacy_length_check = false;
}
// Check that the app key is 32 characters
if ($legacy_length_check === true) {
$this->comment('INFO: Your LEGACY_APP_KEY looks correct. Okay to continue.');
} else {
$this->error('ERROR: Your LEGACY_APP_KEY is not the correct length (32 characters or base64 followed by 44 characters for later versions). Please locate your old APP_KEY and use that as your LEGACY_APP_KEY in your .env file to continue.');
return false;
}
$this->error('================================!!!! WARNING !!!!================================');
$this->error('================================!!!! WARNING !!!!================================');
$this->comment("This tool will attempt to decrypt your old Snipe-IT (mcrypt, now deprecated) encrypted data and re-encrypt it using OpenSSL. \n\nYou should only continue if you have backed up any and all old APP_KEYs and have backed up your data.");
$force = ($this->option('force')) ? true : false;
if ($force || ($this->confirm('Are you SURE you wish to continue?'))) {
$backup_file = 'backups/env-backups/'.'app_key-'.date('Y-m-d-gis');
try {
Storage::disk('local')->put($backup_file, 'APP_KEY: '.config('app.key'));
Storage::disk('local')->append($backup_file, 'LEGACY_APP_KEY: '.$legacy_key);
} catch (\Exception $e) {
$this->info('WARNING: Could not backup app keys');
}
if ($legacy_cipher) {
$mcrypter = new McryptEncrypter($legacy_key, $legacy_cipher);
} else {
$mcrypter = new McryptEncrypter($legacy_key);
}
$settings = Setting::getSettings();
if ($settings->ldap_pword == '') {
$this->comment('INFO: No LDAP password found. Skipping... ');
} else {
$decrypted_ldap_pword = $mcrypter->decrypt($settings->ldap_pword);
$settings->ldap_pword = Crypt::encrypt($decrypted_ldap_pword);
$settings->save();
}
/** @var CustomField[] $custom_fields */
$custom_fields = CustomField::where('field_encrypted', '=', 1)->get();
$this->comment('INFO: Retrieving encrypted custom fields...');
$query = Asset::withTrashed();
foreach ($custom_fields as $custom_field) {
$this->comment('FIELD TO RECRYPT: '.$custom_field->name.' ('.$custom_field->db_column.')');
$query->orWhereNotNull($custom_field->db_column);
}
// Get all assets with a value in any of the fields that were encrypted
/** @var Asset[] $assets */
$assets = $query->get();
$bar = $this->output->createProgressBar(count($assets));
foreach ($assets as $asset) {
foreach ($custom_fields as $encrypted_field) {
$columnName = $encrypted_field->db_column;
// Make sure the value isn't null
if ($asset->{$columnName} != '') {
// Try to decrypt the payload using the legacy app key
try {
$decrypted_field = $mcrypter->decrypt($asset->{$columnName});
$asset->{$columnName} = Crypt::encrypt($decrypted_field);
$this->comment($decrypted_field);
} catch (\Exception $e) {
$errors[] = ' - ERROR: Could not decrypt field ['.$encrypted_field->name.']: '.$e->getMessage();
}
}
}
$asset->save();
$bar->advance();
}
$bar->finish();
if (count($errors) > 0) {
$this->comment("\n\n");
$this->error("The decrypter encountered some errors: \n");
foreach ($errors as $error) {
$this->error($error);
}
}
}
}
}

View File

@@ -50,12 +50,12 @@ class ResetDemoSettings extends Command
$settings->alert_email = 'service@snipe-it.io';
$settings->login_note = 'Use `admin` / `password` to login to the demo.';
$settings->header_color = null;
$settings->barcode_type = 'QRCODE';
$settings->label2_2d_type = 'QRCODE';
$settings->default_currency = 'USD';
$settings->brand = 2;
$settings->ldap_enabled = 0;
$settings->full_multiple_companies_support = 0;
$settings->alt_barcode = 'C128';
$settings->label2_1d_type = 'C128';
$settings->skin = '';
$settings->email_domain = 'snipeitapp.com';
$settings->email_format = 'filastname';
@@ -65,7 +65,7 @@ class ResetDemoSettings extends Command
$settings->thumbnail_max_h = '30';
$settings->locale = 'en-US';
$settings->version_footer = 'on';
$settings->support_footer = null;
$settings->support_footer = 'on';
$settings->saml_enabled = '0';
$settings->saml_sp_x509cert = null;
$settings->saml_idp_metadata = null;

View File

@@ -51,6 +51,8 @@ class SQLStreamer {
/* we *could* have made the ^INSERT INTO blah VALUES$ turn on the capturing state, and closed it with
a ^(blahblah);$ but it's cleaner to not have to manage the state machine. We're just going to
assume that (blahblah), or (blahblah); are values for INSERT and are always acceptable. */
"<^/\*!40101 SET NAMES '?[a-zA-Z0-9_-]+'? \*/;$>" => false, //using weird delimiters (<,>) for readability. allow quoted or unquoted charsets
"<^/\*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' \*/;$>" => false, //same, now handle zero-values
];
foreach($allowed_statements as $statement => $statechange) {
@@ -370,7 +372,7 @@ class RestoreFromBackup extends Command
if ($this->option('sanitize-guess-prefix')) {
$prefix = SQLStreamer::guess_prefix($sql_contents);
$this->line($prefix);
return $this->info("Re-run this command with '--sanitize-with-prefix=".$prefix."' to see an attempt to sanitze your SQL.");
return $this->info("Re-run this command with '--sanitize-with-prefix=".$prefix."' to see an attempt to sanitize your SQL.");
}
// If we're doing --sql-stdout-only, handle that now so we don't have to open pipes to mysql and all of that silliness

View File

@@ -2,15 +2,15 @@
namespace App\Console\Commands;
use App\Mail\UnacceptedAssetReminderMail;
use App\Models\Asset;
use App\Models\CheckoutAcceptance;
use App\Models\Setting;
use App\Models\User;
use App\Notifications\CheckoutAssetNotification;
use App\Notifications\CurrentInventory;
use App\Notifications\UnacceptedAssetReminderNotification;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Mail;
class SendAcceptanceReminder extends Command
{
@@ -64,43 +64,45 @@ class SendAcceptanceReminder extends Command
->groupBy(function($item) {
return $item['acceptance']->assignedTo ? $item['acceptance']->assignedTo->id : '';
});
$no_mail_address = [];
$no_email_list= [];
foreach($unacceptedAssetGroups as $unacceptedAssetGroup) {
$item_count = $unacceptedAssetGroup->count();
foreach ($unacceptedAssetGroup as $unacceptedAsset) {
// if ($unacceptedAsset['acceptance']->assignedTo->email == ''){
// $no_mail_address[] = $unacceptedAsset['checkoutable']->assignedTo->present()->fullName;
// }
if ($unacceptedAsset['acceptance']->assignedTo) {
// The [0] is weird, but it allows for the item_count to work and grabs the appropriate info for each user.
// Collapsing and flattening the collection doesn't work above.
$acceptance = $unacceptedAssetGroup[0]['acceptance'];
if (!$unacceptedAsset['acceptance']->assignedTo->locale) {
Notification::locale(Setting::getSettings()->locale)->send(
$unacceptedAsset['acceptance']->assignedTo,
new UnacceptedAssetReminderNotification($unacceptedAsset['assetItem'], $count)
);
$locale = $acceptance->assignedTo?->locale;
$email = $acceptance->assignedTo?->email;
if(!$email){
$no_email_list[] = [
'id' => $acceptance->assignedTo?->id,
'name' => $acceptance->assignedTo?->present()->fullName(),
];
} else {
Notification::send(
$unacceptedAsset['acceptance']->assignedTo,
new UnacceptedAssetReminderNotification($unacceptedAsset, $item_count)
);
}
$count++;
}
}
$item_count = $unacceptedAssetGroup->count();
if ($locale && $email) {
Mail::to($email)->send((new UnacceptedAssetReminderMail($acceptance, $item_count))->locale($locale));
} elseif ($email) {
Mail::to($email)->send((new UnacceptedAssetReminderMail($acceptance, $item_count)));
}
if (!empty($no_mail_address)) {
foreach($no_mail_address as $user) {
return $user.' has no email.';
}
}
$this->info($count.' users notified.');
$headers = ['ID', 'Name'];
$rows = [];
foreach ($no_email_list as $user) {
$rows[] = [$user['id'], $user['name']];
}
$this->info("The following users do not have an email address:");
$this->table($headers, $rows);
return 0;
}
}

View File

@@ -2,13 +2,13 @@
namespace App\Console\Commands;
use App\Mail\ExpiringAssetsMail;
use App\Mail\ExpiringLicenseMail;
use App\Models\Asset;
use App\Models\License;
use App\Models\Recipients\AlertRecipient;
use App\Models\Setting;
use App\Notifications\ExpiringAssetsNotification;
use App\Notifications\ExpiringLicenseNotification;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;
class SendExpirationAlerts extends Command
{
@@ -42,27 +42,27 @@ class SendExpirationAlerts extends Command
public function handle()
{
$settings = Setting::getSettings();
$threshold = $settings->alert_interval;
$alert_interval = $settings->alert_interval;
if (($settings->alert_email != '') && ($settings->alerts_enabled == 1)) {
// Send a rollup to the admin, if settings dictate
$recipients = collect(explode(',', $settings->alert_email))->map(function ($item, $key) {
return new AlertRecipient($item);
});
$recipients = collect(explode(',', $settings->alert_email))
->map(fn($item) => trim($item)) // Trim each email
->all();
// Expiring Assets
$assets = Asset::getExpiringWarrantee($threshold);
$assets = Asset::getExpiringWarrantee($alert_interval);
if ($assets->count() > 0) {
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $threshold]));
\Notification::send($recipients, new ExpiringAssetsNotification($assets, $threshold));
$this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $alert_interval]));
Mail::to($recipients)->send(new ExpiringAssetsMail($assets, $alert_interval));
}
// Expiring licenses
$licenses = License::getExpiringLicenses($threshold);
$licenses = License::getExpiringLicenses($alert_interval);
if ($licenses->count() > 0) {
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $threshold]));
\Notification::send($recipients, new ExpiringLicenseNotification($licenses, $threshold));
$this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $alert_interval]));
Mail::to($recipients)->send(new ExpiringLicenseMail($licenses, $alert_interval));
}
} else {
if ($settings->alert_email == '') {

View File

@@ -2,13 +2,12 @@
namespace App\Console\Commands;
use App\Mail\SendUpcomingAuditMail;
use App\Models\Asset;
use App\Models\Recipients\AlertRecipient;
use App\Models\Setting;
use App\Notifications\SendUpcomingAuditNotification;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;
class SendUpcomingAuditReport extends Command
{
@@ -48,19 +47,19 @@ class SendUpcomingAuditReport extends Command
$today = Carbon::now();
$interval_date = $today->copy()->addDays($interval);
$assets = Asset::whereNull('deleted_at')->DueOrOverdueForAudit($settings)->orderBy('assets.next_audit_date', 'desc')->get();
$this->info($assets->count().' assets must be audited in on or before '.$interval_date.' is deadline');
$assets = Asset::whereNull('deleted_at')->dueOrOverdueForAudit($settings)->orderBy('assets.next_audit_date', 'desc')->get();
$this->info($assets->count() . ' assets must be audited in on or before ' . $interval_date . ' is deadline');
if (($assets) && ($assets->count() > 0) && ($settings->alert_email != '')) {
if ((count($assets) !== 0) && ($assets->count() > 0) && ($settings->alert_email != '')) {
// Send a rollup to the admin, if settings dictate
$recipients = collect(explode(',', $settings->alert_email))->map(function ($item) {
return new AlertRecipient($item);
});
$recipients = collect(explode(',', $settings->alert_email))
->map(fn($item) => trim($item))
->all();
$this->info('Sending Admin SendUpcomingAuditNotification to: '.$settings->alert_email);
\Notification::send($recipients, new SendUpcomingAuditNotification($assets, $settings->audit_warning_days));
$this->info('Sending Admin SendUpcomingAuditNotification to: ' . $settings->alert_email);
Mail::to($recipients)->send(new SendUpcomingAuditMail($assets, $settings->audit_warning_days));
}
}

View File

@@ -5,6 +5,7 @@ namespace App\Console;
use App\Console\Commands\ImportLocations;
use App\Console\Commands\ReEncodeCustomFieldNames;
use App\Console\Commands\RestoreDeletedUsers;
use App\Models\Setting;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@@ -18,12 +19,14 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
if(Setting::getSettings()->alerts_enabled === 1) {
$schedule->command('snipeit:inventory-alerts')->daily();
$schedule->command('snipeit:expiring-alerts')->daily();
$schedule->command('snipeit:expected-checkin')->daily();
$schedule->command('snipeit:upcoming-audits')->daily();
}
$schedule->command('snipeit:backup')->weekly();
$schedule->command('backup:clean')->daily();
$schedule->command('snipeit:upcoming-audits')->daily();
$schedule->command('auth:clear-resets')->everyFifteenMinutes();
$schedule->command('saml:clear_expired_nonces')->weekly();
}

View File

@@ -122,6 +122,31 @@ class Handler extends ExceptionHandler
}
// This is traaaaash but it handles models that are not found while using route model binding :(
// The only alternative is to set that at *each* route, which is crazypants
if ($e instanceof \Illuminate\Database\Eloquent\ModelNotFoundException) {
// This gets the MVC model name from the exception and formats in a way that's less fugly
$model_name = strtolower(implode(" ", preg_split('/(?=[A-Z])/', last(explode('\\', $e->getModel())))));
$route = str_plural(strtolower(last(explode('\\', $e->getModel())))).'.index';
// Sigh.
if ($route == 'assets.index') {
$route = 'hardware.index';
} elseif ($route == 'reporttemplates.index') {
$route = 'reports/custom';
} elseif ($route == 'assetmodels.index') {
$route = 'models.index';
} elseif ($route == 'predefinedkits.index') {
$route = 'kits.index';
} elseif ($route == 'assetmaintenances.index') {
$route = 'maintenances.index';
}
return redirect()
->route($route)
->withError(trans('general.generic_model_not_found', ['model' => $model_name]));
}
if ($this->isHttpException($e) && (isset($statusCode)) && ($statusCode == '404' )) {

View File

@@ -1520,11 +1520,11 @@ class Helper
if ($redirect_option == 'target') {
switch ($checkout_to_type) {
case 'user':
return route('users.show', ['user' => $request->assigned_user]);
return route('users.show', $request->assigned_user);
case 'location':
return route('locations.show', ['location' => $request->assigned_location]);
return route('locations.show', $request->assigned_location);
case 'asset':
return route('hardware.show', ['hardware' => $request->assigned_asset]);
return route('hardware.show', $request->assigned_asset);
}
}
return redirect()->back()->with('error', trans('admin/hardware/message.checkout.error'));

View File

@@ -59,6 +59,8 @@ class IconHelper
return 'fas fa-cog';
case 'angle-left':
return 'fas fa-angle-left';
case 'angle-right':
return 'fas fa-angle-right';
case 'warning':
return 'fas fa-exclamation-triangle';
case 'kits':
@@ -184,7 +186,11 @@ class IconHelper
return 'fa-regular fa-id-card';
case 'department' :
return 'fa-solid fa-building-user';
case 'home' :
return 'fa-solid fa-house';
case 'note':
case 'notes':
return 'fas fa-sticky-note';
}
}
}

View File

@@ -31,7 +31,7 @@ class AccessoriesController extends Controller
public function index() : View
{
$this->authorize('index', Accessory::class);
return view('accessories/index');
return view('accessories.index');
}
/**
@@ -95,16 +95,10 @@ class AccessoriesController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
*/
public function edit($accessoryId = null) : View | RedirectResponse
public function edit(Accessory $accessory) : View | RedirectResponse
{
if ($item = Accessory::find($accessoryId)) {
$this->authorize($item);
return view('accessories/edit', compact('item'))->with('category_type', 'accessory');
}
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
$this->authorize('update', Accessory::class);
return view('accessories.edit')->with('item', $accessory)->with('category_type', 'accessory');
}
/**
@@ -114,19 +108,12 @@ class AccessoriesController extends Controller
* @param int $accessoryId
* @since [v6.0]
*/
public function getClone($accessoryId = null) : View | RedirectResponse
public function getClone(Accessory $accessory) : View | RedirectResponse
{
$this->authorize('create', Accessory::class);
// Check if the asset exists
if (is_null($accessory_to_clone = Accessory::find($accessoryId))) {
// Redirect to the asset management page
return redirect()->route('accessories.index')
->with('error', trans('admin/accessories/message.does_not_exist', ['id' => $accessoryId]));
}
$accessory = clone $accessory_to_clone;
$accessory = clone $accessory;
$accessory->id = null;
$accessory->location_id = null;
@@ -142,9 +129,9 @@ class AccessoriesController extends Controller
* @param ImageUploadRequest $request
* @param int $accessoryId
*/
public function update(ImageUploadRequest $request, $accessoryId = null) : RedirectResponse
public function update(ImageUploadRequest $request, Accessory $accessory) : RedirectResponse
{
if ($accessory = Accessory::withCount('checkouts as checkouts_count')->find($accessoryId)) {
if ($accessory = Accessory::withCount('checkouts as checkouts_count')->find($accessory->id)) {
$this->authorize($accessory);
@@ -231,14 +218,10 @@ class AccessoriesController extends Controller
* @see AccessoriesController::getDataView() method that generates the JSON response
* @since [v1.0]
*/
public function show($accessoryID = null) : View | RedirectResponse
public function show(Accessory $accessory) : View | RedirectResponse
{
$accessory = Accessory::withCount('checkouts as checkouts_count')->find($accessoryID);
$accessory = Accessory::withCount('checkouts as checkouts_count')->find($accessory->id);
$this->authorize('view', $accessory);
if (isset($accessory->id)) {
return view('accessories/view', compact('accessory'));
}
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist', ['id' => $accessoryID]));
return view('accessories.view', compact('accessory'));
}
}

View File

@@ -51,15 +51,15 @@ class AccessoriesFilesController extends Controller
}
return redirect()->route('accessories.show', $accessory->id)->with('success', trans('general.file_upload_success'));
return redirect()->route('accessories.show', $accessory->id)->withFragment('files')->with('success', trans('general.file_upload_success'));
}
return redirect()->route('accessories.show', $accessory->id)->with('error', trans('general.no_files_uploaded'));
return redirect()->route('accessories.show', $accessory->id)->withFragment('files')->with('error', trans('general.no_files_uploaded'));
}
// Prepare the error message
return redirect()->route('accessories.index')
->with('error', trans('general.file_does_not_exist'));
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
/**
@@ -72,31 +72,28 @@ class AccessoriesFilesController extends Controller
*/
public function destroy($accessoryId = null, $fileId = null) : RedirectResponse
{
$accessory = Accessory::find($accessoryId);
// the asset is valid
if (isset($accessory->id)) {
if ($accessory = Accessory::find($accessoryId)) {
$this->authorize('update', $accessory);
$log = Actionlog::find($fileId);
// Remove the file if one exists
if (Storage::exists('accessories/'.$log->filename)) {
if ($log = Actionlog::find($fileId)) {
if (Storage::exists('private_uploads/accessories/'.$log->filename)) {
try {
Storage::delete('accessories/'.$log->filename);
Storage::delete('private_uploads/accessories/' . $log->filename);
$log->delete();
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.deletefile.success'));
} catch (\Exception $e) {
Log::debug($e);
}
}
$log->delete();
return redirect()->back()
->with('success', trans('admin/hardware/message.deletefile.success'));
}
// Redirect to the licence management page
return redirect()->route('accessories.index')->with('error', trans('general.file_does_not_exist'));
}
}
}
return redirect()->route('accessories.show', ['accessory' => $accessory])->withFragment('files')->with('error', trans('general.log_record_not_found'));
}
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
/**
* Allows the selected file to be viewed.
@@ -125,10 +122,11 @@ class AccessoriesFilesController extends Controller
}
}
return redirect()->route('accessories.show', ['accessory' => $accessory])->with('error', trans('general.log_record_not_found'));
return redirect()->route('accessories.show', ['accessory' => $accessory])->withFragment('files')->with('error', trans('general.log_record_not_found'));
}
return redirect()->route('accessories.index')->with('error', trans('general.file_not_found'));
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
}

View File

@@ -75,20 +75,23 @@ class AccessoryCheckoutController extends Controller
$accessory->checkout_qty = $request->input('checkout_qty', 1);
for ($i = 0; $i < $accessory->checkout_qty; $i++) {
AccessoryCheckout::create([
$accessory_checkout = new AccessoryCheckout([
'accessory_id' => $accessory->id,
'created_at' => Carbon::now(),
'created_by' => auth()->id(),
'assigned_to' => $target->id,
'assigned_type' => $target::class,
'note' => $request->input('note'),
]);
$accessory_checkout->created_by = auth()->id();
$accessory_checkout->save();
}
event(new CheckoutableCheckedOut($accessory, $target, auth()->user(), $request->input('note')));
// Set this as user since we only allow checkout to user for this item type
$request->request->add(['checkout_to_type' => request('checkout_to_type')]);
$request->request->add(['assigned_user' => $target->id]);
$request->request->add(['assigned_to' => $target->id]);
session()->put(['redirect_option' => $request->get('redirect_option'), 'checkout_to_type' => $request->get('checkout_to_type')]);

View File

@@ -40,15 +40,16 @@ class ActionlogController extends Controller
public function getStoredEula($filename) : Response | BinaryFileResponse | RedirectResponse
{
$this->authorize('view', \App\Models\Asset::class);
$file = config('app.private_uploads').'/eula-pdfs/'.$filename;
if (Storage::exists($file)) {
return response()->download($file);
if (config('filesystems.default') == 's3_private') {
return redirect()->away(Storage::disk('s3_private')->temporaryUrl('private_uploads/eula-pdfs/'.$filename, now()->addMinutes(5)));
}
if (Storage::exists('private_uploads/eula-pdfs/'.$filename)) {
return response()->download(config('app.private_uploads').'/eula-pdfs/'.$filename);
}
return redirect()->back()->with('error', trans('general.file_does_not_exist'));
}
}

View File

@@ -13,6 +13,7 @@ use App\Http\Transformers\SelectlistTransformer;
use App\Models\Accessory;
use App\Models\Company;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Auth;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
@@ -184,39 +185,33 @@ class AccessoriesController extends Controller
/**
* Display the specified resource.
* Get the list of checkouts for a specific accessory
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
* @return \Illuminate\Http\Response
* @return | array
*/
public function checkedout($id, Request $request)
public function checkedout(Request $request, $id)
{
$this->authorize('view', Accessory::class);
$accessory = Accessory::with('lastCheckout')->findOrFail($id);
$offset = request('offset', 0);
$limit = request('limit', 50);
$accessory_checkouts = $accessory->checkouts;
$total = $accessory_checkouts->count();
if ($total < $offset) {
$offset = 0;
}
$accessory_checkouts = $accessory->checkouts()->skip($offset)->take($limit)->get();
// Total count of all checkouts for this asset
$accessory_checkouts = $accessory->checkouts();
// Check for search text in the request
if ($request->filled('search')) {
$accessory_checkouts = $accessory->checkouts()->TextSearch($request->input('search'))
->get();
$total = $accessory_checkouts->count();
$accessory_checkouts = $accessory_checkouts->TextSearch($request->input('search'));
}
return (new AccessoriesTransformer)->transformCheckedoutAccessory($accessory, $accessory_checkouts, $total);
$total = $accessory_checkouts->count();
$accessory_checkouts = $accessory_checkouts->skip($offset)->take($limit)->get();
return (new AccessoriesTransformer)->transformCheckedoutAccessory($accessory_checkouts, $total);
}
@@ -227,7 +222,7 @@ class AccessoriesController extends Controller
* @since [v4.0]
* @param \App\Http\Requests\ImageUploadRequest $request
* @param int $id
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\JsonResponse
*/
public function update(ImageUploadRequest $request, $id)
{
@@ -249,7 +244,7 @@ class AccessoriesController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @param int $id
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\JsonResponse
*/
public function destroy($id)
{
@@ -284,14 +279,17 @@ class AccessoriesController extends Controller
$accessory->checkout_qty = $request->input('checkout_qty', 1);
for ($i = 0; $i < $accessory->checkout_qty; $i++) {
AccessoryCheckout::create([
$accessory_checkout = new AccessoryCheckout([
'accessory_id' => $accessory->id,
'created_at' => Carbon::now(),
'created_by' => auth()->id(),
'assigned_to' => $target->id,
'assigned_type' => $target::class,
'note' => $request->input('note'),
]);
$accessory_checkout->created_by = auth()->id();
$accessory_checkout->save();
}
// Set this value to be able to pass the qty through to the event

View File

@@ -122,7 +122,7 @@ class AssetMaintenancesController extends Controller
* @version v1.0
* @since [v1.8]
*/
public function store(Request $request) : JsonResponse
public function store(Request $request) : JsonResponse | array
{
$this->authorize('update', Asset::class);
// create a new model instance
@@ -149,7 +149,7 @@ class AssetMaintenancesController extends Controller
* @version v1.0
* @since [v4.0]
*/
public function update(Request $request, $id) : JsonResponse
public function update(Request $request, $id) : JsonResponse | array
{
$this->authorize('update', Asset::class);
@@ -186,7 +186,7 @@ class AssetMaintenancesController extends Controller
* @version v1.0
* @since [v4.0]
*/
public function destroy($assetMaintenanceId) : JsonResponse
public function destroy($assetMaintenanceId) : JsonResponse | array
{
$this->authorize('update', Asset::class);
// Check if the asset maintenance exists
@@ -208,7 +208,7 @@ class AssetMaintenancesController extends Controller
* @version v1.0
* @since [v4.0]
*/
public function show($assetMaintenanceId) : JsonResponse
public function show($assetMaintenanceId) : JsonResponse | array
{
$this->authorize('view', Asset::class);
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);

View File

@@ -9,6 +9,7 @@ use App\Http\Controllers\Controller;
use App\Models\AssetModel;
use App\Models\Actionlog;
use App\Http\Requests\UploadFileRequest;
use App\Http\Transformers\AssetModelsTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Log;
use Symfony\Component\HttpFoundation\StreamedResponse;
@@ -68,37 +69,15 @@ class AssetModelFilesController extends Controller
/**
* List the files for an asset.
*
* @param int $assetModelId
* @param int $assetmodel
* @since [v7.0.12]
* @author [r-xyz]
*/
public function list($assetModelId = null) : JsonResponse
public function list($assetmodel_id) : JsonResponse | array
{
// Start by checking if the asset being acted upon exists
if (! $assetModel = AssetModel::find($assetModelId)) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/models/message.does_not_exist')), 404);
}
// the asset is valid
if (isset($assetModel->id)) {
$this->authorize('view', $assetModel);
// Check that there are some uploads on this asset that can be listed
if ($assetModel->uploads->count() > 0) {
$files = array();
foreach ($assetModel->uploads as $upload) {
array_push($files, $upload);
}
// Give the list of files back to the user
return response()->json(Helper::formatStandardApiResponse('success', $files, trans('admin/models/message.upload.success')));
}
// There are no files.
return response()->json(Helper::formatStandardApiResponse('success', array(), trans('admin/models/message.upload.success')));
}
// Send back an error message
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/models/message.download.error')), 500);
$assetmodel = AssetModel::with('uploads')->find($assetmodel_id);
$this->authorize('view', $assetmodel);
return (new AssetModelsTransformer)->transformAssetModelFiles($assetmodel, $assetmodel->uploads()->count());
}
/**

View File

@@ -77,6 +77,18 @@ class AssetModelsController extends Controller
$assetmodels->onlyTrashed();
}
if ($request->filled('name')) {
$assetmodels = $assetmodels->where('models.name', '=', $request->input('name'));
}
if ($request->filled('model_number')) {
$assetmodels = $assetmodels->where('models.model_number', '=', $request->input('model_number'));
}
if ($request->filled('notes')) {
$assetmodels = $assetmodels->where('models.notes', '=', $request->input('notes'));
}
if ($request->filled('category_id')) {
$assetmodels = $assetmodels->where('models.category_id', '=', $request->input('category_id'));
}

View File

@@ -6,6 +6,7 @@ use App\Events\CheckoutableCheckedIn;
use App\Http\Requests\StoreAssetRequest;
use App\Http\Requests\UpdateAssetRequest;
use App\Http\Traits\MigratesLegacyAssetLocations;
use App\Models\AccessoryCheckout;
use App\Models\CheckoutAcceptance;
use App\Models\LicenseSeat;
use Illuminate\Database\Eloquent\Builder;
@@ -26,13 +27,13 @@ use App\Models\License;
use App\Models\Location;
use App\Models\Setting;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use App\Http\Requests\ImageUploadRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
use App\View\Label;
use Illuminate\Support\Facades\Storage;
/**
@@ -126,8 +127,20 @@ class AssetsController extends Controller
}
$assets = Asset::select('assets.*')
->with('location', 'assetstatus', 'company', 'defaultLoc','assignedTo', 'adminuser','model.depreciation',
'model.category', 'model.manufacturer', 'model.fieldset','supplier'); //it might be tempting to add 'assetlog' here, but don't. It blows up update-heavy users.
->with(
'model',
'location',
'assetstatus',
'company',
'defaultLoc',
'assignedTo',
'adminuser',
'model.depreciation',
'model.category',
'model.manufacturer',
'model.fieldset',
'supplier'
); // it might be tempting to add 'assetlog' here, but don't. It blows up update-heavy users.
if ($filter_non_deprecable_assets) {
@@ -160,7 +173,7 @@ class AssetsController extends Controller
*/
switch ($action) {
// Audit (singular) is left over from earlier legacy APIs
case 'audits' :
case 'audits':
switch ($upcoming_status) {
case 'due':
$assets->DueForAudit($settings);
@@ -265,7 +278,6 @@ class AssetsController extends Controller
$join->on('status_alias.id', '=', 'assets.status_id');
});
}
}
@@ -399,7 +411,6 @@ class AssetsController extends Controller
} else {
$assets->orderBy($sort_override, $order);
}
} else {
$assets->orderBy($column_sort, $order);
}
@@ -441,7 +452,7 @@ class AssetsController extends Controller
* @since [v4.2.1]
* @author [A. Gianotto] [<snipe@snipe.net>]
*/
public function showByTag(Request $request, $tag) : JsonResponse | array
public function showByTag(Request $request, $tag): JsonResponse | array
{
$this->authorize('index', Asset::class);
$assets = Asset::where('asset_tag', $tag)->with('assetstatus')->with('assignedTo');
@@ -463,12 +474,10 @@ class AssetsController extends Controller
} else {
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
}
}
// If there are 0 results, return the "no such asset" response
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
/**
@@ -479,7 +488,7 @@ class AssetsController extends Controller
* @since [v4.2.1]
* @return \Illuminate\Http\JsonResponse
*/
public function showBySerial(Request $request, $serial) : JsonResponse | array
public function showBySerial(Request $request, $serial): JsonResponse | array
{
$this->authorize('index', Asset::class);
$assets = Asset::where('serial', $serial)->with('assetstatus')->with('assignedTo');
@@ -495,7 +504,6 @@ class AssetsController extends Controller
// If there are 0 results, return the "no such asset" response
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
/**
@@ -506,20 +514,20 @@ class AssetsController extends Controller
* @since [v4.0]
* @return \Illuminate\Http\JsonResponse
*/
public function show(Request $request, $id) : JsonResponse | array
public function show(Request $request, $id): JsonResponse | array
{
if ($asset = Asset::with('assetstatus')
->with('assignedTo')->withTrashed()
->withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as user_requests_count')->find($id)) {
->withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as user_requests_count')->find($id)
) {
$this->authorize('view', $asset);
return (new AssetsTransformer)->transformAsset($asset, $request->input('components') );
return (new AssetsTransformer)->transformAsset($asset, $request->input('components'));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
public function licenses(Request $request, $id) : array
public function licenses(Request $request, $id): array
{
$this->authorize('view', Asset::class);
$this->authorize('view', License::class);
@@ -537,7 +545,7 @@ class AssetsController extends Controller
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
*/
public function selectlist(Request $request) : array
public function selectlist(Request $request): array
{
$assets = Asset::select([
@@ -570,12 +578,12 @@ class AssetsController extends Controller
$asset->use_text = $asset->present()->fullName;
if (($asset->checkedOutToUser()) && ($asset->assigned)) {
$asset->use_text .= ' → '.$asset->assigned->getFullNameAttribute();
$asset->use_text .= ' → ' . $asset->assigned->getFullNameAttribute();
}
if ($asset->assetstatus->getStatuslabelType() == 'pending') {
$asset->use_text .= '('.$asset->assetstatus->getStatuslabelType().')';
$asset->use_text .= '(' . $asset->assetstatus->getStatuslabelType() . ')';
}
$asset->use_image = ($asset->getImageUrl()) ? $asset->getImageUrl() : null;
@@ -623,9 +631,9 @@ class AssetsController extends Controller
// If input value is null, use custom field's default value
if ($field_val == null) {
Log::debug('Field value for '.$field->db_column.' is null');
Log::debug('Field value for ' . $field->db_column . ' is null');
$field_val = $field->defaultValue($request->get('model_id'));
Log::debug('Use the default fieldset value of '.$field->defaultValue($request->get('model_id')));
Log::debug('Use the default fieldset value of ' . $field->defaultValue($request->get('model_id')));
}
// if the field is set to encrypted, make sure we encrypt the value
@@ -643,7 +651,7 @@ class AssetsController extends Controller
}
}
if ($field->element == 'checkbox') {
if(is_array($field_val)) {
if (is_array($field_val)) {
$field_val = implode(',', $field_val);
}
}
@@ -720,7 +728,7 @@ class AssetsController extends Controller
if ($request->has($field->db_column)) {
if ($field->element == 'checkbox') {
if(is_array($field_val)) {
if (is_array($field_val)) {
$field_val = implode(',', $field_val);
}
}
@@ -758,8 +766,12 @@ class AssetsController extends Controller
if ($problems_updating_encrypted_custom_fields) {
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.update.encrypted_warning')));
// Below is the *correct* return since it uses the transformer, but we have to use the old, flat return for now until we can update Jamf2Snipe and Kanji2Snipe
// return response()->json(Helper::formatStandardApiResponse('success', (new AssetsTransformer)->transformAsset($asset), trans('admin/hardware/message.update.encrypted_warning')));
} else {
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.update.success')));
// Below is the *correct* return since it uses the transformer, but we have to use the old, flat return for now until we can update Jamf2Snipe and Kanji2Snipe
/// return response()->json(Helper::formatStandardApiResponse('success', (new AssetsTransformer)->transformAsset($asset), trans('admin/hardware/message.update.success')));
}
}
return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200);
@@ -773,7 +785,7 @@ class AssetsController extends Controller
* @param int $assetId
* @since [v4.0]
*/
public function destroy($id) : JsonResponse
public function destroy($id): JsonResponse
{
$this->authorize('delete', Asset::class);
@@ -808,7 +820,7 @@ class AssetsController extends Controller
* @param int $assetId
* @since [v5.1.18]
*/
public function restore(Request $request, $assetId = null) : JsonResponse
public function restore(Request $request, $assetId = null): JsonResponse
{
if ($asset = Asset::withTrashed()->find($assetId)) {
@@ -827,7 +839,6 @@ class AssetsController extends Controller
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
/**
@@ -837,7 +848,7 @@ class AssetsController extends Controller
* @param string $tag
* @since [v6.0.5]
*/
public function checkoutByTag(AssetCheckoutRequest $request, $tag) : JsonResponse
public function checkoutByTag(AssetCheckoutRequest $request, $tag): JsonResponse
{
if ($asset = Asset::where('asset_tag', $tag)->first()) {
return $this->checkout($request, $asset->id);
@@ -852,13 +863,13 @@ class AssetsController extends Controller
* @param int $assetId
* @since [v4.0]
*/
public function checkout(AssetCheckoutRequest $request, $asset_id) : JsonResponse
public function checkout(AssetCheckoutRequest $request, $asset_id): JsonResponse
{
$this->authorize('checkout', Asset::class);
$asset = Asset::findOrFail($asset_id);
if (! $asset->availableForCheckout()) {
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.not_available')));
return response()->json(Helper::formatStandardApiResponse('error', ['asset' => e($asset->asset_tag)], trans('admin/hardware/message.checkout.not_available')));
}
$this->authorize('checkout', $asset);
@@ -875,14 +886,12 @@ class AssetsController extends Controller
$asset->location_id = ($target) ? $target->id : '';
$error_payload['target_id'] = $request->input('assigned_location');
$error_payload['target_type'] = 'location';
} elseif (request('checkout_to_type') == 'asset') {
$target = Asset::where('id', '!=', $asset_id)->find(request('assigned_asset'));
// Override with the asset's location_id if it has one
$asset->location_id = (($target) && (isset($target->location_id))) ? $target->location_id : '';
$error_payload['target_id'] = $request->input('assigned_asset');
$error_payload['target_type'] = 'asset';
} elseif (request('checkout_to_type') == 'user') {
// Fetch the target and set the asset's new location_id
$target = User::find(request('assigned_user'));
@@ -896,7 +905,7 @@ class AssetsController extends Controller
}
if (! isset($target)) {
return response()->json(Helper::formatStandardApiResponse('error', $error_payload, 'Checkout target for asset '.e($asset->asset_tag).' is invalid - '.$error_payload['target_type'].' does not exist.'));
return response()->json(Helper::formatStandardApiResponse('error', $error_payload, 'Checkout target for asset ' . e($asset->asset_tag) . ' is invalid - ' . $error_payload['target_type'] . ' does not exist.'));
}
$checkout_at = request('checkout_at', date('Y-m-d H:i:s'));
@@ -910,15 +919,15 @@ class AssetsController extends Controller
// TODO: Follow up here. WTF. Commented out for now.
// if ((isset($target->rtd_location_id)) && ($asset->rtd_location_id!='')) {
// $asset->location_id = $target->rtd_location_id;
// }
// if ((isset($target->rtd_location_id)) && ($asset->rtd_location_id!='')) {
// $asset->location_id = $target->rtd_location_id;
// }
if ($asset->checkOut($target, auth()->user(), $checkout_at, $expected_checkin, $note, $asset_name, $asset->location_id)) {
return response()->json(Helper::formatStandardApiResponse('success', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.success')));
return response()->json(Helper::formatStandardApiResponse('success', ['asset' => e($asset->asset_tag)], trans('admin/hardware/message.checkout.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.error')));
return response()->json(Helper::formatStandardApiResponse('error', ['asset' => e($asset->asset_tag)], trans('admin/hardware/message.checkout.error')));
}
@@ -929,7 +938,7 @@ class AssetsController extends Controller
* @param int $assetId
* @since [v4.0]
*/
public function checkin(Request $request, $asset_id) : JsonResponse
public function checkin(Request $request, $asset_id): JsonResponse
{
$asset = Asset::with('model')->findOrFail($asset_id);
$this->authorize('checkin', $asset);
@@ -937,7 +946,7 @@ class AssetsController extends Controller
$target = $asset->assignedTo;
if (is_null($target)) {
return response()->json(Helper::formatStandardApiResponse('error', [
'asset_tag'=> e($asset->asset_tag),
'asset_tag' => e($asset->asset_tag),
'model' => e($asset->model->name),
'model_number' => e($asset->model->model_number)
], trans('admin/hardware/message.checkin.already_checked_in')));
@@ -960,7 +969,7 @@ class AssetsController extends Controller
if ($request->filled('location_id')) {
$asset->location_id = $request->input('location_id');
if ($request->input('update_default_location')){
if ($request->input('update_default_location')) {
$asset->rtd_location_id = $request->input('location_id');
}
}
@@ -969,7 +978,7 @@ class AssetsController extends Controller
$asset->status_id = $request->input('status_id');
}
$checkin_at = $request->filled('checkin_at') ? $request->input('checkin_at').' '. date('H:i:s') : date('Y-m-d H:i:s');
$checkin_at = $request->filled('checkin_at') ? $request->input('checkin_at') . ' ' . date('H:i:s') : date('Y-m-d H:i:s');
$originalValues = $asset->getRawOriginal();
if (($request->filled('checkin_at')) && ($request->get('checkin_at') != date('Y-m-d'))) {
@@ -987,7 +996,8 @@ class AssetsController extends Controller
[Asset::class],
function (Builder $query) use ($asset) {
$query->where('id', $asset->id);
})
}
)
->get()
->map(function ($acceptance) {
$acceptance->delete();
@@ -997,13 +1007,13 @@ class AssetsController extends Controller
event(new CheckoutableCheckedIn($asset, $target, auth()->user(), $request->input('note'), $checkin_at, $originalValues));
return response()->json(Helper::formatStandardApiResponse('success', [
'asset_tag'=> e($asset->asset_tag),
'asset_tag' => e($asset->asset_tag),
'model' => e($asset->model->name),
'model_number' => e($asset->model->model_number)
], trans('admin/hardware/message.checkin.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.error')));
return response()->json(Helper::formatStandardApiResponse('error', ['asset' => e($asset->asset_tag)], trans('admin/hardware/message.checkin.error')));
}
/**
@@ -1012,7 +1022,7 @@ class AssetsController extends Controller
* @author [A. Janes] [<ajanes@adagiohealth.org>]
* @since [v6.0]
*/
public function checkinByTag(Request $request, $tag = null) : JsonResponse
public function checkinByTag(Request $request, $tag = null): JsonResponse
{
$this->authorize('checkin', Asset::class);
if (null == $tag && null !== ($request->input('asset_tag'))) {
@@ -1025,8 +1035,8 @@ class AssetsController extends Controller
}
return response()->json(Helper::formatStandardApiResponse('error', [
'asset'=> e($tag)
], 'Asset with tag '.e($tag).' not found'));
'asset' => e($tag)
], 'Asset with tag ' . e($tag) . ' not found'));
}
@@ -1037,7 +1047,7 @@ class AssetsController extends Controller
* @param int $id
* @since [v4.0]
*/
public function audit(Request $request) : JsonResponse
public function audit(Request $request): JsonResponse
{
$this->authorize('audit', Asset::class);
@@ -1048,8 +1058,8 @@ class AssetsController extends Controller
// No tag passed - return an error
if (!$request->filled('asset_tag')) {
return response()->json(Helper::formatStandardApiResponse('error', [
'asset_tag'=> '',
'error'=> trans('admin/hardware/message.no_tag'),
'asset_tag' => '',
'error' => trans('admin/hardware/message.no_tag'),
], trans('admin/hardware/message.no_tag')), 200);
}
@@ -1097,28 +1107,25 @@ class AssetsController extends Controller
$asset->logAudit(request('note'), request('location_id'));
return response()->json(Helper::formatStandardApiResponse('success', [
'asset_tag'=> e($asset->asset_tag),
'note'=> e($request->input('note')),
'asset_tag' => e($asset->asset_tag),
'note' => e($request->input('note')),
'next_audit_date' => Helper::getFormattedDateObject($asset->next_audit_date),
], trans('admin/hardware/message.audit.success')));
}
// Asset failed validation or was not able to be saved
return response()->json(Helper::formatStandardApiResponse('error', [
'asset_tag'=> e($asset->asset_tag),
'error'=> $asset->getErrors()->first(),
'asset_tag' => e($asset->asset_tag),
'error' => $asset->getErrors()->first(),
], trans('admin/hardware/message.audit.error', ['error' => $asset->getErrors()->first()])), 200);
}
// No matching asset for the asset tag that was passed.
return response()->json(Helper::formatStandardApiResponse('error', [
'asset_tag'=> e($request->input('asset_tag')),
'error'=> trans('admin/hardware/message.audit.error'),
'asset_tag' => e($request->input('asset_tag')),
'error' => trans('admin/hardware/message.audit.error'),
], trans('admin/hardware/message.audit.error', ['error' => trans('admin/hardware/message.does_not_exist')])), 200);
}
@@ -1129,7 +1136,7 @@ class AssetsController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
*/
public function requestable(Request $request) : JsonResponse | array
public function requestable(Request $request): JsonResponse | array
{
$this->authorize('viewRequestable', Asset::class);
@@ -1150,8 +1157,18 @@ class AssetsController extends Controller
}
$assets = Asset::select('assets.*')
->with('location', 'assetstatus', 'assetlog', 'company','assignedTo',
'model.category', 'model.manufacturer', 'model.fieldset', 'supplier', 'requests');
->with(
'location',
'assetstatus',
'assetlog',
'company',
'assignedTo',
'model.category',
'model.manufacturer',
'model.fieldset',
'supplier',
'requests'
);
@@ -1200,4 +1217,115 @@ class AssetsController extends Controller
return (new AssetsTransformer)->transformRequestedAssets($assets, $total);
}
public function assignedAssets(Request $request, Asset $asset) : JsonResponse | array
{
return [];
// to do
}
public function assignedAccessories(Request $request, Asset $asset) : JsonResponse | array
{
$this->authorize('view', Asset::class);
$this->authorize('view', $asset);
$accessory_checkouts = AccessoryCheckout::AssetsAssigned()
->where('assigned_to', $asset->id)
->with('adminuser')
->with('accessories');
$offset = ($request->input('offset') > $accessory_checkouts->count()) ? $accessory_checkouts->count() : app('api_offset_value');
$limit = app('api_limit_value');
$total = $accessory_checkouts->count();
$accessory_checkouts = $accessory_checkouts->skip($offset)->take($limit)->get();
return (new AssetsTransformer)->transformCheckedoutAccessories($accessory_checkouts, $total);
}
/**
* Generate asset labels by tag
*
* @author [Nebelkreis] [https://github.com/NebelKreis]
*
* @param Request $request Contains asset_tags array of asset tags to generate labels for
* @return JsonResponse Returns base64 encoded PDF on success, error message on failure
*/
public function getLabels(Request $request): JsonResponse
{
try {
$this->authorize('view', Asset::class);
// Validate that asset tags were provided in the request
if (!$request->filled('asset_tags')) {
return response()->json(Helper::formatStandardApiResponse('error', null,
trans('admin/hardware/message.no_assets_selected')), 400);
}
// Convert asset tags from request into collection and fetch matching assets
$asset_tags = collect($request->input('asset_tags'));
$assets = Asset::whereIn('asset_tag', $asset_tags)->get();
// Return error if no assets were found for the provided tags
if ($assets->isEmpty()) {
return response()->json(Helper::formatStandardApiResponse('error', null,
trans('admin/hardware/message.does_not_exist')), 404);
}
try {
$settings = Setting::getSettings();
// Check if logo file exists in storage and disable logo if not found
// This prevents errors when trying to include a non-existent logo in the PDF
$settings->label_logo = ($original_logo = $settings->label_logo) && !Storage::disk('public')->exists('/' . $original_logo) ? null : $settings->label_logo;
$label = new Label();
if (!$label) {
throw new \Exception('Label object could not be created');
}
// Configure label with assets and settings
// bulkedit=false and count=0 are default values for label generation
$label = $label->with('assets', $assets)
->with('settings', $settings)
->with('bulkedit', false)
->with('count', 0);
// Generate PDF using callback function
// The callback captures the PDF content in $pdf_content variable
$pdf_content = '';
$label->render(function($pdf) use (&$pdf_content) {
$pdf_content = $pdf->Output('', 'S');
return $pdf;
});
// Verify PDF was generated successfully
if (empty($pdf_content)) {
throw new \Exception('PDF content is empty');
}
$encoded_content = base64_encode($pdf_content);
return response()->json(Helper::formatStandardApiResponse('success', [
'pdf' => $encoded_content
], trans('admin/hardware/message.labels_generated')));
} catch (\Exception $e) {
return response()->json(Helper::formatStandardApiResponse('error', [
'error_message' => $e->getMessage(),
'error_line' => $e->getLine(),
'error_file' => $e->getFile()
], trans('admin/hardware/message.error_generating_labels')), 500);
}
} catch (\Exception $e) {
return response()->json(Helper::formatStandardApiResponse('error', [
'error_message' => $e->getMessage(),
'error_line' => $e->getLine(),
'error_file' => $e->getFile()
], $e->getMessage()), 500);
}
}
}

View File

@@ -39,6 +39,7 @@ class CategoriesController extends Controller
'components_count',
'licenses_count',
'image',
'notes',
];
$categories = Category::select([
@@ -52,6 +53,7 @@ class CategoriesController extends Controller
'require_acceptance',
'checkin_email',
'image',
'notes',
])
->with('adminuser')
->withCount('accessories as accessories_count', 'consumables as consumables_count', 'components as components_count', 'licenses as licenses_count');

View File

@@ -38,11 +38,12 @@ class CompaniesController extends Controller
'accessories_count',
'consumables_count',
'components_count',
'notes',
];
$companies = Company::withCount(['assets as assets_count' => function ($query) {
$query->AssetsForShow();
}])->withCount('assets as assets_count', 'licenses as licenses_count', 'accessories as accessories_count', 'consumables as consumables_count', 'components as components_count', 'users as users_count');
}])->withCount('licenses as licenses_count', 'accessories as accessories_count', 'consumables as consumables_count', 'components as components_count', 'users as users_count');
if ($request->filled('search')) {
$companies->TextSearch($request->input('search'));

View File

@@ -48,7 +48,8 @@ class ComponentsController extends Controller
];
$components = Component::select('components.*')
->with('company', 'location', 'category', 'assets', 'supplier', 'adminuser', 'manufacturer');
->with('company', 'location', 'category', 'assets', 'supplier', 'adminuser', 'manufacturer', 'uncontrainedAssets')
->withSum('uncontrainedAssets', 'components_assets.assigned_qty');
if ($request->filled('search')) {
$components = $components->TextSearch($request->input('search'));
@@ -197,6 +198,11 @@ class ComponentsController extends Controller
$this->authorize('delete', Component::class);
$component = Component::findOrFail($id);
$this->authorize('delete', $component);
if ($component->numCheckedOut() > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/components/message.delete.error_qty')));
}
$component->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/components/message.delete.success')));
@@ -309,9 +315,7 @@ class ComponentsController extends Controller
public function checkin(Request $request, $component_asset_id) : JsonResponse
{
if ($component_assets = DB::table('components_assets')->find($component_asset_id)) {
if (is_null($component = Component::find($component_assets->component_id))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/components/message.not_found')));
}
@@ -319,17 +323,13 @@ class ComponentsController extends Controller
$max_to_checkin = $component_assets->assigned_qty;
if ($max_to_checkin > 1) {
$validator = Validator::make($request->all(), [
"checkin_qty" => "required|numeric|between:1,$max_to_checkin"
]);
if ($validator->fails()) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Checkin quantity must be between 1 and '.$max_to_checkin));
return response()->json(Helper::formatStandardApiResponse('error', null, 'Checkin quantity must be between 1 and ' . $max_to_checkin));
}
}
// Validation passed, so let's figure out what we have to do here.
$qty_remaining_in_checkout = ($component_assets->assigned_qty - (int)$request->input('checkin_qty', 1));
@@ -340,27 +340,22 @@ class ComponentsController extends Controller
Log::debug($component_asset_id.' - '.$qty_remaining_in_checkout.' remaining in record '.$component_assets->id);
DB::table('components_assets')->where('id',
$component_asset_id)->update(['assigned_qty' => $qty_remaining_in_checkout]);
DB::table('components_assets')->where('id', $component_asset_id)->update(['assigned_qty' => $qty_remaining_in_checkout]);
// If the checked-in qty is exactly the same as the assigned_qty,
// we can simply delete the associated components_assets record
if ($qty_remaining_in_checkout == 0) {
if ($qty_remaining_in_checkout === 0) {
DB::table('components_assets')->where('id', '=', $component_asset_id)->delete();
}
$asset = Asset::find($component_assets->asset_id);
event(new CheckoutableCheckedIn($component, $asset, auth()->user(), $request->input('note'), Carbon::now()));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/components/message.checkin.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'No matching checkouts for that component join record'));
}
}

View File

@@ -23,7 +23,7 @@ class DepartmentsController extends Controller
public function index(Request $request) : JsonResponse | array
{
$this->authorize('view', Department::class);
$allowed_columns = ['id', 'name', 'image', 'users_count'];
$allowed_columns = ['id', 'name', 'image', 'users_count', 'notes'];
$departments = Department::select(
'departments.id',
@@ -35,7 +35,8 @@ class DepartmentsController extends Controller
'departments.manager_id',
'departments.created_at',
'departments.updated_at',
'departments.image'
'departments.image',
'departments.notes',
)->with('users')->with('location')->with('manager')->with('company')->withCount('users as users_count');
if ($request->filled('search')) {
@@ -72,6 +73,9 @@ class DepartmentsController extends Controller
case 'manager':
$departments->OrderManager($order);
break;
case 'company':
$departments->OrderCompany($order);
break;
default:
$departments->orderBy($sort, $order);
break;

View File

@@ -24,7 +24,7 @@ class GroupsController extends Controller
$this->authorize('view', Group::class);
$groups = Group::select('id', 'name', 'permissions', 'created_at', 'updated_at', 'created_by')->with('adminuser')->withCount('users as users_count');
$groups = Group::select('id', 'name', 'permissions', 'notes', 'created_at', 'updated_at', 'created_by')->with('adminuser')->withCount('users as users_count');
if ($request->filled('search')) {
$groups = $groups->TextSearch($request->input('search'));
@@ -81,6 +81,7 @@ class GroupsController extends Controller
$group->name = $request->input('name');
$group->created_by = auth()->id();
$group->notes = $request->input('notes');
$group->permissions = json_encode($request->input('permissions', $groupPermissions));
if ($group->save()) {
@@ -118,6 +119,7 @@ class GroupsController extends Controller
$group = Group::findOrFail($id);
$group->name = $request->input('name');
$group->notes = $request->input('notes');
$group->permissions = $request->input('permissions'); // Todo - some JSON validation stuff here
if ($group->save()) {

View File

@@ -9,12 +9,14 @@ use App\Http\Transformers\ImportsTransformer;
use App\Models\Asset;
use App\Models\Company;
use App\Models\Import;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Database\Eloquent\JsonEncodingException;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Storage;
use League\Csv\Reader;
use Onnov\DetectEncoding\EncodingDetector;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use Illuminate\Support\Facades\Log;
use Illuminate\Http\JsonResponse;
@@ -45,6 +47,8 @@ class ImportController extends Controller
$path = config('app.private_uploads').'/imports';
$results = [];
$import = new Import;
$detector = new EncodingDetector();
foreach ($files as $file) {
if (! in_array($file->getMimeType(), [
'application/vnd.ms-excel',
@@ -55,7 +59,6 @@ class ImportController extends Controller
'text/comma-separated-values',
'text/tsv', ])) {
$results['error'] = 'File type must be CSV. Uploaded file is '.$file->getMimeType();
return response()->json(Helper::formatStandardApiResponse('error', null, $results['error']), 422);
}
@@ -63,6 +66,40 @@ class ImportController extends Controller
if (! ini_get('auto_detect_line_endings')) {
ini_set('auto_detect_line_endings', '1');
}
if (function_exists('iconv')) {
$file_contents = $file->getContent(); //TODO - this *does* load the whole file in RAM, but we need that to be able to 'iconv' it?
$encoding = $detector->getEncoding($file_contents);
\Log::warning("Discovered encoding: $encoding in uploaded CSV");
$reader = null;
if (strcasecmp($encoding, 'UTF-8') != 0) {
$transliterated = false;
try {
$transliterated = iconv(strtoupper($encoding), 'UTF-8', $file_contents);
} catch (\Exception $e) {
$transliterated = false; //blank out the partially-decoded string
return response()->json(
Helper::formatStandardApiResponse(
'error',
null,
trans('admin/hardware/message.import.transliterate_failure', ["encoding" => $encoding])
),
422
);
}
if ($transliterated !== false) {
$tmpname = tempnam(sys_get_temp_dir(), '');
$tmpresults = file_put_contents($tmpname, $transliterated);
$transliterated = null; //save on memory?
if ($tmpresults !== false) {
$newfile = new UploadedFile($tmpname, $file->getClientOriginalName(), null, null, true); //WARNING: this is enabling 'test mode' - which is gross, but otherwise the file won't be treated as 'uploaded'
if ($newfile->isValid()) {
$file = $newfile;
}
}
}
}
$file_contents = null; //try to save on memory, I guess?
}
$reader = Reader::createFromFileObject($file->openFile('r')); //file pointer leak?
try {

View File

@@ -3,17 +3,20 @@
namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
use App\Http\Requests\ImageUploadRequest;
use App\Http\Controllers\Controller;
use App\Http\Requests\ImageUploadRequest;
use App\Http\Transformers\AccessoriesTransformer;
use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\LocationsTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Accessory;
use App\Models\AccessoryCheckout;
use App\Models\Asset;
use App\Models\Location;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
use Illuminate\Http\JsonResponse;
class LocationsController extends Controller
{
@@ -28,26 +31,29 @@ class LocationsController extends Controller
{
$this->authorize('view', Location::class);
$allowed_columns = [
'id',
'name',
'accessories_count',
'address',
'address2',
'assets_count',
'assets_count',
'assigned_accessories_count',
'assigned_assets_count',
'assigned_assets_count',
'city',
'state',
'country',
'zip',
'created_at',
'updated_at',
'manager_id',
'image',
'assigned_assets_count',
'users_count',
'assets_count',
'assigned_assets_count',
'assets_count',
'rtd_assets_count',
'currency',
'id',
'image',
'ldap_ou',
'manager_id',
'name',
'rtd_assets_count',
'state',
'updated_at',
'users_count',
'zip',
'notes',
];
$locations = Location::with('parent', 'manager', 'children')->select([
@@ -68,8 +74,12 @@ class LocationsController extends Controller
'locations.image',
'locations.ldap_ou',
'locations.currency',
])->withCount('assignedAssets as assigned_assets_count')
'locations.notes',
])
->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('assignedAccessories as assigned_accessories_count')
->withCount('accessories as accessories_count')
->withCount('rtd_assets as rtd_assets_count')
->withCount('children as children_count')
->withCount('users as users_count');
@@ -182,6 +192,7 @@ class LocationsController extends Controller
'locations.updated_at',
'locations.image',
'locations.currency',
'locations.notes',
])
->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
@@ -224,7 +235,17 @@ class LocationsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, $location->getErrors()));
}
public function assets(Request $request, Location $location) : JsonResponse | array
{
$this->authorize('view', Asset::class);
$this->authorize('view', $location);
$assets = Asset::where('location_id', '=', $location->id)->with('model', 'model.category', 'assetstatus', 'location', 'company', 'defaultLoc');
$assets = $assets->get();
return (new AssetsTransformer)->transformAssets($assets, $assets->count(), $request);
}
public function assignedAssets(Request $request, Location $location) : JsonResponse | array
{
$this->authorize('view', Asset::class);
$this->authorize('view', $location);
@@ -233,6 +254,20 @@ class LocationsController extends Controller
return (new AssetsTransformer)->transformAssets($assets, $assets->count(), $request);
}
public function assignedAccessories(Request $request, Location $location) : JsonResponse | array
{
$this->authorize('view', Accessory::class);
$this->authorize('view', $location);
$accessory_checkouts = AccessoryCheckout::LocationAssigned()->where('assigned_to', $location->id)->with('adminuser')->with('accessories');
$offset = ($request->input('offset') > $accessory_checkouts->count()) ? $accessory_checkouts->count() : app('api_offset_value');
$limit = app('api_limit_value');
$total = $accessory_checkouts->count();
$accessory_checkouts = $accessory_checkouts->skip($offset)->take($limit)->get();
return (new LocationsTransformer)->transformCheckedoutAccessories($accessory_checkouts, $total);
}
/**
* Remove the specified resource from storage.
*

View File

@@ -39,7 +39,8 @@ class ManufacturersController extends Controller
'assets_count',
'consumables_count',
'components_count',
'licenses_count'
'licenses_count',
'notes',
];
$manufacturers = Manufacturer::select([
@@ -55,6 +56,7 @@ class ManufacturersController extends Controller
'updated_at',
'image',
'deleted_at',
'notes',
])
->with('adminuser')
->withCount('assets as assets_count')

View File

@@ -290,10 +290,12 @@ class StatuslabelsController extends Controller
/**
* Returns a boolean response based on whether the status label
* is one that is deployable.
* is one that is deployable or pending.
*
* This is used by the hardware create/edit view to determine whether
* we should provide a dropdown of users for them to check the asset out to.
* we should provide a dropdown of users for them to check the asset out to,
* and whether we show a warning that the asset will be checked in if it's already
* assigned but the status is changed to one that isn't pending or deployable
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
@@ -301,7 +303,7 @@ class StatuslabelsController extends Controller
public function checkIfDeployable($id) : string
{
$statuslabel = Statuslabel::findOrFail($id);
if ($statuslabel->getStatuslabelType() == 'deployable') {
if (($statuslabel->getStatuslabelType() == 'pending') || ($statuslabel->getStatuslabelType() == 'deployable')) {
return '1';
}

View File

@@ -20,6 +20,7 @@ use App\Models\License;
use App\Models\User;
use App\Notifications\CurrentInventory;
use Illuminate\Support\Facades\Auth;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator;
@@ -80,7 +81,16 @@ class UsersController extends Controller
'users.website',
])->with('manager', 'groups', 'userloc', 'company', 'department', 'assets', 'licenses', 'accessories', 'consumables', 'createdBy', 'managesUsers', 'managedLocations')
->withCount('assets as assets_count', 'licenses as licenses_count', 'accessories as accessories_count', 'consumables as consumables_count', 'managesUsers as manages_users_count', 'managedLocations as manages_locations_count');
->withCount([
'assets as assets_count' => function(Builder $query) {
$query->withoutTrashed();
},
'licenses as licenses_count',
'accessories as accessories_count',
'consumables as consumables_count',
'managesUsers as manages_users_count',
'managedLocations as manages_locations_count'
]);
if ($request->filled('search') != '') {
@@ -283,6 +293,7 @@ class UsersController extends Controller
'autoassign_licenses',
'website',
'locale',
'notes',
];
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'first_name';
@@ -480,10 +491,11 @@ class UsersController extends Controller
$user->permissions = $permissions_array;
}
if($request->has('location_id')) {
// Update the location of any assets checked out to this user
Asset::where('assigned_type', User::class)
->where('assigned_to', $user->id)->update(['location_id' => $request->input('location_id', null)]);
}
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, 600, 'image', 'avatars', 'avatar');
if ($user->save()) {

View File

@@ -139,19 +139,12 @@ class AssetMaintenancesController extends Controller
* @version v1.0
* @since [v1.8]
*/
public function edit($assetMaintenanceId = null) : View | RedirectResponse
public function edit(AssetMaintenance $maintenance) : View | RedirectResponse
{
$this->authorize('update', Asset::class);
// Check if the asset maintenance exists
$this->authorize('update', Asset::class);
// Check if the asset maintenance exists
if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
// Redirect to the asset maintenance management page
return redirect()->route('maintenances.index')->with('error', trans('admin/asset_maintenances/message.not_found'));
} elseif ((!$assetMaintenance->asset) || ($assetMaintenance->asset->deleted_at!='')) {
// Redirect to the asset maintenance management page
if ((!$maintenance->asset) || ($maintenance->asset->deleted_at!='')) {
return redirect()->route('maintenances.index')->with('error', 'asset does not exist');
} elseif (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
} elseif (! Company::isCurrentUserHasAccess($maintenance->asset)) {
return static::getInsufficientPermissionsRedirect();
}
@@ -161,7 +154,7 @@ class AssetMaintenancesController extends Controller
return view('asset_maintenances/edit')
->with('selectedAsset', null)
->with('assetMaintenanceType', $assetMaintenanceType)
->with('item', $assetMaintenance);
->with('item', $maintenance);
}
/**
@@ -174,24 +167,20 @@ class AssetMaintenancesController extends Controller
* @version v1.0
* @since [v1.8]
*/
public function update(Request $request, $assetMaintenanceId = null) : View | RedirectResponse
public function update(Request $request, AssetMaintenance $maintenance) : View | RedirectResponse
{
$this->authorize('update', Asset::class);
// Check if the asset maintenance exists
if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
// Redirect to the asset maintenance management page
return redirect()->route('maintenances.index')->with('error', trans('admin/asset_maintenances/message.not_found'));
} elseif ((!$assetMaintenance->asset) || ($assetMaintenance->asset->deleted_at!='')) {
// Redirect to the asset maintenance management page
if ((!$maintenance->asset) || ($maintenance->asset->deleted_at!='')) {
return redirect()->route('maintenances.index')->with('error', 'asset does not exist');
} elseif (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
} elseif (! Company::isCurrentUserHasAccess($maintenance->asset)) {
return static::getInsufficientPermissionsRedirect();
}
$assetMaintenance->supplier_id = $request->input('supplier_id');
$assetMaintenance->is_warranty = $request->input('is_warranty');
$assetMaintenance->cost = $request->input('cost');
$assetMaintenance->notes = $request->input('notes');
$maintenance->supplier_id = $request->input('supplier_id');
$maintenance->is_warranty = $request->input('is_warranty');
$maintenance->cost = $request->input('cost');
$maintenance->notes = $request->input('notes');
$asset = Asset::find(request('asset_id'));
@@ -200,39 +189,39 @@ class AssetMaintenancesController extends Controller
}
// Save the asset maintenance data
$assetMaintenance->asset_id = $request->input('asset_id');
$assetMaintenance->asset_maintenance_type = $request->input('asset_maintenance_type');
$assetMaintenance->title = $request->input('title');
$assetMaintenance->start_date = $request->input('start_date');
$assetMaintenance->completion_date = $request->input('completion_date');
$maintenance->asset_id = $request->input('asset_id');
$maintenance->asset_maintenance_type = $request->input('asset_maintenance_type');
$maintenance->title = $request->input('title');
$maintenance->start_date = $request->input('start_date');
$maintenance->completion_date = $request->input('completion_date');
if (($assetMaintenance->completion_date == null)
if (($maintenance->completion_date == null)
) {
if (($assetMaintenance->asset_maintenance_time !== 0)
|| (! is_null($assetMaintenance->asset_maintenance_time))
if (($maintenance->asset_maintenance_time !== 0)
|| (! is_null($maintenance->asset_maintenance_time))
) {
$assetMaintenance->asset_maintenance_time = null;
$maintenance->asset_maintenance_time = null;
}
}
if (($assetMaintenance->completion_date !== null)
&& ($assetMaintenance->start_date !== '')
&& ($assetMaintenance->start_date !== '0000-00-00')
if (($maintenance->completion_date !== null)
&& ($maintenance->start_date !== '')
&& ($maintenance->start_date !== '0000-00-00')
) {
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$assetMaintenance->asset_maintenance_time = $completionDate->diffInDays($startDate);
$startDate = Carbon::parse($maintenance->start_date);
$completionDate = Carbon::parse($maintenance->completion_date);
$maintenance->asset_maintenance_time = $completionDate->diffInDays($startDate);
}
// Was the asset maintenance created?
if ($assetMaintenance->save()) {
if ($maintenance->save()) {
// Redirect to the new asset maintenance page
return redirect()->route('maintenances.index')
->with('success', trans('admin/asset_maintenances/message.edit.success'));
}
return redirect()->back()->withInput()->withErrors($assetMaintenance->getErrors());
return redirect()->back()->withInput()->withErrors($maintenance->getErrors());
}
/**
@@ -271,19 +260,13 @@ class AssetMaintenancesController extends Controller
* @version v1.0
* @since [v1.8]
*/
public function show($assetMaintenanceId) : View | RedirectResponse
public function show(AssetMaintenance $maintenance) : View | RedirectResponse
{
$this->authorize('view', Asset::class);
// Check if the asset maintenance exists
if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
// Redirect to the asset maintenance management page
return redirect()->route('maintenances.index')
->with('error', trans('admin/asset_maintenances/message.not_found'));
} elseif (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
if (! Company::isCurrentUserHasAccess($maintenance->asset)) {
return static::getInsufficientPermissionsRedirect();
}
return view('asset_maintenances/view')->with('assetMaintenance', $assetMaintenance);
return view('asset_maintenances/view')->with('assetMaintenance', $maintenance);
}
}

View File

@@ -18,6 +18,7 @@ use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Log;
use \Illuminate\Contracts\View\View;
use \Illuminate\Http\RedirectResponse;
use Illuminate\Support\MessageBag;
/**
@@ -29,6 +30,7 @@ use \Illuminate\Http\RedirectResponse;
*/
class AssetModelsController extends Controller
{
protected MessageBag $validatorErrors;
/**
* Returns a view that invokes the ajax tables which actually contains
* the content for the accessories listing, which is generated in getDatatable.
@@ -107,16 +109,11 @@ class AssetModelsController extends Controller
* @since [v1.0]
* @param int $modelId
*/
public function edit($modelId = null) : View | RedirectResponse
public function edit(AssetModel $model) : View | RedirectResponse
{
$this->authorize('update', AssetModel::class);
if ($item = AssetModel::find($modelId)) {
$category_type = 'asset';
return view('models/edit', compact('item', 'category_type'))->with('depreciation_list', Helper::depreciationList());
}
return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));
return view('models/edit', compact('category_type'))->with('item', $model)->with('depreciation_list', Helper::depreciationList());
}
@@ -131,16 +128,11 @@ class AssetModelsController extends Controller
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function update(StoreAssetModelRequest $request, $modelId) : RedirectResponse
public function update(StoreAssetModelRequest $request, AssetModel $model) : RedirectResponse
{
$this->authorize('update', AssetModel::class);
if (is_null($model = AssetModel::find($modelId))) {
return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));
}
$model = $request->handleImages($model);
$model->depreciation_id = $request->input('depreciation_id');
$model->eol = $request->input('eol');
$model->name = $request->input('name');
@@ -158,7 +150,7 @@ class AssetModelsController extends Controller
if ($this->shouldAddDefaultValues($request->input())) {
if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))) {
return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error'));
return redirect()->back()->withInput()->withErrors($this->validatorErrors);
}
}
@@ -186,28 +178,16 @@ class AssetModelsController extends Controller
* @since [v1.0]
* @param int $modelId
*/
public function destroy($modelId) : RedirectResponse
public function destroy(AssetModel $model) : RedirectResponse
{
$this->authorize('delete', AssetModel::class);
// Check if the model exists
if (is_null($model = AssetModel::find($modelId))) {
return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));
}
if ($model->assets()->count() > 0) {
// Throw an error that this model is associated with assets
return redirect()->route('models.index')->with('error', trans('admin/models/message.assoc_users'));
}
if ($model->image) {
try {
Storage::disk('public')->delete('models/'.$model->image);
$model->update(['image' => null]);
} catch (\Exception $e) {
Log::info($e);
}
}
// Delete the model
$model->delete();
@@ -265,18 +245,12 @@ class AssetModelsController extends Controller
* @since [v1.0]
* @param int $modelId
*/
public function show($modelId = null) : View | RedirectResponse
public function show(AssetModel $model) : View | RedirectResponse
{
$this->authorize('view', AssetModel::class);
$model = AssetModel::withTrashed()->find($modelId);
if (isset($model->id)) {
return view('models/view', compact('model'));
}
return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));
}
/**
* Get the clone page to clone a model
*
@@ -284,23 +258,20 @@ class AssetModelsController extends Controller
* @since [v1.0]
* @param int $modelId
*/
public function getClone($modelId = null) : View | RedirectResponse
public function getClone(AssetModel $model) : View | RedirectResponse
{
$this->authorize('create', AssetModel::class);
// Check if the model exists
if (is_null($model_to_clone = AssetModel::find($modelId))) {
return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));
}
$model = clone $model_to_clone;
$cloned_model = clone $model;
$model->id = null;
$model->deleted_at = null;
// Show the page
return view('models/edit')
->with('depreciation_list', Helper::depreciationList())
->with('item', $model)
->with('model_id', $model_to_clone->id)
->with('clone_model', $model_to_clone);
->with('model_id', $model->id)
->with('clone_model', $cloned_model);
}
@@ -319,7 +290,7 @@ class AssetModelsController extends Controller
/**
* Returns a view that allows the user to bulk edit model attrbutes
* Returns a view that allows the user to bulk edit model attributes
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.7]
@@ -481,9 +452,15 @@ class AssetModelsController extends Controller
$rules[$field] = $validation;
}
$validator = Validator::make($data, $rules);
$attributes = [];
foreach ($model->fieldset->fields as $field) {
$attributes[$field->db_column] = trim(preg_replace('/_+|snipeit|\d+/', ' ', $field->db_column));
}
$validator = Validator::make($data, $rules)->setAttributeNames($attributes);
if($validator->fails()){
$this->validatorErrors = $validator->errors();
return false;
}

View File

@@ -44,10 +44,10 @@ class AssetModelsFilesController extends Controller
$model->logUpload($file_name, $request->get('notes'));
}
return redirect()->back()->with('success', trans('general.file_upload_success'));
return redirect()->back()->withFragment('files')->with('success', trans('general.file_upload_success'));
}
return redirect()->back()->with('error', trans('admin/hardware/message.upload.nofiles'));
return redirect()->back()->withFragment('files')->with('error', trans('admin/hardware/message.upload.nofiles'));
}
/**
@@ -58,11 +58,9 @@ class AssetModelsFilesController extends Controller
* @param int $fileId
* @since [v1.0]
*/
public function show($modelId = null, $fileId = null) : StreamedResponse | Response | RedirectResponse | BinaryFileResponse
public function show(AssetModel $model, $fileId = null) : StreamedResponse | Response | RedirectResponse | BinaryFileResponse
{
$model = AssetModel::find($modelId);
// the asset is valid
if (isset($model->id)) {
$this->authorize('view', $model);
if (! $log = Actionlog::find($fileId)) {
@@ -88,12 +86,6 @@ class AssetModelsFilesController extends Controller
return StorageHelper::downloader($file);
}
// Prepare the error message
$error = trans('admin/hardware/message.does_not_exist', ['id' => $fileId]);
// Redirect to the hardware management page
return redirect()->route('hardware.index')->with('error', $error);
}
/**
* Delete the associated file
@@ -103,14 +95,9 @@ class AssetModelsFilesController extends Controller
* @param int $fileId
* @since [v1.0]
*/
public function destroy($modelId = null, $fileId = null) : RedirectResponse
public function destroy(AssetModel $model, $fileId = null) : RedirectResponse
{
$model = AssetModel::find($modelId);
$this->authorize('update', $model);
$rel_path = 'private_uploads/assetmodels';
// the asset is valid
if (isset($model->id)) {
$this->authorize('update', $model);
$log = Actionlog::find($fileId);
if ($log) {
@@ -119,14 +106,10 @@ class AssetModelsFilesController extends Controller
}
$log->delete();
return redirect()->back()->with('success', trans('admin/hardware/message.deletefile.success'));
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.deletefile.success'));
}
return redirect()->back()
->with('success', trans('admin/hardware/message.deletefile.success'));
}
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.deletefile.success'));
// Redirect to the hardware management page
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
}

View File

@@ -27,18 +27,12 @@ class AssetCheckinController extends Controller
* @param string $backto
* @since [v1.0]
*/
public function create($assetId, $backto = null) : View | RedirectResponse
public function create(Asset $asset, $backto = null) : View | RedirectResponse
{
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
// Redirect to the asset management page with error
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$this->authorize('checkin', $asset);
// This asset is already checked in, redirect
if (is_null($asset->assignedTo)) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkin.already_checked_in'));
}
@@ -47,7 +41,11 @@ class AssetCheckinController extends Controller
return redirect()->route('hardware.show', $asset->id)->with('error', trans('admin/hardware/general.model_invalid_fix'));
}
return view('hardware/checkin', compact('asset'))->with('statusLabel_list', Helper::statusLabelList())->with('backto', $backto)->with('table_name', 'Assets');
return view('hardware/checkin', compact('asset'))
->with('item', $asset)
->with('statusLabel_list', Helper::statusLabelList())
->with('backto', $backto)
->with('table_name', 'Assets');
}
/**
@@ -91,6 +89,9 @@ class AssetCheckinController extends Controller
$asset->status_id = e($request->get('status_id'));
}
// Add any custom fields that should be included in the checkout
$asset->customFieldsForCheckinCheckout('display_checkin');
$this->migrateLegacyLocations($asset);
$asset->location_id = $asset->rtd_location_id;
@@ -128,6 +129,9 @@ class AssetCheckinController extends Controller
session()->put('redirect_option', $request->get('redirect_option'));
// Add any custom fields that should be included in the checkout
$asset->customFieldsForCheckinCheckout('display_checkin');
if ($asset->save()) {
event(new CheckoutableCheckedIn($asset, $target, auth()->user(), $request->input('note'), $checkin_at, $originalValues));

View File

@@ -26,27 +26,25 @@ class AssetCheckoutController extends Controller
* @since [v1.0]
* @return \Illuminate\Contracts\View\View
*/
public function create($assetId) : View | RedirectResponse
public function create(Asset $asset) : View | RedirectResponse
{
// Check if the asset exists
if (is_null($asset = Asset::with('company')->find(e($assetId)))) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$this->authorize('checkout', $asset);
if (!$asset->model) {
return redirect()->route('hardware.show', $asset->id)->with('error', trans('admin/hardware/general.model_invalid_fix'));
return redirect()->route('hardware.show', $asset)
->with('error', trans('admin/hardware/general.model_invalid_fix'));
}
if ($asset->availableForCheckout()) {
return view('hardware/checkout', compact('asset'))
->with('statusLabel_list', Helper::deployableStatusLabelList())
->with('table_name', 'Assets');
->with('table_name', 'Assets')
->with('item', $asset);
}
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkout.not_available'));
return redirect()->route('hardware.index')
->with('error', trans('admin/hardware/message.checkout.not_available'));
}
/**
@@ -68,7 +66,7 @@ class AssetCheckoutController extends Controller
$this->authorize('checkout', $asset);
if (!$asset->model) {
return redirect()->route('hardware.show', $asset->id)->with('error', trans('admin/hardware/general.model_invalid_fix'));
return redirect()->route('hardware.show', $asset)->with('error', trans('admin/hardware/general.model_invalid_fix'));
}
$admin = auth()->user();
@@ -91,6 +89,7 @@ class AssetCheckoutController extends Controller
$asset->status_id = $request->get('status_id');
}
if(!empty($asset->licenseseats->all())){
if(request('checkout_to_type') == 'user') {
foreach ($asset->licenseseats as $seat){
@@ -100,12 +99,15 @@ class AssetCheckoutController extends Controller
}
}
// Add any custom fields that should be included in the checkout
$asset->customFieldsForCheckinCheckout('display_checkout');
$settings = \App\Models\Setting::getSettings();
// We have to check whether $target->company_id is null here since locations don't have a company yet
if (($settings->full_multiple_companies_support) && ((!is_null($target->company_id)) && (!is_null($asset->company_id)))) {
if ($target->company_id != $asset->company_id){
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('general.error_user_company'));
return redirect()->route('hardware.checkout.create', $asset)->with('error', trans('general.error_user_company'));
}
}
@@ -116,7 +118,7 @@ class AssetCheckoutController extends Controller
->with('success', trans('admin/hardware/message.checkout.success'));
}
// Redirect to the asset management page with error
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('admin/hardware/message.checkout.error').$asset->getErrors());
return redirect()->route("hardware.checkout.create", $asset)->with('error', trans('admin/hardware/message.checkout.error').$asset->getErrors());
} catch (ModelNotFoundException $e) {
return redirect()->back()->with('error', trans('admin/hardware/message.checkout.error'))->withErrors($asset->getErrors());
} catch (CheckoutNotAllowed $e) {

View File

@@ -26,11 +26,8 @@ class AssetFilesController extends Controller
*@since [v1.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
*/
public function store(UploadFileRequest $request, $assetId = null) : RedirectResponse
public function store(UploadFileRequest $request, Asset $asset) : RedirectResponse
{
if (! $asset = Asset::find($assetId)) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$this->authorize('update', $asset);
@@ -45,7 +42,7 @@ class AssetFilesController extends Controller
$asset->logUpload($file_name, $request->get('notes'));
}
return redirect()->back()->with('success', trans('admin/hardware/message.upload.success'));
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.upload.success'));
}
return redirect()->back()->with('error', trans('admin/hardware/message.upload.nofiles'));
@@ -59,9 +56,8 @@ class AssetFilesController extends Controller
* @param int $fileId
* @since [v1.0]
*/
public function show($assetId = null, $fileId = null) : View | RedirectResponse | Response | StreamedResponse | BinaryFileResponse
public function show(Asset $asset, $fileId = null) : View | RedirectResponse | Response | StreamedResponse | BinaryFileResponse
{
if ($asset = Asset::find($assetId)) {
$this->authorize('view', $asset);
@@ -75,15 +71,13 @@ class AssetFilesController extends Controller
try {
return StorageHelper::showOrDownloadFile($file, $log->filename);
} catch (\Exception $e) {
return redirect()->route('hardware.show', ['hardware' => $asset])->with('error', trans('general.file_not_found'));
return redirect()->route('hardware.show', $asset)->with('error', trans('general.file_not_found'));
}
}
return redirect()->route('hardware.show', ['hardware' => $asset])->with('error', trans('general.log_record_not_found'));
}
return redirect()->route('hardware.show', $asset)->with('error', trans('general.log_record_not_found'));
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
@@ -95,29 +89,20 @@ class AssetFilesController extends Controller
* @param int $fileId
* @since [v1.0]
*/
public function destroy($assetId = null, $fileId = null) : RedirectResponse
public function destroy(Asset $asset, $fileId = null) : RedirectResponse
{
$asset = Asset::find($assetId);
$this->authorize('update', $asset);
$rel_path = 'private_uploads/assets';
// the asset is valid
if (isset($asset->id)) {
$this->authorize('update', $asset);
$log = Actionlog::find($fileId);
if ($log) {
if ($log = Actionlog::find($fileId)) {
if (Storage::exists($rel_path.'/'.$log->filename)) {
Storage::delete($rel_path.'/'.$log->filename);
}
$log->delete();
return redirect()->back()->with('success', trans('admin/hardware/message.deletefile.success'));
return redirect()->back()->withFragment('files')->with('success', trans('admin/hardware/message.deletefile.success'));
}
return redirect()->back()
->with('success', trans('admin/hardware/message.deletefile.success'));
return redirect()->route('hardware.show', $asset)->with('error', trans('general.log_record_not_found'));
}
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
}

View File

@@ -30,6 +30,7 @@ use Illuminate\Http\Response;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use TypeError;
/**
* This class controls all actions related to assets for
@@ -201,7 +202,7 @@ class AssetsController extends Controller
$asset->checkOut($target, auth()->user(), date('Y-m-d H:i:s'), $request->input('expected_checkin', null), 'Checked out on asset creation', $request->get('name'), $location);
}
$successes[] = "<a href='" . route('hardware.show', ['hardware' => $asset->id]) . "' style='color: white;'>" . e($asset->asset_tag) . "</a>";
$successes[] = "<a href='" . route('hardware.show', $asset) . "' style='color: white;'>" . e($asset->asset_tag) . "</a>";
} else {
$failures[] = join(",", $asset->getErrors()->all());
@@ -222,7 +223,7 @@ class AssetsController extends Controller
//the most common case, keeping it so we don't have to make every use of that translation string be trans_choice'ed
//and re-translated
return redirect()->to(Helper::getRedirectOption($request, $asset->id, 'Assets'))
->with('success-unescaped', trans('admin/hardware/message.create.success_linked', ['link' => route('hardware.show', ['hardware' => $asset->id]), 'id', 'tag' => e($asset->asset_tag)]));
->with('success-unescaped', trans('admin/hardware/message.create.success_linked', ['link' => route('hardware.show', $asset), 'id', 'tag' => e($asset->asset_tag)]));
} else {
//multi-success
return redirect()->to(Helper::getRedirectOption($request, $asset->id, 'Assets'))
@@ -240,20 +241,14 @@ class AssetsController extends Controller
* Returns a view that presents a form to edit an existing asset.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @since [v1.0]
* @return \Illuminate\Contracts\View\View
*/
public function edit($assetId = null) : View | RedirectResponse
public function edit(Asset $asset) : View | RedirectResponse
{
if (! $item = Asset::find($assetId)) {
// Redirect to the asset management page with error
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
//Handles company checks and permissions.
$this->authorize($item);
return view('hardware/edit', compact('item'))
$this->authorize($asset);
return view('hardware/edit')
->with('item', $asset)
->with('statuslabel_list', Helper::statusLabelList())
->with('statuslabel_types', Helper::statusTypeList());
}
@@ -267,15 +262,14 @@ class AssetsController extends Controller
* @since [v1.0]
* @return \Illuminate\Contracts\View\View
*/
public function show($assetId = null) : View | RedirectResponse
public function show(Asset $asset) : View | RedirectResponse
{
$asset = Asset::withTrashed()->find($assetId);
$this->authorize('view', $asset);
$settings = Setting::getSettings();
if (isset($asset)) {
$audit_log = Actionlog::where('action_type', '=', 'audit')
->where('item_id', '=', $assetId)
->where('item_id', '=', $asset->id)
->where('item_type', '=', Asset::class)
->orderBy('created_at', 'DESC')->first();
@@ -291,7 +285,7 @@ class AssetsController extends Controller
$qr_code = (object) [
'display' => $settings->qr_code == '1',
'url' => route('qr_code/hardware', $asset->id),
'url' => route('qr_code/hardware', $asset),
];
return view('hardware/view', compact('asset', 'qr_code', 'settings'))
@@ -308,14 +302,9 @@ class AssetsController extends Controller
* @since [v1.0]
* @author [A. Gianotto] [<snipe@snipe.net>]
*/
public function update(ImageUploadRequest $request, $assetId = null) : RedirectResponse
public function update(ImageUploadRequest $request, Asset $asset) : RedirectResponse
{
// Check if the asset exists
if (! $asset = Asset::find($assetId)) {
// Redirect to the asset management page with error
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$this->authorize($asset);
$asset->status_id = $request->input('status_id', null);
@@ -351,15 +340,14 @@ class AssetsController extends Controller
$status = Statuslabel::find($request->input('status_id'));
// This is a non-deployable status label - we should check the asset back in.
if (($status && $status->getStatuslabelType() != 'deployable') && ($target = $asset->assignedTo)) {
// This is an archived or undeployable - we should check the asset back in.
// Pending is allowed here
if (($status) && (($status->getStatuslabelType() != 'pending') && ($status->getStatuslabelType() != 'deployable')) && ($target = $asset->assignedTo)) {
$originalValues = $asset->getRawOriginal();
$asset->assigned_to = null;
$asset->assigned_type = null;
$asset->accepted = null;
event(new CheckoutableCheckedIn($asset, $target, auth()->user(), 'Checkin on asset update', date('Y-m-d H:i:s'), $originalValues));
event(new CheckoutableCheckedIn($asset, $target, auth()->user(), 'Checkin on asset update with '.$status->getStatuslabelType().' status', date('Y-m-d H:i:s'), $originalValues));
}
if ($asset->assigned_to == '') {
@@ -430,7 +418,7 @@ class AssetsController extends Controller
session()->put(['redirect_option' => $request->get('redirect_option'), 'checkout_to_type' => $request->get('checkout_to_type')]);
if ($asset->save()) {
return redirect()->to(Helper::getRedirectOption($request, $assetId, 'Assets'))
return redirect()->to(Helper::getRedirectOption($request, $asset->id, 'Assets'))
->with('success', trans('admin/hardware/message.update.success'));
}
@@ -531,14 +519,14 @@ class AssetsController extends Controller
* @param int $assetId
* @since [v1.0]
*/
public function getQrCode($assetId = null) : Response | BinaryFileResponse | string | bool
public function getQrCode(Asset $asset) : Response | BinaryFileResponse | string | bool
{
$settings = Setting::getSettings();
if ($settings->qr_code == '1') {
$asset = Asset::withTrashed()->find($assetId);
if (($settings->qr_code == '1') && ($settings->label2_2d_type !== 'none')) {
if ($asset) {
$size = Helper::barcodeDimensions($settings->barcode_type);
$size = Helper::barcodeDimensions($settings->label2_2d_type);
$qr_file = public_path().'/uploads/barcodes/qr-'.str_slug($asset->asset_tag).'-'.str_slug($asset->id).'.png';
if (isset($asset->id, $asset->asset_tag)) {
@@ -548,7 +536,7 @@ class AssetsController extends Controller
return response()->file($qr_file, $header);
} else {
$barcode = new \Com\Tecnick\Barcode\Barcode();
$barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('hardware.show', $asset->id), $size['height'], $size['width'], 'black', [-2, -2, -2, -2]);
$barcode_obj = $barcode->getBarcodeObj($settings->label2_2d_type, route('hardware.show', $asset->id), $size['height'], $size['width'], 'black', [-2, -2, -2, -2]);
file_put_contents($qr_file, $barcode_obj->getPngData());
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
@@ -573,7 +561,7 @@ class AssetsController extends Controller
{
$settings = Setting::getSettings();
if ($asset = Asset::withTrashed()->find($assetId)) {
$barcode_file = public_path().'/uploads/barcodes/'.str_slug($settings->alt_barcode).'-'.str_slug($asset->asset_tag).'.png';
$barcode_file = public_path().'/uploads/barcodes/'.str_slug($settings->label2_1d_type).'-'.str_slug($asset->asset_tag).'.png';
if (isset($asset->id, $asset->asset_tag)) {
if (file_exists($barcode_file)) {
@@ -586,11 +574,11 @@ class AssetsController extends Controller
$barcode = new \Com\Tecnick\Barcode\Barcode();
try {
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode, $asset->asset_tag, ($barcode_width < 300 ? $barcode_width : 300), 50);
$barcode_obj = $barcode->getBarcodeObj($settings->label2_1d_type, $asset->asset_tag, ($barcode_width < 300 ? $barcode_width : 300), 50);
file_put_contents($barcode_file, $barcode_obj->getPngData());
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
} catch (\Exception $e) {
} catch (\Exception|TypeError $e) {
Log::debug('The barcode format is invalid.');
return response(file_get_contents(public_path('uploads/barcodes/invalid_barcode.gif')))->header('Content-type', 'image/gif');
@@ -865,8 +853,8 @@ class AssetsController extends Controller
public function quickScan()
{
$this->authorize('audit', Asset::class);
$dt = Carbon::now()->addMonths(12)->toDateString();
$settings = Setting::getSettings();
$dt = Carbon::now()->addMonths($settings->audit_interval)->toDateString();
return view('hardware/quickscan')->with('next_audit_date', $dt);
}
@@ -877,13 +865,11 @@ class AssetsController extends Controller
return view('hardware/quickscan-checkin')->with('statusLabel_list', Helper::statusLabelList());
}
public function audit($id)
public function audit(Asset $asset)
{
$settings = Setting::getSettings();
$this->authorize('audit', Asset::class);
$dt = Carbon::now()->addMonths($settings->audit_interval)->toDateString();
$asset = Asset::findOrFail($id);
return view('hardware/audit')->with('asset', $asset)->with('next_audit_date', $dt)->with('locations_list');
}
@@ -902,7 +888,7 @@ class AssetsController extends Controller
}
public function auditStore(UploadFileRequest $request, $id)
public function auditStore(UploadFileRequest $request, Asset $asset)
{
$this->authorize('audit', Asset::class);
@@ -917,8 +903,6 @@ class AssetsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, $validator->errors()->all()));
}
$asset = Asset::findOrFail($id);
/**
* Even though we do a save() further down, we don't want to log this as a "normal" asset update,
* which would trigger the Asset Observer and would log an asset *update* log entry (because the

View File

@@ -358,7 +358,11 @@ class BulkAssetsController extends Controller
* to someone/something.
*/
if ($request->filled('status_id')) {
$updated_status = Statuslabel::find($request->input('status_id'));
try {
$updated_status = Statuslabel::findOrFail($request->input('status_id'));
} catch (ModelNotFoundException $e) {
return redirect($bulk_back_url)->with('error', trans('admin/statuslabels/message.does_not_exist'));
}
// We cannot assign a non-deployable status type if the asset is already assigned.
// This could probably be added to a form request.
@@ -366,7 +370,7 @@ class BulkAssetsController extends Controller
// Otherwise we need to make sure the status type is still a deployable one.
if (
($asset->assigned_to == '')
|| ($updated_status->deployable == '1') && ($asset->assetstatus->deployable == '1')
|| ($updated_status->deployable == '1') && ($asset->assetstatus?->deployable == '1')
) {
$this->update_array['status_id'] = $updated_status->id;
}
@@ -525,21 +529,31 @@ class BulkAssetsController extends Controller
$this->authorize('delete', Asset::class);
$bulk_back_url = route('hardware.index');
if ($request->session()->has('bulk_back_url')) {
$bulk_back_url = $request->session()->pull('bulk_back_url');
}
$assetIds = $request->get('ids');
if ($request->filled('ids')) {
$assets = Asset::find($request->get('ids'));
foreach ($assets as $asset) {
if(empty($assetIds)) {
return redirect($bulk_back_url)->with('error', trans('admin/hardware/message.delete.nothing_updated'));
}
$assignedAssets = Asset::whereIn('id', $assetIds)->whereNotNull('assigned_to')->get();
if($assignedAssets->isNotEmpty()) {
//if assets are checked out, return a list of asset tags that would need to be checked in first.
$assetTags = $assignedAssets->pluck('asset_tag')->implode(', ');
return redirect($bulk_back_url)->with('error', trans_choice('admin/hardware/message.delete.assigned_to_error', $assignedAssets->count(), ['asset_tag' => $assetTags] ));
}
foreach (Asset::wherein('id', $assetIds)->get() as $asset) {
$asset->delete();
} // endforeach
}
return redirect($bulk_back_url)->with('success', trans('admin/hardware/message.delete.success'));
// no values given, nothing to update
}
return redirect($bulk_back_url)->with('error', trans('admin/hardware/message.delete.nothing_updated'));
}
/**

View File

@@ -50,14 +50,14 @@ class ForgotPasswordController extends Controller
*/
public function sendResetLinkEmail(Request $request)
{
/**
* Let's set a max character count here to prevent potential
* buffer overflow issues with attackers sending very large
* payloads through.
* payloads through. The addition of the string rule prevents attackers
* sending arrays through and causing 500s
*/
$request->validate([
'username' => ['required', 'max:255'],
'username' => ['required', 'max:255', 'string'],
]);
/**

View File

@@ -206,6 +206,7 @@ class LoginController extends Controller
$user->password = bcrypt($request->input('password'));
}
$user->last_login = \Carbon::now();
$user->email = $ldap_attr['email'];
$user->first_name = $ldap_attr['firstname'];
$user->last_name = $ldap_attr['lastname']; //FIXME (or TODO?) - do we need to map additional fields that we now support? E.g. country, phone, etc.
@@ -432,6 +433,7 @@ class LoginController extends Controller
if (Google2FA::verifyKey($user->two_factor_secret, $secret)) {
$user->two_factor_enrolled = 1;
$user->last_login = \Carbon::now();
$user->saveQuietly();
$request->session()->put('2fa_authed', $user->id);

View File

@@ -103,6 +103,7 @@ class ResetPasswordController extends Controller
], $messages);
}
if ($user->ldap_import != '1') {
// set the response
$response = $broker->reset(
@@ -112,12 +113,13 @@ class ResetPasswordController extends Controller
// Check if the password reset above actually worked
if ($response == \Password::PASSWORD_RESET) {
Log::debug('Password reset for '.$user->username.' worked');
Log::debug('Password reset for ' . $user->username . ' worked');
return redirect()->guest('login')->with('success', trans('passwords.reset'));
}
Log::debug('Password reset for '.$user->username.' FAILED - this user exists but the token is not valid');
Log::debug('Password reset for ' . $user->username . ' FAILED - this user exists but the token is not valid');
return redirect()->back()->withInput($request->only('email'))->with('success', trans('passwords.reset'));
}
}

View File

@@ -69,6 +69,7 @@ class CategoriesController extends Controller
$category->use_default_eula = $request->input('use_default_eula', '0');
$category->require_acceptance = $request->input('require_acceptance', '0');
$category->checkin_email = $request->input('checkin_email', '0');
$category->notes = $request->input('notes');
$category->created_by = auth()->id();
$category = $request->handleImages($category);
@@ -87,14 +88,10 @@ class CategoriesController extends Controller
* @param int $categoryId
* @since [v1.0]
*/
public function edit($categoryId = null) : RedirectResponse | View
public function edit(Category $category) : RedirectResponse | View
{
$this->authorize('update', Category::class);
if (is_null($item = Category::find($categoryId))) {
return redirect()->route('categories.index')->with('error', trans('admin/categories/message.does_not_exist'));
}
return view('categories/edit', compact('item'))
return view('categories/edit')->with('item', $category)
->with('category_types', Helper::categoryTypeList());
}
@@ -107,19 +104,10 @@ class CategoriesController extends Controller
* @param int $categoryId
* @since [v1.0]
*/
public function update(ImageUploadRequest $request, $categoryId = null) : RedirectResponse
public function update(ImageUploadRequest $request, Category $category) : RedirectResponse
{
$this->authorize('update', Category::class);
if (is_null($category = Category::find($categoryId))) {
// Redirect to the categories management page
return redirect()->route('categories.index')->with('error', trans('admin/categories/message.does_not_exist'));
}
// Update the category data
$category->name = $request->input('name');
// If the item count is > 0, we disable the category type in the edit. Disabled items
// don't POST, so if the category_type is blank we just set it to the default.
// Don't allow the user to change the category_type once it's been created
if (($request->filled('category_type') && ($category->itemCount() > 0))) {
@@ -134,6 +122,7 @@ class CategoriesController extends Controller
$category->use_default_eula = $request->input('use_default_eula', '0');
$category->require_acceptance = $request->input('require_acceptance', '0');
$category->checkin_email = $request->input('checkin_email', '0');
$category->notes = $request->input('notes');
$category = $request->handleImages($category);
@@ -179,10 +168,10 @@ class CategoriesController extends Controller
* @param $id
* @since [v1.8]
*/
public function show($id) : View | RedirectResponse
public function show(Category $category) : View | RedirectResponse
{
$this->authorize('view', Category::class);
if ($category = Category::find($id)) {
if ($category->category_type == 'asset') {
$category_type = 'hardware';
$category_type_route = 'assets';
@@ -198,7 +187,4 @@ class CategoriesController extends Controller
->with('category_type', $category_type)
->with('category_type_route', $category_type_route);
}
return redirect()->route('categories.index')->with('error', trans('admin/categories/message.does_not_exist'));
}
}

View File

@@ -60,6 +60,7 @@ final class CompaniesController extends Controller
$company->phone = $request->input('phone');
$company->fax = $request->input('fax');
$company->email = $request->input('email');
$company->notes = $request->input('notes');
$company->created_by = auth()->id();
$company = $request->handleImages($company);
@@ -79,16 +80,10 @@ final class CompaniesController extends Controller
* @since [v1.8]
* @param int $companyId
*/
public function edit($companyId) : View | RedirectResponse
public function edit(Company $company) : View | RedirectResponse
{
if (is_null($item = Company::find($companyId))) {
return redirect()->route('companies.index')
->with('error', trans('admin/companies/message.does_not_exist'));
}
$this->authorize('update', $item);
return view('companies/edit')->with('item', $item);
$this->authorize('update', $company);
return view('companies/edit')->with('item', $company);
}
/**
@@ -99,18 +94,15 @@ final class CompaniesController extends Controller
* @param ImageUploadRequest $request
* @param int $companyId
*/
public function update(ImageUploadRequest $request, $companyId) : RedirectResponse
public function update(ImageUploadRequest $request, Company $company) : RedirectResponse
{
if (is_null($company = Company::find($companyId))) {
return redirect()->route('companies.index')->with('error', trans('admin/companies/message.does_not_exist'));
}
$this->authorize('update', $company);
$company->name = $request->input('name');
$company->phone = $request->input('phone');
$company->fax = $request->input('fax');
$company->email = $request->input('email');
$company->notes = $request->input('notes');
$company = $request->handleImages($company);
@@ -156,15 +148,9 @@ final class CompaniesController extends Controller
->with('success', trans('admin/companies/message.delete.success'));
}
public function show($id) : View | RedirectResponse
public function show(Company $company) : View | RedirectResponse
{
$this->authorize('view', Company::class);
if (is_null($company = Company::find($id))) {
return redirect()->route('companies.index')
->with('error', trans('admin/companies/message.not_found'));
}
return view('companies/view')->with('company', $company);
}
}

View File

@@ -107,15 +107,13 @@ class ComponentsController extends Controller
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function edit($componentId = null)
public function edit(Component $component)
{
if ($item = Component::find($componentId)) {
$this->authorize('update', $item);
return view('components/edit', compact('item'))->with('category_type', 'component');
}
return redirect()->route('components.index')->with('error', trans('admin/components/message.does_not_exist'));
$this->authorize('update', $component);
return view('components/edit')
->with('item', $component)
->with('category_type', 'component');
}
@@ -130,11 +128,8 @@ class ComponentsController extends Controller
* @throws \Illuminate\Auth\Access\AuthorizationException
* @since [v3.0]
*/
public function update(ImageUploadRequest $request, $componentId = null)
public function update(ImageUploadRequest $request, Component $component)
{
if (is_null($component = Component::find($componentId))) {
return redirect()->route('components.index')->with('error', trans('admin/components/message.does_not_exist'));
}
$min = $component->numCheckedOut();
$validator = Validator::make($request->all(), [
'qty' => "required|numeric|min:$min",
@@ -193,7 +188,7 @@ class ComponentsController extends Controller
$this->authorize('delete', $component);
// Remove the image if one exists
if (Storage::disk('public')->exists('components/'.$component->image)) {
if ($component->image && Storage::disk('public')->exists('components/' . $component->image)) {
try {
Storage::disk('public')->delete('components/'.$component->image);
} catch (\Exception $e) {
@@ -201,6 +196,10 @@ class ComponentsController extends Controller
}
}
if ($component->numCheckedOut() > 0) {
return redirect()->route('components.index')->with('error', trans('admin/components/message.delete.error_qty'));
}
$component->delete();
return redirect()->route('components.index')->with('success', trans('admin/components/message.delete.success'));
@@ -216,17 +215,9 @@ class ComponentsController extends Controller
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($componentId = null)
public function show(Component $component)
{
$component = Component::find($componentId);
if (isset($component->id)) {
$this->authorize('view', $component);
return view('components/view', compact('component'));
}
// Redirect to the user management page
return redirect()->route('components.index')
->with('error', trans('admin/components/message.does_not_exist'));
}
}

View File

@@ -50,7 +50,7 @@ class ComponentsFilesController extends Controller
}
return redirect()->route('components.show', $component->id)->with('success', trans('general.file_upload_success'));
return redirect()->route('components.show', $component->id)->withFragment('files')->with('success', trans('general.file_upload_success'));
}
@@ -91,7 +91,7 @@ class ComponentsFilesController extends Controller
$log->delete();
return redirect()->back()
return redirect()->back()->withFragment('files')
->with('success', trans('admin/hardware/message.deletefile.success'));
}

View File

@@ -50,7 +50,7 @@ class ConsumablesController extends Controller
{
$this->authorize('create', Consumable::class);
return view('consumables/edit')->with('category_type', 'consumable')
return view('consumables.edit')->with('category_type', 'consumable')
->with('item', new Consumable);
}
@@ -104,15 +104,13 @@ class ConsumablesController extends Controller
* @see ConsumablesController::postEdit() method that stores the form data.
* @since [v1.0]
*/
public function edit($consumableId = null) : View | RedirectResponse
public function edit(Consumable $consumable) : View | RedirectResponse
{
if ($item = Consumable::find($consumableId)) {
$this->authorize($item);
$this->authorize($consumable);
return view('consumables/edit')
->with('item', $consumable)
->with('category_type', 'consumable');
return view('consumables/edit', compact('item'))->with('category_type', 'consumable');
}
return redirect()->route('consumables.index')->with('error', trans('admin/consumables/message.does_not_exist'));
}
/**
@@ -126,11 +124,8 @@ class ConsumablesController extends Controller
* @see ConsumablesController::getEdit() method that stores the form data.
* @since [v1.0]
*/
public function update(StoreConsumableRequest $request, $consumableId = null)
public function update(StoreConsumableRequest $request, Consumable $consumable)
{
if (is_null($consumable = Consumable::find($consumableId))) {
return redirect()->route('consumables.index')->with('error', trans('admin/consumables/message.does_not_exist'));
}
$min = $consumable->numCheckedOut();
$validator = Validator::make($request->all(), [
@@ -202,18 +197,13 @@ class ConsumablesController extends Controller
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($consumableId = null)
public function show(Consumable $consumable)
{
$consumable = Consumable::withCount('users as users_consumables')->find($consumableId);
$consumable = Consumable::withCount('users as users_consumables')->find($consumable->id);
$this->authorize($consumable);
if (isset($consumable->id)) {
return view('consumables/view', compact('consumable'));
}
return redirect()->route('consumables.index')
->with('error', trans('admin/consumables/message.does_not_exist'));
}
public function clone(Consumable $consumable) : View
{
$this->authorize('create', $consumable);

View File

@@ -48,7 +48,7 @@ class ConsumablesFilesController extends Controller
}
return redirect()->route('consumables.show', $consumable->id)->with('success', trans('general.file_upload_success'));
return redirect()->route('consumables.show', $consumable->id)->withFragment('files')->with('success', trans('general.file_upload_success'));
}
@@ -89,7 +89,7 @@ class ConsumablesFilesController extends Controller
$log->delete();
return redirect()->back()
return redirect()->back()->withFragment('files')
->with('success', trans('admin/hardware/message.deletefile.success'));
}

View File

@@ -104,7 +104,9 @@ class CustomFieldsController extends Controller
"auto_add_to_fieldsets" => $request->get("auto_add_to_fieldsets", 0),
"show_in_listview" => $request->get("show_in_listview", 0),
"show_in_requestable_list" => $request->get("show_in_requestable_list", 0),
"user_id" => auth()->id()
"display_checkin" => $request->get("display_checkin", 0),
"display_checkout" => $request->get("display_checkout", 0),
"created_by" => auth()->id()
]);
@@ -193,10 +195,8 @@ class CustomFieldsController extends Controller
* @param int $id
* @since [v4.0]
*/
public function edit(Request $request, $id) : View | RedirectResponse
public function edit(Request $request, CustomField $field) : View | RedirectResponse
{
if ($field = CustomField::find($id)) {
$this->authorize('update', $field);
$fieldsets = CustomFieldset::get();
$customFormat = '';
@@ -210,10 +210,6 @@ class CustomFieldsController extends Controller
'fieldsets' => $fieldsets,
'predefinedFormats' => Helper::predefined_formats(),
]);
}
return redirect()->route("fields.index")
->with("error", trans('admin/custom_fields/message.field.invalid'));
}
@@ -229,13 +225,9 @@ class CustomFieldsController extends Controller
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function update(CustomFieldRequest $request, $id) : RedirectResponse
public function update(CustomFieldRequest $request, CustomField $field) : RedirectResponse
{
$field = CustomField::find($id);
$this->authorize('update', $field);
$show_in_email = $request->get("show_in_email", 0);
$display_in_user_view = $request->get("display_in_user_view", 0);
@@ -256,6 +248,8 @@ class CustomFieldsController extends Controller
$field->auto_add_to_fieldsets = $request->get("auto_add_to_fieldsets", 0);
$field->show_in_listview = $request->get("show_in_listview", 0);
$field->show_in_requestable_list = $request->get("show_in_requestable_list", 0);
$field->display_checkin = $request->get("display_checkin", 0);
$field->display_checkout = $request->get("display_checkout", 0);
if ($request->get('format') == 'CUSTOM REGEX') {
$field->format = e($request->get('custom_format'));

View File

@@ -35,10 +35,12 @@ class CustomFieldsetsController extends Controller
* @param int $id
* @since [v1.8]
*/
public function show($id) : View | RedirectResponse
public function show(CustomFieldset $fieldset) : View | RedirectResponse
{
$cfset = CustomFieldset::with('fields')
->where('id', '=', $id)->orderBy('id', 'ASC')->first();
->where('id', '=', $fieldset->id)
->orderBy('id', 'ASC')
->first();
$this->authorize('view', $cfset);
@@ -122,18 +124,12 @@ class CustomFieldsetsController extends Controller
* @param int $id
* @since [v6.0.14]
*/
public function edit($id) : View | RedirectResponse
public function edit(CustomFieldset $fieldset) : View | RedirectResponse
{
$this->authorize('create', CustomField::class);
if ($fieldset = CustomFieldset::find($id)) {
return view('custom_fields.fieldsets.edit')->with('item', $fieldset);
}
return redirect()->route('fields.index')->with('error', trans('admin/custom_fields/general.fieldset_does_not_exist', ['id' => $id]));
}
/**
* Saves updated fieldset data
*
@@ -141,12 +137,10 @@ class CustomFieldsetsController extends Controller
* @param int $id
* @since [v6.0.14]
*/
public function update(Request $request, $id) : RedirectResponse
public function update(Request $request, CustomFieldset $fieldset) : RedirectResponse
{
$this->authorize('create', CustomField::class);
if ($fieldset = CustomFieldset::find($id)) {
$fieldset->name = $request->input('name');
if ($fieldset->save()) {
@@ -157,9 +151,6 @@ class CustomFieldsetsController extends Controller
}
return redirect()->route('fields.index')->with('error', trans('admin/custom_fields/general.fieldset_does_not_exist', ['id' => $id]));
}
/**
* Validates a custom fieldset and then deletes if it has no models associated.
*

View File

@@ -40,7 +40,7 @@ class DashboardController extends Controller
if ((! file_exists(storage_path().'/oauth-private.key')) || (! file_exists(storage_path().'/oauth-public.key'))) {
Artisan::call('migrate', ['--force' => true]);
\Artisan::call('passport:install');
Artisan::call('passport:install', ['--no-interaction' => true]);
}
return view('dashboard')->with('asset_stats', $asset_stats)->with('counts', $counts);

View File

@@ -55,6 +55,7 @@ class DepartmentsController extends Controller
$department->manager_id = ($request->filled('manager_id') ? $request->input('manager_id') : null);
$department->location_id = ($request->filled('location_id') ? $request->input('location_id') : null);
$department->company_id = ($request->filled('company_id') ? $request->input('company_id') : null);
$department->notes = $request->input('notes');
$department = $request->handleImages($department);
if ($department->save()) {
@@ -72,19 +73,12 @@ class DepartmentsController extends Controller
* @param int $id
* @since [v4.0]
*/
public function show($id) : View | RedirectResponse
public function show(Department $department) : View | RedirectResponse
{
$department = Department::find($id);
$this->authorize('view', $department);
if (isset($department->id)) {
return view('departments/view', compact('department'));
}
return redirect()->route('departments.index')->with('error', trans('admin/departments/message.does_not_exist'));
}
/**
* Returns a form view used to create a new department.
*
@@ -138,15 +132,10 @@ class DepartmentsController extends Controller
* @param int $departmentId
* @since [v1.0]
*/
public function edit($departmentId = null) : View | RedirectResponse
public function edit(Department $department) : View | RedirectResponse
{
if (is_null($item = Department::find($departmentId))) {
return redirect()->back()->with('error', trans('admin/locations/message.does_not_exist'));
}
$this->authorize('update', $item);
return view('departments/edit', compact('item'));
$this->authorize('update', $department);
return view('departments/edit')->with('item', $department);
}
/**
@@ -157,11 +146,8 @@ class DepartmentsController extends Controller
* @param int $departmentId
* @since [v1.0]
*/
public function update(ImageUploadRequest $request, $id) : RedirectResponse
public function update(ImageUploadRequest $request, Department $department) : RedirectResponse
{
if (is_null($department = Department::find($id))) {
return redirect()->route('departments.index')->with('error', trans('admin/departments/message.does_not_exist'));
}
$this->authorize('update', $department);
@@ -171,7 +157,7 @@ class DepartmentsController extends Controller
$department->company_id = ($request->filled('company_id') ? $request->input('company_id') : null);
$department->phone = $request->input('phone');
$department->fax = $request->input('fax');
$department->notes = $request->input('notes');
$department = $request->handleImages($department);
if ($department->save()) {

View File

@@ -95,17 +95,11 @@ class DepreciationsController extends Controller
* @param int $depreciationId
* @since [v1.0]
*/
public function edit($depreciationId = null) : RedirectResponse | View
public function edit(Depreciation $depreciation) : RedirectResponse | View
{
// Check if the depreciation exists
if (is_null($item = Depreciation::find($depreciationId))) {
// Redirect to the blogs management page
return redirect()->route('depreciations.index')->with('error', trans('admin/depreciations/message.does_not_exist'));
}
$this->authorize('update', $item);
return view('depreciations/edit', compact('item'));
$this->authorize('update', $depreciation);
return view('depreciations/edit')->with('item', $depreciation);
}
/**
@@ -117,17 +111,10 @@ class DepreciationsController extends Controller
* @param int $depreciationId
* @since [v1.0]
*/
public function update(Request $request, $depreciationId = null) : RedirectResponse
public function update(Request $request, Depreciation $depreciation) : RedirectResponse
{
// Check if the depreciation exists
if (is_null($depreciation = Depreciation::find($depreciationId))) {
// Redirect to the blogs management page
return redirect()->route('depreciations.index')->with('error', trans('admin/depreciations/message.does_not_exist'));
}
$this->authorize('update', $depreciation);
// Depreciation data
$depreciation->name = $request->input('name');
$depreciation->months = $request->input('months');
@@ -191,12 +178,12 @@ class DepreciationsController extends Controller
* @param int $depreciationId
* @since [v1.0]
*/
public function show($id) : View | RedirectResponse
public function show(Depreciation $depreciation) : View | RedirectResponse
{
$depreciation = Depreciation::withCount('assets as assets_count')
->withCount('models as models_count')
->withCount('licenses as licenses_count')
->find($id);
->find($depreciation->id);
$this->authorize('view', $depreciation);

View File

@@ -62,6 +62,7 @@ class GroupsController extends Controller
$group->name = $request->input('name');
$group->permissions = json_encode($request->input('permission'));
$group->created_by = auth()->id();
$group->notes = $request->input('notes');
if ($group->save()) {
return redirect()->route('groups.index')->with('success', trans('admin/groups/message.success.create'));
@@ -78,21 +79,14 @@ class GroupsController extends Controller
* @param int $id
* @since [v1.0]
*/
public function edit($id) : View | RedirectResponse
public function edit(Group $group) : View | RedirectResponse
{
$group = Group::find($id);
if ($group) {
$permissions = config('permissions');
$groupPermissions = $group->decodePermissions();
$selected_array = Helper::selectedPermissionsArray($permissions, $groupPermissions);
return view('groups.edit', compact('group', 'permissions', 'selected_array', 'groupPermissions'));
}
return redirect()->route('groups.index')->with('error', trans('admin/groups/message.group_not_found', ['id' => $id]));
}
/**
* Validates and stores the updated User Group data.
*
@@ -101,13 +95,11 @@ class GroupsController extends Controller
* @param int $id
* @since [v1.0]
*/
public function update(Request $request, $id = null) : RedirectResponse
public function update(Request $request, Group $group) : RedirectResponse
{
if (! $group = Group::find($id)) {
return redirect()->route('groups.index')->with('error', trans('admin/groups/message.group_not_found', ['id' => $id]));
}
$group->name = $request->input('name');
$group->permissions = json_encode($request->input('permission'));
$group->notes = $request->input('notes');
if (! config('app.lock_passwords')) {
if ($group->save()) {
@@ -149,14 +141,8 @@ class GroupsController extends Controller
* @param $id
* @since [v4.0.11]
*/
public function show($id) : View | RedirectResponse
public function show(Group $group) : View | RedirectResponse
{
$group = Group::find($id);
if ($group) {
return view('groups/view', compact('group'));
}
return redirect()->route('groups.index')->with('error', trans('admin/groups/message.group_not_found', ['id' => $id]));
}
}

View File

@@ -4,10 +4,8 @@ namespace App\Http\Controllers\Kits;
use App\Http\Controllers\CheckInOutRequest;
use App\Http\Controllers\Controller;
use App\Models\PredefinedKit;
use App\Models\Asset;
use App\Models\PredefinedLicence;
use App\Models\PredefinedModel;
use App\Models\PredefinedKit;
use App\Models\User;
use App\Services\PredefinedKitCheckoutService;
use Illuminate\Http\Request;
@@ -35,12 +33,9 @@ class CheckoutKitController extends Controller
* @author [D. Minaev.] [<dmitriy.minaev.v@gmail.com>]
* @return \Illuminate\Contracts\View\View View to checkout
*/
public function showCheckout($kit_id)
public function showCheckout(PredefinedKit $kit)
{
$this->authorize('checkout', Asset::class);
$kit = PredefinedKit::findOrFail($kit_id);
return view('kits/checkout')->with('kit', $kit);
}

View File

@@ -76,17 +76,15 @@ class PredefinedKitsController extends Controller
* @param int $kit_id
* @return \Illuminate\Contracts\View\View
*/
public function edit($kit_id = null)
public function edit(PredefinedKit $kit)
{
$this->authorize('update', PredefinedKit::class);
if ($kit = PredefinedKit::find($kit_id)) {
return view('kits/edit')
->with('item', $kit)
->with('models', $kit->models)
->with('licenses', $kit->licenses);
}
return redirect()->route('kits.index')->with('error', trans('admin/kits/general.kit_none'));
}
/**
@@ -98,15 +96,9 @@ class PredefinedKitsController extends Controller
* @param int $kit_id
* @return \Illuminate\Http\RedirectResponse
*/
public function update(ImageUploadRequest $request, $kit_id = null)
public function update(ImageUploadRequest $request, PredefinedKit $kit)
{
$this->authorize('update', PredefinedKit::class);
// Check if the kit exists
if (is_null($kit = PredefinedKit::find($kit_id))) {
// Redirect to the kits management page
return redirect()->route('kits.index')->with('error', trans('admin/kits/general.kit_none'));
}
$kit->name = $request->input('name');
if ($kit->save()) {
@@ -153,9 +145,9 @@ class PredefinedKitsController extends Controller
* @param int $modelId
* @return \Illuminate\Contracts\View\View
*/
public function show($kit_id = null)
public function show(PredefinedKit $kit)
{
return $this->edit($kit_id);
return $this->edit($kit);
}
/**

View File

@@ -28,16 +28,11 @@ class LicenseCheckinController extends Controller
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function create($seatId = null, $backTo = null)
public function create(LicenseSeat $licenseSeat, $backTo = null)
{
// Check if the asset exists
if (is_null($licenseSeat = LicenseSeat::find($seatId)) || is_null($license = License::find($licenseSeat->license_id))) {
// Redirect to the asset management page with error
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
}
$license = License::find($licenseSeat->license_id);
$this->authorize('checkout', $license);
return view('licenses/checkin', compact('licenseSeat'))->with('backto', $backTo);
}
@@ -71,7 +66,7 @@ class LicenseCheckinController extends Controller
if (! $license->reassignable) {
// Not allowed to checkin
Session::flash('error', 'License not reassignable.');
Session::flash('error', trans('admin/licenses/message.checkin.not_reassignable') . '.');
return redirect()->back()->withInput();
}

View File

@@ -28,17 +28,14 @@ class LicenseCheckoutController extends Controller
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function create($id)
public function create(License $license)
{
if ($license = License::find($id)) {
$this->authorize('checkout', $license);
if ($license->category) {
// Make sure there is at least one available to checkout
if ($license->availCount()->count() < 1){
if ($license->availCount()->count() < 1) {
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.checkout.not_enough_seats'));
}
@@ -52,12 +49,6 @@ class LicenseCheckoutController extends Controller
}
// Not found
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
}
/**
* Validates and stores the license checkout action.
*

View File

@@ -121,13 +121,10 @@ class LicensesController extends Controller
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function edit($licenseId = null)
public function edit(License $license)
{
if (is_null($item = License::find($licenseId))) {
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist'));
}
$this->authorize('update', $item);
$this->authorize('update', $license);
$maintained_list = [
'' => 'Maintained',
@@ -135,7 +132,8 @@ class LicensesController extends Controller
'0' => 'No',
];
return view('licenses/edit', compact('item'))
return view('licenses/edit')
->with('item', $license)
->with('depreciation_list', Helper::depreciationList())
->with('maintained_list', $maintained_list);
}
@@ -153,11 +151,9 @@ class LicensesController extends Controller
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function update(Request $request, $licenseId = null)
public function update(Request $request, License $license)
{
if (is_null($license = License::find($licenseId))) {
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist'));
}
$this->authorize('update', $license);
@@ -201,10 +197,10 @@ class LicensesController extends Controller
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function destroy($licenseId)
public function destroy(License $license)
{
// Check if the license exists
if (is_null($license = License::find($licenseId))) {
if (is_null($license = License::find($license->id))) {
// Redirect to the license management page
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
}
@@ -238,14 +234,9 @@ class LicensesController extends Controller
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($licenseId = null)
public function show(License $license)
{
$license = License::with('assignedusers')->find($licenseId);
if (!$license) {
return redirect()->route('licenses.index')
->with('error', trans('admin/licenses/message.does_not_exist'));
}
$license = License::with('assignedusers')->find($license->id);
$users_count = User::where('autoassign_licenses', '1')->count();
$total_seats_count = $license->totalSeatsByLicenseID();
@@ -267,10 +258,10 @@ class LicensesController extends Controller
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $licenseId
* @return \Illuminate\Http\RedirectResponse
* @return \Illuminate\Http\RedirectResponse | \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function getClone($licenseId = null)
public function getClone($licenseId = null) : \Illuminate\Contracts\View\View | \Illuminate\Http\RedirectResponse
{
if (is_null($license_to_clone = License::find($licenseId))) {
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist'));

View File

@@ -78,6 +78,7 @@ class LocationsController extends Controller
$location->created_by = auth()->id();
$location->phone = request('phone');
$location->fax = request('fax');
$location->notes = $request->input('notes');
$location = $request->handleImages($location);
@@ -96,15 +97,10 @@ class LocationsController extends Controller
* @param int $locationId
* @since [v1.0]
*/
public function edit($locationId = null) : View | RedirectResponse
public function edit(Location $location) : View | RedirectResponse
{
$this->authorize('update', Location::class);
// Check if the location exists
if (is_null($item = Location::find($locationId))) {
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist'));
}
return view('locations/edit', compact('item'));
return view('locations/edit')->with('item', $location);
}
/**
@@ -116,15 +112,10 @@ class LocationsController extends Controller
* @param int $locationId
* @since [v1.0]
*/
public function update(ImageUploadRequest $request, $locationId = null) : RedirectResponse
public function update(ImageUploadRequest $request, Location $location) : RedirectResponse
{
$this->authorize('update', Location::class);
// Check if the location exists
if (is_null($location = Location::find($locationId))) {
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist'));
}
// Update the location data
$location->name = $request->input('name');
$location->parent_id = $request->input('parent_id', null);
$location->currency = $request->input('currency', '$');
@@ -138,6 +129,7 @@ class LocationsController extends Controller
$location->fax = request('fax');
$location->ldap_ou = $request->input('ldap_ou');
$location->manager_id = $request->input('manager_id');
$location->notes = $request->input('notes');
$location = $request->handleImages($location);
@@ -192,7 +184,7 @@ class LocationsController extends Controller
* @param int $id
* @since [v1.0]
*/
public function show($id = null) : View | RedirectResponse
public function show(Location $location) : View | RedirectResponse
{
$location = Location::withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
@@ -200,7 +192,7 @@ class LocationsController extends Controller
->withCount('children as children_count')
->withCount('users as users_count')
->withTrashed()
->find($id);
->find($location->id);
if (isset($location->id)) {
return view('locations/view', compact('location'));

View File

@@ -67,6 +67,7 @@ class ManufacturersController extends Controller
$manufacturer->warranty_lookup_url = $request->input('warranty_lookup_url');
$manufacturer->support_phone = $request->input('support_phone');
$manufacturer->support_email = $request->input('support_email');
$manufacturer->notes = $request->input('notes');
$manufacturer = $request->handleImages($manufacturer);
if ($manufacturer->save()) {
@@ -84,18 +85,10 @@ class ManufacturersController extends Controller
* @param int $manufacturerId
* @since [v1.0]
*/
public function edit($manufacturerId = null) : View | RedirectResponse
public function edit(Manufacturer $manufacturer) : View | RedirectResponse
{
// Handles manufacturer checks and permissions.
$this->authorize('update', Manufacturer::class);
// Check if the manufacturer exists
if (! $item = Manufacturer::find($manufacturerId)) {
return redirect()->route('manufacturers.index')->with('error', trans('admin/manufacturers/message.does_not_exist'));
}
// Show the page
return view('manufacturers/edit', compact('item'));
return view('manufacturers/edit')->with('item', $manufacturer);
}
/**
@@ -107,22 +100,17 @@ class ManufacturersController extends Controller
* @param int $manufacturerId
* @since [v1.0]
*/
public function update(ImageUploadRequest $request, $manufacturerId = null) : RedirectResponse
public function update(ImageUploadRequest $request, Manufacturer $manufacturer) : RedirectResponse
{
$this->authorize('update', Manufacturer::class);
// Check if the manufacturer exists
if (is_null($manufacturer = Manufacturer::find($manufacturerId))) {
// Redirect to the manufacturer page
return redirect()->route('manufacturers.index')->with('error', trans('admin/manufacturers/message.does_not_exist'));
}
// Save the data
$manufacturer->name = $request->input('name');
$manufacturer->url = $request->input('url');
$manufacturer->support_url = $request->input('support_url');
$manufacturer->warranty_lookup_url = $request->input('warranty_lookup_url');
$manufacturer->support_phone = $request->input('support_phone');
$manufacturer->support_email = $request->input('support_email');
$manufacturer->notes = $request->input('notes');
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
@@ -183,20 +171,12 @@ class ManufacturersController extends Controller
* @param int $manufacturerId
* @since [v1.0]
*/
public function show($manufacturerId = null) : View | RedirectResponse
public function show(Manufacturer $manufacturer) : View | RedirectResponse
{
$this->authorize('view', Manufacturer::class);
$manufacturer = Manufacturer::find($manufacturerId);
if (isset($manufacturer->id)) {
return view('manufacturers/view', compact('manufacturer'));
}
$error = trans('admin/manufacturers/message.does_not_exist');
// Redirect to the user management page
return redirect()->route('manufacturers.index')->with('error', $error);
}
/**
* Restore a given Manufacturer (mark as un-deleted)
*

View File

@@ -33,6 +33,7 @@ class ModalController extends Controller
'supplier',
'upload-file',
'user',
'add-note',
];

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Http\Controllers;
use App\Models\Actionlog;
use App\Models\Asset;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\Rule;
class NotesController extends Controller
{
public function store(Request $request)
{
$this->authorize('update', Asset::class);
$validated = $request->validate([
'id' => 'required',
'note' => 'required|string|max:50000',
'type' => [
'required',
Rule::in(['asset']),
],
]);
$item = Asset::findOrFail($validated['id']);
$this->authorize('update', $item);
$logaction = new Actionlog;
$logaction->item_id = $item->id;
$logaction->item_type = get_class($item);
$logaction->note = $validated['note'];
$logaction->created_by = Auth::id();
$logaction->logaction('note added');
return redirect()
->route('hardware.show', $validated['id'])
->withFragment('history')
->with('success', trans('general.note_added'));
}
}

View File

@@ -99,9 +99,13 @@ class ProfileController extends Controller
* User change email page.
*
*/
public function password() : View
public function password() : View | RedirectResponse
{
$user = auth()->user();
if ($user->ldap_import=='1') {
return redirect()->route('account')->with('error', trans('admin/users/message.error.password_ldap'));
}
return view('account/change-password', compact('user'));
}
@@ -116,7 +120,7 @@ class ProfileController extends Controller
$user = auth()->user();
if ($user->ldap_import == '1') {
return redirect()->route('account.password.index')->with('error', trans('admin/users/message.error.password_ldap'));
return redirect()->route('account')->with('error', trans('admin/users/message.error.password_ldap'));
}
$rules = [

View File

@@ -0,0 +1,80 @@
<?php
namespace App\Http\Controllers;
use App\Models\CustomField;
use App\Models\ReportTemplate;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
class ReportTemplatesController extends Controller
{
public function store(Request $request): RedirectResponse
{
$this->authorize('reports.view');
// Ignore "options" rules since data does not come in under that key...
$validated = $request->validate(Arr::except((new ReportTemplate)->getRules(), 'options'));
$report = $request->user()->reportTemplates()->create([
'name' => $validated['name'],
'options' => $request->except(['_token', 'name']),
]);
session()->flash('success', trans('admin/reports/message.create.success'));
return redirect()->route('report-templates.show', $report->id);
}
public function show(ReportTemplate $reportTemplate)
{
$this->authorize('reports.view');
$customfields = CustomField::get();
$report_templates = ReportTemplate::orderBy('name')->get();
return view('reports/custom', [
'customfields' => $customfields,
'report_templates' => $report_templates,
'template' => $reportTemplate,
]);
}
public function edit(ReportTemplate $reportTemplate)
{
$this->authorize('reports.view');
return view('reports/custom', [
'customfields' => CustomField::get(),
'template' => $reportTemplate,
]);
}
public function update(Request $request, ReportTemplate $reportTemplate): RedirectResponse
{
$this->authorize('reports.view');
// Ignore "options" rules since data does not come in under that key...
$validated = $request->validate(Arr::except((new ReportTemplate)->getRules(), 'options'));
$reportTemplate->update([
'name' => $validated['name'],
'options' => $request->except(['_token', 'name']),
]);
session()->flash('success', trans('admin/reports/message.update.success'));
return redirect()->route('report-templates.show', $reportTemplate->id);
}
public function destroy(ReportTemplate $reportTemplate): RedirectResponse
{
$this->authorize('reports.view');
$reportTemplate->delete();
return redirect()->route('reports/custom')
->with('success', trans('admin/reports/message.delete.success'));
}
}

View File

@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Helpers\Helper;
use App\Mail\CheckoutAssetMail;
use App\Models\Accessory;
use App\Models\Actionlog;
use App\Models\Asset;
@@ -10,14 +11,18 @@ use App\Models\AssetModel;
use App\Models\Category;
use App\Models\AssetMaintenance;
use App\Models\CheckoutAcceptance;
use App\Models\Company;
use App\Models\CustomField;
use App\Models\Depreciation;
use App\Models\License;
use App\Models\ReportTemplate;
use App\Models\Setting;
use App\Notifications\CheckoutAssetNotification;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Notification;
use \Illuminate\Contracts\View\View;
use League\Csv\Reader;
@@ -259,9 +264,9 @@ class ReportsController extends Controller
$executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
Log::debug('Added headers: '.$executionTime);
$actionlogs = Actionlog::with('item', 'user', 'target', 'location')
$actionlogs = Actionlog::with('item', 'user', 'target', 'location', 'adminuser')
->orderBy('created_at', 'DESC')
->chunk(20, function ($actionlogs) use ($handle) {
->chunk(500, function ($actionlogs) use ($handle) {
$executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
Log::debug('Walking results: '.$executionTime);
$count = 0;
@@ -286,7 +291,7 @@ class ReportsController extends Controller
$row = [
$actionlog->created_at,
($actionlog->admin) ? e($actionlog->admin->getFullNameAttribute()) : '',
($actionlog->adminuser) ? e($actionlog->adminuser->getFullNameAttribute()) : '',
$actionlog->present()->actionType(),
e($actionlog->itemType()),
($actionlog->itemType() == 'user') ? $actionlog->filename : $item_name,
@@ -392,12 +397,27 @@ class ReportsController extends Controller
* @see ReportsController::postCustomReport() method that generates the CSV
* @since [v1.0]
*/
public function getCustomReport() : View
public function getCustomReport(Request $request) : View
{
$this->authorize('reports.view');
$customfields = CustomField::get();
$report_templates = ReportTemplate::orderBy('name')->get();
return view('reports/custom')->with('customfields', $customfields);
// The view needs a template to render correctly, even if it is empty...
$template = new ReportTemplate;
// Set the report's input values in the cases we were redirected back
// with validation errors so the report is populated as expected.
if ($request->old()) {
$template->name = $request->old('name');
$template->options = $request->old();
}
return view('reports/custom', [
'customfields' => $customfields,
'report_templates' => $report_templates,
'template' => $template,
]);
}
/**
@@ -728,7 +748,7 @@ class ReportsController extends Controller
}
Log::debug($assets->toSql());
$assets->orderBy('assets.id', 'ASC')->chunk(20, function ($assets) use ($handle, $customfields, $request) {
$assets->orderBy('assets.id', 'ASC')->chunk(500, function ($assets) use ($handle, $customfields, $request) {
$executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
Log::debug('Walking results: '.$executionTime);
@@ -1091,28 +1111,31 @@ class ReportsController extends Controller
$this->authorize('reports.view');
$showDeleted = $deleted == 'deleted';
/**
* Get all assets with pending checkout acceptances
*/
if($showDeleted) {
$acceptances = CheckoutAcceptance::pending()->where('checkoutable_type', 'App\Models\Asset')->withTrashed()->with(['assignedTo' , 'checkoutable.assignedTo', 'checkoutable.model'])->get();
} else {
$acceptances = CheckoutAcceptance::pending()->where('checkoutable_type', 'App\Models\Asset')->with(['assignedTo' => function ($query) {
$query = CheckoutAcceptance::pending()
->where('checkoutable_type', 'App\Models\Asset')
->with([
'checkoutable' => function (MorphTo $query) {
$query->morphWith([
AssetModel::class => ['model'],
Company::class => ['company'],
Asset::class => ['assignedTo'],
])->with('model.category');
},
'assignedTo' => function($query){
$query->withTrashed();
}
]);
if ($showDeleted) {
$query->withTrashed();
}, 'checkoutable.assignedTo', 'checkoutable.model'])->get();
}
$assetsForReport = $acceptances
->filter(function ($acceptance) {
$acceptance_checkoutable_flag = false;
if ($acceptance->checkoutable){
$acceptance_checkoutable_flag = $acceptance->checkoutable->checkedOutToUser();
}
return $acceptance->checkoutable_type == 'App\Models\Asset' && $acceptance_checkoutable_flag;
})
->map(function($acceptance) {
return ['assetItem' => $acceptance->checkoutable, 'acceptance' => $acceptance];
$assetsForReport = $query->get()
->map(function ($acceptance) {
return [
'assetItem' => $acceptance->checkoutable,
'acceptance' => $acceptance,
];
});
return view('reports/unaccepted_assets', compact('assetsForReport','showDeleted' ));
@@ -1150,27 +1173,15 @@ class ReportsController extends Controller
}
$logItem = $logItem_res[0];
}
$email = $assetItem->assignedTo?->email;
$locale = $assetItem->assignedTo?->locale;
// Only send notification if assigned
if ($assetItem->assignedTo) {
if (!$assetItem->assignedTo->locale) {
Notification::locale(Setting::getSettings()->locale)->send(
$assetItem->assignedTo,
new CheckoutAssetNotification($assetItem, $assetItem->assignedTo, $logItem->user, $acceptance, $logItem->note)
);
} else {
Notification::send(
$assetItem->assignedTo,
new CheckoutAssetNotification($assetItem, $assetItem->assignedTo, $logItem->user, $acceptance, $logItem->note)
);
}
}
if ($assetItem->assignedTo->email == ''){
if (is_null($email) || $email === '') {
return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.no_email'));
}
Mail::to($email)->send((new CheckoutAssetMail($assetItem, $assetItem->assignedTo, $logItem->user, $acceptance, $logItem->note, firstTimeSending: false))->locale($locale));
return redirect()->route('reports/unaccepted_assets')->with('success', trans('admin/reports/general.reminder_sent'));
}

63
app/Http/Controllers/SettingsController.php Executable file → Normal file
View File

@@ -192,6 +192,7 @@ class SettingsController extends Controller
$settings->next_auto_tag_base = 1;
$settings->auto_increment_assets = $request->input('auto_increment_assets', 0);
$settings->auto_increment_prefix = $request->input('auto_increment_prefix');
$settings->zerofill_count = $request->input('zerofill_count') ?: 0;
if ((! $user->isValid()) || (! $settings->isValid())) {
return redirect()->back()->withInput()->withErrors($user->getErrors())->withErrors($settings->getErrors());
@@ -255,7 +256,7 @@ class SettingsController extends Controller
Artisan::call('migrate', ['--force' => true]);
if ((! file_exists(storage_path().'/oauth-private.key')) || (! file_exists(storage_path().'/oauth-public.key'))) {
Artisan::call('migrate', ['--path' => 'vendor/laravel/passport/database/migrations', '--force' => true]);
Artisan::call('passport:install');
Artisan::call('passport:install', ['--no-interaction' => true]);
}
return view('setup/migrate')
@@ -334,6 +335,8 @@ class SettingsController extends Controller
$setting->depreciation_method = $request->input('depreciation_method');
$setting->dash_chart_type = $request->input('dash_chart_type');
$setting->profile_edit = $request->input('profile_edit', 0);
$setting->require_checkinout_notes = $request->input('require_checkinout_notes', 0);
if ($request->input('per_page') != '') {
$setting->per_page = $request->input('per_page');
@@ -693,48 +696,6 @@ class SettingsController extends Controller
return redirect()->back()->withInput()->withErrors($setting->getErrors());
}
/**
* Return a form to allow a super admin to update settings.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
*
* @since [v1.0]
*/
public function getBarcodes() : View
{
$setting = Setting::getSettings();
$is_gd_installed = extension_loaded('gd');
return view('settings.barcodes', compact('setting'))->with('is_gd_installed', $is_gd_installed);
}
/**
* Saves settings from form.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
*
* @since [v1.0]
*/
public function postBarcodes(Request $request) : RedirectResponse
{
if (is_null($setting = Setting::getSettings())) {
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
}
$setting->qr_code = $request->input('qr_code', '0');
$setting->alt_barcode = $request->input('alt_barcode');
$setting->alt_barcode_enabled = $request->input('alt_barcode_enabled', '0');
$setting->barcode_type = $request->input('barcode_type');
$setting->qr_text = $request->input('qr_text');
if ($setting->save()) {
return redirect()->route('settings.index')
->with('success', trans('admin/settings/message.update.success'));
}
return redirect()->back()->withInput()->withErrors($setting->getErrors());
}
/**
* Return a form to allow a super admin to update settings.
*
@@ -760,8 +721,11 @@ class SettingsController extends Controller
*/
public function getLabels() : View
{
$is_gd_installed = extension_loaded('gd');
return view('settings.labels')
->with('setting', Setting::getSettings())
->with('is_gd_installed', $is_gd_installed)
->with('customFields', CustomField::where('field_encrypted', '=', 0)->get());
}
@@ -797,9 +761,13 @@ class SettingsController extends Controller
$setting->labels_pagewidth = $request->input('labels_pagewidth');
$setting->labels_pageheight = $request->input('labels_pageheight');
$setting->labels_display_company_name = $request->input('labels_display_company_name', '0');
$setting->labels_display_company_name = $request->input('labels_display_company_name', '0');
//Barcodes
$setting->qr_code = $request->input('qr_code', '0');
//1D-Barcode
$setting->alt_barcode_enabled = $request->input('alt_barcode_enabled', '0');
//QR-Code
$setting->qr_text = $request->input('qr_text');
if ($request->filled('labels_display_name')) {
$setting->labels_display_name = 1;
@@ -832,6 +800,7 @@ class SettingsController extends Controller
}
if ($setting->save()) {
return redirect()->route('settings.labels.index')
->with('success', trans('admin/settings/message.update.success'));
}
@@ -881,7 +850,8 @@ class SettingsController extends Controller
$setting->ldap_fname_field = $request->input('ldap_fname_field');
$setting->ldap_auth_filter_query = $request->input('ldap_auth_filter_query');
$setting->ldap_version = $request->input('ldap_version', 3);
$setting->ldap_active_flag = $request->input('ldap_active_flag');
$setting->ldap_active_flag = $request->input('ldap_active_flag', 0);
$setting->ldap_invert_active_flag = $request->input('ldap_invert_active_flag', 0);
$setting->ldap_emp_num = $request->input('ldap_emp_num');
$setting->ldap_email = $request->input('ldap_email');
$setting->ldap_manager = $request->input('ldap_manager');
@@ -901,7 +871,6 @@ class SettingsController extends Controller
}
if ($setting->save()) {
$setting->update_client_side_cert_files();
return redirect()->route('settings.ldap.index')
->with('success', trans('admin/settings/message.update.success'));
}

View File

@@ -26,16 +26,12 @@ class StatuslabelsController extends Controller
return view('statuslabels.index');
}
public function show($id) : View | RedirectResponse
public function show(Statuslabel $statuslabel) : View | RedirectResponse
{
$this->authorize('view', Statuslabel::class);
if ($statuslabel = Statuslabel::find($id)) {
return view('statuslabels.view')->with('statuslabel', $statuslabel);
}
return redirect()->route('statuslabels.index')->with('error', trans('admin/statuslabels/message.does_not_exist'));
}
/**
* Statuslabel create.
*
@@ -91,20 +87,15 @@ class StatuslabelsController extends Controller
*
* @param int $statuslabelId
*/
public function edit($statuslabelId = null) : View | RedirectResponse
public function edit(Statuslabel $statuslabel) : View | RedirectResponse
{
$this->authorize('update', Statuslabel::class);
// Check if the Statuslabel exists
if (is_null($item = Statuslabel::find($statuslabelId))) {
// Redirect to the blogs management page
return redirect()->route('statuslabels.index')->with('error', trans('admin/statuslabels/message.does_not_exist'));
}
$use_statuslabel_type = $item->getStatuslabelType();
$statuslabel_types = ['' => trans('admin/hardware/form.select_statustype')] + ['undeployable' => trans('admin/hardware/general.undeployable')] + ['pending' => trans('admin/hardware/general.pending')] + ['archived' => trans('admin/hardware/general.archived')] + ['deployable' => trans('admin/hardware/general.deployable')];
return view('statuslabels/edit', compact('item', 'statuslabel_types'))->with('use_statuslabel_type', $use_statuslabel_type);
return view('statuslabels/edit', compact('statuslabel_types'))
->with('item', $statuslabel)
->with('use_statuslabel_type', $statuslabel);
}
/**
@@ -112,14 +103,9 @@ class StatuslabelsController extends Controller
*
* @param int $statuslabelId
*/
public function update(Request $request, $statuslabelId = null) : RedirectResponse
public function update(Request $request, Statuslabel $statuslabel) : RedirectResponse
{
$this->authorize('update', Statuslabel::class);
// Check if the Statuslabel exists
if (is_null($statuslabel = Statuslabel::find($statuslabelId))) {
// Redirect to the blogs management page
return redirect()->route('statuslabels.index')->with('error', trans('admin/statuslabels/message.does_not_exist'));
}
if (! $request->filled('statuslabel_types')) {
return redirect()->back()->withInput()->withErrors(['statuslabel_types' => trans('validation.statuslabel_type')]);

View File

@@ -77,17 +77,10 @@ class SuppliersController extends Controller
*
* @param int $supplierId
*/
public function edit($supplierId = null) : View | RedirectResponse
public function edit(Supplier $supplier) : View | RedirectResponse
{
$this->authorize('update', Supplier::class);
// Check if the supplier exists
if (is_null($item = Supplier::find($supplierId))) {
// Redirect to the supplier page
return redirect()->route('suppliers.index')->with('error', trans('admin/suppliers/message.does_not_exist'));
}
// Show the page
return view('suppliers/edit', compact('item'));
return view('suppliers/edit')->with('item', $supplier);
}
/**
@@ -95,14 +88,9 @@ class SuppliersController extends Controller
*
* @param int $supplierId
*/
public function update($supplierId, ImageUploadRequest $request) : RedirectResponse
public function update(ImageUploadRequest $request, Supplier $supplier) : RedirectResponse
{
$this->authorize('update', Supplier::class);
if (is_null($supplier = Supplier::find($supplierId))) {
return redirect()->route('suppliers.index')->with('error', trans('admin/suppliers/message.does_not_exist'));
}
// Save the data
$supplier->name = request('name');
$supplier->address = request('address');
@@ -163,15 +151,10 @@ class SuppliersController extends Controller
* @param null $supplierId
* @internal param int $assetId
*/
public function show($supplierId = null) : View | RedirectResponse
public function show(Supplier $supplier) : View | RedirectResponse
{
$this->authorize('view', Supplier::class);
$supplier = Supplier::find($supplierId);
if (isset($supplier->id)) {
return view('suppliers/view', compact('supplier'));
}
return redirect()->route('suppliers.index')->with('error', trans('admin/suppliers/message.does_not_exist'));
}
}

View File

@@ -15,6 +15,7 @@ use App\Models\ConsumableAssignment;
use App\Models\Consumable;
use App\Models\Setting;
use App\Models\User;
use App\Notifications\CurrentInventory;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
@@ -52,6 +53,28 @@ class BulkUsersController extends Controller
return view('users/bulk-edit', compact('users'))
->with('groups', Group::pluck('name', 'id'));
// bulk send assigned inventory
} elseif ($request->input('bulk_actions') == 'send_assigned') {
$this->authorize('update', User::class);
$users_without_email = 0;
foreach ($users as $user) {
if (empty($user->email)) {
$users_without_email++;
} else {
$user->notify((new CurrentInventory($user)));
}
}
if ($users_without_email == 0) {
return redirect()->back()->with('success', trans_choice('admin/users/general.users_notified', $users->count()));
} else {
return redirect()->back()->with('warning', trans_choice('admin/users/general.users_notified_warning', $users->count(), ['no_email' => $users_without_email]));
}
// bulk delete, display the bulk delete confirmation form
} elseif ($request->input('bulk_actions') == 'delete') {
$this->authorize('delete', User::class);
@@ -70,7 +93,7 @@ class BulkUsersController extends Controller
// bulk password reset, just do the thing
} elseif ($request->input('bulk_actions') == 'bulkpasswordreset') {
foreach ($users as $user) {
if (($user->activated == '1') && ($user->email != '')) {
if (($user->activated == '1') && ($user->email != '') && ($user->ldap_import != '1')) {
$credentials = ['email' => $user->email];
Password::sendResetLink($credentials/* , function (Message $message) {
$message->subject($this->getEmailSubject()); // TODO - I'm not sure if we still need this, but this second parameter is no longer accepted in later Laravel versions.
@@ -323,7 +346,7 @@ class BulkUsersController extends Controller
$logAction->item_type = $itemType;
$logAction->target_id = $item->assigned_to;
$logAction->target_type = User::class;
$logAction->created_at = auth()->id();
$logAction->created_by = auth()->id();
$logAction->note = 'Bulk checkin items';
$logAction->logaction('checkin from');
}

View File

@@ -22,15 +22,9 @@ class UserFilesController extends Controller
*@author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.6]
*/
public function store(UploadFileRequest $request, $userId = null)
public function store(UploadFileRequest $request, User $user)
{
$user = User::find($userId);
$destinationPath = config('app.private_uploads').'/users';
if (isset($user->id)) {
$this->authorize('update', $user);
$logActions = [];
$files = $request->file('file');
if (is_null($files)) {
@@ -53,12 +47,9 @@ class UserFilesController extends Controller
if (! $logAction->save()) {
return JsonResponse::create(['error' => 'Failed validation: '.print_r($logAction->getErrors(), true)], 500);
}
$logActions[] = $logAction;
return redirect()->back()->withFragment('files')->with('success', trans('admin/users/message.upload.success'));
}
// dd($logActions);
return redirect()->back()->with('success', trans('admin/users/message.upload.success'));
}
return redirect()->back()->with('error', trans('admin/users/message.upload.nofiles'));
}
@@ -87,7 +78,7 @@ class UserFilesController extends Controller
if (Storage::exists($rel_path.'/'.$filename)) {
Storage::delete($rel_path.'/'.$filename);
return redirect()->back()->with('success', trans('admin/users/message.deletefile.success'));
return redirect()->back()->withFragment('files')->with('success', trans('admin/users/message.deletefile.success'));
}
}
@@ -110,7 +101,7 @@ class UserFilesController extends Controller
* @return mixed
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($userId = null, $fileId = null)
public function show(User $user, $fileId = null)
{
@@ -118,8 +109,6 @@ class UserFilesController extends Controller
return redirect()->route('users.show')->with('error', 'Invalid file request');
}
if ($user = User::find($userId)) {
$this->authorize('view', $user);
if ($log = Actionlog::whereNotNull('filename')->where('item_id', $user->id)->find($fileId)) {
@@ -135,12 +124,6 @@ class UserFilesController extends Controller
// The log record doesn't exist somehow
return redirect()->route('users.show', ['user' => $user])->with('error', trans('general.log_record_not_found'));
return redirect()->back()->with('error', trans('general.file_not_found'));
}
// Redirect to the user management page if the user doesn't exist
return redirect()->route('users.index')->with('error', trans('admin/users/message.user_not_found', ['id' => $userId]));
}
}

View File

@@ -182,11 +182,11 @@ class UsersController extends Controller
* @internal param int $id
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function edit($id)
public function edit(User $user)
{
$this->authorize('update', User::class);
$user = User::with(['assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc'])->withTrashed()->find($id);
$user = User::with(['assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc'])->withTrashed()->find($user->id);
if ($user) {
@@ -201,7 +201,6 @@ class UsersController extends Controller
return view('users/edit', compact('user', 'groups', 'userGroups', 'permissions', 'userPermissions'))->with('item', $user);
}
return redirect()->route('users.index')->with('error', trans('admin/users/message.user_not_found', compact('id')));
}
/**
@@ -324,7 +323,7 @@ class UsersController extends Controller
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function destroy(DeleteUserRequest $request, $id = null)
public function destroy(DeleteUserRequest $request, $id)
{
$this->authorize('delete', User::class);
@@ -333,13 +332,6 @@ class UsersController extends Controller
$this->authorize('delete', $user);
if ($user->delete()) {
if (Storage::disk('public')->exists('avatars/' . $user->avatar)) {
try {
Storage::disk('public')->delete('avatars/' . $user->avatar);
} catch (\Exception $e) {
Log::debug($e);
}
}
return redirect()->route('users.index')->with('success', trans('admin/users/message.success.delete'));
}
}
@@ -398,25 +390,20 @@ class UsersController extends Controller
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($userId = null)
public function show(User $user)
{
// Make sure the user can view users at all
$this->authorize('view', User::class);
$user = User::with('assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc')->withTrashed()->find($userId);
$user = User::with('assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc')->withTrashed()->find($user->id);
// Make sure they can view this particular user
$this->authorize('view', $user);
if ($user) {
$userlog = $user->userlog->load('item');
return view('users/view', compact('user', 'userlog'))->with('settings', Setting::getSettings());
}
return redirect()->route('users.index')->with('error', trans('admin/users/message.user_not_found', ['id' => $userId]));
}
/**
* Return a view containing a pre-populated new user form,
@@ -428,7 +415,7 @@ class UsersController extends Controller
* @return \Illuminate\Contracts\View\View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function getClone(Request $request, $id = null)
public function getClone(Request $request, User $user)
{
$this->authorize('create', User::class);
@@ -438,7 +425,7 @@ class UsersController extends Controller
app('request')->request->set('permissions', $permissions);
$user_to_clone = User::with('assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc')->withTrashed()->find($id);
$user_to_clone = User::with('assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc')->withTrashed()->find($user->id);
// Make sure they can view this particular user
$this->authorize('view', $user_to_clone);
@@ -468,10 +455,10 @@ class UsersController extends Controller
->with('user', $user)
->with('groups', Group::pluck('name', 'id'))
->with('userGroups', $userGroups)
->with('clone_user', $user_to_clone);
->with('clone_user', $user_to_clone)
->with('item', $user);
}
return redirect()->route('users.index')->with('error', trans('admin/users/message.user_not_found', compact('id')));
}

View File

@@ -21,9 +21,14 @@ class AssetCheckinRequest extends Request
*/
public function rules()
{
return [
$settings = \App\Models\Setting::getSettings();
];
$rules = [];
if($settings->require_checkinout_notes) {
$rules['note'] = 'string|required';
}
return $rules;
}
public function response(array $errors)

View File

@@ -21,10 +21,12 @@ class AssetCheckoutRequest extends Request
*/
public function rules()
{
$settings = \App\Models\Setting::getSettings();
$rules = [
'assigned_user' => 'required_without_all:assigned_asset,assigned_location',
'assigned_asset' => 'required_without_all:assigned_user,assigned_location',
'assigned_location' => 'required_without_all:assigned_user,assigned_asset',
'assigned_user' => 'numeric|nullable|required_without_all:assigned_asset,assigned_location',
'assigned_asset' => 'numeric|nullable|required_without_all:assigned_user,assigned_location',
'assigned_location' => 'numeric|nullable|required_without_all:assigned_user,assigned_asset',
'status_id' => 'exists:status_labels,id,deployable,1',
'checkout_to_type' => 'required|in:asset,location,user',
'checkout_at' => [
@@ -37,6 +39,10 @@ class AssetCheckoutRequest extends Request
],
];
if($settings->require_checkinout_notes) {
$rules['note'] = 'required|string';
}
return $rules;
}
}

View File

@@ -24,7 +24,7 @@ class DeleteUserRequest extends FormRequest
public function prepareForValidation(): void
{
$user_to_delete = User::withTrashed()->find(request()->route('user'));
$user_to_delete = User::withTrashed()->with('managesUsers')->find(request()->route('user'));
if ($user_to_delete) {
$this->merge([
@@ -61,7 +61,8 @@ class DeleteUserRequest extends FormRequest
public function messages(): array
{
$user_to_delete = User::withTrashed()->find(request()->route('user'));
$user_to_delete = User::withTrashed()->with('managesUsers')->find(request()->route('user'));
$messages = [];
if ($user_to_delete) {

View File

@@ -62,7 +62,7 @@ class SettingsSamlRequest extends FormRequest
$custom_privateKey = '';
$custom_x509certNew = '';
if (! empty($this->input('saml_custom_settings'))) {
$req_custom_settings = preg_split('/\r\n|\r|\n/', $this->input('saml_custom_settings'));
$req_custom_settings = preg_split('/\r\n|\r|\n/', $this->input('saml_custom_settings', ''));
$custom_settings = [];
foreach ($req_custom_settings as $custom_setting) {

View File

@@ -2,8 +2,11 @@
namespace App\Http\Requests;
use App\Models\Labels\Label;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
use Illuminate\Validation\Rule;
class StoreLabelSettings extends FormRequest
{
@@ -22,6 +25,10 @@ class StoreLabelSettings extends FormRequest
*/
public function rules(): array
{
$names = Label::find()?->map(function ($label) {
return $label->getName();
})->values()->toArray();
return [
'labels_per_page' => 'numeric',
'labels_width' => 'numeric',
@@ -36,6 +43,10 @@ class StoreLabelSettings extends FormRequest
'labels_pagewidth' => 'numeric|nullable',
'labels_pageheight' => 'numeric|nullable',
'qr_text' => 'max:31|nullable',
'label2_template' => [
'required',
Rule::in($names),
],
];
}
}

View File

@@ -26,9 +26,9 @@ class StoreNotificationSettings extends FormRequest
return [
'alert_email' => 'email_array|nullable',
'admin_cc_email' => 'email_array|nullable',
'alert_threshold' => 'numeric|nullable|gt:0',
'alert_threshold' => 'numeric|nullable',
'alert_interval' => 'numeric|nullable|gt:0',
'audit_warning_days' => 'numeric|nullable|gt:0',
'audit_warning_days' => 'numeric|nullable',
'due_checkin_days' => 'numeric|nullable|gt:0',
'audit_interval' => 'numeric|nullable|gt:0',
];

View File

@@ -46,8 +46,6 @@ class UploadFileRequest extends Request
$extension = $file->getClientOriginalExtension();
$file_name = $name_prefix.'-'.str_random(8).'-'.str_slug(basename($file->getClientOriginalName(), '.'.$extension)).'.'.$file->guessExtension();
Log::debug("Your filetype IS: ".$file->getMimeType());
// Check for SVG and sanitize it
if ($file->getMimeType() === 'image/svg+xml') {
Log::debug('This is an SVG');
@@ -66,7 +64,6 @@ class UploadFileRequest extends Request
} else {
$put_results = Storage::put($dirname.$file_name, file_get_contents($file));
Log::debug("Here are the '$put_results' (should be 0 or 1 or true or false or something?)");
}
return $file_name;
}

View File

@@ -69,7 +69,7 @@ class AccessoriesTransformer
return $array;
}
public function transformCheckedoutAccessory($accessory, $accessory_checkouts, $total)
public function transformCheckedoutAccessory($accessory_checkouts, $total)
{
$array = [];
@@ -77,9 +77,13 @@ class AccessoriesTransformer
$array[] = [
'id' => $checkout->id,
'assigned_to' => $this->transformAssignedTo($checkout),
'checkout_notes' => e($checkout->note),
'last_checkout' => Helper::getFormattedDateObject($checkout->created_at, 'datetime'),
'available_actions' => ['checkin' => true],
'note' => $checkout->note ? e($checkout->note) : null,
'created_by' => $checkout->adminuser ? [
'id' => (int) $checkout->adminuser->id,
'name'=> e($checkout->adminuser->present()->fullName),
]: null,
'created_at' => Helper::getFormattedDateObject($checkout->created_at, 'datetime'),
'available_actions' => Gate::allows('checkout', Accessory::class) ? ['checkin' => true] : ['checkin' => false],
];
}
@@ -89,22 +93,11 @@ class AccessoriesTransformer
public function transformAssignedTo($accessoryCheckout)
{
if ($accessoryCheckout->checkedOutToUser()) {
return [
'id' => (int) $accessoryCheckout->assigned->id,
'username' => e($accessoryCheckout->assigned->username),
'name' => e($accessoryCheckout->assigned->getFullNameAttribute()),
'first_name'=> e($accessoryCheckout->assigned->first_name),
'last_name'=> ($accessoryCheckout->assigned->last_name) ? e($accessoryCheckout->assigned->last_name) : null,
'email'=> ($accessoryCheckout->assigned->email) ? e($accessoryCheckout->assigned->email) : null,
'employee_number' => ($accessoryCheckout->assigned->employee_num) ? e($accessoryCheckout->assigned->employee_num) : null,
'type' => 'user',
];
return (new UsersTransformer)->transformUserCompact($accessoryCheckout->assigned);
} elseif ($accessoryCheckout->checkedOutToLocation()) {
return (new LocationsTransformer())->transformLocationCompact($accessoryCheckout->assigned);
} elseif ($accessoryCheckout->checkedOutToAsset()) {
return (new AssetsTransformer())->transformAssetCompact($accessoryCheckout->assigned);
}
return $accessoryCheckout->assigned ? [
'id' => $accessoryCheckout->assigned->id,
'name' => e($accessoryCheckout->assigned->display_name),
'type' => $accessoryCheckout->assignedType(),
] : null;
}
}

Some files were not shown because too many files have changed in this diff Show More