Compare commits

...

2184 Commits

Author SHA1 Message Date
snipe
158dc1f8da Squashed commit of the following:
commit e1263155b1
Merge: 886f2a0de 014eab3ab
Author: snipe <snipe@snipe.net>
Date:   Mon Jan 9 11:10:19 2023 -0800

    Merge pull request #12323 from snipe/translations/updated_strings

    Updated language strings

commit 014eab3abc
Author: snipe <snipe@snipe.net>
Date:   Mon Jan 9 11:09:26 2023 -0800

    Updated language strings

    Signed-off-by: snipe <snipe@snipe.net>

commit 886f2a0dec
Merge: 19e703980 e05764ac3
Author: snipe <snipe@snipe.net>
Date:   Thu Jan 5 18:44:44 2023 -0800

    Merge pull request #12317 from snipe/fixes/shorten_url_display_on_view

    Truncate URL with ellipsis if too long

commit e05764ac34
Author: snipe <snipe@snipe.net>
Date:   Thu Jan 5 18:42:26 2023 -0800

    Truncate URL with ellipsis if too long

    Signed-off-by: snipe <snipe@snipe.net>

commit 19e703980d
Merge: bd3f730cb 6e42bce40
Author: snipe <snipe@snipe.net>
Date:   Thu Jan 5 18:07:30 2023 -0800

    Merge pull request #12316 from snipe/features/chunk_data_in_sync_script

    Chunk sync script

commit 6e42bce409
Author: snipe <snipe@snipe.net>
Date:   Thu Jan 5 18:04:06 2023 -0800

    Removed $start variable from calback

    Signed-off-by: snipe <snipe@snipe.net>

commit 1a3c947b14
Author: snipe <snipe@snipe.net>
Date:   Thu Jan 5 17:57:52 2023 -0800

    Chunk sync script

    Signed-off-by: snipe <snipe@snipe.net>

commit bd3f730cb2
Merge: ace73acba 381f89c5a
Author: snipe <snipe@snipe.net>
Date:   Thu Jan 5 14:11:24 2023 -0800

    Merge pull request #12315 from snipe/features/added_default_values_to_model_api

    Features/added default values to model api

commit 381f89c5a8
Author: snipe <snipe@snipe.net>
Date:   Thu Jan 5 13:15:30 2023 -0800

    Added format to array

    Signed-off-by: snipe <snipe@snipe.net>

commit db43628bdc
Author: snipe <snipe@snipe.net>
Date:   Thu Jan 5 13:12:54 2023 -0800

    Added default field info to models API response

    Signed-off-by: snipe <snipe@snipe.net>

commit ace73acba1
Merge: 5898e384f 301c4fda6
Author: snipe <snipe@snipe.net>
Date:   Thu Jan 5 09:59:35 2023 -0800

    Merge pull request #12263 from Godmartinz/gh12211_label_padding_adjustment

    Fixed: page-break and padding at the end of document for labels

commit 301c4fda6e
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Jan 5 09:55:25 2023 -0800

    fixes conflicts

commit 5898e384f8
Merge: c575798b5 9c63f426d
Author: snipe <snipe@snipe.net>
Date:   Wed Jan 4 15:13:36 2023 -0800

    Merge pull request #12308 from snipe/fixes/missing_translation_string

    Fixed missing translation string

commit 9c63f426d9
Author: snipe <snipe@snipe.net>
Date:   Wed Jan 4 14:09:14 2023 -0800

    Added missing translation string

    Signed-off-by: snipe <snipe@snipe.net>

commit c575798b56
Merge: b36e81836 7123e7327
Author: snipe <snipe@snipe.net>
Date:   Wed Jan 4 14:01:03 2023 -0800

    Merge pull request #12307 from snipe/fixes/update_less_and_css_loader

    Updated less-loader and css-loader libraries

commit 7123e7327f
Author: snipe <snipe@snipe.net>
Date:   Wed Jan 4 14:00:04 2023 -0800

    Updated less-loader and css-loader libraries

    Signed-off-by: snipe <snipe@snipe.net>

commit b36e81836f
Merge: 818db58a7 b77d5801f
Author: snipe <snipe@snipe.net>
Date:   Wed Jan 4 13:57:14 2023 -0800

    Merge pull request #12306 from snipe/fixes/weird_sentence_in_translations

    Fixed incomplete sentence in translation file for audit interval

commit b77d5801fa
Author: snipe <snipe@snipe.net>
Date:   Wed Jan 4 13:56:16 2023 -0800

    English is hard, apparently

    Signed-off-by: snipe <snipe@snipe.net>

commit 818db58a7b
Merge: baf14c43e c4f900e9a
Author: snipe <snipe@snipe.net>
Date:   Wed Jan 4 13:22:03 2023 -0800

    Merge pull request #12305 from uberbrady/fix_license_seat_reporting

    Fixed: Change license_seat changing method to properly 'true up' license seats

commit c4f900e9af
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Wed Jan 4 13:02:53 2023 -0800

    Change license_seat changing method to properly 'true up' license seats

commit baf14c43ee
Merge: d187174f0 fa439a192
Author: snipe <snipe@snipe.net>
Date:   Tue Jan 3 14:50:25 2023 -0800

    Merge pull request #12298 from snipe/fixes/db_seeder_company_id

    Fixed db seeder when company id is not present

commit fa439a1928
Author: snipe <snipe@snipe.net>
Date:   Tue Jan 3 14:45:23 2023 -0800

    Check that the array key exists before trying to seed it

    Signed-off-by: snipe <snipe@snipe.net>

commit d187174f00
Merge: 6d3c5e065 92ae27129
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 22 11:29:12 2022 -0800

    Merge pull request #12090 from Godmartinz/deparmtnet_name_validator

    Added: validation for department names at Company locations

commit 6d3c5e0659
Merge: 685cc86d7 e791e6592
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 21 19:04:11 2022 -0800

    Merge pull request #12264 from Godmartinz/gh12253_display_notes_accessories

    Added: notes to the accessories tab for user detail view

commit 685cc86d71
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 20 17:24:01 2022 -0800

    Sets the `ldap_default_group` field to nullable and default null

    Signed-off-by: snipe <snipe@snipe.net>

commit fb10a6f218
Merge: 128c21a90 3a9b8a499
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 20 17:05:18 2022 -0800

    Merge pull request #12268 from inietov/fixes/people_count

    Fixed: Dashboard user count scoping when full company support is enabled

commit 3a9b8a4993
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Tue Dec 20 18:39:17 2022 -0600

    Calculate the proper amount of people in the dashboard if Full Company Support is enabled

commit 128c21a905
Merge: 88291cadc 75a757d6f
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 20 15:09:30 2022 -0800

    Merge pull request #12266 from uberbrady/fix-select-all-bug

    Fixed: There was a bug with BS tables' select-all which showed an incorrect list of elements

commit 75a757d6f5
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Tue Dec 20 14:57:58 2022 -0800

    There was a bug with select-all where some bits didn't quite work

commit e791e6592a
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 20 10:37:19 2022 -0800

    adds notes to the accessories tab under users

commit 38575e93e8
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 20 09:45:41 2022 -0800

    fixes the rules for adding page-break and padding at the end of document

commit 88291cadc1
Merge: 399c7590c 94afe2bc6
Author: snipe <snipe@snipe.net>
Date:   Mon Dec 19 12:41:32 2022 -0800

    Merge pull request #12254 from akemidx/documentating_something

    Commenting on a scope in Models/Company.php

commit 94afe2bc6a
Author: akemidx <kojotek.dx@gmail.com>
Date:   Mon Dec 19 14:48:43 2022 -0500

    edits & typo fixes

commit 399c7590cd
Merge: d0c5ba70f eb67d1b06
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 14:19:41 2022 -0800

    Merge pull request #12209 from snipe/fixes/error_downloading_unaccepted_assets

    Fixed 500 when downloading the Unaccepted Assets report  [sc-19555]

commit d0c5ba70f6
Merge: 29c2ff56e d9a21cce0
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 12:42:29 2022 -0800

    Merge pull request #12242 from inietov/features/add_purchase_cost_column

    Added `purchase_cost` to user's default view [sc-19680]

commit 133d6ffa50
Author: akemidx <kojotek.dx@gmail.com>
Date:   Thu Dec 15 15:18:24 2022 -0500

    Commenting on a scope in Models/Company.php

commit d9a21cce00
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Thu Dec 15 14:12:05 2022 -0600

    Add other items' purchase_cost columns to the same permission

commit 29c2ff56ec
Merge: 3e7975b2c 1fe0bfe17
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:26:49 2022 -0800

    Merge pull request #12188 from snipe/fixes/decrease_logging_for_saml_when_not_enabled

    Removed extra logging case that was very noisy

commit 3e7975b2c3
Merge: 227fef76e d870bc3b0
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:25:53 2022 -0800

    Merge pull request #12250 from akemidx/grey_out_pw_reset_button

    Fixed: Grey out pw reset button for consistency

commit d870bc3b02
Author: akemidx <kojotek.dx@gmail.com>
Date:   Thu Dec 15 14:19:51 2022 -0500

    nested if loop

commit 227fef76ee
Merge: 418ddcfac 9d44720ff
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:06:53 2022 -0800

    Merge pull request #11736 from Godmartinz/gh6508_ldap_default_group

    Adds a permission group selection for directory sync

commit 9d44720ffd
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 11:02:34 2022 -0800

    reverted changes to composer.lock

commit 9f3f0a25ed
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 10:53:45 2022 -0800

    reverted changes to composer.lock

commit 2e228ccb0b
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 10:45:42 2022 -0800

    redid a few things. should be good now :)

commit 3ee413f379
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 09:20:30 2022 -0800

    removes livewire stuff

commit b142f8e012
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Wed Dec 14 23:00:35 2022 -0600

    Add the permission to show purchase cost column to non-admin sessions

commit 418ddcfac3
Merge: c342668f0 1a908e361
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:46:53 2022 -0800

    Merge pull request #9876 from Toreg87/fixes/locations-deletable

    Fixed #9875: Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport

commit c342668f0f
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:25:39 2022 -0800

    Update @scoo73r as a contributor

commit 2f6a26ec7d
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:25:25 2022 -0800

    Add @scoo73r as a contributor

commit f635278010
Merge: d13a23700 8043b8678
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 16:42:41 2022 -0800

    Merge pull request #12251 from snipe/security/upgrade_font_awesome

    Upgraded font awesome to 6.2.1

commit 8043b86786
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 16:41:56 2022 -0800

    Upgraded font awesome to 6.2.1

    Signed-off-by: snipe <snipe@snipe.net>

commit d13a237000
Merge: fabefa61b d0d0058e7
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 12:13:18 2022 -0800

    Merge pull request #12205 from Godmartinz/sc19675_add_remote_to_importer

    Adds remote field to the user importer

commit b114ffd2c3
Author: akemidx <kojotek.dx@gmail.com>
Date:   Wed Dec 14 14:48:59 2022 -0500

    Grey out button pw reset button for consistency

    When user has no email in their profile, the box is greyed out for
    consistency accross all buttons on the user profile

commit fabefa61b0
Merge: 389ec3a3c f3e57d7dc
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 14:00:48 2022 -0800

    Merge pull request #12243 from akemidx/new_grey_out_when_no_assets

    Created method in users.php for adding up all assigned to user and pr…

commit f3e57d7dc0
Author: akemidx <kojotek.dx@gmail.com>
Date:   Tue Dec 13 16:00:59 2022 -0500

    fixing PR

commit 389ec3a3cb
Merge: c432fb9d7 6a72c344b
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 12:57:50 2022 -0800

    Merge pull request #12247 from Godmartinz/gh12225_serial_added_to_components

    adds serial to components tab of assets

commit 6a72c344b7
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 13 12:32:30 2022 -0800

    removed the cuddlers

commit 4442b446b9
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 13 10:30:37 2022 -0800

    adds serial to components tab of assets

commit c432fb9d70
Merge: 9e8fff6e5 fa872b09a
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 10:28:17 2022 -0800

    Merge pull request #12181 from Godmartinz/gh12163_asset_age

    Adds asset age to asset index and asset view pages

commit 07ae91b00f
Author: akemi <akemi@ShibaPro.local>
Date:   Wed Dec 7 17:46:18 2022 -0500

    Created method in users.php for adding up all assigned to user and providing an integer value. this then used to grey out buttons on user view if user has nothing assigned.

commit 450ad3dcec
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Mon Dec 12 14:17:08 2022 -0600

    Added the column purchase_cost to user's default view

commit fa872b09a9
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Dec 12 10:38:31 2022 -0800

    fixes a typo, the world is great again

commit eb67d1b064
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Tue Dec 6 18:00:16 2022 -0600

    Filter items from the report if null returned

commit d0d0058e79
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 6 11:19:28 2022 -0800

    removed unwanted changes

commit bbd04f8876
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 6 11:13:24 2022 -0800

    adds the rest of the fields for Remote

commit 36901d271b
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Dec 5 16:28:19 2022 -0800

    adds csvmatch for remote. Im a bit lost though lol

commit 3206929ee4
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Nov 29 09:51:42 2022 -0800

    adds AgeFormatter, not working yet

commit 1fe0bfe17e
Author: snipe <snipe@snipe.net>
Date:   Mon Nov 28 19:27:42 2022 -0800

    Removed extra logging case that was very noisy

    Signed-off-by: snipe <snipe@snipe.net>

commit 8d861cfd82
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Nov 28 10:59:18 2022 -0800

    adds age to the asset table

commit 078e7281cd
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Nov 28 10:45:58 2022 -0800

    adds asset age to asset view

commit 92ae271292
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Nov 9 13:11:33 2022 -0800

    adds validation for department names at Company locations

commit f2d4a61e3c
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:31:37 2022 -0700

    removes dead space

commit 3f25a1bf61
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:25:38 2022 -0700

    removes dead code

commit f9ac447dd1
Merge: 9b448227f b7bcfaccc
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:18:09 2022 -0700

    adds default group to LDAP

commit 9b448227f7
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Sep 13 11:40:10 2022 -0700

    tinkering to no avail

commit 28bc97f29f
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Sep 12 11:40:16 2022 -0700

    one line away from this being over with

commit 193b31e427
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Aug 31 12:58:33 2022 -0700

    select options working, testing sync then done

commit 70ac8af9c4
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Aug 31 09:53:20 2022 -0700

    .

commit 0c362e8b57
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Aug 29 12:09:56 2022 -0700

    gets the groups selector to appear but options are blank

commit fc6fefdb4e
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Aug 25 15:19:38 2022 -0700

    adds migration, variables, checkbox,working on groups

commit 1a908e361e
Author: Tobias Regnery <tobias.regnery@gmail.com>
Date:   Thu Jul 29 10:33:34 2021 +0200

    Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport

    locations->isDeletable() checks via gate::allows if a locations is deletable.
    This calls SnipePermissionsPolicy->before() and checks for !Company::isCurrentUserHasAccess($item).
    This returns false because locations don't have a company_id.

    Check for this and return true if the item don't have a company_id.

Signed-off-by: snipe <snipe@snipe.net>
2023-01-09 12:07:46 -08:00
snipe
ba51021ce3 Squashed commit of the following:
commit 818db58a7b
Merge: baf14c43e c4f900e9a
Author: snipe <snipe@snipe.net>
Date:   Wed Jan 4 13:22:03 2023 -0800

    Merge pull request #12305 from uberbrady/fix_license_seat_reporting

    Fixed: Change license_seat changing method to properly 'true up' license seats

commit c4f900e9af
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Wed Jan 4 13:02:53 2023 -0800

    Change license_seat changing method to properly 'true up' license seats

commit baf14c43ee
Merge: d187174f0 fa439a192
Author: snipe <snipe@snipe.net>
Date:   Tue Jan 3 14:50:25 2023 -0800

    Merge pull request #12298 from snipe/fixes/db_seeder_company_id

    Fixed db seeder when company id is not present

commit fa439a1928
Author: snipe <snipe@snipe.net>
Date:   Tue Jan 3 14:45:23 2023 -0800

    Check that the array key exists before trying to seed it

    Signed-off-by: snipe <snipe@snipe.net>

commit d187174f00
Merge: 6d3c5e065 92ae27129
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 22 11:29:12 2022 -0800

    Merge pull request #12090 from Godmartinz/deparmtnet_name_validator

    Added: validation for department names at Company locations

commit 6d3c5e0659
Merge: 685cc86d7 e791e6592
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 21 19:04:11 2022 -0800

    Merge pull request #12264 from Godmartinz/gh12253_display_notes_accessories

    Added: notes to the accessories tab for user detail view

commit 685cc86d71
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 20 17:24:01 2022 -0800

    Sets the `ldap_default_group` field to nullable and default null

    Signed-off-by: snipe <snipe@snipe.net>

commit fb10a6f218
Merge: 128c21a90 3a9b8a499
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 20 17:05:18 2022 -0800

    Merge pull request #12268 from inietov/fixes/people_count

    Fixed: Dashboard user count scoping when full company support is enabled

commit 3a9b8a4993
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Tue Dec 20 18:39:17 2022 -0600

    Calculate the proper amount of people in the dashboard if Full Company Support is enabled

commit 128c21a905
Merge: 88291cadc 75a757d6f
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 20 15:09:30 2022 -0800

    Merge pull request #12266 from uberbrady/fix-select-all-bug

    Fixed: There was a bug with BS tables' select-all which showed an incorrect list of elements

commit 75a757d6f5
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Tue Dec 20 14:57:58 2022 -0800

    There was a bug with select-all where some bits didn't quite work

commit e791e6592a
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 20 10:37:19 2022 -0800

    adds notes to the accessories tab under users

commit 88291cadc1
Merge: 399c7590c 94afe2bc6
Author: snipe <snipe@snipe.net>
Date:   Mon Dec 19 12:41:32 2022 -0800

    Merge pull request #12254 from akemidx/documentating_something

    Commenting on a scope in Models/Company.php

commit 94afe2bc6a
Author: akemidx <kojotek.dx@gmail.com>
Date:   Mon Dec 19 14:48:43 2022 -0500

    edits & typo fixes

commit 399c7590cd
Merge: d0c5ba70f eb67d1b06
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 14:19:41 2022 -0800

    Merge pull request #12209 from snipe/fixes/error_downloading_unaccepted_assets

    Fixed 500 when downloading the Unaccepted Assets report  [sc-19555]

commit d0c5ba70f6
Merge: 29c2ff56e d9a21cce0
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 12:42:29 2022 -0800

    Merge pull request #12242 from inietov/features/add_purchase_cost_column

    Added `purchase_cost` to user's default view [sc-19680]

commit 133d6ffa50
Author: akemidx <kojotek.dx@gmail.com>
Date:   Thu Dec 15 15:18:24 2022 -0500

    Commenting on a scope in Models/Company.php

commit d9a21cce00
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Thu Dec 15 14:12:05 2022 -0600

    Add other items' purchase_cost columns to the same permission

commit 29c2ff56ec
Merge: 3e7975b2c 1fe0bfe17
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:26:49 2022 -0800

    Merge pull request #12188 from snipe/fixes/decrease_logging_for_saml_when_not_enabled

    Removed extra logging case that was very noisy

commit 3e7975b2c3
Merge: 227fef76e d870bc3b0
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:25:53 2022 -0800

    Merge pull request #12250 from akemidx/grey_out_pw_reset_button

    Fixed: Grey out pw reset button for consistency

commit d870bc3b02
Author: akemidx <kojotek.dx@gmail.com>
Date:   Thu Dec 15 14:19:51 2022 -0500

    nested if loop

commit 227fef76ee
Merge: 418ddcfac 9d44720ff
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:06:53 2022 -0800

    Merge pull request #11736 from Godmartinz/gh6508_ldap_default_group

    Adds a permission group selection for directory sync

commit 9d44720ffd
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 11:02:34 2022 -0800

    reverted changes to composer.lock

commit 9f3f0a25ed
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 10:53:45 2022 -0800

    reverted changes to composer.lock

commit 2e228ccb0b
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 10:45:42 2022 -0800

    redid a few things. should be good now :)

commit 3ee413f379
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 09:20:30 2022 -0800

    removes livewire stuff

commit b142f8e012
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Wed Dec 14 23:00:35 2022 -0600

    Add the permission to show purchase cost column to non-admin sessions

commit 418ddcfac3
Merge: c342668f0 1a908e361
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:46:53 2022 -0800

    Merge pull request #9876 from Toreg87/fixes/locations-deletable

    Fixed #9875: Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport

commit c342668f0f
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:25:39 2022 -0800

    Update @scoo73r as a contributor

commit 2f6a26ec7d
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:25:25 2022 -0800

    Add @scoo73r as a contributor

commit f635278010
Merge: d13a23700 8043b8678
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 16:42:41 2022 -0800

    Merge pull request #12251 from snipe/security/upgrade_font_awesome

    Upgraded font awesome to 6.2.1

commit 8043b86786
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 16:41:56 2022 -0800

    Upgraded font awesome to 6.2.1

    Signed-off-by: snipe <snipe@snipe.net>

commit d13a237000
Merge: fabefa61b d0d0058e7
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 12:13:18 2022 -0800

    Merge pull request #12205 from Godmartinz/sc19675_add_remote_to_importer

    Adds remote field to the user importer

commit b114ffd2c3
Author: akemidx <kojotek.dx@gmail.com>
Date:   Wed Dec 14 14:48:59 2022 -0500

    Grey out button pw reset button for consistency

    When user has no email in their profile, the box is greyed out for
    consistency accross all buttons on the user profile

commit fabefa61b0
Merge: 389ec3a3c f3e57d7dc
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 14:00:48 2022 -0800

    Merge pull request #12243 from akemidx/new_grey_out_when_no_assets

    Created method in users.php for adding up all assigned to user and pr…

commit f3e57d7dc0
Author: akemidx <kojotek.dx@gmail.com>
Date:   Tue Dec 13 16:00:59 2022 -0500

    fixing PR

commit 389ec3a3cb
Merge: c432fb9d7 6a72c344b
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 12:57:50 2022 -0800

    Merge pull request #12247 from Godmartinz/gh12225_serial_added_to_components

    adds serial to components tab of assets

commit 6a72c344b7
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 13 12:32:30 2022 -0800

    removed the cuddlers

commit 4442b446b9
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 13 10:30:37 2022 -0800

    adds serial to components tab of assets

commit c432fb9d70
Merge: 9e8fff6e5 fa872b09a
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 10:28:17 2022 -0800

    Merge pull request #12181 from Godmartinz/gh12163_asset_age

    Adds asset age to asset index and asset view pages

commit 07ae91b00f
Author: akemi <akemi@ShibaPro.local>
Date:   Wed Dec 7 17:46:18 2022 -0500

    Created method in users.php for adding up all assigned to user and providing an integer value. this then used to grey out buttons on user view if user has nothing assigned.

commit 450ad3dcec
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Mon Dec 12 14:17:08 2022 -0600

    Added the column purchase_cost to user's default view

commit fa872b09a9
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Dec 12 10:38:31 2022 -0800

    fixes a typo, the world is great again

commit eb67d1b064
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Tue Dec 6 18:00:16 2022 -0600

    Filter items from the report if null returned

commit d0d0058e79
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 6 11:19:28 2022 -0800

    removed unwanted changes

commit bbd04f8876
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 6 11:13:24 2022 -0800

    adds the rest of the fields for Remote

commit 36901d271b
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Dec 5 16:28:19 2022 -0800

    adds csvmatch for remote. Im a bit lost though lol

commit 3206929ee4
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Nov 29 09:51:42 2022 -0800

    adds AgeFormatter, not working yet

commit 1fe0bfe17e
Author: snipe <snipe@snipe.net>
Date:   Mon Nov 28 19:27:42 2022 -0800

    Removed extra logging case that was very noisy

    Signed-off-by: snipe <snipe@snipe.net>

commit 8d861cfd82
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Nov 28 10:59:18 2022 -0800

    adds age to the asset table

commit 078e7281cd
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Nov 28 10:45:58 2022 -0800

    adds asset age to asset view

commit 92ae271292
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Nov 9 13:11:33 2022 -0800

    adds validation for department names at Company locations

commit f2d4a61e3c
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:31:37 2022 -0700

    removes dead space

commit 3f25a1bf61
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:25:38 2022 -0700

    removes dead code

commit f9ac447dd1
Merge: 9b448227f b7bcfaccc
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:18:09 2022 -0700

    adds default group to LDAP

commit 9b448227f7
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Sep 13 11:40:10 2022 -0700

    tinkering to no avail

commit 28bc97f29f
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Sep 12 11:40:16 2022 -0700

    one line away from this being over with

commit 193b31e427
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Aug 31 12:58:33 2022 -0700

    select options working, testing sync then done

commit 70ac8af9c4
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Aug 31 09:53:20 2022 -0700

    .

commit 0c362e8b57
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Aug 29 12:09:56 2022 -0700

    gets the groups selector to appear but options are blank

commit fc6fefdb4e
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Aug 25 15:19:38 2022 -0700

    adds migration, variables, checkbox,working on groups

commit 1a908e361e
Author: Tobias Regnery <tobias.regnery@gmail.com>
Date:   Thu Jul 29 10:33:34 2021 +0200

    Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport

    locations->isDeletable() checks via gate::allows if a locations is deletable.
    This calls SnipePermissionsPolicy->before() and checks for !Company::isCurrentUserHasAccess($item).
    This returns false because locations don't have a company_id.

    Check for this and return true if the item don't have a company_id.

Signed-off-by: snipe <snipe@snipe.net>
2023-01-04 13:53:41 -08:00
snipe
a605dc16b6 Set session urls
Signed-off-by: snipe <snipe@snipe.net>
2023-01-02 13:31:52 -08:00
snipe
36858d1c64 Removed whitespace
Signed-off-by: snipe <snipe@snipe.net>
2022-12-21 18:53:48 -08:00
snipe
3d74e40c44 Deleted similar acceptance blades and created one more generic one
Signed-off-by: snipe <snipe@snipe.net>
2022-12-21 18:03:17 -08:00
snipe
cc7253b29f Small case/switch refactoring
Signed-off-by: snipe <snipe@snipe.net>
2022-12-21 18:02:34 -08:00
snipe
bc185a2848 Squashed commit of the following:
commit 685cc86d71
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 20 17:24:01 2022 -0800

    Sets the `ldap_default_group` field to nullable and default null

    Signed-off-by: snipe <snipe@snipe.net>

commit fb10a6f218
Merge: 128c21a90 3a9b8a499
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 20 17:05:18 2022 -0800

    Merge pull request #12268 from inietov/fixes/people_count

    Fixed: Dashboard user count scoping when full company support is enabled

commit 3a9b8a4993
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Tue Dec 20 18:39:17 2022 -0600

    Calculate the proper amount of people in the dashboard if Full Company Support is enabled

commit 128c21a905
Merge: 88291cadc 75a757d6f
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 20 15:09:30 2022 -0800

    Merge pull request #12266 from uberbrady/fix-select-all-bug

    Fixed: There was a bug with BS tables' select-all which showed an incorrect list of elements

commit 75a757d6f5
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Tue Dec 20 14:57:58 2022 -0800

    There was a bug with select-all where some bits didn't quite work

commit 88291cadc1
Merge: 399c7590c 94afe2bc6
Author: snipe <snipe@snipe.net>
Date:   Mon Dec 19 12:41:32 2022 -0800

    Merge pull request #12254 from akemidx/documentating_something

    Commenting on a scope in Models/Company.php

commit 94afe2bc6a
Author: akemidx <kojotek.dx@gmail.com>
Date:   Mon Dec 19 14:48:43 2022 -0500

    edits & typo fixes

commit 399c7590cd
Merge: d0c5ba70f eb67d1b06
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 14:19:41 2022 -0800

    Merge pull request #12209 from snipe/fixes/error_downloading_unaccepted_assets

    Fixed 500 when downloading the Unaccepted Assets report  [sc-19555]

commit d0c5ba70f6
Merge: 29c2ff56e d9a21cce0
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 12:42:29 2022 -0800

    Merge pull request #12242 from inietov/features/add_purchase_cost_column

    Added `purchase_cost` to user's default view [sc-19680]

commit 133d6ffa50
Author: akemidx <kojotek.dx@gmail.com>
Date:   Thu Dec 15 15:18:24 2022 -0500

    Commenting on a scope in Models/Company.php

commit d9a21cce00
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Thu Dec 15 14:12:05 2022 -0600

    Add other items' purchase_cost columns to the same permission

commit 29c2ff56ec
Merge: 3e7975b2c 1fe0bfe17
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:26:49 2022 -0800

    Merge pull request #12188 from snipe/fixes/decrease_logging_for_saml_when_not_enabled

    Removed extra logging case that was very noisy

commit 3e7975b2c3
Merge: 227fef76e d870bc3b0
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:25:53 2022 -0800

    Merge pull request #12250 from akemidx/grey_out_pw_reset_button

    Fixed: Grey out pw reset button for consistency

commit d870bc3b02
Author: akemidx <kojotek.dx@gmail.com>
Date:   Thu Dec 15 14:19:51 2022 -0500

    nested if loop

commit 227fef76ee
Merge: 418ddcfac 9d44720ff
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:06:53 2022 -0800

    Merge pull request #11736 from Godmartinz/gh6508_ldap_default_group

    Adds a permission group selection for directory sync

commit 9d44720ffd
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 11:02:34 2022 -0800

    reverted changes to composer.lock

commit 9f3f0a25ed
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 10:53:45 2022 -0800

    reverted changes to composer.lock

commit 2e228ccb0b
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 10:45:42 2022 -0800

    redid a few things. should be good now :)

commit 3ee413f379
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 09:20:30 2022 -0800

    removes livewire stuff

commit b142f8e012
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Wed Dec 14 23:00:35 2022 -0600

    Add the permission to show purchase cost column to non-admin sessions

commit 418ddcfac3
Merge: c342668f0 1a908e361
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:46:53 2022 -0800

    Merge pull request #9876 from Toreg87/fixes/locations-deletable

    Fixed #9875: Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport

commit c342668f0f
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:25:39 2022 -0800

    Update @scoo73r as a contributor

commit 2f6a26ec7d
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:25:25 2022 -0800

    Add @scoo73r as a contributor

commit f635278010
Merge: d13a23700 8043b8678
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 16:42:41 2022 -0800

    Merge pull request #12251 from snipe/security/upgrade_font_awesome

    Upgraded font awesome to 6.2.1

commit 8043b86786
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 16:41:56 2022 -0800

    Upgraded font awesome to 6.2.1

    Signed-off-by: snipe <snipe@snipe.net>

commit d13a237000
Merge: fabefa61b d0d0058e7
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 12:13:18 2022 -0800

    Merge pull request #12205 from Godmartinz/sc19675_add_remote_to_importer

    Adds remote field to the user importer

commit b114ffd2c3
Author: akemidx <kojotek.dx@gmail.com>
Date:   Wed Dec 14 14:48:59 2022 -0500

    Grey out button pw reset button for consistency

    When user has no email in their profile, the box is greyed out for
    consistency accross all buttons on the user profile

commit fabefa61b0
Merge: 389ec3a3c f3e57d7dc
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 14:00:48 2022 -0800

    Merge pull request #12243 from akemidx/new_grey_out_when_no_assets

    Created method in users.php for adding up all assigned to user and pr…

commit f3e57d7dc0
Author: akemidx <kojotek.dx@gmail.com>
Date:   Tue Dec 13 16:00:59 2022 -0500

    fixing PR

commit 389ec3a3cb
Merge: c432fb9d7 6a72c344b
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 12:57:50 2022 -0800

    Merge pull request #12247 from Godmartinz/gh12225_serial_added_to_components

    adds serial to components tab of assets

commit 6a72c344b7
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 13 12:32:30 2022 -0800

    removed the cuddlers

commit 4442b446b9
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 13 10:30:37 2022 -0800

    adds serial to components tab of assets

commit c432fb9d70
Merge: 9e8fff6e5 fa872b09a
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 10:28:17 2022 -0800

    Merge pull request #12181 from Godmartinz/gh12163_asset_age

    Adds asset age to asset index and asset view pages

commit 07ae91b00f
Author: akemi <akemi@ShibaPro.local>
Date:   Wed Dec 7 17:46:18 2022 -0500

    Created method in users.php for adding up all assigned to user and providing an integer value. this then used to grey out buttons on user view if user has nothing assigned.

commit 450ad3dcec
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Mon Dec 12 14:17:08 2022 -0600

    Added the column purchase_cost to user's default view

commit fa872b09a9
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Dec 12 10:38:31 2022 -0800

    fixes a typo, the world is great again

commit eb67d1b064
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Tue Dec 6 18:00:16 2022 -0600

    Filter items from the report if null returned

commit d0d0058e79
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 6 11:19:28 2022 -0800

    removed unwanted changes

commit bbd04f8876
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 6 11:13:24 2022 -0800

    adds the rest of the fields for Remote

commit 36901d271b
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Dec 5 16:28:19 2022 -0800

    adds csvmatch for remote. Im a bit lost though lol

commit 3206929ee4
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Nov 29 09:51:42 2022 -0800

    adds AgeFormatter, not working yet

commit 1fe0bfe17e
Author: snipe <snipe@snipe.net>
Date:   Mon Nov 28 19:27:42 2022 -0800

    Removed extra logging case that was very noisy

    Signed-off-by: snipe <snipe@snipe.net>

commit 8d861cfd82
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Nov 28 10:59:18 2022 -0800

    adds age to the asset table

commit 078e7281cd
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Nov 28 10:45:58 2022 -0800

    adds asset age to asset view

commit f2d4a61e3c
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:31:37 2022 -0700

    removes dead space

commit 3f25a1bf61
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:25:38 2022 -0700

    removes dead code

commit f9ac447dd1
Merge: 9b448227f b7bcfaccc
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:18:09 2022 -0700

    adds default group to LDAP

commit 9b448227f7
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Sep 13 11:40:10 2022 -0700

    tinkering to no avail

commit 28bc97f29f
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Sep 12 11:40:16 2022 -0700

    one line away from this being over with

commit 193b31e427
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Aug 31 12:58:33 2022 -0700

    select options working, testing sync then done

commit 70ac8af9c4
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Aug 31 09:53:20 2022 -0700

    .

commit 0c362e8b57
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Aug 29 12:09:56 2022 -0700

    gets the groups selector to appear but options are blank

commit fc6fefdb4e
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Aug 25 15:19:38 2022 -0700

    adds migration, variables, checkbox,working on groups

commit 1a908e361e
Author: Tobias Regnery <tobias.regnery@gmail.com>
Date:   Thu Jul 29 10:33:34 2021 +0200

    Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport

    locations->isDeletable() checks via gate::allows if a locations is deletable.
    This calls SnipePermissionsPolicy->before() and checks for !Company::isCurrentUserHasAccess($item).
    This returns false because locations don't have a company_id.

    Check for this and return true if the item don't have a company_id.

Signed-off-by: snipe <snipe@snipe.net>
2022-12-21 16:46:29 -08:00
snipe
d33829f67a New universal accept blade
Signed-off-by: snipe <snipe@snipe.net>
2022-12-20 15:11:12 -08:00
snipe
d818dc19c1 Felt cute, might revert later
Signed-off-by: snipe <snipe@snipe.net>
2022-12-20 15:11:02 -08:00
snipe
d6769443a9 Squashed commit of the following:
commit 399c7590cd
Merge: d0c5ba70f eb67d1b06
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 14:19:41 2022 -0800

    Merge pull request #12209 from snipe/fixes/error_downloading_unaccepted_assets

    Fixed 500 when downloading the Unaccepted Assets report  [sc-19555]

commit d0c5ba70f6
Merge: 29c2ff56e d9a21cce0
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 12:42:29 2022 -0800

    Merge pull request #12242 from inietov/features/add_purchase_cost_column

    Added `purchase_cost` to user's default view [sc-19680]

commit d9a21cce00
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Thu Dec 15 14:12:05 2022 -0600

    Add other items' purchase_cost columns to the same permission

commit 29c2ff56ec
Merge: 3e7975b2c 1fe0bfe17
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:26:49 2022 -0800

    Merge pull request #12188 from snipe/fixes/decrease_logging_for_saml_when_not_enabled

    Removed extra logging case that was very noisy

commit 3e7975b2c3
Merge: 227fef76e d870bc3b0
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:25:53 2022 -0800

    Merge pull request #12250 from akemidx/grey_out_pw_reset_button

    Fixed: Grey out pw reset button for consistency

commit d870bc3b02
Author: akemidx <kojotek.dx@gmail.com>
Date:   Thu Dec 15 14:19:51 2022 -0500

    nested if loop

commit 227fef76ee
Merge: 418ddcfac 9d44720ff
Author: snipe <snipe@snipe.net>
Date:   Thu Dec 15 11:06:53 2022 -0800

    Merge pull request #11736 from Godmartinz/gh6508_ldap_default_group

    Adds a permission group selection for directory sync

commit 9d44720ffd
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 11:02:34 2022 -0800

    reverted changes to composer.lock

commit 9f3f0a25ed
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 10:53:45 2022 -0800

    reverted changes to composer.lock

commit 2e228ccb0b
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 10:45:42 2022 -0800

    redid a few things. should be good now :)

commit 3ee413f379
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Dec 15 09:20:30 2022 -0800

    removes livewire stuff

commit b142f8e012
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Wed Dec 14 23:00:35 2022 -0600

    Add the permission to show purchase cost column to non-admin sessions

commit 418ddcfac3
Merge: c342668f0 1a908e361
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:46:53 2022 -0800

    Merge pull request #9876 from Toreg87/fixes/locations-deletable

    Fixed #9875: Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport

commit c342668f0f
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:25:39 2022 -0800

    Update @scoo73r as a contributor

commit 2f6a26ec7d
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 17:25:25 2022 -0800

    Add @scoo73r as a contributor

commit f635278010
Merge: d13a23700 8043b8678
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 16:42:41 2022 -0800

    Merge pull request #12251 from snipe/security/upgrade_font_awesome

    Upgraded font awesome to 6.2.1

commit 8043b86786
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 16:41:56 2022 -0800

    Upgraded font awesome to 6.2.1

    Signed-off-by: snipe <snipe@snipe.net>

commit d13a237000
Merge: fabefa61b d0d0058e7
Author: snipe <snipe@snipe.net>
Date:   Wed Dec 14 12:13:18 2022 -0800

    Merge pull request #12205 from Godmartinz/sc19675_add_remote_to_importer

    Adds remote field to the user importer

commit b114ffd2c3
Author: akemidx <kojotek.dx@gmail.com>
Date:   Wed Dec 14 14:48:59 2022 -0500

    Grey out button pw reset button for consistency

    When user has no email in their profile, the box is greyed out for
    consistency accross all buttons on the user profile

commit fabefa61b0
Merge: 389ec3a3c f3e57d7dc
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 14:00:48 2022 -0800

    Merge pull request #12243 from akemidx/new_grey_out_when_no_assets

    Created method in users.php for adding up all assigned to user and pr…

commit f3e57d7dc0
Author: akemidx <kojotek.dx@gmail.com>
Date:   Tue Dec 13 16:00:59 2022 -0500

    fixing PR

commit 389ec3a3cb
Merge: c432fb9d7 6a72c344b
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 12:57:50 2022 -0800

    Merge pull request #12247 from Godmartinz/gh12225_serial_added_to_components

    adds serial to components tab of assets

commit 6a72c344b7
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 13 12:32:30 2022 -0800

    removed the cuddlers

commit 4442b446b9
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 13 10:30:37 2022 -0800

    adds serial to components tab of assets

commit c432fb9d70
Merge: 9e8fff6e5 fa872b09a
Author: snipe <snipe@snipe.net>
Date:   Tue Dec 13 10:28:17 2022 -0800

    Merge pull request #12181 from Godmartinz/gh12163_asset_age

    Adds asset age to asset index and asset view pages

commit 07ae91b00f
Author: akemi <akemi@ShibaPro.local>
Date:   Wed Dec 7 17:46:18 2022 -0500

    Created method in users.php for adding up all assigned to user and providing an integer value. this then used to grey out buttons on user view if user has nothing assigned.

commit 450ad3dcec
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Mon Dec 12 14:17:08 2022 -0600

    Added the column purchase_cost to user's default view

commit fa872b09a9
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Dec 12 10:38:31 2022 -0800

    fixes a typo, the world is great again

commit eb67d1b064
Author: Ivan Nieto Vivanco <inietov@gmail.com>
Date:   Tue Dec 6 18:00:16 2022 -0600

    Filter items from the report if null returned

commit d0d0058e79
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 6 11:19:28 2022 -0800

    removed unwanted changes

commit bbd04f8876
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Dec 6 11:13:24 2022 -0800

    adds the rest of the fields for Remote

commit 36901d271b
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Dec 5 16:28:19 2022 -0800

    adds csvmatch for remote. Im a bit lost though lol

commit 3206929ee4
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Nov 29 09:51:42 2022 -0800

    adds AgeFormatter, not working yet

commit 1fe0bfe17e
Author: snipe <snipe@snipe.net>
Date:   Mon Nov 28 19:27:42 2022 -0800

    Removed extra logging case that was very noisy

    Signed-off-by: snipe <snipe@snipe.net>

commit 8d861cfd82
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Nov 28 10:59:18 2022 -0800

    adds age to the asset table

commit 078e7281cd
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Nov 28 10:45:58 2022 -0800

    adds asset age to asset view

commit f2d4a61e3c
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:31:37 2022 -0700

    removes dead space

commit 3f25a1bf61
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:25:38 2022 -0700

    removes dead code

commit f9ac447dd1
Merge: 9b448227f b7bcfaccc
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Oct 18 15:18:09 2022 -0700

    adds default group to LDAP

commit 9b448227f7
Author: Godfrey M <godmartinz@gmail.com>
Date:   Tue Sep 13 11:40:10 2022 -0700

    tinkering to no avail

commit 28bc97f29f
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Sep 12 11:40:16 2022 -0700

    one line away from this being over with

commit 193b31e427
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Aug 31 12:58:33 2022 -0700

    select options working, testing sync then done

commit 70ac8af9c4
Author: Godfrey M <godmartinz@gmail.com>
Date:   Wed Aug 31 09:53:20 2022 -0700

    .

commit 0c362e8b57
Author: Godfrey M <godmartinz@gmail.com>
Date:   Mon Aug 29 12:09:56 2022 -0700

    gets the groups selector to appear but options are blank

commit fc6fefdb4e
Author: Godfrey M <godmartinz@gmail.com>
Date:   Thu Aug 25 15:19:38 2022 -0700

    adds migration, variables, checkbox,working on groups

commit 1a908e361e
Author: Tobias Regnery <tobias.regnery@gmail.com>
Date:   Thu Jul 29 10:33:34 2021 +0200

    Make locations deletable for non Superuser-Accounts with FullMultipleCompanySupport

    locations->isDeletable() checks via gate::allows if a locations is deletable.
    This calls SnipePermissionsPolicy->before() and checks for !Company::isCurrentUserHasAccess($item).
    This returns false because locations don't have a company_id.

    Check for this and return true if the item don't have a company_id.

Signed-off-by: snipe <snipe@snipe.net>
2022-12-15 15:18:16 -08:00
snipe
9e0566ca7a First stab
Signed-off-by: snipe <snipe@snipe.net>
2022-12-09 16:38:40 -08:00
snipe
9e8fff6e5b Merge pull request #12238 from snipe/features/add_email_to_endpoint
Add email in assigned_to on asset transformer
2022-12-09 16:08:35 -08:00
snipe
4ac09ff4e4 Add email in assigned_to on asset transformer
Signed-off-by: snipe <snipe@snipe.net>
2022-12-09 16:07:17 -08:00
snipe
1017148bad Merge pull request #12233 from snipe/fixes/translation_placeholder_for_ola_pt-BR
Fixed #12215 - string for “Hello, :name” in pt-BR was using `%`
2022-12-08 17:25:19 -08:00
snipe
00ed197651 Fixed #12215 - string for “Hello, :name” in pt-BR was using %
Signed-off-by: snipe <snipe@snipe.net>
2022-12-08 17:21:55 -08:00
snipe
775df0ab60 Merge pull request #12221 from snipe/fixes/throttles_reset_password_form
Add throttle for password reset form
2022-12-08 14:51:22 -08:00
snipe
bc2a455a89 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-12-08 14:48:55 -08:00
snipe
97c28d9adc Add @oguzbilgic as a contributor 2022-12-08 14:44:28 -08:00
snipe
9b3df40ed6 Merge pull request #12231 from oguzbilgic/patch-2
Use `heroku-redis:mini` instead of `hobby` as It is deprecated
2022-12-08 11:22:14 -08:00
Oguz Bilgic
1c8ee0f706 Use heroku-redis:mini instead of hobby as It is deprecated
Heroku has renamed it's plan to `mini`.
2022-12-08 11:20:33 -08:00
snipe
d7c5a6af71 Merge pull request #12224 from Godmartinz/gh12211_img_barcode_adjustment
Fixes the margin and padding for img barcode in labels
2022-12-07 16:35:04 -08:00
snipe
f7da87520c Merge pull request #12134 from Godmartinz/custom_report_user_fields_missing
fixes a regression with the csv assigned to fields
2022-12-07 16:18:32 -08:00
Godfrey M
ec854ddc1d adjusts the margin and padding for img barcode in labels 2022-12-07 14:52:23 -08:00
snipe
1a8b2a169b Merge pull request #12219 from snipe/fixes/typo_in_sr_text_for_apple
Fixed typo in screen reader text
2022-12-07 13:12:07 -08:00
snipe
43acd3b488 Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2022-12-07 13:11:17 -08:00
snipe
c3a6874b16 Add throttle for password reset form
Signed-off-by: snipe <snipe@snipe.net>
2022-12-06 20:42:40 -08:00
snipe
b7a5467f8b Merge pull request #12204 from akemidx/fixcurlyquotes
Fixed: curly quotes in #12182
2022-12-05 15:33:47 -08:00
akemi
2f8a435e18 fixing curly quotes 2022-12-05 18:06:28 -05:00
snipe
9ca40716ce Merge pull request #12197 from inietov/fixes/custom_regex_defaults_to_any
Fixed #11682  Custom field type of CUSTOM REGEX defaults back to ANY on editing
2022-12-05 13:24:22 -08:00
snipe
7518cab7c8 Merge pull request #12194 from Godmartinz/FDD32094_Icon_color_change
changes the life-ring icon color with themes
2022-12-01 10:04:55 -08:00
Ivan Nieto Vivanco
8d36971c8b Properly select 'CUSTOM REGEX' from the select list if the format declares onee 2022-11-30 16:21:23 -06:00
Godfrey M
371a5bf4d6 changes the icon color with themes 2022-11-30 10:37:47 -08:00
snipe
cfc4229308 Add @akemidx as a contributor 2022-11-29 13:15:28 -08:00
snipe
8bf01715a9 Merge pull request #12182 from akemidx/translate_inventory_notification
Fixed #12119 - updated user inventory language to use strings
2022-11-29 13:14:32 -08:00
akemi
55f5e7866d edits for PR 2022-11-29 15:59:36 -05:00
snipe
0cc7389b85 Merge pull request #12187 from snipe/features/added_jobtitle_to_print
Fixed #12133 - Added job title to header in print assets view
2022-11-28 19:20:46 -08:00
snipe
e21d0729c1 Add jobh title to header in print assets view
Signed-off-by: snipe <snipe@snipe.net>
2022-11-28 19:19:42 -08:00
snipe
64a8d1d207 Merge pull request #12185 from snipe/features/add_serial_to_inventory_email
Added serial number to emailed inventory report
2022-11-28 17:20:34 -08:00
snipe
8de59d117f Added serial number to emailed inventory report
Signed-off-by: snipe <snipe@snipe.net>
2022-11-28 17:14:38 -08:00
snipe
6113afe36e Merge pull request #12125 from inietov/fixes/email_issues
Fixed #11699 and #12065 Email issues
2022-11-28 14:09:42 -08:00
snipe
305df42f92 Merge pull request #12167 from inietov/features/no_submit_until_status_selected
Fixed #11980 Submit button deactivated in Users' Bulk Checkin if no status selected
2022-11-28 13:17:33 -08:00
snipe
9aa0356de7 Merge pull request #12159 from uberbrady/upgrade_scim_server_to_upstream
Pulled in latest upstream changes for improved standards-compliance
2022-11-28 13:15:27 -08:00
akemi
39e06a8856 Update to PR#12119, adding inventory notification to messages and changing code to be dynamicaly translated 2022-11-28 14:16:22 -05:00
snipe
3ef578eb56 Merge pull request #12164 from Robert-Azelis/patch-7
Fix categories view columns matching
2022-11-23 18:47:02 -08:00
snipe
11a1ab971c Merge pull request #12166 from inietov/fixes/custom_fields_values_develop
Fixed #12046 #12137 Custom field checkboxes not holding value for develop
2022-11-23 18:44:23 -08:00
snipe
d226cf189b Merge pull request #12168 from inietov/fixes/error_accepting_assets
Fixed #12161 500 error when accepting assets
2022-11-23 18:41:42 -08:00
Ivan Nieto Vivanco
c082d8b90e Return empty string if no MAIL_REPLYTO_ADDR var set 2022-11-23 18:22:31 -06:00
Ivan Nieto Vivanco
b1985a08c4 Checks the status before activate the submit button on users bulk-checkin 2022-11-23 17:45:59 -06:00
Ivan Nieto Vivanco
9bafe795b0 Corrected the view when editing custom fields values 2022-11-23 16:34:29 -06:00
Robert-Azelis
c2cfd8ff53 Update CategoryPresenter.php 2022-11-23 19:00:08 +01:00
Robert-Azelis
20ad4fb681 Update CategoryPresenter.php
Fix snipe#12153
2022-11-23 18:42:38 +01:00
Brady Wetherington
06a1fe5b38 Pulled in latest upstream changes for improved standards-compliance 2022-11-22 12:52:11 -08:00
snipe
e426846c23 Merge pull request #12157 from snipe/fixes/inherit_bgcolor_for_readonly
Fixed background color for readonly date picker fields
2022-11-22 16:57:34 +00:00
snipe
27898e660c Inherit the background color, since the field isn’t actually technically readonly
Signed-off-by: snipe <snipe@snipe.net>
2022-11-22 08:54:48 -08:00
snipe
0d9d02c6d6 Merge pull request #12148 from whalehub/develop
Fix restore icon in table view
2022-11-19 10:25:48 +00:00
Aaron
7c854c0a5c Fix restore icon in table view
Signed-off-by: Aaron <admin@datahoarder.dev>
2022-11-19 10:45:10 +01:00
snipe
ba4c37a7f4 Merge pull request #12139 from snipe/fixes/custom_fields_api_patches
Fixed #9949 - PATCH to custom fields failing on validation (alt approach to #12011)
2022-11-17 21:28:39 +00:00
snipe
f0c5560c1b Merge pull request #12141 from Godmartinz/adds_serial_number_to_history
Added `serial` column to the user history page
2022-11-17 21:15:26 +00:00
snipe
774962c122 Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2022-11-17 21:14:35 +00:00
Godfrey M
0a9fd0b867 adds serial to activity report page 2022-11-17 13:09:06 -08:00
Godfrey M
5c94ca1403 removes dead space 2022-11-17 13:06:07 -08:00
Godfrey M
86bc409d3a adds serial column to the action logs 2022-11-17 12:57:53 -08:00
snipe
24841a75d4 Move common things into the model level validation
Signed-off-by: snipe <snipe@snipe.net>
2022-11-17 19:41:10 +00:00
Godfrey M
a02a04d601 fixes a regression with the csv assigned to fields 2022-11-16 16:34:57 -08:00
snipe
3997085faf Merge pull request #12122 from Godmartinz/fixes_checkout_to_all_description
fixes checkout to all description
2022-11-16 21:56:53 +00:00
snipe
3ac92e1425 Merge pull request #12127 from deloz/fix-Asset-checked-in-Email-Asset-Picture-Not-Displaying
Fixed #12095 - email logo still linking even if settings deny it
2022-11-16 21:55:59 +00:00
snipe
cdcd19a7d8 Merge pull request #12132 from snipe/fixes/view_assets_page_error_when_no_custom_fields
Handle use case where there are no custom fields for any assigned models
2022-11-16 17:48:53 +00:00
snipe
489895a5fa Added comments and spacing for readability
Signed-off-by: snipe <snipe@snipe.net>
2022-11-16 17:48:28 +00:00
snipe
1122562b4e Handle use case where there are no custom fields for any assigned models
Signed-off-by: snipe <snipe@snipe.net>
2022-11-16 17:45:50 +00:00
snipe
4ffe13d3c2 Merge pull request #12131 from snipe/fixes/check_for_format_index_in_custom_field_api_call
Fixed 500 if `format` is not passed to the create custom field endpoint payload
2022-11-16 15:57:07 +00:00
snipe
5df76155ce Check for the format index in the $data array when creating a new custom field via API
Signed-off-by: snipe <snipe@snipe.net>
2022-11-16 15:53:16 +00:00
snipe
e1c33d4eff Merge pull request #12129 from deloz/fix-remove-duplicate-column-checkin_email
Fixed #12109 - Duplicate column on Category listing
2022-11-16 11:41:55 +00:00
Instead of looking elsewhere, it is better to come here together
2fc7a15372 Fixed: #12109 2022-11-16 18:22:11 +08:00
Instead of looking elsewhere, it is better to come here together
9056d48775 Fixed: 12095 2022-11-16 18:16:45 +08:00
Godfrey M
9fefdea9de fixes checkout to all description 2022-11-15 12:50:46 -08:00
snipe
da0efaa278 Add @fernando-almeida as a contributor 2022-11-15 17:56:19 +00:00
snipe
69bde0443e Add @lukasfehling as a contributor 2022-11-15 17:56:01 +00:00
snipe
6400bdc266 Merge pull request #12120 from snipe/features/added_deleted_filter_to_search_by_tag
Added ability to include deleted items in tag search endpoint
2022-11-15 17:54:34 +00:00
snipe
ffd252a00c Merge pull request #12119 from lukasfehling/feature/added-endpoint-for-user-notification
Added: API endpoint to trigger a user email notification with their assigned assets
2022-11-15 17:51:15 +00:00
snipe
7fcf6f2463 Removed deleted parameter
Signed-off-by: snipe <snipe@snipe.net>
2022-11-15 17:47:21 +00:00
snipe
5103f28598 Merge pull request #12121 from snipe/fixes/safer_file_existance_checking_for_model_files
Replace error suppression with better logic
2022-11-15 17:43:39 +00:00
snipe
60d7128a5e Replace error suppression with better logic
Signed-off-by: snipe <snipe@snipe.net>
2022-11-15 17:41:57 +00:00
snipe
2c5a0d370c Clean up API byserial and bytag, allow deleted param
Signed-off-by: snipe <snipe@snipe.net>
2022-11-15 17:33:56 +00:00
snipe
bcbe517446 Added ability to include deleted items in tag search endpoint
Signed-off-by: snipe <snipe@snipe.net>
2022-11-15 17:18:09 +00:00
lukasfehling
d9a9bd1c0d Added a api endpoint for sending email notifications to users with their assigned assets 2022-11-15 18:17:51 +01:00
snipe
2166fcec41 Merge pull request #12118 from snipe/features/adds_asset_tag_and_serial_to_api
Allow searching firectly for asset tag and serial
2022-11-15 17:16:17 +00:00
snipe
9a5d431962 Allow searching firectly for asset tag and serial
Signed-off-by: snipe <snipe@snipe.net>
2022-11-15 17:13:26 +00:00
snipe
6dc0846f38 Merge pull request #12117 from snipe/fixes/pr_12106_missing_slash_for_stdClass
Fixes PR #12106 missing slash for std class
2022-11-15 17:04:58 +00:00
snipe
50431c046f Fixed missing slash in stdClass
Signed-off-by: snipe <snipe@snipe.net>
2022-11-15 17:04:06 +00:00
Ivan Nieto Vivanco
f0ecab7bb1 Fix typo in variable (ah-hyuck!) 2022-11-15 11:00:40 -06:00
Ivan Nieto Vivanco
7cc8b39863 Checks if settings let URL's be shown in email notifications 2022-11-15 10:55:54 -06:00
snipe
ae259f36ae Merge pull request #12106 from fernando-almeida/develop
Fix HTTP AssetTransformer to generate an empty object for missing custom fields
2022-11-15 15:54:43 +00:00
Ivan Nieto Vivanco
cd2997b674 Determine if email_logo or logo setting needs to be used in the Forgot Password email 2022-11-15 08:08:26 -06:00
snipe
8122236944 Merge pull request #12096 from snipe/features/add_custom_field_option_to_view_assets
Added custom field option to view assets
2022-11-14 22:45:26 +00:00
snipe
56c4fa7c27 Override display settings if field is encrypted
Signed-off-by: snipe <snipe@snipe.net>
2022-11-14 22:41:31 +00:00
snipe
602c2698d2 Fixed broken table header tag
Signed-off-by: snipe <snipe@snipe.net>
2022-11-14 22:06:23 +00:00
snipe
ff0b68724f Merge pull request #12107 from snipe/fixes/500_on_missing_model_file
Fixed 500 error if model files are missing
2022-11-14 22:04:31 +00:00
snipe
d4ac7530b6 Removed download button for files that don’t exist on the server
Signed-off-by: snipe <snipe@snipe.net>
2022-11-14 22:04:06 +00:00
snipe
4aded5e117 FIxed 500 error if model files are missing
Signed-off-by: snipe <snipe@snipe.net>
2022-11-14 22:01:33 +00:00
snipe
15da39d44a Merge pull request #12105 from snipe/fixes/500_on_missing_license_files
Fixed 500 on missing license files
2022-11-14 17:44:16 +00:00
snipe
077d343f01 Prevent 500 if license file is missing
Signed-off-by: snipe <snipe@snipe.net>
2022-11-14 17:42:40 +00:00
Fernando Almeida
47ee2a8153 Fix HTTP AssetTransformer to generate an empty object for missing custom_fields instead of an empty array. 2022-11-14 16:31:08 +00:00
snipe
ae95ee49f1 Hide the option if the field is encrypted
Signed-off-by: snipe <snipe@snipe.net>
2022-11-10 17:56:50 +00:00
snipe
2ac558494d Set column width instead of letting BS tables guess
Signed-off-by: snipe <snipe@snipe.net>
2022-11-10 17:21:07 +00:00
snipe
ede16ad2c2 Removed unused block
Signed-off-by: snipe <snipe@snipe.net>
2022-11-10 17:19:35 +00:00
snipe
1e34398c99 Permissions check on the field itself
Signed-off-by: snipe <snipe@snipe.net>
2022-11-10 17:19:12 +00:00
snipe
7a5fcfb87a Loop through fields array
Signed-off-by: snipe <snipe@snipe.net>
2022-11-10 16:46:59 +00:00
snipe
1fa624420e Removed unneeded relationships
Signed-off-by: snipe <snipe@snipe.net>
2022-11-10 16:46:49 +00:00
snipe
6a9131e771 Merge pull request #12088 from uberbrady/minimal_scim_upgrade
Added new SCIM env vars; and upgraded SCIM library
2022-11-09 19:30:50 +00:00
Brady Wetherington
383bd6bb45 Add new SCIM env vars; upgrade SCIM library 2022-11-09 19:08:15 +00:00
snipe
097821b818 Slight revamping of column layouts and also added new general.display_in_user_view column
Signed-off-by: snipe <snipe@snipe.net>
2022-11-08 15:28:19 +00:00
snipe
2e56c9b521 Added new general.display_in_user_view field to form
Signed-off-by: snipe <snipe@snipe.net>
2022-11-08 15:27:59 +00:00
snipe
b95d24b5eb Additional translations
Signed-off-by: snipe <snipe@snipe.net>
2022-11-08 15:27:44 +00:00
snipe
f91e1d58ad Migration to add the field to the custom_fields table
Signed-off-by: snipe <snipe@snipe.net>
2022-11-08 15:27:34 +00:00
snipe
7c37c70164 Added new field to allowed_fields so that the API can change them if needed
Signed-off-by: snipe <snipe@snipe.net>
2022-11-08 15:27:22 +00:00
snipe
52dc5aa4ba Added field to controller and tranformer
Signed-off-by: snipe <snipe@snipe.net>
2022-11-08 15:26:59 +00:00
snipe
7c21158680 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-11-03 14:18:13 -07:00
snipe
b1fa50cde2 Merge pull request #12067 from snipe/fixes/modelfile_image_path
Fixed model file image path/variable
2022-11-03 14:13:54 -07:00
snipe
236684ec92 Fixed model file image path/variable
Signed-off-by: snipe <snipe@snipe.net>
2022-11-03 14:12:49 -07:00
snipe
53499b1e29 Merge pull request #12066 from snipe/fixes/small_uploads_fixes
Fixed - small uploads fixes
2022-11-03 14:08:52 -07:00
snipe
04b6f023ae Use new upload string
Signed-off-by: snipe <snipe@snipe.net>
2022-11-03 13:57:50 -07:00
snipe
3c7d63c060 Disallow uploads if app is locked
Signed-off-by: snipe <snipe@snipe.net>
2022-11-03 13:52:23 -07:00
snipe
7cb1ca8754 Fixed image path to show preview
Signed-off-by: snipe <snipe@snipe.net>
2022-11-03 13:51:48 -07:00
snipe
6d5ace0458 Merge pull request #12049 from uberbrady/improve_scim_externalid_support
Fixed writes to the `externalId` from SCIM
2022-11-02 15:43:55 -07:00
snipe
6f14355cbc Merge pull request #12060 from snipe/features/added_accessories_file_uploads
Added accessories file uploads
2022-11-01 19:51:38 -07:00
snipe
eb81c290dc Accessory file upload
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:50:39 -07:00
snipe
2f9e097854 Merge pull request #12059 from snipe/fixes/consumables_files_translations
Use the generic file uploads strings
2022-11-01 19:32:35 -07:00
snipe
97aeb1fcec Use the generic file uploads strings
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:31:23 -07:00
snipe
e6d259bac0 Merge pull request #12058 from snipe/features/added_uploads_to_components
Added uploads to components
2022-11-01 19:30:17 -07:00
snipe
8887d40b86 Added gitignore
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:29:21 -07:00
snipe
3d8e0b707e Fixed component file route controller names
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:29:13 -07:00
snipe
71a7176a6e Updated component blade
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:28:57 -07:00
snipe
def89bfa0c Added some generic file translations
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:28:49 -07:00
snipe
f1cb7ee410 Fixed some translations
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:28:39 -07:00
snipe
84c0f50266 Added ComponentFilesController
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:10:04 -07:00
snipe
f51b312843 Added component routes for uploads
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:09:51 -07:00
snipe
3d3a4b02fc Added helper method for uploads
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:09:34 -07:00
snipe
276f534ded Updated permissions
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:09:21 -07:00
snipe
1d47d9e52b Merge pull request #12057 from snipe/features/add_uploads_to_components
Added uploads to components
2022-11-01 19:07:42 -07:00
snipe
2106b64da6 Fixed some layout issues
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 19:06:49 -07:00
snipe
fa79a6c15f Skip storage:: facade on missing images
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 18:19:13 -07:00
snipe
761da534f3 Updated consumables UI to allow uploads and display files
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 17:53:08 -07:00
snipe
b362951c95 Added consumables permissions
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 17:52:45 -07:00
snipe
25f69a7bd2 Added consumable methods for uploads
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 17:52:28 -07:00
snipe
f6a6478804 Added consumable uploads gitignore
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 17:52:04 -07:00
snipe
3282702c73 Added consumables upload routes
Signed-off-by: snipe <snipe@snipe.net>
2022-11-01 17:51:53 -07:00
Brady Wetherington
4e5c878b73 Needed to fix the way we write externalId from SCIM 2022-10-31 19:15:08 -07:00
snipe
a930661150 Check for valid category
Signed-off-by: snipe <snipe@snipe.net>
2022-10-31 12:16:39 -07:00
snipe
7cb4740359 Merge pull request #11766 from snipe/fixes/wtf_method_names_derp
Fixed (?) method name?
2022-10-26 17:39:11 -07:00
snipe
d0b9e956df Merge pull request #12042 from snipe/fixes/added_missing_hashed_password_string
Corrected string for invalid current password
2022-10-26 12:20:35 -07:00
snipe
c1eee2cc72 Corrected string for invalid current password
Signed-off-by: snipe <snipe@snipe.net>
2022-10-26 12:18:29 -07:00
snipe
73f30c0a41 Merge pull request #12041 from snipe/features/reflect_status_label_color_in_sidenav
Fixed #12009 - Added ability to reflect color in sidenav if one is given
2022-10-26 10:58:19 -07:00
snipe
c233d7fb1c Removed extra spaces
Signed-off-by: snipe <snipe@snipe.net>
2022-10-26 10:51:06 -07:00
snipe
dea0fcefbd Reflect color in sidenav if one is given
Signed-off-by: snipe <snipe@snipe.net>
2022-10-26 10:48:42 -07:00
snipe
476a5cbc02 Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2022-10-26 09:49:50 -07:00
snipe
73f61ce032 Merge pull request #12040 from snipe/fixes/locations_asset_count
Renamed column back to assets_count for legacy
2022-10-26 09:43:01 -07:00
snipe
12c7223bcd Renamed column back to assets_count for legacy
Signed-off-by: snipe <snipe@snipe.net>
2022-10-26 09:39:03 -07:00
snipe
b7efb58733 Merge pull request #12038 from snipe/fixes/clear_expected_checkin_on_checkin_action
Added - set `expected_checkin` to `null` on user bulk checkin and delete
2022-10-26 00:56:43 -07:00
snipe
28b0d8cf0f Null expected_checkin on user bulk checkin and delete
Signed-off-by: snipe <snipe@snipe.net>
2022-10-26 00:54:37 -07:00
snipe
0bc0a116aa Merge pull request #12035 from snipe/features/added_new_tab_to_locations
Features/added new tab to locations
2022-10-26 00:32:07 -07:00
snipe
e670ffe349 Added Assets Assigned to tab
Signed-off-by: snipe <snipe@snipe.net>
2022-10-26 00:16:06 -07:00
snipe
a94f1c4a64 Cleaned up and added comments
Signed-off-by: snipe <snipe@snipe.net>
2022-10-26 00:15:52 -07:00
snipe
b503b672ba Merge pull request #11951 from Godmartinz/AccessKey_shortcuts
adds shortcuts for listing, creating, and saving
2022-10-25 15:53:57 -07:00
snipe
bc023a2566 Add @eltociear as a contributor 2022-10-25 15:46:07 -07:00
snipe
2f7e22be1e Fixed all-contributors type
Signed-off-by: snipe <snipe@snipe.net>
2022-10-25 15:46:07 -07:00
snipe
9409965239 Merge pull request #11928 from eltociear/patch-1
Fix typo in Dockerfile.fpm-alpine
2022-10-25 15:45:42 -07:00
snipe
f54c92ade2 Merge pull request #12028 from StarlessNights/feature/add-memcached-php-extensions-to-docker-images
Fixed #12027: Add memcached php extensions to docker images
2022-10-25 15:42:15 -07:00
snipe
9e08936cbc Merge pull request #12030 from uberbrady/scim_externalid_support
Added externalId support to SCIM integration
2022-10-25 14:51:52 -07:00
Brady Wetherington
cd385e0865 Set scim_externalid to nullable, default null 2022-10-25 14:38:19 -07:00
Brady Wetherington
1e3281c76c Add externalId support to SCIM integration 2022-10-25 14:19:01 -07:00
Iisakki Jaakkola
af4d62759f Added php memcached extension to docker Alpine image. 2022-10-25 16:16:25 +03:00
Iisakki Jaakkola
9452973845 Added php memcached extension to the docker image. 2022-10-25 16:16:25 +03:00
snipe
3b16157d6b Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2022-10-21 17:43:53 -07:00
snipe
ae430959a4 Merge pull request #12015 from snipe/fixes/revert_processing_button
Changed button icon for importer
2022-10-21 17:00:22 -07:00
snipe
85a85082b7 Changed button icon for importer
Signed-off-by: snipe <snipe@snipe.net>
2022-10-21 16:59:19 -07:00
snipe
5acb493efd Merge pull request #12008 from snipe/features/add_default_loc_to_location_view
Added default tab to locations
2022-10-21 16:43:24 -07:00
snipe
515b14a001 Updated JS to better handle input IDs
Signed-off-by: snipe <snipe@snipe.net>
2022-10-20 19:21:09 -07:00
snipe
4eed2baa31 Added default tab to locations
Signed-off-by: snipe <snipe@snipe.net>
2022-10-20 19:06:58 -07:00
snipe
453f2c3b0e Merge pull request #12006 from uberbrady/ldap_manager_cache
Added cache manager lookups in LDAP for performance boost
2022-10-20 17:06:23 -07:00
Brady Wetherington
bc78d341a0 Caches manager lookups in LDAP for performance boost 2022-10-20 16:52:40 -07:00
snipe
edf191b724 Merge pull request #11995 from uberbrady/ldap_manager_fix
Fixed: Okta LDAP Manager Attribute - Try to better-handle LDAP Manager settings
2022-10-19 19:04:10 -07:00
Brady Wetherington
12d86bd6e2 Erroneous line-break removal - re-add 2022-10-19 19:01:52 -07:00
Brady Wetherington
c4f11de90d Remove incorrect comment. 2022-10-19 18:49:19 -07:00
Brady Wetherington
8fb61cf5f8 Try to better handle LDAP Manager settings that don't line up with what we expect 2022-10-19 18:36:16 -07:00
snipe
23e613f903 Fixed kit parse error on model edit
Signed-off-by: snipe <snipe@snipe.net>
2022-10-18 15:00:33 -07:00
snipe
f1c82ca732 Merge pull request #11988 from snipe/fixes/wrong_icons_for_mobile_location_view
Fixed wrong icons for mobile view for locations listing
2022-10-17 20:14:01 -07:00
snipe
2543fa6b98 Fixed user icon for tab
Signed-off-by: snipe <snipe@snipe.net>
2022-10-17 20:04:42 -07:00
snipe
7c34652da0 Fixed incorrect icons for mobile view on location tabs
Signed-off-by: snipe <snipe@snipe.net>
2022-10-17 20:02:27 -07:00
snipe
1ec303931a Merge pull request #11986 from Godmartinz/FD31357_depreciation
Fixes the calc of months and fixes typo of the word depreciation
2022-10-17 14:44:46 -07:00
Godfrey M
d359bcb88d adds proper spacing 2022-10-17 13:15:10 -07:00
Godfrey M
28059c878a gets the proper amount of months and fixes typo of the word depreciation 2022-10-17 11:16:29 -07:00
snipe
b7bcfaccc9 Merge pull request #11834 from uberbrady/try_catch_notifications
try/catch wrap notifications on checkin/checkout
2022-10-13 14:20:22 -07:00
snipe
0303df4b25 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-10-13 13:19:51 -07:00
snipe
8c6aaec9ce Merge pull request #11971 from snipe/localization/new_translations
Added new translations
2022-10-13 13:06:16 -07:00
snipe
fb228d6ded Updated strings
Signed-off-by: snipe <snipe@snipe.net>
2022-10-13 12:57:10 -07:00
snipe
1360ce90a5 Updated strings
Signed-off-by: snipe <snipe@snipe.net>
2022-10-13 12:52:45 -07:00
snipe
3549afe157 Added strings
Signed-off-by: snipe <snipe@snipe.net>
2022-10-13 12:43:24 -07:00
snipe
cfb780b20b Remove unused files
Signed-off-by: snipe <snipe@snipe.net>
2022-10-13 12:39:10 -07:00
snipe
eb9f17122e Updated strings
Signed-off-by: snipe <snipe@snipe.net>
2022-10-13 12:21:09 -07:00
snipe
2ef45afb2b Removed extraneous files
Signed-off-by: snipe <snipe@snipe.net>
2022-10-13 12:18:57 -07:00
snipe
ecc6bd8a24 Updated dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-10-12 16:24:31 -07:00
snipe
80279a95ae Merge pull request #11964 from snipe/fixes/audit_admin_presenting
Use admin ID for audit log notification
2022-10-12 16:00:50 -07:00
snipe
ac055c01dc Use admin ID for audit log notification
Signed-off-by: snipe <snipe@snipe.net>
2022-10-12 15:59:43 -07:00
snipe
5ff72420a6 Set branch back to develop
I hads to switch branches because the automated GH action script always targets masterb

Signed-off-by: snipe <snipe@snipe.net>
2022-10-12 11:00:06 -07:00
snipe
55b33c1042 Merge pull request #11944 from snipe/dependabot/github_actions/actions/checkout-3.1.0
Bump actions/checkout from 2 to 3.1.0
2022-10-12 10:59:21 -07:00
snipe
a499a92bb7 Added @nh314 as a contributor
Signed-off-by: snipe <snipe@snipe.net>
2022-10-12 10:57:50 -07:00
snipe
e7ae7742b0 Merge pull request #11949 from nh314/Remove-required-mark
Remove required mark
2022-10-12 10:55:49 -07:00
snipe
98f2e0271b Merge pull request #11942 from nh314/develop
Correct comparison logic
2022-10-12 10:55:29 -07:00
snipe
cd43fc50fb Merge pull request #11960 from snipe/fixes/better_validation_for_ldap_filter
Sets nullable attribute on validation
2022-10-12 10:53:08 -07:00
snipe
06803092c5 Merge pull request #11952 from snipe/features/clearer_activated_helptext
Added clearer LDAP activated helptext
2022-10-12 10:52:56 -07:00
snipe
0312ecf09d Sets nullable attribute on validation
Signed-off-by: snipe <snipe@snipe.net>
2022-10-12 10:30:47 -07:00
snipe
3f105cd3b2 Merge pull request #11959 from inietov/fixes/depreciation_date
Fixed Depreciation date diff readable precision
2022-10-12 10:21:37 -07:00
Ivan Nieto Vivanco
ab0c5bcd9d Add precision parameter to the diffForHumans() Carbon function to report 2022-10-12 12:16:13 -05:00
snipe
5ba01728d9 More text tweaking
Signed-off-by: snipe <snipe@snipe.net>
2022-10-11 12:51:25 -07:00
snipe
ae0eb378e4 Additional clarification
Signed-off-by: snipe <snipe@snipe.net>
2022-10-11 12:43:54 -07:00
snipe
ad8a2387f0 Updated help text to be more clear
Signed-off-by: snipe <snipe@snipe.net>
2022-10-11 12:38:37 -07:00
Godfrey M
4fa01350c3 adds shortcuts for listing, creating, and saving 2022-10-11 12:00:15 -07:00
Phan Nguyen
d3161fad02 Remove required mark
Because it actually not required by model.
2022-10-11 15:49:56 +07:00
dependabot[bot]
36eb51b52f Bump actions/checkout from 2 to 3.1.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3.1.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 08:36:34 +00:00
Phan Nguyen
8ff109e9da Correct comparison logic
Comparison operator should be greater than or equal
2022-10-08 12:54:15 +07:00
snipe
15da3b831d Merge pull request #11937 from Godmartinz/gh11868_sidebar_unclickable
Fixes the margin top adjustment for desktop
2022-10-06 10:43:27 -07:00
Godfrey M
0c6441ebed removes the margin top adjustment for desktop 2022-10-06 10:35:28 -07:00
snipe
fbfc9d123c Merge remote-tracking branch 'origin/develop' 2022-10-06 09:26:07 -07:00
snipe
cd942196cc Merge pull request #11933 from inietov/fixes/500_creating_new_user_undefined_variable_item
Fixed Error 500 undefined variable item creating a new user.
2022-10-06 09:07:18 -07:00
Ivan Nieto Vivanco
f1edbc9810 Send item variable that the datepicker needs 2022-10-06 09:15:00 -05:00
Ikko Ashimine
66e64cb136 Fix typo in Dockerfile.fpm-alpine
enviroment -> environment
2022-10-06 11:53:13 +09:00
snipe
1ef3eb94db Merge remote-tracking branch 'origin/develop' 2022-10-05 17:55:33 -07:00
snipe
25e4b7d59d Merge pull request #11927 from uberbrady/use_improved_scim
Use the new scim-trace feature from our fork of laravel-scim-server lib
2022-10-05 17:53:20 -07:00
Brady Wetherington
9605dec22a Use the new scim-trace feature from our fork of laravel-scim-server lib 2022-10-05 17:43:59 -07:00
snipe
ca937667b4 Indented divs per @uberbrady
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 17:21:39 -07:00
snipe
e9c61903f1 Merge pull request #11926 from snipe/features/add_start_and_term_dates_to_users
Added start and end dates to users
2022-10-05 17:20:37 -07:00
snipe
14b7319b63 Added start/end to sortable columns
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 17:07:07 -07:00
snipe
9d641573b5 Make the APU return null instead of blank
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 17:01:04 -07:00
snipe
3605aa8f5a Added clear button to generic datepicker and made it wider
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 16:59:06 -07:00
snipe
0817308822 Added start/end to edit/view screens
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 16:58:49 -07:00
snipe
bdfac1a345 Added start/end to the users API
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 16:58:37 -07:00
snipe
f7a9be92ca Store data for start and end
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 16:58:26 -07:00
snipe
56ba8a7e24 Added API select fields and filters
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 16:58:16 -07:00
snipe
cf62761d18 Added date casting and fillable to models
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 16:57:59 -07:00
snipe
d23e178c62 Adde language strings
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 16:56:10 -07:00
snipe
7353ecd388 Added start_date and end_date migration to users table
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 16:55:59 -07:00
snipe
18663c2599 Merge pull request #11925 from inietov/fixes/checkbox_customfields_comma_issues
Fixed #11710 - Validation of checkbox data with multiple values
2022-10-05 16:48:32 -07:00
Ivan Nieto Vivanco
5b8e0b3af1 Use a regex (gulp) to admit ',' (comma) and ', '(comma plus space) as customfields checkbox value delimiter 2022-10-05 18:40:07 -05:00
snipe
dab83091d2 Merge remote-tracking branch 'origin/develop' 2022-10-05 12:12:27 -07:00
snipe
4c0be7ec98 Merge pull request #11924 from snipe/features/autoglossonym_locales
Added autoglossonyms for locales and translations for countries
2022-10-05 12:09:29 -07:00
snipe
018f71a157 Switched to translations for better autoglossonym support
Signed-off-by: snipe <snipe@snipe.net>
2022-10-05 11:46:42 -07:00
snipe
9f03f0f6f6 Updated link
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 23:39:47 -07:00
snipe
da40c0ad48 Dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 18:09:18 -07:00
snipe
c70c8ce856 Merge pull request #11916 from Godmartinz/gh11868_sidebar_unclickable
fixes mobile views and clickability of sidebar menu
2022-10-04 18:07:02 -07:00
snipe
fe49ac79d1 Updated all contributors
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 18:06:09 -07:00
snipe
687a764fc1 Dev to master in version.php
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 17:53:16 -07:00
snipe
81be84568e Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 17:52:24 -07:00
snipe
61fa0bda4d Merge pull request #11917 from snipe/updates/updated_language_strings
Updated lnaguage strings
2022-10-04 17:49:27 -07:00
snipe
81d2a3acda Updated lnaguage strings
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 17:48:43 -07:00
snipe
931d81d825 Merge pull request #11908 from snipe/features/nicer_view_assets_ui_for_regular_users
Overhaul of UI for unprivileged users
2022-10-04 16:41:44 -07:00
snipe
bcebc1e33b Stylistic refactoring
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 16:37:33 -07:00
snipe
ba0483b33e Phrasing!
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 16:21:10 -07:00
snipe
97b9f96030 Added nag alert for unaccepted assets
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 16:16:21 -07:00
snipe
891b5b2882 Added routes, language
Signed-off-by: snipe <snipe@snipe.net>
2022-10-04 15:45:25 -07:00
Godfrey M
e21660ae05 off by a pixel 2022-10-04 12:11:37 -07:00
Godfrey M
53392d6069 fixes mobile views and clickability of sidebar menu 2022-10-04 12:01:13 -07:00
snipe
3469e49470 First UI overhaul
Signed-off-by: snipe <snipe@snipe.net>
2022-10-03 21:28:22 -07:00
snipe
e9224f094e Merge pull request #11906 from inietov/fixes/server_error_downloading_unaccepted_assets
Fixed error 500 when downloading asset acceptance report. [sc-19555]
2022-10-03 16:40:28 -07:00
Ivan Nieto Vivanco
25c10c3819 Filter non-asset items from download unaccepted assets report 2022-10-03 18:12:30 -05:00
snipe
b9419c7454 Merge pull request #11901 from snipe/security/escape_formats_in_csv
Use `EscapeFormula()` in CSV export
2022-09-30 11:59:11 -07:00
snipe
b07c4caa37 Extra whitespace
Signed-off-by: snipe <snipe@snipe.net>
2022-09-30 11:47:27 -07:00
snipe
aa52bc6c6a Added Vautia
Signed-off-by: snipe <snipe@snipe.net>
2022-09-30 11:47:20 -07:00
snipe
5a7e35c0e8 Made a conditional escape according to .env
Signed-off-by: snipe <snipe@snipe.net>
2022-09-30 09:48:43 -07:00
snipe
bae200edd7 Use EscapeFormula() in CSV export
Signed-off-by: snipe <snipe@snipe.net>
2022-09-30 09:29:17 -07:00
snipe
2fd197c2db Merge pull request #11896 from snipe/fixes/500_on_depreciation
Fixed depreciation API call
2022-09-29 17:09:39 -07:00
snipe
36484d50ef Fixed depreciation API call
Signed-off-by: snipe <snipe@snipe.net>
2022-09-29 17:07:42 -07:00
snipe
2b7c8cf82b Merge pull request #11895 from uberbrady/switch_dashboard_piechart_to_percent
Modified dashboard tooltips to add percentage as well as count
2022-09-29 14:11:16 -07:00
Brady Wetherington
0424308863 Modified dashboard tooltips to add percentage as well as count 2022-09-29 13:46:56 -07:00
snipe
78580136f6 Merge pull request #11894 from uberbrady/improve_piechart_labels_legends
Added counts to Dashboard Pie Chart legends and tooltips
2022-09-29 13:27:28 -07:00
Brady Wetherington
420c216973 Added counts to Dashboard Pie Chart legends and tooltips 2022-09-29 13:20:58 -07:00
snipe
9c6fa18454 Merge pull request #11893 from snipe/features/switch_dash_pie_to_status_type
Fixed #11521 - Add option to switch to using status meta from status label name
2022-09-29 13:02:28 -07:00
snipe
70c766e8b3 Added setting to choose dashboard type
Signed-off-by: snipe <snipe@snipe.net>
2022-09-29 04:16:46 -07:00
snipe
0b2ce7be07 Fixed #11521 - switch to using status meta from status label name
Signed-off-by: snipe <snipe@snipe.net>
2022-09-29 03:48:58 -07:00
snipe
3d48dd19cb Merge pull request #11890 from snipe/fixes/statuslabels_assetlist
Fixed #11889 - API route for status labels asset listing
2022-09-29 00:51:25 -07:00
snipe
08bab4f101 Fixed #11889 - API route for status labels asset listing
Signed-off-by: snipe <snipe@snipe.net>
2022-09-29 00:50:07 -07:00
snipe
95b49f8deb Merge pull request #11886 from sunflowerbofh/tmp-replace-patchwork-utf8
Tmp replace patchwork utf8
2022-09-28 10:32:07 -07:00
Katharina Drexel
4f5d536e32 Fixed: #11871 Replacing (deprecated) patchwork/utf8 by polyfill/mbstring. 2022-09-28 14:52:02 +02:00
snipe
9dbc5070f8 Remove phplint (for now)
Signed-off-by: snipe <snipe@snipe.net>
2022-09-27 16:47:09 -07:00
snipe
055a2f827f Merge pull request #11872 from sunflowerbofh/tmp-replace-patchwork-utf8
Fixed #11871 Replacing (deprecated) patchwork/utf8 by polyfill/mbstring.
2022-09-27 16:46:12 -07:00
snipe
8d3fe423e1 Merge pull request #11671 from chartjes/ch-fix-tests
Fixed unit test suite that was not running, added working browser test
2022-09-27 16:20:56 -07:00
snipe
1377725a97 Dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-09-27 14:53:47 -07:00
snipe
58ccfe9226 Updated prod assets
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	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
2022-09-27 14:51:19 -07:00
snipe
05ac9f4a68 Updated dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-09-27 14:47:54 -07:00
snipe
0889cd61cf Updated skins
Signed-off-by: snipe <snipe@snipe.net>
2022-09-27 14:47:09 -07:00
snipe
8168ca4074 Merge pull request #11853 from Godmartinz/ldap_test_results_color
Fixes the color choice for the ldap_test_results
2022-09-27 14:46:46 -07:00
snipe
de399a9f8f Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/dist/all.css
#	public/js/build/app.js
#	public/js/dist/all.js
#	public/mix-manifest.json
2022-09-27 14:46:30 -07:00
snipe
af150f0192 Add @BasO12 as a contributor 2022-09-27 14:44:32 -07:00
snipe
c194c8a0c8 Merge pull request #11764 from BasO12/master
Added notes to audit mail notification
2022-09-27 14:43:50 -07:00
snipe
a7b83fc531 Merge pull request #11854 from inietov/fixes/location_issue_during_import
Fixed #11847 404 error during Import if a checkout type of location is specified and no checkout location is passed
2022-09-27 14:34:26 -07:00
snipe
ef22da622d Merge pull request #11870 from snipe/dependabot/github_actions/codacy/codacy-analysis-cli-action-4.2.0
Bump codacy/codacy-analysis-cli-action from 4.1.0 to 4.2.0
2022-09-27 14:33:53 -07:00
dependabot[bot]
8443796cbe Bump codacy/codacy-analysis-cli-action from 4.1.0 to 4.2.0
Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases)
- [Commits](https://github.com/codacy/codacy-analysis-cli-action/compare/v4.1.0...v4.2.0)

---
updated-dependencies:
- dependency-name: codacy/codacy-analysis-cli-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-27 21:33:19 +00:00
snipe
ac996a771c Merge pull request #11882 from snipe/security/upgraded_fontawesome
Upgraded fontawesome
2022-09-27 14:27:22 -07:00
snipe
942eaac2ee Upgraded fontawesome
Signed-off-by: snipe <snipe@snipe.net>
2022-09-27 14:25:44 -07:00
snipe
ada2a2cd43 Merge pull request #11878 from inietov/fixes/asset_importer_duplicate_fields
Delete duplicate fields from the importer dropdown menu [sc-19547]
2022-09-27 14:21:30 -07:00
Ivan Nieto Vivanco
06ba9356ca Delete another set of duplicates 2022-09-26 18:57:35 -05:00
Ivan Nieto Vivanco
e034f7b674 Delete another duplicate that somehow has survived 2022-09-26 18:56:24 -05:00
Ivan Nieto Vivanco
4d14243f57 Delete duplicate fields from the importer dropdown menu 2022-09-26 18:51:13 -05:00
snipe
88a371082d Merge remote-tracking branch 'origin/develop' 2022-09-26 16:29:21 -07:00
snipe
ee7e26ae8d Merge pull request #11877 from snipe/features/use_built_in_clear_on_datepicker
Use BS datepicker’s built in clear button
2022-09-26 16:23:27 -07:00
snipe
9d93c72534 Use BS datepicker’s built in clear button
Signed-off-by: snipe <snipe@snipe.net>
2022-09-26 14:34:35 -07:00
snipe
44b72e0f5f Merge remote-tracking branch 'origin/develop' 2022-09-26 13:49:48 -07:00
snipe
d91d226652 Merge pull request #11857 from inietov/fixes/throw_exception_instead_of_redirect_when_no_available_licenseseats
Fixed #11827 Throw exception when there are no available seats for checkout.
2022-09-26 13:43:57 -07:00
snipe
091ef62cbe Merge pull request #11856 from inietov/fixes/purchase_date_not_nullable
Fixed Purchase date "readonly" value makes purchase date unable to be nulled in update form [sc-19540]
2022-09-26 13:38:24 -07:00
Katharina Drexel
8316a4eb92 Fixed: #11871 Replacing (deprecated) patchwork/utf8 by polyfill/mbstring. 2022-09-26 12:06:06 +02:00
snipe
b4518677bd Merge pull request #11762 from geo-chen/master
correcting default mysql port from 3309 to 3306
2022-09-22 15:12:11 -07:00
Ivan Nieto Vivanco
23cf556a8b Adds cursor:pointer to indicate a clickable link 2022-09-20 22:24:52 -05:00
Ivan Nieto Vivanco
c0f83a7927 Delete not necessary conditional 2022-09-20 19:02:01 -05:00
Ivan Nieto Vivanco
5a1062f0f4 Delete debugging symbols (just kidding, it's just a dd() function) 2022-09-20 18:58:31 -05:00
Ivan Nieto Vivanco
c32676596c Redirect correctly if not enough license seats exists to be checkout 2022-09-20 18:55:53 -05:00
Ivan Nieto Vivanco
f75917d34d Add a link used to clear the purchase date input 2022-09-20 17:53:55 -05:00
Godfrey M
c55f2d5417 corrects color for query and results of ldap sync test 2022-09-20 10:35:55 -07:00
Ivan Nieto Vivanco
e267f5491a Adds a check for empty location values on import 2022-09-19 19:05:48 -05:00
Godfrey M
571ce5b741 corrects the color choice for the ldap_test_results 2022-09-19 11:59:02 -07:00
snipe
733b0750a2 Merge remote-tracking branch 'origin/develop' 2022-09-16 14:20:25 -07:00
snipe
9369165007 Merge pull request #11842 from snipe/security/license_file_access
Check for `licenses.files` permissions
2022-09-16 14:19:37 -07:00
snipe
f75d348dc0 Fixed license policy method
Signed-off-by: snipe <snipe@snipe.net>
2022-09-16 14:06:46 -07:00
snipe
dcab1381e7 Check for licenses.files permissions
Signed-off-by: snipe <snipe@snipe.net>
2022-09-16 14:00:27 -07:00
snipe
0924d2144b 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
2022-09-15 21:47:14 -07:00
snipe
9cae4f1d1b Merge pull request #11838 from snipe/features/larger_checkboxes_in_lists
Larger checkbox in lists
2022-09-15 21:44:42 -07:00
snipe
ca70988879 Larger checkbox in lists
Signed-off-by: snipe <snipe@snipe.net>
2022-09-15 21:42:16 -07:00
snipe
421c9baecc # Conflicts:
Signed-off-by: snipe <snipe@snipe.net>
#	public/css/dist/all.css
#	public/css/dist/bootstrap-table.css
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
2022-09-15 20:11:07 -07:00
snipe
5c9e84f663 Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2022-09-15 20:09:00 -07:00
snipe
fbb5f1445a Merge pull request #11837 from snipe/fixes/disappearing_checkboxes
Downgraded BS Tables
2022-09-15 20:06:42 -07:00
snipe
07e0fec1de Downgraded BS Tables
Signed-off-by: snipe <snipe@snipe.net>
2022-09-15 20:05:29 -07:00
snipe
c6cbf3712e Merge remote-tracking branch 'origin/develop' 2022-09-15 16:22:47 -07:00
snipe
0f777b3168 Merge pull request #11836 from snipe/fixes/500_if_image_is_missing
Fixed 500 error if uploaded file is missing from asset view
2022-09-15 16:21:13 -07:00
snipe
62ad3fad1c Remove DL button if file doesn’t exist
Signed-off-by: snipe <snipe@snipe.net>
2022-09-15 16:11:27 -07:00
snipe
eb1e287c15 Better handle missing files
Signed-off-by: snipe <snipe@snipe.net>
2022-09-15 16:08:13 -07:00
snipe
3eab44f748 Merge pull request #11835 from snipe/fixes/depreciation_when_no_purchase_date
Fixes 500 in depreciation on asset view when no purchase date
2022-09-15 15:52:58 -07:00
snipe
1885e73704 Ignore warning icon if no purchase date
Signed-off-by: snipe <snipe@snipe.net>
2022-09-15 15:42:47 -07:00
snipe
24910433a1 Fixed 500 when depreciation is set but no purchase_date
Signed-off-by: snipe <snipe@snipe.net>
2022-09-15 15:39:47 -07:00
Brady Wetherington
1899e4d1e8 try/catch wrap notifications on checkin/checkout 2022-09-15 13:18:42 -07:00
snipe
481eb2c7f0 Merge remote-tracking branch 'origin/develop' 2022-09-15 11:40:33 -07:00
snipe
51d7f2b97b Merge pull request #11830 from inietov/fixes/default_values_for_checkboxes_unaccessible
Fixed #9801 #11199 Default Values for Checkbox Field Types Unaccessible
2022-09-15 11:28:15 -07:00
Ivan Nieto Vivanco
9b2eda2d70 Save and show the default values properly on custom fields of type checkbox 2022-09-15 11:52:49 -05:00
Ivan Nieto Vivanco
41b75704e3 Removes format when changing to custom fields elements that doesn't need it 2022-09-15 11:21:02 -05:00
Ivan Nieto Vivanco
20220764bb Add possible values for custom fields of type checkbox 2022-09-15 11:18:54 -05:00
snipe
abd2349604 Add @rnelsonee as a contributor 2022-09-14 20:08:39 -07:00
snipe
ac4f91918e Merge pull request #11771 from rnelsonee/PAT_test
Fixed #11769: PAT Test hardcoded text
2022-09-14 20:01:18 -07:00
snipe
28f0b72bcd Merge remote-tracking branch 'origin/develop' 2022-09-14 19:56:16 -07:00
snipe
ad7bc6f38a Merge pull request #11825 from snipe/features/added_applecare_lookup_link
Added Applecare lookup link if manufacturer is apple
2022-09-14 19:54:47 -07:00
snipe
72feaee6c0 Added Applecare lookup link if manufacturer is apple
Signed-off-by: snipe <snipe@snipe.net>
2022-09-14 19:43:48 -07:00
snipe
4ac3650d64 Merge remote-tracking branch 'origin/develop' 2022-09-14 18:21:40 -07:00
snipe
3877770160 Merge pull request #11824 from snipe/fixes/removed_assetlog_from_custom_report
Fixed custom asset report timeout - removed assetlog
2022-09-14 18:20:14 -07:00
snipe
3192a68b06 Pulled assetlog from custom report controller
Signed-off-by: snipe <snipe@snipe.net>
2022-09-14 18:17:52 -07:00
snipe
284b4d869f Merge pull request #11823 from Godmartinz/gh11822_depreciation_calc_off
Fixes depreciation calculations off
2022-09-14 17:39:59 -07:00
Godfrey M
6b6a079440 fixes current value and monthly depreciation on reports and calculations 2022-09-14 17:01:18 -07:00
Godfrey M
a0624fe179 reworks the depreciation formula, includes months passed instead of months remaining 2022-09-14 16:00:21 -07:00
snipe
d598f75721 Merge pull request #11811 from inietov/fixes/min_qty_not_importing_consumables
Fixed Mini quantity field values are not importing into Snipe-IT
2022-09-14 12:12:52 -07:00
Ivan Nieto Vivanco
d51eca20f0 Add min_amt field in Consumables and Accessories imports 2022-09-12 18:11:48 -05:00
snipe
9b5790b7e6 Merge pull request #11072 from snipe/fixes/support_apache_24
YOLO
2022-09-12 14:26:43 -07:00
snipe
a8a00f0a79 Updated prod JS assets
Signed-off-by: snipe <snipe@snipe.net>
2022-09-12 11:08:29 -07:00
snipe
cbd16174d8 Merge pull request #11810 from snipe/maintenance/updated_dev_assets
Updated compiled assets
2022-09-12 10:55:40 -07:00
snipe
448aefac28 Updated compiled assets
Signed-off-by: snipe <snipe@snipe.net>
2022-09-12 10:54:54 -07:00
snipe
b23cd6d4f0 Merge pull request #11808 from snipe/snyk-upgrade-390057161cf95c21d9a4b53f57207321
[Snyk] Upgrade bootstrap-table from 1.20.2 to 1.21.0
2022-09-11 16:56:22 -07:00
snyk-bot
b0ea1a31dc fix: upgrade bootstrap-table from 1.20.2 to 1.21.0
Snyk has created this PR to upgrade bootstrap-table from 1.20.2 to 1.21.0.

See this package in npm:
https://www.npmjs.com/package/bootstrap-table

See this project in Snyk:
https://app.snyk.io/org/snipe/project/3d53e1dd-b8bf-46b5-ba61-18ce26933166?utm_source=github&utm_medium=referral&page=upgrade-pr
2022-09-11 23:55:26 +00:00
snipe
11a2f96b4f Merge pull request #11806 from snipe/snyk-upgrade-390057161cf95c21d9a4b53f57207321
[Snyk] Upgrade bootstrap-table from 1.20.2 to 1.21.0
2022-09-11 01:30:34 -07:00
snyk-bot
7361977cdc fix: upgrade bootstrap-table from 1.20.2 to 1.21.0
Snyk has created this PR to upgrade bootstrap-table from 1.20.2 to 1.21.0.

See this package in npm:
https://www.npmjs.com/package/bootstrap-table

See this project in Snyk:
https://app.snyk.io/org/snipe/project/3d53e1dd-b8bf-46b5-ba61-18ce26933166?utm_source=github&utm_medium=referral&page=upgrade-pr
2022-09-10 23:32:02 +00:00
snipe
659703bd7d Merge pull request #11790 from inietov/fixes/double_login_issue_when_switching_users
Fixed Double login when switching users
2022-09-06 17:03:21 -07:00
Ivan Nieto Vivanco
3aff97ace1 Remove the previous user hashed password 2022-09-06 18:43:35 -05:00
Rick Nelson
6e82de2f47 Fixed #11769: PAT Test hardcoded text 2022-09-01 11:21:02 -04:00
snipe
ae505ef44d Literally have no idea how this ever worked
Signed-off-by: snipe <snipe@snipe.net>
2022-08-31 19:20:35 -07:00
snipe
e86e96e159 Merge pull request #11765 from snipe/fixes/colspan_for_delete_checkboxes
Increased colspan for checkboxes
2022-08-31 13:35:21 -07:00
snipe
93428e1ed4 Increased colspan for checkboxes
Signed-off-by: snipe <snipe@snipe.net>
2022-08-31 13:34:27 -07:00
BasO12
61e1650542 Add files via upload 2022-08-31 13:08:09 +02:00
BasO12
ab54ac9408 Add files via upload 2022-08-31 13:07:05 +02:00
snipe
dcbd407698 Merge pull request #11661 from inietov/fixes/notifications_asset_acceptance
Send notifications when Acceptance Assets actions occur [sc-9917]
2022-08-30 12:14:58 -07:00
geo-chen
4e7fea3468 correcting default mysql port from 3309 to 3306
installation breaks using default config and manual edits to correct the port is currently required
2022-08-30 20:40:49 +08:00
geo-chen
3ef25c3a4d correcting default mysql port from 3309 to 3306
installation breaks using default config and manual edits to correct the port is currently required
2022-08-30 20:40:35 +08:00
geo-chen
22596f4bb8 correcting default mysql port from 3309 to 3306
installation breaks using default config and manual edits to correct the port is currently required
2022-08-30 20:40:19 +08:00
geo-chen
8fdca7f42b correcting default mysql port from 3309 to 3306
installation breaks using default config and manual edits to correct the port is currently required
2022-08-30 20:40:04 +08:00
geo-chen
1f04cfdb44 correcting default mysql port from 3309 to 3306
installation breaks using default config and manual edits to correct the port is currently required
2022-08-30 20:39:50 +08:00
geo-chen
04c130e596 correcting default mysql port from 3309 to 3306
installation breaks using default config and manual edits to correct the port is currently required
2022-08-30 20:39:34 +08:00
snipe
7fa9214beb Merge pull request #11489 from Godmartinz/bug/sc-19333/expiring-assets-report-email-content-ordering
Fixed the order expiring assets are listed in notifications
2022-08-29 12:37:01 -07:00
Godfrey M
ea63049b4b removed redundancy with raw query 2022-08-29 12:33:51 -07:00
snipe
e94b5ac435 Merge pull request #11758 from snipe/security/xss_on_dashboard_note
Fixed possible XSS on dashboard note
2022-08-29 11:50:48 -07:00
snipe
9cf5f30c77 Set safeMode to true and use helper for all parsedown
Signed-off-by: snipe <snipe@snipe.net>
2022-08-29 11:26:47 -07:00
snipe
e8f2e50ada Add @dsferruzza as a contributor 2022-08-29 10:10:13 -07:00
snipe
3527902ba3 Merge pull request #11752 from dsferruzza/fixes/s3-file-size
Fixed #11742: display correct file sizes when using S3(-like) storage
2022-08-29 10:08:10 -07:00
David Sferruzza
f60ea9581d Fixed #11742: display correct file sizes when using S3(-like) storage 2022-08-28 12:07:14 +02:00
Chris Hartjes
74fe3dc733 Updated testing-related documentation 2022-08-26 13:55:12 -04:00
snipe
96ec96ff7f Merge pull request #11737 from inietov/fixes/validation_error_still_without_required_rule
Fixed Validation error when empty default customfield values
2022-08-25 17:54:04 -07:00
snipe
4fd1827576 Merge pull request #11738 from inietov/fixes/problem_checkin_and_delete_users
Fixed #11695 Problem with checkin all and delete user.
2022-08-25 17:52:51 -07:00
Ivan Nieto Vivanco
0d4e9c183b Save correct id in action log if the bulk-checkin is of type license 2022-08-25 19:16:48 -05:00
Ivan Nieto Vivanco
1ff2d15c4a Replace 'required' rule with 'nullable' to allow blank default customfields values 2022-08-25 18:16:50 -05:00
snipe
482a7b2a3a Merge pull request #11700 from inietov/fixes/unaccepted_assets_reminder_500
Fixed 500 error when sending unaccepted assets reminder
2022-08-25 14:00:00 -07:00
snipe
6f0f6c8042 Don’t prevent deletion if user has consumables checked out
Signed-off-by: snipe <snipe@snipe.net>
2022-08-25 12:51:02 -07:00
snipe
4cc9b5a5a2 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2022-08-25 12:34:38 -07:00
snipe
8720a58b51 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-08-25 12:34:02 -07:00
snipe
22710afee3 Merge remote-tracking branch 'origin/develop' 2022-08-25 12:28:06 -07:00
snipe
968f8fb554 Merge pull request #11735 from snipe/security/logout_other_devices
Fixed: Log user out of other devices when they change their password
2022-08-25 12:26:13 -07:00
snipe
6fde72a693 Log user out of other devices when they change their password
Signed-off-by: snipe <snipe@snipe.net>
2022-08-25 12:24:26 -07:00
snipe
afb7fa2e81 Merge remote-tracking branch 'origin/develop' 2022-08-24 18:12:26 -07:00
snipe
c9ef49ec65 Merge pull request #11731 from snipe/fixes/add_sig_column_to_user_history
Fixed #10593 - added signature column to user history
2022-08-24 18:08:41 -07:00
snipe
36ab794adc Added signature field to user history
Signed-off-by: snipe <snipe@snipe.net>
2022-08-24 18:05:43 -07:00
snipe
2ad9c39090 Merge pull request #11730 from inietov/fixes/importing_licenses_field_mismatch
Fixed #11679 Importing Licenses - Field Mismatch
2022-08-24 17:31:12 -07:00
Ivan Nieto Vivanco
c59fd7b8da Fix importer field mapping for command line 2022-08-24 19:20:23 -05:00
snipe
44e598b0dc Updated branch name in version
Signed-off-by: snipe <snipe@snipe.net>
2022-08-24 17:17:38 -07:00
snipe
ffd38292cf Merge pull request #11729 from uberbrady/improve_docker_assetmodels_restore
Fixed #11708 - pre-create private_storage directories for Docker restores
2022-08-24 17:16:21 -07:00
snipe
660c1429b2 Merge pull request #11728 from snipe/fixes/adds_style_to_readonly_date_fields
Added style to readonly date fields
2022-08-24 17:14:16 -07:00
Brady Wetherington
8ad5fb34d3 Fixed #11708 - pre-create private_storage directories for Docker restores 2022-08-24 17:11:21 -07:00
snipe
a5fd9ebbb1 Added style to readonly datetime picker field
Signed-off-by: snipe <snipe@snipe.net>
2022-08-24 17:10:15 -07:00
snipe
49d2aef831 Merge pull request #11726 from inietov/fixes/customfields_date_format_issue
Fixed #11709 Dates in custom fields not always stored in the correct format
2022-08-24 16:46:35 -07:00
snipe
74f5980af7 Merge pull request #11724 from inietov/fixes/remove_required_rule_for_default_custom_values
Fixed Validation error when creating custom fields' default values
2022-08-24 16:44:46 -07:00
snipe
1a47e1000d Merge pull request #11727 from snipe/security/updated_compiled_assets
Updated compiled assets
2022-08-24 16:43:08 -07:00
snipe
ab60fa08df Updated dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-08-24 16:38:11 -07:00
snipe
8a312f69a6 Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2022-08-24 16:37:22 -07:00
Ivan Nieto Vivanco
581cae94ab Add readonly property to datepickers 2022-08-24 18:21:54 -05:00
Ivan Nieto Vivanco
6e85c2e5cb Delete unused import 2022-08-24 16:30:25 -05:00
Ivan Nieto Vivanco
30d0125cbd Remove the rule 'required' for default values, if custom field is obligatory 2022-08-24 16:18:11 -05:00
snipe
e2dec5d5d7 Merge pull request #11723 from snipe/fixes/fail_with_error_when_uploaded_file_does_not_exist
Fixed crash on Asset View if file doesn’t exist on server
2022-08-24 13:50:26 -07:00
snipe
af34fc207c Suppress error output if file doesn’t exist on server
Signed-off-by: snipe <snipe@snipe.net>
2022-08-24 13:47:56 -07:00
snipe
cca531f8ca Add @sunflowerbofh as a contributor 2022-08-22 16:32:30 -07:00
snipe
45f17fea8a Merge pull request #11510 from sunflowerbofh/tmp-ldap
Fixed #11509 allow-ldap-anonymous-bind
2022-08-22 16:32:07 -07:00
snipe
3ac84eab58 Merge pull request #11651 from inietov/fixes/activity_report_search
Fixed Search in activity report for full name in relation
2022-08-22 16:23:50 -07:00
snipe
15af4ea56e Add @kylegordon as a contributor 2022-08-22 16:21:20 -07:00
snipe
d649c65508 Merge pull request #11669 from kylegordon/master
Declare DB_PORT in all .env files
2022-08-22 16:20:40 -07:00
snipe
0965ac9592 Merge pull request #11680 from snipe/snyk-upgrade-3dd3b8528a5a6c5104f99fc833e3820e
[Snyk] Upgrade @fortawesome/fontawesome-free from 6.1.1 to 6.1.2
2022-08-22 16:18:15 -07:00
snipe
bfadc69d73 Merge pull request #11681 from snipe/snyk-upgrade-ce70c2a6ece4c881ee4f6267e992332c
[Snyk] Upgrade webpack from 5.73.0 to 5.74.0
2022-08-22 16:17:53 -07:00
snipe
41be3f7208 Add @julian-piehl as a contributor 2022-08-22 16:17:24 -07:00
snipe
906a36dc1a Merge pull request #11703 from julian-piehl/fixes/wrong-trans-string
Fixed Translation String: wrong key at request canceled message
2022-08-22 16:16:10 -07:00
snipe
aba8449dc6 Merge pull request #11707 from wewhite/manager_name
Fixed #11706 Manager name
2022-08-22 16:15:52 -07:00
snipe
861283b874 Merge pull request #11712 from Godmartinz/gh11711Admin_options_disappear
Fixed #11711 clearfix missing on admin settings page  to prevent blanking divs
2022-08-22 16:15:06 -07:00
Godfrey M
2994c3613a adds clearfix to settings page 2022-08-22 10:46:15 -07:00
Warren White
ba7d6dde3f Fixed #11706: changes the display of managers username to First Last name 2022-08-19 10:17:25 -07:00
Warren White
4b9a91f55b Fixed #10565, #11086: correctly looks up Manager DN from AD Manager attribute and sets manager id 2022-08-19 09:09:03 -07:00
Peace
94bbf2bf2f fixed translation string for canceled requests 2022-08-19 13:59:01 +02:00
Ivan Nieto Vivanco
e5cc6ec972 Fixes error 500 if checkout_acceptances table have a created_at null column 2022-08-17 22:02:13 -05:00
snyk-bot
e97c526050 fix: upgrade webpack from 5.73.0 to 5.74.0
Snyk has created this PR to upgrade webpack from 5.73.0 to 5.74.0.

See this package in npm:
https://www.npmjs.com/package/webpack

See this project in Snyk:
https://app.snyk.io/org/snipe/project/3d53e1dd-b8bf-46b5-ba61-18ce26933166?utm_source=github&utm_medium=referral&page=upgrade-pr
2022-08-15 23:41:31 +00:00
snyk-bot
7b45328fcc fix: upgrade @fortawesome/fontawesome-free from 6.1.1 to 6.1.2
Snyk has created this PR to upgrade @fortawesome/fontawesome-free from 6.1.1 to 6.1.2.

See this package in npm:
https://www.npmjs.com/package/@fortawesome/fontawesome-free

See this project in Snyk:
https://app.snyk.io/org/snipe/project/3d53e1dd-b8bf-46b5-ba61-18ce26933166?utm_source=github&utm_medium=referral&page=upgrade-pr
2022-08-15 23:41:27 +00:00
snipe
40bc13a946 Merge pull request #11676 from snipe/fixes/added_category_to_model_info
Adds the category in the side info on Models > View
2022-08-14 14:03:09 -07:00
snipe
368bd5da3f Adds the category in the side info on Models > View
Signed-off-by: snipe <snipe@snipe.net>
2022-08-14 14:01:58 -07:00
snipe
1763bbfbd3 Merge pull request #11662 from octobunny/patch-1
Fixed #6899 Docker container's php configuration isn't congruent with snipe-it uploads setting size.
2022-08-14 13:46:38 -07:00
snipe
7b44afc43c Merge pull request #11666 from snipe/features/add_null_option_for_purchase_expected_dates
Added `null` option for `purchase_date` and `expected_checkin` dates
2022-08-14 13:43:03 -07:00
snipe
13b6c281df Merge pull request #11675 from snipe/revert-11663-fixes/user_cant_be_deleted_if_has_consumables
Revert "Prevent to delete a user if still has consumables associated to them"
2022-08-14 13:42:45 -07:00
snipe
5feea17f8d Revert "Prevent to delete a user if still has consumables associated to them" 2022-08-14 13:42:14 -07:00
snipe
60d1578a01 Merge pull request #11663 from inietov/fixes/user_cant_be_deleted_if_has_consumables
Prevent to delete a user if still has consumables associated to them
2022-08-14 13:41:09 -07:00
Chris Hartjes
07585809b3 Got unit and browser tests working, added documentation 2022-08-12 13:00:26 -04:00
Kyle Gordon
98a111796b Declare DB_PORT in all .env files 2022-08-12 15:07:02 +01:00
snipe
7b3be076b4 Make location field the same width
Signed-off-by: snipe <snipe@snipe.net>
2022-08-11 18:38:34 -07:00
snipe
2c68ec927a Use trans_choice for string
Signed-off-by: snipe <snipe@snipe.net>
2022-08-11 18:30:59 -07:00
snipe
a0ba33ed7c Added checkboxes
Signed-off-by: snipe <snipe@snipe.net>
2022-08-11 18:25:22 -07:00
snipe
70bb4cd746 Added translation
Signed-off-by: snipe <snipe@snipe.net>
2022-08-11 18:25:15 -07:00
snipe
91e824c5b0 Check for nullifying checkboxes
Signed-off-by: snipe <snipe@snipe.net>
2022-08-11 18:25:07 -07:00
snipe
491cdd4de6 Merge pull request #11664 from snipe/snyk-upgrade-bcc306620433a4ebeaaed8c3e4d4c9eb
[Snyk] Upgrade acorn from 8.7.1 to 8.8.0
2022-08-11 16:59:45 -07:00
snyk-bot
3454cdd2a0 fix: upgrade acorn from 8.7.1 to 8.8.0
Snyk has created this PR to upgrade acorn from 8.7.1 to 8.8.0.

See this package in npm:
https://www.npmjs.com/package/acorn

See this project in Snyk:
https://app.snyk.io/org/snipe/project/3d53e1dd-b8bf-46b5-ba61-18ce26933166?utm_source=github&utm_medium=referral&page=upgrade-pr
2022-08-11 23:58:21 +00:00
Ivan Nieto Vivanco
db53a00d3f Prevent to delete a user if still has consumables associated to them 2022-08-11 17:01:52 -05:00
octobunny
8324b94022 Change PHP post_max_size
Must change post_max_size in addition to upload_max_filesize to increase total upload size to greater than 8MB.
2022-08-11 17:07:46 -04:00
Ivan Nieto Vivanco
a33ca39237 Figure out declined notifications 2022-08-11 16:00:21 -05:00
Ivan Nieto Vivanco
98bcd82108 Add the mail recipient from configuration in the CheckoutAcceptance model 2022-08-11 15:33:18 -05:00
Ivan Nieto Vivanco
d2c486bb1e Create the mail template for the acceptance 2022-08-11 15:28:30 -05:00
snipe
8c579d693a Merge pull request #11660 from Godmartinz/departments_location_and_company_updates_with_null
Fixes Departments update/store  to allow company and/or location ids to be null
2022-08-11 13:04:45 -07:00
Godfrey M
814992eb7d allows company and location ids to be null 2022-08-11 12:47:40 -07:00
Ivan Nieto Vivanco
267997f0a6 Customize the notifications with the needed data 2022-08-11 14:01:11 -05:00
Ivan Nieto Vivanco
0172fe6403 Add Notifiable trait to the CheckoutAcceptance Model 2022-08-11 13:02:25 -05:00
Ivan Nieto Vivanco
509bbbc685 Create Notifications classes for accepted and declined and add some necesary lang strings 2022-08-11 13:01:21 -05:00
Ivan Nieto Vivanco
8cee5060af Remove unused DB statement 2022-08-10 19:16:04 -05:00
Ivan Nieto Vivanco
a7de97f060 Found a better place for the where condition 2022-08-10 19:13:28 -05:00
Ivan Nieto Vivanco
c1074000f9 Add a concat to search for full name when the relationship search in the users table 2022-08-10 18:27:28 -05:00
snipe
c7d9baad8e Merge remote-tracking branch 'origin/master' into develop 2022-08-10 16:11:29 -07:00
snipe
c77d763f05 Merge pull request #11650 from snipe/fixes/6877_add_notes_to_consumables
Fixed #6877 - Added notes to consumables, components on checkout
2022-08-10 16:11:08 -07:00
snipe
ef099aa644 Reverted notes to note since pivot
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 16:09:56 -07:00
snipe
acd666fdf5 Added notes to user consumables tab
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:34:07 -07:00
snipe
8de7e9a2ab Use route name in case the user biffs the checkout twice
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:17:52 -07:00
snipe
dd0260c3be Use old note on validation failure
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:15:29 -07:00
snipe
512348cc5a Added withInput()
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:15:09 -07:00
snipe
fb3d7bf82e Made button wider
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:07:58 -07:00
snipe
e3293151a2 Added note on checkout
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:04:59 -07:00
snipe
3ec77724d8 Added note pivot
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:04:34 -07:00
snipe
024a014298 Changed notes to note
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:04:19 -07:00
snipe
c1e5d03340 Added pivot for note
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:03:41 -07:00
snipe
fb2fe61daf Use a less stupid URL for this endpoint
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:03:26 -07:00
snipe
0d9eccb7eb Addeed note field
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 15:03:12 -07:00
snipe
f9956cc5df Added DB migration
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 14:54:33 -07:00
snipe
f7cceaedd5 Merge pull request #11649 from snipe/features/add_url_in_export
Fixed #8928 - add URL and ID to custom asset report
2022-08-10 13:58:22 -07:00
snipe
e7c47408a7 Derp
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 13:57:42 -07:00
snipe
637604dfaf Fixed #8928 - add URL and ID to custom asset report
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 13:51:47 -07:00
snipe
f66df4d468 Merge pull request #11648 from uberbrady/reimplement_active_flag
Fixed the active flag to be as it was in later v5 releases
2022-08-10 13:32:52 -07:00
Brady Wetherington
b6adfa294c Fixed the active flag to be as it was in later v5 releases
Originally implemented here:

https://github.com/snipe/snipe-it/pull/10610/files
2022-08-10 12:55:30 -07:00
snipe
f374f231d4 Added ERD link
Signed-off-by: snipe <snipe@snipe.net>
2022-08-10 11:37:17 -07:00
snipe
d4e60a46c1 Merge remote-tracking branch 'origin/develop' 2022-08-09 15:15:31 -07:00
snipe
a834ac6ec2 Merge pull request #11642 from Godmartinz/monthly_depreciation_calculation
Fixes Monthly depreciation calculation if EOL is blank
2022-08-09 15:14:57 -07:00
Godfrey M
92e6ea96b2 if eol is missing from asset model monthly depreciation will be recalculated 2022-08-09 15:05:15 -07:00
snipe
de449fd1c2 Merge pull request #11635 from exula/fix/missing_closing_div_in_general_admin_settings
Added a closing div tag around the mail text help block, this was cau…
2022-08-09 11:07:19 -07:00
Brad Coudriet
77a1fcb1fc There was actually a missing p tag too 2022-08-09 06:36:53 -04:00
Brad Coudriet
0cf0598936 Added a closing div tag around the mail text help block, this was causing labels further down the page to be formatted in correctly 2022-08-09 06:32:03 -04:00
snipe
80d91c0c51 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2022-08-08 15:33:10 -07:00
snipe
c39bf7b7e6 Added German (Informal) to select list
Signed-off-by: snipe <snipe@snipe.net>
2022-08-08 15:30:58 -07:00
snipe
9db0b038a5 Updated translation strings
Signed-off-by: snipe <snipe@snipe.net>
2022-08-08 15:29:28 -07:00
snipe
4f4c4ed5be Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-08-08 14:35:04 -07:00
snipe
51f7298720 Merge remote-tracking branch 'origin/develop' 2022-08-05 18:16:20 -07:00
snipe
bc4032c2cd Merge pull request #11617 from inietov/fixes/components_wrong_remaining_inventory
Fixed wrong calculation of assigned components
2022-08-05 18:05:21 -07:00
Ivan Nieto Vivanco
c055c91739 Change db query for an existing method 2022-08-04 09:20:20 -05:00
Ivan Nieto Vivanco
ea8f12579d Calculate the proper amount of assigned components 2022-08-04 07:58:25 -05:00
snipe
88db2d9e18 Merge remote-tracking branch 'origin/develop' 2022-08-03 17:57:07 -07:00
snipe
5f93d7b3be Merge pull request #11615 from inietov/fixes/autoincrement_in_importer
Fix auto incrementing in CSV importer [sc-19366]
2022-08-03 17:50:23 -07:00
snipe
1875ed55cc Merge pull request #11612 from snipe/fixes/improved_report_search
Added relations to report search
2022-08-03 17:49:59 -07:00
Ivan Nieto Vivanco
9f0ecba9b9 Add autoincrementing asset tags to the import if the CSV column is empty 2022-08-03 12:48:48 -05:00
snipe
9acfceba29 Added relations to report search
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 23:50:10 -07:00
snipe
92bf8b4436 Merge remote-tracking branch 'origin/develop' 2022-08-02 20:22:02 -07:00
snipe
b52c00d49b Merge pull request #11611 from snipe/fixes/added_configuration_change_to_maintenance_types
Added configuration change to maintenance types
2022-08-02 20:21:25 -07:00
snipe
20fcf7a1e9 Added configuration change to maintenance types
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 20:19:43 -07:00
snipe
095dd3ecf2 Added configuration, PAT test strings
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 20:19:28 -07:00
snipe
5a1b8bc4b6 Fixed icheck checkbox class
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 20:19:19 -07:00
snipe
eadb36cb26 Merge remote-tracking branch 'origin/develop' 2022-08-02 20:00:13 -07:00
snipe
6eac133caf Merge pull request #11610 from snipe/fixes/adds_deleted_at_to_custom_report_export
Added deleted at to custom report export
2022-08-02 19:59:39 -07:00
snipe
cc92d342ea Added deleted at value
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:58:37 -07:00
snipe
02caa13222 Removed debugging
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:58:30 -07:00
snipe
975b4dee2f Added deleted header
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:58:17 -07:00
snipe
65f0a3f535 Merge pull request #11609 from snipe/fixes/checkboxes_on_custom_report
Fixed labels on radio buttons in custom report
2022-08-02 19:54:14 -07:00
snipe
9ae7c66b77 Fixed indenting
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:50:21 -07:00
snipe
77ab4ac1b5 Fixed labels on radio buttons in custom report
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:48:41 -07:00
snipe
b0e66ae445 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	resources/views/locations/print.blade.php
2022-08-02 19:41:17 -07:00
snipe
5fe8db541e Merge pull request #11608 from snipe/features/add_time_diff_to_eol
Added time diff to EOL in asset view
2022-08-02 19:40:10 -07:00
snipe
87bed9b294 Fixed typo in code comments
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:24:46 -07:00
snipe
da1c1dbdd9 Added warning icon
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:19:08 -07:00
snipe
56b6904564 Added time difference
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:13:02 -07:00
snipe
10e64deafe Updated method name in mail
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:12:44 -07:00
snipe
ac72b69ece Update method name
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:12:28 -07:00
snipe
8e18ce74b2 Update method name
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 19:12:18 -07:00
snipe
254ce72415 Add @vickyjaura183 as a contributor 2022-08-02 17:20:51 -07:00
snipe
1b657ee995 Merge pull request #11601 from vickyjaura183/bugfix/error_404_bulkcheckout
Error 404 fixed on submitting without mandatory field
2022-08-02 17:19:22 -07:00
snipe
71facb1850 Merge pull request #11596 from snipe/fixes/unique_undeleted_for_custom_fields
Use unique_undeleted instead of unique for custom fields
2022-08-02 17:16:12 -07:00
snipe
8d8c502546 Merge pull request #11605 from snipe/fixes/really_disable_consumable_checkout
Disallow checkout if qty = 0
2022-08-02 12:31:29 -07:00
snipe
0a9bd07f20 Disallow checkout if qty = 0
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 12:27:58 -07:00
snipe
688577c1ed Merge pull request #11604 from snipe/fixes/only_show_requested_if_requestable_perms
Hide requested assets if the user cannot see requestable items
2022-08-02 11:49:22 -07:00
snipe
8027039754 Hide requested assets if the user cannot see requestable items
Signed-off-by: snipe <snipe@snipe.net>
2022-08-02 11:48:45 -07:00
snipe
031b7998c9 Merge pull request #11603 from inietov/fixes/actions_on_licenses
Use apropiate string for license actions
2022-08-02 10:40:20 -07:00
Ivan Nieto Vivanco
13053b85ef Remove Actions button and pass the correct variable to the routes 2022-08-02 12:37:27 -05:00
snipe
e3b13143bf Merge pull request #11594 from Godmartinz/adds_deleted_asset_options_to_custom_reports
Adds options to include Deleted assets to custom asset reports
2022-08-02 10:33:57 -07:00
Godfrey M
e150ab58e9 reworded trans 2022-08-02 10:31:06 -07:00
Godfrey M
ff080a2d8f replace checkboxes with radiobuttons 2022-08-02 10:27:55 -07:00
Ivan Nieto Vivanco
a63d00bb5c Use apropiate string for license actions 2022-08-02 11:55:11 -05:00
vishalkumar183
96b40a5edd Error 404 fixed on sumitting witout mandtory field 2022-08-02 18:44:16 +05:30
Katharina Drexel
8596c54d6a Fixing query order (otherwise you run into app_key exception before anonymous ldap applied).
Signed-off-by: Katharina Drexel <katharina.drexel@bfh.ch>
2022-08-02 14:24:00 +02:00
snipe
e07532dd1b Applied master fix to develop
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 18:55:28 -07:00
snipe
04a467bdc7 One more
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 18:53:00 -07:00
snipe
06d60bb1d1 Applied date formatter PR to master
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 18:49:56 -07:00
snipe
9c6c01bab1 Merge pull request #11597 from snipe/fixes/missed_date_formatting_on_print
Fixed date format for Current Date output on location print assigned
2022-08-01 18:48:41 -07:00
snipe
4133ac6ef0 Applied date formatter to Current Date output on location print assigned
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 18:47:29 -07:00
snipe
4834c33861 Missed a named route
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 18:43:54 -07:00
snipe
904b5c2886 Merge pull request #11595 from snipe/fixes/fix_routes_for_optimize
Fixed routes for optimize
2022-08-01 17:55:34 -07:00
snipe
e79a819724 Fixed inconsistency in naming
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 17:45:39 -07:00
snipe
0fdbd410b6 Use unique_undeleted instead of unique for custom fields
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 17:10:39 -07:00
snipe
af7ccf3beb Handle logout route names
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 16:17:40 -07:00
snipe
3e48f436af Handled user route names
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 16:13:30 -07:00
snipe
5e488bd81f Handle components route names
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 16:10:39 -07:00
snipe
53ff28d2b0 Handle consumables route names
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 16:07:56 -07:00
snipe
4a4636bd03 Handle accessories route names
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 16:06:28 -07:00
snipe
744d0d299e Handle model route names
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 16:03:45 -07:00
snipe
b035003546 Handled hardware route names
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 15:59:54 -07:00
Godfrey M
842dafefec adds options to include Deleted assets to custom asset reports 2022-08-01 14:52:12 -07:00
snipe
375963f92d Merge remote-tracking branch 'origin/develop' 2022-08-01 14:08:16 -07:00
snipe
a51b446a10 Merge pull request #11578 from snipe/fixes/conditionally_add_nbsp
Switched to conditionally adding the nbsp; that the table needs for proper layout if cell is empty
2022-08-01 14:07:50 -07:00
snipe
371aba9912 Merge pull request #11593 from snipe/fixes/add_bulk_assets_to_company_view
Added bulk edit to company view
2022-08-01 14:07:14 -07:00
snipe
8b30992a11 Added bulk edit to company view
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 14:06:18 -07:00
snipe
33de45d8fb Swirtched to conditionally adding the nbsp; that the table needs for proper layout if cell is empty
Signed-off-by: snipe <snipe@snipe.net>
2022-07-29 00:57:20 -07:00
snipe
d7d0056b73 Merge remote-tracking branch 'origin/develop' 2022-07-27 15:10:38 -07:00
snipe
7d2fcef807 Merge pull request #11562 from uberbrady/clarify_logging
Fixed inconsistent `*_LOG_LEVEL` variables; set reasonable defaults
2022-07-25 20:02:37 -07:00
Brady Wetherington
1981b79557 Good catch! APP_LOG -> LOG_CHANNEL 2022-07-25 19:57:14 -07:00
Brady Wetherington
0c7d4a709a Cleaned up more logging options 2022-07-25 19:25:06 -07:00
snipe
6c8d226b21 Merge pull request #11561 from snipe/features/added_perl_module_link
Added link to SEDC / perl-www-snipe
2022-07-25 18:54:57 -07:00
snipe
211bbeda5b Added link to SEDC / perl-www-snipe
Signed-off-by: snipe <snipe@snipe.net>
2022-07-25 18:53:17 -07:00
Brady Wetherington
7057cb0104 Make all *_LOG_LEVEL vars consistent; set default to 'warning' 2022-07-25 18:44:37 -07:00
snipe
658edb64d6 Merge remote-tracking branch 'origin/develop' 2022-07-22 19:06:28 -07:00
snipe
dc06f14505 Merge pull request #11554 from snipe/security/upgrade_dompdf
Bumped packages
2022-07-22 18:21:51 -07:00
snipe
f446314ce6 Merge pull request #11547 from snipe/fixes/midnight_timestamp
Applies current time to checkin date
2022-07-22 17:58:45 -07:00
snipe
443b1df5e1 Bumped packages
Signed-off-by: snipe <snipe@snipe.net>
2022-07-22 17:55:19 -07:00
snipe
3c22e0d203 Merge remote-tracking branch 'origin/develop' 2022-07-22 17:28:43 -07:00
snipe
d636ad8e09 Merge pull request #11553 from snipe/security/upgrade_imagemin
Upgraded imagemin
2022-07-22 17:27:35 -07:00
snipe
adfdbf3d44 Upgraded imagemin
Signed-off-by: snipe <snipe@snipe.net>
2022-07-22 17:26:47 -07:00
snipe
8b03abde8d Production assets for dark skin fix
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	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
2022-07-22 15:39:46 -07:00
snipe
67320dc024 Merge pull request #11551 from snipe/fixes/dark_skin_dropdowns
Fixed #11549 - dark skin dropdown menu fixes
2022-07-22 15:38:02 -07:00
snipe
c5530104ff Fixed #11549 - dark skin dropdowbn menu fixes
Signed-off-by: snipe <snipe@snipe.net>
2022-07-22 15:36:51 -07:00
snipe
78097df7ff Aplpies current time to checkin date
Signed-off-by: snipe <snipe@snipe.net>
2022-07-21 21:45:25 -07:00
snipe
072e6029b6 Merge remote-tracking branch 'origin/develop' 2022-07-21 12:20:24 -07:00
snipe
5926441984 Merge pull request #11542 from snipe/features/users_checkin_without_delete
Features/users checkin without delete
2022-07-20 18:59:45 -07:00
snipe
a1fe2a8d58 Fixed translation reference
Signed-off-by: snipe <snipe@snipe.net>
2022-07-20 18:01:55 -07:00
snipe
25cc46e416 Fixed button string
Signed-off-by: snipe <snipe@snipe.net>
2022-07-20 18:01:41 -07:00
snipe
458d61fafe Front-end updates for checkin without delete
Signed-off-by: snipe <snipe@snipe.net>
2022-07-20 17:57:39 -07:00
snipe
32010d5387 Updated language strings
Signed-off-by: snipe <snipe@snipe.net>
2022-07-20 17:57:27 -07:00
snipe
7313bca403 Checkin without deleting
Signed-off-by: snipe <snipe@snipe.net>
2022-07-20 17:57:19 -07:00
snipe
b7c7e6c623 Added/updated language strings
Signed-off-by: snipe <snipe@snipe.net>
2022-07-20 17:56:58 -07:00
snipe
0b4d243bf0 Merge pull request #11541 from Godmartinz/gh11540_Error_405_when_checking_out_Accessory
Fixes #11540 - accessory api routes from get to posts
2022-07-20 14:14:15 -07:00
Godfrey M
377c0e7075 fixes component routes 2022-07-20 13:41:35 -07:00
Godfrey M
0c4c4fc352 changes api checkin and checkout routes to post 2022-07-20 11:52:54 -07:00
Katharina Drexel
9d627936e6 Fixed #11509: Allow LDAP anonymous bind. 2022-07-20 17:24:20 +02:00
snipe
29a32c4726 Merge remote-tracking branch 'origin/develop' 2022-07-19 12:46:05 -07:00
snipe
e72c4f989f Merge pull request #11528 from uberbrady/upgrade_laravel_scim_server
Upgraded our fork of laravel-scim-server to better support scim creates
2022-07-18 19:56:06 -07:00
snipe
0d656e3963 Production assets
Signed-off-by: snipe <snipe@snipe.net>
2022-07-18 17:29:37 -07:00
snipe
50ce471dc6 Production assets
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/js/build/app.js
#	public/js/dist/all.js
#	public/mix-manifest.json
2022-07-18 17:29:29 -07:00
snipe
8113838eee Merge pull request #11531 from snipe/security/upgrade_jquery_ui
Upgraded jquery-UI
2022-07-18 17:28:22 -07:00
snipe
a92bb80055 Upgraded jquery-UI
Signed-off-by: snipe <snipe@snipe.net>
2022-07-18 17:27:54 -07:00
snipe
e9121c15d8 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2022-07-18 16:50:53 -07:00
snipe
43bd00da86 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-07-18 16:50:12 -07:00
snipe
d124c89ced Moved session driver setting to be more clear
Signed-off-by: snipe <snipe@snipe.net>
2022-07-18 16:47:46 -07:00
Brady Wetherington
b2112e6792 Whoops, bump version to have the right syntax! 2022-07-18 15:16:45 -07:00
Brady Wetherington
250db10249 Upgrade our fork of laravel-scim-server to better support scim creates 2022-07-18 15:05:42 -07:00
snipe
ff5d64fcbf Merge remote-tracking branch 'origin/develop' 2022-07-18 12:15:44 -07:00
snipe
ec01aadbe4 Merge pull request #11526 from snipe/fixes/use_icheck_on_custom_report
Use icheckbox formatting on BOM and archived checkboxes
2022-07-18 12:13:27 -07:00
snipe
f0a9de72b1 Use icheckbox formatting on BOM and archived checkboxes
Signed-off-by: snipe <snipe@snipe.net>
2022-07-18 12:12:22 -07:00
snipe
145c191a65 Merge remote-tracking branch 'origin/develop' 2022-07-15 19:17:04 -07:00
snipe
5cb5ef249b Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2022-07-15 19:16:54 -07:00
snipe
ea38cef48c Merge remote-tracking branch 'origin/develop' 2022-07-15 19:15:31 -07:00
snipe
4808185b5c Added link to MosyleSnipeSync
Signed-off-by: snipe <snipe@snipe.net>
2022-07-15 19:15:19 -07:00
snipe
b3d65b5703 Merge remote-tracking branch 'origin/develop' 2022-07-15 18:53:20 -07:00
snipe
0f38714e21 Merge pull request #11517 from snipe/fixes/small_changes_to_gh_actions_configs
Changed some autolabeler and code owners
2022-07-15 18:53:01 -07:00
snipe
7a099bc268 Changed some autolabeler and code owners
Signed-off-by: snipe <snipe@snipe.net>
2022-07-15 18:51:57 -07:00
snipe
6f1f6c75e6 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
2022-07-15 17:11:55 -07:00
snipe
40d5c37aea Merge pull request #11516 from snipe/fixes/11508_alert_font_size
Fixed #11508 - font size in alert menu
2022-07-15 17:10:26 -07:00
snipe
58499c2322 Fixed #11508 - font size in alert menu
Signed-off-by: snipe <snipe@snipe.net>
2022-07-15 17:09:17 -07:00
snipe
6428dc5cd2 Removed duplicate supplier_id
Signed-off-by: snipe <snipe@snipe.net>
2022-07-13 13:08:15 -07:00
snipe
5f5ff04636 Merge pull request #11502 from mikeroq/fixes/eula_download_if_app_locale_is_not_en
Fixes #11496 - Wrong URL generated for download of asset acceptance PDF if locale was not en
2022-07-12 16:18:59 -07:00
mikeroq
f21824a8e2 Changed comparing the action type from translated in presenter to actual value 2022-07-12 17:59:03 -05:00
snipe
0ccd7e09de Merge pull request #11488 from Godmartinz/feature/sc-19107/add-box-to-custom-reports-to-not-include
adds a checkbox to exclude archived assets from custom reports
2022-07-12 12:59:18 -07:00
Godfrey M
27039325f3 removed comments, because I forgot 2022-07-12 12:41:07 -07:00
Godfrey M
58c54cc3dc uses notArchived scope instead now 2022-07-12 12:20:11 -07:00
Godfrey M
48349071ed accounts for status_id as well 2022-07-12 09:46:44 -07:00
snipe
bb5ac900ec Merge pull request #11492 from mikeroq/fixes/email_all_assigned_to_user_with_no_email
Fixes "email list of all assigned" apparently being successful even if the user has no email address
2022-07-11 18:27:01 -07:00
mikeroq
5efe45226d Fixes Email List of All Assigned being "successful" when the user has no email
Added check in view to disable button if there is no email
Added translation for title on disabled button and for email check in controller
Fixed missing trans for user not found message
2022-07-11 20:02:10 -05:00
snipe
a0183ff56f Merge remote-tracking branch 'origin/develop' 2022-07-11 17:11:44 -07:00
snipe
bb091760af Fixedd unclosed brace
Signed-off-by: snipe <snipe@snipe.net>
2022-07-11 17:11:28 -07:00
snipe
78d13871eb Merge pull request #11458 from snipe/dependabot/github_actions/codacy/codacy-analysis-cli-action-4.1.0
Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.1.0
2022-07-11 16:34:51 -07:00
snipe
fc5cf3e291 Merge pull request #11483 from snipe/fixes/migrations_on_restore
Fixes - migrations on restore
2022-07-11 16:34:06 -07:00
snipe
3182f251e1 Merge remote-tracking branch 'origin/develop' 2022-07-11 16:26:14 -07:00
snipe
d6ba8655bb Merge pull request #11490 from snipe/fixes/print_assigned_sig_broken
Fixed - print assigned sig broken
2022-07-11 14:48:25 -07:00
snipe
8114d01799 Only show sig file if there is a value for accepted sig
Signed-off-by: snipe <snipe@snipe.net>
2022-07-11 14:46:45 -07:00
Godfrey M
309229619b fixes the order expiring assets are listed in notifications 2022-07-11 12:25:38 -07:00
Godfrey M
75844c5942 adds a checkbox to exclude archived assets from custom reports 2022-07-11 09:56:58 -07:00
snipe
78d5c37267 Merge pull request #11484 from mikeroq/fixes/delete_file_modal_on_licenses
Fixes license file(s) delete modal showing entire model data instead of just the name
2022-07-10 13:23:03 -07:00
mikeroq
397e89cbed Fixes modal showing entire model data instead of just the name 2022-07-09 14:09:40 -05:00
snipe
2518e2f0ee Removed > 300
Signed-off-by: snipe <snipe@snipe.net>
2022-07-08 17:09:56 -07:00
snipe
e833052e8e Check for column
Signed-off-by: snipe <snipe@snipe.net>
2022-07-08 16:46:00 -07:00
snipe
43e370f35a Move migrations further up
Signed-off-by: snipe <snipe@snipe.net>
2022-07-08 16:40:51 -07:00
snipe
8d3c9e67a0 Merge remote-tracking branch 'origin/develop' 2022-07-07 16:19:29 -07:00
snipe
3988c0e3f0 Merge pull request #11480 from snipe/fixes/changed_model_file_icon
Changed model file icon
2022-07-07 16:19:09 -07:00
snipe
723454b04d Changed model file icon
Signed-off-by: snipe <snipe@snipe.net>
2022-07-07 16:17:35 -07:00
snipe
30c03435e4 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
2022-07-07 16:01:17 -07:00
snipe
5043533fde Merge pull request #11479 from snipe/fixes/padlock_icon
Fixes padlock icon
2022-07-07 16:00:02 -07:00
snipe
d458973649 Removed unneeded JS
Signed-off-by: snipe <snipe@snipe.net>
2022-07-07 15:58:37 -07:00
snipe
9c86b4bf88 Fixes padlock icon
Signed-off-by: snipe <snipe@snipe.net>
2022-07-07 15:57:33 -07:00
snipe
3a6c6d8466 Prod assets
Signed-off-by: snipe <snipe@snipe.net>
2022-07-07 14:40:39 -07:00
snipe
d62167e364 Merge remote-tracking branch 'origin/develop' 2022-07-07 14:39:02 -07:00
snipe
9297d8af1d Merge pull request #11478 from snipe/fixes/upgrade_font_awesome
Upgrade font-awesome to v6
2022-07-07 14:38:34 -07:00
snipe
bae9792f01 Missed two
Signed-off-by: snipe <snipe@snipe.net>
2022-07-07 14:36:09 -07:00
snipe
b98af0f50f Upgrade font-awesome to v6
Signed-off-by: snipe <snipe@snipe.net>
2022-07-07 14:22:08 -07:00
snipe
75e5cde39b Merge remote-tracking branch 'origin/develop' 2022-07-06 18:20:30 -07:00
snipe
f853188bc7 Merge pull request #11471 from uberbrady/add_license_seat_indexes
This adds some indexes for performance on license_seats
2022-07-06 18:19:40 -07:00
Brady Wetherington
61813a6f2c This adds some indexes for performance on license_seats 2022-07-06 18:10:48 -07:00
snipe
7a0c9776b4 Merge remote-tracking branch 'origin/develop' 2022-07-05 17:58:59 -07:00
snipe
ee4f355e49 Changed logging to debug
Signed-off-by: snipe <snipe@snipe.net>
2022-07-05 17:58:45 -07:00
snipe
bfc8c18675 Merge pull request #11451 from mikeroq/fixes/populate_custom_fields_from_asset_model_create
Fixes custom fields not populating when creating asset from asset model page
2022-07-05 17:31:08 -07:00
snipe
f1488767f8 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2022-07-05 16:41:00 -07:00
snipe
2d5755c1dd Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-07-05 16:40:17 -07:00
snipe
acc2e12f12 Merge remote-tracking branch 'origin/develop' 2022-07-05 16:35:34 -07:00
snipe
eb2793bfa7 Added @reederda
Signed-off-by: snipe <snipe@snipe.net>
2022-07-05 16:35:12 -07:00
snipe
1a05843183 Merge pull request #11462 from reederda/develop
Fixed #NA: typo
2022-07-05 16:33:09 -07:00
snipe
ef17fd41f7 Merge branch 'develop' into develop 2022-07-05 16:26:53 -07:00
snipe
7bdbbbee50 Branch in config set to master
Signed-off-by: snipe <snipe@snipe.net>
2022-07-05 16:20:33 -07:00
snipe
2e800e6a0d Merge pull request #11467 from snipe/translations/updated_strings
Updated translations
2022-07-05 16:19:46 -07:00
snipe
dae53a1128 Updated translations
Signed-off-by: snipe <snipe@snipe.net>
2022-07-05 16:18:53 -07:00
mikeroq
2781bd02b5 Add TODO to indicate future refactoring. 2022-07-05 18:02:37 -05:00
Daniel Reeder
7772ef22db Quick typo fix 2022-07-04 21:57:54 +00:00
snipe
2137c4e897 Back to develop
Signed-off-by: snipe <snipe@snipe.net>
2022-07-04 10:12:25 -07:00
snipe
4a0e51bf34 Merge remote-tracking branch 'origin/develop' 2022-07-04 10:11:05 -07:00
snipe
9f581a7677 Merge pull request #11460 from mikeroq/fix_missing_use_statement
Fixes #11459 Missing import for Setting model in AcceptanceController
2022-07-04 10:07:54 -07:00
mikeroq
be8869978d Added import for Setting model 2022-07-04 07:29:01 -05:00
dependabot[bot]
1ae044b91e Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.1.0
Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 1.1.0 to 4.1.0.
- [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases)
- [Commits](https://github.com/codacy/codacy-analysis-cli-action/compare/1.1.0...v4.1.0)

---
updated-dependencies:
- dependency-name: codacy/codacy-analysis-cli-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 08:28:05 +00:00
snipe
e550fb1a52 Merge pull request #11447 from snipe/dependabot/github_actions/docker/metadata-action-4
Bump docker/metadata-action from 3 to 4
2022-07-03 20:04:15 -07:00
snipe
fc65bb020f Merge pull request #11446 from snipe/dependabot/github_actions/docker/login-action-2
Bump docker/login-action from 1 to 2
2022-07-03 20:03:50 -07:00
snipe
a4dfdcd90d Merge pull request #11450 from snipe/dependabot/github_actions/docker/build-push-action-3
Bump docker/build-push-action from 2 to 3
2022-07-03 20:03:32 -07:00
snipe
16d2e34148 Merge pull request #11448 from snipe/dependabot/github_actions/docker/setup-buildx-action-2
Bump docker/setup-buildx-action from 1 to 2
2022-07-03 20:03:08 -07:00
snipe
567eefab1a Merge pull request #11449 from snipe/dependabot/github_actions/github/codeql-action-2
Bump github/codeql-action from 1 to 2
2022-07-03 20:02:31 -07:00
snipe
1ef20ec622 Merge remote-tracking branch 'origin/develop' 2022-07-02 13:08:59 -07:00
snipe
afab167e8c Fixed restore button in listings
Signed-off-by: snipe <snipe@snipe.net>
2022-07-02 13:08:46 -07:00
snipe
af14ee0d47 Merge pull request #11453 from mikeroq/fixes/asset_restore_not_working
Fixes #11452 - Asset Restore routes/buttons also asset models/users restore as well
2022-07-02 13:07:29 -07:00
Mike Roquemore
0a5ca6eb25 Change restore route to POST instead of GET 2022-07-02 14:34:43 -05:00
Mike Roquemore
6e9f24c08f Change restore route to POST instead of GET 2022-07-02 14:34:23 -05:00
Mike Roquemore
07ac4087a3 Remove link from alert since there is already a restore button on the side 2022-07-02 14:34:22 -05:00
Mike Roquemore
1650c9f878 Remove duplicate users routes 2022-07-02 14:34:22 -05:00
Mike Roquemore
123963c14c Modify genericActionsFormatter restore link to be a button instead since it's in a form.
Changed user restore route to POST
2022-07-02 14:34:22 -05:00
Mike Roquemore
1b45170ca3 Adds check if request has model_id, if so call fetchCustomFields on document ready 2022-07-01 20:15:11 -05:00
snipe
9a0b677dac Merge remote-tracking branch 'origin/develop' 2022-07-01 14:31:29 -07:00
snipe
b44f27dafa Add @mikeroq as a contributor 2022-07-01 14:31:07 -07:00
snipe
92d46edca3 Cleaned up logging output
Signed-off-by: snipe <snipe@snipe.net>
2022-07-01 13:33:58 -07:00
dependabot[bot]
471cf117ab Bump docker/build-push-action from 2 to 3
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2 to 3.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 18:36:55 +00:00
dependabot[bot]
bf78bd4b8b Bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 18:36:50 +00:00
dependabot[bot]
a0a0d7e344 Bump docker/setup-buildx-action from 1 to 2
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 18:36:45 +00:00
dependabot[bot]
a9361571d6 Bump docker/metadata-action from 3 to 4
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 3 to 4.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](https://github.com/docker/metadata-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 18:36:41 +00:00
dependabot[bot]
1a13be9b5d Bump docker/login-action from 1 to 2
Bumps [docker/login-action](https://github.com/docker/login-action) from 1 to 2.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 18:36:36 +00:00
snipe
0ed84c83c8 Merge pull request #11437 from turrisxyz/Dependabot-GitHub-Actions
chore: Included githubactions in the dependabot config
2022-07-01 11:35:58 -07:00
snipe
9670ca3b8a Merge remote-tracking branch 'origin/develop' 2022-07-01 11:26:46 -07:00
snipe
d4476cb10b Merge pull request #11445 from snipe/fixes/11444
Replicates #11444
2022-07-01 11:26:25 -07:00
snipe
45c616639c Replicates #11444
Signed-off-by: snipe <snipe@snipe.net>
2022-07-01 11:21:02 -07:00
snipe
eedd646c28 Merge remote-tracking branch 'origin/develop' 2022-06-30 21:10:46 -07:00
snipe
acbd4deb1b Merge pull request #11440 from snipe/fixes/check_for_image_on_signing
Fixed #11393 - reject acceptance if no file is present
2022-06-30 21:09:16 -07:00
snipe
4e547a3639 Fixed typos :(
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 21:06:36 -07:00
snipe
b910db0617 Fixed #11393 - reject acceptance if no file is present
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 21:01:58 -07:00
snipe
bb382f3d2a Merge remote-tracking branch 'origin/develop' 2022-06-30 18:52:02 -07:00
snipe
25cb32ca6a Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 18:51:44 -07:00
snipe
6a13a7e096 Merge remote-tracking branch 'origin/develop' 2022-06-30 18:38:25 -07:00
snipe
e366caf3d1 Merge pull request #11438 from uberbrady/backout_linear_depreciation_math
Revert a change in our Linear Depreciation math
2022-06-30 18:38:03 -07:00
naveen
cfa301f5ae chore: Included githubactions in the dependabot config
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-07-01 01:33:50 +00:00
Brady Wetherington
f72aa2415f Revert a change in our Linear Depreciation math; I think the old algorithm was correct 2022-06-30 18:24:45 -07:00
snipe
7969a66552 Merge remote-tracking branch 'origin/develop' 2022-06-30 18:17:51 -07:00
snipe
4edba064d5 Removed duplicate model column in depreciation report
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 18:17:30 -07:00
snipe
f3a3c59b7b Fixed branch name
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 18:05:46 -07:00
snipe
aa54c23f98 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 18:04:53 -07:00
snipe
df1e2687d6 Updated languages
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 17:35:02 -07:00
snipe
4f07e77bf9 Add @naveensrinivasan as a contributor 2022-06-30 17:35:02 -07:00
snipe
a10f570350 Merge pull request #11436 from turrisxyz/Pinned-Dependencies-GitHub
chore: Set permissions for GitHub actions
2022-06-30 17:30:17 -07:00
naveen
ac94aa8e46 chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-07-01 00:29:21 +00:00
snipe
7ebf125dae Merge remote-tracking branch 'origin/develop' 2022-06-30 15:44:51 -07:00
snipe
9a361d573f Merge pull request #11435 from snipe/features/ldap_warnings
Added warnings for common LDAP misconfigs
2022-06-30 15:44:33 -07:00
snipe
1a423a252b Derp
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 15:22:58 -07:00
snipe
7591f3f092 Added auth filter check regex
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 15:15:49 -07:00
snipe
2cace3c73a Added LDAP warnings on page load
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 15:08:12 -07:00
snipe
97afafdd48 Merge remote-tracking branch 'origin/develop' 2022-06-30 14:20:34 -07:00
snipe
656efc5f92 Fixed missing trans()
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 14:20:15 -07:00
snipe
46d055cf74 Fixed weird extra padding on crown
Signed-off-by: snipe <snipe@snipe.net>
2022-06-30 14:17:53 -07:00
snipe
423e7439ee Merge remote-tracking branch 'origin/develop' 2022-06-30 14:09:19 -07:00
snipe
2262ef818e Merge pull request #11427 from Godmartinz/email_users_list
[feature] adds button to email user list of assets from profile
2022-06-29 15:25:18 -07:00
snipe
02459aad26 Merge pull request #11430 from uberbrady/scim_more_tolerant
Make SCIM be more tolerant of missing fields
2022-06-29 15:24:25 -07:00
Brady Wetherington
2451bb9a2b Make SCIM be more tolerant of missing fields 2022-06-29 14:48:59 -07:00
Godfrey M
cd9d2d0cec adds docblock 2022-06-29 13:01:29 -07:00
Godfrey M
fc636ea888 removed redundant header 2022-06-29 12:01:56 -07:00
Godfrey M
e471aa8639 adds button to email user list of assets from profile 2022-06-29 11:15:15 -07:00
snipe
180f36d145 Merge remote-tracking branch 'origin/develop' 2022-06-29 05:04:21 -07:00
snipe
f8fd87b896 Add @ntbutler-nbcs as a contributor 2022-06-29 05:04:07 -07:00
snipe
130c8ea1b0 Add @ntbutler-nbcs as a contributor 2022-06-29 05:03:22 -07:00
snipe
5af6330398 Merge pull request #11417 from ntbutler-nbcs/master
[Feature] - Add checkoutByTag API endpoint for assets
2022-06-29 05:03:01 -07:00
snipe
daaf8713d8 Merge branch 'dampfklon-9813-duplicate-accept-asset' into develop 2022-06-29 04:58:26 -07:00
snipe
5b02d9ed06 Merge branch '9813-duplicate-accept-asset' of https://github.com/dampfklon/snipe-it into dampfklon-9813-duplicate-accept-asset
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	resources/views/account/accept/create.blade.php
2022-06-29 04:58:13 -07:00
snipe
b04cf20735 Merge pull request #10758 from inietov/fixes/badmethodcallexception_undefined_method_Asset.unaccepted_develop
Fixes BadMethodCallException Call to undefined method App\Models\Asset::unaccepted() for master [ch-17636]
2022-06-29 04:34:51 -07:00
Nathan Butler
6531657ee0 Revert version to dev for pull request 2022-06-29 18:00:15 +10:00
Nathan Butler
e28e7e37b8 Removed unneeded checks when searching for asset 2022-06-29 17:49:50 +10:00
snipe
467f59e193 Merge remote-tracking branch 'origin/develop' 2022-06-29 00:25:00 -07:00
snipe
be9e6fe847 Another typo
Signed-off-by: snipe <snipe@snipe.net>
2022-06-29 00:24:33 -07:00
snipe
b0e13611f7 Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2022-06-29 00:24:08 -07:00
snipe
f3887aef33 Merge remote-tracking branch 'origin/develop' 2022-06-29 00:10:38 -07:00
snipe
7b3f891edd Merge pull request #11418 from snipe/features/api_backup_download
Download backup via API
2022-06-29 00:07:09 -07:00
snipe
b590f29f33 Attempt a download via API
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 23:59:13 -07:00
snipe
1debdc47cf Backups endpoint
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 23:30:17 -07:00
snipe
bb7662a214 Merge pull request #11416 from snipe/features/personal_access_endpoint
Added personal access endpoint to API
2022-06-28 23:27:21 -07:00
snipe
53bc15900b Formatted show api
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 23:23:55 -07:00
snipe
90fe7af863 Small refactor
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 23:18:16 -07:00
snipe
67ad24af08 Return token ID in cli
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 23:13:25 -07:00
Nathan Butler
67e9b7795a Added asset checkoutByTag API endpoint 2022-06-29 16:11:57 +10:00
snipe
52332bc9ed Include token ID in payload
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 23:10:56 -07:00
snipe
dc27d3bec9 Change to plural endpoints
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 23:10:40 -07:00
snipe
a711e608c9 Changed siganture to be clearer
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 22:26:37 -07:00
snipe
2f7c04362e Make -kkey-only a flag
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 22:20:55 -07:00
snipe
9b6fd7e19a Set $accessTokenName
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 22:11:46 -07:00
snipe
9680b02bce Check that the user has permission to create their own API keys
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 22:09:18 -07:00
snipe
e7de7d1716 Show user info as well
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 22:06:46 -07:00
snipe
112f147596 Console script to generate API tokens
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 22:04:39 -07:00
snipe
413487de80 Made method naming consistent
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 21:32:12 -07:00
snipe
1158fa9ea8 Added personal access tokens to api
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 21:29:15 -07:00
snipe
a8e8112b34 Merge pull request #11415 from snipe/features/more_api_filters
Added additional filters for api indexes
2022-06-28 20:04:01 -07:00
snipe
3df9260ca8 Added additional filters for api indexes
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 19:59:45 -07:00
snipe
14ba3af086 Merge pull request #11414 from snipe/features/additional_search_fields_for_locations
Added additional search filters for location API
2022-06-28 19:08:08 -07:00
snipe
71c8050883 Added additional search filters for location API
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 19:07:11 -07:00
snipe
df5b01492c Merge remote-tracking branch 'origin/develop' 2022-06-28 18:55:59 -07:00
snipe
9dbb355e8d Merge pull request #11412 from snipe/features/model_uploads
Added model uploads
2022-06-28 18:42:05 -07:00
snipe
0f3778f07b Merge pull request #11413 from uberbrady/add_username_index
Add index across username and deleted_at to improve performance
2022-06-28 17:16:01 -07:00
Brady Wetherington
f515bd2dc8 Add index across username and deleted_at to improve large directory sync performance 2022-06-28 17:12:14 -07:00
snipe
f3075facb4 Added delete button
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 16:25:22 -07:00
snipe
ed95adb45c Show model files on hardware page
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 16:17:46 -07:00
snipe
95d4f7c62e Added models router to BS tables
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 15:56:18 -07:00
snipe
c90ed9f25f Allow models uploads
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 15:50:07 -07:00
snipe
7f664a7971 Layout changes for file upload
Signed-off-by: snipe <snipe@snipe.net>
2022-06-28 12:32:12 -07:00
snipe
14c6879f06 Merge remote-tracking branch 'origin/develop' 2022-06-28 11:41:56 -07:00
snipe
d8d12d4590 Merge pull request #11408 from uberbrady/add_filter_option_to_ldap_sync
Add a new `--filter` option to Artisan ldap-sync command
2022-06-28 09:50:48 -07:00
Brady Wetherington
be3388d647 Add a new --filter option to Artisan ldap-sync command 2022-06-27 19:49:59 -07:00
snipe
242836719d Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 19:32:10 -07:00
snipe
393c32558b Gotta bump that hash up
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 19:31:26 -07:00
snipe
94e723a88f Merge pull request #11404 from snipe/features/fix_transliteration
Fixed custom field transliteration
2022-06-27 17:42:02 -07:00
snipe
14d8fb66aa Merge pull request #11405 from snipe/fixes/use_db_column_instead_of_converted_value
Only care about the custom field's converted name when updating the custom field itself
2022-06-27 17:36:26 -07:00
snipe
ae73d4cc7c Merge pull request #11407 from snipe/features/disclosure_arrows_on_user_screen
Added disclosure arrows for lesser used options on user screen
2022-06-27 17:33:31 -07:00
snipe
bf08e73f8f Removed comments and server side cookie info
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 16:36:09 -07:00
snipe
4a3f56acf2 Removed old cooke stuff
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 16:35:54 -07:00
snipe
e33a4c2ef2 Added disclosure arrows to use screen
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 16:35:44 -07:00
snipe
52bd7d0d68 Merge remote-tracking branch 'origin/develop' 2022-06-27 14:25:38 -07:00
snipe
baad3b9d58 Only care about the converted name when updating the custom field itself
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 14:17:07 -07:00
snipe
131edb611e Refine output and checks
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 13:54:21 -07:00
snipe
518395bbc7 Merge pull request #11403 from uberbrady/remember_disclosure_triangles
Remember the state of the disclosure triangles in Assets
2022-06-27 13:28:14 -07:00
Brady Wetherington
34b4499178 Remember the state of the disclosure triangles in Assets 2022-06-27 12:57:19 -07:00
snipe
8f900fb4e1 More UI tweaks
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 12:15:11 -07:00
snipe
9355689dd4 Nicer output for custom fields error
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 11:52:51 -07:00
snipe
0909feaa6b Few more UI tweaks
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 11:01:19 -07:00
snipe
7f18180105 Fixed toggle
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 10:26:37 -07:00
snipe
bee694e605 Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 09:57:20 -07:00
snipe
08525a3c20 Few more changes
Signed-off-by: snipe <snipe@snipe.net>
2022-06-27 09:43:32 -07:00
snipe
d70b36750c Merge pull request #10967 from veenone/fix/hide_optional_field_on_create_asset
Fixes #8155 -  improve the workflow during asset creation
2022-06-24 18:53:07 -07:00
snipe
8c85d7bc97 Merge pull request #11370 from inietov/fixes/customfields_default_values_not_validating
Adds validation to custom fields' default values
2022-06-24 18:11:16 -07:00
snipe
cb225cb1ce Merge remote-tracking branch 'origin/develop' 2022-06-24 18:00:21 -07:00
snipe
7e7ae3bb95 Really reverting this time
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 17:55:34 -07:00
snipe
838579e9a8 Reverting :(
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 17:30:56 -07:00
snipe
a99896618d Merge branch 'develop' of https://github.com/snipe/snipe-it into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	composer.json
#	composer.lock
2022-06-24 17:21:57 -07:00
snipe
24cb13d52b Upgraded guzzle (not broken this time)
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 17:18:34 -07:00
snipe
cc7513e202 Merge pull request #11392 from snipe/security/upgrade_guzzle
Upgraded guzzle to 7.4.5
2022-06-24 17:04:17 -07:00
snipe
c0b6d5aa2c Upgraded guzzle to 7.4.5
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 17:01:24 -07:00
snipe
5788038b49 Merge pull request #11391 from snipe/security/upgrade_webpack
Upgrade webpack from 5.72.1 to 5.73.0
2022-06-24 16:41:59 -07:00
snipe
fbf0815b16 Upgrade webpack from 5.72.1 to 5.73.0
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 16:41:19 -07:00
snipe
e2c227f02b Merge remote-tracking branch 'origin/develop' 2022-06-24 16:21:10 -07:00
snipe
be0f0fc421 Merge pull request #11388 from snipe/features/disable_purge_in_env
Disallow purge backup deletion by default and, enable via .env
2022-06-24 16:12:00 -07:00
snipe
a03075b6ea Merge pull request #11389 from uberbrady/errmagerd_the_gerneral
Typo of 'general' was in the migration blade a few places
2022-06-24 16:05:40 -07:00
Brady Wetherington
3b3f1a817e Typo of 'general' was in the migration blade a few places 2022-06-24 16:00:15 -07:00
snipe
601f7a6994 Moved new variables in example env
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 16:00:05 -07:00
snipe
75d19d815d Still show the purge button even if not allowed to avoid confusion
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 15:59:40 -07:00
snipe
d167d2a10f Disallow backup deletion and log attempt if not allowed
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 15:49:22 -07:00
snipe
fce4f0dc0e Disable delete button if not allowed
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 15:49:07 -07:00
snipe
657039882c Added purge and backup strings
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 15:48:46 -07:00
snipe
cf99d42413 Added backup delete to app config
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 15:48:37 -07:00
snipe
f483eafae9 Added backup delete env
Signed-off-by: snipe <snipe@snipe.net>
2022-06-24 15:44:11 -07:00
snipe
77bf28bcb6 Disallow purge
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 20:11:43 -07:00
snipe
6c2d06efb9 Merge remote-tracking branch 'origin/develop' 2022-06-23 20:02:19 -07:00
snipe
d0081188c7 Merge pull request #11387 from snipe/fixes/nicer_settings_search
Moved the settings search box higher
2022-06-23 19:31:24 -07:00
snipe
ce2362459c Layout tweak for search and back placement
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 19:30:52 -07:00
snipe
4e568bec8a Moves the settings search box higher
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 19:25:30 -07:00
snipe
18c37c97b8 Dark skin prod assets
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 19:14:12 -07:00
snipe
82e5faa869 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	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-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
2022-06-23 19:14:01 -07:00
snipe
dec7122ac7 Dark skin dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 19:13:01 -07:00
snipe
a75fc8af7e Merge remote-tracking branch 'origin/develop' 2022-06-23 19:12:13 -07:00
snipe
86d2c2b153 Small naming changes
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 19:11:59 -07:00
snipe
9fc4565bc1 Merge remote-tracking branch 'origin/develop' 2022-06-23 18:56:04 -07:00
snipe
f0cc418965 Merge pull request #11383 from snipe/features/adds_user_id_to_users
Added created_by to users
2022-06-23 18:48:42 -07:00
snipe
0bc3ca5c42 Fixed comments
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:44:27 -07:00
snipe
62ab867051 Fixed url param
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:43:10 -07:00
snipe
9fd3541520 Missed on createdBy
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:42:22 -07:00
snipe
3e559044b2 Changed method and scope names
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:41:13 -07:00
snipe
75a631b91f Merge pull request #11375 from Godmartinz/bootS_dropdown_menu_fix
fixes dropdown column select font color  in bootstrap tables
2022-06-23 18:31:36 -07:00
snipe
3a8786fdb7 Updated assets for prod
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:27:31 -07:00
snipe
f2a89161b3 Merge remote-tracking branch 'origin/develop' 2022-06-23 18:26:36 -07:00
snipe
1c25057e42 Merge pull request #11379 from Godmartinz/license_acceptance_eula
adds eula blade for licenses/consumables/components and fixes assigned_to for dom_pdf
2022-06-23 18:26:19 -07:00
snipe
590630e4e0 Merge pull request #11386 from snipe/fixes/default_skin_settings_colors
Small fixes to default blue
2022-06-23 18:23:45 -07:00
snipe
487dedba25 Merge pull request #11384 from snipe/fixes/bs_tables_undefined_for_archived
Fixed missing archived tooltip
2022-06-23 18:16:31 -07:00
snipe
f4c346a57c Small fixes to default blue skin
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:11:42 -07:00
snipe
35365882ac Used new settings_button class in settings index
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:10:28 -07:00
snipe
ea254ccc04 Tweaked default @blue
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:10:14 -07:00
snipe
06d5b5f4b1 Small change to color in overrides
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:10:03 -07:00
snipe
2536b02ace Fixed some colors on default skin
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 18:09:52 -07:00
snipe
6b8abb1511 Fixed missing archived tooltip
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 17:32:39 -07:00
snipe
9c9f5be6fe Do not show the creating admin by default in list view
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 17:28:34 -07:00
snipe
d8daec2e0a Added created_by results to user index API
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 17:19:30 -07:00
snipe
c9b81d65f1 Save the user id who is creating the user
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 17:19:08 -07:00
snipe
7f05029089 Added created_by to API output
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 17:18:31 -07:00
snipe
23c50ea9a5 Added admihn scopes
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 17:18:11 -07:00
snipe
2e5e8f363b Added admin to oresenter
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 17:18:04 -07:00
snipe
e63183649a Show admin in user view
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 17:17:48 -07:00
snipe
ef86c0273a Added migration to store admin ID
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 17:17:38 -07:00
snipe
dd8d90aa39 Merge remote-tracking branch 'origin/develop' 2022-06-23 16:16:04 -07:00
snipe
670a46e85c Merge pull request #11382 from snipe/fixes/check_for_archived_setting_on_counts
Fixes check for archived setting on counts
2022-06-23 16:13:20 -07:00
snipe
daf6c72005 Fleshed out comments on new scope
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 16:02:54 -07:00
snipe
1a4579b770 Missed one
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 16:00:27 -07:00
snipe
398c77bfdc Use new scope for additional tabs
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 15:37:39 -07:00
snipe
d45d322b54 Use scoped query for asset count
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 13:43:23 -07:00
Godfrey M
b0897a1fc9 adds acceptance for consumables and components 2022-06-23 11:52:35 -07:00
Godfrey M
d00b469001 fixed the search for the license 2022-06-23 11:33:36 -07:00
snipe
c5a6cec194 Merge pull request #11380 from snipe/features/better_excel_export
Fixed #11378 - Added better excel export
2022-06-23 11:25:33 -07:00
snipe
e2b1494511 Reordered and added xlsx to export list
Signed-off-by: snipe <snipe@snipe.net>
2022-06-23 11:18:59 -07:00
Godfrey M
df76e6eacf adds eula blade for licenses and fixes assigned_to for dom_pdf 2022-06-23 11:15:15 -07:00
Godfrey M
541ae919d9 fixes dropdown column select font color in bootstrap tables 2022-06-23 09:38:44 -07:00
Ivan Nieto Vivanco
7976401aa2 Add error message when the default customfield values can't be validated 2022-06-22 22:17:05 -05:00
Ivan Nieto Vivanco
7e10abe605 Fix the date control in custom fields' default values form to show the selected date 2022-06-22 21:47:08 -05:00
Ivan Nieto Vivanco
afdf93ca63 Adds controls for custom fields of type date in the default value form 2022-06-22 21:37:11 -05:00
Ivan Nieto Vivanco
321367b974 Adds validation to custom fields' default values 2022-06-22 21:06:07 -05:00
snipe
366f3aacef Merge pull request #11367 from snipe/js_library_updates
Updated/upgraded assets
2022-06-22 16:23:03 -07:00
snipe
4b9ec9218d Upgraded/updates assets
Signed-off-by: snipe <snipe@snipe.net>
2022-06-22 15:54:58 -07:00
snipe
cae66753fb Merge pull request #11323 from Godmartinz/bug/sc-19255/issues-with-black-light-sk
fixes non-dark mode black theme
2022-06-22 15:47:55 -07:00
snipe
5ac9efa9a3 Merge remote-tracking branch 'origin/develop' 2022-06-22 12:20:04 -07:00
snipe
ded635207f Merge pull request #11365 from snipe/fixes/adds_missing_zip_to_user_view
Added missing postal code from user view
2022-06-22 12:19:27 -07:00
snipe
f0f37df76e Added missing postal code from user view
Signed-off-by: snipe <snipe@snipe.net>
2022-06-22 12:18:57 -07:00
snipe
f5702532f0 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-06-22 11:21:51 -07:00
snipe
2f02eee69b Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-06-22 11:21:04 -07:00
snipe
89c234b1c2 Merge pull request #11358 from snipe/fixes/missing_token_lang
Fixed missing password.token string and checked for user existing before attempting to send reset email
2022-06-22 11:15:08 -07:00
snipe
c24052cb2d Merge pull request #11364 from snipe/features/link_asset_to_order_number
Fixed #11351 - add link on asset view to order number
2022-06-22 11:08:40 -07:00
snipe
a7a61a3620 Fixed #11351 - add link on asset view to order number
Signed-off-by: snipe <snipe@snipe.net>
2022-06-22 11:07:54 -07:00
snipe
135fdae209 Merge pull request #11337 from mikeroq/fixes/user_edit_website_missing
Fixed #11332 Added website field that was missing from update and store method.
2022-06-22 10:16:38 -07:00
snipe
5c30de517d Use rate limiter for API calls
Signed-off-by: snipe <snipe@snipe.net>
2022-06-22 09:11:40 -07:00
snipe
a7dc6162fa Simplify password attempts rate limiting
Signed-off-by: snipe <snipe@snipe.net>
2022-06-22 09:11:24 -07:00
snipe
18778d3723 Additional example variables
Signed-off-by: snipe <snipe@snipe.net>
2022-06-22 09:07:48 -07:00
snipe
5ff1b5fd50 Increased throttle
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 19:39:50 -07:00
snipe
1c1f3dc42c Added password requests cleanup to scheduler
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 19:35:16 -07:00
snipe
d67afc3bd0 Merge pull request #11359 from uberbrady/dont_show_images_on_checkin_email_if_not_requested
Fixes issue where asset images were showing up in checkin emails
2022-06-21 19:34:22 -07:00
snipe
a5b857c753 Return error if token is incorrect
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 19:30:51 -07:00
snipe
b00db3cc56 Added throttling to password reset token form
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 19:30:11 -07:00
snipe
57720cb978 Added comment block
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 19:12:57 -07:00
snipe
172e8d463f Use newer forgotten password variables
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 19:11:57 -07:00
snipe
284dbb7553 Set higher threshhold, moved throttle settings
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 19:11:39 -07:00
Brady Wetherington
1156eea8af Fixes issue where asset images were showing up in checkin emails 2022-06-21 19:11:16 -07:00
snipe
17ee332715 Remove throttle from GET in password reset
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 18:53:14 -07:00
snipe
2f258a3e3d Make the strings match
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 18:48:22 -07:00
snipe
a31bca1798 Check that the user is activated before letting them reset their password
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 18:48:02 -07:00
snipe
791f77f641 Fixed throttle variables
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 18:41:12 -07:00
snipe
1b6df232aa Updated string
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 18:41:02 -07:00
snipe
386272a618 Manually add the additional routes so we can throttle them
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 18:40:53 -07:00
snipe
7f8fc7add9 Make SAML debugging less noisy
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 17:57:17 -07:00
snipe
6bc525bc25 Merge pull request #11352 from inietov/fixes/assets_transformer_date_customfields_fixes
Fixed #11335 Assets transformer date customfields issues
2022-06-21 17:56:17 -07:00
snipe
de048e1009 Updated language
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 16:13:59 -07:00
snipe
68150d11b7 Make logo clickable
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 16:13:52 -07:00
snipe
f4f400ed87 Handle workflow better for invalid users
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 16:13:43 -07:00
snipe
a49ccf0863 Removed unused rules
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 16:13:26 -07:00
snipe
300879847f Added a few comments to make it clearer what’s happening
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 14:33:10 -07:00
snipe
d4c53945d9 Tweaked language
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 14:19:49 -07:00
snipe
21875100b6 Fixed missing password.token string and checked for user existing before trying to reset
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 14:15:38 -07:00
snipe
87980643ea Merge pull request #11357 from snipe/fixes/11343_null_asset_name
Fixed #11343 - ability to null asset name on checkin
2022-06-21 10:58:28 -07:00
snipe
675f42401c Fixed #11343 - ability to null asset name
Signed-off-by: snipe <snipe@snipe.net>
2022-06-21 10:57:39 -07:00
Ivan Nieto Vivanco
3a5c09c424 Used the getFormattedDateObject() function with the expected parameters 2022-06-20 19:58:51 -05:00
snipe
3b462ffadc Merge pull request #11329 from mikeroq/fixes/deprecations_pagination_missing
Fixed #11285 - Depreciation index table missing pagination
2022-06-18 19:58:32 -07:00
mikeroq
d60af478ad Added website field that was missing from update and store method. 2022-06-17 08:09:39 -05:00
snipe
cabef8ff12 Merge pull request #11326 from snipe/features/added_number_format_to_tab_badges
Added number_format() to tab badges
2022-06-16 14:05:29 -07:00
Mike Roquemore
8a27ef30d5 Missing total argument on transformDeprecations method
Removed duplicate array key on transformDeprecation method
2022-06-15 21:52:15 -05:00
snipe
a111482217 Use number_format on badges
Signed-off-by: snipe <snipe@snipe.net>
2022-06-15 14:59:06 -07:00
snipe
a758e825ed Dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-06-15 13:45:33 -07:00
snipe
af66f83a3d Check for blank (not null) values i asset transformer date
Signed-off-by: snipe <snipe@snipe.net>
2022-06-15 13:42:30 -07:00
snipe
b3605fa141 Merge remote-tracking branch 'origin/develop' 2022-06-15 11:39:16 -07:00
snipe
6f713985fb Merge pull request #11324 from snipe/features/add_badges_to_companies
Features/add badges to companies
2022-06-15 11:38:32 -07:00
snipe
677e5a8cf1 Added tab badges to company detail view
Signed-off-by: snipe <snipe@snipe.net>
2022-06-15 11:37:44 -07:00
snipe
872600a7a7 Link company on license page
Signed-off-by: snipe <snipe@snipe.net>
2022-06-15 11:37:26 -07:00
Godfrey M
3a879bda4a more adjustments 2022-06-15 11:08:42 -07:00
Godfrey M
a6852cf4d2 fixes non-dark mode black theme 2022-06-15 10:20:25 -07:00
snipe
61c601dbdf 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
2022-06-15 02:09:32 -07:00
snipe
74bc06cc49 Removed debugging code
Signed-off-by: snipe <snipe@snipe.net>
2022-06-15 02:07:58 -07:00
snipe
5fe1078013 Squashed commit of the following:
commit a011b07d99
Merge: b392ed269 6059e9e11
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 14 17:52:50 2022 -0700

    Merge pull request #11315 from snipe/features/adds_fullscreen_option_to_tables

    Added fullscreen option to tables

commit b392ed269b
Merge: 693043e64 e6d792bdf
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 14 17:52:41 2022 -0700

    Merge pull request #11316 from snipe/fixes/smaller_padlock_on_table_header

    Tweaked CSS for smaller padlock

commit 6059e9e119
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 14 17:49:00 2022 -0700

    Added fullscreen option to tables

    Signed-off-by: snipe <snipe@snipe.net>

commit e6d792bdf7
Author: snipe <snipe@snipe.net>
Date:   Tue Jun 14 17:43:12 2022 -0700

    Tweaked CSS for smaller padlock

    Signed-off-by: snipe <snipe@snipe.net>

Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 17:54:18 -07:00
snipe
a011b07d99 Merge pull request #11315 from snipe/features/adds_fullscreen_option_to_tables
Added fullscreen option to tables
2022-06-14 17:52:50 -07:00
snipe
b392ed269b Merge pull request #11316 from snipe/fixes/smaller_padlock_on_table_header
Tweaked CSS for smaller padlock
2022-06-14 17:52:41 -07:00
snipe
6059e9e119 Added fullscreen option to tables
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 17:49:00 -07:00
snipe
e6d792bdf7 Tweaked CSS for smaller padlock
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 17:43:12 -07:00
snipe
f16a4b6aef Removed footer from show category
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 17:16:14 -07:00
snipe
d74b4f55fb Merge remote-tracking branch 'origin/develop' 2022-06-14 17:15:39 -07:00
snipe
693043e645 Merge pull request #11313 from snipe/fixes/nicer_suppliers_mfgs_ui
Nicer suppliers and manufacturers UI
2022-06-14 17:14:53 -07:00
snipe
e935a34946 Merge remote-tracking branch 'origin/develop' 2022-06-14 16:25:50 -07:00
snipe
4052e360c1 Merge pull request #11314 from snipe/fixes/deja_vu_font_pdf
Fixed #11175 - Use the Deja Vu font in PDFs to be able to support Cyrillic, etc
2022-06-14 16:25:33 -07:00
snipe
cc6a2f2d49 Use the Deja Vu font to be able to support cyrllic, etc
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 16:23:30 -07:00
snipe
07bc2fd742 Added maintenance scope for ordering by supplier
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 16:11:43 -07:00
snipe
a57a6486e7 Only add http:// if the url variable isn’t blank
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 16:11:13 -07:00
snipe
a33276cb3d Additional filters on maintenances UI
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 16:10:48 -07:00
snipe
bfec0059c5 Improved manufacturers UI
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 16:10:36 -07:00
snipe
aea9dd1de5 Improved suplpiers UI
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 16:06:56 -07:00
snipe
954b54f914 Removed duplicated $allowed_columns
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 15:06:04 -07:00
snipe
56a15731ef Merge remote-tracking branch 'origin/develop' 2022-06-14 12:56:16 -07:00
snipe
766e59acde Merge pull request #11310 from snipe/fixes/statuslabels_bulk_edit
Fixes #11308 - bulk edit on statuslabels detail page
2022-06-14 12:55:56 -07:00
snipe
f1a63f25e7 Partialize and add data atributes to statuslabel bulk
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 12:50:26 -07:00
snipe
88dfdb7538 Fixed bug in uncheck
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 12:50:10 -07:00
snipe
9072f7c6c9 Added click-to-select to tables
Signed-off-by: snipe <snipe@snipe.net>
2022-06-14 12:49:50 -07:00
snipe
bff34063cd Merge pull request #11309 from uberbrady/ldap_troubleshooter_improvements
Fixed SC-19104 - fixes to ldap:troubleshoot artisan command
2022-06-14 12:24:24 -07:00
Brady Wetherington
1e685ca835 Fixed SC-19104 - fixes to ldap:troubleshoot artisan command 2022-06-14 12:18:42 -07:00
snipe
b55630aafa Merge remote-tracking branch 'origin/develop' 2022-06-14 11:45:27 -07:00
snipe
c3b644797e Merge pull request #11169 from inietov/fixes/user_update_from_import_location_in_assets
Fixes Asset location doesn't change when assigned user's location change via importer
2022-06-14 11:44:26 -07:00
snipe
1806dacb9d Bumped hash on master to 6.0.4
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2022-06-13 23:59:43 -07:00
snipe
abb7f23ca5 Bumped version to 6.0.4
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 23:58:53 -07:00
snipe
b448c89655 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2022-06-13 23:52:48 -07:00
snipe
8857391da7 Merge pull request #11305 from inietov/fixes/trying_to_access_array_offset_on_value_of_type_null
Fixed #11304 Trying to access array offset on value of type null at .../Transformers/AssetsTransformer.php
2022-06-13 23:51:51 -07:00
Ivan Nieto Vivanco
50c008ead5 Adds check in condition that format custom dates 2022-06-14 01:37:15 -05:00
snipe
3e8837dd6e Bumped dev branch to 6.0.3
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 22:13:18 -07:00
snipe
ea1ff1e8bb Bumped version to 6.0.3
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 22:12:40 -07:00
snipe
a7b155108d Merge remote-tracking branch 'origin/develop' 2022-06-13 22:07:13 -07:00
snipe
44c0c1bf0e Merge pull request #11301 from snipe/features/models_view_in_categories
Added models view (and bulk edit) in category detail view
2022-06-13 21:45:43 -07:00
snipe
7cd35a80b6 Updated assets for production
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 20:52:47 -07:00
snipe
e8973f08b5 Added a back button
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 20:47:35 -07:00
snipe
dd9c9520fb Correctly filter by category_id
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 20:42:21 -07:00
snipe
aec033d8d2 Use better phrasing for tab
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 20:33:37 -07:00
snipe
5496b62b33 Split categories into two tabs if the type = asset
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 20:30:50 -07:00
snipe
e393e2eb4b Fixed issue in BS tables where uncheck-all then checking a few would not uncheck properly
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 20:30:35 -07:00
snipe
10781a6e4b Use new bulk edit partial
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 20:29:17 -07:00
snipe
5a86004081 Created new models bulk edit partial
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 20:29:08 -07:00
snipe
91ade1f33e Merge remote-tracking branch 'origin/develop' 2022-06-13 20:02:52 -07:00
snipe
eaecf8137a Updated assets for develop
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 19:52:27 -07:00
snipe
92bb8fac32 Removed log statement
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 19:49:14 -07:00
snipe
d4a7811078 Merge pull request #11282 from Godmartinz/new_Yellow_skin
redone none dark mode yellow skin
2022-06-13 19:48:24 -07:00
snipe
cb8dbcc172 Merge pull request #11281 from Godmartinz/chore_dark_mode_color_clean_up
cleans up dark modes
2022-06-13 19:48:15 -07:00
snipe
495e68d23c Merge pull request #11258 from Godmartinz/bug/sc-19123/link-colors-slightly-different-settings
Fixed colors in light color skins
2022-06-13 19:48:05 -07:00
snipe
20a0c4e3b5 Merge pull request #11272 from inietov/fixes/date_localization_in_customfields
Fixes #8143 Date localization not working on custom fields
2022-06-13 19:47:20 -07:00
snipe
4d773829f8 Merge pull request #10988 from bestlong/bestlong-patch-1
Ensure schedule analysis job never runs on forked repos
2022-06-13 19:45:36 -07:00
snipe
bcb9804be8 Added a little more context to mail template
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 19:44:18 -07:00
snipe
5e59fa2598 Default to $snipeSettings->site_name
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 19:29:46 -07:00
snipe
6ea722d41e Merge pull request #11271 from inietov/fixes/bulk_delete_not_checking_assignedto_type
Fix typo in language files
2022-06-13 19:24:08 -07:00
snipe
66346684a9 Merge pull request #11288 from snipe/fixes/set_crons_as_app_user_in_installer
Fixes - set crons as app user in installer
2022-06-13 19:18:55 -07:00
snipe
9731a31cb6 Merge remote-tracking branch 'origin/develop' 2022-06-13 18:37:18 -07:00
snipe
ef3e016667 Merge pull request #11300 from snipe/fixes/fa_map_icon_in_chrome
Fixed font-awesome leading class
2022-06-13 18:37:04 -07:00
snipe
93e4d23143 Changed font-awesome leading class
Signed-off-by: snipe <snipe@snipe.net>
2022-06-13 18:36:13 -07:00
snipe
0153a37cd7 Merge pull request #11264 from snipe/fixes/set_default_ldap_version
Fixed default ldap version if not specified
2022-06-13 17:14:57 -07:00
snipe
cce5846018 Squashed commit of the following:
commit a070f7cd5e
Merge: 166f52630 4c1104147
Author: snipe <snipe@snipe.net>
Date:   Thu Jun 9 17:23:05 2022 -0700

    Merge pull request #11291 from snipe/fixes/regression_missing_restore_command

    Fixed regression: missing restore option for assets via API

commit 4c11041477
Author: snipe <snipe@snipe.net>
Date:   Thu Jun 9 17:17:38 2022 -0700

    Fixed regression: missing restore option for assets via API

    Signed-off-by: snipe <snipe@snipe.net>

Signed-off-by: snipe <snipe@snipe.net>
2022-06-09 17:23:50 -07:00
snipe
a070f7cd5e Merge pull request #11291 from snipe/fixes/regression_missing_restore_command
Fixed regression: missing restore option for assets via API
2022-06-09 17:23:05 -07:00
snipe
4c11041477 Fixed regression: missing restore option for assets via API
Signed-off-by: snipe <snipe@snipe.net>
2022-06-09 17:17:38 -07:00
snipe
166f526302 Merge pull request #11290 from inietov/fixes/asset_observer_fails_checkout_on_creating
Fixes observer fails when creating and assigning a new asset
2022-06-09 16:13:12 -07:00
Ivan Nieto Vivanco
f8718ffc1e Fixes observer fails when creating and assigning asset 2022-06-09 18:08:04 -05:00
snipe
31e4d3b725 Added second run_as_app_user
Signed-off-by: snipe <snipe@snipe.net>
2022-06-09 14:31:02 -07:00
snipe
a766572a2f Set crons as app user for installer
Signed-off-by: snipe <snipe@snipe.net>
2022-06-09 14:21:38 -07:00
snipe
6a8824a467 Merge pull request #11286 from inietov/fixes/return_element_type_of_customfield
Fixes #11092 Add element type of customfield to API response
2022-06-09 11:40:09 -07:00
Ivan Nieto Vivanco
0c3972d7b7 Add spaces to the code for consistency 2022-06-09 13:02:31 -05:00
Ivan Nieto Vivanco
4a0eb2b3f1 Add element type of customfield to API response 2022-06-09 12:57:20 -05:00
Godfrey M
b3559ac74e redone none dark mode yellow skin 2022-06-08 13:59:46 -07:00
Godfrey M
4252bd2348 cleans up dark modes 2022-06-08 13:17:16 -07:00
snipe
728338bfa8 Merge pull request #10824 from inietov/fixes/accessories_consumables_negative_numbers_develop
Fixes Accessories total quantity shows a negative number for develop branch
2022-06-08 10:53:57 -07:00
snipe
df8834fd88 Merge pull request #11278 from Godmartinz/bug/sc-19134/possible-missing-wrong-translations-in-ldap
fixes translation references in the users ldap blade
2022-06-08 10:47:03 -07:00
Godfrey M
c8bc0eff11 fixes translation references in the users ldap blade 2022-06-08 09:52:55 -07:00
snipe
8b6e869215 Merge pull request #11276 from snipe/fixes/added_bulk_data_attributes_to_manufacturers
Added new JS data attributes for assets in manufacturers
2022-06-08 04:19:38 -07:00
snipe
063893c109 Added new JS data attributes for assets in manufacturers
Signed-off-by: snipe <snipe@snipe.net>
2022-06-08 04:18:05 -07:00
Ivan Nieto Vivanco
44f4f20187 Only fix typo in 'en' file 2022-06-07 19:09:59 -05:00
Ivan Nieto Vivanco
792b18f845 Return language files to previous state 2022-06-07 19:09:03 -05:00
snipe
0671e478cd Merge pull request #11273 from inietov/fixes/eol_without_specified_date_format
Fixes EOL field doesn't have date formatter applied
2022-06-07 17:01:46 -07:00
Ivan Nieto Vivanco
d2fc27e21d Add formatted date to EOL field in asset detailed view 2022-06-07 18:22:09 -05:00
Ivan Nieto Vivanco
740f27198f Evaluate if a custom field is a Date to present it with the correct format 2022-06-07 18:00:46 -05:00
Ivan Nieto Vivanco
064f4b3fc6 Fix typo in language files 2022-06-07 16:30:18 -05:00
snipe
5458676ead Default to v3 of LDAP on settings save
Signed-off-by: snipe <snipe@snipe.net>
2022-06-06 21:00:22 -07:00
snipe
8337628323 Set elvis operator to ensure ldap version is 3 if null
Signed-off-by: snipe <snipe@snipe.net>
2022-06-06 20:57:18 -07:00
snipe
7faaa4ce24 Merge pull request #11263 from inietov/fixes/dont_save_update_action_if_nothings_changed
Fixes log update action even if no changes are made to assets [sc-19131]
2022-06-06 20:06:19 -07:00
snipe
9583a72016 Merge pull request #11262 from snipe/fixes/11093_use_true_false_in_custom_fields_fieldsets
Fixed #11093 - Return true/false for custom fields/fieldsets required value in API
2022-06-06 20:04:52 -07:00
snipe
e0102ddbf0 Fixes #11093 Return true/false for custom fields/fieldsets required in API
Signed-off-by: snipe <snipe@snipe.net>
2022-06-06 20:03:20 -07:00
Ivan Nieto Vivanco
1030ad9a27 Early returns if no change is made in the Asset so the 'update' action doesn't log 2022-06-06 22:00:05 -05:00
snipe
ab8dcdcc40 Merge remote-tracking branch 'origin/master' into develop 2022-06-06 19:35:29 -07:00
snipe
773997a492 Merge pull request #11261 from snipe/features/11255_add_location_2_to_locations_listing
Fixed #11255 - add address 2 field to locations listing
2022-06-06 19:35:07 -07:00
snipe
8333c80b7a Added address2 to column selector for locations listing
Signed-off-by: snipe <snipe@snipe.net>
2022-06-06 19:31:08 -07:00
snipe
96644ab6b9 Merge pull request #11259 from inietov/fixes/history_issues
Fixes some issues in the asset observer
2022-06-06 18:25:05 -07:00
Ivan Nieto Vivanco
f977c53ecb Fixes some issues in the asset observer 2022-06-06 19:14:32 -05:00
Godfrey M
8c1843b351 updates colors in light color modes 2022-06-06 11:40:57 -07:00
snipe
c9e86ac194 Merge remote-tracking branch 'origin/develop' 2022-06-06 10:23:37 -07:00
snipe
f7449921e9 Merge pull request #11253 from snipe/features/nicer_locations_ui
Nicer locations UI
2022-06-06 10:23:04 -07:00
snipe
5f79534f4a Merge remote-tracking branch 'origin/develop' 2022-06-05 22:44:53 -07:00
snipe
3bcd5d94d6 Merge pull request #11254 from snipe/fixes/11224_only_show_possible_options_in_bulk_menu
Fixed  #11224 - only show menu options if the user is allowed
2022-06-05 22:44:26 -07:00
snipe
01348187c8 Fixed #11224 - only show menu options if the user is allowed
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 22:41:53 -07:00
snipe
b26a4ad333 Added missing headers
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 21:35:57 -07:00
snipe
89f45d3d05 Removed extra console logs and unused variable
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 21:16:29 -07:00
snipe
e83a062eda Use translation string for model editing
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 21:11:50 -07:00
snipe
1ea667e709 Update views with additional data fields
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 21:03:56 -07:00
snipe
5326ebd136 Removed toolbar div we weren’t using
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 21:03:45 -07:00
snipe
4db9892f8c Use partial in overdue audit screen
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 21:03:12 -07:00
snipe
880828379e Update bulki partials with new values
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 21:02:51 -07:00
snipe
9b54077409 Additional tweaks to BS tables partial
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 21:02:19 -07:00
snipe
9f478b51e2 Additional JS tweaking
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 20:13:51 -07:00
snipe
7c77e03c5a Initial rework of locations display
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 18:08:15 -07:00
snipe
9d3aed42b7 Add @denzfarid as a contributor 2022-06-05 17:16:58 -07:00
snipe
3dedd51b84 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2022-06-05 17:16:21 -07:00
snipe
711c713ab8 Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 17:15:29 -07:00
snipe
5bc5e9f108 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	resources/lang/en/admin/locations/general.php
2022-06-05 17:14:31 -07:00
snipe
9770692d07 Merge pull request #11251 from denzfarid/fixes/docker-php-redis-extension
Fixed #10910  : Add php-redis extension
2022-06-05 17:09:39 -07:00
snipe
133da6569b Merge pull request #11252 from snipe/fixes/locations_improvements
Fixes/locations improvements
2022-06-05 17:05:25 -07:00
snipe
985e683896 Small display improvements
Signed-off-by: snipe <snipe@snipe.net>
2022-06-05 16:59:53 -07:00
Raden Farid Nugraha
c3698053ea Fixed ( #10910 ) : Add php redis extension 2022-06-06 06:58:07 +07:00
snipe
dba06a3a9e Check for valid location before trying to print
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 16:56:15 -07:00
snipe
07b1062fb2 Better handle API calls to nonexistent users
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 16:55:23 -07:00
snipe
be0933a708 Merge pull request #11249 from snipe/fixes/better_handle_bad_date_values
Fixed crashing on date formatting helper when value is not actually a date
2022-06-03 16:46:09 -07:00
snipe
d31f185cce Display the actual value
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 15:36:52 -07:00
snipe
5901182885 Removed stray character
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 15:30:34 -07:00
snipe
f033aeda83 Fixed typo in comments
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 15:28:00 -07:00
snipe
53f9e2bc7a Wrap the Carbon method in a try/catch to prevent crashing on bad data
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 15:25:39 -07:00
snipe
514db05770 Merge remote-tracking branch 'origin/develop' 2022-06-03 13:29:04 -07:00
snipe
7ca617f077 Merge pull request #11246 from snipe/fixes/clearer_placeholder_text_for_ldap
Added explicit “Example:” text in placeholders
2022-06-03 13:28:40 -07:00
snipe
8f5ac5fb55 Removed quotes around filter query
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 13:01:53 -07:00
snipe
54f828743e Merge remote-tracking branch 'origin/develop' 2022-06-03 12:54:13 -07:00
snipe
f519fb747f Merge pull request #11248 from snipe/fixes/corrected_gate_on_assetmodels
Updated Asset Model gate to correctly display the button on view
2022-06-03 12:53:52 -07:00
snipe
36f714e414 Updated Asset Model gate to correctly display the button on view
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 12:52:53 -07:00
snipe
773c773773 Merge pull request #11247 from snipe/fixes/added_missing_validation_translations
Added the validation strings for user creation password options
2022-06-03 12:03:47 -07:00
snipe
3071a83ae0 Added the validation strings for user creation password options
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 12:00:56 -07:00
snipe
1c4864a3cc Added explicit “Example:” text in placeholders
Signed-off-by: snipe <snipe@snipe.net>
2022-06-03 11:25:18 -07:00
snipe
50c92d4730 Merge remote-tracking branch 'origin/develop' 2022-06-02 17:09:52 -07:00
snipe
f8a0bf6a4b Merge pull request #11244 from snipe/fixes/drop_log_level_to_warn_on_SAML
Dropped log level to warn on SAML error
2022-06-02 17:09:32 -07:00
snipe
910fc08406 Dropped log level to warn on SAML error
Signed-off-by: snipe <snipe@snipe.net>
2022-06-02 17:07:49 -07:00
snipe
eebc56d54b Merge remote-tracking branch 'origin/develop' 2022-06-02 16:33:04 -07:00
snipe
b5ddc2c85b Merge pull request #11243 from snipe/fixes/fix_diff_time_in_audit_report
Don’t use the formatted date for diff days in audit report
2022-06-02 16:32:46 -07:00
snipe
4e03ebe284 Don’t use the formatted date for diff days in audit report
Signed-off-by: snipe <snipe@snipe.net>
2022-06-02 16:30:26 -07:00
snipe
7577fc61e4 Merge pull request #11235 from Godmartinz/gh_5644-checkout_history_for_accessories
fixed issue with misplaced div
2022-06-01 17:03:23 -07:00
Godfrey M
d302675056 fixed a div placement 2022-06-01 16:58:29 -07:00
Godfrey M
5316f41eba fixed a div placement 2022-06-01 16:56:01 -07:00
snipe
fa6c463d46 Merge pull request #11046 from Godmartinz/gh_5644-checkout_history_for_accessories
Added history tab to accessories
2022-06-01 12:46:38 -07:00
snipe
23a441e7c8 Merge remote-tracking branch 'origin/develop' 2022-06-01 10:27:50 -07:00
snipe
ac993184ee Merge pull request #11233 from snipe/fixes/11232_depreciation_layout
Fixed #11232 - missing closing div
2022-06-01 10:27:25 -07:00
snipe
1dbc1f4aa2 Fixed #11232 - missing closing div
Signed-off-by: snipe <snipe@snipe.net>
2022-06-01 10:26:26 -07:00
Achmad Fienan Rahardianto
fe65de1207 implements cookie to maintain display preference 2022-06-01 11:54:05 +07:00
snipe
089704c4f9 Merge remote-tracking branch 'origin/develop' 2022-05-31 14:17:23 -07:00
snipe
bb933e5214 Merge pull request #11227 from inietov/fixes/exception_getimagesize
Fixes #11116 Error exception in getimagesize
2022-05-31 14:09:18 -07:00
Ivan Nieto Vivanco
eb34cf7917 Evaluates if logo is uploaded before export PDF 2022-05-31 15:59:01 -05:00
snipe
4909cf2a9e Merge pull request #11212 from inietov/fixes/checkout_logs_require_target
Fixes Exception checkout logs require target
2022-05-28 06:12:55 -07:00
Ivan Nieto Vivanco
37f9cca5ec Minor stylistic change 2022-05-28 08:11:13 -05:00
Ivan Nieto Vivanco
72192257f2 Delete a test file 2022-05-26 18:18:13 -05:00
Ivan Nieto Vivanco
e0050bc844 Don't let a license to be checked out to a non-existent target 2022-05-26 18:06:53 -05:00
snipe
d2d0842737 Merge pull request #11206 from snipe/features/suggest_updating_global_composer
Added a self-update suggestion in the upgrader
2022-05-26 11:30:09 -07:00
snipe
fe3b9f9e86 Added a self-update suggestion in the upgrader
Signed-off-by: snipe <snipe@snipe.net>
2022-05-25 19:18:37 -07:00
snipe
0ea6671bfa Merge pull request #11202 from snipe/fixes/livewire_config
Starter Livewire config (for subdirectories)
2022-05-25 17:32:17 -07:00
snipe
9209675d45 Merge pull request #11204 from inietov/fixes/file_uploads_dont_show_in_target_activity_report
Fixes #11193 File Uploads don't show target in Activity report
2022-05-25 17:30:01 -07:00
Ivan Nieto Vivanco
3e44f39f4d Set the new File column as not visible by default 2022-05-25 19:19:25 -05:00
Ivan Nieto Vivanco
1f6ab340a6 Give a more descriptive name to variable 2022-05-25 18:53:17 -05:00
Ivan Nieto Vivanco
f208869aff Add column to show filenames in Activity Report if the log action is 'uploaded' 2022-05-25 18:50:32 -05:00
snipe
c031686825 Fixed path
Signed-off-by: snipe <snipe@snipe.net>
2022-05-25 15:12:38 -07:00
snipe
791c39d977 Starter Livewire config (for subdirectories)
Signed-off-by: snipe <snipe@snipe.net>
2022-05-25 15:10:20 -07:00
snipe
aac432b00c Merge remote-tracking branch 'origin/develop' 2022-05-24 20:53:36 -07:00
snipe
2b5b3273e2 Strip quote marks from env_values
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 20:52:03 -07:00
snipe
4f57eebf24 Merge remote-tracking branch 'origin/develop' 2022-05-24 20:10:13 -07:00
snipe
0c9a1a8922 Merge pull request #11198 from snipe/features/check_for_dev_v_prod_in_updater
Check for APP_ENV in upgrader
2022-05-24 20:09:43 -07:00
snipe
fa2a3e4b03 Added a line break
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 20:08:04 -07:00
snipe
94a337fc9e Rearrange a few thing
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 20:03:10 -07:00
snipe
8d9cdf9c15 Check for APP_ENV
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 19:56:42 -07:00
snipe
fb8d52d599 Merge remote-tracking branch 'origin/develop' 2022-05-24 19:37:34 -07:00
snipe
070c36ffe6 Merge pull request #11197 from uberbrady/improve_ldap_php_81
Fixes #11119 - Downgraded/Removed log statements
2022-05-24 19:37:04 -07:00
snipe
5db1c50816 Merge pull request #11196 from snipe/fearures/env_checker_in_upgrader
Added a simple .env checker into the upgrader
2022-05-24 19:36:21 -07:00
snipe
43e97ea6ea Make printout more consistent
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 19:36:01 -07:00
Brady Wetherington
8fdedf9441 Downgraded/Removed log statements 2022-05-24 19:30:22 -07:00
snipe
b67ed3eac2 Check for present APP_KEY as well
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 19:24:03 -07:00
snipe
116ce931ce Fixed path name to backup temp dir
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 18:44:32 -07:00
snipe
15d0fb4feb Added permissions check
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 18:40:15 -07:00
snipe
132b164a74 Slightly clarified error text
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 17:51:46 -07:00
snipe
bdbe2c3ac6 Added a simple .env checker into the upgrader
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 17:43:23 -07:00
snipe
2db6cf85a7 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2022-05-24 15:10:46 -07:00
snipe
5be7dee3d3 Updated language strings
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 15:07:14 -07:00
snipe
72799973e7 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 14:41:44 -07:00
snipe
d8a8e03bf6 Nicer styling
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 14:39:01 -07:00
snipe
a243823e5e Merge pull request #11190 from inietov/fixes/requested_assets_models_workflow
Adjust requested assets and models workflow a little bit.
2022-05-24 14:31:40 -07:00
Ivan Nieto Vivanco
a4cf601c98 Remove extra tag and other stylistic changes 2022-05-24 16:27:55 -05:00
Ivan Nieto Vivanco
1e3c0d597e Use @can view directive instead of @if superadmin 2022-05-24 15:53:26 -05:00
snipe
91822d2e45 Use shorter helper config method
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 13:26:29 -07:00
snipe
43c5b412ca Merge remote-tracking branch 'origin/develop' 2022-05-24 13:17:39 -07:00
snipe
08ff71aae3 Merge pull request #11192 from snipe/fixes/typo_on_maintenance_screen
Fixed typo on maintenance screen
2022-05-24 13:16:50 -07:00
snipe
5d83516659 Fixed typoe on maintenance screen
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 13:15:01 -07:00
snipe
f39005d295 Merge remote-tracking branch 'origin/develop' 2022-05-24 13:13:21 -07:00
snipe
0e6c82776a Merge pull request #11191 from snipe/fixes/corrected_activated_language_in_bulk_edit
Updated language strings from activated to able to login
2022-05-24 13:13:02 -07:00
snipe
67616dbcf4 Updated language strings from activated to able to login
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 13:12:02 -07:00
snipe
5881eef2c6 Merge remote-tracking branch 'origin/develop' 2022-05-24 13:01:16 -07:00
snipe
4839985f38 Added forced space after admin/superadmin badge
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 12:59:36 -07:00
Ivan Nieto Vivanco
aa841a4674 Check permission before show links or not in requestable asset models view 2022-05-24 14:40:32 -05:00
Ivan Nieto Vivanco
6d1de73cad Fixes some html structure in the requested assets view 2022-05-24 14:06:05 -05:00
Ivan Nieto Vivanco
e0b64a4879 Fixes constraint violation when ordering some columns 2022-05-24 14:00:23 -05:00
Ivan Nieto Vivanco
0a6626891e Add links to requestable Models' name 2022-05-24 13:36:13 -05:00
snipe
2ec7644a33 Merge remote-tracking branch 'origin/develop' 2022-05-24 10:49:13 -07:00
snipe
810578ff5d Merge pull request #11189 from snipe/fixes/show_username_on_user_view_if_not_admin
Fixed bug where username wasn’t showing for regular users
2022-05-24 10:48:55 -07:00
snipe
64eafb062e Fixed bug where username wasn’t showing for regular users
Signed-off-by: snipe <snipe@snipe.net>
2022-05-24 10:48:02 -07:00
snipe
ad56928d04 Merge remote-tracking branch 'origin/develop' 2022-05-23 20:35:40 -07:00
snipe
30583f920d Merge pull request #11184 from uberbrady/fix_google_ldap_rebased
Google client-side TLS auth works better with null as context(?)
2022-05-23 20:35:15 -07:00
Brady Wetherington
5130a86854 Google client-side TLS auth works better with null as context(?) 2022-05-23 20:31:43 -07:00
snipe
e4e32307de Merge remote-tracking branch 'origin/develop' 2022-05-23 20:15:33 -07:00
snipe
e34ea32a5e Fixed translation styring reference
Signed-off-by: snipe <snipe@snipe.net>
2022-05-23 20:15:22 -07:00
snipe
b8e6df545a Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2022-05-23 18:55:57 -07:00
snipe
90a4ce5723 Merge remote-tracking branch 'origin/develop' 2022-05-23 18:54:40 -07:00
snipe
8333089278 Merge pull request #11172 from snipe/rebased_added_gitkeep_to_to_eula_pdfs
Accept asset/accessory improvements and fixes
2022-05-23 12:59:01 -07:00
snipe
70344cc02e Merge pull request #11149 from Godmartinz/gh11129_setting_disclosure_arrow
Fixed #11129 - settings treeview won't stay active.
2022-05-23 12:55:11 -07:00
Godfrey M
4adb990a5d removed line breaks and deadspace 2022-05-23 09:37:20 -07:00
Godfrey M
160a147a58 removed line breaks and deadspace 2022-05-23 09:35:19 -07:00
snipe
bd384d3f10 Small formatting fixes
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
ad8143b0bd Added comments
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
f439970e7a Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
625f120813 Removed unused cases
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
a37a576ee5 FIxed translation string
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
2bd0679a81 A few more tweaks to PDFs
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
b7eb72fe49 Rough refactor of the acceptance controller
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
afb3843fad Added sig and filename to acceptedCheckout method
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
8e85d316c9 Removed stored_eula_file from API transformer
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
ebd3c11129 Added singleton
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
75acb0f28a Added sig and eula pdf to checkout_acceptance
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
eb5f33e815 Removed logging statement
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
8c64e7359a Added signature column, removed stored_eula_file column
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
14495cd1da Nicer PDF display
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
93eba43b76 Removed trailing slash from route
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
adbac82c30 Removed stored_eula_file from actionlog
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
e467ce912b Added some debugging and comments
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
4eab5fd075 Removed older comments
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
d0e8a4ca09 Added some comments for clarity
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
bcd0671213 Migration to drop stored_eula_column
It’s extraneous, since we already have a file field in the action_logs, and we already store the stored_eula_file in checkout_acceptances.

Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
266a9e5328 Removed stored_eula_file from controller
Signed-off-by: snipe <snipe@snipe.net>
2022-05-19 17:55:59 -07:00
snipe
a37fbe6abf Merge pull request #11171 from inietov/fixes/checkout_date_missing_in_mail_when_importing_assets
Fixes Checkout date missing in asset delivery mail
2022-05-19 15:49:43 -07:00
Ivan Nieto Vivanco
52901f50eb Add date to checkout action when importing assets 2022-05-19 17:38:10 -05:00
Ivan Nieto Vivanco
340c59969c Add query to update assigned assets location when importing users 2022-05-19 13:34:50 -05:00
snipe
8706b6d8a9 Merge pull request #11167 from inietov/fixes/error_500_on_import_page
Fixes #9019 Import page returns error 500
2022-05-19 10:50:59 -07:00
Ivan Nieto Vivanco
5d29f77d60 Initialize result variable so return don't crash 2022-05-19 12:47:12 -05:00
snipe
61a6c83418 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	public/css/dist/skins/skin-black.css
#	public/css/dist/skins/skin-black.min.css
#	public/css/dist/skins/skin-blue.css
#	public/css/dist/skins/skin-blue.min.css
#	public/css/dist/skins/skin-green.css
#	public/css/dist/skins/skin-green.min.css
#	public/css/dist/skins/skin-orange.css
#	public/css/dist/skins/skin-orange.min.css
#	public/css/dist/skins/skin-purple.css
#	public/css/dist/skins/skin-purple.min.css
#	public/css/dist/skins/skin-red.css
#	public/css/dist/skins/skin-red.min.css
#	public/css/dist/skins/skin-yellow.css
#	public/css/dist/skins/skin-yellow.min.css
#	public/mix-manifest.json
2022-05-18 17:21:32 -07:00
snipe
deda1c2fd6 Merge pull request #11161 from snipe/fixes/corrects_retagging_script
Small fixes for asset tag regeneration script
2022-05-18 17:19:40 -07:00
snipe
4669bb54fe Small fixes for asset tag regeneration script
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 17:14:22 -07:00
snipe
319eae7810 Recompiled dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 16:21:04 -07:00
snipe
8449b5ca1e Merge pull request #11160 from uberbrady/improve_default_custom_field_value_on_asset_create
Fixed: #11098 - Smartly overwrite fields with default values for custom fields
2022-05-18 16:12:12 -07:00
Brady Wetherington
e4b24e17f3 Improve comments because the logic is complicated and unintuitive 2022-05-18 16:06:39 -07:00
Brady Wetherington
981741062b Try to intelligently overwrite fields with default values for custom field 2022-05-18 15:51:32 -07:00
snipe
a55adfc0a1 Merge pull request #11152 from Godmartinz/link_inconsistentcies
Thanks!
2022-05-18 15:45:30 -07:00
snipe
f609146c29 Corrected field name
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 15:37:10 -07:00
snipe
891009dc67 Nicer formatting for buttons in bulk user edit
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 15:35:57 -07:00
Godfrey M
ab23e04c65 re-adds Request::is to setting categories 2022-05-18 14:33:41 -07:00
Godfrey M
877b1bd0a3 re-adds Request::is to setting categories 2022-05-18 14:31:03 -07:00
snipe
c0d352dd7d Merge remote-tracking branch 'origin/develop' 2022-05-18 14:17:51 -07:00
snipe
bef895eaf4 Merge pull request #11158 from snipe/fixes/perform_db_migrate_on_restore
Run migrations after restore
2022-05-18 14:17:21 -07:00
snipe
014a32b050 Run migrations after restore
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 14:12:17 -07:00
snipe
937472feb0 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
2022-05-18 13:37:31 -07:00
snipe
f14a4d3bc7 Recompiled dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 13:35:38 -07:00
snipe
9e9d371e1c Merge pull request #11157 from uberbrady/fix_select2_autofocus
Downgrade jQuery to 3.5.1 from 3.6.0 to re-enable select2 autofocus
2022-05-18 13:34:22 -07:00
Brady Wetherington
9e2bcfe168 Downgrade jQuery to 3.5.1 from 3.6.0 to re-enable select2 autofocus 2022-05-18 13:24:02 -07:00
Godfrey M
eaeb74c576 readded comment 2022-05-18 13:13:38 -07:00
Godfrey M
23891054dc removed dead space and unused namespace 2022-05-18 13:11:20 -07:00
Godfrey M
cfc4c58da3 fixes the Settings Tree menu to remain active when opened 2022-05-18 13:06:06 -07:00
snipe
5f187f71c8 Merge remote-tracking branch 'origin/develop' 2022-05-18 13:05:47 -07:00
snipe
b2250ecb7a Merge pull request #11156 from inietov/fixes/error_500_on_unaccepeted_assets_report
Fixes error 500 on Unaccepted Assets Report
2022-05-18 13:04:54 -07:00
Ivan Nieto Vivanco
1453b36484 Add filter to only get Assets for the unaccepted assets report 2022-05-18 14:46:48 -05:00
snipe
4b21d9e7f4 Rebuild production assets
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 11:13:18 -07:00
snipe
4644f1479b Merge pull request #11154 from inietov/fixes/username_required_on_import
Fixes Username required on import process
2022-05-18 11:12:07 -07:00
snipe
3bf2328db2 Regenerated dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 11:11:34 -07:00
snipe
7d637eaa5a Merge pull request #11153 from Godmartinz/gh11146_license_detail_formatting
updated less files for license details to adhere to dark skin themes
2022-05-18 11:09:26 -07:00
Ivan Nieto Vivanco
32111a863b Call User::generateFormattedNameFromFullName() in the UserImporter 2022-05-18 13:02:44 -05:00
Godfrey M
0ed59753da updated less files for license details to adhere to dark skin themes 2022-05-18 10:55:57 -07:00
Godfrey M
75f5f3a0a8 fixes inconsistencies with links styling 2022-05-18 09:37:53 -07:00
Godfrey M
07679aa376 settings treeview won't stay active. still experimenting with potential solutions 2022-05-18 08:40:37 -07:00
snipe
b7b21689f2 Merge remote-tracking branch 'origin/develop' 2022-05-18 04:25:23 -07:00
snipe
b426fa352e Merge pull request #11147 from inietov/fixes/argument_passed_to_ItemImportRequest_is_null
FixesArgument 1 passed to App\Http\Requests\ItemImportRequest::import() must be an instance of App\Models\Import, null given
2022-05-18 04:24:46 -07:00
Ivan Nieto Vivanco
a771984619 Add an early return if for some reason the import record is not found 2022-05-18 06:15:46 -05:00
snipe
71828d5461 One more trim…. sigh..
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 03:53:42 -07:00
snipe
d9817ec696 Added a trim
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 03:51:53 -07:00
snipe
33ded3f18a More debugging
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 03:48:09 -07:00
snipe
004d567253 Added some debugging
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 03:31:00 -07:00
snipe
e2fd5199c3 Merge remote-tracking branch 'origin/develop' 2022-05-18 02:43:14 -07:00
snipe
b7b3b1a776 Merge pull request #11144 from snipe/fixes/add_spinner_to_backup_upload_icon
Added spinner onClick for file upload button on backups
2022-05-18 02:42:40 -07:00
snipe
4078e4e323 Added spinner onClick for file upload button on backups
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 02:40:32 -07:00
snipe
64d457425e Merge remote-tracking branch 'origin/develop' 2022-05-18 01:06:53 -07:00
snipe
524ef8261b Merge pull request #11142 from snipe/fixes/11141_fixed_accessories_api_endpoint
Fixed #11141 - accessories endpoint missing from API
2022-05-18 01:06:29 -07:00
snipe
344dcc10c1 Fixed #11141 - accessories endpoint missing from API
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 01:04:50 -07:00
snipe
2ad97ca040 Merge remote-tracking branch 'origin/develop' 2022-05-18 00:59:33 -07:00
snipe
7880e15672 Merge pull request #11140 from snipe/fixes/11120_textarea_on_fieldset
Fixed #11120 - custom fields not showing when textarea is present as field type
2022-05-18 00:59:13 -07:00
snipe
ceffbb950f Fixed #11120 - custom fields not showing when textarea is present as field type
Signed-off-by: snipe <snipe@snipe.net>
2022-05-18 00:47:22 -07:00
snipe
b941ea6950 Merge remote-tracking branch 'origin/develop' 2022-05-17 20:07:41 -07:00
snipe
54c1659210 Merge pull request #11139 from uberbrady/reduce_saml_debugging
Reduce saml debugging
2022-05-17 20:07:09 -07:00
Brady Wetherington
b4a0d33ba8 Reduce logging further; we know the main error condition now 2022-05-17 19:57:42 -07:00
Brady Wetherington
4e65a8d755 Reduce SAML debugging output to actual error conditions 2022-05-17 19:54:14 -07:00
snipe
bf028adcc3 Updated production assets
Signed-off-by: snipe <snipe@snipe.net>
2022-05-17 19:33:50 -07:00
snipe
137b558bef Merge pull request #11138 from snipe/fixes/updated_packages
Bumped packages
2022-05-17 19:32:18 -07:00
snipe
be5be7a8b9 Bumped packages
Signed-off-by: snipe <snipe@snipe.net>
2022-05-17 19:30:57 -07:00
snipe
2b3a1ee120 Merge pull request #11137 from snipe/fixes/removed_weird_file_in_upgrader
Delete vendor/symfony/translation/TranslatorInterface.php in upgrader
2022-05-17 19:13:20 -07:00
snipe
d316a3f044 Added trailing comma per convention
Signed-off-by: snipe <snipe@snipe.net>
2022-05-17 19:13:07 -07:00
snipe
105750bfde Delete vendor/symfony/translation/TranslatorInterface.php in upgrader
Signed-off-by: snipe <snipe@snipe.net>
2022-05-17 19:11:03 -07:00
snipe
3e34027ae0 Merge pull request #11136 from snipe/fixes/new_maintenance_page
Fixed #11124 - updated maintenance page
2022-05-17 19:03:54 -07:00
snipe
0f9559c1ff Fixed #11124 - updated maintenance page
Signed-off-by: snipe <snipe@snipe.net>
2022-05-17 19:01:37 -07:00
snipe
11db243514 Merge pull request #11135 from uberbrady/improve_restore_erroring
Do some better erroring if you can't launch the mysql binary
2022-05-17 18:16:40 -07:00
Brady Wetherington
d391980b06 Do some better erroring if you can't launch the mysql binary 2022-05-17 17:01:23 -07:00
snipe
a8eb138ae0 Merge pull request #11133 from inietov/fixes/backup_createdat_time_incorrect
Fixes #11096 Backup created_at time is incorrect
2022-05-17 14:39:19 -07:00
Ivan Nieto Vivanco
72493d54aa Show the date and time as the user select in their settings 2022-05-17 16:36:05 -05:00
Ivan Nieto Vivanco
91c7a89f93 Change to use the date() function instead of Helper::getFormattedDateObject() 2022-05-17 16:24:52 -05:00
snipe
11f540daaf Added debug line
Signed-off-by: snipe <snipe@snipe.net>
2022-05-17 09:41:35 -07:00
snipe
700b4ef058 Merge pull request #11127 from trav-c/bugfix/issue-11126-custom-css-encoding
Fixed #11126: don't entitise custom CSS on the labels view
2022-05-17 07:22:21 -07:00
Travers Carter
1fc0adf7b7 Fixed #11126: don't entitise custom CSS on the labels view 2022-05-18 00:16:18 +10:00
snipe
58875d5606 Added gitgnore to eula-pdfs
Signed-off-by: snipe <snipe@snipe.net>
2022-05-17 04:28:18 -07:00
snipe
0dfc98a493 Force db:wipe
Signed-off-by: snipe <snipe@snipe.net>
2022-05-17 04:27:48 -07:00
snipe
15a1db480a Merge pull request #11115 from snipe/fixes/update_constraints_to_php82
Update constraints to allow up to 8.2
2022-05-16 17:42:50 -07:00
snipe
3dc4f56fb4 Update constraints to allow up to 8.2
Signed-off-by: snipe <snipe@snipe.net>
2022-05-16 17:23:41 -07:00
snipe
7da8ec8448 Merge remote-tracking branch 'origin/develop' 2022-05-16 17:02:54 -07:00
snipe
a973c0626e Merge pull request #11114 from uberbrady/bad_header_label_for_size_in_backups
We inadvertently used the wrong label for one of the headers
2022-05-16 17:02:31 -07:00
Brady Wetherington
213d990e47 We inadvertently used the wrong label for one of the headers on the backups page 2022-05-16 17:00:22 -07:00
snipe
a5fbfdbab4 Merge remote-tracking branch 'origin/develop' 2022-05-16 16:51:46 -07:00
snipe
b705878318 Merge pull request #11113 from snipe/fixes/11112_correct_formatter_for_locations
Fixed #11112 - use correct formatter for locations on dashboard
2022-05-16 16:51:22 -07:00
snipe
925529923a Fixed #11112 - use correct formatter for locations on dashboard
Signed-off-by: snipe <snipe@snipe.net>
2022-05-16 16:50:47 -07:00
snipe
13ce7513f0 Merge remote-tracking branch 'origin/develop' 2022-05-16 15:59:54 -07:00
snipe
7a1b17ff6a Backslash log:: (we shouldn’t have to do this tho?)
Signed-off-by: snipe <snipe@snipe.net>
2022-05-16 15:59:41 -07:00
snipe
b32fba7f8a Switch to master
Signed-off-by: snipe <snipe@snipe.net>
2022-05-16 15:33:26 -07:00
snipe
7573a03cc5 Bumped minor version
Signed-off-by: snipe <snipe@snipe.net>
2022-05-16 15:32:57 -07:00
snipe
b2e7572fe0 Merge pull request #11111 from snipe/fixes/individual_pass_reset
Fixed #11100 for individual users
2022-05-16 12:08:08 -07:00
snipe
d4f7b5f80c Fixed #11100 for individual users
Signed-off-by: snipe <snipe@snipe.net>
2022-05-16 12:07:18 -07:00
snipe
64b582c657 Merge pull request #11108 from uberbrady/fix_ldap_first_login_password
Pass the password along directly instead of retrieving it from the In…
2022-05-16 11:01:35 -07:00
Brady Wetherington
6c86a28d18 Pass the password along directly instead of retrieving it from the Input or Request 2022-05-16 10:58:27 -07:00
snipe
63f8b0cad1 Merge pull request #11107 from uberbrady/fix_bulk_user_reset_passwords
Fixed #11104 - bulk-user reset-password links returning 500
2022-05-16 10:41:37 -07:00
Brady Wetherington
b05d85ab0a Fix bulk-user reset-password links 2022-05-16 10:38:12 -07:00
snipe
93e509bd79 Merge pull request #11105 from snipe/fixes/upgrade_dom_pdf
Upgraded dompdf
2022-05-16 10:18:37 -07:00
snipe
4c06a451b8 Upgraded dompdf
Signed-off-by: snipe <snipe@snipe.net>
2022-05-16 10:17:46 -07:00
snipe
1c32dcae9f Add login note to demo resetter
Signed-off-by: snipe <snipe@snipe.net>
2022-05-15 10:20:03 -07:00
snipe
33c3a5a8ca Merge pull request #11088 from uberbrady/fix_ldap_manager_sync
Only set manager ID when the lookup succeeds.
2022-05-15 09:45:04 -07:00
Brady Wetherington
f608e4586c Only set manager ID when the lookup succeeds. 2022-05-15 09:25:28 -07:00
snipe
a050be873b Merge pull request #11080 from snipe/fixes/remove_sr_only_for_backup_file
Removed sr-only class for now - not sure why it’s interfering with the upload button
2022-05-14 11:02:55 -07:00
snipe
ed8e82a606 Removed sr-only class for now - not sure why it’s interfering with the submit button JS
Signed-off-by: snipe <snipe@snipe.net>
2022-05-14 11:02:02 -07:00
snipe
8eed01bfa4 Merge pull request #11078 from snipe/fixes/show_encrypted_on_custom_field_view
Adds encrypted status to custom fields overview
2022-05-14 10:25:45 -07:00
snipe
418131df69 Merge pull request #11079 from snipe/fixes/adds_missing_backups_help_string
Fixed missing backups help string
2022-05-14 10:25:33 -07:00
snipe
5030c7e5ff Added missing backups help string
Signed-off-by: snipe <snipe@snipe.net>
2022-05-14 10:24:03 -07:00
snipe
91fb27ee00 Adds encrypted status to custom fields overview
Signed-off-by: snipe <snipe@snipe.net>
2022-05-14 10:20:04 -07:00
snipe
5f1f6baee9 Fixed unrelated typo
Signed-off-by: snipe <snipe@snipe.net>
2022-05-14 10:19:12 -07:00
snipe
cc35a9ab6b Merge pull request #11077 from snipe/fixes/11075_wrong_var_for_licenses
Fix route for people file deletion
2022-05-14 08:26:29 -07:00
snipe
3fe0e04d52 Fix roite for people file deletion
Signed-off-by: snipe <snipe@snipe.net>
2022-05-14 08:25:22 -07:00
snipe
d904fb1d80 Merge pull request #11076 from johnson-yi/fixes/saml_slo
Fixes #10706 - Fix saml slo for logout
2022-05-14 08:10:50 -07:00
Johnson Yi
4401dab8d6 fix saml slo for logout 2022-05-14 11:59:34 +00:00
snipe
c4d75dca68 Merge pull request #11073 from snipe/features/add_filesize_to_object_uploads
Fixed #11052 - add file sizes to upload displays
2022-05-13 19:39:07 -07:00
snipe
3a31104b5c Fixed #11052 - add file sizes to upload displays
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 19:33:14 -07:00
snipe
157944b774 Try conditiinal formatting to support apache 2.2 and 2.4
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 18:01:06 -07:00
snipe
3ff745937a Merge pull request #11070 from snipe/fixes/11068_use_statement_for_login_attempts
Added missing use statement
2022-05-13 16:46:39 -07:00
snipe
333aa05809 Added missing use statement
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 16:46:13 -07:00
snipe
c5ec3efc70 Merge pull request #11065 from snipe/fixes/double_encoding_for_custom_fields
Fixed  #11014 - double encoding for custom fields
2022-05-13 16:12:24 -07:00
snipe
747b58cb59 Bumped laravel version in readme
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 16:09:00 -07:00
snipe
8794936e1a Merge pull request #11067 from uberbrady/master
Fix cancel button in two-factor sign-in screen
2022-05-13 14:56:00 -07:00
Brady Wetherington
ec65f7c72a Merge remote-tracking branch 'upstream/master' 2022-05-13 14:50:08 -07:00
Brady Wetherington
b6284e6651 Fix 'cancel' button in two-factor screen 2022-05-13 14:49:37 -07:00
snipe
5cc4f9bc2a Merge pull request #11066 from uberbrady/fix_two_factor_v6
Switch the barcode backend to SVG, and fix the two-factor middleware
2022-05-13 14:38:15 -07:00
snipe
d8a4509b22 Fix logout on 2fa
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 14:36:20 -07:00
Brady Wetherington
0ddb0f2c81 Switch the barcode backend to SVG, and fix the two-factor middleware 2022-05-13 14:22:27 -07:00
snipe
ce5ae80755 Regenerated assets
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 13:44:51 -07:00
snipe
c0868a68fb Removed console.log cruft
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 13:44:38 -07:00
snipe
eccc5e7cf0 Make logout a post on 2FA cancel
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 13:35:13 -07:00
snipe
1424e168d6 Switch logout back to post
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 13:30:11 -07:00
snipe
bda5d13c2b Fixed route name for appending models to kit
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 13:26:01 -07:00
snipe
7c82f5670b One more 2FA login change
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 12:48:55 -07:00
snipe
32bbe7c715 Fixed 2FA middleware
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 12:45:54 -07:00
snipe
293e3e02e4 Updated cookie name
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 12:07:00 -07:00
snipe
13d81f0a0c Updated prod assets
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 11:55:19 -07:00
snipe
64dc6fbd9c Switched branch to master
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 11:52:27 -07:00
snipe
e55aac7fea Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 11:51:41 -07:00
snipe
6fc222a648 Fixed #11014 - Removed double escaping on custom fields
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 05:45:00 -07:00
snipe
b36bfad0ca Set maxlength on password confirmation form element
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 05:27:47 -07:00
snipe
6b27c0311d Updated help text on groups for more info on deselecting
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 05:23:12 -07:00
snipe
93454decec Fixed broken quotes
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 05:14:53 -07:00
snipe
47fb323d90 Adding feature request file back
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 05:03:48 -07:00
snipe
e4bd5be4fe Try deleting the issue template file because wtf?
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 05:03:27 -07:00
snipe
cf4b418b22 Merge pull request #11063 from snipe/fixes/set_maxlength_for_user_fields
Sets maxlength of user fields to 191
2022-05-13 04:56:09 -07:00
snipe
deb2d958d8 Sets maxlength of user fields to 191
Signed-off-by: snipe <snipe@snipe.net>
2022-05-13 04:54:12 -07:00
snipe
c3e8c35063 Replaced feature request
Signed-off-by: snipe <snipe@snipe.net>
2022-05-12 22:15:02 -07:00
snipe
aa04a9b2e2 Clear feature template to see if it fixes docker issue
Signed-off-by: snipe <snipe@snipe.net>
2022-05-12 22:14:49 -07:00
snipe
0cb6a9ce69 Bumped tableexport plugin
Signed-off-by: snipe <snipe@snipe.net>
2022-05-12 22:14:09 -07:00
snipe
ef1eb15a91 Merge remote-tracking branch 'origin/master' into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/permissions.php
2022-05-12 09:31:42 -07:00
snipe
714f6d80f2 Merge pull request #11059 from Godmartinz/feature/sc-19017/change-bootstrap-tables-export-to-be-landscape
Bootstrap tables export as landscape
2022-05-12 09:28:47 -07:00
Godfrey M
54f5e268a0 removed change from tableExport.js 2022-05-12 09:20:19 -07:00
Godfrey M
83d0743ab8 saves bootstrap pdf tables in landscape 2022-05-12 09:18:44 -07:00
snipe
722e88a472 Merge pull request #11058 from snipe/fixes/kit_permissions
Fixed kit checkout permissions if admin is not superadmin
2022-05-11 20:11:13 -07:00
snipe
91cc08d3fb Merge pull request #11050 from uberbrady/fix_encrypted_textareas
Make sure to decrypt Textareas as well as input type=text
2022-05-11 19:03:02 -07:00
snipe
c52faaf23d Added checkout to permissions check
Signed-off-by: snipe <snipe@snipe.net>
2022-05-11 19:02:23 -07:00
snipe
c0ef27fc9e Removed kit checkout permission - it’s just confusing
Signed-off-by: snipe <snipe@snipe.net>
2022-05-11 19:02:11 -07:00
snipe
5a5bb79188 Merge pull request #11055 from uberbrady/update_livewire_assets
Update Livewire assets, and make Composer auto-update Livewire assets
2022-05-11 14:02:04 -07:00
Brady Wetherington
35450aebdd Update Livewire assets, and make Composer auto-update Livewire assets as needed 2022-05-11 14:00:10 -07:00
Godfrey M
8ebe64e630 fixes final visual issue 2022-05-11 12:13:36 -07:00
Brady Wetherington
e3696ff84c Make sure to decrypt Textareas as well as input type=text 2022-05-10 18:39:03 -07:00
snipe
446e44deb6 Merge pull request #11048 from Godmartinz/bug/sc-18989/purchase-cost-can-be-negative
Fixed validation for purchase cost allowed to be negative
2022-05-10 17:36:01 -07:00
snipe
816437b4d8 Updated hash
Signed-off-by: snipe <snipe@snipe.net>
2022-05-10 17:28:11 -07:00
snipe
5dfdf73e01 Dev assets
Signed-off-by: snipe <snipe@snipe.net>
2022-05-10 17:28:06 -07:00
snipe
780222d372 Merge remote-tracking branch 'origin/master' into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Auth/LoginController.php
#	resources/views/users/print.blade.php
2022-05-10 17:26:26 -07:00
Godfrey M
2c1f368828 adds validation for all purchase costs variables 2022-05-10 16:26:06 -07:00
Godfrey M
33b1ab3658 prevents values for assets being negative through validation 2022-05-10 16:19:06 -07:00
snipe
f4650c65db Clearer phrasing for log
Signed-off-by: snipe <snipe@snipe.net>
2022-05-10 13:00:48 -07:00
snipe
d3830a44d8 Added more verbose messaging
Signed-off-by: snipe <snipe@snipe.net>
2022-05-10 12:40:50 -07:00
snipe
5869b6ed0c And still more debugging
Signed-off-by: snipe <snipe@snipe.net>
2022-05-10 12:38:46 -07:00
snipe
4fccf4ddc4 Few more log lines
Signed-off-by: snipe <snipe@snipe.net>
2022-05-10 12:27:42 -07:00
snipe
646166b2b6 Removed debug line
Signed-off-by: snipe <snipe@snipe.net>
2022-05-10 12:16:07 -07:00
snipe
f4e737eaf3 More SAML debugging
Signed-off-by: snipe <snipe@snipe.net>
2022-05-10 12:14:22 -07:00
snipe
f572eaa421 Added debugging for SAML login
Signed-off-by: snipe <snipe@snipe.net>
2022-05-10 12:07:07 -07:00
Godfrey M
c07a244bab fixes 1/2 visual issues, adds history tab to accessories 2022-05-10 11:20:42 -07:00
snipe
72fe0d22ea Merge pull request #11040 from snipe/uberbrady-patch-2
Remove extraneous `{` in migration
2022-05-09 11:59:23 -07:00
Brady Wetherington
5357b1fa10 Remove extraneous { in migration
It looks like we inadvertently got an extra `{` in here - I noticed it because my IDE threw a big red dot on this migration. We must've accidentally put that in when we were adding the 'id' column.
2022-05-09 11:56:05 -07:00
snipe
f3fc81b860 Merge pull request #11039 from snipe/features/adds_seat_id_to_seats_ui
Added license seat ID to the UI
2022-05-09 10:59:47 -07:00
snipe
dc8669121d Added license seat ID to the UI
Signed-off-by: snipe <snipe@snipe.net>
2022-05-09 10:59:06 -07:00
Shao Yu-Lung (Allen)
8a032ee040 fix type 2022-05-07 22:54:47 +08:00
Shao Yu-Lung (Allen)
a835401cb2 skip run schedule analysis job on forked repos 2022-05-07 22:50:01 +08:00
snipe
dfd4d54433 Fixed route name
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 15:46:25 -07:00
snipe
e353780b1b Merge pull request #11027 from snipe/features/add_bulk_edit_to_other_asset_views
Fixed #11026 - add bulk edit to other asset views
2022-05-06 14:21:10 -07:00
snipe
220f94faee Check that the session key exists
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 14:10:47 -07:00
snipe
d5edb0908b Added translation string to the correct file this time
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 14:07:05 -07:00
snipe
89fee23d32 Commented out console log that was pooping up the joint
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 08:34:30 -07:00
snipe
2982d78899 Added translation for no assets selected
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:42:02 -07:00
snipe
22ec3c1398 Use error style instead of warn/info when nothing was selected
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:41:52 -07:00
snipe
caf17d4f25 Fixed wrong variable name
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:41:32 -07:00
snipe
e1b24bb763 Added a comment
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:30:21 -07:00
snipe
304cd75af5 Fixed extra divs
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:20:44 -07:00
snipe
59a0f4722b Use partial for asset bulk edit
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:20:35 -07:00
snipe
418a797e7e Use partial for asset bulk edit
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:20:29 -07:00
snipe
adc017db23 Added checkbox to audit listing
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:16:13 -07:00
snipe
0c20543c49 Remove conflicting toolbar call in model listing
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:15:58 -07:00
snipe
fe98e505fe Use the new partial for bulk asset edit
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:15:31 -07:00
snipe
78a9c16761 Minor formatting improvements
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:15:10 -07:00
snipe
c4bf0045c8 Fixed stray < tag
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:14:55 -07:00
snipe
c64f34ebcc Check the "do not change” radio button by default
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:14:31 -07:00
snipe
76213ec3d9 Create a session on bulk actions, store it for redirect, then delete it
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:14:08 -07:00
snipe
243739e9c3 Added missing gate for bulk checkout
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:13:36 -07:00
snipe
cf0548bd1f Create a new partial for asset bulk actions
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 05:11:52 -07:00
snipe
a43b54cc8d Bumped hash for clarity
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 02:13:56 -07:00
snipe
caef98d36d Patched #11025 to develop
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 02:06:12 -07:00
snipe
f91be34baf Merge pull request #11025 from snipe/fixes/missed_a_few_trans_strings
Fixed #10890 - Missed a few hard coded english strings
2022-05-06 02:02:15 -07:00
snipe
fba731ac1c Missed a few hard coded english strings
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 02:01:17 -07:00
snipe
784bf4d784 Merge remote-tracking branch 'origin/master' into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	.github/ISSUE_TEMPLATE/feature_request.yml
#	app/Http/Controllers/CustomFieldsetsController.php
#	app/Http/Controllers/ReportsController.php
#	config/version.php
#	package-lock.json
#	package.json
#	public/css/dist/all.css
#	public/css/dist/bootstrap-table.css
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
#	resources/views/users/print.blade.php
#	webpack.mix.js
2022-05-06 01:52:43 -07:00
snipe
6304709c77 Merge pull request #11023 from snipe/fixes/10890_use_translation_strings_in_assigned_printout
Fixed #10890 - Use translation strings in assigned printout instead of hardcoded English
2022-05-06 01:33:46 -07:00
snipe
39ee825ba2 Fixed html lang specification
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 01:32:20 -07:00
snipe
c0e9393092 Fixed #10890 - use translation strings in user asset printout
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 01:30:58 -07:00
snipe
1ac626a43a Merge pull request #11022 from snipe/fixes/specify_full_url_in_favicons
Use full app_url in favicon paths
2022-05-06 00:22:14 -07:00
snipe
3a415b2fce Use full app_url in favicon paths
Signed-off-by: snipe <snipe@snipe.net>
2022-05-06 00:19:32 -07:00
snipe
b20921cb62 Removed duplicate session regenerate
Signed-off-by: snipe <snipe@snipe.net>
2022-05-05 21:35:05 -07:00
snipe
2e03270fca Updated feature request YAML
Signed-off-by: snipe <snipe@snipe.net>
2022-05-05 19:06:25 -07:00
snipe
5370c2ca42 Merge pull request #10941 from Godmartinz/gh8856_signature_not_showing_in_print_all
[Fix] changes the query for the accept signature on print blade
2022-05-05 13:32:37 -07:00
snipe
0939591efb Merge pull request #11003 from inietov/fixes/integrity_constraint_violation_column_order_cannot_be_null_develop
Fixes QueryException Integrity constraint violation: Column 'order' cannot be null for develop
2022-05-05 13:28:00 -07:00
snipe
a859eac4a0 Merge pull request #11002 from inietov/fixes/integrity_constraint_violation_column_order_cannot_be_null
Fixes QueryException Integrity constraint violation:  Column 'order' cannot be null
2022-05-05 13:27:45 -07:00
snipe
35d81be8d1 Merge pull request #11018 from snipe/update_bootstrap_table_to_latest
Update BS tables and table export to latest
2022-05-05 13:23:55 -07:00
snipe
a5760cfe7b Update BS tables and table export to latest
Signed-off-by: snipe <snipe@snipe.net>
2022-05-05 12:22:20 -07:00
snipe
cab29745e7 More small tweaks to feature request template
Signed-off-by: snipe <snipe@snipe.net>
2022-05-05 11:17:31 -07:00
snipe
41fa42f7d8 FR updates
Signed-off-by: snipe <snipe@snipe.net>
2022-05-05 11:14:55 -07:00
snipe
eb49c33e1b Reverting feature request YAML
Signed-off-by: snipe <snipe@snipe.net>
2022-05-05 11:10:11 -07:00
snipe
31f2b73e5a Bumped version to GM
Signed-off-by: snipe <snipe@snipe.net>
2022-05-05 10:55:29 -07:00
snipe
953b3a8d6e Merge pull request #10993 from snipe/rcs/merge_master_into_develop_for_rc_8
Merge master into develop for RC 6.0.0-8
2022-05-05 10:53:17 -07:00
snipe
c01f0880ef Changed language string
Signed-off-by: snipe <snipe@snipe.net>
2022-05-05 10:52:57 -07:00
snipe
c838354b74 Merge pull request #11016 from benwa/patch-1
Update feature_request.yml
2022-05-05 10:19:37 -07:00
Bennett Blodinger
46c4d1a3d6 Update feature_request.yml
Correcting the label/description fields
2022-05-05 09:49:41 -05:00
snipe
5c78a15835 Removed dupe lines from merge conflict
Signed-off-by: snipe <snipe@snipe.net>
2022-05-03 12:56:29 -07:00
snipe
011ab604f2 Merge pull request #11001 from inietov/fixes/download_all_triggers_getDisplayNameAttribute_on_null_develop
Fixes Activity Report Download all action fails creating the CSV report for develop.
2022-05-03 20:52:47 +01:00
Ivan Nieto Vivanco
37805509da Adds an integer casting to the order input field so it cannot be null 2022-05-01 15:27:05 -05:00
Ivan Nieto Vivanco
01232d9a54 Adds an integer casting to the order input field so it cannot be null 2022-05-01 15:16:56 -05:00
Ivan Nieto Vivanco
ac8da55270 Evaluate if an item still exists before trying to get its name in the report 2022-05-01 13:25:55 -05:00
snipe
313150e6dd Merge pull request #10998 from johnson-yi/fixes/saml_logout
Fixes #10980 - Prevent immediate saml login after normal logout
2022-04-30 19:49:54 +01:00
Johnson Yi
281c6df7b3 Customize login page when REQUIRE_SAML is enabled 2022-04-29 15:35:40 +00:00
Johnson Yi
92fe1287ea Do not saml login automatically after normal logout 2022-04-29 15:35:08 +00:00
snipe
150724b744 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-04-28 17:51:27 +01:00
snipe
9aac1cbba4 Merge branch 'master' into rcs/merge_master_into_develop_for_rc_8
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	README.md
#	app/Console/Commands/MoveUploadsToNewDisk.php
#	app/Http/Controllers/ActionlogController.php
#	app/Http/Controllers/Api/LicensesController.php
#	app/Http/Controllers/Api/StatuslabelsController.php
#	app/Http/Controllers/Assets/AssetCheckinController.php
#	app/Http/Controllers/Licenses/LicensesController.php
#	app/Http/Controllers/Users/BulkUsersController.php
#	app/Http/Requests/AssetCheckoutRequest.php
#	app/Importer/LicenseImporter.php
#	app/Models/Actionlog.php
#	app/Models/License.php
#	app/Models/User.php
#	app/Observers/AssetObserver.php
#	composer.lock
#	config/version.php
#	database/factories/LicenseFactory.php
#	database/migrations/2015_09_21_235926_create_custom_field_custom_fieldset.php
#	database/migrations/2018_10_18_191228_add_kits_licenses_table.php
#	database/migrations/2018_10_19_153910_add_kits_table.php
#	database/migrations/2018_10_19_154013_add_kits_models_table.php
#	database/migrations/2019_02_07_185953_add_kits_consumables_table.php
#	database/migrations/2019_02_07_190030_add_kits_accessories_table.php
#	package-lock.json
#	package.json
#	public/css/dist/all.css
#	public/css/dist/bootstrap-table.css
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
#	resources/lang/ar/general.php
#	resources/lang/ar/passwords.php
#	resources/lang/cs/general.php
#	resources/lang/cs/passwords.php
#	resources/lang/de/admin/custom_fields/general.php
#	resources/lang/de/admin/settings/general.php
#	resources/lang/de/admin/settings/message.php
#	resources/lang/fr/admin/custom_fields/general.php
#	resources/lang/fr/admin/hardware/general.php
#	resources/lang/fr/admin/locations/table.php
#	resources/lang/fr/admin/settings/message.php
#	resources/lang/hu/admin/custom_fields/general.php
#	resources/lang/hu/admin/settings/general.php
#	resources/lang/hu/general.php
#	resources/lang/it/admin/settings/general.php
#	resources/lang/nl/admin/custom_fields/general.php
#	resources/lang/nl/admin/settings/general.php
#	resources/lang/nl/general.php
#	resources/lang/pl/admin/custom_fields/general.php
#	resources/lang/sv-SE/passwords.php
#	resources/lang/tr/general.php
#	resources/views/hardware/view.blade.php
#	resources/views/partials/bootstrap-table.blade.php
#	resources/views/reports/activity.blade.php
#	resources/views/users/print.blade.php
2022-04-28 17:49:06 +01:00
snipe
c8d5445178 Merge pull request #10982 from Trizelos/develop
Fixed #10983: Possibility to set region for AWS (SES)
2022-04-28 14:23:39 +01:00
Shao Yu-Lung (Allen)
2cd7c7a357 Ensure analysis job never runs on forked repos 2022-04-28 16:51:53 +08:00
Christian Weirich
4be6288ae3 Possibility to set region for AWS (SES) 2022-04-27 15:26:33 +02:00
Achmad Fienan Rahardianto
dafe353050 Implements #8155 to improve the workflow during asset creation
- adding 2 options to hide optional information
2022-04-23 14:41:38 +07:00
Godfrey M
380cb38b7d changes the query for the accept signature on print blade 2022-04-14 17:17:28 -07:00
snipe
809fe7f6d8 Compiled assets
Signed-off-by: snipe <snipe@snipe.net>
2022-04-12 19:28:58 +01:00
snipe
bdbb0c0ce5 Merge pull request #10928 from uberbrady/fix_remembered_columns_develop
Fix #10482 for develop - Downgrade bootstrap-table to fix remembered-columns feature
2022-04-11 18:57:24 +01:00
Brady Wetherington
3472aa9a46 Downgrade bootstrap-table to fix remembered-columns feature 2022-04-11 14:41:46 +01:00
snipe
8218b5ef47 Merge pull request #10914 from inietov/fixes/bulk_user_edit_not_updating_asset_locations_develop
Fixes Bulk user edit not updating checked out asset locations
2022-04-07 19:40:42 +01:00
snipe
b73542664b Merge pull request #10919 from Godmartinz/gh10866-checkin_time_always_show_12am
Fixed #10866 - Checkin time always shows 12am
2022-04-07 19:40:11 +01:00
Godfrey M
1325628039 fixes typo 2022-04-07 11:18:16 -07:00
Godfrey M
8498082f21 fixes typo 2022-04-07 11:16:40 -07:00
Godfrey M
6dc45c189b removed deadspace 2022-04-07 11:10:36 -07:00
Godfrey M
5d0a1ebb7a fixes action_date for check-in not including H:i:s 2022-04-07 11:08:43 -07:00
snipe
30a5d57ce5 Merge pull request #10917 from uberbrady/bs_tables_export_without_html_develop
This disables the display of HTML content during exports
2022-04-07 16:44:36 +01:00
Brady Wetherington
5a776af091 This disables the display of HTML content during exports, without enabling XSS attacks 2022-04-07 16:27:06 +01:00
Ivan Nieto Vivanco
e1927aa154 Update Assets locations when user's location changes whey they got bulk-edited 2022-04-06 19:23:49 -05:00
Ivan Nieto Vivanco
b5378eff64 Fix several typos 2022-04-05 16:12:31 -05:00
snipe
8195a664a9 Merge pull request #10883 from inietov/fixes/update_existing_value_import_develop
Fixes Importer always update existing values develop
2022-04-05 21:11:24 +01:00
snipe
7385a0765e Merge pull request #10889 from uberbrady/scim_squashed_grok_library
SCIM integration using laravel-scim-server library
2022-04-05 20:32:16 +01:00
Brady Wetherington
599d725d55 Just needed to adjust the hash so that the composer.lock is correct 2022-04-05 20:31:34 +01:00
Brady Wetherington
9bd04eb8c9 Use our forked version of the Laravel-SCIM-Server package (hopefully temporary) 2022-04-05 20:26:40 +01:00
Brady Wetherington
6756dd193e SCIM integration using the 're-do-the routes' approach, which seems like a dead-end
Cleaning up routes to match laravel-scim-server's recommended implementation

Some actually *working* changes for SCIM support?!

Whoops, forgot my route file

Fix public SCIM routes

Removed Ziggy, removed old generated file, yanked Ziggy references

Resolves the first set of comments for SCIM

Ensure all /api routes have baseUrl prepended

Fix the parent:: call to be, uh, actually correct :P

Clarify the route-ordering, as it is quite tricky

This gets it so that users can actually be saved..

Work around the lack of callbacks with some inheritance

Mapped a bunch more fields from SCIM into Snipe-IT's user table

More baseUrl shenanigans since we yanked Ziggy :/

Properly map job title and work with some other necessary attributes

Map more fields...

Finalized basic mapping for core and enterprise namespaces

Latest tuned settings for SCIM config to work with Azure (and others)
2022-04-05 20:26:37 +01:00
snipe
56ee5c50a9 Merge pull request #10897 from ubc-cpsc/develop
Security updates to enshrined/svg-sanitize and guzzlehttp/psr7
2022-04-05 20:19:26 +01:00
snipe
91e6acbfd9 Add @veenone as a contributor 2022-04-05 18:52:17 +01:00
snipe
08588a2e6a Merge pull request #10901 from veenone/fix/invalid_consumable_date_in_user_view
Fixes #10898 (invalid consumable date time info in user view)
2022-04-05 18:30:23 +01:00
Achmad Fienan Rahardianto
231a34ace3 FIX: #10898 (invalid consumable date time info in user view) 2022-04-05 15:31:27 +07:00
Joël Pittet
472c94ef89 Security updates to enshrined/svg-sanitize and guzzlehttp/psr7 2022-04-04 12:31:27 -07:00
Ivan Nieto Vivanco
1a448cc4b6 Take the values from the importer form to configure the used importer 2022-03-29 17:31:43 -06:00
snipe
f7cd21a007 Sigh.
Signed-off-by: snipe <snipe@snipe.net>
2022-03-29 22:59:52 +01:00
snipe
8ccf148799 Fixed #10881 - bad merge with bootstrap-tables changes
Signed-off-by: snipe <snipe@snipe.net>
2022-03-29 22:57:00 +01:00
snipe
b2056816c9 Use the same string for both radio buttons in bulk user edit
Signed-off-by: snipe <snipe@snipe.net>
2022-03-29 16:45:55 +01:00
snipe
67b0e731e5 Merge pull request #10879 from snipe/rcs/merge_master_into_develop
Merge master back down into develop
2022-03-29 16:40:31 +01:00
snipe
a937bd34f6 Merge master back down into develop
Signed-off-by: snipe <snipe@snipe.net>
2022-03-29 16:28:43 +01:00
snipe
7941a88623 Merge pull request #10817 from dampfklon/fix-10810-unaccepted-assets
Fix #10810 unaccepted assets
2022-03-29 12:10:37 +01:00
snipe
80dff41c00 Merge pull request #10843 from ahpaleus/features/add_codeql_to_sdlc
[Feature] Adds CodeQL to the SDLC process
2022-03-29 12:07:44 +01:00
snipe
b5f3a357e2 Merge pull request #10850 from Godmartinz/feature/sc-18937/add-manager-to-ldap-sync
This looks good, thanks!
2022-03-29 12:06:01 +01:00
snipe
e207a5043e Merge pull request #10737 from Godmartinz/feature/sc-15014/asset-acceptance-and-signed-eula-as-pdf
Fixed #7891, #3019 and #8260 [sc-15014] - added asset acceptance and signed eula as pdf
2022-03-24 20:52:41 +00:00
Godfrey M
a1429ce86b removed manager_name from user files 2022-03-24 11:47:13 -07:00
Godfrey M
c1f8252388 adds manager field to LDAP sync 2022-03-24 11:24:39 -07:00
snipe
edcf109b0f Merge pull request #10861 from andreaci/develop
next_audit_date error on saving asset
2022-03-23 18:44:21 +00:00
andreaci
ff5a95a6a4 next_audit_date error on saving asset
Solved error 500 when saving new Asset and no next_audit_date  is defined
2022-03-23 17:23:53 +01:00
Godfrey M
55680762de Merge branch 'develop' into feature/sc-18937/add-manager-to-ldap-sync 2022-03-22 16:33:58 -07:00
Godfrey Martinez
fe6a6740db Merge branch 'develop' into feature/sc-15014/asset-acceptance-and-signed-eula-as-pdf 2022-03-22 10:10:56 -07:00
Godfrey M
3e01981576 clean up 2022-03-22 10:07:08 -07:00
Godfrey M
bc30eef23e clean up 2022-03-22 10:04:54 -07:00
Godfrey M
62352ef1a1 completes accessory eula agreement blade 2022-03-22 10:04:22 -07:00
snipe
e9a59f55ab Merge pull request #10855 from inietov/fixes/exception_boolean_field_check_no_customfields
Validate custom fieldset only if the asset have one
2022-03-22 15:58:01 +00:00
Ivan Nieto Vivanco
98b78837e1 Validate custom fieldset only if the asset have one 2022-03-22 09:38:57 -06:00
snipe
26cababc43 Merge pull request #10851 from inietov/fixes/licenses_assigned_to_assets_dont_follow_users
Fixes #10753 Licenses assigned to assets don't follow users
2022-03-21 21:22:41 +00:00
Ivan Nieto Vivanco
319d816002 Update in the license seat the user that the asset with that license have assigned 2022-03-21 15:06:43 -06:00
Godfrey M
4956eb0410 WIP: needs to be tested. adds ldap_manager field to ldap sync 2022-03-21 11:15:39 -07:00
Godfrey M
220df9710e adds most of the fields for an accessory eula agreement pdf 2022-03-21 09:18:29 -07:00
snipe
820f0a7f04 Merge pull request #10849 from snipe/fixes/10769_return_to_due_for_audit
Fixes #10769 - return to Due for Audit screen after auditing
2022-03-21 14:28:13 +00:00
snipe
df60729140 Fixed #10769 - redirect user back to due for audit page
This could probably take a little reworking, since if you are auditing from the Overdue for Audit page, we’d want to take you back *there* instead of the Due for Audit page.

Signed-off-by: snipe <snipe@snipe.net>
2022-03-21 14:27:18 +00:00
snipe
c01cc48482 Merge pull request #10848 from snipe/fixes/10819_use_full_url_for_barcodes_in_label_view
Fixed #10819 - use full url for label barcodes
2022-03-21 14:00:56 +00:00
snipe
760b78b584 Fixed #10819 - use full url for label barcodes
I don’t know when/why this would really be necessary, since it would be weird to call /hardware/123/label, but this fixes the broken barcodes

Signed-off-by: snipe <snipe@snipe.net>
2022-03-21 13:57:18 +00:00
Maciej Domanski
d53750d389 LdapSync 2022-03-21 10:37:14 +01:00
Maciej Domanski
565f4eb6a1 LdapSync 2022-03-21 10:36:15 +01:00
Maciej Domanski
4a9ff86941 revert LdapSync 2022-03-21 10:31:21 +01:00
Maciej Domanski
70b22784fe Delete LdapSync.php 2022-03-21 10:04:42 +01:00
Maciej Domanski
374bed3f0c info update codeql 2022-03-21 09:51:29 +01:00
snipe
ada0932e80 Merge pull request #10841 from snipe/fixes/default_id_suppliers
Fixed #10840 - defaulting to 0 on supplier ID if no value provided
2022-03-19 23:20:36 +00:00
snipe
e04ae63d02 Apply the fix to API controller too :(
Signed-off-by: snipe <snipe@snipe.net>
2022-03-19 23:12:48 +00:00
snipe
7db252ade3 Fixed #10840 - defaulting to 0 on supplier ID if no value provided
Signed-off-by: snipe <snipe@snipe.net>
2022-03-19 23:11:42 +00:00
snipe
42220cc566 Merge pull request #10809 from inietov/fixes/customfields_boolean_format_not_saving
Fixes Customfields with boolean format not saving [ch-9973]
2022-03-19 22:10:54 +00:00
Maciej Domanski
41e89123e1 revert from develop 2022-03-17 12:22:37 +01:00
Maciej Domanski
e09516d69b codeql sa 2022-03-17 12:10:44 +01:00
Ivan Nieto Vivanco
6ed9ed0e79 Add field type boolean to custom fields list all 2022-03-16 17:21:05 -06:00
Godfrey M
b2e78e3382 formats most of the pdf blade 2022-03-16 15:53:32 -07:00
Dampfklon
9818d16834 fix showDeletedFunction by reverting #9508 2022-03-16 20:20:46 +01:00
Godfrey M
5fcc3c39f3 routes eula agreements for download correctly to the asset history 2022-03-16 11:56:56 -07:00
snipe
d55c176199 Merge pull request #10831 from snipe/merges/master_down_to_develop_march_16
v6.0.0-RC-5 - Merges master down to develop
2022-03-16 18:35:42 +00:00
snipe
c0451fe17a Bumped version to v6.0.0-RC-5
Signed-off-by: snipe <snipe@snipe.net>
2022-03-16 18:10:17 +00:00
snipe
0f95802699 Fixed mis-automerge
Signed-off-by: snipe <snipe@snipe.net>
2022-03-16 18:05:47 +00:00
snipe
9db8bd782d Merging master down into develop
Signed-off-by: snipe <snipe@snipe.net>
2022-03-16 18:02:07 +00:00
snipe
93ff9524d6 Merge pull request #10829 from snipe/features/add_statuslabel_filter_by_type_in_api
Added filter by status_type in StatusLabels API index endpoint
2022-03-16 10:04:58 -07:00
Godfrey M
6386fa1c5e clean up 2022-03-16 09:54:10 -07:00
snipe
89ddbddada Fixed comment
Signed-off-by: snipe <snipe@snipe.net>
2022-03-16 16:53:18 +00:00
snipe
7498fe36e9 Removed extra space because pedantry
Signed-off-by: snipe <snipe@snipe.net>
2022-03-16 16:45:03 +00:00
snipe
babf7c064b Added ability to filter status label index endpoint by status type
Signed-off-by: snipe <snipe@snipe.net>
2022-03-16 16:38:45 +00:00
snipe
40a9470770 Merge pull request #10828 from snipe/fixes/10826_parse_error_on_print_all
Fixed #10826 - parse error on translation string for print all assets
2022-03-16 08:54:10 -07:00
snipe
781b426018 Fixed #10826 - parse error on translation string for print all assets
Signed-off-by: snipe <snipe@snipe.net>
2022-03-16 08:50:47 -07:00
snipe
f499dcf7c3 Merge pull request #10827 from snipe/fixes/modal_dropdowns_broken
Fixed #10825 - selectlists in modals b0rked
2022-03-16 08:25:29 -07:00
snipe
54d6a4d978 Fixed #10825 - selectlists in modals b0rked
Signed-off-by: snipe <snipe@snipe.net>
2022-03-16 08:23:50 -07:00
Maciej Domanski
44d5b589bb Update phpstan.neon 2022-03-16 15:22:45 +01:00
Maciej Domanski
0a98adb246 Update SA-phpstan.yml 2022-03-16 15:22:27 +01:00
Maciej Domanski
540f783ba2 phpstan-fixes 2022-03-16 15:11:40 +01:00
Maciej Domanski
67ed550743 phpstan update 2022-03-16 12:37:32 +01:00
Maciej Domanski
967ee714a1 sa tooling 2022-03-16 12:14:18 +01:00
Ivan Nieto Vivanco
570dd09dcd Add validation to Accessories and Consumables to not let the user update the number of items to less than they already have checked out 2022-03-15 17:52:19 -06:00
Godfrey M
b2f7262cd2 adds table structure for asset history 2022-03-14 19:38:36 -07:00
Dampfklon
29e1d657e3 fix missed rename 2022-03-11 21:33:25 +01:00
snipe
84aa26dd50 Merge pull request #10728 from Godmartinz/gh10191-css-dropdownmenu
Fixed #10191 - font color contrast on mobile menu
2022-03-10 13:02:45 -08:00
Godfrey M
e1a6a2afc6 adds translation for accept_eula, a bit more logic on the Acceptance Controller that is not working yet 2022-03-10 12:15:50 -08:00
snipe
8984b3a59d Merge pull request #10812 from inietov/fixes/CarbonExceptions_InvalidFormatException_DateTime_develop
Fixes Carbon\Exceptions\InvalidFormatException: DateTime::__construct(): Failed to parse time string develop
2022-03-10 10:40:33 -08:00
Ivan Nieto Vivanco
cdc0805fc4 Sanitize dates input in the importer before saving 2022-03-10 12:07:07 -06:00
Ivan Nieto Vivanco
86bd90c564 Show icons in the asset view for boolean customfields 2022-03-09 21:46:19 -06:00
Ivan Nieto Vivanco
e104195796 Convert value of the customfield element from string to boolean 2022-03-09 18:49:39 -06:00
snipe
d06ef4bdef Bumped lockfile
Signed-off-by: snipe <snipe@snipe.net>
2022-03-08 22:17:46 -08:00
snipe
c817daa4da Merge pull request #10767 from uberbrady/fix_double_request_datatable
One attempt to fix the 'datatable double-request' problem.
2022-03-08 20:34:15 -08:00
snipe
1b3631d57d Merge pull request #10806 from snipe/fixes/removed_experimental_content_policies
Removed experimental feature policies
2022-03-08 20:32:39 -08:00
snipe
e3d2f7cc96 Missed a few
Signed-off-by: snipe <snipe@snipe.net>
2022-03-08 20:05:17 -08:00
snipe
d1358b6249 Removed experimental feature policies
Signed-off-by: snipe <snipe@snipe.net>
2022-03-08 16:58:24 -08:00
Godfrey M
59c583ac74 adds the ability to save eula pdfs to storage, still working on storing them in the DB and exposing them in the UI 2022-03-08 16:42:27 -08:00
snipe
95d6e1a402 Merge pull request #10805 from inietov/fixes/date_localization_not_working_custom_fields_develop
Fixes #8143 Date localization not work in custom fields for develop branch
2022-03-08 16:36:31 -08:00
Ivan Nieto Vivanco
657cfddd3c Add a condition to show customfields as the user wants in localization settings 2022-03-08 18:28:13 -06:00
snipe
9311584f43 Merge pull request #10033 from uberbrady/ldap_troubleshooter_cherrypicked
Fixed [ch14855] - create LDAP troubleshooter
2022-03-07 20:24:11 -08:00
Brady Wetherington
ab7bf3c5d4 Get rid of stale commented-out line 2022-03-07 20:22:23 -08:00
Brady Wetherington
0556c7653a Implement a generic timeout function, and run methods that need to run with a timeout using it. 2022-03-07 19:51:21 -08:00
Brady Wetherington
b96303cb38 Clean up errors, add new required package to Dockerfile 2022-03-07 19:51:21 -08:00
Brady Wetherington
312a90ce77 Add start of Tracing to LDAP troubleshooter 2022-03-07 19:51:21 -08:00
Brady Wetherington
71b5c0e80f Add new LDAP troubleshoot ldapsearch subcommand, broaden out troubleshooting 2022-03-07 19:51:21 -08:00
Brady Wetherington
519bd00bef WIP - just need to get authed connections to work 2022-03-07 19:51:21 -08:00
Brady Wetherington
ffd8f583b4 Got most of the stages working for the LDAP troubleshooter 2022-03-07 19:51:21 -08:00
Brady Wetherington
8cd5ec6799 Most of the host-port-tls discovery stuff is in-place now 2022-03-07 19:51:20 -08:00
Brady Wetherington
ef0e9a3c93 WIP: Enhancing stage 2 of LDAP troubleshooter 2022-03-07 19:51:20 -08:00
Brady Wetherington
8aa975e959 First pass at Artisan-based LDAP troubleshooter 2022-03-07 19:51:20 -08:00
Brady Wetherington
8d49d35463 Remove another data-toggle="table" - possibly the last one 2022-03-07 12:52:57 -08:00
Brady Wetherington
6f3e9033c2 One attempt to fix the 'datatable double-request' problem. 2022-03-07 12:52:57 -08:00
snipe
0c520476a3 Removed namespace
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 12:30:47 -08:00
snipe
ba010618f7 Throttle got merged out - re-adding it
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 12:15:09 -08:00
snipe
2d7a8b5e15 Merge pull request #10776 from snipe/added_trim_to_email_and_username
Added trim to email and username
2022-03-04 11:57:33 -08:00
snipe
1dabd6cc71 Merge pull request #10777 from snipe/added_remote_to_bulk_user_edit
Add remote user setting to bulk edit
2022-03-04 10:35:07 -08:00
snipe
9a358087ec Add remote user to bulk edit
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 06:47:23 -08:00
snipe
b6a1d245e8 Added trim to CC email as well
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 06:20:34 -08:00
snipe
67134ca387 Do a trim() before inserting/updating
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 06:18:52 -08:00
snipe
0dfc27f56e Added remote to allowed_columns for sorting
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 05:44:46 -08:00
snipe
eb8b4a2aa5 Merge pull request #10775 from snipe/features/add_remote_checkbox_to_user
Added remote checkbox to user
2022-03-04 05:39:23 -08:00
snipe
06a05e6340 Added remote to view
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 05:37:28 -08:00
snipe
43c1949092 Add remote option to user
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 05:35:26 -08:00
snipe
a9069e65e5 Don’t show groups in menu if there are none yet
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 04:39:39 -08:00
snipe
1400c610a1 Use correct button translation
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 04:22:44 -08:00
snipe
67ed0d91c0 Handle file_get_contents more gracefully
Signed-off-by: snipe <snipe@snipe.net>
2022-03-04 02:54:37 -08:00
snipe
349715576a Bumped RC version
Signed-off-by: snipe <snipe@snipe.net>
2022-03-03 22:23:24 -08:00
snipe
0d787fcc94 Updated language files
Signed-off-by: snipe <snipe@snipe.net>
2022-03-03 22:21:44 -08:00
snipe
b876d0abb0 Merge remote-tracking branch 'origin/master' into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	.env.example
#	app/Http/Controllers/Auth/LoginController.php
#	app/Http/Kernel.php
#	app/Http/Transformers/ActionlogsTransformer.php
#	app/Importer/AssetImporter.php
#	app/Models/Accessory.php
#	app/Models/Consumable.php
#	app/Presenters/AccessoryPresenter.php
#	app/Presenters/ComponentPresenter.php
#	app/Presenters/ConsumablePresenter.php
#	app/Providers/AuthServiceProvider.php
#	composer.json
#	composer.lock
#	config/app.php
#	config/cors.php
#	config/version.php
#	package-lock.json
#	public/js/build/app.js
#	public/js/build/app.js.LICENSE.txt
#	public/js/dist/all.js
#	public/mix-manifest.json
#	resources/views/accessories/view.blade.php
#	resources/views/consumables/view.blade.php
#	resources/views/settings/saml.blade.php
#	routes/api.php
2022-03-03 21:59:38 -08:00
Godfrey M
14bd07e97d gerge branchevelop' into gh10191-css-dropdownmenu 2022-03-03 10:14:30 -08:00
Godfrey M
4435ea95fd removes changes to mix-manifest 2022-03-03 09:47:11 -08:00
Godfrey M
f115385243 C&P mix-manifest to be tracked 2022-03-03 09:32:05 -08:00
Godfrey M
708dc08b4f mixes color contrast on dropdown menu from navbar
on file
2022-03-03 09:27:52 -08:00
snipe
16fd109540 Merge pull request #10417 from inietov/fixes/trying_to_get_property_id_of_nonobject
Fixes trying to get property 'id' of non-object when running develop seeders.
2022-03-02 14:35:53 -08:00
snipe
2b4ee4827f Merge branch 'develop' into fixes/trying_to_get_property_id_of_nonobject 2022-03-02 14:35:35 -08:00
snipe
dc1e0ecdb7 Merge pull request #10739 from insert-waffle/fixes/prevent_double_values_email
Feature: Prevent showing of double values in a checkin or checkout email
2022-03-02 14:28:22 -08:00
Ivan Nieto Vivanco
0df9dd8320 Delete a function that is not longer used 2022-03-01 18:59:50 -06:00
snipe
5d1cd89838 Merge pull request #10751 from aranar-pro/bug_fix/location-drop-down-#10701
Fix for location and model drop down with granular permissions.
2022-02-28 16:33:12 -08:00
Andrew Roth
74248a4314 removing composer.lock from PR 2022-02-28 19:30:32 -05:00
Andrew Roth
2e60420aeb Fix for location and model drop down with granular permissions. 2022-02-28 17:38:38 -05:00
Jens Maes
9b88f650d2 Prevents showing double values
- If the asset name and tag are the same, the tag does not get shown in an email.
- If the model name is the same as the model number (when importing from LanSweeper for example), do not show the model number.
2022-02-25 08:19:46 +01:00
Godfrey M
533670f3f1 faulty method for converting asset acceptance to pdf 2022-02-24 14:50:16 -08:00
snipe
a5c16c6a9c Update @insert-waffle as a contributor 2022-02-24 14:47:48 -08:00
snipe
1ee37212f1 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2022-02-24 14:47:14 -08:00
snipe
ed43d36895 Updated assets
Signed-off-by: snipe <snipe@snipe.net>
2022-02-24 14:47:09 -08:00
snipe
d243b822e7 Merge pull request #10729 from insert-waffle/fix-10708
Fixes 10708: removed line height of manufacturer and changed size of fa-hdd to 2x
2022-02-24 14:46:51 -08:00
snipe
f077d096e2 Merge pull request #10735 from inietov/fixes/imported_assets_duplicate_model_notes_from_assets
Separate notes on assets and asset models [sc-18810]
2022-02-24 14:15:13 -08:00
Ivan Nieto Vivanco
577dc6b02c Separate notes on assets and asset models 2022-02-24 15:50:59 -06:00
Jens Maes
57e93e4e92 Fixes 10708: change size of fa-hdd to 2x 2022-02-24 11:05:40 +01:00
Jens Maes
c0893c44a3 Fixes 10708: Removed line heigt from manufacturer list item. 2022-02-24 10:29:39 +01:00
snipe
292bf21e7d Merge pull request #10720 from uberbrady/fix_cors_develop
Fix cors develop
2022-02-22 19:23:43 -08:00
Brady Wetherington
294606fb0b Move new CORS library to global middleware, the only place it works 2022-02-22 19:07:23 -08:00
Brady Wetherington
cd2c92fd6c Cors should respect the .env var for CORS domains 2022-02-22 19:00:59 -08:00
snipe
6ef053bc52 Merge pull request #10713 from snipe/fixes/error_handler
Added use statement
2022-02-22 10:46:58 -08:00
snipe
0a4a548f9c Added use statement
Signed-off-by: snipe <snipe@snipe.net>
2022-02-22 10:46:02 -08:00
snipe
784bf6f223 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-02-20 13:30:24 -08:00
snipe
dd5f812d88 Merge remote-tracking branch 'origin/master' into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	.all-contributorsrc
#	README.md
#	app/Console/Commands/FixDoubleEscape.php
#	app/Console/Commands/LdapSync.php
#	app/Exceptions/Handler.php
#	app/Http/Controllers/Api/AssetMaintenancesController.php
#	app/Http/Controllers/Api/AssetModelsController.php
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Api/CategoriesController.php
#	app/Http/Controllers/Api/CompaniesController.php
#	app/Http/Controllers/Api/DepartmentsController.php
#	app/Http/Controllers/Api/LicensesController.php
#	app/Http/Controllers/Api/LocationsController.php
#	app/Http/Controllers/Api/ManufacturersController.php
#	app/Http/Controllers/Api/SettingsController.php
#	app/Http/Controllers/Api/SuppliersController.php
#	app/Http/Controllers/AssetModelsController.php
#	app/Http/Controllers/Auth/LoginController.php
#	app/Http/Controllers/CustomFieldsController.php
#	app/Http/Controllers/SettingsController.php
#	app/Models/Loggable.php
#	app/Providers/AuthServiceProvider.php
#	config/version.php
#	database/migrations/2014_11_04_231416_update_group_field_for_reporting.php
#	database/migrations/2015_11_08_222305_add_ldap_fields_to_settings.php
#	package-lock.json
#	package.json
#	public/js/build/app.js
#	public/js/dist/all.js
#	public/mix-manifest.json
#	resources/assets/js/components/forms/asset-models/fieldset-default-values.vue
#	resources/views/hardware/view.blade.php
2022-02-20 13:29:12 -08:00
snipe
cbfb8283f3 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2022-02-20 11:29:55 -08:00
snipe
21a6bdabc6 Add @insert-waffle as a contributor 2022-02-20 11:12:52 -08:00
snipe
eaf4fefc90 Merge pull request #10700 from insert-waffle/develop
Fixes #10699: Added 2 breaks in message.blade.php
2022-02-20 11:12:20 -08:00
snipe
19b25a39ea Merge pull request #10697 from inietov/features/save_loggedin_user_after_restore
Feature Save logged in user data and re-add them after restore if they don't exist [ch-17664]
2022-02-20 11:11:54 -08:00
Jens Maes
e5f6b48115 🧑‍🔧 Added 2 breaks in message.blade.php
The uploaded logo does not align properly, therefor I added 2 breaks which make sure the site title is BELOW the logo and not next to it.
2022-02-18 10:27:12 +01:00
Ivan Nieto Vivanco
f1ba5c7742 Changed the warning message in the Backups page 2022-02-17 22:47:35 -06:00
Ivan Nieto Vivanco
23a6907975 Some minor stylistic changes 2022-02-17 18:05:06 -06:00
Ivan Nieto Vivanco
5b2a5ff124 Put the 'remember_token' column as null in the users table 2022-02-17 18:03:00 -06:00
Ivan Nieto Vivanco
548b172744 Logout every connected user 2022-02-17 18:00:24 -06:00
Ivan Nieto Vivanco
263893b3c6 Search logged in user that made the restore, if they doesn't exist in the restored system, add it again 2022-02-17 17:42:06 -06:00
Ivan Nieto Vivanco
811ca51c4f Wipe database before restoration 2022-02-17 16:59:44 -06:00
snipe
a71911eba2 Merge pull request #10688 from snipe/features/add_unique_option_to_custom_fields
Fixes #9592 - Added unique option to custom fields
2022-02-16 16:22:19 -07:00
snipe
13832856f1 Added strings for unique
Signed-off-by: snipe <snipe@snipe.net>
2022-02-16 13:47:59 -08:00
snipe
824eedf7c2 Added UI elements for is_unique
Signed-off-by: snipe <snipe@snipe.net>
2022-02-16 13:47:48 -08:00
snipe
a4a0aa5124 Removed debugging line
Signed-off-by: snipe <snipe@snipe.net>
2022-02-16 13:47:22 -08:00
snipe
6a91d4d19e Check for uniqueness constraint
Signed-off-by: snipe <snipe@snipe.net>
2022-02-16 13:46:22 -08:00
snipe
41778980bc Add migration for is_unique
Signed-off-by: snipe <snipe@snipe.net>
2022-02-16 13:45:59 -08:00
snipe
ea8f9a6dd9 Make is_unique fillable
Signed-off-by: snipe <snipe@snipe.net>
2022-02-16 13:45:44 -08:00
snipe
b78f32e876 Merge pull request #10655 from inietov/fixes/trying_to_get_property_checkin_email_of_non-object_develop
Fixes ErrorException: Trying to get property 'checkin_email' of non-object for develop[sc-17568]
2022-02-16 11:19:14 -07:00
snipe
592f66bd0c Merge pull request #10670 from Godmartinz/gh10639/linear-depreciation-calculation
Fixed #10639 - incorrect linear depreciation calculation
2022-02-16 11:18:27 -07:00
Godfrey M
7b9a2ae909 added rounding 2022-02-14 09:34:42 -08:00
Godfrey M
6e204a20ca fixed current value formula 2022-02-14 09:28:35 -08:00
Godfrey M
e6e68934f7 adds a months depreciated variable 2022-02-14 09:13:14 -08:00
Godfrey M
cdc402fa04 WIP formula for linear Depreciation has been corrected. still one variable left to fix. 2022-02-14 09:01:42 -08:00
snipe
1c0a96b0ce Added gate to supplier
Signed-off-by: snipe <snipe@snipe.net>
2022-02-13 11:58:12 -07:00
Dampfklon
0d49fc3a2e remove unused route, controller functions and view 2022-02-13 12:10:19 +01:00
Dampfklon
43d92bec5b apply translation to view
rearrange eula on top
small design fixes
2022-02-13 12:02:20 +01:00
snipe
de6f922e54 Fixed migration
Signed-off-by: snipe <snipe@snipe.net>
2022-02-10 22:44:46 -08:00
snipe
99541f0bee Fixed string
Signed-off-by: snipe <snipe@snipe.net>
2022-02-10 21:05:23 -08:00
snipe
8b8e93d703 Fixed #10659 - wrong translation string reference
Signed-off-by: snipe <snipe@snipe.net>
2022-02-10 21:03:09 -08:00
Ivan Nieto Vivanco
f36de6c670 Validates if model and model->category exist before return the checkin_email property 2022-02-10 13:53:49 -06:00
snipe
2852359225 Merge pull request #10638 from uberbrady/report_invalid_json_develop
Report invalid json develop
2022-02-08 12:27:29 -08:00
Brady Wetherington
c300e7c7f6 Remove extraneous backslash 2022-02-08 12:23:15 -08:00
Brady Wetherington
fb890fbc30 Properly alert when invalid JSON is submitted to something that wants JSON 2022-02-08 12:22:59 -08:00
snipe
ad52f9df72 Merge pull request #10635 from inietov/fixes/inconsistencies_between_checkout_checkin_dates
Fixes #10627 Inconsistencies between checkout/checkin dates on asset history and activity log
2022-02-08 10:18:52 -08:00
Ivan Nieto Vivanco
d71aa859fc Add custom date to checkin actionlogs and show it in the history of the asset tab 2022-02-08 11:43:24 -06:00
snipe
959074f836 Merge pull request #10625 from inietov/fixes/checkin_checkout_api_routes_broken
Fixes #10614 Checkin/Checkout API route's broken
2022-02-07 11:56:48 -08:00
Ivan Nieto Vivanco
b4d2b1322f Pass ID of the checkin/checkout assets in API 2022-02-07 13:43:13 -06:00
snipe
a77c51c5f2 Merge pull request #10624 from uberbrady/develop_fix_secure_hosts_in_subdirectory
(Develop) fix secure hosts in subdirectory
2022-02-07 11:41:33 -08:00
Brady Wetherington
a15c0adc79 Fix "secure hostnames" feature for subdirectory-based Snipe-IT installs 2022-02-07 11:33:38 -08:00
snipe
f2b8091b31 Merge pull request #10622 from Godmartinz/bug/sc-18678/add-required-field-marker-to-default-currency
Fixed Bug/sc 18678/add required field marker to default currency
2022-02-07 10:34:27 -08:00
Godfrey M
67882f5531 Removed untracked fileseetvert "adding untracked files"
This reverts commit 9d0b163c11.
2022-02-07 10:23:24 -08:00
Godfrey M
5a70bba51b changed model for default currency requirement check 2022-02-07 09:51:35 -08:00
Godfrey M
9d0b163c11 adding untracked files 2022-02-07 08:58:49 -08:00
snipe
c0cc90066f Merge pull request #10605 from inietov/fixes/column_activated_cannot_be_null_develop
Fixes: Column activated cannot be null for develop [sc-18528]
2022-02-02 12:16:39 -08:00
Ivan Nieto Vivanco
fa2f8409f9 Add a casting to a truthy/falsy that needs to be integer 2022-02-02 14:09:23 -06:00
snipe
ce154a2382 Merge pull request #10455 from adagioajanes/features/quickscan_checkin
Added #10454: Quick Scan Checkin
2022-02-01 20:19:45 -08:00
snipe
06a5ea1530 Fixed duplicate use statement
Signed-off-by: snipe <snipe@snipe.net>
2022-02-01 18:57:45 -08:00
snipe
99c4fd8f84 Updated assets
Signed-off-by: snipe <snipe@snipe.net>
2022-02-01 18:56:18 -08:00
snipe
d2655c1092 Bumped RC version
Signed-off-by: snipe <snipe@snipe.net>
2022-02-01 18:54:46 -08:00
snipe
5fded57ec6 Merge remote-tracking branch 'origin/master' into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	README.md
#	app/Console/Commands/LdapSync.php
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/ProfileController.php
#	app/Importer/ItemImporter.php
#	app/Importer/UserImporter.php
#	app/Models/Asset.php
#	app/Models/License.php
#	app/Providers/AppServiceProvider.php
#	app/Services/LdapAd.php
#	config/version.php
#	public/js/build/app.js
#	public/js/dist/all.js
#	public/mix-manifest.json
#	resources/lang/ar/button.php
#	resources/lang/de/admin/companies/general.php
#	resources/lang/de/admin/custom_fields/general.php
#	resources/lang/de/admin/groups/titles.php
#	resources/lang/de/admin/hardware/form.php
#	resources/lang/de/admin/hardware/general.php
#	resources/lang/de/admin/hardware/message.php
#	resources/lang/de/admin/hardware/table.php
#	resources/lang/de/admin/kits/general.php
#	resources/lang/de/admin/locations/table.php
#	resources/lang/de/admin/reports/general.php
#	resources/lang/de/admin/settings/general.php
#	resources/lang/de/admin/settings/message.php
#	resources/lang/de/admin/users/general.php
#	resources/lang/de/general.php
#	resources/lang/de/mail.php
#	resources/lang/en/admin/asset_maintenances/message.php
#	resources/lang/en/admin/asset_maintenances/table.php
#	resources/lang/en/admin/companies/general.php
#	resources/lang/en/admin/companies/message.php
#	resources/lang/en/admin/custom_fields/general.php
#	resources/lang/en/admin/depreciations/general.php
#	resources/lang/en/admin/groups/titles.php
#	resources/lang/en/admin/hardware/form.php
#	resources/lang/en/admin/hardware/general.php
#	resources/lang/en/admin/hardware/table.php
#	resources/lang/en/admin/kits/general.php
#	resources/lang/en/admin/locations/table.php
#	resources/lang/en/admin/reports/general.php
#	resources/lang/en/admin/settings/general.php
#	resources/lang/en/admin/settings/message.php
#	resources/lang/en/admin/users/general.php
#	resources/lang/en/button.php
#	resources/lang/en/general.php
#	resources/lang/en/help.php
#	resources/lang/en/mail.php
#	resources/lang/en/passwords.php
#	resources/lang/hu/admin/hardware/general.php
#	resources/lang/hu/admin/hardware/table.php
#	resources/lang/hu/admin/locations/table.php
#	resources/lang/is/admin/locations/table.php
#	resources/lang/ko/admin/custom_fields/general.php
#	resources/lang/ko/general.php
#	resources/lang/nl/admin/hardware/general.php
#	resources/lang/nl/admin/hardware/message.php
#	resources/lang/nl/admin/hardware/table.php
#	resources/lang/nl/admin/locations/table.php
#	resources/lang/nl/admin/statuslabels/message.php
#	resources/lang/nl/admin/users/general.php
#	resources/lang/no/admin/companies/general.php
#	resources/lang/no/admin/custom_fields/general.php
#	resources/lang/no/admin/depreciations/general.php
#	resources/lang/no/admin/depreciations/table.php
#	resources/lang/no/admin/groups/titles.php
#	resources/lang/no/admin/hardware/form.php
#	resources/lang/no/admin/hardware/general.php
#	resources/lang/no/admin/hardware/table.php
#	resources/lang/no/admin/kits/general.php
#	resources/lang/no/admin/locations/table.php
#	resources/lang/no/admin/reports/general.php
#	resources/lang/no/admin/settings/general.php
#	resources/lang/no/admin/settings/message.php
#	resources/lang/no/admin/statuslabels/message.php
#	resources/lang/no/admin/users/general.php
#	resources/lang/no/button.php
#	resources/lang/no/general.php
#	resources/lang/no/mail.php
#	resources/lang/no/validation.php
#	resources/lang/pl/admin/companies/general.php
#	resources/lang/pl/admin/custom_fields/general.php
#	resources/lang/pl/admin/depreciations/general.php
#	resources/lang/pl/admin/depreciations/table.php
#	resources/lang/pl/admin/groups/titles.php
#	resources/lang/pl/admin/hardware/form.php
#	resources/lang/pl/admin/hardware/general.php
#	resources/lang/pl/admin/hardware/table.php
#	resources/lang/pl/admin/kits/general.php
#	resources/lang/pl/admin/locations/table.php
#	resources/lang/pl/admin/reports/general.php
#	resources/lang/pl/admin/settings/general.php
#	resources/lang/pl/admin/settings/message.php
#	resources/lang/pl/admin/users/general.php
#	resources/lang/pl/button.php
#	resources/lang/pl/general.php
#	resources/lang/pt-PT/admin/companies/general.php
#	resources/lang/pt-PT/admin/custom_fields/general.php
#	resources/lang/pt-PT/admin/depreciations/general.php
#	resources/lang/pt-PT/admin/depreciations/table.php
#	resources/lang/pt-PT/admin/groups/titles.php
#	resources/lang/pt-PT/admin/hardware/form.php
#	resources/lang/pt-PT/admin/hardware/general.php
#	resources/lang/pt-PT/general.php
#	resources/lang/pt-PT/help.php
#	resources/lang/pt-PT/validation.php
#	resources/lang/ro/admin/companies/general.php
#	resources/lang/ro/admin/custom_fields/general.php
#	resources/lang/ro/admin/groups/titles.php
#	resources/lang/ro/admin/hardware/form.php
#	resources/lang/ro/admin/hardware/general.php
#	resources/lang/ro/admin/hardware/message.php
#	resources/lang/ro/admin/hardware/table.php
#	resources/lang/ro/admin/locations/table.php
#	resources/lang/ro/admin/settings/message.php
#	resources/lang/ru/admin/companies/general.php
#	resources/lang/ru/admin/custom_fields/general.php
#	resources/lang/ru/admin/settings/general.php
#	resources/lang/ru/button.php
#	resources/lang/ru/general.php
#	resources/lang/ru/validation.php
#	resources/lang/sk/admin/settings/general.php
#	resources/lang/sk/button.php
#	resources/lang/sk/general.php
#	resources/lang/tr/admin/hardware/form.php
#	resources/lang/tr/admin/hardware/table.php
#	resources/lang/tr/admin/kits/general.php
#	resources/lang/tr/admin/locations/table.php
#	resources/lang/tr/admin/reports/general.php
#	resources/lang/tr/admin/settings/general.php
#	resources/lang/tr/admin/settings/message.php
#	resources/lang/tr/admin/statuslabels/message.php
#	resources/lang/tr/admin/users/general.php
#	resources/lang/tr/button.php
#	resources/lang/tr/general.php
#	resources/lang/zh-CN/admin/companies/general.php
#	resources/lang/zh-CN/admin/custom_fields/general.php
#	resources/lang/zh-CN/admin/depreciations/general.php
#	resources/lang/zh-CN/admin/depreciations/table.php
#	resources/lang/zh-CN/admin/groups/titles.php
#	resources/lang/zh-CN/admin/hardware/form.php
#	resources/lang/zh-CN/admin/hardware/general.php
#	resources/lang/zh-CN/admin/hardware/message.php
#	resources/lang/zh-CN/admin/hardware/table.php
#	resources/lang/zh-CN/admin/kits/general.php
#	resources/lang/zh-CN/admin/locations/table.php
#	resources/lang/zh-CN/admin/reports/general.php
#	resources/lang/zh-CN/admin/settings/general.php
#	resources/lang/zh-CN/admin/settings/message.php
#	resources/lang/zh-CN/admin/statuslabels/message.php
#	resources/lang/zh-CN/admin/users/general.php
#	resources/lang/zh-CN/button.php
#	resources/lang/zh-CN/general.php
#	resources/lang/zh-CN/mail.php
#	resources/views/depreciations/edit.blade.php
2022-02-01 18:53:05 -08:00
snipe
cda13f69ae Merge pull request #10592 from uberbrady/fix_upcoming_audits_email
Fixed markdown upcoming audits email table
2022-02-01 17:25:46 -08:00
snipe
669826f6b2 Merge pull request #10574 from uberbrady/fix_force_root_url_v6
Add some guardrails around very-badly formatted APP_URL settings
2022-02-01 16:14:48 -08:00
snipe
a7d34dfb19 Merge pull request #10579 from misilot/fix-10176-webui
Replace .my.cnf with column-statistics.cnf at the system level for mysqldump
2022-02-01 16:14:37 -08:00
snipe
8083ba8dca Merge pull request #10590 from inietov/fixes/bulkedit_does_not_show_in_history_develop
Fixes Bulk edit doesn't show in Asset's history nor Activity report for develop [sc-16550]
2022-02-01 16:14:25 -08:00
snipe
237bc22a5c Merge pull request #10591 from uberbrady/allow_invalid_app_urls_develop
Allow invalid app urls develop
2022-02-01 14:17:08 -08:00
Brady Wetherington
eaba560877 We had a markdown failure in the upcoming audits table, this fixes it. 2022-02-01 14:06:01 -08:00
Brady Wetherington
f70c238b1c Merge remote-tracking branch 'upstream/develop' into develop 2022-02-01 11:53:33 -08:00
Ivan Nieto Vivanco
3ef775533a Adds actionlog for bulk edits 2022-02-01 12:10:46 -06:00
snipe
b9d6708181 Merge pull request #10588 from TenOfTens/develop
Typo found in snipeit/routes/api.php @ line 391
2022-02-01 07:21:08 -08:00
TenOfTens
70eeafd2a3 Update api.php
Typo at line 391 GroupsCOntroller to GroupsController. Was causing an error with the groups view not reflecting the actual groups seen from the database.
2022-02-01 08:51:34 -06:00
Brady Wetherington
72e9360228 Merge remote-tracking branch 'upstream/develop' into develop 2022-01-31 10:13:30 -08:00
Tom Misilo
fb585955b4 Replace .my.cnf with column-statistics.cnf at the system level for mysqldump
Fixes #10176

The `column-statistics.cnf` file is copied to `/etc/mysql/conf.d/column-statistics.cnf` for each Dockerfile that exists.

This puts it as a system level mysql client change, so the web ui interface also works.
2022-01-29 07:24:50 -06:00
Brady Wetherington
44719e3dcc Fix whitespace issues 2022-01-27 11:29:20 -08:00
Brady Wetherington
476075235a Add some guardrails around very-badly formatted APP_URL settings 2022-01-27 11:24:21 -08:00
snipe
a65fb63b6b Merge pull request #10511 from inietov/features/audit_date_in_importer
Adds audit dates in the asset importer
2022-01-27 10:58:53 -08:00
snipe
0eab249819 Merge pull request #10569 from inietov/fixes/donked_layout_required_field_error_depreciation_develop
Fixes donked layout required field error depreciation in develop[sc-17111]
2022-01-27 10:57:33 -08:00
Ivan Nieto Vivanco
34819ec5cf Fixes the appearance of some error messages 2022-01-26 23:00:52 -06:00
snipe
b153138d1e Merge pull request #10534 from inietov/feature/add_remaining_address_field_to_user_import_develop
Add Zip field in the User Importer for develop [sc-18556]
2022-01-26 16:58:37 -08:00
snipe
d0b90bdff9 Merge pull request #10568 from inietov/fixes/importing_and_checking_out_licenses
Fixes Importing licenses without product key duplicates the license for develop branch
2022-01-26 16:30:00 -08:00
Ivan Nieto Vivanco
450cb8f92f Tweak query in the License Importer to not require a Product Key 2022-01-26 17:49:34 -06:00
snipe
8ebade7892 Merge pull request #10566 from inietov/fixes/cant_add_customfield_to_fieldset
Fix #10564: Edit the route to associate custom fields with fieldsets
2022-01-26 13:02:26 -08:00
Ivan Nieto Vivanco
fcd203f4dc Fix the route to associate custom fields with fieldsets 2022-01-26 14:43:20 -06:00
Brady Wetherington
48f1380f6e Merge pull request #10528 from uberbrady/fix_insecure_host_headers_v6
Force UrlGenerator's Root URL to be the base of APP_URL unless overriden
2022-01-24 18:26:30 -08:00
snipe
eade041b6e Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2022-01-21 12:33:53 -08:00
snipe
ee47a02792 Updated assets
Signed-off-by: snipe <snipe@snipe.net>
2022-01-21 12:33:49 -08:00
snipe
8813f55770 Merge pull request #10545 from inietov/fixes/unable_to_add_asset_model
Fixes #10536 Unable to add asset model (v6.0.0-RC-1)
2022-01-21 10:13:10 -08:00
Ivan Nieto Vivanco
7383ec7f1e Add an early return if the model id is not set (for new Asset Models) 2022-01-21 11:45:45 -06:00
Ivan Nieto Vivanco
c86ed892ab Add Zip field in the User Importer 2022-01-19 13:52:15 -06:00
Brady Wetherington
455bc736be Force UrlGenerator's Root URL to be the base of APP_URL unless overriden 2022-01-18 15:31:30 -08:00
snipe
a26119c262 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2022-01-18 14:50:35 -08:00
snipe
e7541f29d2 Use php artisan serve url
Signed-off-by: snipe <snipe@snipe.net>
2022-01-18 14:50:24 -08:00
snipe
c8c559784d Merge pull request #10522 from inietov/fixes/depreciation_report_shows_assets_that_not_deprecate
Fixes bug where the depreciation report shows assets that not depreciate
2022-01-15 12:23:58 -08:00
Ivan Nieto Vivanco
8334ed6f7e Add query to filter non-deprecable assets when the Depreciation Report is called 2022-01-15 14:01:19 -06:00
Ivan Nieto Vivanco
9ae03f21dc Adds condition to only charge custom field's livewire when the model is updated 2022-01-15 12:14:34 -06:00
Ivan Nieto Vivanco
92b3576395 Fixes a route definition to correctly populate the deprecation report 2022-01-15 12:02:43 -06:00
snipe
6d96f96615 Merge pull request #10520 from inietov/fixes/sc-14356/importer_creating_duplicate_asset_models
Fixes an issue where importer is creating duplicate asset models
2022-01-15 07:47:36 -08:00
Ivan Nieto Vivanco
58b1db29e2 Adds condition to only update the Asset's Model Number if is provided by import file 2022-01-15 04:15:38 -06:00
Ivan Nieto Vivanco
8bd280b416 Add to Importer the capacity to search Models only with Model Name since Model Number is not required 2022-01-15 04:12:30 -06:00
Ivan Nieto Vivanco
d5f6f6cafe Fixes duplicate API endpoint that returns fieldsets instead of customfields 2022-01-15 03:46:28 -06:00
snipe
b9cc0c9d4c Merge pull request #10519 from uberbrady/request_pending_assets
Make 'pending' assets properly requestable; use requestable scope
2022-01-14 13:07:16 -08:00
Brady Wetherington
ef463a37d8 Make 'pending' assets properly requestable; use requestable scope 2022-01-14 12:48:33 -08:00
snipe
cfb64be9a4 More specific RC version number
Signed-off-by: snipe <snipe@snipe.net>
2022-01-13 21:41:04 -08:00
snipe
91017aed52 Bumped to RC-1
Signed-off-by: snipe <snipe@snipe.net>
2022-01-13 21:38:10 -08:00
snipe
af2e407543 Normalize array format in en language to the new shitty way
Signed-off-by: snipe <snipe@snipe.net>
2022-01-13 21:30:35 -08:00
snipe
ddfa5776c5 Updated language strings
This absolutely sucks. Something changed in CrowdIn or something else, which results in this push being *thousands* of files because someone somewhere decided that `return [];` was vastly inferior to `return array();`

I'll try to fix it. :(

FML

Signed-off-by: snipe <snipe@snipe.net>
2022-01-13 21:27:29 -08:00
snipe
da47f62d17 Added strings
Signed-off-by: snipe <snipe@snipe.net>
2022-01-13 21:20:38 -08:00
snipe
207ff014b1 Merge pull request #10514 from uberbrady/fix_double_wildcard_query_requestable
Fixed extraneous wildcard query in requestable asset search
2022-01-13 19:39:08 -08:00
Brady Wetherington
65e584c2bd Revert the unnecessary optimization for asset->count() 2022-01-13 19:37:08 -08:00
snipe
591e1c6a9d Merge pull request #10512 from uberbrady/fix_asset_acceptance_routing_bug
Duplicate route meant overwrite of route-name
2022-01-13 17:08:26 -08:00
snipe
24a234ede3 Merge pull request #10503 from uberbrady/develop_fix_dont_req_preauth_uac
Permit DONT_REQ_PREAUTH AD users to log in
2022-01-13 17:01:59 -08:00
Brady Wetherington
4e8ae8a162 Fix extraneous wildcard query in requestable asset search 2022-01-13 16:32:40 -08:00
Brady Wetherington
c527a5c6e7 Duplicate route meant overwrite of route-name 2022-01-13 16:03:32 -08:00
Ivan Nieto Vivanco
949fe2a14a Adds last_audit_date and next_audit_date in the asset importer 2022-01-13 15:14:20 -06:00
snipe
4e3fd6bfaf Merge pull request #10509 from misilot/fix-10176
Adding .my.cnf to disable column-statistics backup
2022-01-13 13:13:54 -08:00
Thomas Misilo
930666ffa0 Adding .my.cnf to disable column-statistics backup
Fixes #10176

The ```.my.cnf``` file is copied to ```/root/.my.cnf``` for each
Dockerfile that exists
2022-01-13 14:36:00 -06:00
snipe
0e5ef53c35 Merge pull request #10504 from snipe/fixes/auth_controls_on_api_key_creation
Fixes auth controls on api key creation
2022-01-13 01:36:52 -08:00
snipe
512dbfee7a Added gate to check that the user is allowed to view API keys
Signed-off-by: snipe <snipe@snipe.net>
2022-01-13 01:33:27 -08:00
snipe
eb8f23a888 Removed commented code
Signed-off-by: snipe <snipe@snipe.net>
2022-01-13 01:32:28 -08:00
snipe
8f4ec95fbb Remove assets query, since we handle that via API call now and just need the count()
Signed-off-by: snipe <snipe@snipe.net>
2022-01-12 23:23:00 -08:00
snipe
67ba8a6281 Removed extra spaces
Signed-off-by: snipe <snipe@snipe.net>
2022-01-12 23:18:39 -08:00
snipe
9368ddeaf0 Added badge count on requestable assets
Signed-off-by: snipe <snipe@snipe.net>
2022-01-12 23:17:54 -08:00
snipe
f206d4ed4e Fixed double div in current purchase value
Signed-off-by: snipe <snipe@snipe.net>
2022-01-12 22:26:56 -08:00
snipe
224d0b2fd2 Small language file additions
Signed-off-by: snipe <snipe@snipe.net>
2022-01-12 22:21:00 -08:00
snipe
ae50f86c39 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2022-01-12 20:52:30 -08:00
snipe
43c57c8461 Merge master into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	.all-contributorsrc
#	README.md
#	app/Http/Controllers/BulkAssetModelsController.php
#	app/Http/Controllers/CustomFieldsController.php
#	app/Http/Controllers/CustomFieldsetsController.php
#	app/Http/Controllers/ModalController.php
#	app/Http/Transformers/GroupsTransformer.php
#	config/version.php
#	package-lock.json
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/css/dist/bootstrap-table.css
#	public/js/build/app.js
#	public/js/dist/all.js
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
#	resources/assets/less/overrides.less
#	resources/lang/en/admin/hardware/message.php
#	resources/lang/en/admin/settings/general.php
#	resources/views/partials/bootstrap-table.blade.php
#	routes/web.php
2022-01-12 20:51:33 -08:00
snipe
ba5b835933 Lock seeder to english
Signed-off-by: snipe <snipe@snipe.net>
2022-01-12 13:10:29 -08:00
Brady Wetherington
a063806bcc Permit DONT_REQ_PREAUTH AD users to log in 2022-01-12 12:50:39 -08:00
snipe
df0da0f3bc Fixed escaped string
Signed-off-by: snipe <snipe@snipe.net>
2022-01-12 11:20:31 -08:00
Alex Janes
d2bb3e6377 Merge branch 'develop' into features/quickscan_checkin 2022-01-11 16:40:20 -05:00
snipe
2262176a60 Merge pull request #10449 from adagioajanes/features/lock_logins_to_saml
Added #10436: Restricted Logins to SAML controlled via environment variable
2022-01-11 12:37:54 -08:00
Alex Janes
edef640d35 Merge branch 'develop' into features/lock_logins_to_saml 2022-01-11 09:05:14 -05:00
snipe
23a2700178 Merge pull request #10491 from snipe/fixes/migration_licenses_table_issue
Fixed - v6 migration licenses table issue
2022-01-10 15:51:18 -08:00
snipe
ea83567e7d Merge pull request #10494 from exula/fix/increase_max_licenses
Fixed #7824
2022-01-10 15:04:47 -08:00
snipe
dcc199835b Add @nuraeil as a contributor 2022-01-10 14:56:22 -08:00
snipe
d9624b59b4 Merge pull request #10264 from nuraeil/added-localized-strings
Added #10242: Improved localized strings
2022-01-10 14:48:52 -08:00
snipe
b98c97b00e Merge pull request #10265 from uberbrady/remove_old_ldap
Remove old ldap
2022-01-10 14:34:34 -08:00
Brad
6b6a83a525 Removing something stupid PHPStorm put in the use area 2022-01-10 14:21:19 -05:00
Brad
81084fa717 Fixed #7824
Previously there was a 999 max seats on Licenses as anything above that seemed to cause slowdowns and failure.

This commit allievates those pain points

- removed freeSeats as a hydrated Eloquent model on JSON requests for the licenses index
- removed 'licenseSeats.user', 'licenseSeats.asset' from the 'with' clause as it's not needed in the view (Datatabales takes care of that)
- removed the 999 max seats limit from the License Model,
- reworked how new license seats are created when increasing seats or creating licenses
- Added an index the license_seats table to help speed up lookups
2022-01-10 14:03:28 -05:00
Wächtler, Yannick
f906dbd81e Added missed translation strings, fixed the column width for the date selector (too small in certain languages) 2022-01-10 09:21:23 +01:00
Nuraeil
5bb2f6fa0f Merge branch 'develop' into added-localized-strings 2022-01-09 17:40:54 +01:00
Wächtler, Yannick
b77e7f88d4 fix(bootstrap-table): adds locale env to table init, adds bootstrap-table-locale-all to webpack-mix 2022-01-09 17:35:28 +01:00
snipe
66976d9359 Merge pull request #10492 from snipe/fixes/finish_localizing_backup_restore
Finished localizing backup restore strings
2022-01-07 16:51:43 -08:00
snipe
0f5bb0e65d Localize bakcup restore strings
Signed-off-by: snipe <snipe@snipe.net>
2022-01-07 16:50:19 -08:00
snipe
8719b3d3e9 Only try to create the licenses table if it doesn't exist
Signed-off-by: snipe <snipe@snipe.net>
2022-01-07 15:43:34 -08:00
Wächtler, Yannick
c3ab4c7512 Fixed the tables not displaying the correct language 2022-01-06 14:29:10 +01:00
Wächtler, Yannick
04d649122b Fixed duplication for a couple of items, removed TODO markers, added lots of translation strings where there was a TODO 2022-01-06 12:35:37 +01:00
Nuraeil
271c364ef8 Merge pull request #9 from snipe/develop
Merge snipe/snipe-it:develop into nuraeil/snipe-it:added-localized-strings
2022-01-04 10:48:51 +01:00
Brady Wetherington
95c30cae8d Some duplicate imports at the top of the Settings file 2022-01-03 13:53:53 -08:00
Brady Wetherington
3c7f2e89ec Merge branch 'develop' into remove_old_ldap
Had to re-do the composer install because the conflicts were too complicated.
2022-01-03 12:56:58 -08:00
snipe
359b22e17a Applies #10470 to develop
Signed-off-by: snipe <snipe@snipe.net>
2021-12-27 13:22:47 -08:00
snipe
aaeda5bf76 Merge pull request #10468 from snipe/fixes/10467_safari_font_awesome_content_code_headers
Fixed #10467 - Safari only font-awesome bug
2021-12-24 12:34:36 -08:00
snipe
8be6d10dbe Fixed #10467 - Safari only font-awesome bug
Signed-off-by: snipe <snipe@snipe.net>
2021-12-24 12:30:34 -08:00
snipe
fde5c6c226 Add @adagioajanes as a contributor 2021-12-24 11:21:46 -08:00
snipe
f4ef828332 Fixex js table export
Signed-off-by: snipe <snipe@snipe.net>
2021-12-24 11:17:36 -08:00
snipe
87f52cbfec Seeder fixes
Signed-off-by: snipe <snipe@snipe.net>
2021-12-24 10:47:06 -08:00
Alex Janes
ea93f82bde added the notes field to allow users to quickly add notes to multiple checkins at once 2021-12-23 17:37:48 -05:00
snipe
69bc02727b Merge pull request #10460 from inietov/fixes/duplicate_department_in_user_import
Fixes Duplicate department in user import
2021-12-21 13:30:24 -08:00
Ivan Nieto Vivanco
e03a8cc721 Delete an extra entry for Departments when importing Users via GUI 2021-12-21 14:42:51 -06:00
Alex Janes
2e5820e29d small phrase change 2021-12-20 23:31:10 -05:00
Alex Janes
b01a4468c7 refactored from bulkcheckin to quickscancheckin 2021-12-20 23:27:36 -05:00
snipe
48d3bfef03 Merge pull request #10421 from Robert-Azelis/patch-5
Create new user account from asset form - additional fields
2021-12-20 17:05:38 -08:00
Alex Janes
7acb559069 corrected issue with asset not found errors 2021-12-20 19:55:00 -05:00
Alex Janes
55b8d080b9 more lang changes 2021-12-20 19:39:06 -05:00
Alex Janes
fcc9815c6e Revert "Added phrase to all language files to prevent errors (translation still needs to happen)"
This reverts commit 87ef37b0b4.
2021-12-20 18:05:21 -05:00
Alex Janes
cb14abfc54 Revert "fixed zh-CN file format"
This reverts commit 20f66a1b55.
2021-12-20 18:05:09 -05:00
Alex Janes
3841c3560b changed a page title 2021-12-20 16:52:00 -05:00
Alex Janes
20f66a1b55 fixed zh-CN file format 2021-12-20 14:05:13 -05:00
Alex Janes
2b5aca183c removed unnecessary additional data call from api method 2021-12-19 19:21:58 -05:00
Alex Janes
14b21a6e95 removed some whitespace 2021-12-19 19:17:32 -05:00
Alex Janes
08cb8c354b more cleanup to fit formatting convention 2021-12-19 19:11:24 -05:00
Alex Janes
87ef37b0b4 Added phrase to all language files to prevent errors (translation still needs to happen) 2021-12-19 18:50:55 -05:00
Alex Janes
29da4f4325 Removed a bunch of redundant code I created from the API 2021-12-19 18:39:57 -05:00
Alex Janes
bc4fe88ac0 First version of bulk checkin 2021-12-19 16:53:31 -05:00
Alex Janes
ead142cdf7 Corrected a tiny HTML typo in the SAML view. (Unrelated to this PR) 2021-12-18 12:00:07 -05:00
Alex Janes
9d4a6b85ed Merge remote-tracking branch 'origin/features/lock_logins_to_saml' into features/lock_logins_to_saml 2021-12-18 11:56:57 -05:00
Alex Janes
227ca61301 Changed phrasing of "SAML Force Login" to "SAML Default Login" (English only at this point) 2021-12-18 11:56:36 -05:00
Alex Janes
a68ec8bb57 Update LoginController.php
Updated if statements to match convention exactly.
2021-12-17 18:52:42 -05:00
Alex Janes
74de91c31a Merge pull request #1 from snipe/develop
Develop
2021-12-17 14:51:03 -05:00
snipe
4ca2252e3b Switches GET to POST for request assset
Signed-off-by: snipe <snipe@snipe.net>
2021-12-16 20:32:29 -08:00
Alex Janes
d99db5c63b bug fix and formatting fix 2021-12-16 19:04:37 -05:00
Wächtler, Yannick
2901525194 Merge branch 'snipe-develop' into added-localized-strings 2021-12-17 00:22:08 +01:00
Wächtler, Yannick
279fced877 merge 2021-12-17 00:14:36 +01:00
snipe
8c5dce5dcf Merge pull request #10450 from snipe/master_into_develop
Master into develop
2021-12-16 14:45:53 -08:00
snipe
398180dc59 Small merge unmagling
Signed-off-by: snipe <snipe@snipe.net>
2021-12-16 14:38:04 -08:00
snipe
6be98638ed Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2021-12-16 14:29:38 -08:00
snipe
c3d55ee27e Merge master down into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	.all-contributorsrc
#	README.md
#	app/Exceptions/Handler.php
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Api/SettingsController.php
#	app/Http/Controllers/CustomFieldsController.php
#	app/Http/Controllers/SettingsController.php
#	app/Http/Transformers/AssetsTransformer.php
#	app/Models/Setting.php
#	config/version.php
#	resources/lang/af/button.php
#	resources/lang/ar/button.php
#	resources/lang/bg/button.php
#	resources/lang/cs/button.php
#	resources/lang/cy/button.php
#	resources/lang/da/button.php
#	resources/lang/de/button.php
#	resources/lang/el/button.php
#	resources/lang/en-GB/button.php
#	resources/lang/en-ID/button.php
#	resources/lang/es-CO/admin/groups/message.php
#	resources/lang/es-MX/button.php
#	resources/lang/et/admin/custom_fields/general.php
#	resources/lang/et/admin/hardware/table.php
#	resources/lang/et/admin/kits/general.php
#	resources/lang/et/admin/manufacturers/message.php
#	resources/lang/et/admin/models/general.php
#	resources/lang/et/admin/settings/general.php
#	resources/lang/et/button.php
#	resources/lang/et/mail.php
#	resources/lang/fa/button.php
#	resources/lang/fa/help.php
#	resources/lang/fi/button.php
#	resources/lang/fil/button.php
#	resources/lang/fr/button.php
#	resources/lang/ga-IE/button.php
#	resources/lang/he/button.php
#	resources/lang/hr/button.php
#	resources/lang/hu/admin/settings/general.php
#	resources/lang/hu/auth/message.php
#	resources/lang/hu/button.php
#	resources/lang/hu/mail.php
#	resources/lang/id/admin/hardware/table.php
#	resources/lang/id/button.php
#	resources/lang/it/button.php
#	resources/lang/iu/button.php
#	resources/lang/ja/button.php
#	resources/lang/ko/button.php
#	resources/lang/lt/button.php
#	resources/lang/lv/button.php
#	resources/lang/mi/button.php
#	resources/lang/mk/button.php
#	resources/lang/ml-IN/button.php
#	resources/lang/mn/button.php
#	resources/lang/ms/admin/hardware/table.php
#	resources/lang/ms/admin/kits/general.php
#	resources/lang/ms/admin/models/general.php
#	resources/lang/ms/admin/models/message.php
#	resources/lang/ms/admin/settings/general.php
#	resources/lang/ms/button.php
#	resources/lang/nl/button.php
#	resources/lang/no/admin/hardware/table.php
#	resources/lang/no/admin/kits/general.php
#	resources/lang/no/admin/settings/general.php
#	resources/lang/no/auth/message.php
#	resources/lang/no/button.php
#	resources/lang/no/help.php
#	resources/lang/no/mail.php
#	resources/lang/pl/button.php
#	resources/lang/pt-BR/button.php
#	resources/lang/pt-PT/auth/message.php
#	resources/lang/pt-PT/button.php
#	resources/lang/pt-PT/mail.php
#	resources/lang/ro/button.php
#	resources/lang/ru/admin/settings/general.php
#	resources/lang/ru/button.php
#	resources/lang/ru/help.php
#	resources/lang/sl/admin/custom_fields/general.php
#	resources/lang/sl/admin/hardware/table.php
#	resources/lang/sl/admin/kits/general.php
#	resources/lang/sl/admin/manufacturers/message.php
#	resources/lang/sl/admin/models/general.php
#	resources/lang/sl/admin/settings/general.php
#	resources/lang/sl/admin/users/general.php
#	resources/lang/sl/auth/message.php
#	resources/lang/sl/button.php
#	resources/lang/sl/help.php
#	resources/lang/sr-CS/button.php
#	resources/lang/ta/button.php
#	resources/lang/th/button.php
#	resources/lang/th/mail.php
#	resources/lang/tl/button.php
#	resources/lang/tr/admin/settings/general.php
#	resources/lang/tr/auth/message.php
#	resources/lang/tr/button.php
#	resources/lang/uk/button.php
#	resources/lang/ur-PK/button.php
#	resources/lang/vi/button.php
#	resources/lang/zh-CN/button.php
#	resources/lang/zh-HK/button.php
#	resources/lang/zh-TW/admin/hardware/table.php
#	resources/lang/zh-TW/button.php
#	resources/lang/zu/button.php
#	resources/views/models/custom_fields_form.blade.php
#	resources/views/reports/custom.blade.php
#	resources/views/settings/slack.blade.php
2021-12-16 14:26:24 -08:00
Alex Janes
6898119891 Replaced env() with config() to check environment variables
Made the app.php description for 'REQUIRE_SAML' a bit more... descriptive.
2021-12-16 16:56:39 -05:00
Alex Janes
a6116a1b15 If SAML required, don't accept login form post. 2021-12-16 14:33:25 -05:00
Alex Janes
696943b04b Add option to environment to require SAML for a more secure installation. 2021-12-16 11:44:34 -05:00
Alex Janes
3c8d70c5fb Add option to environment to require SAML for a more secure installation. 2021-12-16 11:44:07 -05:00
Nuraeil
c3b7576d99 Merge pull request #7 from snipe/develop
Develop
2021-12-14 19:51:40 +01:00
Wächtler, Yannick
484b996879 fixed merge conflicts 2021-12-14 19:48:59 +01:00
snipe
52322806fa Merge pull request #10434 from inietov/fixes/v6_components_error
Fix route to checkout components from the details page
2021-12-14 10:41:24 -08:00
Wächtler, Yannick
4397a12efc Merge branch 'develop' of https://github.com/snipe/snipe-it into snipe-develop 2021-12-14 19:37:27 +01:00
Ivan Nieto Vivanco
d083f89f30 Delete extra character remaining from previous tests :( 2021-12-14 12:32:30 -06:00
snipe
59555483f3 Merge pull request #10432 from inietov/features/adding_title_to_custom_report
Add title column to custom reports
2021-12-14 10:28:02 -08:00
Ivan Nieto Vivanco
2402f00a2e Fix route to checkout components from the details page 2021-12-14 12:26:46 -06:00
Ivan Nieto Vivanco
0037cdb00c Add title column to custom reports 2021-12-13 20:27:23 -06:00
Robert-Azelis
01608d81ab Update user.blade.php
Create new user account from asset form - additional fields #10420
2021-12-13 09:22:25 +01:00
Ivan Nieto Vivanco
5bda4b79d2 Fixes the Asset Factory to assign example Suppliers and Locations to Assets 2021-12-11 21:36:54 -06:00
Ivan Nieto Vivanco
b43a0569b1 Fixes trying to get property 'id' of non-object in develop seeders 2021-12-11 17:26:41 -06:00
snipe
503c802d70 Merge pull request #10416 from uberbrady/yank_assetlogs_from_asset_api
Yank assetlog from eager-load clause in API query for develop
2021-12-10 19:09:55 -08:00
Brady Wetherington
ea71086dfc Yank assetlog from eager-load clause in API query for develop 2021-12-10 18:50:34 -08:00
snipe
713fbdc0a6 Merge pull request #10239 from Godmartinz/Adds-info-on-how-to-nullify-reorder-alerts
adds info on how to nullify reorder alerts for consumables, component…
2021-12-08 14:26:22 -08:00
snipe
6d84482104 Merge pull request #10388 from snipe/features/switch_to_dusk
WIP - Fixing unit tests, switching to dusk
2021-12-06 14:19:36 -08:00
snipe
0ba55e0eaf Merge pull request #10393 from aranar-pro/fix/#10365-Total-Purchase
Fixed #10365: Snipe-IT has a wrong total purchase cost when reaches m…
2021-12-06 14:08:24 -08:00
snipe
4612b9e711 Merge pull request #10394 from snipe/fixes/add_stricter_validation_for_slack_hooks
Adds stricter validation for slack hooks
2021-12-06 11:41:11 -08:00
snipe
ebdbc20740 Adds stricter validation for slack endpoints
Signed-off-by: snipe <snipe@snipe.net>
2021-12-06 11:40:24 -08:00
Andrew Roth
d1d3b84f77 Fixed #10365: Snipe-IT has a wrong total purchase cost when reaches million. Fixed to remove multiple commas in +1M per item. 2021-12-06 13:06:23 -05:00
snipe
66ed311914 Fixed asset maintenances test
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 20:14:39 -08:00
snipe
f334bf1058 Fixed notification tests
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 20:01:03 -08:00
snipe
0104f35f31 Fixed Component Test, commented Consumables
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 19:43:15 -08:00
snipe
222ee8e0bf Slight refactor on depreciation test
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 19:36:07 -08:00
snipe
0e3bafd5b4 Fixed depreciation tests
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 19:19:42 -08:00
snipe
17bc562ac4 Commented out broken permissions and importer tests for now
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 19:19:35 -08:00
snipe
1e46fde5e2 Fixed status labels tests
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 19:01:57 -08:00
snipe
872bd29cb3 Removed repetitive tests
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 18:27:52 -08:00
snipe
21e2504f79 Trying unsuccessfully to get nested factories working
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 17:38:28 -08:00
snipe
3a1e2a56d6 Use the proper ID for status ID factory
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 17:38:06 -08:00
snipe
5a01fff79c Use the Setting model for basetest
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 17:37:51 -08:00
snipe
390e8a6cc3 Fixed company unit test
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 16:43:03 -08:00
snipe
b0d2fc787a Fixed accessory test
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 16:33:16 -08:00
snipe
35ba28bff9 Continuing to refactor tests
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 16:14:45 -08:00
snipe
c2709be4a1 Removed pointless tests
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 16:14:23 -08:00
snipe
00d2235610 Lowercase tests in composer.json per previous revert
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 15:12:47 -08:00
snipe
21575cf674 Lowercase tests dir
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 15:09:52 -08:00
snipe
c949a1f5f2 renamed Tests to tests 2021-12-02 15:08:26 -08:00
snipe
9536f836f0 Beginning of CompanyTest fixes (not done yet)
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 15:02:46 -08:00
snipe
064e0b7a1c Removed dd for debugging
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 15:02:25 -08:00
snipe
37033fb2f7 Removed some defaul values to handle validation
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 15:02:11 -08:00
snipe
77d6649e38 One more case change because I have NOTHING else to do
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 14:26:31 -08:00
snipe
f61f386f31 Fixed again because I suck
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 14:07:48 -08:00
snipe
d20a0f7c6d Update composer autoload for test case case
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 14:05:35 -08:00
snipe
406aed6b07 Case sensitive dir stuff
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 14:03:32 -08:00
snipe
5555553307 renamed again for git to accept case 2021-12-02 14:02:16 -08:00
snipe
00b63fe7c7 Fixed category factory methods
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 13:40:16 -08:00
snipe
cae62fd4c7 Merge pull request #9902 from SidingsMedia/sum_cost_by_quantity
Fixed #5676: Sum cost by quantity
2021-12-02 12:13:04 -08:00
snipe
44b6907919 Updated phpunit.xml
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 11:44:32 -08:00
snipe
406211d2fe Move mockery to require-dev
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 11:22:46 -08:00
snipe
fb06c136b9 Added mockery (because reasons?)
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 11:11:14 -08:00
snipe
957d092844 Upgraded phpunit to v9
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 11:04:04 -08:00
snipe
ed2797afdd Small fixes
Signed-off-by: snipe <snipe@snipe.net>
2021-12-01 23:33:20 -08:00
snipe
ad6d70b86f Removed unused Str
Signed-off-by: snipe <snipe@snipe.net>
2021-12-01 23:30:48 -08:00
snipe
17bd6d71e7 Fixed location unit test
Signed-off-by: snipe <snipe@snipe.net>
2021-12-01 22:45:39 -08:00
snipe
d96e95abd6 Small mods to configs, removed old faker, added new
Signed-off-by: snipe <snipe@snipe.net>
2021-12-01 13:46:21 -08:00
snipe
bc355e1f26 Remve unused use Hash statements
Signed-off-by: snipe <snipe@snipe.net>
2021-11-30 20:47:02 -08:00
snipe
d8234d5a0b Trying to unfuck the TestCase
A lot has changed between versions

Signed-off-by: snipe <snipe@snipe.net>
2021-11-30 20:46:44 -08:00
snipe
f3f6a04c43 Use hash::
Signed-off-by: snipe <snipe@snipe.net>
2021-11-30 20:46:20 -08:00
snipe
fe2cd8b708 Switched back to sqlite for unit
Signed-off-by: snipe <snipe@snipe.net>
2021-11-30 20:45:54 -08:00
snipe
e73373a75a Removed empty tests
Signed-off-by: snipe <snipe@snipe.net>
2021-11-30 20:45:42 -08:00
snipe
d08c1787a1 First steps at getting dusk working
Signed-off-by: snipe <snipe@snipe.net>
2021-11-30 20:09:29 -08:00
Nuraeil
d3972888dc Merge pull request #6 from snipe/develop
Develop
2021-11-30 06:37:17 +01:00
snipe
4c2d47e7c6 Merge pull request #10354 from inietov/fixes/customfields_with_date_format_doesnt_display_default_value
Fixes Default Values - Date not applying
2021-11-24 19:41:51 -08:00
snipe
29bbfad693 Applied escaping fix from master to develop
Signed-off-by: snipe <snipe@snipe.net>
2021-11-24 19:38:27 -08:00
Ivan Nieto Vivanco
741eb28622 Add the call to defaultValue() function in custom fields with date format 2021-11-23 17:11:21 -06:00
snipe
ef8f646ab2 Merge pull request #10349 from snipe/chore/sc-17719/add-sodium-as-a-requirement-in-upgrade-php
Update upgrade.php with newer requires
2021-11-22 15:32:51 -08:00
snipe
686e58806f Update upgrade.php with newer requires
Signed-off-by: snipe <snipe@snipe.net>
2021-11-22 15:31:23 -08:00
Matthew Nickson
9381ba2404 Merge branch 'develop' into sum_cost_by_quantity 2021-11-21 18:59:34 +00:00
Brady Wetherington
e8f5dc85a6 Downgraded a FIXME to a TODO 2021-11-19 16:38:46 -08:00
Wächtler, Yannick
1b76185798 Added TODO: comments to pages, where there are non-localized strings, in order to keep track of them 2021-11-19 15:32:13 +01:00
Wächtler, Yannick
9164daf5bc Added localized strings for admin/settings 2021-11-19 15:23:48 +01:00
Wächtler, Yannick
6917d59185 Added localized strings for reports 2021-11-19 12:39:19 +01:00
Wächtler, Yannick
04fec144a0 Added localization strings for partials, added file structure 2021-11-19 12:12:11 +01:00
Nuraeil
6eb120d101 Merge pull request #5 from snipe/develop
Develop
2021-11-19 11:51:16 +01:00
snipe
df0b240a05 Merge pull request #10288 from uberbrady/composer_install_under_phpv8
[sc-17645] Composer install under phpv8
2021-11-18 15:28:54 -08:00
snipe
3e83b2ff2f Merge pull request #10334 from snipe/feature/sc-17704/make-all-currency-values-right-aligned
Added text-right to presenters for money values
2021-11-18 15:10:19 -08:00
snipe
c49c5f4164 Added text-right to presenters for money values
Signed-off-by: snipe <snipe@snipe.net>
2021-11-18 15:09:17 -08:00
snipe
6d545ff11b Merge pull request #10333 from snipe/bug/sc-17711/v6-bug-500-server-error-when-trying-to-checkin
Fixed v6 bug 500 server error when trying to checkin
2021-11-18 14:38:17 -08:00
snipe
250f6b6fb8 Fixed v6 bug 500 server error when trying to checkin [sc-17711]
Signed-off-by: snipe <snipe@snipe.net>
2021-11-18 14:37:12 -08:00
Nuraeil
7084703b5a Merge pull request #4 from snipe/develop
Merge current develop into branch
2021-11-18 21:30:45 +01:00
snipe
f6d5d6cc09 Merge pull request #10316 from snipe/bug/sc-17684/v6-bug-error-when-editing-model-with-no-custom
v6 bug - Error when editing model with no custom
2021-11-17 18:38:48 -08:00
Wächtler, Yannick
5a2f8788a9 Fixed merge issue in view.blade.php and added translatable string 2021-11-16 19:34:20 +01:00
Wächtler, Yannick
f2c3e51a83 Catching up to snipe-it/develop branch 2021-11-16 19:25:23 +01:00
Wächtler, Yannick
74ed790d20 Merge branch 'snipe-develop' into added-localized-strings 2021-11-16 08:51:06 +01:00
Wächtler, Yannick
6feb39f6b9 Merge branch 'develop' of https://github.com/snipe/snipe-it into snipe-develop 2021-11-16 08:50:45 +01:00
snipe
bbb0d1be17 Possible fix for asset model editing when no custom fieldset is associated
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 21:09:35 -08:00
snipe
476e17055b Escape custom fields in API response
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 20:31:01 -08:00
snipe
db45de5da2 Fixed old style user routes
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 20:26:07 -08:00
snipe
207c785b1d Added missing use statements for Laravel 8 routes
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 20:20:10 -08:00
snipe
8a747be3a0 Fixed routes for newer format (l8)
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 20:16:40 -08:00
snipe
65d1855b38 Display app_locked message on front-end
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 19:50:55 -08:00
snipe
46d2f8a81d Disallow file upload to backups on demo
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 19:42:02 -08:00
snipe
92b7aaf44b Log the user out upon successful restore
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 19:40:01 -08:00
snipe
8bf11e9417 Bummped hash fpr v6-pre-alpha
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 19:31:20 -08:00
snipe
174d23a42a Updated assets
Signed-off-by: snipe <snipe@snipe.net>
2021-11-15 19:29:57 -08:00
snipe
f2f8f96991 Merge remote-tracking branch 'origin/master' into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Transformers/AssetsTransformer.php
#	app/Importer/ConsumableImporter.php
#	app/Models/Consumable.php
#	config/version.php
#	package-lock.json
#	package.json
#	public/css/dist/all.css
#	public/css/dist/bootstrap-table.css
#	public/js/build/app.js
#	public/js/dist/all.js
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
#	resources/views/custom_fields/fieldsets/view.blade.php
#	resources/views/layouts/default.blade.php
#	routes/web.php
#	routes/web/fields.php
2021-11-15 19:24:38 -08:00
snipe
ce69e54202 Merge pull request #10297 from snipe/features/backup_importer_ui
v6 Feature - Added backup restore from GUI
2021-11-15 19:09:37 -08:00
snipe
cc5b8f3d6d Merge pull request #10302 from SBrown2021/patch-1
Typo in upgrade.php
2021-11-11 10:32:42 -08:00
SBrown2021
c668cc3103 Typo in upgrade.php
Fixed typo on line 181. bootsrap/cache/services.php -> bootstrap/cache/services.php
2021-11-11 17:05:24 +00:00
snipe
bc21875324 More refinements to the UI
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 18:15:38 -08:00
snipe
1a703bf78b Added logout clarification
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 17:59:52 -08:00
snipe
494c72d92b Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 17:58:04 -08:00
snipe
69fe3c0299 Added some comments on the JS
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 17:57:15 -08:00
snipe
0c58fa1b1e Merge branch 'features/backup_importer_ui' of https://github.com/snipe/snipe-it into features/backup_importer_ui 2021-11-10 17:49:04 -08:00
snipe
e2702186a9 Slightly reworked UI
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 17:48:59 -08:00
snipe
595c3bfd57 Merge pull request #10298 from uberbrady/features/backup_importer_ui
Cleaned up the output and added some better checks for errors
2021-11-10 17:21:23 -08:00
Brady Wetherington
c2b5f9b372 Cleaned up the output and added some better checks for errors 2021-11-10 17:08:04 -08:00
snipe
b069eec43a Fixed upload disabled button
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 16:01:22 -08:00
snipe
040bdd2f32 Merge branch 'features/backup_importer_ui' of https://github.com/snipe/snipe-it into features/backup_importer_ui 2021-11-10 13:01:05 -08:00
snipe
f8cf65bbb3 Small layout fixes
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 13:01:02 -08:00
snipe
c1a844cce6 Merge pull request #10296 from uberbrady/features/backup_importer_ui
Tweak Restore command to _also_ run via webserver via Artisan::call()
2021-11-10 13:00:40 -08:00
Brady Wetherington
2b6614e2dd Tweak Restore command to _also_ run via webserver via Artisan::call() 2021-11-10 12:44:19 -08:00
Brady Wetherington
864cc4f8d5 Fix FIXME's by downgrading them to TODO's :) 2021-11-10 11:37:10 -08:00
snipe
ec2a3b0f35 Updated label names
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 01:44:34 -08:00
snipe
230a568145 Added help text and more info in the modal
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 01:44:11 -08:00
snipe
457c6080cc Better handling if there was no file uploaded
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 01:43:45 -08:00
snipe
856b9294f8 Improved BS tables on backups
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 00:08:43 -08:00
snipe
8590e5d67e UNRELATED: fixed wrong html tag for license view badge count
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 00:08:15 -08:00
snipe
cf070866f0 INCOMPLETE: Added more generic language strings
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 00:07:47 -08:00
snipe
76685d7fd3 Clearer text in restore artisan command
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 00:07:32 -08:00
snipe
96f76e1f6b INCOMPLETE: Added restore and upload methods for backups
Signed-off-by: snipe <snipe@snipe.net>
2021-11-10 00:07:17 -08:00
snipe
05c6254fdc Updated snipeit.js with "restore" modal code
Signed-off-by: snipe <snipe@snipe.net>
2021-11-09 22:39:33 -08:00
snipe
3b25093aeb Removed noisy debugging
Signed-off-by: snipe <snipe@snipe.net>
2021-11-09 22:38:27 -08:00
snipe
76506dabbf Made helpers call full namespace (tho I have no idea why this was necessary)
Signed-off-by: snipe <snipe@snipe.net>
2021-11-09 22:38:14 -08:00
snipe
1b1b54fbf4 Add modified_value and modified_display so we can use the formatted date but still sort correctly
Signed-off-by: snipe <snipe@snipe.net>
2021-11-09 22:37:49 -08:00
snipe
542ab75d89 Added new backup routes
Signed-off-by: snipe <snipe@snipe.net>
2021-11-09 19:39:50 -08:00
snipe
0e21a95817 Escape error message in asset autdit apI (same as in v5)
Signed-off-by: snipe <snipe@snipe.net>
2021-11-09 19:39:32 -08:00
snipe
fb21712a68 Added restore modal HTML
Signed-off-by: snipe <snipe@snipe.net>
2021-11-09 19:38:40 -08:00
Brady Wetherington
91f087258b Merge branch 'develop' into remove_old_ldap 2021-11-09 18:33:41 -08:00
Brady Wetherington
25d72d2978 Make composer install work on 7.4 as well as 8.0 2021-11-09 13:06:24 -08:00
Brady Wetherington
ec030e9e1f Tweak some version requirements to make composer install run under phpv8 2021-11-08 21:19:23 -08:00
Brady Wetherington
a58c5ce27f Better documentation, disable AdLdap2-based "Add domain" setting 2021-11-08 17:11:47 -08:00
Wächtler, Yannick
6b2801867d Renamed account/api to account/general to match naming schema, changed the associated account/api trans() to account/general 2021-11-04 20:15:23 +01:00
Wächtler, Yannick
97030866e4 Adding newly added template files 2021-11-04 20:12:47 +01:00
Nuraeil
3f2749d5d6 Merge pull request #2 from snipe/develop
Develop
2021-11-04 19:16:00 +01:00
Brady Wetherington
b0417e5bd7 Finish pulling out the AdLdap2-based LDAP remnants that were still in the system 2021-11-03 15:22:06 -07:00
snipe
98de8526db Merge pull request #10258 from PlaneNuts/Fix_Advanced_Search/Checked_Out_To
Fixed #8828: Can't search by checked out user in advanced search
2021-11-02 14:53:08 -07:00
Wächtler, Yannick
63b30489df Added localized strings for notifications 2021-11-02 15:44:57 +01:00
Wächtler, Yannick
670b70c7e1 Added localized strings for models 2021-11-02 15:34:50 +01:00
Wächtler, Yannick
c0891e6827 Added localized strings for modals 2021-11-02 15:27:13 +01:00
Wächtler, Yannick
30d30490a3 Added localized strings for locations 2021-11-02 15:14:54 +01:00
Wächtler, Yannick
4af6412da6 Added localized strings for licenses 2021-11-02 14:55:49 +01:00
Wächtler, Yannick
4fcd4a930f Added localized strings for layouts 2021-11-02 14:45:58 +01:00
Wächtler, Yannick
8bad9c5140 Added localized strings for kits 2021-11-02 14:25:21 +01:00
Wächtler, Yannick
26e056fb3c Added localized strings for improter, added en structure 2021-11-02 14:09:22 +01:00
Wächtler, Yannick
c16ade2d87 Added localized strings for hardware 2021-11-02 14:02:48 +01:00
Wächtler, Yannick
167bf97d46 Added localized strings for groups 2021-11-02 12:03:41 +01:00
Wächtler, Yannick
e825fa81aa Added localized strings for depreciations 2021-11-02 11:50:56 +01:00
Wächtler, Yannick
a96c53784c Added localized strings for custom_fields 2021-11-02 11:27:53 +01:00
Wächtler, Yannick
c11af0e222 Added missing localized strings for account/accept/index.blade.php and view-assets.blade.php 2021-11-02 10:40:41 +01:00
Wächtler, Yannick
433d6fd3e0 Added localized strings for admin/companies 2021-11-02 10:23:15 +01:00
Wächtler, Yannick
b784e63aa8 Added localized strings for account 2021-11-02 10:13:22 +01:00
Terrell Eaton
2c7a71a2a1 Fixes not being able to search by checked out user in advanced search 2021-11-01 22:14:19 +01:00
Godfrey M
1683b04244 changed min_amt_help message 2021-11-01 11:05:44 -07:00
Matthew Nickson
90ca66834b Fixed sumFormatterQuantity if using 1.234,56 fomat
Previously sumFormatterQuantity used the parseFloat to convert the
string purchase_cost to a floating point number. parseFloat does not
return the correct value when using the comma format. To fix this
sumFormatterQuantity now used the cleanFloat function to convert
purchase_cost to a float.

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
2021-10-30 22:48:45 +01:00
snipe
eae9bf574f Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-10-29 14:11:58 -07:00
snipe
409600f29d Added S3 commented out settings in env example for clarity
Signed-off-by: snipe <snipe@snipe.net>
2021-10-29 14:11:54 -07:00
Brady Wetherington
4dda28de9e WIP: cleaning up LDAP 2021-10-28 18:19:50 -07:00
snipe
e932cdf106 Merge pull request #9799 from Toreg87/fixes/fmcs_departments
Fixed #9798: Scope departments for FullMultipleCompanySupport
2021-10-28 18:18:16 -07:00
Brady Wetherington
31933a56fa Trying to get the login screen working 2021-10-28 18:18:11 -07:00
snipe
ea0d92c439 Merge branch 'develop' into fixes/fmcs_departments 2021-10-28 18:18:08 -07:00
snipe
5458e44a40 Merge pull request #9508 from sh1hab/feature/remove_deleted_user_from_unaccepted_assets_report
Feature #9378 remove deleted user from unaccepted assets report
2021-10-28 18:11:19 -07:00
snipe
d36849bd41 Merge branch 'develop' into feature/remove_deleted_user_from_unaccepted_assets_report 2021-10-28 18:11:03 -07:00
snipe
84a3a85823 Fixed parse error for merge conflict
Signed-off-by: snipe <snipe@snipe.net>
2021-10-28 18:04:03 -07:00
snipe
798f6d65de Merge pull request #9847 from inietov/bug/ch15357/requested_assets_allow_to_cancel_if_checkedout_to_self
Adds a check to know if the asset is checked out to the logged in user to allow check the state in the view
2021-10-28 17:53:24 -07:00
snipe
d54434fdf7 Merge pull request #9541 from misilot/change-var-aws-public-url
Change from ENV to config value for PUBLIC_AWS_URL
2021-10-28 17:46:25 -07:00
snipe
bdf321ecc9 Merge branch 'develop' into change-var-aws-public-url 2021-10-28 17:46:16 -07:00
snipe
3ede7c7f18 Use icon and string for maintained value in license view
Signed-off-by: snipe <snipe@snipe.net>
2021-10-28 17:26:03 -07:00
snipe
2d782cd31f Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-10-28 17:20:27 -07:00
snipe
645529ba78 Merge pull request #9889 from ncareau/api-licenses
Add licenses api parameters and fix a missing variable in license view.
2021-10-28 17:20:09 -07:00
snipe
636dc6877b Merge pull request #10113 from Godmartinz/bug/sc-17129/v6-integration-pie-chart-disappears-if-you
Fixed #sc17129 - Pie chart disappears when window resizes
2021-10-28 17:14:14 -07:00
snipe
3951de1669 Merge branch 'develop' into bug/sc-17129/v6-integration-pie-chart-disappears-if-you 2021-10-28 17:13:37 -07:00
snipe
3088230236 Merge pull request #10209 from Godmartinz/feature/sc-1474/sync-parent-asset-location-with-children-assets
Fixes Bug: When parent asset is assigned to other location, children assets loca…
2021-10-28 16:49:44 -07:00
snipe
984bc501a5 Merge pull request #9906 from Toreg87/fixes/advanced_search_serial_v2
Fixed #9904: Advanced search with serial and another field produce incorrect results (v2)
2021-10-28 16:42:32 -07:00
snipe
371a39a118 Merge branch 'develop' into fixes/advanced_search_serial_v2 2021-10-28 16:42:10 -07:00
snipe
d3d199efc3 Add @PlaneNuts as a contributor 2021-10-28 16:39:28 -07:00
snipe
7821d38e60 Merge pull request #10238 from inietov/fixes/asset_components_must_return_relationship_instance
Fixes asset components must return relationship instance
2021-10-28 16:38:21 -07:00
snipe
1895dd326f Merge pull request #10245 from Sxderp/pr-support-appache-rewrite-redirect-headers-for-remote-user
support apache REDIRECT_* for remote user login
2021-10-28 16:34:57 -07:00
snipe
1975afaca6 Merge pull request #10248 from snipe/features/add_requestable_to_bulk_model_edit
Adds reqestable as model bulk edit field
2021-10-28 16:30:55 -07:00
snipe
52ef9280ba Adds reqestable as model bulk edit field
Signed-off-by: snipe <snipe@snipe.net>
2021-10-28 15:15:54 -07:00
snipe
30cfc34ecf Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-10-28 14:42:58 -07:00
snipe
668e8a357c Fixed labels in profile form
Signed-off-by: snipe <snipe@snipe.net>
2021-10-28 12:57:27 -07:00
Steven Daniele
efc644c960 support apache REDIRECT_* for remote user login 2021-10-28 14:23:38 -04:00
Godfrey M
b0da936c5c changed get to receive in the message 2021-10-27 16:41:38 -07:00
Godfrey M
8719667c44 adds info on how to nullify reorder alerts for consumables, components and accessories 2021-10-27 16:36:04 -07:00
Ivan Nieto Vivanco
ee9133f722 Return the proper Asset-Components relationship 2021-10-27 16:42:51 -05:00
snipe
8cfa8d97b4 Merge pull request #10215 from inietov/fixes/bulk_edit_counts_more_users_selected
Fixes bulk edit message counts more users than the actual selected users number
2021-10-21 13:02:03 -07:00
Ivan Nieto Vivanco
9eaf89aaa7 Add a variable to better control the selected user's ids 2021-10-21 13:28:58 -05:00
snipe
31d49b5c9b Fixed merge error parse error
Signed-off-by: snipe <snipe@snipe.net>
2021-10-20 18:11:34 -07:00
snipe
6e0f8068b2 Fixed duplicate use statement from merge fuckery
Signed-off-by: snipe <snipe@snipe.net>
2021-10-20 17:54:32 -07:00
snipe
9ee13f0d2a Fixed dupe use statement from merge fuckery
Signed-off-by: snipe <snipe@snipe.net>
2021-10-20 17:53:43 -07:00
snipe
ae1a4bb3c9 Fixed extra braces from merge fuckery
Signed-off-by: snipe <snipe@snipe.net>
2021-10-20 17:36:06 -07:00
snipe
aa8f1378c9 Merge remote-tracking branch 'origin/master' into develop
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	README.md
#	app/Http/Controllers/Accessories/AccessoriesController.php
#	app/Http/Controllers/Api/AssetMaintenancesController.php
#	app/Http/Controllers/Api/AssetModelsController.php
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Api/UsersController.php
#	app/Http/Controllers/AssetMaintenancesController.php
#	app/Http/Controllers/Assets/AssetFilesController.php
#	app/Http/Controllers/Assets/AssetsController.php
#	app/Http/Controllers/Assets/BulkAssetsController.php
#	app/Http/Controllers/Components/ComponentsController.php
#	app/Http/Controllers/Consumables/ConsumablesController.php
#	app/Http/Controllers/Licenses/LicenseFilesController.php
#	app/Http/Controllers/Licenses/LicensesController.php
#	app/Http/Controllers/Users/UserFilesController.php
#	app/Http/Transformers/AssetsTransformer.php
#	app/Http/Transformers/LicensesTransformer.php
#	app/Importer/UserImporter.php
#	app/Models/Asset.php
#	config/app.php
#	config/version.php
#	package-lock.json
#	public/js/build/app.js
#	public/js/dist/all.js
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
#	resources/lang/en/admin/users/message.php
#	resources/lang/is/button.php
#	resources/lang/ja/admin/kits/general.php
#	resources/lang/ro/admin/users/general.php
#	resources/lang/zh-HK/admin/depreciations/general.php
#	resources/lang/zh-HK/admin/models/general.php
#	resources/views/hardware/qr-view.blade.php
#	resources/views/hardware/view.blade.php
#	resources/views/partials/bootstrap-table.blade.php
#	resources/views/users/view.blade.php
#	routes/web.php
#	routes/web/hardware.php
#	routes/web/models.php
#	routes/web/users.php
2021-10-20 17:26:41 -07:00
Godfrey M
9ae7d0b23a when parent asset is assigned to other location, children assets location are updated as well. 2021-10-20 17:01:25 -07:00
snipe
365349fd91 Center custom fields email icon
Signed-off-by: snipe <snipe@snipe.net>
2021-10-18 18:39:46 -07:00
snipe
4095a3f8c4 Removed dupe bars
Signed-off-by: snipe <snipe@snipe.net>
2021-10-12 12:31:08 -07:00
snipe
94c4265524 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2021-10-12 12:30:39 -07:00
snipe
4a98519c1f Compiled assets
Signed-off-by: snipe <snipe@snipe.net>
2021-10-12 12:30:25 -07:00
snipe
d126b265ee Merge pull request #10192 from snipe/bug/sc-17471/font-awesome-hamburger-menu-is-showing-as
Fixed misisng hamburger menu
2021-10-12 12:10:53 -07:00
snipe
892fc0004a Fixed misisng hamburger menu
Signed-off-by: snipe <snipe@snipe.net>
2021-10-12 12:09:46 -07:00
snipe
2cbbf7efe2 Merge pull request #10186 from tanji/patch-2
Exclude web.config from Apache
2021-10-11 10:03:37 -07:00
Guillaume Lefranc
494ed3d17a Exclude web.config from Apache 2021-10-11 14:14:00 +02:00
Matthew Nickson
8996c24d1f Merge branch 'develop' into sum_cost_by_quantity 2021-10-10 13:01:44 +01:00
snipe
1f5c38ad7e Merge pull request #10179 from inietov/features/allow_same_category_name_for_different_types
Fixes #9365 #9800 Added a validation to use the same name in categories with different types [sc-17487]
2021-10-08 14:10:29 -07:00
Ivan Nieto Vivanco
23b770fac6 Added a validation to use the same name in categories with different types 2021-10-08 15:19:16 -05:00
snipe
5f52ee59b2 Merge pull request #9529 from dampfklon/Feature_#9514_Asset_Acceptance,_resend_mail/_send_remainder
Feature #9514, Feature #9378 Unaccepted Assets Report Actions, Fixed [ch16410]
2021-10-07 12:49:42 -07:00
Dampfklon
ab4a234e20 fix rebase errors 2021-10-07 21:32:57 +02:00
Dampfklon
7645f23f5c remove pending Acceptances on checkin 2021-10-07 21:03:46 +02:00
Dampfklon
4418ad2340 Enable display of deleted acceptances, strike deleted users, add date, enable sorting 2021-10-07 21:03:46 +02:00
Dampfklon
12ee06deb6 add Download All Button, change route analogue to activity report 2021-10-07 21:01:50 +02:00
Dampfklon
9a9ca59544 Fix decprecated implode usage 2021-10-07 20:55:47 +02:00
Dampfklon
ed99532c30 Unaccepted Assets Report Actions (send reminder, delete) added
Unaccepted Assets Export fixed
2021-10-07 20:53:02 +02:00
snipe
3980c80c70 Merge pull request #10166 from uberbrady/fix_default_values_for_custom_fields_for_models_rebased
Fix default values for custom fields for models rebased
2021-10-04 22:27:45 -07:00
Brady Wetherington
bbeedc026d A lot of cleanups to the Livewire stuff, and got it kinda-sorta basically working. 2021-10-04 22:07:29 -07:00
Brady Wetherington
d80604f2ac Most of the basics are working, but not done and lots of debug messages are about
I picked up the change that picked a point-release difference on the AWS library since that usually
works out for us (x.y.1 vs. x.y.2 - usually a good call)
2021-10-04 22:06:48 -07:00
snipe
1457fda508 Merge pull request #10159 from AL4AL/specify_docker_images_version
Fixed #10158 Specify docker images versions
2021-10-04 18:28:11 -07:00
Sajjad
f036e2b2a3 Specify docker images versions
Fix unquoted sentences
2021-10-03 11:12:53 +03:30
snipe
b919f5b1e9 Merge pull request #10150 from inietov/fixes/new_department_error_importing_users
Fixes New department error importing users.
2021-09-30 15:31:17 -07:00
Ivan Nieto Vivanco
11aa8971c8 Fix error if the Department is also empty 2021-09-30 17:20:44 -05:00
Ivan Nieto Vivanco
5c7aaaac22 Fix error when department is null 2021-09-30 16:46:23 -05:00
snipe
43a437000b Slightly better right-padding on row-new-striped
Signed-off-by: snipe <snipe@snipe.net>
2021-09-29 11:20:32 -07:00
snipe
228c8223a8 Merge pull request #10148 from uberbrady/snipe_it_v6_php_73
Try to generate a new composer lockfile under PHP 7.3
2021-09-29 10:57:56 -07:00
Brady Wetherington
3a73fa19f0 Try to generate a new composer lockfile under PHP 7.3 2021-09-29 10:53:44 -07:00
snipe
85b5f52cd8 Nicer mobile view for user view icons
Signed-off-by: snipe <snipe@snipe.net>
2021-09-28 23:04:30 -07:00
snipe
61f16f47a2 Use Helper alias
Signed-off-by: snipe <snipe@snipe.net>
2021-09-28 19:44:55 -07:00
snipe
9a83b90e44 Make row-new-striped 100% width
Signed-off-by: snipe <snipe@snipe.net>
2021-09-28 15:04:57 -07:00
snipe
9311f8694f Fixed incorrect icon for map marker
Signed-off-by: snipe <snipe@snipe.net>
2021-09-28 09:35:48 -07:00
NMC
c680977791 Merge branch 'develop' into api-licenses 2021-09-27 15:02:51 -04:00
snipe
c8ac19a5a0 Merge pull request #10135 from svpernova09/recreate-license-table-migration-issue
Rename license migration to resolve fatal error running migrations
2021-09-27 11:03:17 -07:00
Joe Ferguson
8c49f78218 Rename license migration to resolve fatal error running migrations during setup 2021-09-27 12:53:17 -05:00
snipe
2a6b59f0f8 Removed extra paramater from hasTable
Signed-off-by: snipe <snipe@snipe.net>
2021-09-27 09:48:03 -07:00
snipe
4c3f59c5fd Remove first migration for licenses
Signed-off-by: snipe <snipe@snipe.net>
2021-09-26 15:51:17 -07:00
snipe
6f96b25440 Attempt fix at Laravel "magic" class in migrations resulting in table already exists
Signed-off-by: snipe <snipe@snipe.net>
2021-09-26 15:48:43 -07:00
snipe
1657ba396f Added available license seat count to top tabs for licenses
Signed-off-by: snipe <snipe@snipe.net>
2021-09-26 15:03:56 -07:00
snipe
f0da1977fb Small visual improvements on consumables view
Signed-off-by: snipe <snipe@snipe.net>
2021-09-26 14:32:51 -07:00
snipe
d88c0ae5ec Merge pull request #10103 from snipe/fixes/make_boolean_fields_nullable
Fixed issue when creating a status label via API - default_label and show_in_nav being not nullable
2021-09-26 13:41:52 -07:00
snipe
450da5661d Add additional info on accessories view page
Signed-off-by: snipe <snipe@snipe.net>
2021-09-26 03:59:04 -07:00
snipe
a6632a7b9f Use new row striping on licenses detail page
Signed-off-by: snipe <snipe@snipe.net>
2021-09-26 03:58:53 -07:00
snipe
638e5a5bf6 Merge pull request #10132 from snipe/features/upgrade_the_rest_of_fa_icons
Upgraded FA icons to latest
2021-09-26 01:12:33 -07:00
snipe
7e41c74cc3 Updated more fa icons
Signed-off-by: snipe <snipe@snipe.net>
2021-09-26 01:11:08 -07:00
snipe
8738451685 Fixed font awesome caret
Signed-off-by: snipe <snipe@snipe.net>
2021-09-25 23:17:35 -07:00
snipe
65a6da5bd2 Added files tab back to assets
Signed-off-by: snipe <snipe@snipe.net>
2021-09-25 22:59:02 -07:00
snipe
a7b3f98e9f Updated angle icon with new font awesome
Signed-off-by: snipe <snipe@snipe.net>
2021-09-25 22:57:27 -07:00
snipe
8ee00d0f42 Changed paperflip to file icon
Signed-off-by: snipe <snipe@snipe.net>
2021-09-25 22:57:06 -07:00
snipe
667639b9fb Backed out the ribbon CSS for now
Signed-off-by: snipe <snipe@snipe.net>
2021-09-25 22:56:54 -07:00
snipe
749f364186 Removed gitter
Signed-off-by: snipe <snipe@snipe.net>
2021-09-25 22:56:32 -07:00
snipe
67d898e897 Updated map icons
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 14:30:36 -07:00
snipe
a9b306f2d2 Backing out the ribbon - too finicky on mobile :(
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 14:30:29 -07:00
snipe
e03d7b7016 More fa icon updates
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 13:07:02 -07:00
snipe
20e23c1248 Fixed 500 on wrong association
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 12:54:47 -07:00
snipe
5875cf1e9e Removed test code
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 12:33:34 -07:00
snipe
03e3c21d7e Merge pull request #10129 from snipe/features/improved_mobile_ux
Features/improved mobile ux
2021-09-24 12:30:56 -07:00
snipe
decc771459 Starting to refactor the hardware page
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 12:05:48 -07:00
snipe
78fa6452ee Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 12:05:18 -07:00
snipe
2c141813f1 Better formatting
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 11:51:52 -07:00
snipe
3317b5107a Added ribbon to show on user's photo that they are an admin
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 11:13:55 -07:00
snipe
0d1bd5b470 Updated more fa icons
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 11:13:34 -07:00
snipe
8d1c3106b5 Building assets again
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 11:13:15 -07:00
snipe
d480084c01 Merge pull request #10128 from inietov/fixes/route_not_defined_components_consumables
Fixes route not defined exception on components and consumables
2021-09-24 10:50:46 -07:00
Ivan Nieto Vivanco
efc9a8e2c9 Fixes route not defined exception on components and consumables 2021-09-24 11:38:07 -05:00
snipe
299ad681f7 More fa icons
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 07:21:30 -07:00
snipe
b2dc92b088 And a few more missed icons
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 06:44:38 -07:00
snipe
ad6f073c82 Few more icon updates
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 06:38:23 -07:00
snipe
8aba37522d More FA icons
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 06:18:22 -07:00
snipe
dbe93d91cd Updated fontawesome icons
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 06:07:46 -07:00
snipe
383c2c8466 New assets
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 04:12:55 -07:00
snipe
06e8e826bc Added some BS tables style overrides for mobile
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 04:12:41 -07:00
snipe
4a8f06b0f1 Added badge counters to tabs
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 04:12:22 -07:00
snipe
c69a883409 Fixed Groups route
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 04:12:07 -07:00
snipe
1574d24dde Fixed accessories route
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 04:11:58 -07:00
snipe
8937396a26 Added padding to the sidenav on mobile
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 03:02:57 -07:00
snipe
fd7c6179d5 Show the user's photo frst on mobile view
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 03:02:47 -07:00
snipe
9a299973ff Mobile CSS overrides
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 03:02:19 -07:00
snipe
7f41bdf0b0 Use new striping on hardware page
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 02:17:57 -07:00
snipe
90c22caa4b Rework user page to no longer use tables for data layout
This also fixes the weird display when lines break

Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 02:17:40 -07:00
snipe
12df310449 Updated assets
Signed-off-by: snipe <snipe@snipe.net>
2021-09-24 02:16:58 -07:00
snipe
7cbdf2c727 A few seeder fixes
Signed-off-by: snipe <snipe@snipe.net>
2021-09-23 22:16:19 -07:00
snipe
28a5838dfb Merge pull request #10125 from snipe/features/add_demo_user_images
Added userpics from thispersondoesnotexist.com
2021-09-23 22:08:39 -07:00
snipe
932c1364ee Added userpics from thispersondoesnotexist.com
Signed-off-by: snipe <snipe@snipe.net>
2021-09-23 22:05:42 -07:00
snipe
1ecd11dd2e More route fixes
Signed-off-by: snipe <snipe@snipe.net>
2021-09-23 21:46:17 -07:00
snipe
d82490f4a6 Updated package-lock
Signed-off-by: snipe <snipe@snipe.net>
2021-09-23 19:05:41 -07:00
snipe
71644696d1 Removed duplicate migration
Signed-off-by: snipe <snipe@snipe.net>
2021-09-22 17:21:48 -07:00
snipe
61cf9ec009 Small conflict handling bits
Signed-off-by: snipe <snipe@snipe.net>
2021-09-22 00:00:44 -07:00
snipe
e27065fe16 Merge branch 'develop-v6-integration' into develop-v6-rc1
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	.all-contributorsrc
#	README.md
#	app/Console/Commands/ResetDemoSettings.php
#	app/Helpers/Helper.php
#	app/Http/Controllers/Api/AccessoriesController.php
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Api/CategoriesController.php
#	app/Http/Controllers/Api/ComponentsController.php
#	app/Http/Controllers/Api/ConsumablesController.php
#	app/Http/Controllers/Api/LocationsController.php
#	app/Http/Controllers/Api/StatuslabelsController.php
#	app/Http/Controllers/Api/SuppliersController.php
#	app/Http/Controllers/AssetMaintenancesController.php
#	app/Http/Controllers/Auth/ForgotPasswordController.php
#	app/Http/Controllers/DepreciationsController.php
#	app/Http/Controllers/ReportsController.php
#	app/Http/Controllers/SettingsController.php
#	app/Http/Requests/ImageUploadRequest.php
#	app/Http/Transformers/ActionlogsTransformer.php
#	app/Http/Transformers/DepreciationsTransformer.php
#	app/Listeners/CheckoutableListener.php
#	app/Models/Accessory.php
#	app/Models/Asset.php
#	app/Models/Company.php
#	app/Models/Ldap.php
#	app/Models/User.php
#	app/Presenters/AssetPresenter.php
#	app/Presenters/CategoryPresenter.php
#	composer.json
#	composer.lock
#	config/version.php
#	database/factories/AssetModelFactory.php
#	database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php
#	database/seeds/AssetModelSeeder.php
#	package-lock.json
#	public/css/build/AdminLTE.css
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/css/dist/bootstrap-table.css
#	public/css/dist/skins/skin-black-dark.css
#	public/css/dist/skins/skin-black-dark.min.css
#	public/css/dist/skins/skin-black.css
#	public/css/dist/skins/skin-black.min.css
#	public/css/dist/skins/skin-blue-dark.css
#	public/css/dist/skins/skin-blue-dark.min.css
#	public/css/dist/skins/skin-blue.css
#	public/css/dist/skins/skin-blue.min.css
#	public/css/dist/skins/skin-contrast.css
#	public/css/dist/skins/skin-contrast.min.css
#	public/css/dist/skins/skin-green-dark.css
#	public/css/dist/skins/skin-green-dark.min.css
#	public/css/dist/skins/skin-green.css
#	public/css/dist/skins/skin-green.min.css
#	public/css/dist/skins/skin-orange-dark.css
#	public/css/dist/skins/skin-orange-dark.min.css
#	public/css/dist/skins/skin-orange.css
#	public/css/dist/skins/skin-orange.min.css
#	public/css/dist/skins/skin-purple-dark.css
#	public/css/dist/skins/skin-purple-dark.min.css
#	public/css/dist/skins/skin-purple.css
#	public/css/dist/skins/skin-purple.min.css
#	public/css/dist/skins/skin-red-dark.css
#	public/css/dist/skins/skin-red-dark.min.css
#	public/css/dist/skins/skin-red.css
#	public/css/dist/skins/skin-red.min.css
#	public/css/dist/skins/skin-yellow-dark.css
#	public/css/dist/skins/skin-yellow-dark.min.css
#	public/css/dist/skins/skin-yellow.css
#	public/css/dist/skins/skin-yellow.min.css
#	public/js/build/app.js
#	public/js/build/vendor.js
#	public/js/dist/all.js
#	public/js/dist/bootstrap-table.js
#	public/mix-manifest.json
#	resources/assets/js/vue.js
#	resources/lang/af/validation.php
#	resources/lang/ar/admin/settings/general.php
#	resources/lang/ar/validation.php
#	resources/lang/bg/admin/settings/general.php
#	resources/lang/bg/validation.php
#	resources/lang/cs/admin/settings/general.php
#	resources/lang/cs/validation.php
#	resources/lang/cy/help.php
#	resources/lang/cy/validation.php
#	resources/lang/da/admin/settings/general.php
#	resources/lang/da/validation.php
#	resources/lang/de/admin/settings/general.php
#	resources/lang/de/validation.php
#	resources/lang/el/validation.php
#	resources/lang/en-GB/admin/settings/general.php
#	resources/lang/en-GB/validation.php
#	resources/lang/en-ID/admin/hardware/table.php
#	resources/lang/en-ID/admin/settings/general.php
#	resources/lang/en-ID/validation.php
#	resources/lang/es-CO/admin/settings/general.php
#	resources/lang/es-CO/auth/message.php
#	resources/lang/es-CO/button.php
#	resources/lang/es-CO/help.php
#	resources/lang/es-CO/validation.php
#	resources/lang/es-ES/admin/settings/general.php
#	resources/lang/es-ES/auth/message.php
#	resources/lang/es-ES/button.php
#	resources/lang/es-ES/help.php
#	resources/lang/es-ES/validation.php
#	resources/lang/es-MX/admin/settings/general.php
#	resources/lang/es-MX/validation.php
#	resources/lang/es-VE/admin/settings/general.php
#	resources/lang/es-VE/auth/message.php
#	resources/lang/es-VE/button.php
#	resources/lang/es-VE/help.php
#	resources/lang/es-VE/validation.php
#	resources/lang/et/validation.php
#	resources/lang/fa/validation.php
#	resources/lang/fi/admin/settings/general.php
#	resources/lang/fi/validation.php
#	resources/lang/fil/validation.php
#	resources/lang/fr/admin/settings/general.php
#	resources/lang/fr/validation.php
#	resources/lang/ga-IE/validation.php
#	resources/lang/he/admin/settings/general.php
#	resources/lang/he/general.php
#	resources/lang/he/validation.php
#	resources/lang/hr/validation.php
#	resources/lang/hu/validation.php
#	resources/lang/id/validation.php
#	resources/lang/is/admin/categories/general.php
#	resources/lang/is/admin/companies/message.php
#	resources/lang/is/admin/companies/table.php
#	resources/lang/is/admin/components/general.php
#	resources/lang/is/admin/components/table.php
#	resources/lang/is/admin/consumables/table.php
#	resources/lang/is/admin/depreciations/general.php
#	resources/lang/is/admin/depreciations/message.php
#	resources/lang/is/admin/hardware/form.php
#	resources/lang/is/admin/hardware/general.php
#	resources/lang/is/admin/hardware/message.php
#	resources/lang/is/admin/hardware/table.php
#	resources/lang/is/admin/kits/general.php
#	resources/lang/is/admin/licenses/form.php
#	resources/lang/is/admin/licenses/general.php
#	resources/lang/is/admin/locations/table.php
#	resources/lang/is/admin/manufacturers/table.php
#	resources/lang/is/admin/reports/message.php
#	resources/lang/is/admin/settings/general.php
#	resources/lang/is/admin/settings/message.php
#	resources/lang/is/admin/statuslabels/message.php
#	resources/lang/is/admin/suppliers/message.php
#	resources/lang/is/admin/suppliers/table.php
#	resources/lang/is/admin/users/table.php
#	resources/lang/is/mail.php
#	resources/lang/is/validation.php
#	resources/lang/it/admin/settings/general.php
#	resources/lang/it/validation.php
#	resources/lang/iu/validation.php
#	resources/lang/ja/mail.php
#	resources/lang/ja/validation.php
#	resources/lang/ko/validation.php
#	resources/lang/lt/validation.php
#	resources/lang/lv/validation.php
#	resources/lang/mi/validation.php
#	resources/lang/mk/validation.php
#	resources/lang/ml-IN/validation.php
#	resources/lang/mn/validation.php
#	resources/lang/ms/validation.php
#	resources/lang/nl/admin/settings/general.php
#	resources/lang/nl/validation.php
#	resources/lang/no/validation.php
#	resources/lang/pl/admin/settings/general.php
#	resources/lang/pl/validation.php
#	resources/lang/pt-BR/admin/settings/general.php
#	resources/lang/pt-BR/mail.php
#	resources/lang/pt-BR/validation.php
#	resources/lang/pt-PT/validation.php
#	resources/lang/ro/validation.php
#	resources/lang/ru/validation.php
#	resources/lang/sl/validation.php
#	resources/lang/sr-CS/admin/settings/general.php
#	resources/lang/sr-CS/validation.php
#	resources/lang/sv-SE/admin/settings/general.php
#	resources/lang/sv-SE/auth/message.php
#	resources/lang/sv-SE/button.php
#	resources/lang/sv-SE/mail.php
#	resources/lang/sv-SE/validation.php
#	resources/lang/ta/validation.php
#	resources/lang/th/validation.php
#	resources/lang/tl/validation.php
#	resources/lang/tr/mail.php
#	resources/lang/tr/validation.php
#	resources/lang/uk/admin/accessories/table.php
#	resources/lang/uk/admin/asset_maintenances/message.php
#	resources/lang/uk/admin/asset_maintenances/table.php
#	resources/lang/uk/validation.php
#	resources/lang/ur-PK/validation.php
#	resources/lang/vi/admin/settings/general.php
#	resources/lang/vi/validation.php
#	resources/lang/zh-CN/admin/settings/general.php
#	resources/lang/zh-CN/validation.php
#	resources/lang/zh-HK/validation.php
#	resources/lang/zh-TW/validation.php
#	resources/lang/zu/validation.php
#	resources/views/partials/bootstrap-table.blade.php
#	resources/views/partials/forms/edit/company-select.blade.php
#	routes/api.php
2021-09-21 23:46:50 -07:00
snipe
b7f0e76e4c Merge branch 'develop-v6-integration' of https://github.com/snipe/snipe-it into develop-v6-integration 2021-09-21 20:07:07 -07:00
snipe
6d3c8a9189 Add @Delta5 as a contributor 2021-09-21 20:06:45 -07:00
snipe
df1b1bc972 Merge pull request #10111 from Delta5/add-restore-user-api-endpoint
Added restore functionality to user API
2021-09-21 20:05:52 -07:00
Godfrey M
160017c720 more deadspace 2021-09-21 19:28:39 -07:00
Godfrey M
941cba73b9 removed deadspace and unnecessary css changes 2021-09-21 19:27:17 -07:00
Godfrey M
4a0c8de82a adds jquery eventlistner to monitor chart.js width and refresh accordingly 2021-09-21 19:13:09 -07:00
Delta5
c8c3c7fbbd Fixed issue with incorrect error message 2021-09-21 19:45:18 +00:00
Delta5
615f7e3c69 Fix author name and remove additional line spacing 2021-09-21 19:18:19 +00:00
Delta5
59302e1d19 Add restore to users api endpoint 2021-09-21 17:42:26 +00:00
Delta5
20f7fe1ecc Add restore to users api endpoint 2021-09-21 17:36:11 +00:00
snipe
d24822e342 Retroactively fix any existing settings for that table
Signed-off-by: snipe <snipe@snipe.net>
2021-09-20 15:47:29 -07:00
snipe
c59c7337a5 Forgot the ->change() method
Signed-off-by: snipe <snipe@snipe.net>
2021-09-20 15:42:25 -07:00
snipe
b331bb33d9 Code fixes and a new migration
Signed-off-by: snipe <snipe@snipe.net>
2021-09-20 15:37:24 -07:00
snipe
9f3b63387a Merge pull request #9987 from Godmartinz/bug/ch17111/donked-layout-on-required-field-error-in
Bug/ch17111/donked layout on required field error in
2021-08-24 15:11:22 -07:00
Godfrey M
a407fe9312 removed more dead space 2021-08-24 15:07:56 -07:00
Godfrey M
53ddf5ae04 removed dead space 2021-08-24 15:07:18 -07:00
Godfrey M
a197b730a1 fixed a layout issue with the month field in depreciations [ch17111] 2021-08-24 15:02:42 -07:00
snipe
193a52876e Fix incorrect resource route name
Signed-off-by: snipe <snipe@snipe.net>
2021-08-18 15:01:10 -07:00
snipe
d3844811b5 Updated composer lock
Signed-off-by: snipe <snipe@snipe.net>
2021-08-17 20:28:26 -07:00
snipe
211e0c6bd4 Dropped down to PHP 7.3 compat packages
Signed-off-by: snipe <snipe@snipe.net>
2021-08-17 20:21:43 -07:00
snipe
4c13ddd0c5 Merge pull request #9937 from Godmartinz/depreciation_min_feature
adds a Floor value for depreciation models
2021-08-16 18:29:48 -07:00
Godfrey M
9480709ea3 changed value to current value 2021-08-16 18:22:24 -07:00
Godfrey M
cef0e424e1 adds a Floor value for depreciation models 2021-08-16 18:14:10 -07:00
snipe
29008545bc Merge pull request #9924 from snipe/chore/ch16531/update-demo-photos-of-iphones-to-be-more
Update demo photos of iPhones to be more [ch16531]
2021-08-11 13:16:09 -07:00
Godfrey M
4c2257b67d Update demo photos of iPhones to be more [ch16531] 2021-08-11 13:13:12 -07:00
Tobias Regnery
eced1ab77f Fix advanced search with serial and another field
The advanced search in /hardware produces incorrect results if the serial is combined with another field like category.
There is a typo as the fieldname 'product_key' doesn't exist. Change this to 'serial'.

Also change the last If-Statement from ->orWhere() to ->where(). Now additional fields like custom fields can be combined with other searches in an And-Clause.
I think this function could be simplified further, but this is the minimal bugfix.
2021-08-05 15:07:28 +02:00
Computroniks
8121d904e7 Licence cost calculation
Licences use diffrent key to track quantity. sumFormatterQuantity has
been modified to detect which key to use.

Signed-off-by: Computroniks <mnickson@sidingsmedia.com>
2021-08-04 22:33:39 +01:00
Computroniks
f994af16da Added function to calculate cost based on quantity
sumFormatterQuantity takes the same input as sumFormatter but instead
of calculating the specified columns total it calculates the total
purchase cost of an item based upon its quantity. Also updated affected
pressenters to use this formatter.

Signed-off-by: Computroniks <mnickson@sidingsmedia.com>
2021-08-04 22:09:50 +01:00
NMC
4cfc4aec1d fix false search in api. 2021-08-01 15:10:22 -04:00
NMC
976957ddd4 Add Maintained filed in licenses view and api. + Expires in API 2021-08-01 14:30:16 -04:00
snipe
071325f368 Merge pull request #9824 from PetriAsi/feature/api-image-uploads-v6
Added #9594:  Feature/api image uploads for v6
2021-07-27 14:35:16 -07:00
snipe
476ab2888c Merge pull request #9852 from Godmartinz/develop-v6-integration
adds newer versions of devices for demo
2021-07-27 14:34:15 -07:00
snipe
5f077cc33a Merge pull request #9858 from dampfklon/fix-dockerfile-v6
Add new php extension dependencies for v6
2021-07-27 14:32:23 -07:00
Dampfklon
20df7be2f4 add new php extensions dependencies for v6 2021-07-24 23:15:17 +02:00
Godfrey M
013e168883 adds newer versions of devices for demo 2021-07-21 15:12:27 -07:00
Ivan Nieto Vivanco
35ffe8b902 Adds a check to know if the asset is checked out to the logged in user to allow check the state int the view 2021-07-20 18:56:22 -05:00
Petri Asikainen
f753404197 missed this when rebasing 2021-07-15 12:26:14 +03:00
Petri Asikainen
5d999d2572 legacy image_source support for store 2021-07-15 12:26:14 +03:00
Petri Asikainen
d50294e8e2 Just mention source of idea as code rewriten 2021-07-15 12:26:14 +03:00
Petri Asikainen
2fc3ff671e hand legacy image_source field 2021-07-15 12:26:14 +03:00
Petri Asikainen
89cc84f1d9 convert image_source field
This reverts commit b2d3ba7410.
2021-07-15 12:26:14 +03:00
Petri Asikainen
f24138da44 Revert "Handle image_source with ConvertBase64ToFiles"
This reverts commit 168d7f7004.
2021-07-15 12:26:14 +03:00
Petri Asikainen
a76b36cad9 Handle image_source with ConvertBase64ToFiles 2021-07-15 12:26:14 +03:00
Petri Asikainen
1936fc2ea9 Better debug comment 2021-07-15 12:26:14 +03:00
Petri Asikainen
23f77b2894 Fixed case again 2021-07-15 12:26:14 +03:00
Petri Asikainen
15dd7061ed removed unused Bag-functions 2021-07-15 12:26:14 +03:00
Petri Asikainen
5f81488679 fix debug placement 2021-07-15 12:26:14 +03:00
Petri Asikainen
c894e8ceb3 handle files via standard field 2021-07-15 12:26:14 +03:00
Petri Asikainen
bbe964c6b2 debug trait 2021-07-15 12:26:14 +03:00
Petri Asikainen
2325b1d8c2 Try without trait 2021-07-15 12:26:14 +03:00
Petri Asikainen
948a741935 case case again.. 2021-07-15 12:26:14 +03:00
Petri Asikainen
d7d3681d71 trait base64 encoded files 2021-07-15 12:26:13 +03:00
Petri Asikainen
e6d432423d trait base64 encoded files 2021-07-15 12:26:13 +03:00
Petri Asikainen
6173aaa25c fixed capitalization 2021-07-15 12:26:13 +03:00
Petri Asikainen
91af3f2661 Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
4191dd39ea Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
2f3501bdc2 Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
f1b8ce0a1b Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
6a21660c14 Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
64c8767e81 Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
0e7af80806 Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
e95b15d553 Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
bb269e0e5f Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
60f13c8d79 Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
5081ca3512 Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
b4380c8012 Support images and multipart requests 2021-07-15 12:26:13 +03:00
Petri Asikainen
f6766c5f23 Support images and multipart requests 2021-07-15 12:26:07 +03:00
Petri Asikainen
8bbbb06c5e testing image upload via api 2021-07-15 12:24:25 +03:00
snipe
06806341c7 Nicer tab names for permissions
Signed-off-by: snipe <snipe@snipe.net>
2021-07-08 15:57:41 -07:00
Tobias Regnery
9e1d7ffb5d Fix scope of departments for FullMultipleCompanySupport
If a user tries to view or edit a department from a different company
with FullMultipleCompanySupport enabled, there is a 403 error displayed.
Apply the correct company scope in order to only display the departments
from the own company in the departments view.

Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
2021-07-06 09:45:46 +02:00
snipe
533c3f1651 Fixed incorrect resource route
Signed-off-by: snipe <snipe@snipe.net>
2021-06-29 20:58:04 -07:00
snipe
a12ae19e32 Try deferring the load so it doesn’t query the server server 7 times for login
This doesn’t work?

Signed-off-by: snipe <snipe@snipe.net>
2021-06-29 10:50:32 -07:00
snipe
50a644a2c0 Did I seriously spell my own goddamned name wrong in the docblock??
Signed-off-by: snipe <snipe@snipe.net>
2021-06-29 10:28:00 -07:00
snipe
3332bbe072 Removed unused properties on login
This may be dumb anyway - we probably don’t need to make so many round trips to the server just to see if things are required or not… But I’d really like to standardize the validation across the system

Signed-off-by: snipe <snipe@snipe.net>
2021-06-29 10:27:44 -07:00
snipe
c517ec849d Small refactor for login Livewire
Signed-off-by: snipe <snipe@snipe.net>
2021-06-29 10:05:23 -07:00
snipe
ca41e2b7f3 Fixed typo in ansible playbook
Signed-off-by: snipe <snipe@snipe.net>
2021-06-29 07:59:12 -07:00
snipe
8780fa0a26 Use correct auth failure message
Signed-off-by: snipe <snipe@snipe.net>
2021-06-29 07:46:39 -07:00
snipe
d5881523d9 Removed unused translations
Signed-off-by: snipe <snipe@snipe.net>
2021-06-29 07:46:27 -07:00
snipe
704eb728bc Added livewire the login screen
Signed-off-by: snipe <snipe@snipe.net>
2021-06-29 02:16:57 -07:00
snipe
576e605f73 Make livewire less assy looking
Signed-off-by: snipe <snipe@snipe.net>
2021-06-28 22:40:18 -07:00
snipe
ebb0aa5532 Merge pull request #9766 from uberbrady/livewire_integration_v6
Livewire integration for Snipe-IT v6
2021-06-28 21:51:00 -07:00
Brady Wetherington
f3427ee670 Tweak to composer packages to get it to composer install correctly 2021-06-28 21:08:05 -07:00
Brady Wetherington
a6ac4f94f1 Breaking out field-listing into its own Livewire blade for use elsewhere 2021-06-28 21:00:20 -07:00
Brady Wetherington
ea1f1eb972 Get some basic Livewire going for 'edit model's default values. 2021-06-28 21:00:20 -07:00
Brady Wetherington
8e66abb926 Basic Laravel7 compatibility, starting getting Livewire going 2021-06-28 21:00:16 -07:00
snipe
dc125af029 Fixed locations link on homepage module
Signed-off-by: snipe <snipe@snipe.net>
2021-06-28 19:56:41 -07:00
snipe
2365634139 Added dashboard module for locations [ch9199]
Signed-off-by: snipe <snipe@snipe.net>
2021-06-28 19:46:56 -07:00
snipe
4af247f845 Added additional boxes to the dashboard
Signed-off-by: snipe <snipe@snipe.net>
2021-06-28 16:36:15 -07:00
snipe
d4e46ee41f Added comma in US currency format [ch16628]
Signed-off-by: snipe <snipe@snipe.net>
2021-06-28 16:14:32 -07:00
snipe
68c751fe63 Break out name into first name and last name [ch1382]
Signed-off-by: snipe <snipe@snipe.net>
2021-06-28 15:55:33 -07:00
snipe
a016f4ecd0 Applies PR #9761 to integration
Signed-off-by: snipe <snipe@snipe.net>
2021-06-28 13:11:22 -07:00
snipe
7af4c3a15f Fixed incorrect maintenances route
Signed-off-by: snipe <snipe@snipe.net>
2021-06-23 21:06:19 -07:00
snipe
d20c425a56 Un-donked assets
Signed-off-by: snipe <snipe@snipe.net>
2021-06-23 20:10:06 -07:00
snipe
1ea843248b Fixed #9729 - bulk edit order number capped at 20
Signed-off-by: snipe <snipe@snipe.net>
2021-06-23 20:04:45 -07:00
snipe
bdc285cebf Merge branch 'develop-v6-integration' of https://github.com/snipe/snipe-it into develop-v6-integration 2021-06-23 20:02:49 -07:00
snipe
71a53b3cbb Merge pull request #9741 from uberbrady/develop-v6-integration
Removed Ziggy.baseUrl references for meta references that already had baseUrl
2021-06-23 20:02:32 -07:00
Brady Wetherington
8268aca9fc Removed Ziggy.baseUrl references for meta references that had baseUrl 2021-06-23 19:57:45 -07:00
snipe
2e6bac7db5 Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2021-06-23 18:36:43 -07:00
snipe
d037ec5b9c Dev assets
Signed-off-by: snipe <snipe@snipe.net>
2021-06-23 18:08:50 -07:00
snipe
2218155700 Remove phantomJS
Signed-off-by: snipe <snipe@snipe.net>
2021-06-23 18:04:00 -07:00
snipe
32a6fa5f0c Pushed less changes into integration branch
Signed-off-by: snipe <snipe@snipe.net>
2021-06-23 18:00:33 -07:00
snipe
b3ec4bb31b Porting PR #9720 to v6 integration
Signed-off-by: snipe <snipe@snipe.net>
2021-06-23 14:28:06 -07:00
snipe
6e7ef585e4 Merge branch 'develop-v6-integration' of https://github.com/snipe/snipe-it into develop-v6-integration 2021-06-23 14:27:26 -07:00
snipe
58d674cca8 Merge pull request #9737 from uberbrady/develop-v6-integration
Develop v6 integration
2021-06-23 11:25:40 -07:00
Brady Wetherington
17aab61987 Some fixes to some typos in other routes, commeting out parameters parameter which seems crashy 2021-06-22 18:58:25 -07:00
Brady Wetherington
9456a03a88 Almost finished with the routes which is...hopefully? The last thing? 2021-06-22 16:58:23 -07:00
snipe
dc157f8f78 Add components and users count to dashboard
Signed-off-by: snipe <snipe@snipe.net>
2021-06-19 16:16:18 -07:00
snipe
60538508d4 Added missing route
Signed-off-by: snipe <snipe@snipe.net>
2021-06-12 01:51:53 -07:00
snipe
17fb56d3b9 More updated routes
Signed-off-by: snipe <snipe@snipe.net>
2021-06-12 01:35:29 -07:00
snipe
346d879344 Updated routes
Signed-off-by: snipe <snipe@snipe.net>
2021-06-12 01:05:20 -07:00
snipe
14ac7a2181 Updated API routes
Signed-off-by: snipe <snipe@snipe.net>
2021-06-12 00:42:34 -07:00
snipe
aebb30cea8 Fixed Cors wildcard
Signed-off-by: snipe <snipe@snipe.net>
2021-06-12 00:23:51 -07:00
snipe
c407b52bbf Updated Cors
Signed-off-by: snipe <snipe@snipe.net>
2021-06-12 00:23:30 -07:00
snipe
b5ddc637b8 Merge branch 'develop-v6-integration' of https://github.com/snipe/snipe-it into develop-v6-integration 2021-06-11 22:20:02 -07:00
snipe
7f74b65834 Merge pull request #9704 from uberbrady/develop-v6-integration
Get it so that we can re-build assets.
2021-06-11 22:19:51 -07:00
snipe
226b208f7c Reset handler to stock for now
Signed-off-by: snipe <snipe@snipe.net>
2021-06-11 22:19:10 -07:00
Brady Wetherington
5b42481d8f Get it so that we can re-build assets. 2021-06-11 21:54:29 -07:00
snipe
c08f70b03c Restore exeption handler functionality
Signed-off-by: snipe <snipe@snipe.net>
2021-06-11 21:51:28 -07:00
snipe
9e0e952576 Updated composer
Signed-off-by: snipe <snipe@snipe.net>
2021-06-11 20:12:39 -07:00
snipe
1b70b533aa Merge branch 'develop-v6-integration' of https://github.com/snipe/snipe-it into develop-v6-integration 2021-06-11 19:41:57 -07:00
snipe
b30bbe1740 Fixed more factories
Signed-off-by: snipe <snipe@snipe.net>
2021-06-11 19:41:20 -07:00
snipe
b3e9c51584 Merge pull request #9703 from uberbrady/develop-v6-integration
Remove barryvdh's laravel-cors for fruitcake's laravel-cors
2021-06-11 19:25:11 -07:00
Brady Wetherington
0118ff8a78 Remove barryvdh's laravel-cors for fruitcake's laravel-cors 2021-06-11 19:12:43 -07:00
snipe
b7f45d2ae2 Re-emable auth routes
Signed-off-by: snipe <snipe@snipe.net>
2021-06-11 19:02:25 -07:00
snipe
fa786e615e Moved HasFactory
Signed-off-by: snipe <snipe@snipe.net>
2021-06-11 19:02:19 -07:00
snipe
2ed2007888 Merge pull request #9702 from uberbrady/develop-v6-integration
Finished fixing the web routes file
2021-06-11 17:15:35 -07:00
Brady Wetherington
42316f3ba7 Finished fixing the web routes file and put a gigantic warning in the api routes file 2021-06-11 17:12:06 -07:00
snipe
ebfb3ed5b7 Merge pull request #9699 from uberbrady/develop-v6-integration
Basic fixes to at least get the dashboard up
2021-06-11 15:56:59 -07:00
Brady Wetherington
fc5c0a0e95 Basic fixes to at least get the dashboard up 2021-06-11 15:23:44 -07:00
snipe
3095a78664 Small tweaks to Dashboard controller
Still gettiing a bizarre `Non-static method App\Http\Controllers\DashboardController::index() should not be called statically` error

Signed-off-by: snipe <snipe@snipe.net>
2021-06-11 14:43:47 -07:00
snipe
2cddd7faf0 Fixed filesystem config
Signed-off-by: snipe <snipe@snipe.net>
2021-06-11 14:26:10 -07:00
snipe
a5f144b4e0 Merge branch 'shift-46327' into develop-v6-integration
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2021-06-11 14:10:10 -07:00
snipe
a8123092af Misc fixes for shift
// TODO - re-fix the exception handler

Signed-off-by: snipe <snipe@snipe.net>
2021-06-11 14:07:50 -07:00
Laravel Shift
b62d1f49e4 Shift cleanup 2021-06-10 20:19:27 +00:00
Laravel Shift
9838c0c2ef Upgrade to Laravel Mix 6 2021-06-10 20:18:15 +00:00
Laravel Shift
8b82262777 Shift return type of base TestCase methods
From the [PHPUnit 8 release notes][1], the `TestCase` methods below now declare a `void` return type:

- `setUpBeforeClass()`
- `setUp()`
- `assertPreConditions()`
- `assertPostConditions()`
- `tearDown()`
- `tearDownAfterClass()`
- `onNotSuccessfulTest()`

[1]: https://phpunit.de/announcements/phpunit-8.html
2021-06-10 20:18:12 +00:00
Laravel Shift
30607ac268 Shift Laravel dependencies 2021-06-10 20:18:11 +00:00
Laravel Shift
7e93086dd4 Default config files
In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them and merged your true customizations -
where ENV variables may not be used.
2021-06-10 20:18:10 +00:00
Laravel Shift
cc3c59bf97 Shift config files 2021-06-10 20:18:10 +00:00
Laravel Shift
c367fa7e40 Shift PSR-4 autoloading 2021-06-10 20:18:01 +00:00
Laravel Shift
c90b1c6a43 Namespace seeders 2021-06-10 20:18:00 +00:00
Laravel Shift
104b441e0d Shift to class based factories 2021-06-10 20:17:44 +00:00
Laravel Shift
c02a95e73f Ignore temporary framework files 2021-06-10 20:17:22 +00:00
Laravel Shift
3c40c6fe25 Shift console routes 2021-06-10 20:17:20 +00:00
Laravel Shift
9f43ce97e9 Convert deprecated $dates property to $casts 2021-06-10 20:17:18 +00:00
Laravel Shift
bdf23e472e Shift to class based routes 2021-06-10 20:17:14 +00:00
Laravel Shift
ddc8b8648b Shift service providers 2021-06-10 20:17:07 +00:00
Laravel Shift
4ed3d6afb8 Shift HTTP kernel and middleware 2021-06-10 20:17:04 +00:00
Laravel Shift
ec0dc681ba Shift core files 2021-06-10 20:16:59 +00:00
Laravel Shift
802dc9240d Shift bindings
PHP 5.5.9+ adds the new static `class` property which provides the fully qualified class name. This is preferred over using class name strings as these references are checked by the parser.
2021-06-10 20:16:56 +00:00
Laravel Shift
934afa036f Adopt Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions.

You may customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config file to your project root. Feel free to use [Shift's Laravel ruleset][2] to help you get started.

[1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
[2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
2021-06-10 20:15:52 +00:00
sh1hab
f43413bdc3 Feature snipe#9378 update 2021-05-21 10:19:04 +06:00
sh1hab
cd4b1d8acb Merge branch 'develop' of https://github.com/snipe/snipe-it into feature/remove_deleted_user_from_unaccepted_assets_report 2021-05-21 10:09:05 +06:00
Thomas Misilo
18b1a155bf Change from ENV to config value for PUBLIC_AWS_URL
When running config:cache the env('PUBLIC_AWS'URL') value disappears and isn't available, so it doesn't get added to the CSP Policy.
2021-05-11 09:51:35 -05:00
sh1hab
6799ce9bfd merge develop with remove_deleted_user_from_unaccepted_assets_report 2021-05-05 16:19:14 +06:00
sh1hab
193a8d923b Feature #9378 update phpdoc comment 2021-04-29 16:32:37 +06:00
sh1hab
98a42afa78 Feature #9378 remove deleted user from unaccepted assets report 2021-04-29 15:34:05 +06:00
2889 changed files with 397673 additions and 66348 deletions

View File

@@ -2361,6 +2361,15 @@
"code"
]
},
{
"login": "Delta5",
"name": "Evan Taylor",
"avatar_url": "https://avatars.githubusercontent.com/u/1975640?v=4",
"profile": "https://github.com/Delta5",
"contributions": [
"code"
]
},
{
"login": "PetriAsi",
"name": "Petri Asikainen",
@@ -2514,6 +2523,15 @@
"code"
]
},
{
"login": "PlaneNuts",
"name": "PlaneNuts",
"avatar_url": "https://avatars.githubusercontent.com/u/88776392?v=4",
"profile": "https://github.com/PlaneNuts",
"contributions": [
"code"
]
},
{
"login": "exula",
"name": "Bradley Coudriet",
@@ -2532,6 +2550,24 @@
"code"
]
},
{
"login": "adagioajanes",
"name": "Alex Janes",
"avatar_url": "https://avatars.githubusercontent.com/u/38761237?v=4",
"profile": "https://adagiohealth.org",
"contributions": [
"code"
]
},
{
"login": "nuraeil",
"name": "Nuraeil",
"avatar_url": "https://avatars.githubusercontent.com/u/32387849?v=4",
"profile": "https://github.com/nuraeil",
"contributions": [
"code"
]
},
{
"login": "TenOfTens",
"name": "TenOfTens",
@@ -2542,12 +2578,30 @@
]
},
{
"login": "savornicesei",
"name": "Simona Avornicesei",
"avatar_url": "https://avatars.githubusercontent.com/u/917232?v=4",
"profile": "http://www.avornicesei.com",
"login": "insert-waffle",
"name": "waffle",
"avatar_url": "https://avatars.githubusercontent.com/u/9415391?v=4",
"profile": "https://ditisjens.be/",
"contributions": [
"test"
"code"
]
},
{
"login": "QveenSi",
"name": "Yevhenii Huzii",
"avatar_url": "https://avatars.githubusercontent.com/u/19945501?v=4",
"profile": "https://github.com/QveenSi",
"contributions": [
"code"
]
},
{
"login": "veenone",
"name": "Achmad Fienan Rahardianto",
"avatar_url": "https://avatars.githubusercontent.com/u/3839381?v=4",
"profile": "https://github.com/veenone",
"contributions": [
"code"
]
},
{
@@ -2567,6 +2621,213 @@
"contributions": [
"code"
]
},
{
"login": "denzfarid",
"name": "denzfarid",
"avatar_url": "https://avatars.githubusercontent.com/u/1294403?v=4",
"profile": "https://github.com/denzfarid",
"contributions": []
},
{
"login": "ntbutler-nbcs",
"name": "ntbutler-nbcs",
"avatar_url": "https://avatars.githubusercontent.com/u/94018771?v=4",
"profile": "https://github.com/ntbutler-nbcs",
"contributions": [
"code"
]
},
{
"login": "naveensrinivasan",
"name": "Naveen",
"avatar_url": "https://avatars.githubusercontent.com/u/172697?v=4",
"profile": "https://naveensrinivasan.dev",
"contributions": [
"code"
]
},
{
"login": "mikeroq",
"name": "Mike Roquemore",
"avatar_url": "https://avatars.githubusercontent.com/u/55674383?v=4",
"profile": "https://github.com/mikeroq",
"contributions": [
"code"
]
},
{
"login": "reederda",
"name": "Daniel Reeder",
"avatar_url": "https://avatars.githubusercontent.com/u/7991086?v=4",
"profile": "https://github.com/reederda",
"contributions": [
"translation",
"translation",
"code"
]
},
{
"login": "vickyjaura183",
"name": "vickyjaura183",
"avatar_url": "https://avatars.githubusercontent.com/u/109422491?v=4",
"profile": "https://github.com/vickyjaura183",
"contributions": [
"code"
]
},
{
"login": "julian-piehl",
"name": "Peace",
"avatar_url": "https://avatars.githubusercontent.com/u/32363424?v=4",
"profile": "https://github.com/julian-piehl",
"contributions": [
"code"
]
},
{
"login": "kylegordon",
"name": "Kyle Gordon",
"avatar_url": "https://avatars.githubusercontent.com/u/231528?v=4",
"profile": "https://github.com/kylegordon",
"contributions": [
"code"
]
},
{
"login": "sunflowerbofh",
"name": "Katharina Drexel",
"avatar_url": "https://avatars.githubusercontent.com/u/53009155?v=4",
"profile": "http://www.bfh.ch",
"contributions": [
"code"
]
},
{
"login": "dsferruzza",
"name": "David Sferruzza",
"avatar_url": "https://avatars.githubusercontent.com/u/1931963?v=4",
"profile": "https://david.sferruzza.fr/",
"contributions": [
"code"
]
},
{
"login": "rnelsonee",
"name": "Rick Nelson",
"avatar_url": "https://avatars.githubusercontent.com/u/19511639?v=4",
"profile": "https://github.com/rnelsonee",
"contributions": [
"code"
]
},
{
"login": "BasO12",
"name": "BasO12",
"avatar_url": "https://avatars.githubusercontent.com/u/94169344?v=4",
"profile": "https://github.com/BasO12",
"contributions": [
"code"
]
},
{
"login": "Vautia",
"name": "Vautia",
"avatar_url": "https://avatars.githubusercontent.com/u/111710123?v=4",
"profile": "https://github.com/Vautia",
"contributions": [
"code"
]
},
{
"login": "chartjes",
"name": "Chris Hartjes",
"avatar_url": "https://avatars.githubusercontent.com/u/28321?v=4",
"profile": "http://www.littlehart.net/atthekeyboard",
"contributions": [
"code"
]
},
{
"login": "geo-chen",
"name": "geo-chen",
"avatar_url": "https://avatars.githubusercontent.com/u/2404584?v=4",
"profile": "https://github.com/geo-chen",
"contributions": [
"code"
]
},
{
"login": "nh314",
"name": "Phan Nguyen",
"avatar_url": "https://avatars.githubusercontent.com/u/6006620?v=4",
"profile": "https://github.com/nh314",
"contributions": [
"code"
]
},
{
"login": "StarlessNights",
"name": "Iisakki Jaakkola",
"avatar_url": "https://avatars.githubusercontent.com/u/115993812?v=4",
"profile": "https://github.com/StarlessNights",
"contributions": [
"code"
]
},
{
"login": "eltociear",
"name": "Ikko Ashimine",
"avatar_url": "https://avatars.githubusercontent.com/u/22633385?v=4",
"profile": "https://bandism.net/",
"contributions": [
"code"
]
},
{
"login": "lukasfehling",
"name": "Lukas Fehling",
"avatar_url": "https://avatars.githubusercontent.com/u/56871540?v=4",
"profile": "https://github.com/lukasfehling",
"contributions": [
"code"
]
},
{
"login": "fernando-almeida",
"name": "Fernando Almeida",
"avatar_url": "https://avatars.githubusercontent.com/u/1975990?v=4",
"profile": "https://github.com/fernando-almeida",
"contributions": [
"code"
]
},
{
"login": "akemidx",
"name": "akemidx",
"avatar_url": "https://avatars.githubusercontent.com/u/116301219?v=4",
"profile": "https://github.com/akemidx",
"contributions": [
"code"
]
},
{
"login": "oguzbilgic",
"name": "Oguz Bilgic",
"avatar_url": "https://avatars.githubusercontent.com/u/144778?v=4",
"profile": "http://oguz.site",
"contributions": [
"code"
]
},
{
"login": "scoo73r",
"name": "Scooter Crawford",
"avatar_url": "https://avatars.githubusercontent.com/u/9262438?v=4",
"profile": "https://github.com/scoo73r",
"contributions": [
"code"
]
}
]
}

View File

@@ -138,6 +138,13 @@ PRIVATE_AWS_BUCKET=null
PRIVATE_AWS_URL=null
PRIVATE_AWS_BUCKET_ROOT=null
# --------------------------------------------
# OPTIONAL: AWS Settings
# --------------------------------------------
AWS_ACCESS_KEY_ID=null
AWS_SECRET_ACCESS_KEY=null
AWS_DEFAULT_REGION=null
# --------------------------------------------
# OPTIONAL: LOGIN THROTTLING
# --------------------------------------------
@@ -148,8 +155,8 @@ RESET_PASSWORD_LINK_EXPIRES=900
# --------------------------------------------
# OPTIONAL: MISC
# --------------------------------------------
APP_LOG=stderr
APP_LOG_MAX_FILES=10
LOG_CHANNEL=stderr
LOG_MAX_DAYS=10
APP_LOCKED=false
APP_CIPHER=AES-256-CBC
GOOGLE_MAPS_API=

106
.env.dusk.local Normal file
View File

@@ -0,0 +1,106 @@
# --------------------------------------------
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=local
APP_DEBUG=false
APP_KEY=base64:hTUIUh9CP6dQx+6EjSlfWTgbaMaaRvlpEwk45vp+xmk=
APP_URL=http://127.0.0.1:8000
APP_TIMEZONE='US/Eastern'
APP_LOCALE=en
APP_LOCKED=false
MAX_RESULTS=200
# --------------------------------------------
# REQUIRED: UPLOADED FILE STORAGE SETTINGS
# --------------------------------------------
PRIVATE_FILESYSTEM_DISK=local
PUBLIC_FILESYSTEM_DISK=local_public
# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=snipeit-local
DB_USERNAME=snipeit-local
DB_PASSWORD=snipeit-local
DB_PREFIX=null
DB_DUMP_PATH='/Applications/MAMP/Library/bin'
# --------------------------------------------
# OPTIONAL: SSL DATABASE SETTINGS
# --------------------------------------------
DB_SSL=false
DB_SSL_KEY_PATH=null
DB_SSL_CERT_PATH=null
DB_SSL_CA_PATH=null
DB_SSL_CIPHER=null
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_DRIVER="log"
# --------------------------------------------
# REQUIRED: IMAGE LIBRARY
# This should be gd or imagick
# --------------------------------------------
IMAGE_LIB=gd
# --------------------------------------------
# OPTIONAL: SESSION SETTINGS
# --------------------------------------------
SESSION_LIFETIME=12000
EXPIRE_ON_CLOSE=false
ENCRYPT=true
COOKIE_NAME=snipeit_v5_local
SECURE_COOKIES=true
# --------------------------------------------
# OPTIONAL: SECURITY HEADER SETTINGS
# --------------------------------------------
REFERRER_POLICY=same-origin
ENABLE_CSP=true
CORS_ALLOWED_ORIGINS="*"
# --------------------------------------------
# OPTIONAL: CACHE SETTINGS
# --------------------------------------------
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
# --------------------------------------------
# OPTIONAL: LOGIN THROTTLING
# --------------------------------------------
LOGIN_MAX_ATTEMPTS=50000
LOGIN_LOCKOUT_DURATION=1000
RESET_PASSWORD_LINK_EXPIRES=15
# --------------------------------------------
# OPTIONAL: API
# --------------------------------------------
API_MAX_REQUESTS_PER_HOUR=200
# --------------------------------------------
# OPTIONAL: SAML SETTINGS
# --------------------------------------------
DISABLE_NOSAML_LOCAL_LOGIN=true
# --------------------------------------------
# OPTIONAL: MISC
# --------------------------------------------
LOG_CHANNEL=single
LOG_LEVEL=debug
LOG_CHANNEL=stack
LOG_SLACK_WEBHOOK_URL=null
APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1
ALLOW_IFRAMING=true
ENABLE_HSTS=false
WARN_DEBUG=false
APP_CIPHER=AES-256-CBC

View File

@@ -15,11 +15,16 @@ MAX_RESULTS=500
PRIVATE_FILESYSTEM_DISK=local
PUBLIC_FILESYSTEM_DISK=local_public
#PRIVATE_FILESYSTEM_DISK=s3_private
#PUBLIC_FILESYSTEM_DISK=s3_public
# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=null
DB_USERNAME=null
DB_PASSWORD=null
@@ -66,11 +71,13 @@ IMAGE_LIB=gd
MAIL_BACKUP_NOTIFICATION_DRIVER=null
MAIL_BACKUP_NOTIFICATION_ADDRESS=null
BACKUP_ENV=true
ALLOW_BACKUP_DELETE=false
ALLOW_DATA_PURGE=false
# --------------------------------------------
# OPTIONAL: SESSION SETTINGS
# --------------------------------------------
SESSION_DRIVER=file
SESSION_LIFETIME=12000
EXPIRE_ON_CLOSE=false
ENCRYPT=false
@@ -93,7 +100,6 @@ ENABLE_HSTS=false
# OPTIONAL: CACHE SETTINGS
# --------------------------------------------
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
CACHE_PREFIX=snipeit
@@ -130,18 +136,31 @@ PRIVATE_AWS_BUCKET=null
PRIVATE_AWS_URL=null
PRIVATE_AWS_BUCKET_ROOT=null
# --------------------------------------------
# OPTIONAL: AWS Settings
# --------------------------------------------
AWS_ACCESS_KEY_ID=null
AWS_SECRET_ACCESS_KEY=null
AWS_DEFAULT_REGION=null
# --------------------------------------------
# OPTIONAL: LOGIN THROTTLING
# --------------------------------------------
LOGIN_MAX_ATTEMPTS=5
LOGIN_LOCKOUT_DURATION=60
RESET_PASSWORD_LINK_EXPIRES=900
# --------------------------------------------
# OPTIONAL: FORGOTTEN PASSWORD SETTINGS
# --------------------------------------------
RESET_PASSWORD_LINK_EXPIRES=15
PASSWORD_CONFIRM_TIMEOUT=10800
PASSWORD_RESET_MAX_ATTEMPTS_PER_MIN=50
# --------------------------------------------
# OPTIONAL: MISC
# --------------------------------------------
APP_LOG=single
APP_LOG_MAX_FILES=10
LOG_CHANNEL=single
LOG_MAX_DAYS=10
APP_LOCKED=false
APP_CIPHER=AES-256-CBC
APP_FORCE_TLS=false
@@ -153,4 +172,11 @@ IMPORT_TIME_LIMIT=600
IMPORT_MEMORY_LIMIT=500M
REPORT_TIME_LIMIT=12000
REQUIRE_SAML=false
API_THROTTLE_PER_MINUTE=120
API_THROTTLE_PER_MINUTE=120
CSV_ESCAPE_FORMULAS=true
# --------------------------------------------
# OPTIONAL: SCIM
# --------------------------------------------
SCIM_TRACE=false
SCIM_STANDARDS_COMPLIANCE=false

View File

@@ -14,6 +14,7 @@ FILESYSTEM_DISK=local
# --------------------------------------------
DB_CONNECTION=sqlite_testing
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=testing.sqlite
DB_USERNAME=null
DB_PASSWORD=null
@@ -38,7 +39,7 @@ IMAGE_LIB=gd
# --------------------------------------------
# OPTIONAL: AWS S3 SETTINGS
# OPTIONAL: AWS SETTINGS
# --------------------------------------------
AWS_SECRET_ACCESS_KEY=null
AWS_ACCESS_KEY_ID=null
@@ -70,5 +71,5 @@ SECURE_COOKIES=false
# --------------------------------------------
# OPTIONAL: APP LOG FORMAT
# --------------------------------------------
APP_LOG=single
APP_LOG_LEVEL=debug
LOG_CHANNEL=single
LOG_LEVEL=debug

View File

@@ -1,10 +1,10 @@
# --------------------------------------------
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=testing-ci
APP_ENV='testing-ci'
APP_DEBUG=false
APP_KEY=ChangeMe
APP_URL=http://localhost:8000
APP_KEY='base64:glJpcM7BYwWiBggp3SQ/+NlRkqsBQMaGEOjemXqJzOU='
APP_URL='http://localhost:8000'
APP_TIMEZONE='US/Pacific'
APP_LOCALE=en
FILESYSTEM_DISK=local
@@ -12,9 +12,10 @@ FILESYSTEM_DISK=local
# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
# --------------------------------------------
DB_CONNECTION=mysql
DB_CONNECTION=sqlite
DB_HOST=localhost
DB_DATABASE=snipeit_unit
DB_PORT=3306
DB_DATABASE='sqlite_testing'
DB_USERNAME=root
DB_PASSWORD=null
@@ -22,13 +23,7 @@ DB_PASSWORD=null
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_DRIVER=log
MAIL_HOST=email-smtp.us-west-2.amazonaws.com
MAIL_PORT=587
MAIL_USERNAME=YOURUSERNAME
MAIL_PASSWORD=YOURPASSWORD
MAIL_ENCRYPTION=null
MAIL_FROM_ADDR=you@example.com
MAIL_FROM_NAME=Snipe-IT
# --------------------------------------------
# REQUIRED: IMAGE LIBRARY
@@ -37,37 +32,7 @@ MAIL_FROM_NAME=Snipe-IT
IMAGE_LIB=gd
# --------------------------------------------
# OPTIONAL: AWS S3 SETTINGS
# --------------------------------------------
AWS_SECRET_ACCESS_KEY=null
AWS_ACCESS_KEY_ID=null
AWS_DEFAULT_REGION=null
AWS_BUCKET=null
AWS_BUCKET_ROOT=null
AWS_URL=null
# --------------------------------------------
# OPTIONAL: CACHE SETTINGS
# --------------------------------------------
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
# --------------------------------------------
# OPTIONAL: SESSION SETTINGS
# --------------------------------------------
SESSION_LIFETIME=12000
EXPIRE_ON_CLOSE=false
ENCRYPT=false
COOKIE_NAME=snipeittest_session
COOKIE_DOMAIN=null
SECURE_COOKIES=false
# --------------------------------------------
# OPTIONAL: APP LOG FORMAT
# --------------------------------------------
APP_LOG=single
LOG_CHANNEL=single

View File

@@ -4,6 +4,7 @@ APP_URL=http://snipe-it.localapp
DB_CONNECTION=mysql
DB_DEFAULT=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=snipeittests
DB_USERNAME=snipeit
DB_PASSWORD=snipe

View File

@@ -4,6 +4,7 @@ APP_URL=http://snipe-it.localapp
DB_CONNECTION=sqlite_testing
DB_DEFAULT=sqlite_testing
DB_HOST=localhost
DB_PORT=3306
APP_KEY=base64:tu9NRh/a6+dCXBDGvg0Gv/0TcABnFsbT4AKxrr8mwQo=

2
.github/CODEOWNERS vendored
View File

@@ -15,8 +15,8 @@
# *.js @octocat @github/js
app/Importer/* @dmeltzer
app/Http/Controllers/CustomFields* @uberbrady
app/Http/Controllers/Api/CustomFields* @uberbrady
resources/views/custom_fields/* @uberbrady
docker/* @uberbrady
app/Providers/SamlServiceProvider.php @uberbrady

View File

@@ -1,42 +1,27 @@
name: Feature Request
description: Suggest an idea for this project
body:
- 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: textarea
attributes:
label: Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
- type: textarea
attributes:
label: Additional context Add any other context or screenshots about the feature request here.
name: Feature Request
description: Suggest an idea for this project
title: "[Feature Request]: "
labels: ["feature request"]
assignees:
- snipe
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,4 +1,18 @@
frontend: ["*.js", "*.css", "*.vue", "*.scss", "*.less", "*.blade.*"]
backend: ["/app", "*.php"]
legal: ["LICENSE*", "NOTICES*"]
frontend: ["*.js", "*.css", "*.vue", "*.scss", "*.less", "*.blade.*", "*livewire*"]
skins: ["*.js", "*.css", "*.scss", "*.less"]
css: ["*.css","*.scss", "*.less"]
backend: ["/app/*", "*.php"]
backups: ["*backup*"]
restore: ["*restore*"]
saml: ["*saml*"]
scim: ["*scim*"]
custom fields: ["*fields*", "*fieldsets*"]
dependencies: ["composer.json"]
consumables: ["*consumables*"]
api: ["/app/Http/Controllers/api/*"]
notifications: ["/app/Notifications/*"]
importer: ["/app/Importer/*"]
cli / artisan: ["/app/Console/*"]
LDAP: ["*LDAP*", "/app/Console/Commands/Ldap*","/app/Models/Ldap.php"]
docker: ["*docker/*", "Dockerfile", "Dockerfile.alpine", "Dockerfile.fpm-alpine", ".dockerignore", ".env.docker"]
config: .github

6
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

39
.github/workflows/SA-codeql.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
# This workflow checks out code, performs a CodeQL analysis (for JavaScript) and integrates the results
# with the GitHub Advanced Security code scanning feature.
# More information: https://codeql.github.com/
name: CodeQL Security Scan
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# schedule:
# - cron: '15 17 * * 1'
jobs:
analyze:
name: CodeQL Security Scan
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3.1.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@@ -17,18 +17,26 @@ on:
schedule:
- cron: '36 23 * * 3'
permissions:
contents: read
jobs:
codacy-security-scan:
# Ensure schedule job never runs on forked repos. It's only executed for 'snipe/snipe-it'
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
if: (github.repository == 'snipe/snipe-it') || ((github.repository != 'snipe/snipe-it') && (github.event_name != 'schedule'))
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@1.1.0
uses: codacy/codacy-analysis-cli-action@v4.2.0
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
@@ -44,6 +52,6 @@ jobs:
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif

View File

@@ -15,6 +15,9 @@ on:
pull_request:
permissions:
contents: read
jobs:
docker:
# Ensure this job never runs on forked repos. It's only executed for 'snipe/snipe-it'
@@ -38,17 +41,17 @@ jobs:
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
# https://github.com/docker/setup-buildx-action
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
# https://github.com/docker/login-action
- name: Login to DockerHub
# Only login if not a PR, as PRs only trigger a Docker build and not a push
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
@@ -60,7 +63,7 @@ jobs:
# Get Metadata for docker_build step below
- name: Sync metadata (tags, labels) from GitHub to Docker for 'snipe-it' image
id: meta_build
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: snipe/snipe-it
tags: ${{ env.IMAGE_TAGS }}
@@ -69,7 +72,7 @@ jobs:
# https://github.com/docker/build-push-action
- name: Build and push 'snipe-it' image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.alpine

View File

@@ -15,6 +15,9 @@ on:
pull_request:
permissions:
contents: read
jobs:
docker:
# Ensure this job never runs on forked repos. It's only executed for 'snipe/snipe-it'
@@ -38,17 +41,17 @@ jobs:
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
# https://github.com/docker/setup-buildx-action
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
# https://github.com/docker/login-action
- name: Login to DockerHub
# Only login if not a PR, as PRs only trigger a Docker build and not a push
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
@@ -60,7 +63,7 @@ jobs:
# Get Metadata for docker_build step below
- name: Sync metadata (tags, labels) from GitHub to Docker for 'snipe-it' image
id: meta_build
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: snipe/snipe-it
tags: ${{ env.IMAGE_TAGS }}
@@ -69,7 +72,7 @@ jobs:
# https://github.com/docker/build-push-action
- name: Build and push 'snipe-it' image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile

2
.nvmrc
View File

@@ -1 +1 @@
v10.15.1
v12.22.1

View File

@@ -1,5 +1,5 @@
FROM ubuntu:focal
LABEL maintainer Brady Wetherington <bwetherington@grokability.com>
FROM ubuntu:20.04
LABEL maintainer="Brady Wetherington <bwetherington@grokability.com>"
# No need to add `apt-get clean` here, reference:
# - https://github.com/snipe/snipe-it/pull/9201
@@ -23,6 +23,8 @@ php7.4-xml \
php7.4-mbstring \
php7.4-zip \
php7.4-bcmath \
php7.4-redis \
php-memcached \
patch \
curl \
wget \
@@ -41,6 +43,7 @@ libmcrypt-dev \
php7.4-dev \
ca-certificates \
unzip \
dnsutils \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

View File

@@ -1,4 +1,4 @@
FROM alpine:3
FROM alpine:3.14.2
# Apache + PHP
RUN apk add --no-cache \
apache2 \
@@ -25,6 +25,10 @@ RUN apk add --no-cache \
php7-session \
php7-dom \
php7-xmlwriter \
php7-xmlreader \
php7-sodium \
php7-redis \
php7-pecl-memcached \
curl \
wget \
vim \

View File

@@ -75,14 +75,14 @@ RUN set -eux; \
rm snipeit.tar.gz; \
# Install composer php dependencies
if [ "$ENVIRONMENT" = "production" ]; then \
echo "production enviroment detected!"; \
echo "production environment detected!"; \
composer update \
--no-cache \
--no-dev \
--optimize-autoloader \
--working-dir=/var/www/html; \
else \
echo "development enviroment detected!"; \
echo "development environment detected!"; \
apk add --no-cache \
${DEV_PACKAGES}; \
composer update \
@@ -100,4 +100,4 @@ COPY --chown=www-data:www-data docker/docker-secrets.env /var/www/html/.env
COPY --chmod=655 docker/docker-entrypoint.sh /usr/local/bin/docker-snipeit-entrypoint
COPY docker/column-statistics.cnf /etc/mysql/conf.d/column-statistics.cnf
ENTRYPOINT [ "/usr/local/bin/docker-snipeit-entrypoint" ]
CMD [ "/usr/local/bin/docker-php-entrypoint", "php-fpm" ]
CMD [ "/usr/local/bin/docker-php-entrypoint", "php-fpm" ]

View File

@@ -1,11 +1,11 @@
![Build Status](https://app.chipperci.com/projects/0e5f8979-31eb-4ee6-9abf-050b76ab0383/status/master) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeitapp.svg?style=social)](https://twitter.com/snipeitapp) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=snipe/snipe-it&amp;utm_campaign=Badge_Grade)
[![All Contributors](https://img.shields.io/badge/all_contributors-282-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev)
[![All Contributors](https://img.shields.io/badge/all_contributors-311-orange.svg?style=flat-square)](#contributors) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/yZFtShAcKk) [![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev)
## Snipe-IT - Open Source Asset Management System
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 6](http://laravel.com).
It is built on [Laravel 8](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/).)
@@ -59,14 +59,16 @@ Since the release of the JSON REST API, several third-party developers have been
- [SnipeSharp - .NET module in C#](https://github.com/barrycarey/SnipeSharp) by [@barrycarey](https://github.com/barrycarey)
- [InQRy -unmaintained-](https://github.com/Microsoft/InQRy) by [@Microsoft](https://github.com/Microsoft)
- [SnipeitPS](https://github.com/snazy2000/SnipeitPS) by [@snazy2000](https://github.com/snazy2000) - Powershell API Wrapper for Snipe-it
- [jamf2snipe](https://github.com/ParadoxGuitarist/jamf2snipe) by [@ParadoxGuitarist](https://github.com/ParadoxGuitarist) - Python script to sync assets between a JAMFPro instance and a Snipe-IT instance
- [jamf2snipe](https://github.com/grokability/jamf2snipe) - Python script to sync assets between a JAMFPro instance and a Snipe-IT instance
- [Marksman](https://github.com/Scope-IT/marksman) - A Windows agent for Snipe-IT
- [Snipe-IT plugin for Jira Service Desk](https://marketplace.atlassian.com/apps/1220964/snipe-it-for-jira)
- [Python 3 CSV importer](https://github.com/gastamper/snipeit-csvimporter) - allows importing assets into Snipe-IT based on Item Name rather than Asset Tag.
- [Snipe-IT Kubernetes Helm Chart](https://github.com/t3n/helm-charts/tree/master/snipeit) - For more information, [click here](https://hub.helm.sh/charts/t3n/snipeit).
- [Snipe-IT Bulk Edit](https://github.com/bricelabelle/snipe-it-bulkedit) - Google Script files to use Google Sheets as a bulk checkout/checkin/edit tool for Snipe-it.
- [MosyleSnipeSync](https://github.com/RodneyLeeBrands/MosyleSnipeSync) by [@RodneyLeeBrands](https://github.com/RodneyLeeBrands) - Python script to synchronize information between Mosyle and Snipe-IT
- [WWW::SnipeIT](https://github.com/SEDC/perl-www-snipeit) by [@SEDC](https://github.com/SEDC) - perl module for accessing the API
As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :)
As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :)
-----
@@ -77,6 +79,8 @@ Please see the documentation on [contributing and developing for Snipe-IT](https
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
The ERD is available [online here](https://drawsql.app/templates/snipe-it).
-----
### Security
@@ -128,10 +132,14 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [<img src="https://avatars.githubusercontent.com/u/9255772?v=4" width="110px;"/><br /><sub>Mark Stenglein</sub>](https://markstenglein.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ocelotsloth "Code") | [<img src="https://avatars.githubusercontent.com/u/35658596?v=4" width="110px;"/><br /><sub>ajsy</sub>](https://github.com/ajsy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ajsy "Code") | [<img src="https://avatars.githubusercontent.com/u/3628035?v=4" width="110px;"/><br /><sub>Jan Kiesewetter</sub>](https://github.com/t3easy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=t3easy "Code") | [<img src="https://avatars.githubusercontent.com/u/79449630?v=4" width="110px;"/><br /><sub>Tetrachloromethane250</sub>](https://github.com/Tetrachloromethane250)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Tetrachloromethane250 "Code") | [<img src="https://avatars.githubusercontent.com/u/22004482?v=4" width="110px;"/><br /><sub>Lars Kajes</sub>](https://www.kajes.se/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kajes "Code") | [<img src="https://avatars.githubusercontent.com/u/13993216?v=4" width="110px;"/><br /><sub>Joly0</sub>](https://github.com/Joly0)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Joly0 "Code") | [<img src="https://avatars.githubusercontent.com/u/1501022?v=4" width="110px;"/><br /><sub>theburger</sub>](https://github.com/limeless)<br />[💻](https://github.com/snipe/snipe-it/commits?author=limeless "Code") |
| [<img src="https://avatars.githubusercontent.com/u/36065681?v=4" width="110px;"/><br /><sub>David Valin Alonso</sub>](https://github.com/deivishome)<br />[💻](https://github.com/snipe/snipe-it/commits?author=deivishome "Code") | [<img src="https://avatars.githubusercontent.com/u/8290389?v=4" width="110px;"/><br /><sub>andreaci</sub>](https://github.com/andreaci)<br />[💻](https://github.com/snipe/snipe-it/commits?author=andreaci "Code") | [<img src="https://avatars.githubusercontent.com/u/1828542?v=4" width="110px;"/><br /><sub>Jelle Sebreghts</sub>](http://www.jellesebreghts.be)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Jelle-S "Code") | [<img src="https://avatars.githubusercontent.com/u/11180862?v=4" width="110px;"/><br /><sub>Michael Pietsch</sub>](https://github.com/Skywalker-11)<br /> | [<img src="https://avatars.githubusercontent.com/u/22068886?v=4" width="110px;"/><br /><sub>Masudul Haque Shihab</sub>](https://github.com/sh1hab)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sh1hab "Code") | [<img src="https://avatars.githubusercontent.com/u/16099942?v=4" width="110px;"/><br /><sub>Supapong Areeprasertkul</sub>](http://www.freedomdive.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=zybersup "Code") | [<img src="https://avatars.githubusercontent.com/u/207358?v=4" width="110px;"/><br /><sub>Peter Sarossy</sub>](https://github.com/psarossy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=psarossy "Code") |
| [<img src="https://avatars.githubusercontent.com/u/11823649?v=4" width="110px;"/><br /><sub>Renee Margaret McConahy</sub>](https://github.com/nepella)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nepella "Code") | [<img src="https://avatars.githubusercontent.com/u/5553884?v=4" width="110px;"/><br /><sub>JohnnyPicnic</sub>](https://github.com/JohnnyPicnic)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JohnnyPicnic "Code") | [<img src="https://avatars.githubusercontent.com/u/8799594?v=4" width="110px;"/><br /><sub>markbrule</sub>](https://github.com/markbrule)<br />[💻](https://github.com/snipe/snipe-it/commits?author=markbrule "Code") | [<img src="https://avatars.githubusercontent.com/u/1962801?v=4" width="110px;"/><br /><sub>Mike Campbell</sub>](https://github.com/mikecmpbll)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mikecmpbll "Code") | [<img src="https://avatars.githubusercontent.com/u/11973217?v=4" width="110px;"/><br /><sub>tbrconnect</sub>](https://github.com/tbrconnect)<br />[💻](https://github.com/snipe/snipe-it/commits?author=tbrconnect "Code") | [<img src="https://avatars.githubusercontent.com/u/12447225?v=4" width="110px;"/><br /><sub>kcoyo</sub>](https://github.com/kcoyo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kcoyo "Code") | [<img src="https://avatars.githubusercontent.com/u/494017?v=4" width="110px;"/><br /><sub>Travis Miller</sub>](https://travismiller.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=travismiller "Code") |
| [<img src="https://avatars.githubusercontent.com/u/8735148?v=4" width="110px;"/><br /><sub>Petri Asikainen</sub>](https://github.com/PetriAsi)<br />[💻](https://github.com/snipe/snipe-it/commits?author=PetriAsi "Code") | [<img src="https://avatars.githubusercontent.com/u/11424540?v=4" width="110px;"/><br /><sub>derdeagle</sub>](https://github.com/derdeagle)<br />[💻](https://github.com/snipe/snipe-it/commits?author=derdeagle "Code") | [<img src="https://avatars.githubusercontent.com/u/176950?v=4" width="110px;"/><br /><sub>Mike Frysinger</sub>](https://wh0rd.org/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vapier "Code") | [<img src="https://avatars.githubusercontent.com/u/22044358?v=4" width="110px;"/><br /><sub>ALPHA</sub>](https://github.com/AL4AL)<br />[💻](https://github.com/snipe/snipe-it/commits?author=AL4AL "Code") | [<img src="https://avatars.githubusercontent.com/u/1042587?v=4" width="110px;"/><br /><sub>FliegenKLATSCH</sub>](https://www.ifern.de)<br />[💻](https://github.com/snipe/snipe-it/commits?author=FliegenKLATSCH "Code") | [<img src="https://avatars.githubusercontent.com/u/442138?v=4" width="110px;"/><br /><sub>Jeremy Price</sub>](https://github.com/jerm)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jerm "Code") | [<img src="https://avatars.githubusercontent.com/u/84392209?v=4" width="110px;"/><br /><sub>Toreg87</sub>](https://github.com/Toreg87)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Toreg87 "Code") |
| [<img src="https://avatars.githubusercontent.com/u/67638596?v=4" width="110px;"/><br /><sub>Matthew Nickson</sub>](https://github.com/Computroniks)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Computroniks "Code") | [<img src="https://avatars.githubusercontent.com/u/1646397?v=4" width="110px;"/><br /><sub>Jethro Nederhof</sub>](https://jethron.id.au)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jethron "Code") | [<img src="https://avatars.githubusercontent.com/u/23289826?v=4" width="110px;"/><br /><sub>Oskar Stenberg</sub>](https://github.com/01ste02)<br />[💻](https://github.com/snipe/snipe-it/commits?author=01ste02 "Code") | [<img src="https://avatars.githubusercontent.com/u/82208283?v=4" width="110px;"/><br /><sub>Robert-Azelis</sub>](https://github.com/Robert-Azelis)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Robert-Azelis "Code") | [<img src="https://avatars.githubusercontent.com/u/60648387?v=4" width="110px;"/><br /><sub>Alexander William Smith</sub>](https://github.com/alwism)<br />[💻](https://github.com/snipe/snipe-it/commits?author=alwism "Code") | [<img src="https://avatars.githubusercontent.com/u/24418301?v=4" width="110px;"/><br /><sub>LEITWERK AG</sub>](https://www.leitwerk.de/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=leitwerk-ag "Code") | [<img src="https://avatars.githubusercontent.com/u/1911435?v=4" width="110px;"/><br /><sub>Adam</sub>](http://www.aboutcher.co.uk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=adamboutcher "Code") |
| [<img src="https://avatars.githubusercontent.com/u/16104273?v=4" width="110px;"/><br /><sub>Ian</sub>](https://snksrv.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sneak-it "Code") | [<img src="https://avatars.githubusercontent.com/u/4023909?v=4" width="110px;"/><br /><sub>Shao Yu-Lung (Allen)</sub>](http://blog.bestlong.idv.tw/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=bestlong "Code") | [<img src="https://avatars.githubusercontent.com/u/76475453?v=4" width="110px;"/><br /><sub>Haxatron</sub>](https://github.com/Haxatron)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Haxatron "Code") | [<img src="https://avatars.githubusercontent.com/u/3842948?v=4" width="110px;"/><br /><sub>Bradley Coudriet</sub>](http://bjcpgd.cias.rit.edu)<br />[💻](https://github.com/snipe/snipe-it/commits?author=exula "Code") | [<img src="https://avatars.githubusercontent.com/u/21966173?v=4" width="110px;"/><br /><sub>Dalton Durst</sub>](https://daltondur.st)<br />[💻](https://github.com/snipe/snipe-it/commits?author=UniversalSuperBox "Code") | [<img src="https://avatars.githubusercontent.com/u/48162670?v=4" width="110px;"/><br /><sub>TenOfTens</sub>](https://github.com/TenOfTens)<br />[💻](https://github.com/snipe/snipe-it/commits?author=TenOfTens "Code") | [<img src="https://avatars.githubusercontent.com/u/917232?v=4" width="110px;"/><br /><sub>Simona Avornicesei</sub>](http://www.avornicesei.com)<br />[⚠️](https://github.com/snipe/snipe-it/commits?author=savornicesei "Tests") |
| [<img src="https://avatars.githubusercontent.com/u/19945501?v=4" width="110px;"/><br /><sub>Yevhenii Huzii</sub>](https://github.com/QveenSi)<br />[💻](https://github.com/snipe/snipe-it/commits?author=QveenSi "Code") | [<img src="https://avatars.githubusercontent.com/u/97299851?v=4" width="110px;"/><br /><sub>Christian Weirich</sub>](https://github.com/chrisweirich)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chrisweirich "Code") |
| [<img src="https://avatars.githubusercontent.com/u/1975640?v=4" width="110px;"/><br /><sub>Evan Taylor</sub>](https://github.com/Delta5)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Delta5 "Code") | [<img src="https://avatars.githubusercontent.com/u/8735148?v=4" width="110px;"/><br /><sub>Petri Asikainen</sub>](https://github.com/PetriAsi)<br />[💻](https://github.com/snipe/snipe-it/commits?author=PetriAsi "Code") | [<img src="https://avatars.githubusercontent.com/u/11424540?v=4" width="110px;"/><br /><sub>derdeagle</sub>](https://github.com/derdeagle)<br />[💻](https://github.com/snipe/snipe-it/commits?author=derdeagle "Code") | [<img src="https://avatars.githubusercontent.com/u/176950?v=4" width="110px;"/><br /><sub>Mike Frysinger</sub>](https://wh0rd.org/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vapier "Code") | [<img src="https://avatars.githubusercontent.com/u/22044358?v=4" width="110px;"/><br /><sub>ALPHA</sub>](https://github.com/AL4AL)<br />[💻](https://github.com/snipe/snipe-it/commits?author=AL4AL "Code") | [<img src="https://avatars.githubusercontent.com/u/1042587?v=4" width="110px;"/><br /><sub>FliegenKLATSCH</sub>](https://www.ifern.de)<br />[💻](https://github.com/snipe/snipe-it/commits?author=FliegenKLATSCH "Code") | [<img src="https://avatars.githubusercontent.com/u/442138?v=4" width="110px;"/><br /><sub>Jeremy Price</sub>](https://github.com/jerm)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jerm "Code") |
| [<img src="https://avatars.githubusercontent.com/u/84392209?v=4" width="110px;"/><br /><sub>Toreg87</sub>](https://github.com/Toreg87)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Toreg87 "Code") | [<img src="https://avatars.githubusercontent.com/u/67638596?v=4" width="110px;"/><br /><sub>Matthew Nickson</sub>](https://github.com/Computroniks)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Computroniks "Code") | [<img src="https://avatars.githubusercontent.com/u/1646397?v=4" width="110px;"/><br /><sub>Jethro Nederhof</sub>](https://jethron.id.au)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jethron "Code") | [<img src="https://avatars.githubusercontent.com/u/23289826?v=4" width="110px;"/><br /><sub>Oskar Stenberg</sub>](https://github.com/01ste02)<br />[💻](https://github.com/snipe/snipe-it/commits?author=01ste02 "Code") | [<img src="https://avatars.githubusercontent.com/u/82208283?v=4" width="110px;"/><br /><sub>Robert-Azelis</sub>](https://github.com/Robert-Azelis)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Robert-Azelis "Code") | [<img src="https://avatars.githubusercontent.com/u/60648387?v=4" width="110px;"/><br /><sub>Alexander William Smith</sub>](https://github.com/alwism)<br />[💻](https://github.com/snipe/snipe-it/commits?author=alwism "Code") | [<img src="https://avatars.githubusercontent.com/u/24418301?v=4" width="110px;"/><br /><sub>LEITWERK AG</sub>](https://www.leitwerk.de/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=leitwerk-ag "Code") |
| [<img src="https://avatars.githubusercontent.com/u/1911435?v=4" width="110px;"/><br /><sub>Adam</sub>](http://www.aboutcher.co.uk)<br />[💻](https://github.com/snipe/snipe-it/commits?author=adamboutcher "Code") | [<img src="https://avatars.githubusercontent.com/u/16104273?v=4" width="110px;"/><br /><sub>Ian</sub>](https://snksrv.com)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sneak-it "Code") | [<img src="https://avatars.githubusercontent.com/u/4023909?v=4" width="110px;"/><br /><sub>Shao Yu-Lung (Allen)</sub>](http://blog.bestlong.idv.tw/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=bestlong "Code") | [<img src="https://avatars.githubusercontent.com/u/76475453?v=4" width="110px;"/><br /><sub>Haxatron</sub>](https://github.com/Haxatron)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Haxatron "Code") | [<img src="https://avatars.githubusercontent.com/u/88776392?v=4" width="110px;"/><br /><sub>PlaneNuts</sub>](https://github.com/PlaneNuts)<br />[💻](https://github.com/snipe/snipe-it/commits?author=PlaneNuts "Code") | [<img src="https://avatars.githubusercontent.com/u/3842948?v=4" width="110px;"/><br /><sub>Bradley Coudriet</sub>](http://bjcpgd.cias.rit.edu)<br />[💻](https://github.com/snipe/snipe-it/commits?author=exula "Code") | [<img src="https://avatars.githubusercontent.com/u/21966173?v=4" width="110px;"/><br /><sub>Dalton Durst</sub>](https://daltondur.st)<br />[💻](https://github.com/snipe/snipe-it/commits?author=UniversalSuperBox "Code") |
| [<img src="https://avatars.githubusercontent.com/u/38761237?v=4" width="110px;"/><br /><sub>Alex Janes</sub>](https://adagiohealth.org)<br />[💻](https://github.com/snipe/snipe-it/commits?author=adagioajanes "Code") | [<img src="https://avatars.githubusercontent.com/u/32387849?v=4" width="110px;"/><br /><sub>Nuraeil</sub>](https://github.com/nuraeil)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nuraeil "Code") | [<img src="https://avatars.githubusercontent.com/u/48162670?v=4" width="110px;"/><br /><sub>TenOfTens</sub>](https://github.com/TenOfTens)<br />[💻](https://github.com/snipe/snipe-it/commits?author=TenOfTens "Code") | [<img src="https://avatars.githubusercontent.com/u/9415391?v=4" width="110px;"/><br /><sub>waffle</sub>](https://ditisjens.be/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=insert-waffle "Code") | [<img src="https://avatars.githubusercontent.com/u/19945501?v=4" width="110px;"/><br /><sub>Yevhenii Huzii</sub>](https://github.com/QveenSi)<br />[💻](https://github.com/snipe/snipe-it/commits?author=QveenSi "Code") | [<img src="https://avatars.githubusercontent.com/u/3839381?v=4" width="110px;"/><br /><sub>Achmad Fienan Rahardianto</sub>](https://github.com/veenone)<br />[💻](https://github.com/snipe/snipe-it/commits?author=veenone "Code") | [<img src="https://avatars.githubusercontent.com/u/19945501?v=4" width="110px;"/><br /><sub>Yevhenii Huzii</sub>](https://github.com/QveenSi)<br />[💻](https://github.com/snipe/snipe-it/commits?author=QveenSi "Code") |
| [<img src="https://avatars.githubusercontent.com/u/97299851?v=4" width="110px;"/><br /><sub>Christian Weirich</sub>](https://github.com/chrisweirich)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chrisweirich "Code") | [<img src="https://avatars.githubusercontent.com/u/1294403?v=4" width="110px;"/><br /><sub>denzfarid</sub>](https://github.com/denzfarid)<br /> | [<img src="https://avatars.githubusercontent.com/u/94018771?v=4" width="110px;"/><br /><sub>ntbutler-nbcs</sub>](https://github.com/ntbutler-nbcs)<br />[💻](https://github.com/snipe/snipe-it/commits?author=ntbutler-nbcs "Code") | [<img src="https://avatars.githubusercontent.com/u/172697?v=4" width="110px;"/><br /><sub>Naveen</sub>](https://naveensrinivasan.dev)<br />[💻](https://github.com/snipe/snipe-it/commits?author=naveensrinivasan "Code") | [<img src="https://avatars.githubusercontent.com/u/55674383?v=4" width="110px;"/><br /><sub>Mike Roquemore</sub>](https://github.com/mikeroq)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mikeroq "Code") | [<img src="https://avatars.githubusercontent.com/u/7991086?v=4" width="110px;"/><br /><sub>Daniel Reeder</sub>](https://github.com/reederda)<br />[🌍](#translation-reederda "Translation") [🌍](#translation-reederda "Translation") [💻](https://github.com/snipe/snipe-it/commits?author=reederda "Code") | [<img src="https://avatars.githubusercontent.com/u/109422491?v=4" width="110px;"/><br /><sub>vickyjaura183</sub>](https://github.com/vickyjaura183)<br />[💻](https://github.com/snipe/snipe-it/commits?author=vickyjaura183 "Code") |
| [<img src="https://avatars.githubusercontent.com/u/32363424?v=4" width="110px;"/><br /><sub>Peace</sub>](https://github.com/julian-piehl)<br />[💻](https://github.com/snipe/snipe-it/commits?author=julian-piehl "Code") | [<img src="https://avatars.githubusercontent.com/u/231528?v=4" width="110px;"/><br /><sub>Kyle Gordon</sub>](https://github.com/kylegordon)<br />[💻](https://github.com/snipe/snipe-it/commits?author=kylegordon "Code") | [<img src="https://avatars.githubusercontent.com/u/53009155?v=4" width="110px;"/><br /><sub>Katharina Drexel</sub>](http://www.bfh.ch)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sunflowerbofh "Code") | [<img src="https://avatars.githubusercontent.com/u/1931963?v=4" width="110px;"/><br /><sub>David Sferruzza</sub>](https://david.sferruzza.fr/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dsferruzza "Code") | [<img src="https://avatars.githubusercontent.com/u/19511639?v=4" width="110px;"/><br /><sub>Rick Nelson</sub>](https://github.com/rnelsonee)<br />[💻](https://github.com/snipe/snipe-it/commits?author=rnelsonee "Code") | [<img src="https://avatars.githubusercontent.com/u/94169344?v=4" width="110px;"/><br /><sub>BasO12</sub>](https://github.com/BasO12)<br />[💻](https://github.com/snipe/snipe-it/commits?author=BasO12 "Code") | [<img src="https://avatars.githubusercontent.com/u/111710123?v=4" width="110px;"/><br /><sub>Vautia</sub>](https://github.com/Vautia)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Vautia "Code") |
| [<img src="https://avatars.githubusercontent.com/u/28321?v=4" width="110px;"/><br /><sub>Chris Hartjes</sub>](http://www.littlehart.net/atthekeyboard)<br />[💻](https://github.com/snipe/snipe-it/commits?author=chartjes "Code") | [<img src="https://avatars.githubusercontent.com/u/2404584?v=4" width="110px;"/><br /><sub>geo-chen</sub>](https://github.com/geo-chen)<br />[💻](https://github.com/snipe/snipe-it/commits?author=geo-chen "Code") | [<img src="https://avatars.githubusercontent.com/u/6006620?v=4" width="110px;"/><br /><sub>Phan Nguyen</sub>](https://github.com/nh314)<br />[💻](https://github.com/snipe/snipe-it/commits?author=nh314 "Code") | [<img src="https://avatars.githubusercontent.com/u/115993812?v=4" width="110px;"/><br /><sub>Iisakki Jaakkola</sub>](https://github.com/StarlessNights)<br />[💻](https://github.com/snipe/snipe-it/commits?author=StarlessNights "Code") | [<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="110px;"/><br /><sub>Ikko Ashimine</sub>](https://bandism.net/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=eltociear "Code") | [<img src="https://avatars.githubusercontent.com/u/56871540?v=4" width="110px;"/><br /><sub>Lukas Fehling</sub>](https://github.com/lukasfehling)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lukasfehling "Code") | [<img src="https://avatars.githubusercontent.com/u/1975990?v=4" width="110px;"/><br /><sub>Fernando Almeida</sub>](https://github.com/fernando-almeida)<br />[💻](https://github.com/snipe/snipe-it/commits?author=fernando-almeida "Code") |
| [<img src="https://avatars.githubusercontent.com/u/116301219?v=4" width="110px;"/><br /><sub>akemidx</sub>](https://github.com/akemidx)<br />[💻](https://github.com/snipe/snipe-it/commits?author=akemidx "Code") | [<img src="https://avatars.githubusercontent.com/u/144778?v=4" width="110px;"/><br /><sub>Oguz Bilgic</sub>](http://oguz.site)<br />[💻](https://github.com/snipe/snipe-it/commits?author=oguzbilgic "Code") | [<img src="https://avatars.githubusercontent.com/u/9262438?v=4" width="110px;"/><br /><sub>Scooter Crawford</sub>](https://github.com/scoo73r)<br />[💻](https://github.com/snipe/snipe-it/commits?author=scoo73r "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

65
TESTING.md Normal file
View File

@@ -0,0 +1,65 @@
# Using the Test Suite
This document is targeted at developers looking to make modifications to
this application's code base and want to run the existing test suite.
## Setup
Follow the instructions for installing the application locally,
making sure to have also run the [database migrations](link to db migrations).
## Unit Tests
The application will use values in the `.env.testing` file located
in the root directory to override the
default settings and/or other values that exist in your `.env` files.
Make sure to modify the section in `.env.testing` that has the
database settings. In the example below, it is connecting to the
[MariaDB](link-to-maria-db) server that is used if you install the
application using [Docker](https://docker.com).
```dotenv
# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=snipeit
DB_USERNAME=root
DB_PASSWORD=changeme1234
```
To run the entire unit test suite, use the following command from your terminal:
`php artisan test --env=testing`
To run individual test files, you can pass the path to the test that
you want to run.
`php artisan test --env=testing tests/Unit/AccessoryTest.php`
## Browser Tests
The browser tests use [Dusk](https://laravel.com/docs/8.x/dusk) to run them.
When troubleshooting any problems, make sure that your `.env` file is configured
correctly to run the existing application.
### Test Setup
Your application needs to be configued and up and running in order for the browser
tests to actually run. When running the tests locally, you can start the application
using the following command:
`php artisan serve`
To run the test suite use the following command from another terminal tab or window:
`php artisan dusk`
To run individual test files, you can pass the path to the test that you want to run.
`php artisan dusk tests/Browser/LoginTest.php`

View File

@@ -118,7 +118,7 @@
"description": "The duration (in seconds) that the user should be blocked from attempting to authenticate again.",
"value": "60"
},
"APP_LOG": {
"LOG_CHANNEL": {
"description": "Driver to send logs to. (errorlog for stderr)",
"value": "errorlog"
},
@@ -148,7 +148,7 @@
"image": "heroku/php",
"addons": [
"cleardb:ignite",
"heroku-redis:hobby-dev",
"heroku-redis:mini",
"papertrail:choklad"
]
}
}

View File

@@ -2,10 +2,10 @@
namespace App\Console\Commands;
use App\Models\LicenseSeat;
use Illuminate\Console\Command;
use App\Models\User;
use App\Models\License;
use App\Models\LicenseSeat;
use App\Models\User;
use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Model;
class CheckinLicensesFromAllUsers extends Command
@@ -41,55 +41,48 @@ class CheckinLicensesFromAllUsers extends Command
*/
public function handle()
{
$license_id = $this->option('license_id');
$notify = $this->option('notify');
if (!$license_id) {
if (! $license_id) {
$this->error('ERROR: License ID is required.');
return false;
}
if (!$license = License::where('id','=',$license_id)->first()) {
if (! $license = License::where('id', '=', $license_id)->first()) {
$this->error('Invalid license ID');
return false;
}
$this->info('Checking in ALL seats for '.$license->name);
$licenseSeats = LicenseSeat::where('license_id', '=', $license_id)
->whereNotNull('assigned_to')
->with('user')
->get();
$this->info(' There are ' .$licenseSeats->count(). ' seats checked out: ');
$this->info(' There are '.$licenseSeats->count().' seats checked out: ');
if (!$notify) {
if (! $notify) {
$this->info('No mail will be sent.');
}
foreach ($licenseSeats as $seat) {
$this->info($seat->user->username .' has a license seat for '.$license->name);
$this->info($seat->user->username.' has a license seat for '.$license->name);
$seat->assigned_to = null;
if ($seat->save()) {
// Override the email address so we don't notify on checkin
if (!$notify) {
if (! $notify) {
$seat->user->email = null;
}
// Log the checkin
$seat->logCheckin($seat->user, 'Checked in via cli tool');
}
}
}
}

View File

@@ -2,10 +2,10 @@
namespace App\Console\Commands;
use App\Models\LicenseSeat;
use Illuminate\Console\Command;
use App\Models\User;
use App\Models\License;
use App\Models\LicenseSeat;
use App\Models\User;
use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Model;
class CheckoutLicenseToAllUsers extends Command
@@ -22,7 +22,7 @@ class CheckoutLicenseToAllUsers extends Command
*
* @var string
*/
protected $description = 'Command description';
protected $description = 'Checks out licenses to all users';
/**
* Create a new command instance.
@@ -41,18 +41,18 @@ class CheckoutLicenseToAllUsers extends Command
*/
public function handle()
{
$license_id = $this->option('license_id');
$notify = $this->option('notify');
if (!$license_id) {
$this->error('ERROR: License ID is required.');
return false;
if (! $license_id) {
$this->error('ERROR: License ID is required.');
return false;
}
if (!$license = License::where('id','=',$license_id)->with('assignedusers')->first()) {
if (! $license = License::where('id', '=', $license_id)->with('assignedusers')->first()) {
$this->error('Invalid license ID');
return false;
}
@@ -64,7 +64,7 @@ class CheckoutLicenseToAllUsers extends Command
$this->info('Checking out '.$users->count().' of '.$license->getAvailSeatsCountAttribute().' seats for '.$license->name);
if (!$notify) {
if (! $notify) {
$this->info('No mail will be sent.');
}
@@ -74,14 +74,14 @@ class CheckoutLicenseToAllUsers extends Command
// to them
if ($user->licenses->where('id', '=', $license_id)->count()) {
$this->info($user->username .' already has this license checked out to them. Skipping... ');
$this->info($user->username.' already has this license checked out to them. Skipping... ');
continue;
}
// If the license is valid, check that there is an available seat
if ($license->availCount()->count() < 1) {
$this->error('ERROR: No available seats');
return false;
}
@@ -89,13 +89,12 @@ class CheckoutLicenseToAllUsers extends Command
// Get the seat ID
$licenseSeat = $license->freeSeat();
// Update the seat with checkout info,
$licenseSeat->assigned_to = $user->id;
$licenseSeat->assigned_to = $user->id;
if ($licenseSeat->save()) {
// Temporarily null the user's email address so we don't send mail if we're not supposed to
if (!$notify) {
if (! $notify) {
$user->email = null;
}
@@ -103,10 +102,6 @@ class CheckoutLicenseToAllUsers extends Command
$licenseSeat->logCheckout('Checked out via cli tool', $user);
$this->info('License '.$license_id.' seat '.$licenseSeat->id.' checked out to '.$user->username);
}
}
}
}

View File

@@ -37,7 +37,6 @@ class CreateAdmin extends Command
*/
public function handle()
{
$first_name = $this->option('first_name');
$last_name = $this->option('last_name');
$username = $this->option('username');
@@ -45,7 +44,7 @@ class CreateAdmin extends Command
$password = $this->option('password');
$show_in_list = $this->argument('show_in_list');
if (($first_name=='') || ($last_name=='') || ($username=='') || ($email=='') || ($password=='')) {
if (($first_name == '') || ($last_name == '') || ($username == '') || ($email == '') || ($password == '')) {
$this->info('ERROR: All fields are required.');
} else {
$user = new \App\Models\User;
@@ -68,12 +67,9 @@ class CreateAdmin extends Command
$errors = $user->getErrors();
foreach ($errors->all() as $error) {
$this->info('ERROR:'. $error);
$this->info('ERROR:'.$error);
}
}
}
}
}

View File

@@ -38,9 +38,7 @@ class DisableLDAP extends Command
*/
public function handle()
{
if ($this->confirm("\n****************************************************\nThis will disable LDAP support. You will not be able \nto login with an account that does not exist \nlocally in the Snipe-IT local database. \n****************************************************\n\nDo you wish to continue? [y|N]")) {
$setting = Setting::getSettings();
$setting->ldap_enabled = 0;
if ($setting->save()) {
@@ -51,6 +49,5 @@ class DisableLDAP extends Command
} else {
$this->info('Canceled. No actions taken.');
}
}
}

View File

@@ -37,53 +37,43 @@ class FixDoubleEscape extends Command
*/
public function handle()
{
$tables = [
'\App\Models\Asset' => ['name'],
'\App\Models\License' => ['name', 'license_name'],
'\App\Models\Consumable' => ['name'],
'\App\Models\Accessory' => ['name'],
'\App\Models\Component' => ['name'],
'\App\Models\Company' => ['name'],
'\App\Models\Manufacturer' => ['name'],
'\App\Models\Supplier' => ['name'],
'\App\Models\Statuslabel' => ['name'],
'\App\Models\Depreciation' => ['name'],
'\App\Models\AssetModel' => ['name'],
'\App\Models\Group' => ['name'],
'\App\Models\Department' => ['name'],
'\App\Models\Location' => ['name'],
'\App\Models\User' => ['first_name', 'last_name', 'jobtitle'],
\App\Models\Asset::class => ['name'],
\App\Models\License::class => ['name'],
\App\Models\Consumable::class => ['name'],
\App\Models\Accessory::class => ['name'],
\App\Models\Component::class => ['name'],
\App\Models\Company::class => ['name'],
\App\Models\Manufacturer::class => ['name'],
\App\Models\Supplier::class => ['name'],
\App\Models\Statuslabel::class => ['name'],
\App\Models\Depreciation::class => ['name'],
\App\Models\AssetModel::class => ['name'],
\App\Models\Group::class => ['name'],
\App\Models\Department::class => ['name'],
\App\Models\Location::class => ['name'],
\App\Models\User::class => ['first_name', 'last_name'],
];
$count = array();
$count = [];
foreach ($tables as $classname => $fields) {
$count[$classname] = [];
$count[$classname]['classname'] = 0;
foreach ($fields as $field) {
$count[$classname]['classname']++;
$count[$classname][$field] = 0;
foreach ($tables as $classname => $fields) {
$count[$classname] = array();
$count[$classname]['classname'] = 0;
foreach($fields as $field) {
$count[$classname]['classname']++;
$count[$classname][$field] = 0;
foreach($classname::where("$field",'LIKE','%;%')->get() as $row) {
$fixed = html_entity_decode($row->{$field});
if ($row->save()) {
$this->info('Updating '.$field.' for '.$classname.' to '.$row->{$field}.' to '.$fixed);
} else {
$this->error('Could NOT update '.$field.' for '.$classname.' to '.$row->{$field}.' to '.$fixed.': '.$row->getErrors());
}
$count[$classname][$field]++;
}
foreach ($classname::where("$field", 'LIKE', '%&%')->get() as $row) {
$this->info('Updating '.$field.' for '.$classname);
$row->{$field} = html_entity_decode($row->{$field}, ENT_QUOTES);
$row->save();
$count[$classname][$field]++;
}
}
}
$this->info('Update complete');
}
}

View File

@@ -29,7 +29,6 @@ class FixMismatchedAssetsAndLogs extends Command
*/
private $dryrun = false;
/**
* Create a new command instance.
*
@@ -47,30 +46,29 @@ class FixMismatchedAssetsAndLogs extends Command
*/
public function handle()
{
if ($this->option('dryrun')) {
$this->dryrun = true;
}
if ($this->dryrun) {
$this->info('This is a DRY RUN - no changes will be saved.' );
$this->info('This is a DRY RUN - no changes will be saved.');
}
$mismatch_count = 0;
$assets = Asset::whereNotNull('assigned_to')
->where('assigned_type', '=', 'App\\Models\\User')
->where('assigned_type', '=', \App\Models\User::class)
->orderBy('id', 'ASC')->get();
foreach ($assets as $asset) {
// get the last checkout of the asset
if ($checkout_log = Actionlog::where('target_type', '=', 'App\\Models\\User')
if ($checkout_log = Actionlog::where('target_type', '=', \App\Models\User::class)
->where('action_type', '=', 'checkout')
->where('item_id', '=', $asset->id)
->orderBy('created_at', 'DESC')
->first()) {
// Now check for a subsequent checkin log - we want to ignore those
if (!$checkin_log = Actionlog::where('target_type', '=', 'App\\Models\\User')
if (! $checkin_log = Actionlog::where('target_type', '=', \App\Models\User::class)
->where('action_type', '=', 'checkin from')
->where('item_id', '=', $asset->id)
->whereDate('created_at', '>', $checkout_log->created_at)
@@ -78,28 +76,24 @@ class FixMismatchedAssetsAndLogs extends Command
->first()) {
//print_r($asset);
if ($checkout_log->target_id != $asset->assigned_to) {
$this->error('Log ID: '.$checkout_log->id.' -- Asset ID '. $checkout_log->item_id.' SHOULD BE checked out to User '.$checkout_log->target_id.' but its assigned_to is '.$asset->assigned_to );
if ($checkout_log->target_id != $asset->assigned_to) {
$this->error('Log ID: '.$checkout_log->id.' -- Asset ID '.$checkout_log->item_id.' SHOULD BE checked out to User '.$checkout_log->target_id.' but its assigned_to is '.$asset->assigned_to);
if (!$this->dryrun) {
$asset->assigned_to = $checkout_log->target_id;
if ($asset->save()) {
$this->info('Asset record updated.');
} else {
$this->error('Error updating asset: '.$asset->getErrors());
}
if (! $this->dryrun) {
$asset->assigned_to = $checkout_log->target_id;
if ($asset->save()) {
$this->info('Asset record updated.');
} else {
$this->error('Error updating asset: '.$asset->getErrors());
}
$mismatch_count++;
}
} else {
//$this->info('Asset ID '.$asset->id.': There is a checkin '.$checkin_log->created_at.' after this checkout '.$checkout_log->created_at);
$mismatch_count++;
}
} else {
//$this->info('Asset ID '.$asset->id.': There is a checkin '.$checkin_log->created_at.' after this checkout '.$checkout_log->created_at);
}
}
}
$this->info($mismatch_count.' mismatched assets.');
}
}

View File

@@ -0,0 +1,97 @@
<?php
namespace App\Console\Commands;
use App\Helpers\Helper;
use Illuminate\Console\Command;
use App\Models\User;
use Laravel\Passport\TokenRepository;
use Illuminate\Contracts\Validation\Factory as ValidationFactory;
use DB;
class GeneratePersonalAccessToken extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:make-api-key
{--user_id= : The ID of the user to create the token for.}
{--name= : The name of the new API token}
{--key-only : Only return the value of the API key}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This console command allows you to generate Personal API tokens to be used with the Snipe-IT JSON REST API on behalf of a user.';
/**
* The token repository implementation.
*
* @var \Laravel\Passport\TokenRepository
*/
protected $tokenRepository;
/**
* Create a new command instance.
*
* @return void
*/
public function __construct(TokenRepository $tokenRepository, ValidationFactory $validation)
{
$this->validation = $validation;
$this->tokenRepository = $tokenRepository;
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$accessTokenName = $this->option('name');
if ($accessTokenName=='') {
$accessTokenName = 'CLI Auth Token';
}
if ($this->option('user_id')=='') {
return $this->error('ERROR: user_id cannot be blank.');
}
if ($user = User::find($this->option('user_id'))) {
$createAccessToken = $user->createToken($accessTokenName)->accessToken;
if ($this->option('key-only')) {
$this->info($createAccessToken);
} else {
$this->warn('Your API Token has been created. Be sure to copy this token now, as it will not be accessible again.');
if ($token = DB::table('oauth_access_tokens')->where('user_id', '=', $user->id)->where('name','=',$accessTokenName)->orderBy('created_at', 'desc')->first()) {
$this->info('API Token ID: '.$token->id);
}
$this->info('API Token User: '.$user->present()->fullName.' ('.$user->username.')');
$this->info('API Token Name: '.$accessTokenName);
$this->info('API Token: '.$createAccessToken);
}
} else {
return $this->error('ERROR: Invalid user. API key was not created.');
}
}
}

View File

@@ -2,9 +2,9 @@
namespace App\Console\Commands;
use App\Models\Location;
use Illuminate\Console\Command;
use League\Csv\Reader;
use App\Models\Location;
class ImportLocations extends Command
{
@@ -39,10 +39,8 @@ class ImportLocations extends Command
*/
public function handle()
{
if (!ini_get("auto_detect_line_endings")) {
ini_set("auto_detect_line_endings", '1');
if (! ini_get('auto_detect_line_endings')) {
ini_set('auto_detect_line_endings', '1');
}
$filename = $this->argument('filename');
@@ -53,18 +51,17 @@ class ImportLocations extends Command
// Import parent location names first if they don't exist
foreach ($results as $parent_index => $parent_row) {
if (array_key_exists('Parent Name', $parent_row)) {
$parent_name = trim($parent_row['Parent Name']);
if (array_key_exists('Name', $parent_row)) {
$this->info('- Parent: ' . $parent_name . ' in row as: ' . trim($parent_row['Parent Name']));
$this->info('- Parent: '.$parent_name.' in row as: '.trim($parent_row['Parent Name']));
}
// Save parent location name
// This creates a sort of name-stub that we'll update later on in this script
$parent_location = Location::firstOrCreate(array('name' => $parent_name));
$parent_location = Location::firstOrCreate(['name' => $parent_name]);
if (array_key_exists('Name', $parent_row)) {
$this->info('Parent for ' . $parent_row['Name'] . ' is ' . $parent_name . '. Attempting to save ' . $parent_name . '.');
$this->info('Parent for '.$parent_row['Name'].' is '.$parent_name.'. Attempting to save '.$parent_name.'.');
}
// Check if the record was updated or created.
@@ -74,18 +71,15 @@ class ImportLocations extends Command
} else {
$this->info('- Parent location '.$parent_name.' was created.');
}
} else {
$this->info('- No Parent Name provided, so no parent location will be created.');
}
}
$this->info('----- Parents Created.... backfilling additional details... --------');
// Loop through ALL records and add/update them if there are additional fields
// besides name
foreach ($results as $index => $row) {
if (array_key_exists('Parent Name', $row)) {
$parent_name = trim($row['Parent Name']);
} else {
@@ -94,11 +88,12 @@ class ImportLocations extends Command
// Set the location attributes to save
if (array_key_exists('Name', $row)) {
$location = Location::firstOrCreate(array('name' => trim($row['Name'])));
$location = Location::firstOrCreate(['name' => trim($row['Name'])]);
$location->name = trim($row['Name']);
$this->info('Checking location: '.$location->name);
} else {
$this->error('Location name is required and is missing from at least one row in this dataset. Check your CSV for extra trailing rows and try again.');
return false;
}
if (array_key_exists('Currency', $row)) {
@@ -126,7 +121,6 @@ class ImportLocations extends Command
$location->ldap_ou = trim($row['OU']);
}
// If a parent name is provided, we created it earlier in the script,
// so let's grab that ID
if ($parent_name) {
@@ -142,21 +136,15 @@ class ImportLocations extends Command
// Check if the record was updated or created.
// This is mostly for clearer debugging.
if ($location->exists) {
$this->info('Location ' . $location->name . ' already exists. Updating...');
$this->info('Location '.$location->name.' already exists. Updating...');
} else {
$this->info('- Location '.$location->name.' was created. ');
}
// If there's a validation error, display that
// If there's a validation error, display that
} else {
$this->error('- Non-parent Location '.$location->name.' could not be created: '.$location->getErrors() );
$this->error('- Non-parent Location '.$location->name.' could not be created: '.$location->getErrors());
}
}
}
}

View File

@@ -3,6 +3,7 @@
namespace App\Console\Commands;
use App\Models\Department;
use App\Models\Group;
use Illuminate\Console\Command;
use App\Models\Setting;
use App\Models\Ldap;
@@ -17,7 +18,7 @@ class LdapSync extends Command
*
* @var string
*/
protected $signature = 'snipeit:ldap-sync {--location=} {--location_id=} {--base_dn=} {--summary} {--json_summary}';
protected $signature = 'snipeit:ldap-sync {--location=} {--location_id=} {--base_dn=} {--filter=} {--summary} {--json_summary}';
/**
* The console command description.
@@ -54,22 +55,25 @@ class LdapSync extends Command
$ldap_result_email = Setting::getSettings()->ldap_email;
$ldap_result_phone = Setting::getSettings()->ldap_phone_field;
$ldap_result_jobtitle = Setting::getSettings()->ldap_jobtitle;
$ldap_result_country = Setting::getSettings()->ldap_country;
$ldap_result_country = Setting::getSettings()->ldap_country;
$ldap_result_dept = Setting::getSettings()->ldap_dept;
$ldap_result_manager = Setting::getSettings()->ldap_manager;
$ldap_default_group = Setting::getSettings()->ldap_default_group;
try {
$ldapconn = Ldap::connectToLdap();
Ldap::bindAdminToLdap($ldapconn);
} catch (\Exception $e) {
if ($this->option('json_summary')) {
$json_summary = [ "error" => true, "error_message" => $e->getMessage(), "summary" => [] ];
$json_summary = ['error' => true, 'error_message' => $e->getMessage(), 'summary' => []];
$this->info(json_encode($json_summary));
}
LOG::info($e);
return [];
}
$summary = array();
$summary = [];
try {
if ($this->option('base_dn') != '') {
@@ -78,81 +82,85 @@ class LdapSync extends Command
} else {
$search_base = null;
}
$results = Ldap::findLdapUsers($search_base);
if ($this->option('filter') != '') {
$results = Ldap::findLdapUsers($search_base, -1, $this->option('filter'));
} else {
$results = Ldap::findLdapUsers($search_base);
}
} catch (\Exception $e) {
if ($this->option('json_summary')) {
$json_summary = [ "error" => true, "error_message" => $e->getMessage(), "summary" => [] ];
$json_summary = ['error' => true, 'error_message' => $e->getMessage(), 'summary' => []];
$this->info(json_encode($json_summary));
}
LOG::info($e);
return [];
}
/* Determine which location to assign users to by default. */
$location = NULL; // FIXME - this would be better called "$default_location", which is more explicit about its purpose
$location = null; // TODO - this would be better called "$default_location", which is more explicit about its purpose
if ($this->option('location')!='') {
if ($this->option('location') != '') {
$location = Location::where('name', '=', $this->option('location'))->first();
LOG::debug('Location name '.$this->option('location').' passed');
LOG::debug('Importing to '.$location->name.' ('.$location->id.')');
} elseif ($this->option('location_id')!='') {
} elseif ($this->option('location_id') != '') {
$location = Location::where('id', '=', $this->option('location_id'))->first();
LOG::debug('Location ID '.$this->option('location_id').' passed');
LOG::debug('Importing to '.$location->name.' ('.$location->id.')');
}
if (!isset($location)) {
if (! isset($location)) {
LOG::debug('That location is invalid or a location was not provided, so no location will be assigned by default.');
}
/* Process locations with explicitly defined OUs, if doing a full import. */
if ($this->option('base_dn')=='') {
if ($this->option('base_dn') == '' && $this->option('filter') == '') {
// Retrieve locations with a mapped OU, and sort them from the shallowest to deepest OU (see #3993)
$ldap_ou_locations = Location::where('ldap_ou', '!=', '')->get()->toArray();
$ldap_ou_lengths = array();
$ldap_ou_lengths = [];
foreach ($ldap_ou_locations as $ou_loc) {
$ldap_ou_lengths[] = strlen($ou_loc["ldap_ou"]);
$ldap_ou_lengths[] = strlen($ou_loc['ldap_ou']);
}
array_multisort($ldap_ou_lengths, SORT_ASC, $ldap_ou_locations);
if (sizeof($ldap_ou_locations) > 0) {
if (count($ldap_ou_locations) > 0) {
LOG::debug('Some locations have special OUs set. Locations will be automatically set for users in those OUs.');
}
// Inject location information fields
for ($i = 0; $i < $results["count"]; $i++) {
$results[$i]["ldap_location_override"] = false;
$results[$i]["location_id"] = 0;
for ($i = 0; $i < $results['count']; $i++) {
$results[$i]['ldap_location_override'] = false;
$results[$i]['location_id'] = 0;
}
// Grab subsets based on location-specific DNs, and overwrite location for these users.
foreach ($ldap_ou_locations as $ldap_loc) {
try {
$location_users = Ldap::findLdapUsers($ldap_loc["ldap_ou"]);
} catch (\Exception $e) { // FIXME: this is stolen from line 77 or so above
$location_users = Ldap::findLdapUsers($ldap_loc['ldap_ou']);
} catch (\Exception $e) { // TODO: this is stolen from line 77 or so above
if ($this->option('json_summary')) {
$json_summary = [ "error" => true, "error_message" => trans('admin/users/message.error.ldap_could_not_search')." Location: ".$ldap_loc['name']." (ID: ".$ldap_loc['id'].") cannot connect to \"".$ldap_loc["ldap_ou"]."\" - ".$e->getMessage(), "summary" => [] ];
$json_summary = ['error' => true, 'error_message' => trans('admin/users/message.error.ldap_could_not_search').' Location: '.$ldap_loc['name'].' (ID: '.$ldap_loc['id'].') cannot connect to "'.$ldap_loc['ldap_ou'].'" - '.$e->getMessage(), 'summary' => []];
$this->info(json_encode($json_summary));
}
LOG::info($e);
return [];
}
$usernames = array();
for ($i = 0; $i < $location_users["count"]; $i++) {
$usernames = [];
for ($i = 0; $i < $location_users['count']; $i++) {
if (array_key_exists($ldap_result_username, $location_users[$i])) {
$location_users[$i]["ldap_location_override"] = true;
$location_users[$i]["location_id"] = $ldap_loc["id"];
$location_users[$i]['ldap_location_override'] = true;
$location_users[$i]['location_id'] = $ldap_loc['id'];
$usernames[] = $location_users[$i][$ldap_result_username][0];
}
}
// Delete located users from the general group.
foreach ($results as $key => $generic_entry) {
if ((is_array($generic_entry)) && (array_key_exists($ldap_result_username, $generic_entry))) {
if ((is_array($generic_entry)) && (array_key_exists($ldap_result_username, $generic_entry))) {
if (in_array($generic_entry[$ldap_result_username][0], $usernames)) {
unset($results[$key]);
}
@@ -166,53 +174,101 @@ class LdapSync extends Command
}
/* Create user account entries in Snipe-IT */
$tmp_pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20);
$tmp_pass = substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 20);
$pass = bcrypt($tmp_pass);
for ($i = 0; $i < $results["count"]; $i++) {
$manager_cache = [];
$item = array();
$item["username"] = isset($results[$i][$ldap_result_username][0]) ? $results[$i][$ldap_result_username][0] : "";
$item["employee_number"] = isset($results[$i][$ldap_result_emp_num][0]) ? $results[$i][$ldap_result_emp_num][0] : "";
$item["lastname"] = isset($results[$i][$ldap_result_last_name][0]) ? $results[$i][$ldap_result_last_name][0] : "";
$item["firstname"] = isset($results[$i][$ldap_result_first_name][0]) ? $results[$i][$ldap_result_first_name][0] : "";
$item["email"] = isset($results[$i][$ldap_result_email][0]) ? $results[$i][$ldap_result_email][0] : "" ;
$item["ldap_location_override"] = isset($results[$i]["ldap_location_override"]) ? $results[$i]["ldap_location_override"]:"";
$item["location_id"] = isset($results[$i]["location_id"]) ? $results[$i]["location_id"]:"";
$item["telephone"] = isset($results[$i][$ldap_result_phone][0]) ? $results[$i][$ldap_result_phone][0] : "";
$item["jobtitle"] = isset($results[$i][$ldap_result_jobtitle][0]) ? $results[$i][$ldap_result_jobtitle][0] : "";
$item["country"] = isset($results[$i][$ldap_result_country][0]) ? $results[$i][$ldap_result_country][0] : "";
$item["department"] = isset($results[$i][$ldap_result_dept][0]) ? $results[$i][$ldap_result_dept][0] : "";
for ($i = 0; $i < $results['count']; $i++) {
$item = [];
$item['username'] = isset($results[$i][$ldap_result_username][0]) ? $results[$i][$ldap_result_username][0] : '';
$item['employee_number'] = isset($results[$i][$ldap_result_emp_num][0]) ? $results[$i][$ldap_result_emp_num][0] : '';
$item['lastname'] = isset($results[$i][$ldap_result_last_name][0]) ? $results[$i][$ldap_result_last_name][0] : '';
$item['firstname'] = isset($results[$i][$ldap_result_first_name][0]) ? $results[$i][$ldap_result_first_name][0] : '';
$item['email'] = isset($results[$i][$ldap_result_email][0]) ? $results[$i][$ldap_result_email][0] : '';
$item['ldap_location_override'] = isset($results[$i]['ldap_location_override']) ? $results[$i]['ldap_location_override'] : '';
$item['location_id'] = isset($results[$i]['location_id']) ? $results[$i]['location_id'] : '';
$item['telephone'] = isset($results[$i][$ldap_result_phone][0]) ? $results[$i][$ldap_result_phone][0] : '';
$item['jobtitle'] = isset($results[$i][$ldap_result_jobtitle][0]) ? $results[$i][$ldap_result_jobtitle][0] : '';
$item['country'] = isset($results[$i][$ldap_result_country][0]) ? $results[$i][$ldap_result_country][0] : '';
$item['department'] = isset($results[$i][$ldap_result_dept][0]) ? $results[$i][$ldap_result_dept][0] : '';
$item['manager'] = isset($results[$i][$ldap_result_manager][0]) ? $results[$i][$ldap_result_manager][0] : '';
$department = Department::firstOrCreate([
'name' => $item["department"],
'name' => $item['department'],
]);
$user = User::where('username', $item["username"])->first();
$user = User::where('username', $item['username'])->first();
if ($user) {
// Updating an existing user.
$item["createorupdate"] = 'updated';
$item['createorupdate'] = 'updated';
} else {
// Creating a new user.
$user = new User;
$user->password = $pass;
$user->activated = 1; // newly created users can log in by default, unless AD's UAC is in use, or an active flag is set (below)
$item["createorupdate"] = 'created';
$item['createorupdate'] = 'created';
}
$user->first_name = $item["firstname"];
$user->last_name = $item["lastname"];
$user->username = $item["username"];
$user->email = $item["email"];
$user->employee_num = e($item["employee_number"]);
$user->phone = $item["telephone"];
$user->jobtitle = $item["jobtitle"];
$user->country = $item["country"];
$user->first_name = $item['firstname'];
$user->last_name = $item['lastname'];
$user->username = $item['username'];
$user->email = $item['email'];
$user->employee_num = e($item['employee_number']);
$user->phone = $item['telephone'];
$user->jobtitle = $item['jobtitle'];
$user->country = $item['country'];
$user->department_id = $department->id;
if($ldap_default_group != null) {
$default = Group::select()->where('id', $ldap_default_group)->first();
$user->permissions = $default->permissions;
}
if($item['manager'] != null) {
// Check Cache first
if (isset($manager_cache[$item['manager']])) {
// found in cache; use that and avoid extra lookups
$user->manager_id = $manager_cache[$item['manager']];
} else {
// Get the LDAP Manager
try {
$ldap_manager = Ldap::findLdapUsers($item['manager'], -1, $this->option('filter'));
} catch (\Exception $e) {
\Log::warning("Manager lookup caused an exception: " . $e->getMessage() . ". Falling back to direct username lookup");
// Hail-mary for Okta manager 'shortnames' - will only work if
// Okta configuration is using full email-address-style usernames
$ldap_manager = [
"count" => 1,
0 => [
$ldap_result_username => [$item['manager']]
]
];
}
if ($ldap_manager["count"] > 0) {
// Get the Manager's username
// PHP LDAP returns every LDAP attribute as an array, and 90% of the time it's an array of just one item. But, hey, it's an array.
$ldapManagerUsername = $ldap_manager[0][$ldap_result_username][0];
// Get User from Manager username.
$ldap_manager = User::where('username', $ldapManagerUsername)->first();
if ($ldap_manager && isset($ldap_manager->id)) {
// Link user to manager id.
$user->manager_id = $ldap_manager->id;
}
}
$manager_cache[$item['manager']] = $ldap_manager && isset($ldap_manager->id) ? $ldap_manager->id : null; // Store results in cache, even if 'failed'
}
}
// Sync activated state for Active Directory.
if ( !empty($ldap_result_active_flag)) { // IF we have an 'active' flag set....
// ....then *most* things that are truthy will activate the user. Anything falsey will deactivate them.
// (Specifically, we don't handle a value of '0.0' correctly)
@@ -222,11 +278,12 @@ class LdapSync extends Command
$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]) ) {
} elseif (array_key_exists('useraccountcontrol', $results[$i]) ) {
// ....otherwise, (ie if no 'active' LDAP flag is defined), IF the UAC setting exists,
// ....then use the UAC setting on the account to determine can-log-in vs. cannot-log-in
/* The following is _probably_ the correct logic, but we can't use it because
/* The following is _probably_ the correct logic, but we can't use it because
some users may have been dependent upon the previous behavior, and this
could cause additional access to be available to users they don't want
to allow to log in.
@@ -242,7 +299,7 @@ class LdapSync extends Command
} else {
$user->activated = 0;
} */
$enabled_accounts = [
$enabled_accounts = [
'512', // 0x200 NORMAL_ACCOUNT
'544', // 0x220 NORMAL_ACCOUNT, PASSWD_NOTREQD
'66048', // 0x10200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD
@@ -251,25 +308,25 @@ class LdapSync extends Command
'262688', // 0x40220 NORMAL_ACCOUNT, PASSWD_NOTREQD, SMARTCARD_REQUIRED
'328192', // 0x50200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD
'328224', // 0x50220 NORMAL_ACCOUNT, PASSWD_NOT_REQD, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD
'4194816',// 0x400200 NORMAL_ACCOUNT, DONT_REQ_PREAUTH
'4260352',// 0x410200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD, DONT_REQ_PREAUTH
'1049088',// 0x100200 NORMAL_ACCOUNT, NOT_DELEGATED
'4194816',// 0x400200 NORMAL_ACCOUNT, DONT_REQ_PREAUTH
'4260352', // 0x410200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD, DONT_REQ_PREAUTH
'1049088', // 0x100200 NORMAL_ACCOUNT, NOT_DELEGATED
];
$user->activated = ( in_array($results[$i]['useraccountcontrol'][0], $enabled_accounts) ) ? 1 : 0;
$user->activated = (in_array($results[$i]['useraccountcontrol'][0], $enabled_accounts)) ? 1 : 0;
// If we're not using AD, and there isn't an activated flag set, activate all users
} /* implied 'else' here - leave the $user->activated flag alone. Newly-created accounts will be active.
already-existing accounts will be however the administrator has set them */
already-existing accounts will be however the administrator has set them */
if ($item['ldap_location_override'] == true) {
$user->location_id = $item['location_id'];
} elseif ((isset($location)) && (!empty($location))) {
} elseif ((isset($location)) && (! empty($location))) {
if ((is_array($location)) && (array_key_exists('id', $location))) {
$user->location_id = $location['id'];
} elseif (is_object($location)) {
$user->location_id = $location->id;
}
}
$user->ldap_import = 1;
@@ -277,30 +334,30 @@ class LdapSync extends Command
$errors = '';
if ($user->save()) {
$item["note"] = $item["createorupdate"];
$item["status"]='success';
$item['note'] = $item['createorupdate'];
$item['status'] = 'success';
} else {
foreach ($user->getErrors()->getMessages() as $key => $err) {
$errors .= $err[0];
}
$item["note"] = $errors;
$item["status"]='error';
$item['note'] = $errors;
$item['status'] = 'error';
}
array_push($summary, $item);
}
if ($this->option('summary')) {
for ($x = 0; $x < count($summary); $x++) {
if ($summary[$x]['status']=='error') {
if ($summary[$x]['status'] == 'error') {
$this->error('ERROR: '.$summary[$x]['firstname'].' '.$summary[$x]['lastname'].' (username: '.$summary[$x]['username'].') was not imported: '.$summary[$x]['note']);
} else {
$this->info('User '.$summary[$x]['firstname'].' '.$summary[$x]['lastname'].' (username: '.$summary[$x]['username'].') was '.strtoupper($summary[$x]['createorupdate']).'.');
}
}
} else if ($this->option('json_summary')) {
$json_summary = [ "error" => false, "error_message" => "", "summary" => $summary ]; // hardcoding the error to false and the error_message to blank seems a bit weird
} elseif ($this->option('json_summary')) {
$json_summary = ['error' => false, 'error_message' => '', 'summary' => $summary]; // hardcoding the error to false and the error_message to blank seems a bit weird
$this->info(json_encode($json_summary));
} else {
return $summary;

View File

@@ -1,399 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Console\Commands;
use Log;
use Exception;
use App\Models\User;
use App\Services\LdapAd;
use App\Models\Location;
use Illuminate\Console\Command;
use Adldap\Models\User as AdldapUser;
/**
* LDAP / AD sync command.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
class LdapSyncNg extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:ldap-sync-ng
{--location= : A location name }
{--location_id= : A location id}
{--base_dn= : A diffrent base DN to use }
{--summary : Print summary }
{--json_summary : Print summary in json format }
{--dryrun : Run the sync process but don\'t update the database}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command line LDAP/AD sync';
/**
* An LdapAd instance.
*
* @var \App\Models\LdapAd
*/
private $ldap;
/**
* LDAP settings collection.
*
* @var \Illuminate\Support\Collection
*/
private $settings = null;
/**
* A default location collection.
*
* @var \Illuminate\Support\Collection
*/
private $defaultLocation = null;
/**
* Mapped locations collection.
*
* @var \Illuminate\Support\Collection
*/
private $mappedLocations = null;
/**
* The summary collection.
*
* @var \Illuminate\Support\Collection
*/
private $summary;
/**
* Is dry-run?
*
* @var bool
*/
private $dryrun = false;
/**
* Show users to be imported.
*
* @var array
*/
private $userlist = [];
/**
* Create a new command instance.
*/
public function __construct(LdapAd $ldap)
{
parent::__construct();
$this->ldap = $ldap;
$this->settings = $this->ldap->ldapSettings;
$this->summary = collect();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$dispatcher = \Adldap\Adldap::getEventDispatcher();
// Listen for all model events.
$dispatcher->listen('Adldap\Models\Events\*', function ($eventName, array $data) {
echo $eventName; // Returns 'Adldap\Models\Events\Updating'
var_dump($data); // Returns [0] => (object) Adldap\Models\Events\Updating;
\Log::debug("Event: ".$eventName." data - ".print_r($data, true));
});
$dispatcher->listen('Adldap\Auth\Events\*', function ($eventName, array $data) {
echo $eventName; // Returns 'Adldap\Models\Events\Updating'
var_dump($data); // Returns [0] => (object) Adldap\Models\Events\Updating;
\Log::debug("Event: ".$eventName." data - ".print_r($data, true));
});
ini_set('max_execution_time', env('LDAP_TIME_LIM', "600")); //600 seconds = 10 minutes
ini_set('memory_limit', '500M');
$old_error_reporting = error_reporting(); // grab old error_reporting .ini setting, for later re-enablement
error_reporting($old_error_reporting & ~E_DEPRECATED); // disable deprecation warnings, for LDAP in PHP 7.4 (and greater)
if ($this->option('dryrun')) {
$this->dryrun = true;
}
$this->checkIfLdapIsEnabled();
$this->checkLdapConnection();
$this->setBaseDn();
$this->getUserDefaultLocation();
/*
* Use the default location if set, this is needed for the LDAP users sync page
*/
if (!$this->option('base_dn') && null == $this->defaultLocation) {
$this->getMappedLocations();
}
$this->processLdapUsers();
// Print table of users
if ($this->dryrun) {
$this->info('The following users will be synced!');
$headers = ['First Name', 'Last Name', 'Username', 'Email', 'Employee #', 'Location Id', 'Status'];
$this->table($headers, $this->summary->toArray());
}
error_reporting($old_error_reporting); // re-enable deprecation warnings.
return $this->getSummary();
}
/**
* Generate the LDAP sync summary.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*
* @return string
*/
private function getSummary(): string
{
if ($this->option('summary') && null === $this->dryrun) {
$this->summary->each(function ($item) {
$this->info('USER: '.$item['note']);
if ('ERROR' === $item['status']) {
$this->error('ERROR: '.$item['note']);
}
});
} elseif ($this->option('json_summary')) {
$json_summary = [
'error' => false,
'error_message' => '',
'summary' => $this->summary->toArray(),
];
$this->info(json_encode($json_summary));
}
return '';
}
/**
* Create a new user or update an existing user.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*
* @param \Adldap\Models\User $snipeUser
*/
private function updateCreateUser(AdldapUser $snipeUser): void
{
$user = $this->ldap->processUser($snipeUser, $this->defaultLocation, $this->mappedLocations);
$summary = [
'firstname' => $user->first_name,
'lastname' => $user->last_name,
'username' => $user->username,
'employee_number' => $user->employee_num,
'email' => $user->email,
'location_id' => $user->location_id,
];
// Only update the database if is not a dry run
if (!$this->dryrun) {
if ($user->isDirty()) { //if nothing on the user changed, don't bother trying to save anything nor put anything in the summary
if ($user->save()) {
$summary['note'] = ($user->wasRecentlyCreated ? 'CREATED' : 'UPDATED');
$summary['status'] = 'SUCCESS';
} else {
$errors = '';
foreach ($user->getErrors()->getMessages() as $error) {
$errors .= implode(", ",$error);
}
$summary['note'] = $snipeUser->getDN().' was not imported. REASON: '.$errors;
$summary['status'] = 'ERROR';
}
} else {
$summary = null;
}
}
// $summary['note'] = ($user->getOriginal('username') ? 'UPDATED' : 'CREATED'); // this seems, kinda, like, superfluous, relative to the $summary['note'] thing above, yeah?
if($summary) { //if the $user wasn't dirty, $summary was set to null so that we will skip the following push()
$this->summary->push($summary);
}
}
/**
* Process the users to update / create.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*
*/
private function processLdapUsers(): void
{
try {
\Log::debug("CAL:LING GET LDAP SUSERS");
$ldapUsers = $this->ldap->getLdapUsers();
\Log::debug("END CALLING GET LDAP USERS");
} catch (Exception $e) {
$this->outputError($e);
exit($e->getMessage());
}
if (0 == $ldapUsers->count()) {
$msg = 'ERROR: No users found!';
Log::error($msg);
if ($this->dryrun) {
$this->error($msg);
}
exit($msg);
}
// Process each individual users
foreach ($ldapUsers->getResults() as $user) { // AdLdap2's paginate() method is weird, it gets *everything* and ->getResults() returns *everything*
$this->updateCreateUser($user);
}
}
/**
* Get the mapped locations if a base_dn is provided.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function getMappedLocations()
{
$ldapOuLocation = Location::where('ldap_ou', '!=', '')->select(['id', 'ldap_ou'])->get();
$locations = $ldapOuLocation->sortBy(function ($ou, $key) {
return strlen($ou->ldap_ou);
});
if ($locations->count() > 0) {
$msg = 'Some locations have special OUs set. Locations will be automatically set for users in those OUs.';
LOG::debug($msg);
if ($this->dryrun) {
$this->info($msg);
}
$this->mappedLocations = $locations->pluck('ldap_ou', 'id'); // TODO: this seems ok-ish, but the key-> value is going location_id -> OU name, and the primary action here is the opposite of that - going from OU's to location ID's.
}
}
/**
* Set the base dn if supplied.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function setBaseDn(): void
{
if ($this->option('base_dn')) {
$this->ldap->baseDn = $this->option('base_dn');
$msg = sprintf('Importing users from specified base DN: "%s"', $this->ldap->baseDn);
LOG::debug($msg);
if ($this->dryrun) {
$this->info($msg);
}
}
}
/**
* Get a default location id for imported users.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function getUserDefaultLocation(): void
{
$location = $this->option('location_id') ?? $this->option('location');
if ($location) {
$userLocation = Location::where('name', '=', $location)
->orWhere('id', '=', intval($location))
->select(['name', 'id'])
->first();
if ($userLocation) {
$msg = 'Importing users with default location: '.$userLocation->name.' ('.$userLocation->id.')';
LOG::debug($msg);
if ($this->dryrun) {
$this->info($msg);
}
$this->defaultLocation = collect([
$userLocation->id => $userLocation->name,
]);
} else {
$msg = 'The supplied location is invalid!';
LOG::error($msg);
if ($this->dryrun) {
$this->error($msg);
}
exit(0);
}
}
}
/**
* Check if LDAP intergration is enabled.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function checkIfLdapIsEnabled(): void
{
if (false === $this->settings['ldap_enabled']) {
$msg = 'LDAP intergration is not enabled. Exiting sync process.';
$this->info($msg);
Log::info($msg);
exit(0);
}
}
/**
* Check to make sure we can access the server.
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*/
private function checkLdapConnection(): void
{
try {
$this->ldap->testLdapAdUserConnection();
$this->ldap->testLdapAdBindConnection();
} catch (Exception $e) {
$this->outputError($e);
exit(0);
}
}
/**
* Output the json summary to the screen if enabled.
*
* @param Exception $error
*/
private function outputError($error): void
{
if ($this->option('json_summary')) {
$json_summary = [
'error' => true,
'error_message' => $error->getMessage(),
'summary' => [],
];
$this->info(json_encode($json_summary));
}
$this->error($error->getMessage());
LOG::error($error);
}
}

View File

@@ -0,0 +1,517 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Setting;
use Exception;
use Crypt;
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
// $range is in IP/CIDR format eg 127.0.0.1/24
list( $range, $netmask ) = explode( '/', $range, 2 );
$range_decimal = ip2long( $range );
$ip_decimal = ip2long( $ip );
$wildcard_decimal = pow( 2, ( 32 - $netmask ) ) - 1;
$netmask_decimal = ~ $wildcard_decimal;
return ( ( $ip_decimal & $netmask_decimal ) == ( $range_decimal & $netmask_decimal ) );
}
// NOTE - this function was shamelessly stolen from this gist: https://gist.github.com/tott/7684443
/**
* Ensure LDAP filters are parentheses-wrapped
*/
function parenthesized_filter($filter)
{
if(substr($filter,0,1) == "(" ) {
return $filter;
} else {
return "(".$filter.")";
}
}
class LdapTroubleshooter extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ldap:troubleshoot
{--ldap-search : Output an ldapsearch command-line for testing your LDAP config}
{--force : Skip the interactive yes/no prompt for confirmation}
{--debug : Include debugging output (verbose)}
{--trace : Include extremely verbose LDAP trace output}
{--timeout=15 : Timeout for LDAP Bind operations}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Runs a series of non-destructive LDAP commands to help try and determine correct LDAP settings for your environment.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Output something *only* if debug is enabled
*
* @return void
*/
public function debugout($string)
{
if($this->option('debug')) {
$this->line($string);
}
}
/**
* Clean the results from ldap_get_entries into something useful
* @param array $array
* @return array
*/
public function ldap_results_cleaner ($array) {
$cleaned = [];
for($i = 0; $i < $array['count']; $i++) {
$row = $array[$i];
$clean_row = [];
foreach($row AS $key => $val ) {
$this->debugout("Key is: ".$key);
if($key == "count" || is_int($key) || $key == "dn") {
$this->debugout(" and we're gonna skip it\n");
continue;
}
$this->debugout(" And that seems fine.\n");
if(array_key_exists('count',$val)) {
if($val['count'] == 1) {
$clean_row[$key] = $val[0];
} else {
unset($val['count']); //these counts are annoying
$elements = [];
foreach($val as $entry) {
if(isset($ldap_constants[$entry])) {
$elements[] = $ldap_constants[$entry];
} else {
$elements[] = $entry;
}
}
$clean_row[$key] = $elements;
}
} else {
$clean_row[$key] = $val;
}
}
$cleaned[$i] = $clean_row;
}
return $cleaned;
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if($this->option('trace')) {
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
}
$settings = Setting::getSettings();
$this->settings = $settings;
if($this->option('ldap-search')) {
if(!$this->option('force')) {
$confirmation = $this->confirm('WARNING: This command will display your LDAP password on your terminal. Are you sure this is ok?');
if(!$confirmation) {
$this->error('ABORTING');
exit(-1);
}
}
$output = [];
if($settings->ldap_server_cert_ignore) {
$this->line("# Ignoring server certificate validity");
$output[] = "LDAPTLS_REQCERT=never";
}
if($settings->ldap_client_tls_cert && $settings->ldap_client_tls_key) {
$this->line("# Adding LDAP Client Certificate and Key");
$output[] = "LDAPTLS_CERT=storage/ldap_client_tls.cert";
$output[] = "LDAPTLS_KEY=storage/ldap_client_tls.key";
}
$output[] = "ldapsearch";
$output[] = "-H ".$settings->ldap_server;
$output[] = "-x";
$output[] = "-b ".escapeshellarg($settings->ldap_basedn);
$output[] = "-D ".escapeshellarg($settings->ldap_uname);
$output[] = "-w ".escapeshellarg(\Crypt::Decrypt($settings->ldap_pword));
$output[] = escapeshellarg(parenthesized_filter($settings->ldap_filter));
if($settings->ldap_tls) {
$this->line("# adding STARTTLS option");
$output[] = "-Z";
}
$output[] = "-v";
$this->line("\n");
$this->line(implode(" \\\n",$output));
exit(0);
}
if(!$this->option('force')) {
$confirmation = $this->confirm('WARNING: This command will make several attempts to connect to your LDAP server. Are you sure this is ok?');
if(!$confirmation) {
$this->error('ABORTING');
exit(-1);
}
}
//$this->line(print_r($settings,true));
$this->info("STAGE 1: Checking settings");
if(!$settings->ldap_enabled) {
$this->error("WARNING: Snipe-IT's LDAP setting is not turned on. (That may be OK if you're still trying to figure out settings)");
}
$ldap_conn = false;
try {
$ldap_conn = ldap_connect($settings->ldap_server);
} catch (Exception $e) {
$this->error("WARNING: Exception caught when executing 'ldap_connect()' - ".$e->getMessage().". We will try to guess.");
}
if(!$ldap_conn) {
$this->error("WARNING: LDAP Server setting of: ".$settings->ldap_server." cannot be parsed. We will try to guess.");
//exit(-1);
}
//since we never use $ldap_conn again, we don't have to ldap_unbind() it (it's not even connected, tbh - that only happens at bind-time)
$parsed = parse_url($settings->ldap_server);
if(@$parsed['scheme'] != 'ldap' && @$parsed['scheme'] != 'ldaps') {
$this->error("WARNING: LDAP URL Scheme of '".@$parsed['scheme']."' is probably incorrect; should usually be ldap or ldaps");
}
if(!@$parsed['host']) {
$this->error("ERROR: Cannot determine hostname or IP from ldap URL: ".$settings->ldap_server.". ABORTING.");
exit(-1);
} else {
$this->info("Determined LDAP hostname to be: ".$parsed['host']);
}
$this->info("Performing DNS lookup of: ".$parsed['host']);
$ips = dns_get_record($parsed['host']);
$raw_ips = [];
//$this->info("Host IP is: ".print_r($ips,true));
if(!$ips || count($ips) == 0) {
$this->error("ERROR: DNS lookup of host: ".$parsed['host']." has failed. ABORTING.");
exit(-1);
}
$this->debugout("IP's? ".print_r($ips,true));
foreach($ips as $ip) {
if(!isset($ip['ip'])) {
continue;
}
$raw_ips[]=$ip['ip'];
if($ip['ip'] == "127.0.0.1") {
$this->error("WARNING: Using the localhost IP as the LDAP server. This is usually wrong");
}
if(ip_in_range($ip['ip'],'10.0.0.0/8') || ip_in_range($ip['ip'],'192.168.0.0/16') || ip_in_range($ip['ip'], '172.16.0.0/12')) {
$this->error("WARNING: Using an RFC1918 Private address for LDAP server. This may be correct, but it can be a problem if your Snipe-IT instance is not hosted on your private network");
}
}
$this->info("STAGE 2: Checking basic network connectivity");
$ports = [389,636];
if(@$parsed['port'] && !in_array($parsed['port'],$ports)) {
$ports[] = $parsed['port'];
}
$open_ports=[];
foreach($ports as $port ) {
$errno = 0;
$errstr = '';
$timeout = 30.0;
$result = '';
$this->info("Attempting to connect to port: ".$port." - may take up to $timeout seconds");
try {
$result = fsockopen($parsed['host'], $port, $errno, $errstr, 30.0);
} catch(Exception $e) {
$this->error("Exception: ".$e->getMessage());
}
if($result) {
$this->info("Success!");
$open_ports[] = $port;
} else {
$this->error("WARNING: Cannot connect to port: $port - $errstr ($errno)");
}
}
if(count($open_ports) == 0) {
$this->error("ERROR - no open ports. ABORTING.");
exit(-1);
}
$this->info("STAGE 3: Determine encryption algorithm, if any");
$ldap_urls = [];
$pretty_ldap_urls = [];
foreach($open_ports as $port) {
$this->line("Trying TLS first for port $port");
$ldap_url = "ldaps://".$parsed['host'].":$port";
if($this->test_anonymous_bind($ldap_url)) {
$this->info("Anonymous bind succesful to $ldap_url!");
$ldap_urls[] = [ $ldap_url, true, false ];
$pretty_ldap_urls[] = [ $ldap_url, "YES", "no" ];
continue; // TODO - lots of copypasta in these if(test_anonymous_bind()) routines...
} else {
$this->error("WARNING: Failed to bind to $ldap_url - trying without certificate checks.");
}
if($this->test_anonymous_bind($ldap_url, false)) {
$this->info("Anonymous bind succesful to $ldap_url with certifcate-checks disabled");
$ldap_urls[] = [ $ldap_url, false, false ];
$pretty_ldap_urls[] = [ $ldap_url, "no", "no" ];
continue;
} else {
$this->error("WARNING: Failed to bind to $ldap_url with certificate checks disabled. Trying unencrypted with STARTTLS");
}
$ldap_url = "ldap://".$parsed['host'].":$port";
if($this->test_anonymous_bind($ldap_url, true, true)) {
$this->info("Plain connection to $ldap_url with STARTTLS succesful!");
$ldap_urls[] = [ $ldap_url, true, true ];
$pretty_ldap_urls[] = [ $ldap_url, "YES", "YES" ];
continue;
} else {
$this->error("WARNING: Failed to bind to $ldap_url with STARTTLS enabled. Trying without STARTTLS");
}
if($this->test_anonymous_bind($ldap_url)) {
$this->info("Plain connection to $ldap_url succesful!");
$ldap_urls[] = [ $ldap_url, true, false ];
$pretty_ldap_urls[] = [ $ldap_url, "YES", "no" ];
continue;
} else {
$this->error("WARNING: Failed to bind to $ldap_url. Giving up on port $port");
}
}
$this->debugout(print_r($ldap_urls,true));
if(count($ldap_urls) > 0 ) {
$this->info("Found working LDAP URL's: ");
foreach($ldap_urls as $ldap_url) { // TODO maybe do this as a $this->table() instead?
$this->info("LDAP URL: ".$ldap_url[0]);
$this->info($ldap_url[0]. ($ldap_url[1] ? " certificate checks enabled" : " certificate checks disabled"). ($ldap_url[2] ? " STARTTLS Enabled ": " STARTTLS Disabled"));
}
$this->table(["URL", "Cert Checks Enabled?", "STARTTLS Enabled?"],$pretty_ldap_urls);
} else {
$this->error("ERROR - no valid LDAP URL's available - ABORTING");
exit(1);
}
$this->info("STAGE 4: Test Administrative Bind for LDAP Sync");
foreach($ldap_urls AS $ldap_url) {
$this->test_authed_bind($ldap_url[0], $ldap_url[1], $ldap_url[2], $settings->ldap_uname, Crypt::decrypt($settings->ldap_pword));
}
$this->info("STAGE 5: Test BaseDN");
//grab all LDAP_ constants and fill up a reversed array mapping from weird LDAP dotted-strings to (Constant Name)
$all_defined_constants = get_defined_constants();
$ldap_constants = [];
foreach($all_defined_constants AS $key => $val) {
if(starts_with($key,"LDAP_") && is_string($val)) {
$ldap_constants[$val] = $key; // INVERT the meaning here!
}
}
$this->debugout("LDAP constants are: ".print_r($ldap_constants,true));
foreach($ldap_urls AS $ldap_url) {
if($this->test_informational_bind($ldap_url[0],$ldap_url[1],$ldap_url[2],$settings->ldap_uname,Crypt::decrypt($settings->ldap_pword),$settings)) {
$this->info("Success getting informational bind!");
} else {
$this->error("Unable to get information from bind.");
}
}
$this->info("STAGE 6: Test LDAP Login to Snipe-IT");
foreach($ldap_urls AS $ldap_url) {
$this->info("Starting auth to ".$ldap_url[0]);
while(true) {
$with_tls = $ldap_url[1] ? "with": "without";
$with_startssl = $ldap_url[2] ? "using": "not using";
if(!$this->confirm('Do you wish to try to authenticate to this directory: '.$ldap_url[0]." $with_tls TLS and $with_startssl STARTSSL?")) {
break;
}
$username = $this->ask("Username");
$password = $this->secret("Password");
$this->test_authed_bind($ldap_url[0], $ldap_url[1], $ldap_url[2], $username, $password); // FIXME - should do some other stuff here, maybe with the concatenating or something? maybe? and/or should put up some results?
}
}
$this->info("LDAP TROUBLESHOOTING COMPLETE!");
}
public function connect_to_ldap($ldap_url, $check_cert, $start_tls)
{
$lconn = ldap_connect($ldap_url);
ldap_set_option($lconn, LDAP_OPT_PROTOCOL_VERSION, 3); // should we 'test' different protocol versions here? Does anyone even use anything other than LDAPv3?
// no - it's formally deprecated: https://tools.ietf.org/html/rfc3494
if(!$check_cert) {
putenv('LDAPTLS_REQCERT=never'); // This is horrible; is this *really* the only way to do it?
} else {
putenv('LDAPTLS_REQCERT'); // have to very explicitly and manually *UN* set the env var here to ensure it works
}
if($this->settings->ldap_client_tls_cert && $this->settings->ldap_client_tls_key) {
// client-side TLS certificate support for LDAP (Google Secure LDAP)
putenv('LDAPTLS_CERT=storage/ldap_client_tls.cert');
putenv('LDAPTLS_KEY=storage/ldap_client_tls.key');
}
if($start_tls) {
if(!ldap_start_tls($lconn)) {
$this->error("WARNING: Unable to start TLS");
return false;
}
}
if(!$lconn) {
$this->error("WARNING: Failed to generate connection string - using: ".$ldap_url);
return false;
}
$net = ldap_set_option($lconn, LDAP_OPT_NETWORK_TIMEOUT, $this->option('timeout'));
$time = ldap_set_option($lconn, LDAP_OPT_TIMELIMIT, $this->option('timeout'));
if(!$net || !$time) {
$this->error("Unable to set timeouts!");
}
return $lconn;
}
public function test_anonymous_bind($ldap_url, $check_cert = true, $start_tls = false)
{
return $this->timed_boolean_execute(function () use ($ldap_url, $check_cert , $start_tls) {
try {
$lconn = $this->connect_to_ldap($ldap_url, $check_cert, $start_tls);
$this->info("gonna try to bind now, this can take a while if we mess it up");
$bind_results = ldap_bind($lconn);
$this->info("Bind results are: ".$bind_results." which translate into boolean: ".(bool)$bind_results);
return (bool)$bind_results;
} catch (Exception $e) {
$this->error("WARNING: Exception caught during bind - ".$e->getMessage());
return false;
}
});
}
public function test_authed_bind($ldap_url, $check_cert, $start_tls, $username, $password)
{
return $this->timed_boolean_execute(function () use ($ldap_url, $check_cert, $start_tls, $username, $password) {
try {
$lconn = $this->connect_to_ldap($ldap_url, $check_cert, $start_tls);
$bind_results = ldap_bind($lconn, $username, $password);
if(!$bind_results) {
$this->error("WARNING: Failed to bind to $ldap_url as $username");
return false;
} else {
$this->info("SUCCESS - Able to bind to $ldap_url as $username");
return (bool)$lconn;
}
} catch (Exception $e) {
$this->error("WARNING: Exception caught during Authed bind to $username - ".$e->getMessage());
return false;
}
});
}
public function test_informational_bind($ldap_url, $check_cert, $start_tls, $username, $password,$settings)
{
return $this->timed_boolean_execute(function () use ($ldap_url, $check_cert, $start_tls, $username, $password, $settings) {
try { // TODO - copypasta'ed from test_authed_bind
$conn = $this->connect_to_ldap($ldap_url, $check_cert, $start_tls);
$bind_results = ldap_bind($conn, $username, $password);
if(!$bind_results) {
$this->error("WARNING: Failed to bind to $ldap_url as $username");
return false;
}
$this->info("SUCCESS - Able to bind to $ldap_url as $username");
$result = ldap_read($conn, '', '(objectClass=*)'/* , ['supportedControl']*/);
$results = ldap_get_entries($conn, $result);
$cleaned_results = $this->ldap_results_cleaner($results);
$this->line(print_r($cleaned_results,true));
//okay, great - now how do we display those results? I have no idea.
// I don't see why this throws an Exception for Google LDAP, but I guess we ought to try and catch it?
$this->comment("I guess we're trying to do the ldap search here, but sometimes it takes too long?");
$this->debugout("Base DN is: ".$settings->ldap_basedn." and filter is: ".parenthesized_filter($settings->ldap_filter));
$search_results = ldap_search($conn, $settings->ldap_basedn, parenthesized_filter($settings->ldap_filter));
$this->info("Printing first 10 results: ");
for($i=0;$i<10;$i++) {
$this->info($search_results[$i]);
}
} catch (\Exception $e) {
$this->error("WARNING: Exception caught during Authed bind to $username - ".$e->getMessage());
return false;
}
});
}
/***********************************************
*
* This function executes $function - which is expected to be some kind of executable function -
* with a timeout set. It respects the timeout by forking execution and setting a strict timer
* for which to get back a SIGUSR1 or SIGUSR2 signal from the forked process.
*
***********************************************/
private function timed_boolean_execute($function)
{
if(!(function_exists('pcntl_sigtimedwait') && function_exists('posix_getpid') && function_exists('pcntl_fork') && function_exists('posix_kill') && function_exists('pcntl_wifsignaled'))) {
// POSIX functions needed for forking aren't present, just run the function inline (ignoring timeout)
$this->info('WARNING: Unable to execute POSIX fork() commands, timeout may not be respected');
return $function();
} else {
$parent_pid = posix_getpid();
$pid = pcntl_fork();
switch($pid) {
case 0:
//we're the 'child'
if($function()) {
//SUCCESS = SIGUSR1
posix_kill($parent_pid, SIGUSR1);
} else {
//FAILURE = SIGUSR2
posix_kill($parent_pid, SIGUSR2);
}
exit();
break; //yes I know we don't need it.
case -1:
//couldn't fork
$this->error("COULD NOT FORK - assuming failure");
return false;
break; //I still know that we don't need it
default:
//we remain the 'parent', $pid is the PID of the forked process.
$siginfo = [];
$exit_status = pcntl_sigtimedwait ([SIGUSR1, SIGUSR2], $siginfo, $this->option('timeout'));
if ($exit_status == SIGUSR1) {
return true;
} else {
posix_kill($pid, SIGKILL); //make sure we don't have processes hanging around that might try and send signals during later executions, confusing us
return false;
}
break; //Yeah I get it already, shush.
}
}
}
}

View File

@@ -2,10 +2,9 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Console\Command;
class MergeUsersByUsername extends Command
{
@@ -42,71 +41,75 @@ class MergeUsersByUsername extends Command
{
// Get the list of users who have an email address as their username
$users = User::where('username', 'LIKE', '%@%')->whereNull('deleted_at')->get();
$this->info($users->count().' total non-deleted users whose usernames contain a @ symbol.');
foreach ($users as $user) {
$parts = explode("@", $user->username);
$bad_users = User::where('username', '=', $parts[0])->whereNull('deleted_at')->with('assets', 'manager', 'userlog', 'licenses', 'consumables', 'accessories', 'managedLocations')->get();
$parts = explode('@', trim($user->username));
$this->info('Checking against username '.trim($parts[0]).'.');
$bad_users = User::where('username', '=', trim($parts[0]))
->whereNull('deleted_at')
->with('assets', 'manager', 'userlog', 'licenses', 'consumables', 'accessories', 'managedLocations')
->get();
foreach ($bad_users as $bad_user) {
$this->info($bad_user->username.' ('.$bad_user->id.') will be merged into '.$user->username.' ('.$user->id.') ');
// Walk the list of assets
foreach ($bad_user->assets as $asset) {
$this->info( 'Updating asset '.$asset->asset_tag.' '.$asset->id.' to user '.$user->id);
$this->info('Updating asset '.$asset->asset_tag.' '.$asset->id.' to user '.$user->id);
$asset->assigned_to = $user->id;
if (!$asset->save()) {
$this->error( 'Could not update assigned_to field on asset '.$asset->asset_tag.' '.$asset->id.' to user '.$user->id);
$this->error( 'Error saving: '.$asset->getErrors());
if (! $asset->save()) {
$this->error('Could not update assigned_to field on asset '.$asset->asset_tag.' '.$asset->id.' to user '.$user->id);
$this->error('Error saving: '.$asset->getErrors());
}
}
// Walk the list of licenses
foreach ($bad_user->licenses as $license) {
$this->info( 'Updating license '.$license->name.' '.$license->id.' to user '.$user->id);
$this->info('Updating license '.$license->name.' '.$license->id.' to user '.$user->id);
$bad_user->licenses()->updateExistingPivot($license->id, ['assigned_to' => $user->id]);
}
// Walk the list of consumables
foreach ($bad_user->consumables as $consumable) {
$this->info( 'Updating consumable '.$consumable->id.' to user '.$user->id);
$this->info('Updating consumable '.$consumable->id.' to user '.$user->id);
$bad_user->consumables()->updateExistingPivot($consumable->id, ['assigned_to' => $user->id]);
}
// Walk the list of accessories
foreach ($bad_user->accessories as $accessory) {
$this->info( 'Updating accessory '.$accessory->id.' to user '.$user->id);
$this->info('Updating accessory '.$accessory->id.' to user '.$user->id);
$bad_user->accessories()->updateExistingPivot($accessory->id, ['assigned_to' => $user->id]);
}
// Walk the list of logs
foreach ($bad_user->userlog as $log) {
$this->info( 'Updating action log record '.$log->id.' to user '.$user->id);
$this->info('Updating action log record '.$log->id.' to user '.$user->id);
$log->target_id = $user->id;
$log->save();
}
// Update any manager IDs
$this->info( 'Updating managed user records to user '.$user->id);
$this->info('Updating managed user records to user '.$user->id);
User::where('manager_id', '=', $bad_user->id)->update(['manager_id' => $user->id]);
// Update location manager IDs
foreach ($bad_user->managedLocations as $managedLocation) {
$this->info( 'Updating managed location record '.$managedLocation->name.' to manager '.$user->id);
$this->info('Updating managed location record '.$managedLocation->name.' to manager '.$user->id);
$managedLocation->manager_id = $user->id;
$managedLocation->save();
}
// Mark the user as deleted
$this->info( 'Marking the user as deleted');
$this->info('Marking the user as deleted');
$bad_user->deleted_at = Carbon::now()->timestamp;
$bad_user->save();
}
}
}
}

View File

@@ -2,7 +2,6 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
@@ -39,10 +38,10 @@ class MoveUploadsToNewDisk extends Command
*/
public function handle()
{
if (config('filesystems.default')=='local') {
if (config('filesystems.default') == 'local') {
$this->error('Your current disk is set to local so we cannot proceed.');
$this->warn("Please configure your .env settings for S3. \nChange your PUBLIC_FILESYSTEM_DISK value to 's3_public' and your PRIVATE_FILESYSTEM_DISK to s3_private.");
return false;
}
$delete_local = $this->argument('delete_local');
@@ -62,10 +61,9 @@ class MoveUploadsToNewDisk extends Command
// iterate files
foreach($public_uploads as $public_type => $public_upload)
{
foreach ($public_uploads as $public_type => $public_upload) {
$type_count = 0;
$this->info("- There are ".count($public_upload).' PUBLIC '.$public_type.' files.');
$this->info('- There are ' . count($public_upload) . ' PUBLIC ' . $public_type . ' files.');
for ($i = 0; $i < count($public_upload); $i++) {
$type_count++;
@@ -79,9 +77,7 @@ class MoveUploadsToNewDisk extends Command
\Log::debug($e);
$this->error($e);
}
}
}
$logos = glob("public/uploads/setting*.*");
@@ -92,8 +88,8 @@ class MoveUploadsToNewDisk extends Command
$this->info($logo);
$type_count++;
$filename = basename($logo);
Storage::disk('public')->put('uploads/'.$filename, file_get_contents($logo));
$this->info($type_count.'. LOGO: '.$filename.' was copied to '.env('PUBLIC_AWS_URL').'/uploads/'.$filename);
Storage::disk('public')->put('uploads/' . $filename, file_get_contents($logo));
$this->info($type_count . '. LOGO: ' . $filename . ' was copied to ' . env('PUBLIC_AWS_URL') . '/uploads/' . $filename);
}
$private_uploads['assets'] = glob('storage/private_uploads/assets'."/*.*");
@@ -104,80 +100,68 @@ class MoveUploadsToNewDisk extends Command
$private_uploads['licenses'] = glob('storage/private_uploads/licenses'."/*.*");
$private_uploads['users'] = glob('storage/private_uploads/users'."/*.*");
$private_uploads['backups'] = glob('storage/private_uploads/backups'."/*.*");
foreach ($private_uploads as $private_type => $private_upload) {
{
$this->info('- There are ' . count($private_upload) . ' PRIVATE ' . $private_type . ' files.');
foreach($private_uploads as $private_type => $private_upload)
{
$this->info("- There are ".count($private_upload).' PRIVATE '.$private_type.' files.');
$type_count = 0;
for ($x = 0; $x < count($private_upload); $x++) {
$type_count++;
$filename = basename($private_upload[$x]);
try {
Storage::put($private_type.'/'.$filename, file_get_contents($private_upload[$i]));
$new_url = Storage::url($private_type.'/'.$filename, $filename);
$this->info($type_count.'. PRIVATE: '.$filename.' was copied to '.$new_url);
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
}
}
}
if ($delete_local=='true') {
$public_delete_count = 0;
$private_delete_count = 0;
$this->info("\n\n");
$this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
$this->warn("\nTHIS WILL DELETE ALL OF YOUR LOCAL UPLOADED FILES. \n\nThis cannot be undone, so you should take a backup of your system before you proceed.\n");
$this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
if ($this->confirm("Do you wish to continue?")) {
foreach($public_uploads as $public_type => $public_upload) {
for ($i = 0; $i < count($public_upload); $i++) {
$filename = $public_upload[$i];
try {
unlink($filename);
$public_delete_count++;
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
}
$type_count = 0;
for ($x = 0; $x < count($private_upload); $x++) {
$type_count++;
$filename = basename($private_upload[$x]);
try {
Storage::put($private_type . '/' . $filename, file_get_contents($private_upload[$i]));
$new_url = Storage::url($private_type . '/' . $filename, $filename);
$this->info($type_count . '. PRIVATE: ' . $filename . ' was copied to ' . $new_url);
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
}
}
}
foreach($private_uploads as $private_type => $private_upload)
{
for ($i = 0; $i < count($private_upload); $i++) {
$filename = $private_upload[$i];
try {
unlink($filename);
$private_delete_count++;
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
if ($delete_local == 'true') {
$public_delete_count = 0;
$private_delete_count = 0;
$this->info("\n\n");
$this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
$this->warn("\nTHIS WILL DELETE ALL OF YOUR LOCAL UPLOADED FILES. \n\nThis cannot be undone, so you should take a backup of your system before you proceed.\n");
$this->error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
if ($this->confirm('Do you wish to continue?')) {
foreach ($public_uploads as $public_type => $public_upload) {
for ($i = 0; $i < count($public_upload); $i++) {
$filename = $public_upload[$i];
try {
unlink($filename);
$public_delete_count++;
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
}
}
}
}
$this->info($public_delete_count." PUBLIC local files and ".$private_delete_count." PRIVATE local files were deleted from your filesystem.");
foreach ($private_uploads as $private_type => $private_upload) {
for ($i = 0; $i < count($private_upload); $i++) {
$filename = $private_upload[$i];
try {
unlink($filename);
$private_delete_count++;
} catch (\Exception $e) {
\Log::debug($e);
$this->error($e);
}
}
}
$this->info($public_delete_count . ' PUBLIC local files and ' . $private_delete_count . ' PRIVATE local files were deleted from your filesystem.');
}
}
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
@@ -13,7 +14,6 @@ ini_set('memory_limit', env('IMPORT_MEMORY_LIMIT', '500M'));
*/
class ObjectImportCommand extends Command
{
/**
* The console command name.
*
@@ -37,7 +37,9 @@ class ObjectImportCommand extends Command
{
parent::__construct();
}
private $bar;
/**
* Execute the console command.
*
@@ -55,7 +57,6 @@ class ObjectImportCommand extends Command
->setShouldNotify($this->option('send-welcome'))
->setUsernameFormat($this->option('username_format'));
// This $logFile/useFiles() bit is currently broken, so commenting it out for now
// $logFile = $this->option('logfile');
// \Log::useFiles($logFile);
@@ -64,29 +65,28 @@ class ObjectImportCommand extends Command
$this->bar = null;
if (!empty($this->errors)) {
$this->comment("The following Errors were encountered.");
if (! empty($this->errors)) {
$this->comment('The following Errors were encountered.');
foreach ($this->errors as $asset => $error) {
$this->comment('Error: Item: ' . $asset . ' failed validation: ' . json_encode($error));
$this->comment('Error: Item: '.$asset.' failed validation: '.json_encode($error));
}
} else {
$this->comment("All Items imported successfully!");
$this->comment('All Items imported successfully!');
}
$this->comment("");
return;
$this->comment('');
}
public function errorCallback($item, $field, $errorString)
{
$this->errors[$item->name][$field] = $errorString;
}
public function progress($count)
{
if (!$this->bar) {
if (! $this->bar) {
$this->bar = $this->output->createProgressBar($count);
}
static $index =0;
static $index = 0;
$index++;
if ($index < $count) {
$this->bar->advance();
@@ -94,12 +94,12 @@ class ObjectImportCommand extends Command
$this->bar->finish();
}
}
// Tracks the current item for error messages
private $updating;
// An array of errors encountered while parsing
private $errors;
/**
* Log a message to file, configurable by the --log-file parameter.
* If a warning message is passed, we'll spit it to the console as well.
@@ -108,7 +108,7 @@ class ObjectImportCommand extends Command
* @since 3.0
* @param string $string
* @param string $level
*/
*/
public function log($string, $level = 'info')
{
if ($level === 'warning') {
@@ -121,6 +121,7 @@ class ObjectImportCommand extends Command
}
}
}
/**
* Get the console command arguments.
*
@@ -130,12 +131,11 @@ class ObjectImportCommand extends Command
*/
protected function getArguments()
{
return array(
array('filename', InputArgument::REQUIRED, 'File for the CSV import.'),
);
return [
['filename', InputArgument::REQUIRED, 'File for the CSV import.'],
];
}
/**
* Get the console command options.
*
@@ -145,16 +145,15 @@ class ObjectImportCommand extends Command
*/
protected function getOptions()
{
return array(
array('email_format', null, InputOption::VALUE_REQUIRED, 'The format of the email addresses that should be generated. Options are firstname.lastname, firstname, filastname', null),
array('username_format', null, InputOption::VALUE_REQUIRED, 'The format of the username that should be generated. Options are firstname.lastname, firstname, filastname, email', null),
array('logfile', null, InputOption::VALUE_REQUIRED, 'The path to log output to. storage/logs/importer.log by default', storage_path('logs/importer.log') ),
array('item-type', null, InputOption::VALUE_REQUIRED, 'Item Type To import. Valid Options are Asset, Consumable, Accessory, License, or User', 'Asset'),
array('web-importer', null, InputOption::VALUE_NONE, 'Internal: packages output for use with the web importer'),
array('user_id', null, InputOption::VALUE_REQUIRED, 'ID of user creating items', 1),
array('update', null, InputOption::VALUE_NONE, 'If a matching item is found, update item information'),
array('send-welcome', null, InputOption::VALUE_NONE, 'Whether to send a welcome email to any new users that are created.'),
);
return [
['email_format', null, InputOption::VALUE_REQUIRED, 'The format of the email addresses that should be generated. Options are firstname.lastname, firstname, filastname', null],
['username_format', null, InputOption::VALUE_REQUIRED, 'The format of the username that should be generated. Options are firstname.lastname, firstname, filastname, email', null],
['logfile', null, InputOption::VALUE_REQUIRED, 'The path to log output to. storage/logs/importer.log by default', storage_path('logs/importer.log')],
['item-type', null, InputOption::VALUE_REQUIRED, 'Item Type To import. Valid Options are Asset, Consumable, Accessory, License, or User', 'Asset'],
['web-importer', null, InputOption::VALUE_NONE, 'Internal: packages output for use with the web importer'],
['user_id', null, InputOption::VALUE_REQUIRED, 'ID of user creating items', 1],
['update', null, InputOption::VALUE_NONE, 'If a matching item is found, update item information'],
['send-welcome', null, InputOption::VALUE_NONE, 'Whether to send a welcome email to any new users that are created.'],
];
}
}

View File

@@ -50,7 +50,7 @@ class Purge extends Command
public function handle()
{
$force = $this->option('force');
if (($this->confirm("\n****************************************************\nTHIS WILL PURGE ALL SOFT-DELETED ITEMS IN YOUR SYSTEM. \nThere is NO undo. This WILL permanently destroy \nALL of your deleted data. \n****************************************************\n\nDo you wish to continue? No backsies! [y|N]")) || $force == 'true') {
if (($this->confirm("\n****************************************************\nTHIS WILL PURGE ALL SOFT-DELETED ITEMS IN YOUR SYSTEM. \nThere is NO undo. This WILL permanently destroy \nALL of your deleted data. \n****************************************************\n\nDo you wish to continue? No backsies! [y|N]")) || $force == 'true') {
/**
* Delete assets
@@ -80,9 +80,8 @@ class Purge extends Command
$location->forceDelete();
}
$accessories = Accessory::whereNotNull('deleted_at')->withTrashed()->get();
$accessory_assoc=0;
$accessory_assoc = 0;
$this->info($accessories->count().' accessories purged.');
foreach ($accessories as $accessory) {
$this->info('- Accessory "'.$accessory->name.'" deleted.');
@@ -92,7 +91,6 @@ class Purge extends Command
}
$this->info($accessory_assoc.' corresponding log records purged.');
$consumables = Consumable::whereNotNull('deleted_at')->withTrashed()->get();
$this->info($consumables->count().' consumables purged.');
foreach ($consumables as $consumable) {
@@ -101,7 +99,6 @@ class Purge extends Command
$consumable->forceDelete();
}
$components = Component::whereNotNull('deleted_at')->withTrashed()->get();
$this->info($components->count().' components purged.');
foreach ($components as $component) {
@@ -126,7 +123,6 @@ class Purge extends Command
$model->forceDelete();
}
$categories = Category::whereNotNull('deleted_at')->withTrashed()->get();
$this->info($categories->count().' categories purged.');
foreach ($categories as $category) {
@@ -165,11 +161,8 @@ class Purge extends Command
$this->info('- Status Label "'.$status_label->name.'" deleted.');
$status_label->forceDelete();
}
} else {
$this->info('Action canceled. Nothing was purged.');
}
}
}

View File

@@ -38,7 +38,7 @@ class PurgeLoginAttempts extends Command
public function handle()
{
if ($this->confirm("\n****************************************************\nTHIS WILL DELETE ALL OF THE YOUR LOGIN ATTEMPT RECORDS. \nThere is NO undo! \n****************************************************\n\nDo you wish to continue? No backsies! [y|N]")) {
\DB::statement('delete from login_attempts');
\DB::statement('delete from login_attempts');
}
}
}

View File

@@ -48,15 +48,13 @@ class ReEncodeCustomFieldNames extends Command
*/
public function handle()
{
if ($this->confirm('This will regenerate all of the custom field database fieldnames in your database. THIS WILL CHANGE YOUR SCHEMA AND SHOULD NOT BE DONE WITHOUT MAKING A BACKUP FIRST. Do you wish to continue?'))
{
if ($this->confirm('This will regenerate all of the custom field database fieldnames in your database. THIS WILL CHANGE YOUR SCHEMA AND SHOULD NOT BE DONE WITHOUT MAKING A BACKUP FIRST. Do you wish to continue?')) {
/** Get all of the custom fields */
$fields = CustomField::get();
$asset_columns = \DB::getSchemaBuilder()->getColumnListing('assets');
$custom_field_columns = array();
$custom_field_columns = [];
/** Loop through the columns on the assets table */
foreach ($asset_columns as $asset_column) {
@@ -71,43 +69,55 @@ class ReEncodeCustomFieldNames extends Command
* Then use that ID as the array key for use comparing the actual assets field name
* and the db_column value from the custom fields table.
*/
$last_part = substr(strrchr($asset_column, "_snipeit_"), 1);
$last_part = substr(strrchr($asset_column, '_snipeit_'), 1);
$custom_field_columns[$last_part] = $asset_column;
}
}
foreach ($fields as $field) {
$this->info($field->name .' ('.$field->id.') column should be '. $field->convertUnicodeDbSlug().'');
$this->info($field->name.' ('.$field->id.') column should be '.$field->convertUnicodeDbSlug());
/** The assets table has the column it should have, all is well */
if (\Schema::hasColumn('assets', $field->convertUnicodeDbSlug()))
{
$this->info('-- ✓ This field exists - all good');
if ($field->db_column == $field->convertUnicodeDbSlug() && \Schema::hasColumn('assets', $field->convertUnicodeDbSlug())) {
$this->info('-- ✓ This field exists on the assets table and the value for db_column matches in the custom_fields table.');
/**
* There is a mismatch between the fieldname on the assets table and
* what $field->convertUnicodeDbSlug() is *now* expecting.
*/
} else {
$this->warn('-- X Field mismatch: updating... ');
/** Make sure the custom_field_columns array has the ID */
if (array_key_exists($field->id, $custom_field_columns)) {
if ($field->db_column != $field->convertUnicodeDbSlug()) {
$this->error('-- ✘ Field mismatch: '.$field->name.' value should be '.$field->convertUnicodeDbSlug().' but is '.$field->db_column.' in the custom_fields table');
/**
* Update the asset schema to the corrected fieldname that will be recognized by the
* system elsewhere that we use $field->convertUnicodeDbSlug()
*/
\Schema::table('assets', function($table) use ($custom_field_columns, $field) {
$table->renameColumn($custom_field_columns[$field->id], $field->convertUnicodeDbSlug());
});
} else {
$this->error('-- ✘ Field mismatch: '.$field->name.' column should be '.$field->convertUnicodeDbSlug().' but is '.$custom_field_columns[$field->id].' on the assets table.');
$this->warn('-- ✓ Field updated from '.$custom_field_columns[$field->id].' to '.$field->convertUnicodeDbSlug());
}
} else {
$this->warn('-- X WARNING: There is no field on the assets table ending in '.$field->id.'. This may require more in-depth investigation and may mean the schema was altered manually.');
}
/** Make sure the custom_field_columns array has the ID */
if (array_key_exists($field->id, $custom_field_columns)) {
/**
* Update the asset schema to the corrected fieldname that will be recognized by the
* system elsewhere that we use $field->convertUnicodeDbSlug()
*/
$this->info('-- ✓ Updating field from '.$field->db_column.' to '.$field->convertUnicodeDbSlug().' in the assets table');
\Schema::table('assets', function ($table) use ($custom_field_columns, $field) {
$table->renameColumn($custom_field_columns[$field->id], $field->convertUnicodeDbSlug());
});
$this->info('-- ✓ Updating field from '.$field->db_column.' to '.$field->convertUnicodeDbSlug().' in the custom fields table');
$field->db_column = $field->convertUnicodeDbSlug();
$field->save();
} else {
$this->warn('-- ✘ WARNING: There is no field on the assets table ending in '.$field->id.'. This may require more in-depth investigation and may mean the schema was altered manually.');
}
}
/** Update the db_column property in the custom fields table, just in case it doesn't match the other
@@ -115,12 +125,7 @@ class ReEncodeCustomFieldNames extends Command
*/
$field->db_column = $field->convertUnicodeDbSlug();
$field->save();
}
}
}
}

View File

@@ -44,37 +44,35 @@ class RecryptFromMcrypt extends Command
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 = array();
$errors = [];
if (!$legacy_key) {
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);
} 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;
}
@@ -84,8 +82,7 @@ class RecryptFromMcrypt extends Command
$force = ($this->option('force')) ? true : false;
if ($force || ($this->confirm("Are you SURE you wish to continue?"))) {
if ($force || ($this->confirm('Are you SURE you wish to continue?'))) {
$backup_file = 'backups/env-backups/'.'app_key-'.date('Y-m-d-gis');
try {
@@ -95,15 +92,14 @@ class RecryptFromMcrypt extends Command
$this->info('WARNING: Could not backup app keys');
}
if ($legacy_cipher){
$mcrypter = new McryptEncrypter($legacy_key,$legacy_cipher);
}else{
if ($legacy_cipher) {
$mcrypter = new McryptEncrypter($legacy_key, $legacy_cipher);
} else {
$mcrypter = new McryptEncrypter($legacy_key);
}
$settings = Setting::getSettings();
if ($settings->ldap_pword=='') {
if ($settings->ldap_pword == '') {
$this->comment('INFO: No LDAP password found. Skipping... ');
} else {
$decrypted_ldap_pword = $mcrypter->decrypt($settings->ldap_pword);
@@ -111,30 +107,28 @@ class RecryptFromMcrypt extends Command
$settings->save();
}
/** @var CustomField[] $custom_fields */
$custom_fields = CustomField::where('field_encrypted','=', 1)->get();
$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.')');
$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}!='') {
if ($asset->{$columnName} != '') {
// Try to decrypt the payload using the legacy app key
try {
$decrypted_field = $mcrypter->decrypt($asset->{$columnName});
@@ -144,14 +138,11 @@ class RecryptFromMcrypt extends Command
$errors[] = ' - ERROR: Could not decrypt field ['.$encrypted_field->name.']: '.$e->getMessage();
}
}
}
$asset->save();
$bar->advance();
}
$bar->finish();
if (count($errors) > 0) {
@@ -162,6 +153,5 @@ class RecryptFromMcrypt extends Command
}
}
}
}
}

View File

@@ -40,31 +40,27 @@ class RegenerateAssetTags extends Command
*/
public function handle()
{
if ($this->confirm('This will regenerate all of the asset tags within your system. This action is data-destructive and should be used with caution. Do you wish to continue?'))
{
if ($this->confirm('This will regenerate all of the asset tags within your system. This action is data-destructive and should be used with caution. Do you wish to continue?')) {
$output['info'] = [];
$output['warn'] = [];
$output['error'] = [];
$settings = Setting::getSettings();
$start_tag = ($this->option('start')) ? $this->option('start') : (($settings->next_auto_tag_base) ? Setting::getSettings()->next_auto_tag_base : 1) ;
$start_tag = ($this->option('start')) ? $this->option('start') : (($settings->next_auto_tag_base) ? Setting::getSettings()->next_auto_tag_base : 1);
$this->info('Starting at '.$start_tag);
$total_assets = Asset::orderBy('id','asc')->get();
$total_assets = Asset::orderBy('id', 'asc')->get();
$bar = $this->output->createProgressBar(count($total_assets));
try {
try {
Artisan::call('backup:run');
} catch (\Exception $e) {
$output['error'][] = $e;
}
foreach ($total_assets as $asset) {
$start_tag++;
$output['info'][] = 'Asset tag:'.$asset->asset_tag;
$asset->asset_tag = $settings->auto_increment_prefix.$settings->auto_increment_prefix.$start_tag;
@@ -76,29 +72,33 @@ class RegenerateAssetTags extends Command
// Use forceSave here to override model level validation
$asset->forceSave();
$start_tag++;
if ($bar) {
$bar->advance();
}
}
$settings->next_auto_tag_base = Asset::zerofill($start_tag, $settings->zerofill_count);
$settings->save();
$bar->finish();
$this->info("\n");
if (($this->option('output')=='all') || ($this->option('output')=='info')) {
if (($this->option('output') == 'all') || ($this->option('output') == 'info')) {
foreach ($output['info'] as $key => $output_text) {
$this->info($output_text);
}
}
if (($this->option('output')=='all') || ($this->option('output')=='warn')) {
if (($this->option('output') == 'all') || ($this->option('output') == 'warn')) {
foreach ($output['warn'] as $key => $output_text) {
$this->warn($output_text);
}
}
if (($this->option('output')=='all') || ($this->option('output')=='error')) {
if (($this->option('output') == 'all') || ($this->option('output') == 'error')) {
foreach ($output['error'] as $key => $output_text) {
$this->error($output_text);
}
}
}
}
}

View File

@@ -48,6 +48,7 @@ class ResetDemoSettings extends Command
$settings->auto_increment_assets = 1;
$settings->logo = 'snipe-logo.png';
$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->default_currency = 'USD';

View File

@@ -43,16 +43,15 @@ class RestoreDeletedUsers extends Command
*/
public function handle()
{
$start_date = $this->option('start_date');
$end_date = $this->option('end_date');
$asset_totals = 0;
$license_totals = 0;
$user_count = 0;
if (($start_date=='') || ($end_date=='')) {
if (($start_date == '') || ($end_date == '')) {
$this->info('ERROR: All fields are required.');
return false;
}
@@ -63,15 +62,15 @@ class RestoreDeletedUsers extends Command
foreach ($users as $user) {
$user_count++;
$user_logs = Actionlog::where('target_id', $user->id)->where('target_type',User::class)
->where('action_type','checkout')->with('item')->get();
$user_logs = Actionlog::where('target_id', $user->id)->where('target_type', User::class)
->where('action_type', 'checkout')->with('item')->get();
$this->info($user_count.'. '.$user->username.' ('.$user->id.') was deleted at '.$user->deleted_at. ' and has '.$user_logs->count().' checkouts associated.');
$this->info($user_count.'. '.$user->username.' ('.$user->id.') was deleted at '.$user->deleted_at.' and has '.$user_logs->count().' checkouts associated.');
foreach ($user_logs as $user_log) {
$this->info(' * '.$user_log->item_type.': '.$user_log->item->name.' - item_id: '.$user_log->item_id);
if ($user_log->item_type==Asset::class) {
if ($user_log->item_type == Asset::class) {
$asset_totals++;
DB::table('assets')
@@ -79,11 +78,10 @@ class RestoreDeletedUsers extends Command
->update(['assigned_to' => $user->id, 'assigned_type'=> User::class]);
$this->info(' ** Asset '.$user_log->item->id.' ('.$user_log->item->asset_tag.') restored to user '.$user->id.'');
} elseif ($user_log->item_type==License::class) {
} elseif ($user_log->item_type == License::class) {
$license_totals++;
$avail_seat = DB::table('license_seats')->where('license_id','=',$user_log->item->id)
$avail_seat = DB::table('license_seats')->where('license_id', '=', $user_log->item->id)
->whereNull('assigned_to')->whereNull('asset_id')->whereBetween('updated_at', [$start_date, $end_date])->first();
if ($avail_seat) {
$this->info(' ** Allocating seat '.$avail_seat->id.' for this License');
@@ -91,27 +89,17 @@ class RestoreDeletedUsers extends Command
DB::table('license_seats')
->where('id', $avail_seat->id)
->update(['assigned_to' => $user->id]);
} else {
$this->warn('ERROR: No available seats for '.$user_log->item->name);
}
}
}
$this->warn('Restoring user '.$user->username.'!');
$user->restore();
}
$this->info($asset_totals.' assets affected');
$this->info($license_totals.' licenses affected');
}
}

View File

@@ -3,7 +3,6 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use ZipArchive;
class RestoreFromBackup extends Command
@@ -23,7 +22,7 @@ class RestoreFromBackup extends Command
*
* @var string
*/
protected $description = 'Restore from a previously created backup';
protected $description = 'Restore from a previously created Snipe-IT backup file';
/**
* Create a new command instance.
@@ -35,6 +34,8 @@ class RestoreFromBackup extends Command
parent::__construct();
}
public static $buffer_size = 1024 * 1024; // use a 1MB buffer, ought to work fine for most cases?
/**
* Execute the console command.
*
@@ -43,20 +44,23 @@ class RestoreFromBackup extends Command
public function handle()
{
$dir = getcwd();
print "Current working directory is: $dir\n";
if( $dir != base_path() ) { // usually only the case when running via webserver, not via command-line
\Log::debug("Current working directory is: $dir, changing directory to: ".base_path());
chdir(base_path()); // TODO - is this *safe* to change on a running script?!
}
//
$filename = $this->argument('filename');
if (!$filename) {
return $this->error("Missing required filename");
if (! $filename) {
return $this->error('Missing required filename');
}
if (!$this->option('force') && !$this->confirm('Are you sure you wish to restore from the given backup file? This can lead to MASSIVE DATA LOSS!')) {
return $this->error("Data loss not confirmed");
if (! $this->option('force') && ! $this->confirm('Are you sure you wish to restore from the given backup file? This can lead to MASSIVE DATA LOSS!')) {
return $this->error('Data loss not confirmed');
}
if (config('database.default') != 'mysql') {
return $this->error("DB_CONNECTION must be MySQL in order to perform a restore. Detected: ".config('database.default'));
return $this->error('DB_CONNECTION must be MySQL in order to perform a restore. Detected: '.config('database.default'));
}
$za = new ZipArchive();
@@ -64,18 +68,18 @@ class RestoreFromBackup extends Command
$errcode = $za->open($filename/* , ZipArchive::RDONLY */); // that constant only exists in PHP 7.4 and higher
if ($errcode !== true) {
$errors = [
ZipArchive::ER_EXISTS => "File already exists.",
ZipArchive::ER_INCONS => "Zip archive inconsistent.",
ZipArchive::ER_INVAL => "Invalid argument.",
ZipArchive::ER_MEMORY => "Malloc failure.",
ZipArchive::ER_NOENT => "No such file.",
ZipArchive::ER_NOZIP => "Not a zip archive.",
ZipArchive::ER_EXISTS => 'File already exists.',
ZipArchive::ER_INCONS => 'Zip archive inconsistent.',
ZipArchive::ER_INVAL => 'Invalid argument.',
ZipArchive::ER_MEMORY => 'Malloc failure.',
ZipArchive::ER_NOENT => 'No such file ('.$filename.') in directory '.$dir.'.',
ZipArchive::ER_NOZIP => 'Not a zip archive.',
ZipArchive::ER_OPEN => "Can't open file.",
ZipArchive::ER_READ => "Read error.",
ZipArchive::ER_SEEK => "Seek error."
ZipArchive::ER_READ => 'Read error.',
ZipArchive::ER_SEEK => 'Seek error.',
];
return $this->error("Could not access file: ".$filename." - ".array_key_exists($errcode,$errors) ? $errors[$errcode] : " Unknown reason: $errcode");
return $this->error('Could not access file: '.$filename.' - '.array_key_exists($errcode, $errors) ? $errors[$errcode] : " Unknown reason: $errcode");
}
@@ -86,11 +90,11 @@ class RestoreFromBackup extends Command
'storage/private_uploads/assetmodels',
'storage/private_uploads/users',
'storage/private_uploads/licenses',
'storage/private_uploads/signatures'
'storage/private_uploads/signatures',
];
$private_files = [
'storage/oauth-private.key',
'storage/oauth-public.key'
'storage/oauth-public.key',
];
$public_dirs = [
'public/uploads/companies',
@@ -108,16 +112,16 @@ class RestoreFromBackup extends Command
'public/uploads/models',
'public/uploads/categories',
'public/uploads/avatars',
'public/uploads/manufacturers'
'public/uploads/manufacturers',
];
$public_files = [
'public/uploads/logo.*',
'public/uploads/setting-email_logo*',
'public/uploads/setting-label_logo*',
'public/uploads/setting-logo*',
'public/uploads/favicon.*',
'public/uploads/favicon-uploaded.*'
'public/uploads/favicon-uploaded.*',
];
$all_files = $private_dirs + $public_dirs;
@@ -127,64 +131,64 @@ class RestoreFromBackup extends Command
$interesting_files = [];
$boring_files = [];
for ($i=0; $i<$za->numFiles;$i++) {
for ($i = 0; $i < $za->numFiles; $i++) {
$stat_results = $za->statIndex($i);
// echo "index: $i\n";
// print_r($stat_results);
$raw_path = $stat_results['name'];
if(strpos($raw_path,'\\')!==false) { //found a backslash, swap it to forward-slash
$raw_path = strtr($raw_path,'\\','/');
if (strpos($raw_path, '\\') !== false) { //found a backslash, swap it to forward-slash
$raw_path = strtr($raw_path, '\\', '/');
//print "Translating file: ".$stat_results['name']." to: ".$raw_path."\n";
}
// skip macOS resource fork files (?!?!?!)
if(strpos($raw_path,"__MACOSX")!==false && strpos($raw_path,"._") !== false) {
if (strpos($raw_path, '__MACOSX') !== false && strpos($raw_path, '._') !== false) {
//print "SKIPPING macOS Resource fork file: $raw_path\n";
$boring_files[] = $raw_path;
continue;
}
if(@pathinfo($raw_path)['extension'] == "sql") {
print "Found a sql file!\n";
if (@pathinfo($raw_path)['extension'] == 'sql') {
\Log::debug("Found a sql file!");
$sqlfiles[] = $raw_path;
$sqlfile_indices[] = $i;
continue;
}
foreach(array_merge($private_dirs,$public_dirs) as $dir) {
$last_pos = strrpos($raw_path,$dir.'/');
if($last_pos !== false ) {
foreach (array_merge($private_dirs, $public_dirs) as $dir) {
$last_pos = strrpos($raw_path, $dir.'/');
if ($last_pos !== false) {
//print("INTERESTING - last_pos is $last_pos when searching $raw_path for $dir - last_pos+strlen(\$dir) is: ".($last_pos+strlen($dir))." and strlen(\$rawpath) is: ".strlen($raw_path)."\n");
//print("We would copy $raw_path to $dir.\n"); //FIXME append to a path?
$interesting_files[$raw_path] = ['dest' =>$dir, 'index' => $i];
continue 2;
if($last_pos + strlen($dir) +1 == strlen($raw_path)) {
if ($last_pos + strlen($dir) + 1 == strlen($raw_path)) {
// we don't care about that; we just want files with the appropriate prefix
//print("FOUND THE EXACT DIRECTORY: $dir AT: $raw_path!!!\n");
}
}
}
$good_extensions = ["png","gif","jpg","svg","jpeg","doc","docx","pdf","txt",
"zip","rar","xls","xlsx","lic","xml","rtf", "webp","key","ico"];
foreach(array_merge($private_files, $public_files) as $file) {
$has_wildcard = (strpos($file,"*") !== false);
if($has_wildcard) {
$file = substr($file,0,-1); //trim last character (which should be the wildcard)
$good_extensions = ['png', 'gif', 'jpg', 'svg', 'jpeg', 'doc', 'docx', 'pdf', 'txt',
'zip', 'rar', 'xls', 'xlsx', 'lic', 'xml', 'rtf', 'webp', 'key', 'ico', ];
foreach (array_merge($private_files, $public_files) as $file) {
$has_wildcard = (strpos($file, '*') !== false);
if ($has_wildcard) {
$file = substr($file, 0, -1); //trim last character (which should be the wildcard)
}
$last_pos = strrpos($raw_path,$file); // no trailing slash!
if($last_pos !== false ) {
$last_pos = strrpos($raw_path, $file); // no trailing slash!
if ($last_pos !== false) {
$extension = strtolower(pathinfo($raw_path, PATHINFO_EXTENSION));
if(!in_array($extension, $good_extensions)) {
$this->warn("Potentially unsafe file ".$raw_path." is being skipped");
if (! in_array($extension, $good_extensions)) {
$this->warn('Potentially unsafe file '.$raw_path.' is being skipped');
$boring_files[] = $raw_path;
continue 2;
}
//print("INTERESTING - last_pos is $last_pos when searching $raw_path for $file - last_pos+strlen(\$file) is: ".($last_pos+strlen($file))." and strlen(\$rawpath) is: ".strlen($raw_path)."\n");
//no wildcards found in $file, process 'normally'
if($last_pos + strlen($file) == strlen($raw_path) || $has_wildcard) { //again, no trailing slash. or this is a wildcard and we just take it.
if ($last_pos + strlen($file) == strlen($raw_path) || $has_wildcard) { //again, no trailing slash. or this is a wildcard and we just take it.
// print("FOUND THE EXACT FILE: $file AT: $raw_path!!!\n"); //we *do* care about this, though.
$interesting_files[$raw_path] = ['dest' => dirname($file),'index' => $i];
$interesting_files[$raw_path] = ['dest' => dirname($file), 'index' => $i];
continue 2;
}
}
@@ -194,11 +198,11 @@ class RestoreFromBackup extends Command
// print_r($interesting_files);exit(-1);
if( count($sqlfiles) != 1) {
return $this->error("There should be exactly *one* sql backup file found, found: ".( count($sqlfiles) == 0 ? "None" : implode(", ",$sqlfiles)));
if (count($sqlfiles) != 1) {
return $this->error('There should be exactly *one* sql backup file found, found: '.(count($sqlfiles) == 0 ? 'None' : implode(', ', $sqlfiles)));
}
if( strpos($sqlfiles[0], "db-dumps") === false ) {
if (strpos($sqlfiles[0], 'db-dumps') === false) {
//return $this->error("SQL backup file is missing 'db-dumps' component of full pathname: ".$sqlfiles[0]);
//older Snipe-IT installs don't have the db-dumps subdirectory component
}
@@ -207,16 +211,25 @@ class RestoreFromBackup extends Command
$pipes = [];
$env_vars = getenv();
$env_vars['MYSQL_PWD'] = config("database.connections.mysql.password");
$proc_results = proc_open("mysql -h ".escapeshellarg(config('database.connections.mysql.host'))." -u ".escapeshellarg(config('database.connections.mysql.username'))." ".escapeshellarg(config('database.connections.mysql.database')), // yanked -p since we pass via ENV
[0 => ['pipe','r'],1 => ['pipe','w'],2 => ['pipe','w']],
$env_vars['MYSQL_PWD'] = config('database.connections.mysql.password');
// TODO notes: we are stealing the dump_binary_path (which *probably* also has your copy of the mysql binary in it. But it might not, so we might need to extend this)
// we unilaterally prepend a slash to the `mysql` command. This might mean your path could look like /blah/blah/blah//mysql - which should be fine. But maybe in some environments it isn't?
$mysql_binary = config('database.connections.mysql.dump.dump_binary_path').'/mysql';
if( ! file_exists($mysql_binary) ) {
return $this->error("mysql tool at: '$mysql_binary' does not exist, cannot restore. Please edit DB_DUMP_PATH in your .env to point to a directory that contains the mysqldump and mysql binary");
}
$proc_results = proc_open("$mysql_binary -h ".escapeshellarg(config('database.connections.mysql.host')).' -u '.escapeshellarg(config('database.connections.mysql.username')).' '.escapeshellarg(config('database.connections.mysql.database')), // yanked -p since we pass via ENV
[0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']],
$pipes,
null,
$env_vars); // this is not super-duper awesome-secure, but definitely more secure than showing it on the CLI, or dropping temporary files with passwords in them.
if($proc_results === false) {
return $this->error("Unable to invoke mysql via CLI");
if ($proc_results === false) {
return $this->error('Unable to invoke mysql via CLI');
}
stream_set_blocking($pipes[1], false); // use non-blocking reads for stdout
stream_set_blocking($pipes[2], false); // use non-blocking reads for stderr
// $this->info("Stdout says? ".fgets($pipes[1])); //FIXME: I think we might need to set non-blocking mode to use this properly?
// $this->info("Stderr says? ".fgets($pipes[2])); //FIXME: ditto, same.
// should we read stdout?
@@ -232,20 +245,36 @@ class RestoreFromBackup extends Command
$this->info($stdout);
$stderr = fgets($pipes[2]);
$this->info($stderr);
return false;
}
$bytes_read = 0;
while(($buffer = fgets($sql_contents)) !== false ) {
//$this->info("Buffer is: '$buffer'");
$bytes_written = fwrite($pipes[0],$buffer);
if($bytes_written === false) {
$stdout = fgets($pipes[1]);
$this->info($stdout);
$stderr = fgets($pipes[2]);
$this->info($stderr);
return false;
try {
while (($buffer = fgets($sql_contents, self::$buffer_size)) !== false) {
$bytes_read += strlen($buffer);
// \Log::debug("Buffer is: '$buffer'");
$bytes_written = fwrite($pipes[0], $buffer);
if ($bytes_written === false) {
throw new Exception("Unable to write to pipe");
}
}
} catch (\Exception $e) {
\Log::error("Error during restore!!!! ".$e->getMessage());
$err_out = fgets($pipes[1]);
$err_err = fgets($pipes[2]);
\Log::error("Error OUTPUT: ".$err_out);
$this->info($err_out);
\Log::error("Error ERROR : ".$err_err);
$this->error($err_err);
throw $e;
}
if (!feof($sql_contents) || $bytes_read == 0) {
return $this->error("Not at end of file for sql file, or zero bytes read. aborting!");
}
fclose($pipes[0]);
fclose($sql_contents);
@@ -257,41 +286,40 @@ class RestoreFromBackup extends Command
//wait, have to do fclose() on all pipes first?
$close_results = proc_close($proc_results);
if($close_results != 0) {
return $this->error("There may have been a problem with the database import: Error number ".$close_results);
if ($close_results != 0) {
return $this->error('There may have been a problem with the database import: Error number '.$close_results);
}
//and now copy the files over too (right?)
//FIXME - we don't prune the filesystem space yet!!!!
if($this->option('no-progress')) {
if ($this->option('no-progress')) {
$bar = null;
} else {
$bar = $this->output->createProgressBar(count($interesting_files));
}
foreach($interesting_files AS $pretty_file_name => $file_details) {
foreach ($interesting_files as $pretty_file_name => $file_details) {
$ugly_file_name = $za->statIndex($file_details['index'])['name'];
$fp = $za->getStream($ugly_file_name);
//$this->info("Weird problem, here are file details? ".print_r($file_details,true));
$migrated_file = fopen($file_details['dest']."/".basename($pretty_file_name),"w");
while(($buffer = fgets($fp))!== false) {
fwrite($migrated_file,$buffer);
$migrated_file = fopen($file_details['dest'].'/'.basename($pretty_file_name), 'w');
while (($buffer = fgets($fp, self::$buffer_size)) !== false) {
fwrite($migrated_file, $buffer);
}
fclose($migrated_file);
fclose($fp);
//$this->info("Wrote $ugly_file_name to $pretty_file_name");
if($bar) {
if ($bar) {
$bar->advance();
}
}
if($bar) {
if ($bar) {
$bar->finish();
$this->line("");
$this->line('');
} else {
$this->info(count($interesting_files)." files were succesfully transferred");
$this->info(count($interesting_files).' files were succesfully transferred');
}
foreach($boring_files as $boring_file) {
$this->warn($boring_file." was skipped.");
foreach ($boring_files as $boring_file) {
$this->warn($boring_file.' was skipped.');
}
}
}

View File

@@ -2,12 +2,12 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Artisan;
use App\Models\CustomField;
use App\Models\Asset;
use App\Models\CustomField;
use App\Models\Setting;
use \Illuminate\Encryption\Encrypter;
use Artisan;
use Illuminate\Console\Command;
use Illuminate\Encryption\Encrypter;
class RotateAppKey extends Command
{
@@ -42,9 +42,7 @@ class RotateAppKey extends Command
*/
public function handle()
{
if ($this->confirm("\n****************************************************\nTHIS WILL MODIFY YOUR APP_KEY AND DE-CRYPT YOUR ENCRYPTED CUSTOM FIELDS AND \nRE-ENCRYPT THEM WITH A NEWLY GENERATED KEY. \n\nThere is NO undo. \n\nMake SURE you have a database backup and a backup of your .env generated BEFORE running this command. \n\nIf you do not save the newly generated APP_KEY to your .env in this process, \nyour encrypted data will no longer be decryptable. \n\nAre you SURE you wish to continue, and have confirmed you have a database backup and an .env backup? ")) {
if ($this->confirm("\n****************************************************\nTHIS WILL MODIFY YOUR APP_KEY AND DE-CRYPT YOUR ENCRYPTED CUSTOM FIELDS AND \nRE-ENCRYPT THEM WITH A NEWLY GENERATED KEY. \n\nThere is NO undo. \n\nMake SURE you have a database backup and a backup of your .env generated BEFORE running this command. \n\nIf you do not save the newly generated APP_KEY to your .env in this process, \nyour encrypted data will no longer be decryptable. \n\nAre you SURE you wish to continue, and have confirmed you have a database backup and an .env backup? ")) {
// Get the existing app_key and ciphers
// We put them in a variable since we clear the cache partway through here.
@@ -73,33 +71,26 @@ class RotateAppKey extends Command
$fields = CustomField::where('field_encrypted', '1')->get();
foreach ($fields as $field) {
$assets = Asset::whereNotNull($field->db_column)->get();
foreach ($assets as $asset) {
$asset->{$field->db_column} = $oldEncrypter->decrypt($asset->{$field->db_column});
$this->line('DECRYPTED: '. $field->db_column);
$this->line('DECRYPTED: '.$field->db_column);
$asset->{$field->db_column} = $newEncrypter->encrypt($asset->{$field->db_column});
$this->line('ENCRYPTED: '.$field->db_column);
$asset->save();
}
}
// Handle the LDAP password if one is provided
$setting = Setting::first();
if ($setting->ldap_pword!='') {
$setting->ldap_pword = $oldEncrypter->decrypt($setting->ldap_pword);
$setting->ldap_pword = $newEncrypter->encrypt($setting->ldap_pword);
if ($setting->ldap_pword != '') {
$setting->ldap_pword = $oldEncrypter->decrypt($setting->ldap_pword);
$setting->ldap_pword = $newEncrypter->encrypt($setting->ldap_pword);
$setting->save();
$this->warn('LDAP password has been re-encrypted.');
}
} else {
$this->info('This operation has been canceled. No changes have been made.');
}
@@ -113,7 +104,6 @@ class RotateAppKey extends Command
*/
protected function writeNewEnvironmentFileWith($key)
{
file_put_contents($this->laravel->environmentFilePath(), preg_replace(
$this->keyReplacementPattern(),
'APP_KEY='.$key,
@@ -129,7 +119,7 @@ class RotateAppKey extends Command
protected function keyReplacementPattern()
{
$escaped = preg_quote('='.$this->laravel['config']['app.key'], '/');
return "/^APP_KEY{$escaped}/m";
}
}

View File

@@ -39,22 +39,16 @@ class SendCurrentInventoryToUsers extends Command
*/
public function handle()
{
$users = User::whereNull('deleted_at')->whereNotNull('email')->with('assets', 'accessories', 'licenses')->get();
$count = 0;
foreach ($users as $user) {
if (($user->assets->count() > 0) || ($user->accessories->count() > 0) || ($user->licenses->count() > 0))
{
if (($user->assets->count() > 0) || ($user->accessories->count() > 0) || ($user->licenses->count() > 0)) {
$count++;
$user->notify((new CurrentInventory($user)));
}
}
$this->info($count.' users notified.');
}
}

View File

@@ -3,12 +3,12 @@
namespace App\Console\Commands;
use App\Models\Asset;
use App\Models\Recipients\AlertRecipient;
use App\Models\Setting;
use App\Notifications\ExpectedCheckinAdminNotification;
use App\Notifications\ExpectedCheckinNotification;
use Carbon\Carbon;
use Illuminate\Console\Command;
use App\Models\Recipients\AlertRecipient;
class SendExpectedCheckinAlerts extends Command
{
@@ -41,12 +41,12 @@ class SendExpectedCheckinAlerts extends Command
*/
public function handle()
{
$settings = Setting::getSettings();
$settings = Setting::getSettings();
$whenNotify = Carbon::now()->addDays(7);
$assets = Asset::with('assignedTo')->whereNotNull('assigned_to')->whereNotNull('expected_checkin')->where('expected_checkin', '<=', $whenNotify)->get();
$assets = Asset::with('assignedTo')->whereNotNull('assigned_to')->whereNotNull('expected_checkin')->where('expected_checkin', '<=', $whenNotify)->get();
$this->info($whenNotify . ' is deadline');
$this->info($assets->count() . ' assets');
$this->info($whenNotify.' is deadline');
$this->info($assets->count().' assets');
foreach ($assets as $asset) {
if ($asset->assigned && $asset->checkedOutToUser()) {

View File

@@ -41,7 +41,7 @@ class SendExpirationAlerts extends Command
*/
public function handle()
{
$settings = Setting::getSettings();
$settings = Setting::getSettings();
$threshold = $settings->alert_interval;
if (($settings->alert_email != '') && ($settings->alerts_enabled == 1)) {

View File

@@ -4,13 +4,13 @@ namespace App\Console\Commands;
use App\Models\Asset;
use App\Models\License;
use App\Models\Recipients;
use App\Models\Setting;
use App\Notifications\ExpiringAssetsNotification;
use App\Models\Recipients;
use DB;
use Illuminate\Console\Command;
use App\Notifications\SendUpcomingAuditNotification;
use Carbon\Carbon;
use DB;
use Illuminate\Console\Command;
class SendUpcomingAuditReport extends Command
{
@@ -54,7 +54,6 @@ class SendUpcomingAuditReport extends Command
return new \App\Models\Recipients\AlertRecipient($item);
});
// Assets due for auditing
$assets = Asset::whereNotNull('next_audit_date')
@@ -62,7 +61,6 @@ class SendUpcomingAuditReport extends Command
->orderBy('last_audit_date', 'asc')->get();
if ($assets->count() > 0) {
$this->info(trans_choice('mail.upcoming-audits', $assets->count(),
['count' => $assets->count(), 'threshold' => $settings->audit_warning_days]));
\Notification::send($recipients, new SendUpcomingAuditNotification($assets, $settings->audit_warning_days));
@@ -70,14 +68,11 @@ class SendUpcomingAuditReport extends Command
} else {
$this->info('No assets to be audited. No report sent.');
}
} elseif ($settings->alert_email=='') {
} elseif ($settings->alert_email == '') {
$this->error('Could not send email. No alert email configured in settings');
} elseif (!$settings->audit_warning_days) {
} elseif (! $settings->audit_warning_days) {
$this->error('No audit warning days set in Admin Notifications. No mail will be sent.');
} elseif ($settings->alerts_enabled!=1) {
} elseif ($settings->alerts_enabled != 1) {
$this->info('Alerts are disabled in the settings. No mail will be sent');
} else {
$this->error('Something went wrong. :( ');
@@ -85,7 +80,5 @@ class SendUpcomingAuditReport extends Command
$this->error('Admin Audit Warning Setting: '.$settings->audit_warning_days);
$this->error('Admin Alerts Emnabled: '.$settings->alerts_enabled);
}
}
}

View File

@@ -39,37 +39,38 @@ class SyncAssetCounters extends Command
public function handle()
{
$start = microtime(true);
// We need the whole count of all assets in order to set up the progress bar
$assets_count = Asset::withTrashed()->count();
$bar = $this->output->createProgressBar($assets_count);
$assets = Asset::withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as user_requests_count')
->withTrashed()->get();
->withTrashed()->chunk(100, function ($assets) use ($bar) {
if ($assets) {
if ($assets->count() > 0) {
$bar = $this->output->createProgressBar($assets->count());
foreach ($assets as $asset) {
$asset->checkin_counter = (int) $asset->checkins_count;
$asset->checkout_counter = (int) $asset->checkouts_count;
$asset->requests_counter = (int) $asset->user_requests_count;
$asset->unsetEventDispatcher();
$asset->save();
$output['info'][] = 'Asset: ' . $asset->id . ' has ' . $asset->checkin_counter . ' checkins, ' . $asset->checkout_counter . ' checkouts, and ' . $asset->requests_counter . ' requests';
$bar->advance();
}
$bar->finish();
if ($assets->count() > 0) {
foreach ($output['info'] as $key => $output_text) {
$this->info($output_text);
}
foreach ($assets as $asset) {
$time_elapsed_secs = microtime(true) - $start;
$this->info('Sync executed in ' . $time_elapsed_secs . ' seconds');
$asset->checkin_counter = (int) $asset->checkins_count;
$asset->checkout_counter = (int) $asset->checkouts_count;
$asset->requests_counter = (int) $asset->user_requests_count;
$asset->unsetEventDispatcher();
$asset->save();
$bar->advance();
\Log::debug('Asset: '.$asset->id.' has '.$asset->checkin_counter.' checkins, '.$asset->checkout_counter.' checkouts, and '.$asset->requests_counter.' requests');
}
} else {
$this->info('No assets to sync');
}
});
}
$bar->finish();
$time_elapsed_secs = microtime(true) - $start;
$this->info("\nSync of ".$assets_count.' assets executed in '.$time_elapsed_secs.' seconds');
}

View File

@@ -38,7 +38,6 @@ class SyncAssetLocations extends Command
*/
public function handle()
{
$output['info'] = [];
$output['warn'] = [];
$output['error'] = [];
@@ -51,96 +50,89 @@ class SyncAssetLocations extends Command
$output['info'][] = 'There are '.$rtd_assets->count().' unassigned assets.';
foreach ($rtd_assets as $rtd_asset) {
$output['info'][] = 'Setting Unassigned Asset ' . $rtd_asset->id . ' ('.$rtd_asset->asset_tag.') to location: ' . $rtd_asset->rtd_location_id . " because their default location is: " . $rtd_asset->rtd_location_id;
$rtd_asset->location_id=$rtd_asset->rtd_location_id;
$output['info'][] = 'Setting Unassigned Asset '.$rtd_asset->id.' ('.$rtd_asset->asset_tag.') to location: '.$rtd_asset->rtd_location_id.' because their default location is: '.$rtd_asset->rtd_location_id;
$rtd_asset->location_id = $rtd_asset->rtd_location_id;
$rtd_asset->unsetEventDispatcher();
$rtd_asset->save();
$bar->advance();
}
$assigned_user_assets = Asset::where('assigned_type','App\Models\User')->whereNotNull('assigned_to')->whereNull('deleted_at')->get();
$assigned_user_assets = Asset::where('assigned_type', \App\Models\User::class)->whereNotNull('assigned_to')->whereNull('deleted_at')->get();
$output['info'][] = 'There are '.$assigned_user_assets->count().' assets checked out to users.';
foreach ($assigned_user_assets as $assigned_user_asset) {
if (($assigned_user_asset->assignedTo) && ($assigned_user_asset->assignedTo->userLoc)) {
$new_location = $assigned_user_asset->assignedTo->userLoc->id;
$output['info'][] ='Setting User Asset ' . $assigned_user_asset->id . ' ('.$assigned_user_asset->asset_tag.') to ' . $assigned_user_asset->assignedTo->userLoc->name . ' which is id: ' . $new_location;
$output['info'][] = 'Setting User Asset '.$assigned_user_asset->id.' ('.$assigned_user_asset->asset_tag.') to '.$assigned_user_asset->assignedTo->userLoc->name.' which is id: '.$new_location;
} else {
$output['warn'][] ='Asset ' . $assigned_user_asset->id . ' ('.$assigned_user_asset->asset_tag.') still has no location! ';
$output['warn'][] = 'Asset '.$assigned_user_asset->id.' ('.$assigned_user_asset->asset_tag.') still has no location! ';
$new_location = $assigned_user_asset->rtd_location_id;
}
$assigned_user_asset->location_id=$new_location;
$assigned_user_asset->location_id = $new_location;
$assigned_user_asset->unsetEventDispatcher();
$assigned_user_asset->save();
$bar->advance();
}
$assigned_location_assets = Asset::where('assigned_type','App\Models\Location')
$assigned_location_assets = Asset::where('assigned_type', \App\Models\Location::class)
->whereNotNull('assigned_to')->whereNull('deleted_at')->get();
$output['info'][] = 'There are '.$assigned_location_assets->count().' assets checked out to locations.';
foreach ($assigned_location_assets as $assigned_location_asset) {
if ($assigned_location_asset->assignedTo) {
$assigned_location_asset->location_id = $assigned_location_asset->assignedTo->id;
$output['info'][] ='Setting Location Assigned asset ' . $assigned_location_asset->id . ' ('.$assigned_location_asset->asset_tag.') that is checked out to '.$assigned_location_asset->assignedTo->name.' (#'.$assigned_location_asset->assignedTo->id.') to location: ' . $assigned_location_asset->assetLoc()->id;
$output['info'][] = 'Setting Location Assigned asset '.$assigned_location_asset->id.' ('.$assigned_location_asset->asset_tag.') that is checked out to '.$assigned_location_asset->assignedTo->name.' (#'.$assigned_location_asset->assignedTo->id.') to location: '.$assigned_location_asset->assetLoc()->id;
$assigned_location_asset->unsetEventDispatcher();
$assigned_location_asset->save();
} else {
$output['warn'][] ='Asset ' . $assigned_location_asset->id . ' ('.$assigned_location_asset->asset_tag.') did not return a valid associated location - perhaps it was deleted?';
$output['warn'][] = 'Asset '.$assigned_location_asset->id.' ('.$assigned_location_asset->asset_tag.') did not return a valid associated location - perhaps it was deleted?';
}
$bar->advance();
}
// Assigned to assets
$assigned_asset_assets = Asset::where('assigned_type','App\Models\Asset')
$assigned_asset_assets = Asset::where('assigned_type', \App\Models\Asset::class)
->whereNotNull('assigned_to')->whereNull('deleted_at')->get();
$output['info'][] ='Asset-assigned assets: '.$assigned_asset_assets->count();
$output['info'][] = 'Asset-assigned assets: '.$assigned_asset_assets->count();
foreach ($assigned_asset_assets as $assigned_asset_asset) {
foreach ($assigned_asset_assets as $assigned_asset_asset) {
// Check to make sure there aren't any invalid relationships
if ($assigned_asset_asset->assetLoc()) {
$assigned_asset_asset->location_id = $assigned_asset_asset->assetLoc()->id;
$output['info'][] ='Setting Asset Assigned asset ' . $assigned_asset_asset->assetLoc()->id. ' ('.$assigned_asset_asset->asset_tag.') location to: ' . $assigned_asset_asset->assetLoc()->id;
$assigned_asset_asset->unsetEventDispatcher();
$assigned_asset_asset->save();
} else {
$output['warn'][] ='Asset Assigned asset ' . $assigned_asset_asset->id. ' ('.$assigned_asset_asset->asset_tag.') does not seem to have a valid location';
}
$bar->advance();
if ($assigned_asset_asset->assetLoc()) {
$assigned_asset_asset->location_id = $assigned_asset_asset->assetLoc()->id;
$output['info'][] = 'Setting Asset Assigned asset '.$assigned_asset_asset->assetLoc()->id.' ('.$assigned_asset_asset->asset_tag.') location to: '.$assigned_asset_asset->assetLoc()->id;
$assigned_asset_asset->unsetEventDispatcher();
$assigned_asset_asset->save();
} else {
$output['warn'][] = 'Asset Assigned asset '.$assigned_asset_asset->id.' ('.$assigned_asset_asset->asset_tag.') does not seem to have a valid location';
}
$unlocated_assets = Asset::whereNull("location_id")->whereNull('deleted_at')->get();
$output['info'][] ='Assets still without a location: '.$unlocated_assets->count();
foreach($unlocated_assets as $unlocated_asset) {
$output['warn'][] ='Asset: '.$unlocated_asset->id.' still has no location. ';
$bar->advance();
}
$unlocated_assets = Asset::whereNull('location_id')->whereNull('deleted_at')->get();
$output['info'][] = 'Assets still without a location: '.$unlocated_assets->count();
foreach ($unlocated_assets as $unlocated_asset) {
$output['warn'][] = 'Asset: '.$unlocated_asset->id.' still has no location. ';
$bar->advance();
}
$bar->finish();
$this->info("\n");
if (($this->option('output')=='all') || ($this->option('output')=='info')) {
if (($this->option('output') == 'all') || ($this->option('output') == 'info')) {
foreach ($output['info'] as $key => $output_text) {
$this->info($output_text);
}
}
if (($this->option('output')=='all') || ($this->option('output')=='warn')) {
if (($this->option('output') == 'all') || ($this->option('output') == 'warn')) {
foreach ($output['warn'] as $key => $output_text) {
$this->warn($output_text);
}
}
if (($this->option('output')=='all') || ($this->option('output')=='error')) {
if (($this->option('output') == 'all') || ($this->option('output') == 'error')) {
foreach ($output['error'] as $key => $output_text) {
$this->error($output_text);
}
}
}
}

View File

@@ -6,7 +6,6 @@ use Illuminate\Console\Command;
class SystemBackup extends Command
{
/**
* The console command name.
*
@@ -40,6 +39,5 @@ class SystemBackup extends Command
{
//
$this->call('backup:run');
}
}

View File

@@ -37,7 +37,6 @@ class Version extends Command
*/
public function handle()
{
$use_branch = $this->option('branch');
$use_type = $this->option('type');
$git_branch = trim(shell_exec('git rev-parse --abbrev-ref HEAD'));
@@ -54,72 +53,66 @@ class Version extends Command
$this->line('Type is: '.$use_type);
$this->line('Current version is: '.$full_hash_version);
if (count($version)==3) {
if (count($version) == 3) {
$this->line('This does not look like an alpha/beta release.');
} else {
if (array_key_exists('3',$version)) {
if (array_key_exists('3', $version)) {
$this->line('The current version looks like a beta release.');
$prerelease_version = $version[1];
$hash_version = $version[3];
}
}
$app_version_raw = explode('.', $app_version);
$maj = str_replace('v', '', $app_version_raw[0]);
$min = $app_version_raw[1];
$patch = '';
// This is a major release that might not have a third .0
if (array_key_exists(2, $app_version_raw)) {
$patch = $app_version_raw[2];
}
if ($use_type=='major') {
$app_version = "v".($maj + 1).".$min.$patch";
} elseif ($use_type=='minor') {
$app_version = "v"."$maj.".($min + 1).".$patch";
} elseif ($use_type=='pre') {
$pre_raw = str_replace('beta','', $prerelease_version);
$pre_raw = str_replace('alpha','', $pre_raw);
$pre_raw = str_ireplace('rc','', $pre_raw);
if ($use_type == 'major') {
$app_version = 'v'.($maj + 1).".$min.$patch";
} elseif ($use_type == 'minor') {
$app_version = 'v'."$maj.".($min + 1).".$patch";
} elseif ($use_type == 'pre') {
$pre_raw = str_replace('beta', '', $prerelease_version);
$pre_raw = str_replace('alpha', '', $pre_raw);
$pre_raw = str_ireplace('rc', '', $pre_raw);
$pre_raw = $pre_raw++;
$this->line('Setting the pre-release to '. $prerelease_version.'-'.$pre_raw);
$app_version = "v"."$maj.".($min + 1).".$patch";
} elseif ($use_type=='patch') {
$app_version = "v" . "$maj.$min." . ($patch + 1);
$this->line('Setting the pre-release to '.$prerelease_version.'-'.$pre_raw);
$app_version = 'v'."$maj.".($min + 1).".$patch";
} elseif ($use_type == 'patch') {
$app_version = 'v'."$maj.$min.".($patch + 1);
// If nothing is passed, leave the version as it is, just increment the build
} else {
$app_version = "v" . "$maj.$min." . $patch;
$app_version = 'v'."$maj.$min.".$patch;
}
// Determine if this tag already exists, or if this prior to a release
$this->line('Running: git rev-parse master '.$current_app_version);
// $pre_release = trim(shell_exec('git rev-parse '.$use_branch.' '.$current_app_version.' 2>&1 1> /dev/null'));
if ($use_branch=='develop') {
if ($use_branch == 'develop') {
$app_version = $app_version.'-pre';
}
$full_app_version = $app_version.' - build '.$build_version.'-'.$hash_version;
$array = var_export(
array(
[
'app_version' => $app_version,
'full_app_version' => $full_app_version,
'build_version' => $build_version,
'prerelease_version' => $prerelease_version,
'hash_version' => $hash_version,
'full_hash' => $full_hash_version,
'branch' => $git_branch),
'branch' => $git_branch, ],
true
);
// Construct our file content
$content = <<<CON
@@ -129,7 +122,6 @@ CON;
// And finally write the file and output the current version
\File::put($versionFile, $content);
$this->info('Setting NEW version: '. $full_app_version.' ('.$git_branch.')');
$this->info('Setting NEW version: '.$full_app_version.' ('.$git_branch.')');
}
}

View File

@@ -10,7 +10,6 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
@@ -25,6 +24,7 @@ class Kernel extends ConsoleKernel
$schedule->command('snipeit:backup')->weekly();
$schedule->command('backup:clean')->daily();
$schedule->command('snipeit:upcoming-audits')->daily();
$schedule->command('auth:clear-resets')->everyFifteenMinutes();
}
/**

View File

@@ -18,6 +18,6 @@ class CheckoutAccepted
*/
public function __construct(CheckoutAcceptance $acceptance)
{
$this->acceptance = $acceptance;
$this->acceptance = $acceptance;
}
}

View File

@@ -10,7 +10,7 @@ use Illuminate\Queue\SerializesModels;
class CheckoutDeclined
{
use Dispatchable, SerializesModels;
/**
* Create a new event instance.
*
@@ -18,6 +18,6 @@ class CheckoutDeclined
*/
public function __construct(CheckoutAcceptance $acceptance)
{
$this->acceptance = $acceptance;
$this->acceptance = $acceptance;
}
}

View File

@@ -25,8 +25,8 @@ class CheckoutableCheckedIn
{
$this->checkoutable = $checkoutable;
$this->checkedOutTo = $checkedOutTo;
$this->checkedInBy = $checkedInBy;
$this->note = $note;
$this->action_date = $action_date ?? date('Y-m-d');
$this->checkedInBy = $checkedInBy;
$this->note = $note;
$this->action_date = $action_date ?? date('Y-m-d');
}
}

View File

@@ -25,6 +25,6 @@ class CheckoutableCheckedOut
$this->checkoutable = $checkoutable;
$this->checkedOutTo = $checkedOutTo;
$this->checkedOutBy = $checkedOutBy;
$this->note = $note;
$this->note = $note;
}
}

View File

@@ -6,17 +6,17 @@ use Exception;
class CheckoutNotAllowed extends Exception
{
private $errorMessage;
function __construct($errorMessage = null)
public function __construct($errorMessage = null)
{
$this->errorMessage = $errorMessage;
parent::__construct($errorMessage);
}
public function __toString()
{
return is_null($this->errorMessage) ? "A checkout is not allowed under these circumstances" : $this->errorMessage;
return is_null($this->errorMessage) ? 'A checkout is not allowed under these circumstances' : $this->errorMessage;
}
}

View File

@@ -2,19 +2,19 @@
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use App\Helpers\Helper;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\AuthenticationException;
use Log;
use Throwable;
use JsonException;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
* A list of the exception types that are not reported.
*
* @var array
*/
@@ -27,7 +27,7 @@ class Handler extends ExceptionHandler
\Illuminate\Validation\ValidationException::class,
\Intervention\Image\Exception\NotSupportedException::class,
\League\OAuth2\Server\Exception\OAuthServerException::class,
JsonException::class
JsonException::class,
];
/**
@@ -35,10 +35,10 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $exception
* @param \Throwable $exception
* @return void
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
if ($this->shouldReport($exception)) {
\Log::error($exception);
@@ -48,12 +48,12 @@ class Handler extends ExceptionHandler
/**
* Render an exception into an HTTP response.
*
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
public function render($request, Throwable $e)
{
@@ -106,7 +106,7 @@ class Handler extends ExceptionHandler
}
/**
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
@@ -122,15 +122,27 @@ class Handler extends ExceptionHandler
return redirect()->guest('login');
}
/**
* Convert a validation exception into a JSON response.
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Validation\ValidationException $exception
* @return \Illuminate\Http\JsonResponse
* @var array
*/
protected function invalidJson($request, ValidationException $exception)
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
return response()->json(Helper::formatStandardApiResponse('error', null, $exception->errors(), 422));
$this->reportable(function (Throwable $e) {
//
});
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,17 @@
<?php
namespace App\Helpers;
use Illuminate\Support\Facades\Storage;
class StorageHelper
{
static function downloader($filename, $disk = 'default') {
if($disk == 'default') {
public static function downloader($filename, $disk = 'default')
{
if ($disk == 'default') {
$disk = config('filesystems.default');
}
switch(config("filesystems.disks.$disk.driver")) {
switch (config("filesystems.disks.$disk.driver")) {
case 'local':
return response()->download(Storage::disk($disk)->path($filename)); //works for PRIVATE or public?!
@@ -20,4 +22,4 @@ class StorageHelper
return Storage::disk($disk)->download($filename);
}
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Http\Controllers\Accessories;
use App\Helpers\Helper;
@@ -8,6 +9,7 @@ use App\Models\Accessory;
use App\Models\Company;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator;
use Redirect;
/** This controller handles all actions related to Accessories for
@@ -30,10 +32,10 @@ class AccessoriesController extends Controller
public function index()
{
$this->authorize('index', Accessory::class);
return view('accessories/index');
}
/**
* Returns a view with a form to create a new Accessory.
*
@@ -45,11 +47,11 @@ class AccessoriesController extends Controller
{
$this->authorize('create', Accessory::class);
$category_type = 'accessory';
return view('accessories/edit')->with('category_type', $category_type)
->with('item', new Accessory);
}
/**
* Validate and save new Accessory from form post
*
@@ -82,12 +84,13 @@ class AccessoriesController extends Controller
$accessory = $request->handleImages($accessory);
// Was the accessory created?
if ($accessory->save()) {
// Redirect to the new accessory page
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.create.success'));
}
return redirect()->back()->withInput()->withErrors($accessory->getErrors());
}
@@ -104,6 +107,7 @@ class AccessoriesController extends Controller
if ($item = Accessory::find($accessoryId)) {
$this->authorize($item);
return view('accessories/edit', compact('item'))->with('category_type', 'accessory');
}
@@ -127,6 +131,17 @@ class AccessoriesController extends Controller
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
}
$min = $accessory->numCheckedOut();
$validator = Validator::make($request->all(), [
"qty" => "required|numeric|min:$min"
]);
if ($validator->fails()) {
return redirect()->back()
->withErrors($validator)
->withInput();
}
$this->authorize($accessory);
// Update the accessory data
@@ -150,6 +165,7 @@ class AccessoriesController extends Controller
if ($accessory->save()) {
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.update.success'));
}
return redirect()->back()->withInput()->withErrors($accessory->getErrors());
}
@@ -171,11 +187,11 @@ class AccessoriesController extends Controller
if ($accessory->hasUsers() > 0) {
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.assoc_users', array('count'=> $accessory->hasUsers())));
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.assoc_users', ['count'=> $accessory->hasUsers()]));
}
if ($accessory->image) {
try {
try {
Storage::disk('public')->delete('accessories'.'/'.$accessory->image);
} catch (\Exception $e) {
\Log::debug($e);
@@ -183,6 +199,7 @@ class AccessoriesController extends Controller
}
$accessory->delete();
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.delete.success'));
}
@@ -205,6 +222,7 @@ class AccessoriesController extends Controller
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]));
}
}

View File

@@ -0,0 +1,186 @@
<?php
namespace App\Http\Controllers\Accessories;
use App\Helpers\StorageHelper;
use App\Http\Controllers\Controller;
use App\Http\Requests\AssetFileRequest;
use App\Models\Actionlog;
use App\Models\Accessory;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Storage;
use Symfony\Accessory\HttpFoundation\JsonResponse;
use enshrined\svgSanitize\Sanitizer;
class AccessoriesFilesController extends Controller
{
/**
* Validates and stores files associated with a accessory.
*
* @todo Switch to using the AssetFileRequest form request validator.
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param AssetFileRequest $request
* @param int $accessoryId
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function store(AssetFileRequest $request, $accessoryId = null)
{
if (config('app.lock_passwords')) {
return redirect()->route('accessories.show', ['accessory'=>$accessoryId])->with('error', trans('general.feature_disabled'));
}
$accessory = Accessory::find($accessoryId);
if (isset($accessory->id)) {
$this->authorize('accessories.files', $accessory);
if ($request->hasFile('file')) {
if (! Storage::exists('private_uploads/accessories')) {
Storage::makeDirectory('private_uploads/accessories', 775);
}
foreach ($request->file('file') as $file) {
$extension = $file->getClientOriginalExtension();
$file_name = 'accessory-'.$accessory->id.'-'.str_random(8).'-'.str_slug(basename($file->getClientOriginalName(), '.'.$extension)).'.'.$extension;
// Check for SVG and sanitize it
if ($extension == 'svg') {
\Log::debug('This is an SVG');
\Log::debug($file_name);
$sanitizer = new Sanitizer();
$dirtySVG = file_get_contents($file->getRealPath());
$cleanSVG = $sanitizer->sanitize($dirtySVG);
try {
Storage::put('private_uploads/accessories/'.$file_name, $cleanSVG);
} catch (\Exception $e) {
\Log::debug('Upload no workie :( ');
\Log::debug($e);
}
} else {
Storage::put('private_uploads/accessories/'.$file_name, file_get_contents($file));
}
//Log the upload to the log
$accessory->logUpload($file_name, e($request->input('notes')));
}
return redirect()->route('accessories.show', $accessory->id)->with('success', trans('general.file_upload_success'));
}
return redirect()->route('accessories.show', $accessory->id)->with('error', trans('general.no_files_uploaded'));
}
// Prepare the error message
return redirect()->route('accessories.index')
->with('error', trans('general.file_does_not_exist'));
}
/**
* Deletes the selected accessory file.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $accessoryId
* @param int $fileId
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function destroy($accessoryId = null, $fileId = null)
{
$accessory = Accessory::find($accessoryId);
// the asset is valid
if (isset($accessory->id)) {
$this->authorize('update', $accessory);
$log = Actionlog::find($fileId);
// Remove the file if one exists
if (Storage::exists('accessories/'.$log->filename)) {
try {
Storage::delete('accessories/'.$log->filename);
} 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'));
}
/**
* Allows the selected file to be viewed.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.4]
* @param int $accessoryId
* @param int $fileId
* @return \Symfony\Accessory\HttpFoundation\Response
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($accessoryId = null, $fileId = null, $download = true)
{
\Log::debug('Private filesystem is: '.config('filesystems.default'));
$accessory = Accessory::find($accessoryId);
// the accessory is valid
if (isset($accessory->id)) {
$this->authorize('view', $accessory);
$this->authorize('accessories.files', $accessory);
if (! $log = Actionlog::find($fileId)) {
return response('No matching record for that asset/file', 500)
->header('Content-Type', 'text/plain');
}
$file = 'private_uploads/accessories/'.$log->filename;
if (Storage::missing($file)) {
\Log::debug('FILE DOES NOT EXISTS for '.$file);
\Log::debug('URL should be '.Storage::url($file));
return response('File '.$file.' ('.Storage::url($file).') not found on server', 404)
->header('Content-Type', 'text/plain');
} else {
// We have to override the URL stuff here, since local defaults in Laravel's Flysystem
// won't work, as they're not accessible via the web
if (config('filesystems.default') == 'local') { // TODO - is there any way to fix this at the StorageHelper layer?
return StorageHelper::downloader($file);
} else {
if ($download != 'true') {
\Log::debug('display the file');
if ($contents = file_get_contents(Storage::url($file))) { // TODO - this will fail on private S3 files or large public ones
return Response::make(Storage::url($file)->header('Content-Type', mime_content_type($file)));
}
return JsonResponse::create(['error' => 'Failed validation: '], 500);
}
return StorageHelper::downloader($file);
}
}
}
return redirect()->route('accessories.index')->with('error', trans('general.file_does_not_exist', ['id' => $fileId]));
}
}

View File

@@ -17,7 +17,7 @@ class AccessoryCheckinController extends Controller
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param Request $request
* @param integer $accessoryUserId
* @param int $accessoryUserId
* @param string $backto
* @return View
* @internal param int $accessoryId
@@ -33,6 +33,7 @@ class AccessoryCheckinController extends Controller
$accessory = Accessory::find($accessory_user->accessory_id);
$this->authorize('checkin', $accessory);
return view('accessories/checkin', compact('accessory'))->with('backto', $backto);
}
@@ -49,7 +50,7 @@ class AccessoryCheckinController extends Controller
*/
public function store(Request $request, $accessoryUserId = null, $backto = null)
{
// Check if the accessory exists
// Check if the accessory exists
if (is_null($accessory_user = DB::table('accessories_users')->find($accessoryUserId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));
@@ -60,7 +61,7 @@ class AccessoryCheckinController extends Controller
$this->authorize('checkin', $accessory);
$checkin_at = date('Y-m-d');
if($request->filled('checkin_at')){
if ($request->filled('checkin_at')) {
$checkin_at = $request->input('checkin_at');
}
@@ -70,7 +71,7 @@ class AccessoryCheckinController extends Controller
event(new CheckoutableCheckedIn($accessory, User::find($return_to), Auth::user(), $request->input('note'), $checkin_at));
return redirect()->route("accessories.show", $accessory->id)->with('success', trans('admin/accessories/message.checkin.success'));
return redirect()->route('accessories.show', $accessory->id)->with('success', trans('admin/accessories/message.checkin.success'));
}
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.checkin.error'));

View File

@@ -14,7 +14,6 @@ use Illuminate\Support\Facades\Input;
class AccessoryCheckoutController extends Controller
{
/**
* Return the form to checkout an Accessory to a user.
*
@@ -32,7 +31,6 @@ class AccessoryCheckoutController extends Controller
}
if ($accessory->category) {
$this->authorize('checkout', $accessory);
// Get the dropdown of users and then pass it to the checkout view
@@ -56,7 +54,7 @@ class AccessoryCheckoutController extends Controller
*/
public function store(Request $request, $accessoryId)
{
// Check if the accessory exists
// Check if the accessory exists
if (is_null($accessory = Accessory::find($accessoryId))) {
// Redirect to the accessory management page with error
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.user_not_found'));
@@ -64,11 +62,11 @@ class AccessoryCheckoutController extends Controller
$this->authorize('checkout', $accessory);
if (!$user = User::find($request->input('assigned_to'))) {
return redirect()->route('checkout/accessory', $accessory->id)->with('error', trans('admin/accessories/message.checkout.user_does_not_exist'));
if (! $user = User::find($request->input('assigned_to'))) {
return redirect()->route('accessories.checkout.show', $accessory->id)->with('error', trans('admin/accessories/message.checkout.user_does_not_exist'));
}
// Update the accessory data
// Update the accessory data
$accessory->assigned_to = e($request->input('assigned_to'));
$accessory->users()->attach($accessory->id, [
@@ -76,14 +74,14 @@ class AccessoryCheckoutController extends Controller
'created_at' => Carbon::now(),
'user_id' => Auth::id(),
'assigned_to' => $request->get('assigned_to'),
'note' => $request->input('note')
'note' => $request->input('note'),
]);
DB::table('accessories_users')->where('assigned_to', '=', $accessory->assigned_to)->where('accessory_id', '=', $accessory->id)->first();
event(new CheckoutableCheckedOut($accessory, $user, Auth::user(), $request->input('note')));
// Redirect to the new accessory page
// Redirect to the new accessory page
return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.checkout.success'));
}
}

View File

@@ -1,4 +1,5 @@
<?php
<?php
namespace App\Http\Controllers\Account;
use App\Events\CheckoutAccepted;
@@ -6,22 +7,39 @@ use App\Events\CheckoutDeclined;
use App\Events\ItemAccepted;
use App\Events\ItemDeclined;
use App\Http\Controllers\Controller;
use App\Models\Actionlog;
use App\Models\Asset;
use App\Models\CheckoutAcceptance;
use App\Models\Company;
use App\Models\Contracts\Acceptable;
use App\Models\Setting;
use App\Models\User;
use App\Models\AssetModel;
use App\Models\Accessory;
use App\Models\License;
use App\Models\Component;
use App\Models\Consumable;
use App\Notifications\AcceptanceAssetAcceptedNotification;
use App\Notifications\AcceptanceAssetDeclinedNotification;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use App\Http\Controllers\SettingsController;
use Barryvdh\DomPDF\Facade\Pdf;
use Carbon\Carbon;
use phpDocumentor\Reflection\Types\Compound;
class AcceptanceController extends Controller {
class AcceptanceController extends Controller
{
/**
* Show a listing of pending checkout acceptances for the current user
*
*
* @return View
*/
public function index() {
public function index()
{
$acceptances = CheckoutAcceptance::forUser(Auth::user())->pending()->get();
return view('account/accept.index', compact('acceptances'));
@@ -29,42 +47,43 @@ class AcceptanceController extends Controller {
/**
* Shows a form to either accept or decline the checkout acceptance
*
*
* @param int $id
* @return mixed
*/
public function create($id) {
public function create($id)
{
$acceptance = CheckoutAcceptance::find($id);
if (is_null($acceptance)) {
return redirect()->route('account.accept')->with('error', trans('admin/hardware/message.does_not_exist'));
}
if (! $acceptance->isPending()) {
return redirect()->route('account.accept')->with('error', trans('admin/users/message.error.asset_already_accepted'));
}
}
if (! $acceptance->isCheckedOutTo(Auth::user())) {
return redirect()->route('account.accept')->with('error', trans('admin/users/message.error.incorrect_user_accepted'));
}
if (!Company::isCurrentUserHasAccess($acceptance->checkoutable)) {
if (! Company::isCurrentUserHasAccess($acceptance->checkoutable)) {
return redirect()->route('account.accept')->with('error', trans('general.insufficient_permissions'));
}
}
return view('account/accept.create', compact('acceptance'));
}
}
/**
* Stores the accept/decline of the checkout acceptance
*
*
* @param Request $request
* @param int $id
* @return Redirect
*/
public function store(Request $request, $id) {
public function store(Request $request, $id)
{
$acceptance = CheckoutAcceptance::find($id);
if (is_null($acceptance)) {
@@ -73,55 +92,183 @@ class AcceptanceController extends Controller {
if (! $acceptance->isPending()) {
return redirect()->route('account.accept')->with('error', trans('admin/users/message.error.asset_already_accepted'));
}
}
if (! $acceptance->isCheckedOutTo(Auth::user())) {
return redirect()->route('account.accept')->with('error', trans('admin/users/message.error.incorrect_user_accepted'));
}
if (!Company::isCurrentUserHasAccess($acceptance->checkoutable)) {
if (! Company::isCurrentUserHasAccess($acceptance->checkoutable)) {
return redirect()->route('account.accept')->with('error', trans('general.insufficient_permissions'));
}
}
if (!$request->filled('asset_acceptance')) {
if (! $request->filled('asset_acceptance')) {
return redirect()->back()->with('error', trans('admin/users/message.error.accept_or_decline'));
}
/**
* Get the signature and save it
*/
if (!Storage::exists('private_uploads/signatures')) Storage::makeDirectory('private_uploads/signatures', 775);
$sig_filename = '';
if ($request->filled('signature_output')) {
$sig_filename = "siglog-" .Str::uuid() . '-'.date('Y-m-d-his').".png";
$data_uri = e($request->input('signature_output'));
$encoded_image = explode(",", $data_uri);
$decoded_image = base64_decode($encoded_image[1]);
Storage::put('private_uploads/signatures/'.$sig_filename, (string)$decoded_image);
if (! Storage::exists('private_uploads/signatures')) {
Storage::makeDirectory('private_uploads/signatures', 775);
}
$item = $acceptance->checkoutable_type::find($acceptance->checkoutable_id);
$display_model = '';
$pdf_view_route = '';
$pdf_filename = 'accepted-eula-'.date('Y-m-d-h-i-s').'.pdf';
$sig_filename='';
if ($request->input('asset_acceptance') == 'accepted') {
$acceptance->accept($sig_filename);
/**
* Check for the eula-pdfs directory
*/
if (! Storage::exists('private_uploads/eula-pdfs')) {
Storage::makeDirectory('private_uploads/eula-pdfs', 775);
}
if (Setting::getSettings()->require_accept_signature == '1') {
// Check if the signature directory exists, if not create it
if (!Storage::exists('private_uploads/signatures')) {
Storage::makeDirectory('private_uploads/signatures', 775);
}
// The item was accepted, check for a signature
if ($request->filled('signature_output')) {
$sig_filename = 'siglog-' . Str::uuid() . '-' . date('Y-m-d-his') . '.png';
$data_uri = $request->input('signature_output');
$encoded_image = explode(',', $data_uri);
$decoded_image = base64_decode($encoded_image[1]);
Storage::put('private_uploads/signatures/' . $sig_filename, (string)$decoded_image);
// No image data is present, kick them back.
// This mostly only applies to users on super-duper crapola browsers *cough* IE *cough*
} else {
return redirect()->back()->with('error', trans('general.shitty_browser'));
}
}
// this is now slightly less horrible
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
switch ($acceptance->checkoutable_type) {
case 'App\Models\Asset':
$asset_model = AssetModel::find($item->model_id);
$display_model = $asset_model->name;
break;
case 'App\Models\Accessory':
$accessory = Accessory::find($item->id);
$display_model = $accessory->name;
break;
case 'App\Models\LicenseSeat':
$license = License::find($item->license_id);
$display_model = $license->name;
break;
case 'App\Models\Component':
$component = Component::find($item->id);
$display_model = $component->name;
break;
case 'App\Models\Consumable':
$consumable = Consumable::find($item->id);
$display_model = $consumable->name;
break;
}
/**
* Gather the data for the PDF. We fire this whether there is a signature required or not,
* since we want the moment-in-time proof of what the EULA was when they accepted it.
*/
$branding_settings = SettingsController::getPDFBranding();
if (is_null($branding_settings->logo)){
$path_logo = "";
} else {
$path_logo = public_path() . '/uploads/' . $branding_settings->logo;
}
$data = [
'item_tag' => $item->asset_tag,
'item_model' => $display_model,
'item_serial' => $item->serial,
'eula' => $item->getEula(),
'check_out_date' => Carbon::parse($acceptance->created_at)->format($branding_settings->date_display_format),
'accepted_date' => Carbon::parse($acceptance->accepted_at)->format($branding_settings->date_display_format),
'assigned_to' => $assigned_to,
'company_name' => $branding_settings->site_name,
'signature' => ($sig_filename) ? storage_path() . '/private_uploads/signatures/' . $sig_filename : null,
'logo' => $path_logo,
'date_settings' => $branding_settings->date_display_format,
];
if ($pdf_view_route!='') {
\Log::debug($pdf_filename.' is the filename, and the route was specified.');
$pdf = Pdf::loadView('account.accept.accept-item', $data);
Storage::put('private_uploads/eula-pdfs/' .$pdf_filename, $pdf->output());
}
$acceptance->accept($sig_filename, $item->getEula(), $pdf_filename);
$acceptance->notify(new AcceptanceAssetAcceptedNotification($data));
event(new CheckoutAccepted($acceptance));
$return_msg = trans('admin/users/message.accepted');
} else {
// Format the data to send the declined notification
$branding_settings = SettingsController::getPDFBranding();
$acceptance->decline($sig_filename);
// This is the most horriblest
switch($acceptance->checkoutable_type){
case 'App\Models\Asset':
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break;
case 'App\Models\Accessory':
$assigned_to = User::find($item->assignedTo);
break;
case 'App\Models\LicenseSeat':
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break;
case 'App\Models\Component':
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break;
case 'App\Models\Consumable':
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break;
}
$data = [
'item_tag' => $item->asset_tag,
'item_model' => $display_model,
'item_serial' => $item->serial,
'declined_date' => Carbon::parse($acceptance->accepted_at)->format($branding_settings->date_display_format),
'assigned_to' => $assigned_to,
'company_name' => $branding_settings->site_name,
'date_settings' => $branding_settings->date_display_format,
];
$acceptance->decline($sig_filename);
$acceptance->notify(new AcceptanceAssetDeclinedNotification($data));
event(new CheckoutDeclined($acceptance));
$return_msg = trans('admin/users/message.declined');
}
return redirect()->to('account/accept')->with('success', $return_msg);
}
}
}
}

View File

@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Helpers\Helper;
use App\Models\Actionlog;
use Response;
class ActionlogController extends Controller
@@ -26,4 +27,10 @@ class ActionlogController extends Controller
}
}
public function getStoredEula($filename){
$this->authorize('view', \App\Models\Asset::class);
$file = config('app.private_uploads').'/eula-pdfs/'.$filename;
return Response::download($file);
}
}

View File

@@ -9,8 +9,8 @@ use App\Http\Transformers\SelectlistTransformer;
use App\Models\Accessory;
use App\Models\Company;
use App\Models\User;
use Carbon\Carbon;
use Auth;
use Carbon\Carbon;
use DB;
use Illuminate\Http\Request;
use App\Http\Requests\ImageUploadRequest;
@@ -27,7 +27,7 @@ class AccessoriesController extends Controller
public function index(Request $request)
{
$this->authorize('view', Accessory::class);
// This array is what determines which fields should be allowed to be sorted on ON the table itself, no relations
// Relations will be handled in query scopes a little further down.
$allowed_columns =
@@ -51,19 +51,19 @@ class AccessoriesController extends Controller
}
if ($request->filled('company_id')) {
$accessories->where('company_id','=',$request->input('company_id'));
$accessories->where('company_id', '=', $request->input('company_id'));
}
if ($request->filled('category_id')) {
$accessories->where('category_id','=',$request->input('category_id'));
$accessories->where('category_id', '=', $request->input('category_id'));
}
if ($request->filled('manufacturer_id')) {
$accessories->where('manufacturer_id','=',$request->input('manufacturer_id'));
$accessories->where('manufacturer_id', '=', $request->input('manufacturer_id'));
}
if ($request->filled('supplier_id')) {
$accessories->where('supplier_id','=',$request->input('supplier_id'));
$accessories->where('supplier_id', '=', $request->input('supplier_id'));
}
if ($request->filled('location_id')) {
@@ -105,10 +105,10 @@ class AccessoriesController extends Controller
$accessories = $accessories->orderBy($column_sort, $order);
break;
}
$total = $accessories->count();
$accessories = $accessories->skip($offset)->take($limit)->get();
return (new AccessoriesTransformer)->transformAccessories($accessories, $total);
}
@@ -131,6 +131,7 @@ class AccessoriesController extends Controller
if ($accessory->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $accessory, trans('admin/accessories/message.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $accessory->getErrors()));
}
@@ -147,6 +148,7 @@ class AccessoriesController extends Controller
{
$this->authorize('view', Accessory::class);
$accessory = Accessory::findOrFail($id);
return (new AccessoriesTransformer)->transformAccessory($accessory);
}
@@ -163,6 +165,7 @@ class AccessoriesController extends Controller
{
$this->authorize('view', Accessory::class);
$accessory = Accessory::findOrFail($id);
return (new AccessoriesTransformer)->transformAccessory($accessory);
}
@@ -180,7 +183,7 @@ class AccessoriesController extends Controller
$this->authorize('view', Accessory::class);
$accessory = Accessory::with('lastCheckout')->findOrFail($id);
if (!Company::isCurrentUserHasAccess($accessory)) {
if (! Company::isCurrentUserHasAccess($accessory)) {
return ['total' => 0, 'rows' => []];
}
@@ -190,7 +193,7 @@ class AccessoriesController extends Controller
$accessory_users = $accessory->users;
$total = $accessory_users->count();
if($total < $offset){
if ($total < $offset) {
$offset = 0;
}
@@ -250,12 +253,12 @@ class AccessoriesController extends Controller
$this->authorize($accessory);
if ($accessory->hasUsers() > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.assoc_users', array('count'=> $accessory->hasUsers()))));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.assoc_users', ['count'=> $accessory->hasUsers()])));
}
$accessory->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.delete.success')));
}
@@ -281,7 +284,7 @@ class AccessoriesController extends Controller
if ($accessory->numRemaining() > 0) {
if (!$user = User::find($request->input('assigned_to'))) {
if (! $user = User::find($request->input('assigned_to'))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkout.user_does_not_exist')));
}
@@ -293,12 +296,12 @@ class AccessoriesController extends Controller
'created_at' => Carbon::now(),
'user_id' => Auth::id(),
'assigned_to' => $request->get('assigned_to'),
'note' => $request->get('note')
'note' => $request->get('note'),
]);
$accessory->logCheckout($request->input('note'), $user);
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkout.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkout.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'No accessories remaining'));
@@ -311,7 +314,7 @@ class AccessoriesController extends Controller
* @uses Accessory::checkin_email() to determine if an email can and should be sent
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param Request $request
* @param integer $accessoryUserId
* @param int $accessoryUserId
* @param string $backto
* @return Redirect
* @internal param int $accessoryId
@@ -329,7 +332,7 @@ class AccessoriesController extends Controller
// Was the accessory updated?
if (DB::table('accessories_users')->where('id', '=', $accessory_user->id)->delete()) {
if (!is_null($accessory_user->assigned_to)) {
if (! is_null($accessory_user->assigned_to)) {
$user = User::find($accessory_user->assigned_to);
}
@@ -344,7 +347,7 @@ class AccessoriesController extends Controller
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkin.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkin.error')));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkin.error')));
}
@@ -360,7 +363,7 @@ class AccessoriesController extends Controller
$accessories = Accessory::select([
'accessories.id',
'accessories.name'
'accessories.name',
]);
if ($request->filled('search')) {
@@ -369,10 +372,7 @@ class AccessoriesController extends Controller
$accessories = $accessories->orderBy('name', 'ASC')->paginate(50);
return (new SelectlistTransformer)->transformSelectlist($accessories);
}
}

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
@@ -29,12 +30,13 @@ class AssetMaintenancesController extends Controller
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
* @since [v1.8]
* @return String JSON
* @return string JSON
*/
public function index(Request $request)
{
$this->authorize('view', Asset::class);
$maintenances = AssetMaintenance::with('asset', 'asset.model','asset.location', 'supplier', 'asset.company', 'admin');
$maintenances = AssetMaintenance::select('asset_maintenances.*')->with('asset', 'asset.model', 'asset.location', 'supplier', 'asset.company', 'admin');
if ($request->filled('search')) {
$maintenances = $maintenances->TextSearch($request->input('search'));
@@ -44,6 +46,15 @@ class AssetMaintenancesController extends Controller
$maintenances->where('asset_id', '=', $request->input('asset_id'));
}
if ($request->filled('supplier_id')) {
$maintenances->where('supplier_id', '=', $request->input('supplier_id'));
}
if ($request->filled('asset_maintenance_type')) {
$maintenances->where('asset_maintenance_type', '=', $request->input('asset_maintenance_type'));
}
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($maintenances) && ($request->get('offset') > $maintenances->count())) ? $maintenances->count() : $request->get('offset', 0);
@@ -51,7 +62,6 @@ class AssetMaintenancesController extends Controller
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$allowed_columns = [
'id',
'title',
@@ -63,7 +73,8 @@ class AssetMaintenancesController extends Controller
'notes',
'asset_tag',
'asset_name',
'user_id'
'user_id',
'supplier'
];
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';
@@ -72,6 +83,9 @@ class AssetMaintenancesController extends Controller
case 'user_id':
$maintenances = $maintenances->OrderAdmin($order);
break;
case 'supplier':
$maintenances = $maintenances->OrderBySupplier($order);
break;
case 'asset_tag':
$maintenances = $maintenances->OrderByTag($order);
break;
@@ -98,7 +112,7 @@ class AssetMaintenancesController extends Controller
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
* @since [v1.8]
* @return String JSON
* @return string JSON
*/
public function store(Request $request)
{
@@ -111,24 +125,24 @@ class AssetMaintenancesController extends Controller
$assetMaintenance->notes = e($request->input('notes'));
$asset = Asset::find(e($request->input('asset_id')));
if (!Company::isCurrentUserHasAccess($asset)) {
if (! Company::isCurrentUserHasAccess($asset)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'You cannot add a maintenance for that asset'));
}
// Save the asset maintenance data
$assetMaintenance->asset_id = $request->input('asset_id');
$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');
$assetMaintenance->user_id = Auth::id();
$assetMaintenance->title = $request->input('title');
$assetMaintenance->start_date = $request->input('start_date');
$assetMaintenance->completion_date = $request->input('completion_date');
$assetMaintenance->user_id = Auth::id();
if (( $assetMaintenance->completion_date !== null )
&& ( $assetMaintenance->start_date !== "" )
&& ( $assetMaintenance->start_date !== "0000-00-00" )
if (($assetMaintenance->completion_date !== null)
&& ($assetMaintenance->start_date !== '')
&& ($assetMaintenance->start_date !== '0000-00-00')
) {
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$assetMaintenance->asset_maintenance_time = $completionDate->diffInDays($startDate);
}
@@ -142,7 +156,6 @@ class AssetMaintenancesController extends Controller
}
/**
* Validates and stores an update to an asset maintenance
*
@@ -151,7 +164,7 @@ class AssetMaintenancesController extends Controller
* @param int $request
* @version v1.0
* @since [v4.0]
* @return String JSON
* @return string JSON
*/
public function update(Request $request, $assetMaintenanceId = null)
{
@@ -159,7 +172,7 @@ class AssetMaintenancesController extends Controller
// Check if the asset maintenance exists
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);
if (!Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
if (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'You cannot edit a maintenance for that asset'));
}
@@ -170,41 +183,41 @@ class AssetMaintenancesController extends Controller
$asset = Asset::find(request('asset_id'));
if (!Company::isCurrentUserHasAccess($asset)) {
if (! Company::isCurrentUserHasAccess($asset)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'You cannot edit a maintenance for that asset'));
}
// Save the asset maintenance data
$assetMaintenance->asset_id = $request->input('asset_id');
$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');
$assetMaintenance->title = $request->input('title');
$assetMaintenance->start_date = $request->input('start_date');
$assetMaintenance->completion_date = $request->input('completion_date');
if (( $assetMaintenance->completion_date == null )
if (($assetMaintenance->completion_date == null)
) {
if (( $assetMaintenance->asset_maintenance_time !== 0 )
|| ( !is_null($assetMaintenance->asset_maintenance_time) )
if (($assetMaintenance->asset_maintenance_time !== 0)
|| (! is_null($assetMaintenance->asset_maintenance_time))
) {
$assetMaintenance->asset_maintenance_time = null;
}
}
if (( $assetMaintenance->completion_date !== null )
&& ( $assetMaintenance->start_date !== "" )
&& ( $assetMaintenance->start_date !== "0000-00-00" )
if (($assetMaintenance->completion_date !== null)
&& ($assetMaintenance->start_date !== '')
&& ($assetMaintenance->start_date !== '0000-00-00')
) {
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$assetMaintenance->asset_maintenance_time = $completionDate->diffInDays($startDate);
}
// Was the asset maintenance created?
if ($assetMaintenance->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $assetMaintenance, trans('admin/asset_maintenances/message.edit.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $assetMaintenance->getErrors()));
}
@@ -215,7 +228,7 @@ class AssetMaintenancesController extends Controller
* @param int $assetMaintenanceId
* @version v1.0
* @since [v4.0]
* @return String JSON
* @return string JSON
*/
public function destroy($assetMaintenanceId)
{
@@ -223,7 +236,7 @@ class AssetMaintenancesController extends Controller
// Check if the asset maintenance exists
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);
if (!Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
if (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'You cannot delete a maintenance for that asset'));
}
@@ -241,15 +254,16 @@ class AssetMaintenancesController extends Controller
* @param int $assetMaintenanceId
* @version v1.0
* @since [v4.0]
* @return String JSON
* @return string JSON
*/
public function show($assetMaintenanceId)
{
$this->authorize('view', Asset::class);
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);
if (!Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
if (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'You cannot view a maintenance for that asset'));
}
return (new AssetMaintenancesTransformer())->transformAssetMaintenance($assetMaintenance);
}

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
@@ -43,7 +44,7 @@ class AssetModelsController extends Controller
'manufacturer',
'requestable',
'assets_count',
'category'
'category',
];
$assetmodels = AssetModel::select([
@@ -62,15 +63,17 @@ class AssetModelsController extends Controller
'models.deleted_at',
'models.updated_at',
])
->with('category','depreciation', 'manufacturer','fieldset')
->with('category', 'depreciation', 'manufacturer', 'fieldset')
->withCount('assets as assets_count');
if ($request->input('status')=='deleted') {
$assetmodels->onlyTrashed();
}
if ($request->filled('category_id')) {
$assetmodels = $assetmodels->where('models.category_id', '=', $request->input('category_id'));
}
if ($request->filled('search')) {
$assetmodels->TextSearch($request->input('search'));
}
@@ -99,6 +102,7 @@ class AssetModelsController extends Controller
$total = $assetmodels->count();
$assetmodels = $assetmodels->skip($offset)->take($limit)->get();
return (new AssetModelsTransformer)->transformAssetModels($assetmodels, $total);
}
@@ -123,6 +127,7 @@ class AssetModelsController extends Controller
}
return response()->json(Helper::formatStandardApiResponse('error', null, $assetmodel->getErrors()));
}
/**
@@ -137,6 +142,7 @@ class AssetModelsController extends Controller
{
$this->authorize('view', AssetModel::class);
$assetmodel = AssetModel::withCount('assets as assets_count')->findOrFail($id);
return (new AssetModelsTransformer)->transformAssetModel($assetmodel);
}
@@ -151,7 +157,8 @@ class AssetModelsController extends Controller
public function assets($id)
{
$this->authorize('view', AssetModel::class);
$assets = Asset::where('model_id','=',$id)->get();
$assets = Asset::where('model_id', '=', $id)->get();
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
}
@@ -181,7 +188,7 @@ class AssetModelsController extends Controller
* it, but I'll be damned if I can think of one. - snipe
*/
if ($request->filled('custom_fieldset_id')) {
$assetmodel->fieldset_id = $request->get("custom_fieldset_id");
$assetmodel->fieldset_id = $request->get('custom_fieldset_id');
}
@@ -207,11 +214,11 @@ class AssetModelsController extends Controller
$this->authorize('delete', $assetmodel);
if ($assetmodel->assets()->count() > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/models/message.assoc_users')));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/models/message.assoc_users')));
}
if ($assetmodel->image) {
try {
try {
Storage::disk('public')->delete('assetmodels/'.$assetmodel->image);
} catch (\Exception $e) {
\Log::info($e);
@@ -219,8 +226,8 @@ class AssetModelsController extends Controller
}
$assetmodel->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/models/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/models/message.delete.success')));
}
/**
@@ -229,7 +236,6 @@ class AssetModelsController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
@@ -242,7 +248,7 @@ class AssetModelsController extends Controller
'models.model_number',
'models.manufacturer_id',
'models.category_id',
])->with('manufacturer','category');
])->with('manufacturer', 'category');
$settings = \App\Models\Setting::getSettings();
@@ -253,7 +259,6 @@ class AssetModelsController extends Controller
$assetmodels = $assetmodels->OrderCategory('ASC')->OrderManufacturer('ASC')->orderby('models.name', 'asc')->orderby('models.model_number', 'asc')->paginate(50);
foreach ($assetmodels as $assetmodel) {
$assetmodel->use_text = '';
if ($settings->modellistCheckedValue('category')) {
@@ -264,10 +269,10 @@ class AssetModelsController extends Controller
$assetmodel->use_text .= (($assetmodel->manufacturer) ? $assetmodel->manufacturer->name.' ' : '');
}
$assetmodel->use_text .= $assetmodel->name;
$assetmodel->use_text .= $assetmodel->name;
if (($settings->modellistCheckedValue('model_number')) && ($assetmodel->model_number!='')) {
$assetmodel->use_text .= ' (#'.$assetmodel->model_number.')';
if (($settings->modellistCheckedValue('model_number')) && ($assetmodel->model_number != '')) {
$assetmodel->use_text .= ' (#'.$assetmodel->model_number.')';
}
$assetmodel->use_image = ($settings->modellistCheckedValue('image') && ($assetmodel->image)) ? Storage::disk('public')->url('models/'.e($assetmodel->image)) : null;
@@ -275,5 +280,4 @@ class AssetModelsController extends Controller
return (new SelectlistTransformer)->transformSelectlist($assetmodels);
}
}

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Http\Controllers\Api;
use App\Events\CheckoutableCheckedIn;
@@ -32,7 +33,6 @@ use TCPDF;
use Validator;
use Route;
/**
* This class controls all actions related to assets for
* the Snipe-IT Asset Management application.
@@ -42,7 +42,6 @@ use Route;
*/
class AssetsController extends Controller
{
/**
* Returns JSON listing of all assets
*
@@ -54,7 +53,6 @@ class AssetsController extends Controller
public function index(Request $request, $audit = null)
{
\Log::debug(Route::currentRouteName());
$filter_non_deprecable_assets = false;
/**
@@ -104,7 +102,7 @@ class AssetsController extends Controller
'requests_counter',
];
$filter = array();
$filter = [];
if ($request->filled('filter')) {
$filter = json_decode($request->input('filter'), true);
@@ -112,19 +110,19 @@ class AssetsController extends Controller
$all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load
foreach ($all_custom_fields as $field) {
$allowed_columns[]=$field->db_column_name();
$allowed_columns[] = $field->db_column_name();
}
$assets = Company::scopeCompanyables(Asset::select('assets.*'),"company_id","assets")
$assets = Company::scopeCompanyables(Asset::select('assets.*'), 'company_id', 'assets')
->with('location', 'assetstatus', 'company', 'defaultLoc','assignedTo',
'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) {
$non_deprecable_models = AssetModel::select('id')->whereNotNull('depreciation_id')->get();
$assets->InModelList($non_deprecable_models->toArray());
}
// These are used by the API to query against specific ID numbers.
// They are also used by the individual searches on detail pages like
// locations, etc.
@@ -142,7 +140,15 @@ class AssetsController extends Controller
$assets->where('assets.status_id', '=', $request->input('status_id'));
}
if ($request->input('requestable')=='true') {
if ($request->filled('asset_tag')) {
$assets->where('assets.asset_tag', '=', $request->input('asset_tag'));
}
if ($request->filled('serial')) {
$assets->where('assets.serial', '=', $request->input('serial'));
}
if ($request->input('requestable') == 'true') {
$assets->where('assets.requestable', '=', '1');
}
@@ -197,7 +203,6 @@ class AssetsController extends Controller
// This is used by the audit reporting routes
if (Gate::allows('audit', Asset::class)) {
switch ($audit) {
case 'due':
$assets->DueOrOverdueForAudit($settings);
@@ -220,19 +225,19 @@ class AssetsController extends Controller
$assets->onlyTrashed();
break;
case 'Pending':
$assets->join('status_labels AS status_alias',function ($join) {
$join->on('status_alias.id', "=", "assets.status_id")
->where('status_alias.deployable','=',0)
->where('status_alias.pending','=',1)
$assets->join('status_labels AS status_alias', function ($join) {
$join->on('status_alias.id', '=', 'assets.status_id')
->where('status_alias.deployable', '=', 0)
->where('status_alias.pending', '=', 1)
->where('status_alias.archived', '=', 0);
});
break;
case 'RTD':
$assets->whereNull('assets.assigned_to')
->join('status_labels AS status_alias',function ($join) {
$join->on('status_alias.id', "=", "assets.status_id")
->where('status_alias.deployable','=',1)
->where('status_alias.pending','=',0)
->join('status_labels AS status_alias', function ($join) {
$join->on('status_alias.id', '=', 'assets.status_id')
->where('status_alias.deployable', '=', 1)
->where('status_alias.pending', '=', 0)
->where('status_alias.archived', '=', 0);
});
break;
@@ -240,19 +245,19 @@ class AssetsController extends Controller
$assets->Undeployable();
break;
case 'Archived':
$assets->join('status_labels AS status_alias',function ($join) {
$join->on('status_alias.id', "=", "assets.status_id")
->where('status_alias.deployable','=',0)
->where('status_alias.pending','=',0)
$assets->join('status_labels AS status_alias', function ($join) {
$join->on('status_alias.id', '=', 'assets.status_id')
->where('status_alias.deployable', '=', 0)
->where('status_alias.pending', '=', 0)
->where('status_alias.archived', '=', 1);
});
break;
case 'Requestable':
$assets->where('assets.requestable', '=', 1)
->join('status_labels AS status_alias',function ($join) {
$join->on('status_alias.id', "=", "assets.status_id")
->where('status_alias.deployable','=',1)
->where('status_alias.pending','=',0)
->join('status_labels AS status_alias', function ($join) {
$join->on('status_alias.id', '=', 'assets.status_id')
->where('status_alias.deployable', '=', 1)
->where('status_alias.pending', '=', 0)
->where('status_alias.archived', '=', 0);
});
@@ -263,34 +268,34 @@ class AssetsController extends Controller
break;
default:
if ((!$request->filled('status_id')) && ($settings->show_archived_in_list!='1')) {
if ((! $request->filled('status_id')) && ($settings->show_archived_in_list != '1')) {
// terrible workaround for complex-query Laravel bug in fulltext
$assets->join('status_labels AS status_alias',function ($join) {
$join->on('status_alias.id', "=", "assets.status_id")
$assets->join('status_labels AS status_alias', function ($join) {
$join->on('status_alias.id', '=', 'assets.status_id')
->where('status_alias.archived', '=', 0);
});
// If there is a status ID, don't take show_archived_in_list into consideration
} else {
$assets->join('status_labels AS status_alias',function ($join) {
$join->on('status_alias.id', "=", "assets.status_id");
$assets->join('status_labels AS status_alias', function ($join) {
$join->on('status_alias.id', '=', 'assets.status_id');
});
}
}
if ((!is_null($filter)) && (count($filter)) > 0) {
if ((! is_null($filter)) && (count($filter)) > 0) {
$assets->ByFilter($filter);
} elseif ($request->filled('search')) {
$assets->TextSearch($request->input('search'));
}
// This is kinda gross, but we need to do this because the Bootstrap Tables
// API passes custom field ordering as custom_fields.fieldname, and we have to strip
// that out to let the default sorter below order them correctly on the assets table.
$sort_override = str_replace('custom_fields.','', $request->input('sort')) ;
$sort_override = str_replace('custom_fields.', '', $request->input('sort'));
// This handles all of the pivot sorting (versus the assets.* fields
// in the allowed_columns array)
@@ -336,7 +341,7 @@ class AssetsController extends Controller
$total = $assets->count();
$assets = $assets->skip($offset)->take($limit)->get();
/**
* Include additional associated relationships
*/
@@ -346,7 +351,6 @@ class AssetsController extends Controller
}]);
}
/**
@@ -360,18 +364,28 @@ class AssetsController extends Controller
/**
* Returns JSON with information about an asset (by tag) for detail view.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param string $tag
* @since [v4.2.1]
* @return JsonResponse
* @author [A. Gianotto] [<snipe@snipe.net>]
* @return \Illuminate\Http\JsonResponse
*/
public function showByTag(Request $request, $tag)
{
if ($asset = Asset::with('assetstatus')->with('assignedTo')->where('asset_tag',$tag)->first()) {
$this->authorize('view', $asset);
return (new AssetsTransformer)->transformAsset($asset, $request);
$this->authorize('index', Asset::class);
$assets = Asset::where('asset_tag', $tag)->with('assetstatus')->with('assignedTo');
// Check if they've passed ?deleted=true
if ($request->input('deleted', 'false') == 'true') {
$assets = $assets->withTrashed();
}
$assets = $assets->get();
if (($assets) && ($assets->count() > 0)) {
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
} else {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200);
}
@@ -381,23 +395,24 @@ class AssetsController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param string $serial
* @since [v4.2.1]
* @return JsonResponse
* @return \Illuminate\Http\JsonResponse
*/
public function showBySerial(Request $request, $serial)
{
$this->authorize('index', Asset::class);
$assets = Asset::where('serial', $serial)->with('assetstatus')->with('assignedTo');
$assets = Asset::with('assetstatus')->with('assignedTo');
if ($request->input('deleted', 'false') === 'true') {
// Check if they've passed ?deleted=true
if ($request->input('deleted', 'false') == 'true') {
$assets = $assets->withTrashed();
}
$assets = $assets->where('serial', $serial)->get();
if ($assets) {
$assets = $assets->get();
if (($assets) && ($assets->count() > 0)) {
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
} else {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200);
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
}
@@ -414,17 +429,20 @@ class AssetsController extends Controller
if ($asset = Asset::with('assetstatus')->with('assignedTo')->withTrashed()
->withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as user_requests_count')->findOrFail($id)) {
$this->authorize('view', $asset);
return (new AssetsTransformer)->transformAsset($asset, $request->input('components') );
}
}
public function licenses(Request $request, $id)
{
$this->authorize('view', Asset::class);
$this->authorize('view', License::class);
$asset = Asset::where('id', $id)->withTrashed()->first();
$licenses = $asset->licenses()->get();
return (new LicensesTransformer())->transformLicenses($licenses, $licenses->count());
}
@@ -447,7 +465,7 @@ class AssetsController extends Controller
'assets.model_id',
'assets.assigned_to',
'assets.assigned_type',
'assets.status_id'
'assets.status_id',
])->with('model', 'assetstatus', 'assignedTo')->NotArchived(), 'company_id', 'assets');
if ($request->filled('assetStatusType') && $request->input('assetStatusType') === 'RTD') {
@@ -474,15 +492,14 @@ class AssetsController extends Controller
}
if ($asset->assetstatus->getStatuslabelType()=='pending') {
$asset->use_text .= '('.$asset->assetstatus->getStatuslabelType().')';
if ($asset->assetstatus->getStatuslabelType() == 'pending') {
$asset->use_text .= '('.$asset->assetstatus->getStatuslabelType().')';
}
$asset->use_image = ($asset->getImageUrl()) ? $asset->getImageUrl() : null;
}
return (new SelectlistTransformer)->transformSelectlist($assets);
}
@@ -496,7 +513,6 @@ class AssetsController extends Controller
*/
public function store(ImageUploadRequest $request)
{
$this->authorize('create', Asset::class);
$asset = new Asset();
@@ -518,7 +534,7 @@ class AssetsController extends Controller
$asset->purchase_cost = Helper::ParseCurrency($request->get('purchase_cost')); // this is the API's store method, so I don't know that I want to do this? Confusing. FIXME (or not?!)
$asset->purchase_date = $request->get('purchase_date', null);
$asset->assigned_to = $request->get('assigned_to', null);
$asset->supplier_id = $request->get('supplier_id', 0);
$asset->supplier_id = $request->get('supplier_id');
$asset->requestable = $request->get('requestable', 0);
$asset->rtd_location_id = $request->get('rtd_location_id', null);
$asset->location_id = $request->get('rtd_location_id', null);
@@ -540,39 +556,36 @@ class AssetsController extends Controller
foreach ($model->fieldset->fields as $field) {
// Set the field value based on what was sent in the request
$field_val = $request->input($field->convertUnicodeDbSlug(), null);
$field_val = $request->input($field->db_column, null);
// If input value is null, use custom field's default value
if ($field_val == null) {
\Log::debug('Field value for '.$field->convertUnicodeDbSlug().' 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')));
}
// if the field is set to encrypted, make sure we encrypt the value
if ($field->field_encrypted == '1') {
\Log::debug('This model field is encrypted in this fieldset.');
if (Gate::allows('admin')) {
// If input value is null, use custom field's default value
if (($field_val == null) && ($request->has('model_id')!='')){
if (($field_val == null) && ($request->has('model_id') != '')) {
$field_val = \Crypt::encrypt($field->defaultValue($request->get('model_id')));
} else {
$field_val = \Crypt::encrypt($request->input($field->convertUnicodeDbSlug()));
$field_val = \Crypt::encrypt($request->input($field->db_column));
}
}
}
$asset->{$field->convertUnicodeDbSlug()} = $field_val;
$asset->{$field->db_column} = $field_val;
}
}
if ($asset->save()) {
if ($request->get('assigned_user')) {
$target = User::find(request('assigned_user'));
} elseif ($request->get('assigned_asset')) {
@@ -633,13 +646,13 @@ class AssetsController extends Controller
// Update custom fields
if (($model = AssetModel::find($asset->model_id)) && (isset($model->fieldset))) {
foreach ($model->fieldset->fields as $field) {
if ($request->has($field->convertUnicodeDbSlug())) {
if ($field->field_encrypted=='1') {
if ($request->has($field->db_column)) {
if ($field->field_encrypted == '1') {
if (Gate::allows('admin')) {
$asset->{$field->convertUnicodeDbSlug()} = \Crypt::encrypt($request->input($field->convertUnicodeDbSlug()));
$asset->{$field->db_column} = \Crypt::encrypt($request->input($field->db_column));
}
} else {
$asset->{$field->convertUnicodeDbSlug()} = $request->input($field->convertUnicodeDbSlug());
$asset->{$field->db_column} = $request->input($field->db_column);
}
}
}
@@ -647,15 +660,13 @@ class AssetsController extends Controller
if ($asset->save()) {
if (($request->filled('assigned_user')) && ($target = User::find($request->get('assigned_user')))) {
$location = $target->location_id;
} elseif (($request->filled('assigned_asset')) && ($target = Asset::find($request->get('assigned_asset')))) {
$location = $target->location_id;
Asset::where('assigned_type', '\\App\\Models\\Asset')->where('assigned_to', $id)
Asset::where('assigned_type', \App\Models\Asset::class)->where('assigned_to', $id)
->update(['location_id' => $target->location_id]);
} elseif (($request->filled('assigned_location')) && ($target = Location::find($request->get('assigned_location')))) {
$location = $target->id;
}
@@ -670,8 +681,10 @@ class AssetsController extends Controller
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.update.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200);
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
@@ -689,12 +702,11 @@ class AssetsController extends Controller
$this->authorize('delete', Asset::class);
if ($asset = Asset::find($id)) {
$this->authorize('delete', $asset);
DB::table('assets')
->where('id', $asset->id)
->update(array('assigned_to' => null));
->update(['assigned_to' => null]);
$asset->delete();
@@ -714,30 +726,53 @@ class AssetsController extends Controller
* @since [v5.1.18]
* @return JsonResponse
*/
public function restore($assetId = null)
public function restore(Request $request, $assetId = null)
{
// Get asset information
$asset = Asset::withTrashed()->find($assetId);
$this->authorize('delete', $asset);
if (isset($asset->id)) {
// Restore the asset
Asset::withTrashed()->where('id', $assetId)->restore();
$logaction = new Actionlog();
$logaction->item_type = Asset::class;
$logaction->item_id = $asset->id;
$logaction->created_at = date("Y-m-d H:i:s");
$logaction->user_id = Auth::user()->id;
$logaction->logaction('restored');
if ($asset->deleted_at=='') {
$message = 'Asset was not deleted. No data was changed.';
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/hardware/message.restore.success')));
} else {
$message = trans('admin/hardware/message.restore.success');
// Restore the asset
Asset::withTrashed()->where('id', $assetId)->restore();
$logaction = new Actionlog();
$logaction->item_type = Asset::class;
$logaction->item_id = $asset->id;
$logaction->created_at = date("Y-m-d H:i:s");
$logaction->user_id = Auth::user()->id;
$logaction->logaction('restored');
}
return response()->json(Helper::formatStandardApiResponse('success', (new AssetsTransformer)->transformAsset($asset, $request), $message));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
}
/**
* Checkout an asset by its tag.
*
* @author [N. Butler]
* @param string $tag
* @since [v6.0.5]
* @return JsonResponse
*/
public function checkoutByTag(AssetCheckoutRequest $request, $tag)
{
if ($asset = Asset::where('asset_tag', $tag)->first()) {
return $this->checkout($request, $asset->id);
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200);
}
/**
* Checkout an asset
@@ -752,7 +787,7 @@ class AssetsController extends Controller
$this->authorize('checkout', Asset::class);
$asset = Asset::findOrFail($asset_id);
if (!$asset->availableForCheckout()) {
if (! $asset->availableForCheckout()) {
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.not_available')));
}
@@ -766,21 +801,21 @@ class AssetsController extends Controller
// This item is checked out to a location
if (request('checkout_to_type')=='location') {
if (request('checkout_to_type') == 'location') {
$target = Location::find(request('assigned_location'));
$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'));
} elseif (request('checkout_to_type') == 'asset') {
$target = Asset::where('id', '!=', $asset_id)->find(request('assigned_asset'));
$asset->location_id = $target->rtd_location_id;
// 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') {
} elseif (request('checkout_to_type') == 'user') {
// Fetch the target and set the asset's new location_id
$target = User::find(request('assigned_user'));
$asset->location_id = (($target) && (isset($target->location_id))) ? $target->location_id : '';
@@ -793,13 +828,13 @@ class AssetsController extends Controller
}
if (!isset($target)) {
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.'));
}
$checkout_at = request('checkout_at', date("Y-m-d H:i:s"));
$checkout_at = request('checkout_at', date('Y-m-d H:i:s'));
$expected_checkin = request('expected_checkin', null);
$note = request('note', null);
$asset_name = request('name', null);
@@ -838,8 +873,8 @@ class AssetsController extends Controller
$this->authorize('checkin', $asset);
$user = $asset->assignedUser;
if (is_null($target = $asset->assignedTo)) {
$target = $asset->assignedTo;
if (is_null($target)) {
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.already_checked_in')));
}
@@ -849,24 +884,22 @@ class AssetsController extends Controller
$asset->assignedTo()->disassociate($asset);
$asset->accepted = null;
if ($request->filled('name')) {
if ($request->has('name')) {
$asset->name = $request->input('name');
}
$asset->location_id = $asset->rtd_location_id;
$asset->location_id = $asset->rtd_location_id;
if ($request->filled('location_id')) {
$asset->location_id = $request->input('location_id');
$asset->location_id = $request->input('location_id');
}
if ($request->has('status_id')) {
$asset->status_id = $request->input('status_id');
$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 = null;
if ($request->filled('checkin_at')) {
$checkin_at = $request->input('checkin_at');
}
if ($asset->save()) {
event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at));
@@ -877,6 +910,27 @@ class AssetsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.error')));
}
/**
* Checkin an asset by asset tag
*
* @author [A. Janes] [<ajanes@adagiohealth.org>]
* @since [v6.0]
* @return JsonResponse
*/
public function checkinByTag(Request $request)
{
$this->authorize('checkin', Asset::class);
$asset = Asset::where('asset_tag', $request->input('asset_tag'))->first();
if ($asset) {
return $this->checkin($request, $asset->id);
}
return response()->json(Helper::formatStandardApiResponse('error', [
'asset'=> e($request->input('asset_tag'))
], 'Asset with tag '.e($request->input('asset_tag')).' not found'));
}
/**
* Mark an asset as audited
@@ -886,15 +940,15 @@ class AssetsController extends Controller
* @since [v4.0]
* @return JsonResponse
*/
public function audit(Request $request) {
public function audit(Request $request)
{
$this->authorize('audit', Asset::class);
$rules = array(
$rules = [
'asset_tag' => 'required',
'location_id' => 'exists:locations,id|nullable|numeric',
'next_audit_date' => 'date|nullable'
);
'next_audit_date' => 'date|nullable',
];
$validator = Validator::make($request->all(), $rules);
if ($validator->fails()) {
@@ -904,7 +958,7 @@ class AssetsController extends Controller
$settings = Setting::getSettings();
$dt = Carbon::now()->addMonths($settings->audit_interval)->toDateString();
$asset = Asset::where('asset_tag','=', $request->input('asset_tag'))->first();
$asset = Asset::where('asset_tag', '=', $request->input('asset_tag'))->first();
if ($asset) {
@@ -918,28 +972,24 @@ class AssetsController extends Controller
// Check to see if they checked the box to update the physical location,
// not just note it in the audit notes
if ($request->input('update_location')=='1') {
if ($request->input('update_location') == '1') {
$asset->location_id = $request->input('location_id');
}
$asset->last_audit_date = date('Y-m-d H:i:s');
if ($asset->save()) {
$log = $asset->logAudit(request('note'),request('location_id'));
$log = $asset->logAudit(request('note'), request('location_id'));
return response()->json(Helper::formatStandardApiResponse('success', [
'asset_tag'=> e($asset->asset_tag),
'note'=> e($request->input('note')),
'next_audit_date' => Helper::getFormattedDateObject($asset->next_audit_date)
'next_audit_date' => Helper::getFormattedDateObject($asset->next_audit_date),
], trans('admin/hardware/message.audit.success')));
}
}
return response()->json(Helper::formatStandardApiResponse('error', ['asset_tag'=> e($request->input('asset_tag'))], 'Asset with tag '.e($request->input('asset_tag')).' not found'));
}
@@ -955,14 +1005,16 @@ class AssetsController extends Controller
{
$this->authorize('viewRequestable', Asset::class);
$assets = Company::scopeCompanyables(Asset::select('assets.*'),"company_id","assets")
$assets = Company::scopeCompanyables(Asset::select('assets.*'), 'company_id', 'assets')
->with('location', 'assetstatus', 'assetlog', 'company', 'defaultLoc','assignedTo',
'model.category', 'model.manufacturer', 'model.fieldset','supplier')->where('assets.requestable', '=', '1');
'model.category', 'model.manufacturer', 'model.fieldset', 'supplier')->requestableAssets();
$offset = request('offset', 0);
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$assets->TextSearch($request->input('search'));
if ($request->filled('search')) {
$assets->TextSearch($request->input('search'));
}
switch ($request->input('sort')) {
case 'model':
@@ -982,9 +1034,9 @@ class AssetsController extends Controller
break;
}
$total = $assets->count();
$assets = $assets->skip($offset)->take($limit)->get();
return (new AssetsTransformer)->transformRequestedAssets($assets, $total);
}
}

View File

@@ -23,15 +23,37 @@ class CategoriesController extends Controller
public function index(Request $request)
{
$this->authorize('view', Category::class);
$allowed_columns = ['id', 'name','category_type', 'category_type','use_default_eula','eula_text', 'require_acceptance','checkin_email', 'assets_count', 'accessories_count', 'consumables_count', 'components_count','licenses_count', 'image'];
$allowed_columns = ['id', 'name', 'category_type', 'category_type', 'use_default_eula', 'eula_text', 'require_acceptance', 'checkin_email', 'assets_count', 'accessories_count', 'consumables_count', 'components_count', 'licenses_count', 'image'];
$categories = Category::select(['id', 'created_at', 'updated_at', 'name','category_type','use_default_eula','eula_text', 'require_acceptance','checkin_email','image'])
->withCount('assets as assets_count', 'accessories as accessories_count', 'consumables as consumables_count', 'components as components_count','licenses as licenses_count');
$categories = Category::select(['id', 'created_at', 'updated_at', 'name', 'category_type', 'use_default_eula', 'eula_text', 'require_acceptance', 'checkin_email', 'image'])
->withCount('assets as assets_count', 'accessories as accessories_count', 'consumables as consumables_count', 'components as components_count', 'licenses as licenses_count');
if ($request->filled('search')) {
$categories = $categories->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$categories->where('name', '=', $request->input('name'));
}
if ($request->filled('category_type')) {
$categories->where('category_type', '=', $request->input('category_type'));
}
if ($request->filled('use_default_eula')) {
$categories->where('use_default_eula', '=', $request->input('use_default_eula'));
}
if ($request->filled('require_acceptance')) {
$categories->where('require_acceptance', '=', $request->input('require_acceptance'));
}
if ($request->filled('checkin_email')) {
$categories->where('checkin_email', '=', $request->input('checkin_email'));
}
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($categories) && ($request->get('offset') > $categories->count())) ? $categories->count() : $request->get('offset', 0);
@@ -45,6 +67,7 @@ class CategoriesController extends Controller
$total = $categories->count();
$categories = $categories->skip($offset)->take($limit)->get();
return (new CategoriesTransformer)->transformCategories($categories, $total);
}
@@ -127,14 +150,14 @@ class CategoriesController extends Controller
$this->authorize('delete', Category::class);
$category = Category::findOrFail($id);
if (!$category->isDeletable()) {
if (! $category->isDeletable()) {
return response()->json(
Helper::formatStandardApiResponse('error', null, trans('admin/categories/message.assoc_items', ['asset_type'=>$category->category_type]))
Helper::formatStandardApiResponse('error', null, trans('admin/categories/message.assoc_items', ['asset_type'=>$category->category_type]))
);
}
$category->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/categories/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/categories/message.delete.success')));
}
@@ -144,7 +167,6 @@ class CategoriesController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request, $category_type = 'asset')
{
@@ -169,7 +191,5 @@ class CategoriesController extends Controller
}
return (new SelectlistTransformer)->transformSelectlist($categories);
}
}

View File

@@ -37,12 +37,17 @@ class CompaniesController extends Controller
'components_count',
];
$companies = Company::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');
$companies = Company::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');
if ($request->filled('search')) {
$companies->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$companies->where('name', '=', $request->input('name'));
}
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($companies) && ($request->get('offset') > $companies->count())) ? $companies->count() : $request->get('offset', 0);
@@ -79,9 +84,9 @@ class CompaniesController extends Controller
if ($company->save()) {
return response()->json(Helper::formatStandardApiResponse('success', (new CompaniesTransformer)->transformCompany($company), trans('admin/companies/message.create.success')));
}
return response()
->json(Helper::formatStandardApiResponse('error', null, $company->getErrors()));
}
/**
@@ -140,13 +145,14 @@ class CompaniesController extends Controller
$company = Company::findOrFail($id);
$this->authorize('delete', $company);
if ( !$company->isDeletable() ) {
if (! $company->isDeletable()) {
return response()
->json(Helper::formatStandardApiResponse('error', null, trans('admin/companies/message.assoc_users')));
->json(Helper::formatStandardApiResponse('error', null, trans('admin/companies/message.assoc_users')));
}
$company->delete();
return response()
->json(Helper::formatStandardApiResponse('success', null, trans('admin/companies/message.delete.success')));
->json(Helper::formatStandardApiResponse('success', null, trans('admin/companies/message.delete.success')));
}
/**
@@ -155,7 +161,6 @@ class CompaniesController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{

View File

@@ -51,16 +51,20 @@ class ComponentsController extends Controller
$components = $components->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$components->where('name', '=', $request->input('name'));
}
if ($request->filled('company_id')) {
$components->where('company_id','=',$request->input('company_id'));
$components->where('company_id', '=', $request->input('company_id'));
}
if ($request->filled('category_id')) {
$components->where('category_id','=',$request->input('category_id'));
$components->where('category_id', '=', $request->input('category_id'));
}
if ($request->filled('location_id')) {
$components->where('location_id','=',$request->input('location_id'));
$components->where('location_id', '=', $request->input('location_id'));
}
if ($request->filled('notes')) {
@@ -96,6 +100,7 @@ class ComponentsController extends Controller
$total = $components->count();
$components = $components->skip($offset)->take($limit)->get();
return (new ComponentsTransformer)->transformComponents($components, $total);
}
@@ -118,6 +123,7 @@ class ComponentsController extends Controller
if ($component->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $component, trans('admin/components/message.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $component->getErrors()));
}
@@ -138,7 +144,6 @@ class ComponentsController extends Controller
}
}
/**
* Update the specified resource in storage.
*
@@ -177,6 +182,7 @@ class ComponentsController extends Controller
$component = Component::findOrFail($id);
$this->authorize('delete', $component);
$component->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/components/message.delete.success')));
}
@@ -200,6 +206,7 @@ class ComponentsController extends Controller
$limit = $request->input('limit', 50);
$total = $assets->count();
$assets = $assets->skip($offset)->take($limit)->get();
return (new ComponentsTransformer)->transformCheckedoutComponents($assets, $total);
}
@@ -239,7 +246,8 @@ class ComponentsController extends Controller
'created_at' => \Carbon::now(),
'assigned_qty' => $request->get('assigned_qty', 1),
'user_id' => \Auth::id(),
'asset_id' => $request->get('assigned_to')
'asset_id' => $request->get('assigned_to'),
'note' => $request->get('note'),
]);
$component->logCheckout($request->input('note'), $asset);

View File

@@ -55,12 +55,16 @@ class ConsumablesController extends Controller
$consumables = $consumables->TextSearch(e($request->input('search')));
}
if ($request->filled('name')) {
$consumables->where('name', '=', $request->input('name'));
}
if ($request->filled('company_id')) {
$consumables->where('company_id','=',$request->input('company_id'));
$consumables->where('company_id', '=', $request->input('company_id'));
}
if ($request->filled('category_id')) {
$consumables->where('category_id','=',$request->input('category_id'));
$consumables->where('category_id', '=', $request->input('category_id'));
}
if ($request->filled('model_number')) {
@@ -68,7 +72,7 @@ class ConsumablesController extends Controller
}
if ($request->filled('manufacturer_id')) {
$consumables->where('manufacturer_id','=',$request->input('manufacturer_id'));
$consumables->where('manufacturer_id', '=', $request->input('manufacturer_id'));
}
if ($request->filled('location_id')) {
@@ -87,7 +91,7 @@ class ConsumablesController extends Controller
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$allowed_columns = ['id', 'name', 'order_number', 'min_amt', 'purchase_date', 'purchase_cost', 'company', 'category', 'model_number', 'item_no', 'manufacturer', 'location', 'qty', 'image'];
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort_override = $request->input('sort');
@@ -112,15 +116,12 @@ class ConsumablesController extends Controller
break;
}
$total = $consumables->count();
$consumables = $consumables->skip($offset)->take($limit)->get();
return (new ConsumablesTransformer)->transformConsumables($consumables, $total);
}
/**
* Store a newly created resource in storage.
*
@@ -139,6 +140,7 @@ class ConsumablesController extends Controller
if ($consumable->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $consumable, trans('admin/consumables/message.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $consumable->getErrors()));
}
@@ -153,10 +155,10 @@ class ConsumablesController extends Controller
{
$this->authorize('view', Consumable::class);
$consumable = Consumable::findOrFail($id);
return (new ConsumablesTransformer)->transformConsumable($consumable);
}
/**
* Update the specified resource in storage.
*
@@ -194,7 +196,8 @@ class ConsumablesController extends Controller
$consumable = Consumable::findOrFail($id);
$this->authorize('delete', $consumable);
$consumable->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/consumables/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/consumables/message.delete.success')));
}
/**
@@ -208,32 +211,34 @@ class ConsumablesController extends Controller
*/
public function getDataView($consumableId)
{
$consumable = Consumable::with(array('consumableAssignments'=>
function ($query) {
$consumable = Consumable::with(['consumableAssignments'=> function ($query) {
$query->orderBy($query->getModel()->getTable().'.created_at', 'DESC');
},
'consumableAssignments.admin'=> function ($query) {
},
'consumableAssignments.user'=> function ($query) {
},
))->find($consumableId);
])->find($consumableId);
if (!Company::isCurrentUserHasAccess($consumable)) {
if (! Company::isCurrentUserHasAccess($consumable)) {
return ['total' => 0, 'rows' => []];
}
$this->authorize('view', Consumable::class);
$rows = array();
$rows = [];
foreach ($consumable->consumableAssignments as $consumable_assignment) {
$rows[] = [
'avatar' => ($consumable_assignment->user) ? e($consumable_assignment->user->present()->gravatar) : '',
'name' => ($consumable_assignment->user) ? $consumable_assignment->user->present()->nameUrl() : 'Deleted User',
'created_at' => Helper::getFormattedDateObject($consumable_assignment->created_at, 'datetime'),
'admin' => ($consumable_assignment->admin) ? $consumable_assignment->admin->present()->nameUrl() : '',
'note' => ($consumable_assignment->note) ? e($consumable_assignment->note) : null,
'admin' => ($consumable_assignment->admin) ? $consumable_assignment->admin->present()->nameUrl() : null,
];
}
$consumableCount = $consumable->users->count();
$data = array('total' => $consumableCount, 'rows' => $rows);
$data = ['total' => $consumableCount, 'rows' => $rows];
return $data;
}
@@ -269,7 +274,8 @@ class ConsumablesController extends Controller
$consumable->users()->attach($consumable->id, [
'consumable_id' => $consumable->id,
'user_id' => $user->id,
'assigned_to' => $assigned_to
'assigned_to' => $assigned_to,
'note' => $request->input('note'),
]);
// Log checkout event
@@ -282,7 +288,7 @@ class ConsumablesController extends Controller
$data['note'] = $logaction->note;
$data['require_acceptance'] = $consumable->requireAcceptance();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/consumables/message.checkout.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/consumables/message.checkout.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'No consumables remaining'));
@@ -292,14 +298,12 @@ class ConsumablesController extends Controller
* Gets a paginated collection for the select2 menus
*
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
$consumables = Consumable::select([
'consumables.id',
'consumables.name'
'consumables.name',
]);
if ($request->filled('search')) {
@@ -308,7 +312,6 @@ class ConsumablesController extends Controller
$consumables = $consumables->orderBy('name', 'ASC')->paginate(50);
return (new SelectlistTransformer)->transformSelectlist($consumables);
}
}

View File

@@ -18,26 +18,26 @@ class CustomFieldsController extends Controller
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @param int $id
* @since [v3.0]
* @return Array
* @return array
*/
public function index()
{
$this->authorize('index', CustomField::class);
$fields = CustomField::get();
return (new CustomFieldsTransformer)->transformCustomFields($fields, $fields->count());
}
/**
* Shows the given field
* @author [V. Cordes] [<volker@fdatek.de>]
* @param int $id
* @since [v4.1.10]
* @return View
*/
* Shows the given field
* @author [V. Cordes] [<volker@fdatek.de>]
* @param int $id
* @since [v4.1.10]
* @return View
*/
public function show($id)
{
$this->authorize('view', CustomField::class);
$this->authorize('view', CustomField::class);
if ($field = CustomField::find($id)) {
return (new CustomFieldsTransformer)->transformCustomField($field);
}
@@ -45,7 +45,7 @@ class CustomFieldsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/custom_fields/message.field.invalid')), 200);
}
/**
/**
* Update the specified field
*
* @author [V. Cordes] [<volker@fdatek.de>]
@@ -80,7 +80,6 @@ class CustomFieldsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, $field->getErrors()));
}
/**
* Store a newly created field.
*
@@ -96,9 +95,9 @@ class CustomFieldsController extends Controller
$data = $request->all();
$regex_format = null;
if (str_contains($data["format"], "regex:")){
$regex_format = $data["format"];
if ((array_key_exists('format', $data)) && (str_contains($data['format'], 'regex:'))) {
$regex_format = $data['format'];
}
$validator = Validator::make($data, $field->validationRules($regex_format));
@@ -111,8 +110,8 @@ class CustomFieldsController extends Controller
if ($field->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $field, trans('admin/custom_fields/message.field.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $field->getErrors()));
return response()->json(Helper::formatStandardApiResponse('error', null, $field->getErrors()));
}
public function postReorder(Request $request, $id)
@@ -121,8 +120,8 @@ class CustomFieldsController extends Controller
$this->authorize('update', $fieldset);
$fields = array();
$order_array = array();
$fields = [];
$order_array = [];
$items = $request->input('item');
@@ -135,7 +134,6 @@ class CustomFieldsController extends Controller
}
return $fieldset->fields()->sync($fields);
}
public function associate(Request $request, $field_id)
@@ -152,7 +150,8 @@ class CustomFieldsController extends Controller
}
$fieldset = CustomFieldset::findOrFail($fieldset_id);
$fieldset->fields()->attach($field->id, ["required" => ($request->input('required') == "on"), "order" => $request->input('order', $fieldset->fields->count())]);
$fieldset->fields()->attach($field->id, ['required' => ($request->input('required') == 'on'), 'order' => $request->input('order', $fieldset->fields->count())]);
return response()->json(Helper::formatStandardApiResponse('success', $fieldset, trans('admin/custom_fields/message.fieldset.update.success')));
}
@@ -166,10 +165,12 @@ class CustomFieldsController extends Controller
foreach ($field->fieldset as $fieldset) {
if ($fieldset->id == $fieldset_id) {
$fieldset->fields()->detach($field->id);
return response()->json(Helper::formatStandardApiResponse('success', $fieldset, trans('admin/custom_fields/message.fieldset.update.success')));
}
}
$fieldset = CustomFieldset::findOrFail($fieldset_id);
return response()->json(Helper::formatStandardApiResponse('success', $fieldset, trans('admin/custom_fields/message.fieldset.update.success')));
}
@@ -186,13 +187,12 @@ class CustomFieldsController extends Controller
$this->authorize('delete', $field);
if ($field->fieldset->count() >0) {
if ($field->fieldset->count() > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Field is in use.'));
}
$field->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/custom_fields/message.field.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/custom_fields/message.field.delete.success')));
}
}

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
@@ -20,47 +21,43 @@ use View;
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @author [Josh Gibson]
*/
class CustomFieldsetsController extends Controller
{
/**
* Shows the given fieldset and its fields
* @author [A. Gianotto] [<snipe@snipe.net>]
* @author [Josh Gibson]
* @param int $id
* @since [v1.8]
* @return View
*/
* Shows the given fieldset and its fields
* @author [A. Gianotto] [<snipe@snipe.net>]
* @author [Josh Gibson]
* @param int $id
* @since [v1.8]
* @return View
*/
public function index()
{
$this->authorize('index', CustomFieldset::class);
$fieldsets = CustomFieldset::withCount('fields as fields_count', 'models as models_count')->get();
return (new CustomFieldsetsTransformer)->transformCustomFieldsets($fieldsets, $fieldsets->count());
return (new CustomFieldsetsTransformer)->transformCustomFieldsets($fieldsets, $fieldsets->count());
}
/**
* Shows the given fieldset and its fields
* @author [A. Gianotto] [<snipe@snipe.net>]
* @author [Josh Gibson]
* @param int $id
* @since [v1.8]
* @return View
*/
* Shows the given fieldset and its fields
* @author [A. Gianotto] [<snipe@snipe.net>]
* @author [Josh Gibson]
* @param int $id
* @since [v1.8]
* @return View
*/
public function show($id)
{
$this->authorize('view', CustomFieldset::class);
$this->authorize('view', CustomFieldset::class);
if ($fieldset = CustomFieldset::find($id)) {
return (new CustomFieldsetsTransformer)->transformCustomFieldset($fieldset);
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/custom_fields/message.fieldset.does_not_exist')), 200);
}
/**
/**
* Update the specified resource in storage.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
@@ -82,7 +79,6 @@ class CustomFieldsetsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, $fieldset->getErrors()));
}
/**
* Store a newly created resource in storage.
*
@@ -100,11 +96,10 @@ class CustomFieldsetsController extends Controller
if ($fieldset->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $fieldset, trans('admin/custom_fields/message.fieldset.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $fieldset->getErrors()));
}
/**
* Delete a custom fieldset.
*
@@ -120,18 +115,15 @@ class CustomFieldsetsController extends Controller
$modelsCount = $fieldset->models->count();
$fieldsCount = $fieldset->fields->count();
if (($modelsCount > 0) || ($fieldsCount > 0) ){
if (($modelsCount > 0) || ($fieldsCount > 0)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Fieldset is in use.'));
}
if ($fieldset->delete()) {
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/custom_fields/message.fieldset.delete.success')));
}
if ($fieldset->delete()) {
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/custom_fields/message.fieldset.delete.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'Unspecified error'));
}
/**
@@ -147,6 +139,7 @@ class CustomFieldsetsController extends Controller
$this->authorize('view', CustomFieldset::class);
$set = CustomFieldset::findOrFail($id);
$fields = $set->fields;
return (new CustomFieldsTransformer)->transformCustomFields($fields, $fields->count());
}

View File

@@ -6,6 +6,7 @@ use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\DepartmentsTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Company;
use App\Models\Department;
use Auth;
use Illuminate\Http\Request;
@@ -24,9 +25,9 @@ class DepartmentsController extends Controller
public function index(Request $request)
{
$this->authorize('view', Department::class);
$allowed_columns = ['id','name','image','users_count'];
$allowed_columns = ['id', 'name', 'image', 'users_count'];
$departments = Department::select([
$departments = Company::scopeCompanyables(Department::select(
'departments.id',
'departments.name',
'departments.location_id',
@@ -34,13 +35,29 @@ class DepartmentsController extends Controller
'departments.manager_id',
'departments.created_at',
'departments.updated_at',
'departments.image'
])->with('users')->with('location')->with('manager')->with('company')->withCount('users as users_count');
'departments.image'),
"company_id", "departments")->with('users')->with('location')->with('manager')->with('company')->withCount('users as users_count');
if ($request->filled('search')) {
$departments = $departments->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$departments->where('name', '=', $request->input('name'));
}
if ($request->filled('company_id')) {
$departments->where('company_id', '=', $request->input('company_id'));
}
if ($request->filled('manager_id')) {
$departments->where('manager_id', '=', $request->input('manager_id'));
}
if ($request->filled('location_id')) {
$departments->where('location_id', '=', $request->input('location_id'));
}
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($departments) && ($request->get('offset') > $departments->count())) ? $departments->count() : $request->get('offset', 0);
@@ -85,7 +102,7 @@ class DepartmentsController extends Controller
$department = $request->handleImages($department);
$department->user_id = Auth::user()->id;
$department->manager_id = ($request->filled('manager_id' ) ? $request->input('manager_id') : null);
$department->manager_id = ($request->filled('manager_id') ? $request->input('manager_id') : null);
if ($department->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $department, trans('admin/departments/message.create.success')));
@@ -106,6 +123,7 @@ class DepartmentsController extends Controller
{
$this->authorize('view', Department::class);
$department = Department::findOrFail($id);
return (new DepartmentsTransformer)->transformDepartment($department);
}
@@ -133,7 +151,6 @@ class DepartmentsController extends Controller
}
/**
* Validates and deletes selected department.
*
@@ -163,7 +180,6 @@ class DepartmentsController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
@@ -189,7 +205,5 @@ class DepartmentsController extends Controller
}
return (new SelectlistTransformer)->transformSelectlist($departments);
}
}

View File

@@ -41,10 +41,10 @@ class DepreciationsController extends Controller
$total = $depreciations->count();
$depreciations = $depreciations->skip($offset)->take($limit)->get();
return (new DepreciationsTransformer)->transformDepreciations($depreciations, $total);
}
/**
* Store a newly created resource in storage.
*
@@ -62,8 +62,8 @@ class DepreciationsController extends Controller
if ($depreciation->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $depreciation, trans('admin/depreciations/message.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $depreciation->getErrors()));
return response()->json(Helper::formatStandardApiResponse('error', null, $depreciation->getErrors()));
}
/**
@@ -78,10 +78,10 @@ class DepreciationsController extends Controller
{
$this->authorize('view', Depreciation::class);
$depreciation = Depreciation::findOrFail($id);
return (new DepreciationsTransformer)->transformDepreciation($depreciation);
}
/**
* Update the specified resource in storage.
*
@@ -123,10 +123,7 @@ class DepreciationsController extends Controller
}
$depreciation->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/depreciations/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/depreciations/message.delete.success')));
}
}

View File

@@ -20,14 +20,18 @@ class GroupsController extends Controller
public function index(Request $request)
{
$this->authorize('view', Group::class);
$allowed_columns = ['id','name','created_at', 'users_count'];
$allowed_columns = ['id', 'name', 'created_at', 'users_count'];
$groups = Group::select('id','name','permissions','created_at','updated_at')->withCount('users as users_count');
$groups = Group::select('id', 'name', 'permissions', 'created_at', 'updated_at')->withCount('users as users_count');
if ($request->filled('search')) {
$groups = $groups->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$groups->where('name', '=', $request->input('name'));
}
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($groups) && ($request->get('offset') > $groups->count())) ? $groups->count() : $request->get('offset', 0);
@@ -41,10 +45,10 @@ class GroupsController extends Controller
$total = $groups->count();
$groups = $groups->skip($offset)->take($limit)->get();
return (new GroupsTransformer)->transformGroups($groups, $total);
}
/**
* Store a newly created resource in storage.
*
@@ -62,8 +66,8 @@ class GroupsController extends Controller
if ($group->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $group, trans('admin/groups/message.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $group->getErrors()));
return response()->json(Helper::formatStandardApiResponse('error', null, $group->getErrors()));
}
/**
@@ -78,10 +82,10 @@ class GroupsController extends Controller
{
$this->authorize('view', Group::class);
$group = Group::findOrFail($id);
return (new GroupsTransformer)->transformGroup($group);
}
/**
* Update the specified resource in storage.
*
@@ -118,9 +122,7 @@ class GroupsController extends Controller
$group = Group::findOrFail($id);
$this->authorize('delete', $group);
$group->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/groups/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/groups/message.delete.success')));
}
}

View File

@@ -27,8 +27,8 @@ class ImportController extends Controller
{
$this->authorize('import');
$imports = Import::latest()->get();
return (new ImportsTransformer)->transformImports($imports);
return (new ImportsTransformer)->transformImports($imports);
}
/**
@@ -40,27 +40,28 @@ class ImportController extends Controller
public function store()
{
$this->authorize('import');
if (!config('app.lock_passwords')) {
if (! config('app.lock_passwords')) {
$files = Request::file('files');
$path = config('app.private_uploads').'/imports';
$results = [];
$import = new Import;
foreach ($files as $file) {
if (!in_array($file->getMimeType(), array(
if (! in_array($file->getMimeType(), [
'application/vnd.ms-excel',
'text/csv',
'application/csv',
'text/x-Algol68', // because wtf CSV files?
'text/plain',
'text/comma-separated-values',
'text/tsv'))) {
$results['error']='File type must be CSV. Uploaded file is '.$file->getMimeType();
'text/tsv', ])) {
$results['error'] = 'File type must be CSV. Uploaded file is '.$file->getMimeType();
return response()->json(Helper::formatStandardApiResponse('error', null, $results['error']), 500);
}
//TODO: is there a lighter way to do this?
if (! ini_get("auto_detect_line_endings")) {
ini_set("auto_detect_line_endings", '1');
if (! ini_get('auto_detect_line_endings')) {
ini_set('auto_detect_line_endings', '1');
}
$reader = Reader::createFromFileObject($file->openFile('r')); //file pointer leak?
$import->header_row = $reader->fetchOne(0);
@@ -68,20 +69,20 @@ class ImportController extends Controller
//duplicate headers check
$duplicate_headers = [];
for($i = 0; $i<count($import->header_row); $i++) {
for ($i = 0; $i < count($import->header_row); $i++) {
$header = $import->header_row[$i];
if(in_array($header, $import->header_row)) {
if (in_array($header, $import->header_row)) {
$found_at = array_search($header, $import->header_row);
if($i > $found_at) {
if ($i > $found_at) {
//avoid reporting duplicates twice, e.g. "1 is same as 17! 17 is same as 1!!!"
//as well as "1 is same as 1!!!" (which is always true)
//has to be > because otherwise the first result of array_search will always be $i itself(!)
array_push($duplicate_headers,"Duplicate header '$header' detected, first at column: ".($found_at+1).", repeats at column: ".($i+1));
array_push($duplicate_headers, "Duplicate header '$header' detected, first at column: ".($found_at + 1).', repeats at column: '.($i + 1));
}
}
}
if(count($duplicate_headers) > 0) {
return response()->json(Helper::formatStandardApiResponse('error',null, implode("; ",$duplicate_headers)), 500); //should this be '4xx'?
if (count($duplicate_headers) > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, implode('; ', $duplicate_headers)), 500); //should this be '4xx'?
}
// Grab the first row to display via ajax as the user picks fields
@@ -92,10 +93,11 @@ class ImportController extends Controller
try {
$file->move($path, $date.'-'.$fixed_filename);
} catch (FileException $exception) {
$results['error']=trans('admin/hardware/message.upload.error');
$results['error'] = trans('admin/hardware/message.upload.error');
if (config('app.debug')) {
$results['error'].= ' ' . $exception->getMessage();
$results['error'] .= ' '.$exception->getMessage();
}
return response()->json(Helper::formatStandardApiResponse('error', null, $results['error']), 500);
}
$file_name = date('Y-m-d-his').'-'.$fixed_filename;
@@ -105,12 +107,15 @@ class ImportController extends Controller
$results[] = $import;
}
$results = (new ImportsTransformer)->transformImports($results);
return [
'files' => $results,
];
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.feature_disabled')), 500);
}
/**
* Processes the specified Import.
*
@@ -129,26 +134,33 @@ class ImportController extends Controller
\Log::debug('NO BACKUP requested via importer');
}
$errors = $request->import(Import::find($import_id));
$redirectTo = "hardware.index";
$import = Import::find($import_id);
if(is_null($import)){
$error[0][0] = trans("validation.exists", ["attribute" => "file"]);
return response()->json(Helper::formatStandardApiResponse('import-errors', null, $error), 500);
}
$errors = $request->import($import);
$redirectTo = 'hardware.index';
switch ($request->get('import-type')) {
case "asset":
$redirectTo = "hardware.index";
case 'asset':
$redirectTo = 'hardware.index';
break;
case "accessory":
$redirectTo = "accessories.index";
case 'accessory':
$redirectTo = 'accessories.index';
break;
case "consumable":
$redirectTo = "consumables.index";
case 'consumable':
$redirectTo = 'consumables.index';
break;
case "component":
$redirectTo = "components.index";
case 'component':
$redirectTo = 'components.index';
break;
case "license":
$redirectTo = "licenses.index";
case 'license':
$redirectTo = 'licenses.index';
break;
case "user":
$redirectTo = "users.index";
case 'user':
$redirectTo = 'users.index';
break;
}
@@ -157,8 +169,8 @@ class ImportController extends Controller
}
//Flash message before the redirect
Session::flash('success', trans('admin/hardware/message.import.success'));
return response()->json(Helper::formatStandardApiResponse('success', null, ['redirect_url' => route($redirectTo)]));
return response()->json(Helper::formatStandardApiResponse('success', null, ['redirect_url' => route($redirectTo)]));
}
/**
@@ -170,20 +182,20 @@ class ImportController extends Controller
public function destroy($import_id)
{
$this->authorize('create', Asset::class);
if ($import = Import::find($import_id)) {
try {
// Try to delete the file
Storage::delete('imports/'.$import->file_path);
$import->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/hardware/message.import.file_delete_success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/hardware/message.import.file_delete_success')));
} catch (\Exception $e) {
// If the file delete didn't work, remove it from the database anyway and return a warning
$import->delete();
return response()->json(Helper::formatStandardApiResponse('warning', null, trans('admin/hardware/message.import.file_not_deleted_warning')));
}
}
}
}

View File

@@ -32,16 +32,16 @@ class LicenseSeatsController extends Controller
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
if ($request->input('sort')=='department') {
if ($request->input('sort') == 'department') {
$seats->OrderDepartments($order);
} else {
$seats->orderBy('id', $order);
}
$total = $seats->count();
$offset = (($seats) && (request('offset') > $total)) ? 0 : request('offset', 0);
$offset = (($seats) && (request('offset') >= $total)) ? 0 : request('offset', 0);
$limit = request('limit', 50);
$seats = $seats->skip($offset)->take($limit)->get();
if ($seats) {
@@ -65,13 +65,14 @@ class LicenseSeatsController extends Controller
$this->authorize('view', License::class);
// sanity checks:
// 1. does the license seat exist?
if (!$licenseSeat = LicenseSeat::find($seatId)) {
if (! $licenseSeat = LicenseSeat::find($seatId)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat not found'));
}
// 2. does the seat belong to the specified license?
if (!$license = $licenseSeat->license()->first() || $license->id != intval($licenseId)) {
if (! $license = $licenseSeat->license()->first() || $license->id != intval($licenseId)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat does not belong to the specified license'));
}
return (new LicenseSeatsTransformer)->transformLicenseSeat($licenseSeat);
}
@@ -89,11 +90,11 @@ class LicenseSeatsController extends Controller
// sanity checks:
// 1. does the license seat exist?
if (!$licenseSeat = LicenseSeat::find($seatId)) {
if (! $licenseSeat = LicenseSeat::find($seatId)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat not found'));
}
// 2. does the seat belong to the specified license?
if (!$license = $licenseSeat->license()->first() || $license->id != intval($licenseId)) {
if (! $license = $licenseSeat->license()->first() || $license->id != intval($licenseId)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Seat does not belong to the specified license'));
}
@@ -103,36 +104,42 @@ class LicenseSeatsController extends Controller
// attempt to update the license seat
$licenseSeat->fill($request->all());
$licenseSeat->user_id = Auth::user()->id;
// check if this update is a checkin operation
// 1. are relevant fields touched at all?
$touched = $licenseSeat->isDirty('assigned_to') || $licenseSeat->isDirty('asset_id');
// 2. are they cleared? if yes then this is a checkin operation
$is_checkin = ($touched && $licenseSeat->assigned_to === null && $licenseSeat->asset_id === null);
if (!$touched) {
if (! $touched) {
// nothing to update
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}
// the logging functions expect only one "target". if both asset and user are present in the request,
// we simply let assets take precedence over users...
if ($licenseSeat->isDirty('assigned_to')) {
$target = $is_checkin ? $oldUser : User::find($licenseSeat->assigned_to);
}
if ($licenseSeat->isDirty('asset_id')) {
$target = $is_checkin ? $oldAsset : Asset::find($licenseSeat->asset_id);
}
if (is_null($target)){
return response()->json(Helper::formatStandardApiResponse('error', null, 'Target not found'));
}
if ($licenseSeat->save()) {
// the logging functions expect only one "target". if both asset and user are present in the request,
// we simply let assets take precedence over users...
$changes = $licenseSeat->getChanges();
if (array_key_exists('assigned_to', $changes)) {
$target = $is_checkin ? $oldUser : User::find($changes['assigned_to']);
}
if (array_key_exists('asset_id', $changes)) {
$target = $is_checkin ? $oldAsset : Asset::find($changes['asset_id']);
}
if ($is_checkin) {
$licenseSeat->logCheckin($target, $request->input('note'));
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}
// in this case, relevant fields are touched but it's not a checkin operation. so it must be a checkout operation.
$licenseSeat->logCheckout($request->input('note'), $target);
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}

View File

@@ -30,53 +30,61 @@ class LicensesController extends Controller
if ($request->filled('company_id')) {
$licenses->where('company_id','=',$request->input('company_id'));
$licenses->where('company_id', '=', $request->input('company_id'));
}
if ($request->filled('name')) {
$licenses->where('licenses.name','=',$request->input('name'));
$licenses->where('licenses.name', '=', $request->input('name'));
}
if ($request->filled('product_key')) {
$licenses->where('licenses.serial','=',$request->input('product_key'));
$licenses->where('licenses.serial', '=', $request->input('product_key'));
}
if ($request->filled('order_number')) {
$licenses->where('order_number','=',$request->input('order_number'));
$licenses->where('order_number', '=', $request->input('order_number'));
}
if ($request->filled('purchase_order')) {
$licenses->where('purchase_order','=',$request->input('purchase_order'));
$licenses->where('purchase_order', '=', $request->input('purchase_order'));
}
if ($request->filled('license_name')) {
$licenses->where('license_name','=',$request->input('license_name'));
$licenses->where('license_name', '=', $request->input('license_name'));
}
if ($request->filled('license_email')) {
$licenses->where('license_email','=',$request->input('license_email'));
$licenses->where('license_email', '=', $request->input('license_email'));
}
if ($request->filled('manufacturer_id')) {
$licenses->where('manufacturer_id','=',$request->input('manufacturer_id'));
$licenses->where('manufacturer_id', '=', $request->input('manufacturer_id'));
}
if ($request->filled('supplier_id')) {
$licenses->where('supplier_id','=',$request->input('supplier_id'));
$licenses->where('supplier_id', '=', $request->input('supplier_id'));
}
if ($request->filled('category_id')) {
$licenses->where('category_id','=',$request->input('category_id'));
$licenses->where('category_id', '=', $request->input('category_id'));
}
if ($request->filled('depreciation_id')) {
$licenses->where('depreciation_id','=',$request->input('depreciation_id'));
$licenses->where('depreciation_id', '=', $request->input('depreciation_id'));
}
if ($request->filled('supplier_id')) {
$licenses->where('supplier_id','=',$request->input('supplier_id'));
if (($request->filled('maintained')) && ($request->input('maintained')=='true')) {
$licenses->where('maintained','=',1);
} elseif (($request->filled('maintained')) && ($request->input('maintained')=='false')) {
$licenses->where('maintained','=',0);
}
if (($request->filled('expires')) && ($request->input('expires')=='true')) {
$licenses->whereNotNull('expiration_date');
} elseif (($request->filled('expires')) && ($request->input('expires')=='false')) {
$licenses->whereNull('expiration_date');
}
if ($request->filled('search')) {
$licenses = $licenses->TextSearch($request->input('search'));
@@ -86,7 +94,6 @@ class LicensesController extends Controller
$licenses->onlyTrashed();
}
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($licenses) && ($request->get('offset') > $licenses->count())) ? $licenses->count() : $request->get('offset', 0);
@@ -96,7 +103,6 @@ class LicensesController extends Controller
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
switch ($request->input('sort')) {
case 'manufacturer':
$licenses = $licenses->leftJoin('manufacturers', 'licenses.manufacturer_id', '=', 'manufacturers.id')->orderBy('manufacturers.name', $order);
@@ -132,15 +138,13 @@ class LicensesController extends Controller
'free_seats_count',
'seats',
'termination_date',
'depreciation_id'
'depreciation_id',
];
$sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';
$licenses = $licenses->orderBy($sort, $order);
break;
}
$total = $licenses->count();
$licenses = $licenses->skip($offset)->take($limit)->get();
@@ -148,9 +152,6 @@ class LicensesController extends Controller
}
/**
* Store a newly created resource in storage.
*
@@ -166,9 +167,10 @@ class LicensesController extends Controller
$license = new License;
$license->fill($request->all());
if($license->save()) {
if ($license->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $license, trans('admin/licenses/message.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $license->getErrors()));
}
@@ -184,10 +186,10 @@ class LicensesController extends Controller
$this->authorize('view', License::class);
$license = License::withCount('freeSeats')->findOrFail($id);
$license = $license->load('assignedusers', 'licenseSeats.user', 'licenseSeats.asset');
return (new LicensesTransformer)->transformLicense($license);
}
/**
* Update the specified resource in storage.
*
@@ -226,22 +228,23 @@ class LicensesController extends Controller
$license = License::findOrFail($id);
$this->authorize('delete', $license);
if($license->assigned_seats_count == 0) {
if ($license->assigned_seats_count == 0) {
// Delete the license and the associated license seats
DB::table('license_seats')
->where('id', $license->id)
->update(array('assigned_to' => null,'asset_id' => null));
->update(['assigned_to' => null, 'asset_id' => null]);
$licenseSeats = $license->licenseseats();
$licenseSeats->delete();
$license->delete();
// Redirect to the licenses management page
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/licenses/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/licenses/message.delete.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/licenses/message.assoc_users')));
}
/**
* Gets a paginated collection for the select2 menus
*
@@ -249,10 +252,9 @@ class LicensesController extends Controller
*/
public function selectlist(Request $request)
{
$licenses = License::select([
'licenses.id',
'licenses.name'
'licenses.name',
]);
if ($request->filled('search')) {
@@ -261,9 +263,6 @@ class LicensesController extends Controller
$licenses = $licenses->orderBy('name', 'ASC')->paginate(50);
return (new SelectlistTransformer)->transformSelectlist($licenses);
}
}

View File

@@ -2,13 +2,13 @@
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Helpers\Helper;
use App\Http\Requests\ImageUploadRequest;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
use App\Models\Location;
use App\Http\Transformers\LocationsTransformer;
use App\Http\Transformers\SelectlistTransformer;
use App\Models\Location;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
@@ -25,9 +25,9 @@ class LocationsController extends Controller
{
$this->authorize('view', Location::class);
$allowed_columns = [
'id','name','address','address2','city','state','country','zip','created_at',
'updated_at','manager_id','image',
'assigned_assets_count','users_count','assets_count','currency','ldap_ou'];
'id', 'name', 'address', 'address2', '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', 'ldap_ou', ];
$locations = Location::with('parent', 'manager', 'children')->select([
'locations.id',
@@ -44,16 +44,39 @@ class LocationsController extends Controller
'locations.updated_at',
'locations.image',
'locations.ldap_ou',
'locations.currency'
'locations.currency',
])->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('rtd_assets as rtd_assets_count')
->withCount('users as users_count');
if ($request->filled('search')) {
$locations = $locations->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$locations->where('locations.name', '=', $request->input('name'));
}
if ($request->filled('address')) {
$locations->where('locations.address', '=', $request->input('address'));
}
if ($request->filled('address2')) {
$locations->where('locations.address2', '=', $request->input('address2'));
}
if ($request->filled('city')) {
$locations->where('locations.city', '=', $request->input('city'));
}
if ($request->filled('zip')) {
$locations->where('locations.zip', '=', $request->input('zip'));
}
if ($request->filled('country')) {
$locations->where('locations.country', '=', $request->input('country'));
}
$offset = (($locations) && (request('offset') > $locations->count())) ? $locations->count() : request('offset', 0);
@@ -78,6 +101,7 @@ class LocationsController extends Controller
$total = $locations->count();
$locations = $locations->skip($offset)->take($limit)->get();
return (new LocationsTransformer)->transformLocations($locations, $total);
}
@@ -100,6 +124,7 @@ class LocationsController extends Controller
if ($location->save()) {
return response()->json(Helper::formatStandardApiResponse('success', (new LocationsTransformer)->transformLocation($location), trans('admin/locations/message.create.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $location->getErrors()));
}
@@ -129,11 +154,14 @@ class LocationsController extends Controller
'locations.created_at',
'locations.updated_at',
'locations.image',
'locations.currency'
'locations.currency',
])
->withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('users as users_count')->findOrFail($id);
->withCount('rtd_assets as rtd_assets_count')
->withCount('users as users_count')
->findOrFail($id);
return (new LocationsTransformer)->transformLocation($location);
}
@@ -182,12 +210,13 @@ class LocationsController extends Controller
{
$this->authorize('delete', Location::class);
$location = Location::findOrFail($id);
if(!$location->isDeletable()) {
if (! $location->isDeletable()) {
return response()
->json(Helper::formatStandardApiResponse('error', null, trans('admin/companies/message.assoc_users')));
->json(Helper::formatStandardApiResponse('error', null, trans('admin/companies/message.assoc_users')));
}
$this->authorize('delete', $location);
$location->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/locations/message.delete.success')));
}
@@ -218,7 +247,6 @@ class LocationsController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
@@ -246,26 +274,22 @@ class LocationsController extends Controller
$locations_with_children = [];
foreach ($locations as $location) {
if (!array_key_exists($location->parent_id, $locations_with_children)) {
if (! array_key_exists($location->parent_id, $locations_with_children)) {
$locations_with_children[$location->parent_id] = [];
}
$locations_with_children[$location->parent_id][] = $location;
}
if ($request->filled('search')) {
$locations_formatted = $locations;
$locations_formatted = $locations;
} else {
$location_options = Location::indenter($locations_with_children);
$locations_formatted = new Collection($location_options);
}
$paginated_results = new LengthAwarePaginator($locations_formatted->forPage($page, 500), $locations_formatted->count(), 500, $page, []);
$paginated_results = new LengthAwarePaginator($locations_formatted->forPage($page, 500), $locations_formatted->count(), 500, $page, []);
//return [];
return (new SelectlistTransformer)->transformSelectlist($paginated_results);
}
}

View File

@@ -23,13 +23,13 @@ class ManufacturersController extends Controller
public function index(Request $request)
{
$this->authorize('view', Manufacturer::class);
$allowed_columns = ['id','name','url','support_url','support_email','support_phone','created_at','updated_at','image', 'assets_count', 'consumables_count', 'components_count', 'licenses_count'];
$allowed_columns = ['id', 'name', 'url', 'support_url', 'support_email', 'support_phone', 'created_at', 'updated_at', 'image', 'assets_count', 'consumables_count', 'components_count', 'licenses_count'];
$manufacturers = Manufacturer::select(
array('id','name','url','support_url','support_email','support_phone','created_at','updated_at','image', 'deleted_at')
['id', 'name', 'url', 'support_url', 'support_email', 'support_phone', 'created_at', 'updated_at', 'image', 'deleted_at']
)->withCount('assets as assets_count')->withCount('licenses as licenses_count')->withCount('consumables as consumables_count')->withCount('accessories as accessories_count');
if ($request->input('deleted')=='true') {
if ($request->input('deleted') == 'true') {
$manufacturers->onlyTrashed();
}
@@ -37,6 +37,25 @@ class ManufacturersController extends Controller
$manufacturers = $manufacturers->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$manufacturers->where('name', '=', $request->input('name'));
}
if ($request->filled('url')) {
$manufacturers->where('url', '=', $request->input('url'));
}
if ($request->filled('support_url')) {
$manufacturers->where('support_url', '=', $request->input('support_url'));
}
if ($request->filled('support_phone')) {
$manufacturers->where('support_phone', '=', $request->input('support_phone'));
}
if ($request->filled('support_email')) {
$manufacturers->where('support_email', '=', $request->input('support_email'));
}
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
@@ -51,10 +70,10 @@ class ManufacturersController extends Controller
$total = $manufacturers->count();
$manufacturers = $manufacturers->skip($offset)->take($limit)->get();
return (new ManufacturersTransformer)->transformManufacturers($manufacturers, $total);
}
/**
* Store a newly created resource in storage.
*
@@ -89,10 +108,10 @@ class ManufacturersController extends Controller
{
$this->authorize('view', Manufacturer::class);
$manufacturer = Manufacturer::withCount('assets as assets_count')->withCount('licenses as licenses_count')->withCount('consumables as consumables_count')->withCount('accessories as accessories_count')->findOrFail($id);
return (new ManufacturersTransformer)->transformManufacturer($manufacturer);
}
/**
* Update the specified resource in storage.
*
@@ -126,7 +145,6 @@ class ManufacturersController extends Controller
*/
public function destroy($id)
{
$this->authorize('delete', Manufacturer::class);
$manufacturer = Manufacturer::findOrFail($id);
$this->authorize('delete', $manufacturer);
@@ -138,10 +156,6 @@ class ManufacturersController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/manufacturers/message.assoc_users')));
}
/**
@@ -150,7 +164,6 @@ class ManufacturersController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
@@ -177,6 +190,5 @@ class ManufacturersController extends Controller
}
return (new SelectlistTransformer)->transformSelectlist($manufacturers);
}
}

View File

@@ -37,11 +37,10 @@ class PredefinedKitsController extends Controller
$total = $kits->count();
$kits = $kits->skip($offset)->take($limit)->get();
return (new PredefinedKitsTransformer)->transformPredefinedKits($kits, $total);
}
/**
* Store a newly created resource in storage.
*
@@ -57,8 +56,8 @@ class PredefinedKitsController extends Controller
if ($kit->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.create_success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $kit->getErrors()));
return response()->json(Helper::formatStandardApiResponse('error', null, $kit->getErrors()));
}
/**
@@ -71,10 +70,10 @@ class PredefinedKitsController extends Controller
{
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($id);
return (new PredefinedKitsTransformer)->transformPredefinedKit($kit);
}
/**
* Update the specified resource in storage.
*
@@ -89,7 +88,7 @@ class PredefinedKitsController extends Controller
$kit->fill($request->all());
if ($kit->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.update_success'))); // TODO: trans
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.update_success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $kit->getErrors()));
@@ -113,23 +112,20 @@ class PredefinedKitsController extends Controller
$kit->accessories()->detach();
$kit->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/kits/general.delete_success'))); // TODO: trans
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/kits/general.delete_success')));
}
/**
* Gets a paginated collection for the select2 menus
*
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
$kits = PredefinedKit::select([
'id',
'name'
'name',
]);
if ($request->filled('search')) {
@@ -139,7 +135,6 @@ class PredefinedKitsController extends Controller
$kits = $kits->orderBy('name', 'ASC')->paginate(50);
return (new SelectlistTransformer)->transformSelectlist($kits);
}
/**
@@ -148,38 +143,40 @@ class PredefinedKitsController extends Controller
* @param int $id
* @return \Illuminate\Http\Response
*/
public function indexLicenses($kit_id) {
public function indexLicenses($kit_id)
{
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$licenses = $kit->licenses;
return (new PredefinedKitsTransformer)->transformElements($licenses, $licenses->count());
}
/**
* Store the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function storeLicense(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
public function storeLicense(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$license_id = $request->get('license');
$relation = $kit->licenses();
if( $relation->find($license_id) ) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['license' => 'License already attached to kit']));
}
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if ($quantity < 1) {
$quantity = 1;
}
$relation->attach( $license_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'License added successfull')); // TODO: trans
$license_id = $request->get('license');
$relation = $kit->licenses();
if ($relation->find($license_id)) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['license' => trans('admin/kits/general.license_error')]));
}
$relation->attach($license_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.license_added_success')));
}
/**
@@ -189,20 +186,20 @@ class PredefinedKitsController extends Controller
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function updateLicense(Request $request, $kit_id, $license_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$kit->licenses()->syncWithoutDetaching([$license_id => ['quantity' => $quantity]]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'License updated')); // TODO: trans
}
public function updateLicense(Request $request, $kit_id, $license_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if ($quantity < 1) {
$quantity = 1;
}
$kit->licenses()->syncWithoutDetaching([$license_id => ['quantity' => $quantity]]);
/**
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.license_updated')));
}
/**
* Remove the specified resource from storage.
*
* @param int $kit_id
@@ -214,48 +211,49 @@ class PredefinedKitsController extends Controller
$kit = PredefinedKit::findOrFail($kit_id);
$kit->licenses()->detach($license_id);
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.delete_success')));
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.delete_success')));
}
/**
* Display the specified resource.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function indexModels($kit_id) {
public function indexModels($kit_id)
{
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$models = $kit->models;
return (new PredefinedKitsTransformer)->transformElements($models, $models->count());
}
/**
* Store the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function storeModel(Request $request, $kit_id)
{
public function storeModel(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$kit = PredefinedKit::findOrFail($kit_id);
$model_id = $request->get('model');
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
if ($quantity < 1) {
$quantity = 1;
}
$relation = $kit->models();
if( $relation->find($model_id) ) {
if ($relation->find($model_id)) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['model' => 'Model already attached to kit']));
}
$relation->attach($model_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Model added successfull'));
}
@@ -266,20 +264,20 @@ class PredefinedKitsController extends Controller
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function updateModel(Request $request, $kit_id, $model_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$kit->models()->syncWithoutDetaching([$model_id => ['quantity' => $quantity]]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'License updated')); // TODO: trans
}
public function updateModel(Request $request, $kit_id, $model_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if ($quantity < 1) {
$quantity = 1;
}
$kit->models()->syncWithoutDetaching([$model_id => ['quantity' => $quantity]]);
/**
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.license_updated')));
}
/**
* Remove the specified resource from storage.
*
* @param int $kit_id
@@ -291,49 +289,50 @@ class PredefinedKitsController extends Controller
$kit = PredefinedKit::findOrFail($kit_id);
$kit->models()->detach($model_id);
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.model_removed_success')));
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.model_removed_success')));
}
/**
* Display the specified resource.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function indexConsumables($kit_id) {
public function indexConsumables($kit_id)
{
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$consumables = $kit->consumables;
return (new PredefinedKitsTransformer)->transformElements($consumables, $consumables->count());
}
/**
* Store the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function storeConsumable(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
public function storeConsumable(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$consumable_id = $request->get('consumable');
$relation = $kit->consumables();
if( $relation->find($consumable_id) ) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['consumable' => 'Consumable already attached to kit']));
}
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if ($quantity < 1) {
$quantity = 1;
}
$relation->attach( $consumable_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Consumable added successfull')); // TODO: trans
$consumable_id = $request->get('consumable');
$relation = $kit->consumables();
if ($relation->find($consumable_id)) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['consumable' => trans('admin/kits/general.consumable_error')]));
}
$relation->attach($consumable_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.consumable_added_success')));
}
/**
@@ -343,20 +342,20 @@ class PredefinedKitsController extends Controller
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function updateConsumable(Request $request, $kit_id, $consumable_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$kit->consumables()->syncWithoutDetaching([$consumable_id => ['quantity' => $quantity]]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Consumable updated')); // TODO: trans
}
public function updateConsumable(Request $request, $kit_id, $consumable_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if ($quantity < 1) {
$quantity = 1;
}
$kit->consumables()->syncWithoutDetaching([$consumable_id => ['quantity' => $quantity]]);
/**
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.consumable_updated')));
}
/**
* Remove the specified resource from storage.
*
* @param int $kit_id
@@ -368,48 +367,50 @@ class PredefinedKitsController extends Controller
$kit = PredefinedKit::findOrFail($kit_id);
$kit->consumables()->detach($consumable_id);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Delete was successfull')); // TODO: trans
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.consumable_deleted')));
}
/**
* Display the specified resource.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function indexAccessories($kit_id) {
public function indexAccessories($kit_id)
{
$this->authorize('view', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$accessories = $kit->accessories;
return (new PredefinedKitsTransformer)->transformElements($accessories, $accessories->count());
}
/**
* Store the specified resource.
*
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function storeAccessory(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
public function storeAccessory(Request $request, $kit_id)
{
$this->authorize('update', PredefinedKit::class);
$accessory_id = $request->get('accessory');
$relation = $kit->accessories();
if( $relation->find($accessory_id) ) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['accessory' => 'Accessory already attached to kit']));
}
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if ($quantity < 1) {
$quantity = 1;
}
$relation->attach( $accessory_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Accessory added successfull')); // TODO: trans
$accessory_id = $request->get('accessory');
$relation = $kit->accessories();
if ($relation->find($accessory_id)) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['accessory' => trans('admin/kits/general.accessory_error')]));
}
$relation->attach($accessory_id, ['quantity' => $quantity]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.accessory_added_success')));
}
/**
@@ -419,20 +420,20 @@ class PredefinedKitsController extends Controller
* @param int $kit_id
* @return \Illuminate\Http\Response
*/
public function updateAccessory(Request $request, $kit_id, $accessory_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if( $quantity < 1) {
$quantity = 1;
}
$kit->accessories()->syncWithoutDetaching([$accessory_id => ['quantity' => $quantity]]);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Accessory updated')); // TODO: trans
}
public function updateAccessory(Request $request, $kit_id, $accessory_id)
{
$this->authorize('update', PredefinedKit::class);
$kit = PredefinedKit::findOrFail($kit_id);
$quantity = $request->input('quantity', 1);
if ($quantity < 1) {
$quantity = 1;
}
$kit->accessories()->syncWithoutDetaching([$accessory_id => ['quantity' => $quantity]]);
/**
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.accessory_updated')));
}
/**
* Remove the specified resource from storage.
*
* @param int $kit_id
@@ -444,6 +445,7 @@ class PredefinedKitsController extends Controller
$kit = PredefinedKit::findOrFail($kit_id);
$kit->accessories()->detach($accessory_id);
return response()->json(Helper::formatStandardApiResponse('success', $kit, 'Delete was successfull')); // TODO: trans
return response()->json(Helper::formatStandardApiResponse('success', $kit, trans('admin/kits/general.accessory_deleted')));
}
}

View File

@@ -5,17 +5,44 @@ namespace App\Http\Controllers\Api;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Models\CheckoutRequest;
use Auth;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use Laravel\Passport\TokenRepository;
use Illuminate\Contracts\Validation\Factory as ValidationFactory;
use Gate;
use DB;
class ProfileController extends Controller
{
/**
* The token repository implementation.
*
* @var \Laravel\Passport\TokenRepository
*/
protected $tokenRepository;
/**
* Create a controller instance.
*
* @param \Laravel\Passport\TokenRepository $tokenRepository
* @param \Illuminate\Contracts\Validation\Factory $validation
* @return void
*/
public function __construct(TokenRepository $tokenRepository, ValidationFactory $validation)
{
$this->validation = $validation;
$this->tokenRepository = $tokenRepository;
}
/**
* Display a listing of requested assets.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.3.0]
*
* @return Array
* @return array
*/
public function requestedAssets()
{
@@ -24,7 +51,6 @@ class ProfileController extends Controller
$results = [];
$results['total'] = $checkoutRequests->count();
foreach ($checkoutRequests as $checkoutRequest) {
// Make sure the asset and request still exist
@@ -39,10 +65,94 @@ class ProfileController extends Controller
'request_date' => Helper::getFormattedDateObject($checkoutRequest->created_at, 'datetime'),
];
}
}
return $results;
}
/**
* Delete an API token
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.0.5]
*
* @return \Illuminate\Http\Response
*/
public function createApiToken(Request $request) {
if (!Gate::allows('self.api')) {
abort(403);
}
$accessTokenName = $request->input('name', 'Auth Token');
if ($accessToken = Auth::user()->createToken($accessTokenName)->accessToken) {
// Get the ID so we can return that with the payload
$token = DB::table('oauth_access_tokens')->where('user_id', '=', Auth::user()->id)->where('name','=',$accessTokenName)->orderBy('created_at', 'desc')->first();
$accessTokenData['id'] = $token->id;
$accessTokenData['token'] = $accessToken;
$accessTokenData['name'] = $accessTokenName;
return response()->json(Helper::formatStandardApiResponse('success', $accessTokenData, 'Personal access token '.$accessTokenName.' created successfully'));
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'Token could not be created.'));
}
/**
* Delete an API token
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.0.5]
*
* @return \Illuminate\Http\Response
*/
public function deleteApiToken($tokenId) {
if (!Gate::allows('self.api')) {
abort(403);
}
$token = $this->tokenRepository->findForUser(
$tokenId, Auth::user()->getAuthIdentifier()
);
if (is_null($token)) {
return new Response('', 404);
}
$token->revoke();
return new Response('', Response::HTTP_NO_CONTENT);
}
/**
* Show user's API tokens
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.0.5]
*
* @return \Illuminate\Http\Response
*/
public function showApiTokens(Request $request) {
if (!Gate::allows('self.api')) {
abort(403);
}
$tokens = $this->tokenRepository->forUser(Auth::user()->getAuthIdentifier());
$token_values = $tokens->load('client')->filter(function ($token) {
return $token->client->personal_access_client && ! $token->revoked;
})->values();
return response()->json(Helper::formatStandardApiResponse('success', $token_values, null));
}
}

View File

@@ -19,25 +19,25 @@ class ReportsController extends Controller
public function index(Request $request)
{
$this->authorize('reports.view');
$actionlogs = Actionlog::with('item', 'user', 'target','location');
$actionlogs = Actionlog::with('item', 'user', 'admin', 'target', 'location');
if ($request->filled('search')) {
$actionlogs = $actionlogs->TextSearch(e($request->input('search')));
}
if (($request->filled('target_type')) && ($request->filled('target_id'))) {
$actionlogs = $actionlogs->where('target_id','=',$request->input('target_id'))
->where('target_type','=',"App\\Models\\".ucwords($request->input('target_type')));
if (($request->filled('target_type')) && ($request->filled('target_id'))) {
$actionlogs = $actionlogs->where('target_id', '=', $request->input('target_id'))
->where('target_type', '=', 'App\\Models\\'.ucwords($request->input('target_type')));
}
if (($request->filled('item_type')) && ($request->filled('item_id'))) {
$actionlogs = $actionlogs->where('item_id','=',$request->input('item_id'))
->where('item_type','=',"App\\Models\\".ucwords($request->input('item_type')));
if (($request->filled('item_type')) && ($request->filled('item_id'))) {
$actionlogs = $actionlogs->where('item_id', '=', $request->input('item_id'))
->where('item_type', '=', 'App\\Models\\'.ucwords($request->input('item_type')));
}
if ($request->filled('action_type')) {
$actionlogs = $actionlogs->where('action_type','=',$request->input('action_type'))->orderBy('created_at', 'desc');
$actionlogs = $actionlogs->where('action_type', '=', $request->input('action_type'))->orderBy('created_at', 'desc');
}
if ($request->filled('uploads')) {
@@ -51,9 +51,9 @@ class ReportsController extends Controller
'user_id',
'accept_signature',
'action_type',
'note'
'note',
];
$sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';
$order = ($request->input('order') == 'asc') ? 'asc' : 'desc';
$offset = request('offset', 0);
@@ -62,6 +62,5 @@ class ReportsController extends Controller
$actionlogs = $actionlogs->orderBy($sort, $order)->skip($offset)->take($limit)->get();
return response()->json((new ActionlogsTransformer)->transformActionlogs($actionlogs, $total), 200, ['Content-Type' => 'application/json;charset=utf8'], JSON_UNESCAPED_UNICODE);
}
}

View File

@@ -2,126 +2,96 @@
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Transformers\LoginAttemptsTransformer;
use App\Models\Setting;
use App\Notifications\MailTest;
use App\Services\LdapAd;
use Illuminate\Http\JsonResponse;
use App\Helpers\Helper;
use App\Helpers\StorageHelper;
use App\Http\Transformers\DatatablesTransformer;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Ldap;
use App\Models\Setting;
use Mail;
use App\Notifications\SlackTest;
use App\Notifications\MailTest;
use GuzzleHttp\Client;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Notification;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator;
use App\Models\Ldap; // forward-port of v4 LDAP model for Sync
use Illuminate\Support\Facades\Validator;
use App\Http\Requests\SlackSettingsRequest;
use App\Http\Transformers\LoginAttemptsTransformer;
class SettingsController extends Controller
{
/**
* Test the ldap settings
*
* @author Wes Hulette <jwhulette@gmail.com>
*
* @since 5.0.0
*
* @param App\Models\LdapAd $ldap
*
* @return \Illuminate\Http\JsonResponse
*/
public function ldapAdSettingsTest(LdapAd $ldap): JsonResponse
public function ldaptest()
{
if(!$ldap->init()) {
Log::info('LDAP is not enabled so we cannot test.');
$settings = Setting::getSettings();
if ($settings->ldap_enabled!='1') {
\Log::debug('LDAP is not enabled cannot test.');
return response()->json(['message' => 'LDAP is not enabled, cannot test.'], 400);
}
// The connect, bind and resulting users message
$message = [];
\Log::debug('Preparing to test LDAP connection');
// This is all kinda fucked right now. The connection test doesn't actually do what you think,
// // and the way we parse the errors
// on the JS side is horrible.
Log::info('Preparing to test LDAP user login');
// Test user can connect to the LDAP server
$message = []; //where we collect together test messages
try {
$ldap->testLdapAdUserConnection();
$message['login'] = [
'message' => 'Successfully connected to LDAP server.'
];
} catch (\Exception $ex) {
\Log::debug('Connection to LDAP server '.Setting::getSettings()->ldap_server.' failed. Please check your LDAP settings and try again. Server Responded with error: ' . $ex->getMessage());
return response()->json(
['message' => 'Connection to LDAP server '.Setting::getSettings()->ldap_server." failed. Verify that the LDAP hostname is entered correctly and that it can be reached from this web server. \n\nServer Responded with error: " . $ex->getMessage()
], 400);
}
Log::info('Preparing to test LDAP bind connection');
// Test user can bind to the LDAP server
try {
Log::info('Testing Bind');
$ldap->testLdapAdBindConnection();
$message['bind'] = [
'message' => 'Successfully bound to LDAP server.'
];
} catch (\Exception $ex) {
Log::info('LDAP Bind failed');
return response()->json(['message' => 'Connection to LDAP successful, but we were unable to Bind the LDAP user '.Setting::getSettings()->ldap_uname.". Verify your that your LDAP Bind username and password are correct. \n\nServer Responded with error: " . $ex->getMessage()
], 400);
}
Log::info('Preparing to get sample user set from LDAP directory');
// Get a sample of 10 users so user can verify the data is correct
$settings = Setting::getSettings();
try {
Log::info('Testing LDAP sync');
error_reporting(E_ALL & ~E_DEPRECATED); // workaround for php7.4, which deprecates ldap_control_paged_result
// $users = $ldap->testUserImportSync(); // from AdLdap2 from v5, disabling and falling back to v4's sync code
$users = collect(Ldap::findLdapUsers())->slice(0, 11)->filter(function ($value, $key) { //choosing ELEVEN because one is going to be the count, which we're about to filter out in the next line
return is_int($key);
})->map(function ($item) use ($settings) {
return (object) [
'username' => $item[$settings['ldap_username_field']][0] ?? null,
'employee_number' => $item[$settings['ldap_emp_num']][0] ?? null,
'lastname' => $item[$settings['ldap_lname_field']][0] ?? null,
'firstname' => $item[$settings['ldap_fname_field']][0] ?? null,
'email' => $item[$settings['ldap_email']][0] ?? null,
$connection = Ldap::connectToLdap();
try {
$message['bind'] = ['message' => 'Successfully bound to LDAP server.'];
\Log::debug('attempting to bind to LDAP for LDAP test');
Ldap::bindAdminToLdap($connection);
$message['login'] = [
'message' => 'Successfully connected to LDAP server.',
];
});
if ($users->count() > 0) {
$message['user_sync'] = [
'users' => $users
];
} else {
$message['user_sync'] = [
'message' => 'Connection to LDAP was successful, however there were no users returned from your query. You should confirm the Base Bind DN above.'
];
return response()->json($message, 400);
$users = collect(Ldap::findLdapUsers(null,10))->filter(function ($value, $key) {
return is_int($key);
})->slice(0, 10)->map(function ($item) use ($settings) {
return (object) [
'username' => $item[$settings['ldap_username_field']][0] ?? null,
'employee_number' => $item[$settings['ldap_emp_num']][0] ?? null,
'lastname' => $item[$settings['ldap_lname_field']][0] ?? null,
'firstname' => $item[$settings['ldap_fname_field']][0] ?? null,
'email' => $item[$settings['ldap_email']][0] ?? null,
];
});
if ($users->count() > 0) {
$message['user_sync'] = [
'users' => $users,
];
} else {
$message['user_sync'] = [
'message' => 'Connection to LDAP was successful, however there were no users returned from your query. You should confirm the Base Bind DN above.',
];
return response()->json($message, 400);
}
return response()->json($message, 200);
} catch (\Exception $e) {
\Log::debug('Bind failed');
\Log::debug("Exception was: ".$e->getMessage());
return response()->json(['message' => $e->getMessage()], 400);
//return response()->json(['message' => $e->getMessage()], 500);
}
} catch (\Exception $ex) {
Log::info('LDAP sync failed');
$message['user_sync'] = [
'message' => 'Error getting users from LDAP directory, error: ' . $ex->getMessage()
];
return response()->json($message, 400);
} catch (\Exception $e) {
\Log::debug('Connection failed but we cannot debug it any further on our end.');
return response()->json(['message' => $e->getMessage()], 500);
}
return response()->json($message, 200);
}
public function ldaptestlogin(Request $request, LdapAd $ldap)
public function ldaptestlogin(Request $request)
{
if (Setting::getSettings()->ldap_enabled!='1') {
if (Setting::getSettings()->ldap_enabled != '1') {
\Log::debug('LDAP is not enabled. Cannot test.');
return response()->json(['message' => 'LDAP is not enabled, cannot test.'], 400);
}
@@ -140,30 +110,40 @@ class SettingsController extends Controller
}
\Log::debug('Preparing to test LDAP login');
try {
DB::beginTransaction(); //this was the easiest way to invoke a full test of an LDAP login without adding new users to the DB (which may not be desired)
$connection = Ldap::connectToLdap();
try {
Ldap::bindAdminToLdap($connection);
\Log::debug('Attempting to bind to LDAP for LDAP test');
try {
$ldap_user = Ldap::findAndBindUserLdap($request->input('ldaptest_user'), $request->input('ldaptest_password'));
if ($ldap_user) {
\Log::debug('It worked! '. $request->input('ldaptest_user').' successfully binded to LDAP.');
return response()->json(['message' => 'It worked! '. $request->input('ldaptest_user').' successfully binded to LDAP.'], 200);
}
return response()->json(['message' => 'Login Failed. '. $request->input('ldaptest_user').' did not successfully bind to LDAP.'], 400);
// $results = $ldap->ldap->auth()->attempt($request->input('ldaptest_username'), $request->input('ldaptest_password'), true);
// can't do this because that's a protected property.
} catch (\Exception $e) {
\Log::debug('LDAP login failed');
return response()->json(['message' => $e->getMessage()], 400);
}
$results = $ldap->ldapLogin($request->input('ldaptest_user'), $request->input('ldaptest_password')); // this would normally create a user on success (if they didn't already exist), but for the transaction
if($results) {
return response()->json(['message' => 'It worked! '. $request->input('ldaptest_user').' successfully binded to LDAP.'], 200);
} else {
return response()->json(['message' => 'Login Failed. '. $request->input('ldaptest_user').' did not successfully bind to LDAP.'], 400);
} catch (\Exception $e) {
\Log::debug('Bind failed');
return response()->json(['message' => $e->getMessage()], 400);
//return response()->json(['message' => $e->getMessage()], 500);
}
} catch (\Exception $e) {
\Log::debug('Connection failed');
return response()->json(['message' => $e->getMessage()], 400);
} finally {
DB::rollBack(); // ALWAYS rollback, whether success or failure
return response()->json(['message' => $e->getMessage()], 500);
}
}
public function slacktest(Request $request)
public function slacktest(SlackSettingsRequest $request)
{
$validator = Validator::make($request->all(), [
@@ -196,9 +176,9 @@ class SettingsController extends Controller
return response()->json(['message' => 'Success'], 200);
} catch (\Exception $e) {
return response()->json(['message' => 'Please check the channel name and webhook endpoint URL ('.$request->input('slack_endpoint').'). Slack responded with: '.$e->getMessage()], 400);
return response()->json(['message' => 'Please check the channel name and webhook endpoint URL ('.e($request->input('slack_endpoint')).'). Slack responded with: '.$e->getMessage()], 400);
}
//}
return response()->json(['message' => 'Something went wrong :( '], 400);
}
@@ -235,23 +215,21 @@ class SettingsController extends Controller
*/
public function purgeBarcodes()
{
$file_count = 0;
$files = Storage::disk('public')->files('barcodes');
foreach ($files as $file) { // iterate files
$file_parts = explode(".", $file);
$file_parts = explode('.', $file);
$extension = end($file_parts);
\Log::debug($extension);
// Only generated barcodes would have a .png file extension
if ($extension =='png') {
if ($extension == 'png') {
\Log::debug('Deleting: '.$file);
try {
try {
Storage::disk('public')->delete($file);
\Log::debug('Deleting: '.$file);
$file_count++;
@@ -259,11 +237,9 @@ class SettingsController extends Controller
\Log::debug($e);
}
}
}
return response()->json(['message' => 'Deleted '.$file_count.' barcodes'], 200);
}
@@ -280,20 +256,64 @@ class SettingsController extends Controller
*/
public function showLoginAttempts(Request $request)
{
$allowed_columns = ['id', 'username', 'remote_ip', 'user_agent','successful','created_at'];
$allowed_columns = ['id', 'username', 'remote_ip', 'user_agent', 'successful', 'created_at'];
$login_attempts = DB::table('login_attempts');
$login_attempts = DB::table('login_attempts');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->get('sort'), $allowed_columns) ? $request->get('sort') : 'created_at';
$total = $login_attempts->count();
$login_attempts->orderBy($sort, $order);
$login_attempt_results = $login_attempts->skip(request('offset', 0))->take(request('limit', 20))->get();
$login_attempt_results = $login_attempts->skip(request('offset', 0))->take(request('limit', 20))->get();
return (new LoginAttemptsTransformer)->transformLoginAttempts($login_attempt_results, $total);
}
public function listBackups() {
$settings = Setting::getSettings();
$path = 'app/backups';
$backup_files = Storage::files($path);
$files_raw = [];
$count = 0;
if (count($backup_files) > 0) {
for ($f = 0; $f < count($backup_files); $f++) {
// Skip dotfiles like .gitignore and .DS_STORE
if ((substr(basename($backup_files[$f]), 0, 1) != '.')) {
$file_timestamp = Storage::lastModified($backup_files[$f]);
$files_raw[] = [
'filename' => basename($backup_files[$f]),
'filesize' => Setting::fileSizeConvert(Storage::size($backup_files[$f])),
'modified_value' => $file_timestamp,
'modified_display' => date($settings->date_display_format.' '.$settings->time_display_format, $file_timestamp),
];
$count++;
}
}
}
$files = array_reverse($files_raw);
return (new DatatablesTransformer)->transformDatatables($files, $count);
}
public function downloadBackup($file) {
}
$path = 'app/backups';
if (Storage::exists($path.'/'.$file)) {
$headers = ['ContentType' => 'application/zip'];
return Storage::download($path.'/'.$file, $file, $headers);
} else {
return response()->json(Helper::formatStandardApiResponse('error', null, 'File not found'));
}
}
}

View File

@@ -9,6 +9,8 @@ use App\Http\Transformers\StatuslabelsTransformer;
use App\Models\Asset;
use App\Models\Statuslabel;
use Illuminate\Http\Request;
use App\Http\Transformers\PieChartTransformer;
use Illuminate\Support\Arr;
class StatuslabelsController extends Controller
{
@@ -22,7 +24,7 @@ class StatuslabelsController extends Controller
public function index(Request $request)
{
$this->authorize('view', Statuslabel::class);
$allowed_columns = ['id','name','created_at', 'assets_count','color', 'notes','default_label'];
$allowed_columns = ['id', 'name', 'created_at', 'assets_count', 'color', 'notes', 'default_label'];
$statuslabels = Statuslabel::withCount('assets as assets_count');
@@ -30,6 +32,11 @@ class StatuslabelsController extends Controller
$statuslabels = $statuslabels->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$statuslabels->where('name', '=', $request->input('name'));
}
// if a status_type is passed, filter by that
if ($request->filled('status_type')) {
if (strtolower($request->input('status_type')) == 'pending') {
@@ -56,6 +63,7 @@ class StatuslabelsController extends Controller
$total = $statuslabels->count();
$statuslabels = $statuslabels->skip($offset)->take($limit)->get();
return (new StatuslabelsTransformer)->transformStatuslabels($statuslabels, $total);
}
@@ -71,19 +79,19 @@ class StatuslabelsController extends Controller
public function store(Request $request)
{
$this->authorize('create', Statuslabel::class);
$request->except('deployable', 'pending','archived');
$request->except('deployable', 'pending', 'archived');
if (!$request->filled('type')) {
return response()->json(Helper::formatStandardApiResponse('error', null, ["type" => ["Status label type is required."]]),500);
if (! $request->filled('type')) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['type' => ['Status label type is required.']]), 500);
}
$statuslabel = new Statuslabel;
$statuslabel->fill($request->all());
$statusType = Statuslabel::getStatuslabelTypesForDB($request->input('type'));
$statuslabel->deployable = $statusType['deployable'];
$statuslabel->pending = $statusType['pending'];
$statuslabel->archived = $statusType['archived'];
$statuslabel->deployable = $statusType['deployable'];
$statuslabel->pending = $statusType['pending'];
$statuslabel->archived = $statusType['archived'];
$statuslabel->color = $request->input('color');
$statuslabel->show_in_nav = $request->input('show_in_nav', 0);
$statuslabel->default_label = $request->input('default_label', 0);
@@ -108,6 +116,7 @@ class StatuslabelsController extends Controller
{
$this->authorize('view', Statuslabel::class);
$statuslabel = Statuslabel::findOrFail($id);
return (new StatuslabelsTransformer)->transformStatuslabel($statuslabel);
}
@@ -126,19 +135,22 @@ class StatuslabelsController extends Controller
$this->authorize('update', Statuslabel::class);
$statuslabel = Statuslabel::findOrFail($id);
$request->except('deployable', 'pending','archived');
$request->except('deployable', 'pending', 'archived');
if (! $request->filled('type')) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'Status label type is required.'));
}
$statuslabel->fill($request->all());
$statusType = Statuslabel::getStatuslabelTypesForDB($request->input('type'));
$statuslabel->deployable = $statusType['deployable'];
$statuslabel->pending = $statusType['pending'];
$statuslabel->archived = $statusType['archived'];
$statuslabel->deployable = $statusType['deployable'];
$statuslabel->pending = $statusType['pending'];
$statuslabel->archived = $statusType['archived'];
$statuslabel->color = $request->input('color');
$statuslabel->show_in_nav = $request->input('show_in_nav');
$statuslabel->default_label = $request->input('default_label');
$statuslabel->show_in_nav = $request->input('show_in_nav', 0);
$statuslabel->default_label = $request->input('default_label', 0);
if ($statuslabel->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $statuslabel, trans('admin/statuslabels/message.update.success')));
@@ -164,11 +176,11 @@ class StatuslabelsController extends Controller
// Check that there are no assets associated
if ($statuslabel->assets()->count() == 0) {
$statuslabel->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/statuslabels/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/statuslabels/message.delete.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/statuslabels/message.assoc_assets')));
}
@@ -178,43 +190,54 @@ class StatuslabelsController extends Controller
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
* @return \Illuminate\Http\Response
* @return array
*/
public function getAssetCountByStatuslabel()
{
$this->authorize('view', Statuslabel::class);
$statuslabels = Statuslabel::withCount('assets')->get();
$labels=[];
$points=[];
$default_color_count = 0;
$colors_array = array();
foreach ($statuslabels as $statuslabel) {
if ($statuslabel->assets_count > 0) {
$labels[]=$statuslabel->name. ' ('.number_format($statuslabel->assets_count).')';
$points[]=$statuslabel->assets_count;
if ($statuslabel->color!='') {
$colors_array[] = $statuslabel->color;
} else {
$colors_array[] = Helper::defaultChartColors($default_color_count);
}
$default_color_count++;
$total[$statuslabel->name]['label'] = $statuslabel->name;
$total[$statuslabel->name]['count'] = $statuslabel->assets_count;
if ($statuslabel->color != '') {
$total[$statuslabel->name]['color'] = $statuslabel->color;
}
}
$result= [
"labels" => $labels,
"datasets" => [ [
"data" => $points,
"backgroundColor" => $colors_array,
"hoverBackgroundColor" => $colors_array
]]
];
return $result;
return (new PieChartTransformer())->transformPieChartDate($total);
}
/**
* Show a count of assets by meta status type for pie chart
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.0.11]
* @return array
*/
public function getAssetCountByMetaStatus()
{
$this->authorize('view', Statuslabel::class);
$total['rtd']['label'] = trans('general.ready_to_deploy');
$total['rtd']['count'] = Asset::RTD()->count();
$total['deployed']['label'] = trans('general.deployed');
$total['deployed']['count'] = Asset::Deployed()->count();
$total['archived']['label'] = trans('general.archived');
$total['archived']['count'] = Asset::Archived()->count();
$total['pending']['label'] = trans('general.pending');
$total['pending']['count'] = Asset::Pending()->count();
$total['undeployable']['label'] = trans('general.undeployable');
$total['undeployable']['count'] = Asset::Undeployable()->count();
return (new PieChartTransformer())->transformPieChartDate($total);
}
/**
@@ -229,7 +252,7 @@ class StatuslabelsController extends Controller
{
$this->authorize('view', Statuslabel::class);
$this->authorize('index', Asset::class);
$assets = Asset::where('status_id','=',$id)->with('assignedTo');
$assets = Asset::where('status_id', '=', $id)->with('assignedTo');
$allowed_columns = [
'id',
@@ -259,11 +282,12 @@ class StatuslabelsController extends Controller
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]
* @return Bool
* @return bool
*/
public function checkIfDeployable($id) {
public function checkIfDeployable($id)
{
$statuslabel = Statuslabel::findOrFail($id);
if ($statuslabel->getStatuslabelType()=='deployable') {
if ($statuslabel->getStatuslabelType() == 'deployable') {
return '1';
}

View File

@@ -23,10 +23,10 @@ class SuppliersController extends Controller
public function index(Request $request)
{
$this->authorize('view', Supplier::class);
$allowed_columns = ['id','name','address','phone','contact','fax','email','image','assets_count','licenses_count', 'accessories_count','url'];
$allowed_columns = ['id', 'name', 'address', 'phone', 'contact', 'fax', 'email', 'image', 'assets_count', 'licenses_count', 'accessories_count', 'url'];
$suppliers = Supplier::select(
array('id','name','address','address2','city','state','country','fax', 'phone','email','contact','created_at','updated_at','deleted_at','image','notes')
['id', 'name', 'address', 'address2', 'city', 'state', 'country', 'fax', 'phone', 'email', 'contact', 'created_at', 'updated_at', 'deleted_at', 'image', 'notes']
)->withCount('assets as assets_count')->withCount('licenses as licenses_count')->withCount('accessories as accessories_count');
@@ -34,6 +34,46 @@ class SuppliersController extends Controller
$suppliers = $suppliers->TextSearch($request->input('search'));
}
if ($request->filled('name')) {
$suppliers->where('name', '=', $request->input('name'));
}
if ($request->filled('address')) {
$suppliers->where('address', '=', $request->input('address'));
}
if ($request->filled('address2')) {
$suppliers->where('address2', '=', $request->input('address2'));
}
if ($request->filled('city')) {
$suppliers->where('city', '=', $request->input('city'));
}
if ($request->filled('zip')) {
$suppliers->where('zip', '=', $request->input('zip'));
}
if ($request->filled('country')) {
$suppliers->where('country', '=', $request->input('country'));
}
if ($request->filled('fax')) {
$suppliers->where('fax', '=', $request->input('fax'));
}
if ($request->filled('email')) {
$suppliers->where('email', '=', $request->input('email'));
}
if ($request->filled('url')) {
$suppliers->where('url', '=', $request->input('url'));
}
if ($request->filled('notes')) {
$suppliers->where('notes', '=', $request->input('notes'));
}
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
// case we override with the actual count, so we should return 0 items.
$offset = (($suppliers) && ($request->get('offset') > $suppliers->count())) ? $suppliers->count() : $request->get('offset', 0);
@@ -47,6 +87,7 @@ class SuppliersController extends Controller
$total = $suppliers->count();
$suppliers = $suppliers->skip($offset)->take($limit)->get();
return (new SuppliersTransformer)->transformSuppliers($suppliers, $total);
}
@@ -85,6 +126,7 @@ class SuppliersController extends Controller
{
$this->authorize('view', Supplier::class);
$supplier = Supplier::findOrFail($id);
return (new SuppliersTransformer)->transformSupplier($supplier);
}
@@ -123,16 +165,16 @@ class SuppliersController extends Controller
public function destroy($id)
{
$this->authorize('delete', Supplier::class);
$supplier = Supplier::with('asset_maintenances', 'assets', 'licenses')->withCount('asset_maintenances as asset_maintenances_count','assets as assets_count', 'licenses as licenses_count')->findOrFail($id);
$supplier = Supplier::with('asset_maintenances', 'assets', 'licenses')->withCount('asset_maintenances as asset_maintenances_count', 'assets as assets_count', 'licenses as licenses_count')->findOrFail($id);
$this->authorize('delete', $supplier);
if ($supplier->assets_count > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/suppliers/message.delete.assoc_assets', ['asset_count' => (int) $supplier->assets_count])));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/suppliers/message.delete.assoc_assets', ['asset_count' => (int) $supplier->assets_count])));
}
if ($supplier->asset_maintenances_count > 0) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/suppliers/message.delete.assoc_maintenances', ['asset_maintenances_count' => $supplier->asset_maintenances_count])));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/suppliers/message.delete.assoc_maintenances', ['asset_maintenances_count' => $supplier->asset_maintenances_count])));
}
if ($supplier->licenses_count > 0) {
@@ -140,8 +182,8 @@ class SuppliersController extends Controller
}
$supplier->delete();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/suppliers/message.delete.success')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/suppliers/message.delete.success')));
}
/**
@@ -150,7 +192,6 @@ class SuppliersController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
@@ -178,7 +219,5 @@ class SuppliersController extends Controller
}
return (new SelectlistTransformer)->transformSelectlist($suppliers);
}
}

View File

@@ -15,6 +15,7 @@ use App\Models\Asset;
use App\Models\Company;
use App\Models\License;
use App\Models\User;
use App\Notifications\CurrentInventory;
use Auth;
use Illuminate\Http\Request;
use App\Http\Requests\ImageUploadRequest;
@@ -36,6 +37,7 @@ class UsersController extends Controller
$users = User::select([
'users.activated',
'users.created_by',
'users.address',
'users.avatar',
'users.city',
@@ -63,16 +65,19 @@ class UsersController extends Controller
'users.updated_at',
'users.username',
'users.zip',
'users.remote',
'users.ldap_import',
'users.start_date',
'users.end_date',
])->with('manager', 'groups', 'userloc', 'company', 'department','assets','licenses','accessories','consumables')
->withCount('assets as assets_count','licenses as licenses_count','accessories as accessories_count','consumables as consumables_count');
])->with('manager', 'groups', 'userloc', 'company', 'department', 'assets', 'licenses', 'accessories', 'consumables', 'createdBy',)
->withCount('assets as assets_count', 'licenses as licenses_count', 'accessories as accessories_count', 'consumables as consumables_count');
$users = Company::scopeCompanyables($users);
if (($request->filled('deleted')) && ($request->input('deleted')=='true')) {
if (($request->filled('deleted')) && ($request->input('deleted') == 'true')) {
$users = $users->onlyTrashed();
} elseif (($request->filled('all')) && ($request->input('all')=='true')) {
} elseif (($request->filled('all')) && ($request->input('all') == 'true')) {
$users = $users->withTrashed();
}
@@ -88,6 +93,10 @@ class UsersController extends Controller
$users = $users->where('users.location_id', '=', $request->input('location_id'));
}
if ($request->filled('created_by')) {
$users = $users->where('users.created_by', '=', $request->input('created_by'));
}
if ($request->filled('email')) {
$users = $users->where('users.email', '=', $request->input('email'));
}
@@ -125,7 +134,7 @@ class UsersController extends Controller
}
if ($request->filled('department_id')) {
$users = $users->where('users.department_id','=',$request->input('department_id'));
$users = $users->where('users.department_id', '=', $request->input('department_id'));
}
if ($request->filled('manager_id')) {
@@ -136,6 +145,19 @@ class UsersController extends Controller
$users = $users->where('ldap_import', '=', $request->input('ldap_import'));
}
if ($request->filled('remote')) {
$users = $users->where('remote', '=', $request->input('remote'));
}
if ($request->filled('start_date')) {
$users = $users->where('users.start_date', '=', $request->input('start_date'));
}
if ($request->filled('end_date')) {
$users = $users->where('users.end_date', '=', $request->input('end_date'));
}
if ($request->filled('assets_count')) {
$users->has('assets', '=', $request->input('assets_count'));
}
@@ -177,17 +199,20 @@ class UsersController extends Controller
case 'department':
$users = $users->OrderDepartment($order);
break;
case 'created_by':
$users = $users->OrderByCreatedBy($order);
break;
case 'company':
$users = $users->OrderCompany($order);
break;
default:
$allowed_columns =
[
'last_name','first_name','email','jobtitle','username','employee_num',
'assets','accessories', 'consumables','licenses','groups','activated','created_at',
'two_factor_enrolled','two_factor_optin','last_login', 'assets_count', 'licenses_count',
'last_name', 'first_name', 'email', 'jobtitle', 'username', 'employee_num',
'assets', 'accessories', 'consumables', 'licenses', 'groups', 'activated', 'created_at',
'two_factor_enrolled', 'two_factor_optin', 'last_login', 'assets_count', 'licenses_count',
'consumables_count', 'accessories_count', 'phone', 'address', 'city', 'state',
'country', 'zip', 'id', 'ldap_import'
'country', 'zip', 'id', 'ldap_import', 'remote', 'start_date', 'end_date',
];
$sort = in_array($request->get('sort'), $allowed_columns) ? $request->get('sort') : 'first_name';
@@ -195,24 +220,21 @@ class UsersController extends Controller
break;
}
$total = $users->count();
$users = $users->skip($offset)->take($limit)->get();
return (new UsersTransformer)->transformUsers($users, $total);
}
/**
* Gets a paginated collection for the select2 menus
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
*
*/
public function selectlist(Request $request)
{
$users = User::select(
[
'users.id',
@@ -239,16 +261,16 @@ class UsersController extends Controller
foreach ($users as $user) {
$name_str = '';
if ($user->last_name!='') {
if ($user->last_name != '') {
$name_str .= $user->last_name.', ';
}
$name_str .= $user->first_name;
if ($user->username!='') {
if ($user->username != '') {
$name_str .= ' ('.$user->username.')';
}
if ($user->employee_num!='') {
if ($user->employee_num != '') {
$name_str .= ' - #'.$user->employee_num;
}
@@ -257,7 +279,6 @@ class UsersController extends Controller
}
return (new SelectlistTransformer)->transformSelectlist($users);
}
@@ -278,17 +299,16 @@ class UsersController extends Controller
$user->fill($request->all());
if ($request->has('permissions')) {
$permissions_array = $request->input('permissions');
// Strip out the superuser permission if the API user isn't a superadmin
if (!Auth::user()->isSuperUser()) {
if (! Auth::user()->isSuperUser()) {
unset($permissions_array['superuser']);
}
$user->permissions = $permissions_array;
$user->permissions = $permissions_array;
}
$tmp_pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20);
$tmp_pass = substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 20);
$user->password = bcrypt($request->get('password', $tmp_pass));
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, 600, 'image', 'avatars', 'avatar');
@@ -297,11 +317,12 @@ class UsersController extends Controller
if ($request->filled('groups')) {
$user->groups()->sync($request->input('groups'));
} else {
$user->groups()->sync(array());
$user->groups()->sync([]);
}
return response()->json(Helper::formatStandardApiResponse('success', (new UsersTransformer)->transformUser($user), trans('admin/users/message.success.create')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $user->getErrors()));
}
@@ -315,7 +336,8 @@ class UsersController extends Controller
public function show($id)
{
$this->authorize('view', User::class);
$user = User::withCount('assets as assets_count','licenses as licenses_count','accessories as accessories_count','consumables as consumables_count')->findOrFail($id);
$user = User::withCount('assets as assets_count', 'licenses as licenses_count', 'accessories as accessories_count', 'consumables as consumables_count')->findOrFail($id);
return (new UsersTransformer)->transformUser($user);
}
@@ -364,19 +386,17 @@ class UsersController extends Controller
// here because we need to overwrite permissions
// if someone needs to null them out
if ($request->has('permissions')) {
$permissions_array = $request->input('permissions');
// Strip out the superuser permission if the API user isn't a superadmin
if (!Auth::user()->isSuperUser()) {
if (! Auth::user()->isSuperUser()) {
unset($permissions_array['superuser']);
}
$user->permissions = $permissions_array;
$user->permissions = $permissions_array;
}
// 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)]);
@@ -396,8 +416,8 @@ class UsersController extends Controller
if ($request->filled('groups')) {
$user->groups()->sync($request->input('groups'));
// The groups field has been passed but it is null, so we should blank it out
} elseif ($request->has('groups')) {
$user->groups()->sync(array());
} elseif ($request->has('groups')) {
$user->groups()->sync([]);
}
@@ -421,36 +441,37 @@ class UsersController extends Controller
$user = User::findOrFail($id);
$this->authorize('delete', $user);
if (($user->assets) && ($user->assets->count() > 0)) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.error.delete_has_assets')));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.error.delete_has_assets')));
}
if (($user->licenses) && ($user->licenses->count() > 0)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has ' . $user->licenses->count() . ' license(s) associated with them and cannot be deleted.'));
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has '.$user->licenses->count().' license(s) associated with them and cannot be deleted.'));
}
if (($user->accessories) && ($user->accessories->count() > 0)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has ' . $user->accessories->count() . ' accessories associated with them.'));
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has '.$user->accessories->count().' accessories associated with them.'));
}
if (($user->managedLocations()) && ($user->managedLocations()->count() > 0)) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has ' . $user->managedLocations()->count() . ' locations that they manage.'));
return response()->json(Helper::formatStandardApiResponse('error', null, 'This user still has '.$user->managedLocations()->count().' locations that they manage.'));
}
if ($user->delete()) {
// Remove the user's avatar if they have one
if (Storage::disk('public')->exists('avatars/'.$user->avatar)) {
try {
try {
Storage::disk('public')->delete('avatars/'.$user->avatar);
} catch (\Exception $e) {
\Log::debug($e);
}
}
}
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/users/message.success.delete')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/users/message.success.delete')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.error.delete')));
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.error.delete')));
}
/**
@@ -466,9 +487,30 @@ class UsersController extends Controller
$this->authorize('view', User::class);
$this->authorize('view', Asset::class);
$assets = Asset::where('assigned_to', '=', $id)->where('assigned_type', '=', User::class)->with('model')->get();
return (new AssetsTransformer)->transformAssets($assets, $assets->count(), $request);
}
/**
* Notify a specific user via email with all of their assigned assets.
*
* @author [Lukas Fehling] [<lukas.fehling@adabay.rocks>]
* @since [v6.0.13]
* @param Request $request
* @param $id
* @return string JSON
*/
public function emailAssetList(Request $request, $id)
{
$user = User::findOrFail($id);
if (empty($user->email)) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.inventorynotification.error')));
}
return response()->Helper::formatStandardApiResponse('success', null, trans('admin/users/message.inventorynotification.success'));
}
/**
* Return JSON containing a list of consumables assigned to a user.
@@ -501,6 +543,7 @@ class UsersController extends Controller
$user = User::findOrFail($id);
$this->authorize('view', Accessory::class);
$accessories = $user->accessories;
return (new AccessoriesTransformer)->transformAccessories($accessories, $accessories->count());
}
@@ -516,14 +559,17 @@ class UsersController extends Controller
{
$this->authorize('view', User::class);
$this->authorize('view', License::class);
$user = User::where('id', $id)->withTrashed()->first();
$licenses = $user->licenses()->get();
return (new LicensesTransformer())->transformLicenses($licenses, $licenses->count());
if ($user = User::where('id', $id)->withTrashed()->first()) {
$licenses = $user->licenses()->get();
return (new LicensesTransformer())->transformLicenses($licenses, $licenses->count());
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.user_not_found', compact('id'))));
}
/**
* Reset the user's two-factor status
*
* @author [A. Gianotto] [<snipe@snipe.net>]
@@ -533,7 +579,6 @@ class UsersController extends Controller
*/
public function postTwoFactorReset(Request $request)
{
$this->authorize('update', User::class);
if ($request->filled('id')) {
@@ -542,6 +587,7 @@ class UsersController extends Controller
$user->two_factor_secret = null;
$user->two_factor_enrolled = 0;
$user->save();
return response()->json(['message' => trans('admin/settings/general.two_factor_reset_success')], 200);
} catch (\Exception $e) {
return response()->json(['message' => trans('admin/settings/general.two_factor_reset_error')], 500);
@@ -549,6 +595,7 @@ class UsersController extends Controller
}
return response()->json(['message' => 'No ID provided'], 500);
}
/**
@@ -563,4 +610,28 @@ class UsersController extends Controller
{
return (new UsersTransformer)->transformUser($request->user());
}
/**
* Restore a soft-deleted user.
*
* @author [E. Taylor] [<dev@evantaylor.name>]
* @param int $userId
* @since [v6.0.0]
* @return JsonResponse
*/
public function restore($userId = null)
{
// Get asset information
$user = User::withTrashed()->find($userId);
$this->authorize('delete', $user);
if (isset($user->id)) {
// Restore the user
User::withTrashed()->where('id', $userId)->restore();
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/users/message.success.restored')));
}
$id = $userId;
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/users/message.user_not_found', compact('id'))), 200);
}
}

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\Helper;
@@ -21,7 +22,6 @@ use View;
*/
class AssetMaintenancesController extends Controller
{
/**
* Checks for permissions for this action.
*
@@ -54,8 +54,6 @@ class AssetMaintenancesController extends Controller
return view('asset_maintenances/index');
}
/**
* Returns a form view to create a new asset maintenance.
*
@@ -107,24 +105,24 @@ class AssetMaintenancesController extends Controller
$assetMaintenance->notes = $request->input('notes');
$asset = Asset::find($request->input('asset_id'));
if ((!Company::isCurrentUserHasAccess($asset)) && ($asset!=null)) {
if ((! Company::isCurrentUserHasAccess($asset)) && ($asset != null)) {
return static::getInsufficientPermissionsRedirect();
}
// Save the asset maintenance data
$assetMaintenance->asset_id = $request->input('asset_id');
$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');
$assetMaintenance->user_id = Auth::id();
$assetMaintenance->title = $request->input('title');
$assetMaintenance->start_date = $request->input('start_date');
$assetMaintenance->completion_date = $request->input('completion_date');
$assetMaintenance->user_id = Auth::id();
if (( $assetMaintenance->completion_date !== null )
&& ( $assetMaintenance->start_date !== "" )
&& ( $assetMaintenance->start_date !== "0000-00-00" )
if (($assetMaintenance->completion_date !== null)
&& ($assetMaintenance->start_date !== '')
&& ($assetMaintenance->start_date !== '0000-00-00')
) {
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$assetMaintenance->asset_maintenance_time = $completionDate->diffInDays($startDate);
}
@@ -136,7 +134,6 @@ class AssetMaintenancesController extends Controller
}
return redirect()->back()->withInput()->withErrors($assetMaintenance->getErrors());
}
/**
@@ -157,11 +154,10 @@ class AssetMaintenancesController extends Controller
// Redirect to the improvement management page
return redirect()->route('maintenances.index')
->with('error', trans('admin/asset_maintenances/message.not_found'));
} elseif (!$assetMaintenance->asset) {
} elseif (! $assetMaintenance->asset) {
return redirect()->route('maintenances.index')
->with('error', 'The asset associated with this maintenance does not exist.');
} elseif (!Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
} elseif (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return static::getInsufficientPermissionsRedirect();
}
@@ -188,7 +184,6 @@ class AssetMaintenancesController extends Controller
->with('selectedAsset', null)
->with('assetMaintenanceType', $assetMaintenanceType)
->with('item', $assetMaintenance);
}
/**
@@ -210,7 +205,7 @@ class AssetMaintenancesController extends Controller
// 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)) {
} elseif (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return static::getInsufficientPermissionsRedirect();
}
@@ -221,32 +216,32 @@ class AssetMaintenancesController extends Controller
$asset = Asset::find(request('asset_id'));
if (!Company::isCurrentUserHasAccess($asset)) {
if (! Company::isCurrentUserHasAccess($asset)) {
return static::getInsufficientPermissionsRedirect();
}
// Save the asset maintenance data
$assetMaintenance->asset_id = $request->input('asset_id');
$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');
$assetMaintenance->title = $request->input('title');
$assetMaintenance->start_date = $request->input('start_date');
$assetMaintenance->completion_date = $request->input('completion_date');
if (( $assetMaintenance->completion_date == null )
if (($assetMaintenance->completion_date == null)
) {
if (( $assetMaintenance->asset_maintenance_time !== 0 )
|| ( !is_null($assetMaintenance->asset_maintenance_time) )
if (($assetMaintenance->asset_maintenance_time !== 0)
|| (! is_null($assetMaintenance->asset_maintenance_time))
) {
$assetMaintenance->asset_maintenance_time = null;
}
}
if (( $assetMaintenance->completion_date !== null )
&& ( $assetMaintenance->start_date !== "" )
&& ( $assetMaintenance->start_date !== "0000-00-00" )
if (($assetMaintenance->completion_date !== null)
&& ($assetMaintenance->start_date !== '')
&& ($assetMaintenance->start_date !== '0000-00-00')
) {
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$startDate = Carbon::parse($assetMaintenance->start_date);
$completionDate = Carbon::parse($assetMaintenance->completion_date);
$assetMaintenance->asset_maintenance_time = $completionDate->diffInDays($startDate);
}
@@ -257,6 +252,7 @@ class AssetMaintenancesController extends Controller
return redirect()->route('maintenances.index')
->with('success', trans('admin/asset_maintenances/message.edit.success'));
}
return redirect()->back()->withInput()->withErrors($assetMaintenance->getErrors());
}
@@ -277,7 +273,7 @@ class AssetMaintenancesController extends Controller
// 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)) {
} elseif (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return static::getInsufficientPermissionsRedirect();
}
@@ -307,7 +303,7 @@ class AssetMaintenancesController extends Controller
// 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)) {
} elseif (! Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
return static::getInsufficientPermissionsRedirect();
}

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\Helper;
@@ -7,10 +8,10 @@ use App\Models\AssetModel;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Validator;
use Redirect;
use Request;
use Storage;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
@@ -34,6 +35,7 @@ class AssetModelsController extends Controller
public function index()
{
$this->authorize('index', AssetModel::class);
return view('models/index');
}
@@ -48,12 +50,12 @@ class AssetModelsController extends Controller
public function create()
{
$this->authorize('create', AssetModel::class);
return view('models/edit')->with('category_type', 'asset')
->with('depreciation_list', Helper::depreciationList())
->with('item', new AssetModel);
}
/**
* Validate and process the new Asset Model data.
*
@@ -65,7 +67,6 @@ class AssetModelsController extends Controller
*/
public function store(ImageUploadRequest $request)
{
$this->authorize('create', AssetModel::class);
// Create a new asset model
$model = new AssetModel;
@@ -73,29 +74,32 @@ class AssetModelsController extends Controller
// Save the model data
$model->eol = $request->input('eol');
$model->depreciation_id = $request->input('depreciation_id');
$model->name = $request->input('name');
$model->model_number = $request->input('model_number');
$model->manufacturer_id = $request->input('manufacturer_id');
$model->category_id = $request->input('category_id');
$model->notes = $request->input('notes');
$model->user_id = Auth::id();
$model->requestable = Request::has('requestable');
$model->name = $request->input('name');
$model->model_number = $request->input('model_number');
$model->manufacturer_id = $request->input('manufacturer_id');
$model->category_id = $request->input('category_id');
$model->notes = $request->input('notes');
$model->user_id = Auth::id();
$model->requestable = Request::has('requestable');
if ($request->input('custom_fieldset')!='') {
if ($request->input('custom_fieldset') != '') {
$model->fieldset_id = e($request->input('custom_fieldset'));
}
$model = $request->handleImages($model);
// Was it created?
// Was it created?
if ($model->save()) {
if ($this->shouldAddDefaultValues($request->input())) {
$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'));
if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){
return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error'));
}
}
// Redirect to the new model page
return redirect()->route("models.index")->with('success', trans('admin/models/message.create.success'));
return redirect()->route('models.index')->with('success', trans('admin/models/message.create.success'));
}
return redirect()->back()->withInput()->withErrors($model->getErrors());
}
@@ -113,13 +117,13 @@ class AssetModelsController extends Controller
$this->authorize('update', AssetModel::class);
if ($item = AssetModel::find($modelId)) {
$category_type = 'asset';
$view = View::make('models/edit', compact('item','category_type'));
$view = View::make('models/edit', compact('item', 'category_type'));
$view->with('depreciation_list', Helper::depreciationList());
return $view;
}
return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));
}
@@ -145,31 +149,33 @@ class AssetModelsController extends Controller
$model = $request->handleImages($model);
$model->depreciation_id = $request->input('depreciation_id');
$model->eol = $request->input('eol');
$model->name = $request->input('name');
$model->model_number = $request->input('model_number');
$model->manufacturer_id = $request->input('manufacturer_id');
$model->category_id = $request->input('category_id');
$model->notes = $request->input('notes');
$model->requestable = $request->input('requestable', '0');
$model->depreciation_id = $request->input('depreciation_id');
$model->eol = $request->input('eol');
$model->name = $request->input('name');
$model->model_number = $request->input('model_number');
$model->manufacturer_id = $request->input('manufacturer_id');
$model->category_id = $request->input('category_id');
$model->notes = $request->input('notes');
$model->requestable = $request->input('requestable', '0');
$this->removeCustomFieldsDefaultValues($model);
if ($request->input('custom_fieldset')=='') {
if ($request->input('custom_fieldset') == '') {
$model->fieldset_id = null;
} else {
$model->fieldset_id = $request->input('custom_fieldset');
if ($this->shouldAddDefaultValues($request->input())) {
$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'));
if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){
return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error'));
}
}
}
if ($model->save()) {
return redirect()->route("models.index")->with('success', trans('admin/models/message.update.success'));
return redirect()->route('models.index')->with('success', trans('admin/models/message.update.success'));
}
return redirect()->back()->withInput()->withErrors($model->getErrors());
}
@@ -197,7 +203,7 @@ class AssetModelsController extends Controller
}
if ($model->image) {
try {
try {
Storage::disk('public')->delete('models/'.$model->image);
} catch (\Exception $e) {
\Log::info($e);
@@ -211,7 +217,6 @@ class AssetModelsController extends Controller
return redirect()->route('models.index')->with('success', trans('admin/models/message.delete.success'));
}
/**
* Restore a given Asset Model (mark as un-deleted)
*
@@ -229,6 +234,7 @@ class AssetModelsController extends Controller
if (isset($model->id)) {
$model->restore();
return redirect()->route('models.index')->with('success', trans('admin/models/message.restore.success'));
}
return redirect()->back()->with('error', trans('admin/models/message.not_found'));
@@ -258,13 +264,13 @@ class AssetModelsController extends Controller
}
/**
* Get the clone page to clone a model
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return View
*/
* Get the clone page to clone a model
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $modelId
* @return View
*/
public function getClone($modelId = null)
{
$this->authorize('create', AssetModel::class);
@@ -285,21 +291,20 @@ class AssetModelsController extends Controller
/**
* Get the custom fields form
*
* @author [B. Wetherington] [<uberbrady@gmail.com>]
* @since [v2.0]
* @param int $modelId
* @return View
*/
* Get the custom fields form
*
* @author [B. Wetherington] [<uberbrady@gmail.com>]
* @since [v2.0]
* @param int $modelId
* @return View
*/
public function getCustomFields($modelId)
{
return view("models.custom_fields_form")->with("model", AssetModel::find($modelId));
return view('models.custom_fields_form')->with('model', AssetModel::find($modelId));
}
/**
* Returns a view that allows the user to bulk edit model attrbutes
*
@@ -309,28 +314,25 @@ class AssetModelsController extends Controller
*/
public function postBulkEdit(Request $request)
{
$models_raw_array = $request->input('ids');
// Make sure some IDs have been selected
if ((is_array($models_raw_array)) && (count($models_raw_array) > 0)) {
$models = AssetModel::whereIn('id', $models_raw_array)->withCount('assets as assets_count')->orderBy('assets_count', 'ASC')->get();
// If deleting....
if ($request->input('bulk_actions')=='delete') {
if ($request->input('bulk_actions') == 'delete') {
$valid_count = 0;
foreach ($models as $model) {
if ($model->assets_count == 0) {
$valid_count++;
}
}
return view('models/bulk-delete', compact('models'))->with('valid_count', $valid_count);
// Otherwise display the bulk edit screen
} else {
$nochange = ['NC' => 'No Change'];
$fieldset_list = $nochange + Helper::customFieldsetList();
$depreciation_list = $nochange + Helper::depreciationList();
@@ -339,12 +341,10 @@ class AssetModelsController extends Controller
->with('fieldset_list', $fieldset_list)
->with('depreciation_list', $depreciation_list);
}
}
return redirect()->route('models.index')
->with('error', 'You must select at least one model to edit.');
}
@@ -358,35 +358,33 @@ class AssetModelsController extends Controller
*/
public function postBulkEditSave(Request $request)
{
$models_raw_array = $request->input('ids');
$update_array = array();
$update_array = [];
if (($request->filled('manufacturer_id') && ($request->input('manufacturer_id')!='NC'))) {
if (($request->filled('manufacturer_id') && ($request->input('manufacturer_id') != 'NC'))) {
$update_array['manufacturer_id'] = $request->input('manufacturer_id');
}
if (($request->filled('category_id') && ($request->input('category_id')!='NC'))) {
if (($request->filled('category_id') && ($request->input('category_id') != 'NC'))) {
$update_array['category_id'] = $request->input('category_id');
}
if ($request->input('fieldset_id')!='NC') {
if ($request->input('fieldset_id') != 'NC') {
$update_array['fieldset_id'] = $request->input('fieldset_id');
}
if ($request->input('depreciation_id')!='NC') {
if ($request->input('depreciation_id') != 'NC') {
$update_array['depreciation_id'] = $request->input('depreciation_id');
}
if (count($update_array) > 0) {
AssetModel::whereIn('id', $models_raw_array)->update($update_array);
return redirect()->route('models.index')
->with('success', trans('admin/models/message.bulkedit.success'));
}
return redirect()->route('models.index')
->with('warning', trans('admin/models/message.bulkedit.error'));
}
/**
@@ -403,7 +401,6 @@ class AssetModelsController extends Controller
$models_raw_array = $request->input('ids');
if ((is_array($models_raw_array)) && (count($models_raw_array) > 0)) {
$models = AssetModel::whereIn('id', $models_raw_array)->withCount('assets as assets_count')->get();
$del_error_count = 0;
@@ -425,7 +422,7 @@ class AssetModelsController extends Controller
if ($del_error_count == 0) {
return redirect()->route('models.index')
->with('success', trans('admin/models/message.bulkdelete.success',['success_count'=> $del_count] ));
->with('success', trans('admin/models/message.bulkdelete.success', ['success_count'=> $del_count]));
}
return redirect()->route('models.index')
@@ -434,7 +431,6 @@ class AssetModelsController extends Controller
return redirect()->route('models.index')
->with('error', trans('admin/models/message.bulkdelete.error'));
}
/**
@@ -442,13 +438,13 @@ class AssetModelsController extends Controller
* any default values were entered into the form.
*
* @param array $input
* @return boolean
* @return bool
*/
private function shouldAddDefaultValues(array $input)
{
return !empty($input['add_default_values'])
&& !empty($input['default_values'])
&& !empty($input['custom_fieldset']);
return ! empty($input['add_default_values'])
&& ! empty($input['default_values'])
&& ! empty($input['custom_fieldset']);
}
/**
@@ -460,6 +456,32 @@ class AssetModelsController extends Controller
*/
private function assignCustomFieldsDefaultValues(AssetModel $model, array $defaultValues)
{
$data = array();
foreach ($defaultValues as $customFieldId => $defaultValue) {
$customField = \App\Models\CustomField::find($customFieldId);
$data[$customField->db_column] = $defaultValue;
}
$fieldsets = $model->fieldset->validation_rules();
$rules = array();
foreach ($fieldsets as $fieldset => $validation){
// If the field is marked as required, eliminate the rule so it doesn't interfere with the default values
// (we are at model level, the rule still applies when creating a new asset using this model)
$index = array_search('required', $validation);
if ($index !== false){
$validation[$index] = 'nullable';
}
$rules[$fieldset] = $validation;
}
$validator = Validator::make($data, $rules);
if($validator->fails()){
return false;
}
foreach ($defaultValues as $customFieldId => $defaultValue) {
if(is_array($defaultValue)){
$model->defaultValues()->attach($customFieldId, ['default_value' => implode(', ', $defaultValue)]);
@@ -467,6 +489,7 @@ class AssetModelsController extends Controller
$model->defaultValues()->attach($customFieldId, ['default_value' => $defaultValue]);
}
}
return true;
}
/**

View File

@@ -0,0 +1,155 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\StorageHelper;
use App\Http\Requests\AssetFileRequest;
use App\Models\Actionlog;
use App\Models\AssetModel;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Storage;
use enshrined\svgSanitize\Sanitizer;
class AssetModelsFilesController extends Controller
{
/**
* Upload a file to the server.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param AssetFileRequest $request
* @param int $modelId
* @return Redirect
* @since [v1.0]
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function store(AssetFileRequest $request, $modelId = null)
{
if (! $model = AssetModel::find($modelId)) {
return redirect()->route('models.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$this->authorize('update', $model);
if ($request->hasFile('file')) {
if (! Storage::exists('private_uploads/assetmodels')) {
Storage::makeDirectory('private_uploads/assetmodels', 775);
}
foreach ($request->file('file') as $file) {
$extension = $file->getClientOriginalExtension();
$file_name = 'model-'.$model->id.'-'.str_random(8).'-'.str_slug(basename($file->getClientOriginalName(), '.'.$extension)).'.'.$extension;
// Check for SVG and sanitize it
if ($extension=='svg') {
\Log::debug('This is an SVG');
$sanitizer = new Sanitizer();
$dirtySVG = file_get_contents($file->getRealPath());
$cleanSVG = $sanitizer->sanitize($dirtySVG);
try {
Storage::put('private_uploads/assetmodels/'.$file_name, $cleanSVG);
} catch (\Exception $e) {
\Log::debug('Upload no workie :( ');
\Log::debug($e);
}
} else {
Storage::put('private_uploads/assetmodels/'.$file_name, file_get_contents($file));
}
$model->logUpload($file_name, e($request->get('notes')));
}
return redirect()->back()->with('success', trans('general.file_upload_success'));
}
return redirect()->back()->with('error', trans('admin/hardware/message.upload.nofiles'));
}
/**
* Check for permissions and display the file.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $modelId
* @param int $fileId
* @since [v1.0]
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function show($modelId = null, $fileId = null, $download = true)
{
$model = AssetModel::find($modelId);
// the asset is valid
if (isset($model->id)) {
$this->authorize('view', $model);
if (! $log = Actionlog::find($fileId)) {
return response('No matching record for that model/file', 500)
->header('Content-Type', 'text/plain');
}
$file = 'private_uploads/assetmodels/'.$log->filename;
\Log::debug('Checking for '.$file);
if (! Storage::exists($file)) {
return response('File '.$file.' not found on server', 404)
->header('Content-Type', 'text/plain');
}
if ($download != 'true') {
if ($contents = file_get_contents(Storage::url($file))) {
return Response::make(Storage::url($file)->header('Content-Type', mime_content_type($file)));
}
return JsonResponse::create(['error' => 'Failed validation: '], 500);
}
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
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $modelId
* @param int $fileId
* @since [v1.0]
* @return View
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function destroy($modelId = null, $fileId = null)
{
$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) {
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()
->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

@@ -7,13 +7,14 @@ use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Requests\AssetCheckinRequest;
use App\Models\Asset;
use App\Models\CheckoutAcceptance;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
class AssetCheckinController extends Controller
{
/**
* Returns a view that presents a form to check an asset back into inventory.
*
@@ -33,6 +34,7 @@ class AssetCheckinController extends Controller
}
$this->authorize('checkin', $asset);
return view('hardware/checkin', compact('asset'))->with('statusLabel_list', Helper::statusLabelList())->with('backto', $backto);
}
@@ -73,7 +75,7 @@ class AssetCheckinController extends Controller
$asset->name = $request->get('name');
if ($request->filled('status_id')) {
$asset->status_id = e($request->get('status_id'));
$asset->status_id = e($request->get('status_id'));
}
// This is just meant to correct legacy issues where some user data would have 0
@@ -81,14 +83,14 @@ class AssetCheckinController extends Controller
// rules, so it's necessary to fix this for long-time users. It's kinda gross, but will help
// people (and their data) in the long run
if ($asset->rtd_location_id=='0') {
if ($asset->rtd_location_id == '0') {
\Log::debug('Manually override the RTD location IDs');
\Log::debug('Original RTD Location ID: '.$asset->rtd_location_id);
$asset->rtd_location_id = '';
\Log::debug('New RTD Location ID: '.$asset->rtd_location_id);
}
if ($asset->location_id=='0') {
if ($asset->location_id == '0') {
\Log::debug('Manually override the location IDs');
\Log::debug('Original Location ID: '.$asset->location_id);
$asset->location_id = '';
@@ -96,13 +98,10 @@ class AssetCheckinController extends Controller
}
$asset->location_id = $asset->rtd_location_id;
\Log::debug('After Location ID: '.$asset->location_id);
\Log::debug('After RTD Location ID: '.$asset->rtd_location_id);
if ($request->filled('location_id')) {
\Log::debug('NEW Location ID: '.$request->get('location_id'));
$asset->location_id = e($request->get('location_id'));
$asset->location_id = e($request->get('location_id'));
}
$checkin_at = date('Y-m-d H:i:s');
@@ -110,16 +109,34 @@ class AssetCheckinController extends Controller
$checkin_at = $request->get('checkin_at');
}
if(!empty($asset->licenseseats->all())){
foreach ($asset->licenseseats as $seat){
$seat->assigned_to = null;
$seat->save();
}
}
// Get all pending Acceptances for this asset and delete them
$acceptances = CheckoutAcceptance::pending()->whereHasMorph('checkoutable',
[Asset::class],
function (Builder $query) use ($asset) {
$query->where('id', $asset->id);
})->get();
$acceptances->map(function($acceptance) {
$acceptance->delete();
});
// Was the asset updated?
if ($asset->save()) {
event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at));
if ((isset($user)) && ($backto =='user')) {
return redirect()->route("users.show", $user->id)->with('success', trans('admin/hardware/message.checkin.success'));
if ((isset($user)) && ($backto == 'user')) {
return redirect()->route('users.show', $user->id)->with('success', trans('admin/hardware/message.checkin.success'));
}
return redirect()->route("hardware.index")->with('success', trans('admin/hardware/message.checkin.success'));
return redirect()->route('hardware.index')->with('success', trans('admin/hardware/message.checkin.success'));
}
// Redirect to the asset management page with error
return redirect()->route("hardware.index")->with('error', trans('admin/hardware/message.checkin.error').$asset->getErrors());
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkin.error').$asset->getErrors());
}
}

View File

@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Assets;
use App\Exceptions\CheckoutNotAllowed;
use App\Helpers\Helper;
use App\Http\Controllers\CheckInOutRequest;
@@ -11,21 +10,24 @@ use App\Http\Requests\AssetCheckoutRequest;
use App\Models\Asset;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
class AssetCheckoutController extends Controller
{
use CheckInOutRequest;
/**
* Returns a view that presents a form to check an asset out to a
* user.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @since [v1.0]
* @return View
*/
public function create($assetId)
* Returns a view that presents a form to check an asset out to a
* user.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @since [v1.0]
* @return View
*/
public function create(Request $request, $assetId)
{
// Check if the asset exists
if (is_null($asset = Asset::find(e($assetId)))) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
@@ -34,12 +36,29 @@ class AssetCheckoutController extends Controller
$this->authorize('checkout', $asset);
if ($asset->availableForCheckout()) {
/**
* Set a session variable here for the possible return url - this may or may not be used
* in the store() method below, but we need to set it here, so we know what "back" means.
* We set this here so that we don't end up with UX weirdness if our referrer isn't what we're
* expecting (for example a checkout that happens from a place we didn't plan for yet.
* - @snipe - 2022-12-22
*/
$request->session()->forget('backto_item_type');
$request->session()->forget('backto_item_id');
\Log::debug('dropping session data for backto_item_type and backto_item_id');
// Hard-coding this for now, since we're only workiing with assets, not other first-class items yet
$request->session()->put('backto_item_type', '\App\Models\Asset');
$request->session()->put('backto_item_id', $assetId);
\Log::debug('setting new session data for asset '. $assetId . ' via backto_item_type and backto_item_id');
return view('hardware/checkout', compact('asset'))
->with('statusLabel_list', Helper::deployableStatusLabelList());
}
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkout.not_available'));
}
/**
@@ -53,26 +72,32 @@ class AssetCheckoutController extends Controller
*/
public function store(AssetCheckoutRequest $request, $assetId)
{
$asset = Asset::find($assetId);
$this->authorize('checkout', $asset);
try {
// Check if the asset exists
if (!$asset = Asset::find($assetId)) {
if (!$asset) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
} elseif (!$asset->availableForCheckout()) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkout.not_available'));
}
$this->authorize('checkout', $asset);
$admin = Auth::user();
$target = $this->determineCheckoutTarget($asset);
$asset = $this->updateAssetLocation($asset, $target);
$expected_checkin = '';
$checkout_at = date('Y-m-d H:i:s');
$checkout_at = date("Y-m-d H:i:s");
if (($request->filled('checkout_at')) && ($request->get('checkout_at')!= date("Y-m-d"))) {
if (($request->filled('checkout_at')) && ($request->get('checkout_at') != date('Y-m-d'))) {
$checkout_at = $request->get('checkout_at');
}
$expected_checkin = '';
if ($request->filled('expected_checkin')) {
$expected_checkin = $request->get('expected_checkin');
}
@@ -81,11 +106,32 @@ class AssetCheckoutController extends Controller
$asset->status_id = $request->get('status_id');
}
if ($asset->checkOut($target, $admin, $checkout_at, $expected_checkin, e($request->get('note')), $request->get('name'))) {
return redirect()->route("hardware.index")->with('success', trans('admin/hardware/message.checkout.success'));
if ($request->filled('next_action')) {
$back_to_route = $request->get('next_action');
}
// Redirect to the asset management page with error
if(!empty($asset->licenseseats->all())) {
if (request('checkout_to_type') == 'user') {
foreach ($asset->licenseseats as $seat){
$seat->assigned_to = $target->id;
$seat->save();
}
}
}
if ($asset->checkOut($target, $admin, $checkout_at, $expected_checkin, e($request->get('note')), $request->get('name'))) {
if ($request->get('accept_in_person')=='1') {
return view('hardware/checkout', compact('asset'))
->with('statusLabel_list', Helper::deployableStatusLabelList());
}
return redirect()->route($back_to_route)->with('success', trans('admin/hardware/message.checkout.success'));
}
// Redirect to the asset page with error
return redirect()->to("hardware/$assetId/checkout")->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());
@@ -93,5 +139,4 @@ class AssetCheckoutController extends Controller
return redirect()->back()->with('error', $e->getMessage());
}
}
}

View File

@@ -2,13 +2,13 @@
namespace App\Http\Controllers\Assets;
use App\Helpers\StorageHelper;
use App\Http\Controllers\Controller;
use App\Http\Requests\AssetFileRequest;
use App\Models\Actionlog;
use App\Models\Asset;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Storage;
use App\Helpers\StorageHelper;
use enshrined\svgSanitize\Sanitizer;
class AssetFilesController extends Controller
@@ -25,15 +25,16 @@ class AssetFilesController extends Controller
*/
public function store(AssetFileRequest $request, $assetId = null)
{
if (!$asset = Asset::find($assetId)) {
if (! $asset = Asset::find($assetId)) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}
$this->authorize('update', $asset);
if ($request->hasFile('file')) {
if (!Storage::exists('private_uploads/assets')) Storage::makeDirectory('private_uploads/assets', 775);
if (! Storage::exists('private_uploads/assets')) {
Storage::makeDirectory('private_uploads/assets', 775);
}
foreach ($request->file('file') as $file) {
@@ -55,12 +56,13 @@ class AssetFilesController extends Controller
\Log::debug($e);
}
} else {
Storage::put('private_uploads/assets/'.$file_name, file_get_contents($file));
Storage::put('private_uploads/assets/'.$file_name, file_get_contents($file));
}
$asset->logUpload($file_name, e($request->get('notes')));
}
return redirect()->back()->with('success', trans('admin/hardware/message.upload.success'));
}
@@ -84,7 +86,7 @@ class AssetFilesController extends Controller
if (isset($asset->id)) {
$this->authorize('view', $asset);
if (!$log = Actionlog::find($fileId)) {
if (! $log = Actionlog::find($fileId)) {
return response('No matching record for that asset/file', 500)
->header('Content-Type', 'text/plain');
}
@@ -92,21 +94,23 @@ class AssetFilesController extends Controller
$file = 'private_uploads/assets/'.$log->filename;
\Log::debug('Checking for '.$file);
if ($log->action_type =='audit') {
if ($log->action_type == 'audit') {
$file = 'private_uploads/audits/'.$log->filename;
}
if (!Storage::exists($file)) {
if (! Storage::exists($file)) {
return response('File '.$file.' not found on server', 404)
->header('Content-Type', 'text/plain');
}
if ($download != 'true') {
if ($contents = file_get_contents(Storage::url($file))) {
return Response::make(Storage::url($file)->header('Content-Type', mime_content_type($file)));
}
return JsonResponse::create(["error" => "Failed validation: "], 500);
if ($contents = file_get_contents(Storage::url($file))) {
return Response::make(Storage::url($file)->header('Content-Type', mime_content_type($file)));
}
return JsonResponse::create(['error' => 'Failed validation: '], 500);
}
return StorageHelper::downloader($file);
}
// Prepare the error message
@@ -141,6 +145,7 @@ class AssetFilesController extends Controller
Storage::delete($rel_path.'/'.$log->filename);
}
$log->delete();
return redirect()->back()->with('success', trans('admin/hardware/message.deletefile.success'));
}

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