3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 03:06:23 +00:00
Commit Graph

328 Commits

Author SHA1 Message Date
b0742978b8 Cleaned up some PHPStan errors, re-ran baseline 2026-08-13 12:20:54 +01:00
71b3747d44 Make phpstan happier 2026-08-13 11:31:57 +01:00
1125e595b4 License Importer: Do not require seats if just assigning licenses 2026-08-12 12:46:10 +01:00
b7d1f84adb Update license importer to look for pre-existing license 2026-08-11 22:02:12 +01:00
747655a706 Merge pull request #19432 from TowyTowy/fix/category-importer-alert-on-response
Fixed category importer silently ignoring the alert_on_response column
2026-08-08 10:20:00 +01:00
037f50b1a5 Refactored to move initial create order logic into the trait 2026-08-07 11:15:10 +01:00
486316c3fb A few more importer fixes 2026-08-06 11:59:46 +01:00
94869caaee More importer fixes and test fixes 2026-08-05 22:46:24 +01:00
3503dc7ee7 Updated importer tests 2026-08-05 22:37:14 +01:00
ddc463e75d Updated importer to handle currency in CSVs 2026-08-05 14:35:37 +01:00
4a2c4557d6 Updated importers 2026-08-05 11:49:31 +01:00
c5bded7238 Fixed category importer silently ignoring the alert_on_response column
The importer UI offers "Alert on Response" as a mappable column for
category imports (app/Livewire/Importer.php, categories_fields), but
CategoryImporter only ever read use_default_eula, require_acceptance
and checkin_email. Anything the user mapped to alert_on_response was
dropped: new categories were always created with the column default,
and update-mode imports could never change it.

alert_on_response was added to the Category model in #17116, four days
after the category importer landed in #17062, and the importer's flag
list was never extended to match.

Adds it to the existing boolean-flag loop so it gets the same
fetchHumanBoolean handling and the same present/absent CSV semantics
as its three siblings.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-04 20:02:21 +02:00
a86bc77b21 Added currency and supplier to modal and importer 2026-08-03 20:32:46 +01:00
f51859013f Handle the remaining importers 2026-08-03 15:11:10 +01:00
6124aed387 Handle consumable importer order_number stuff 2026-08-03 15:06:07 +01:00
0a1884c79c Handle importers 2026-08-03 15:05:53 +01:00
02bb0356a6 Updated tests 2026-08-03 13:43:28 +01:00
a53928e1a4 Replenish/remove for consumables, accessories, components 2026-08-03 13:07:59 +01:00
df475008cd Refactor for codacy’s happiness (npath) 2026-08-03 12:29:41 +01:00
ce670d654f Added loss ratio safety net for *sort of* okay files 2026-08-03 12:15:02 +01:00
500861f82f Fixed #19414 - mojibake fix 2026-08-03 12:02:08 +01:00
951bd4f0e5 Fixed FD-56819 - concurrency issues 2026-08-02 11:39:08 +01:00
96261201e1 Added @SuppressWarnings(PHPMD.UnusedFormalParameter) for required laravel signature variables 2026-07-31 12:50:34 +01:00
bc3cde5e97 Importer improvements 2026-07-31 04:16:03 +01:00
2478cf25d4 Importer: Switch to accessor for created_by 2026-07-29 16:10:48 +01:00
38bcae38d0 Added GATED_AUTH_FIELDS to keep auth gated fields consistent 2026-07-29 15:20:46 +01:00
1106e19956 Updated stale comment 2026-07-27 19:42:02 +01:00
7a0eabec9e Added additional checkouts, history 2026-07-26 00:02:03 +01:00
cb58d56663 More test stuff 2026-07-26 00:00:06 +01:00
bc148ebe2b CSV Import: update mode silently resets requestable and cannot clear byod
In update mode, AssetImporter::createAssetIfNotExists() always coerces the
requestable CSV value to a boolean and assigns it directly to the model. When
the import file has no requestable column, that coerces null to 0 and resets
the flag on every asset the update touches. The existing test suite documented
this ("RequestAble is always updated regardless of initial value.") by
commenting out the assertion instead of failing.

byod has the mirror problem: the value is coerced to int 0 before
sanitizeItemForUpdating(), which strips falsy values in update mode, so an
explicit byod=FALSE in the CSV is silently dropped and the flag can never be
cleared through an update import.

Fix: in update mode only touch either flag when the CSV actually provides a
non-blank value, and assign the coerced value directly to the model (as the
requestable line already did) so an explicit falsy value survives the
empty-value stripping. Create-mode behavior is unchanged (missing/blank still
defaults to 0).

Adds regression tests for both directions and restores the previously
commented-out assertion in update_asset_from_import().

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-18 12:10:11 +02:00
4e43dd5f93 Merge pull request #19315 from grokability/datepicker
🎥 Fixed #17063, #18776, #8855, and #11580 - Added datetime picker
2026-07-17 18:52:29 +01:00
04e0d8298a Update models for cast and rules for datetime 2026-07-17 10:18:35 +01:00
0249be3b7c CSV Import: User importer rejects entire row when start/end dates are not exactly Y-m-d
Sibling follow-up to #19306/#19310. UserImporter passed start_date and end_date raw
from the CSV into the User model, whose validation rules require the exact format
Y-m-d ('nullable|date_format:Y-m-d'). Any other representation of a perfectly valid
date - '07/28/2025', '28-12-2025', '2025-07-28 00:00:00' - failed validation and the
whole user row was rejected, while the same date imports fine for assets, licenses,
accessories, consumables and components.

Run both fields through the importer's existing parseOrNullDate() helper, which
parses with CarbonImmutable, normalizes to Y-m-d, logs on failure and returns null.
This also makes handleEmptyStringsForDates() (added in #19294 to fix the empty-string
symptom of the same validation failure, issue #15141) redundant - parseOrNullDate()
already returns null for empty input - so it is removed.

Adds regression tests: a non-ISO date imports as the normalized Y-m-d value, and an
unparseable date imports as null instead of rejecting the row.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-17 01:09:34 +02:00
f7a9196062 CSV Import: License importer stores 1970-01-01 for unparseable expiration & termination dates
Sibling follow-up to #19306. LicenseImporter used date('Y-m-d 00:00:01', strtotime($value)) for expiration_date and termination_date; strtotime() returns false on failure and date() coerces false to timestamp 0, so unparseable dates were silently stored as 1970-01-01 instead of left empty.

Swap to the importer's existing parseOrNullDate() helper (as #19306 did for purchase_date), which parses with CarbonImmutable, logs on failure, and returns null. Both columns are cast 'date' with toDateString() setters, so valid dates are byte-identical to before; only unparseable input changes (1970-01-01 -> null).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-15 20:19:37 +02:00
b5ccee2d01 CSV Import: Fixed #13995 - purchase date silently stored as 1970-01-01 for unparseable dates
The base ItemImporter parsed purchase_date with date('Y-m-d', strtotime($value)).
When strtotime() cannot parse the value it returns false, which date() coerces to
timestamp 0 and silently writes 1970-01-01 instead of leaving the field empty. This
affects every item import (assets, accessories, consumables, components) and hits
common non-US inputs such as day-first '31/12/2023'.

Use the project's existing parseOrNullDate() helper - already used for last_audit_date,
next_audit_date, asset_eol_date and the checkin/checkout dates - which parses via
CarbonImmutable and returns null (logging 'Unable to parse date') on invalid input.
Valid dates are unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-15 11:29:29 +02:00
115d1a4f5e Rename company_id on users table 2026-07-10 14:41:47 +01:00
d1a635d8b9 Merge remote-tracking branch 'origin/develop' into _floater-mode-superuser-gate 2026-07-02 13:54:24 +01:00
f95767d7d8 FMCS scoping: drop unique DB constraint, scope in the importer 2026-06-30 23:10:39 +01:00
d58e757d37 Reverter tighter scope, updated tests 2026-06-26 12:44:13 +01:00
b78aedeec2 Added stricter gate checks with FMCS and floater mode is on 2026-06-25 19:29:06 +01:00
a6c82eec7b Location Scoping: Fixed ordering for company check on user save
The model save fires before companies are synced, so company_id is stale data, which was causing it to erroneously fail validation. the rule was always wrong in that context for updates. The form request owns this check now.
2026-06-15 15:18:09 +01:00
e3a9872d28 Updated tests 2026-06-13 13:18:37 +01:00
75f86cd669 FMCS+location+floater+importer: handle the importer as well 2026-06-13 12:55:10 +01:00
abc4363e83 Fixed FD-55839 - arbitrary file deletion 2026-06-08 16:48:18 +01:00
7bf8fd5eeb Fixed #19106 - tighten up user accessor to treat null and empty string the same 2026-05-29 10:55:53 +01:00
988729fbeb Skip user records if user exists in another company if FMCS is enabled 2026-05-26 13:36:02 +01:00
dd4117bd5b Tighter guard on user imports auth fields if the user is authenticated (aka not run via cli) 2026-05-26 12:56:10 +01:00
3737b34913 Back-patch security fixes 2026-05-26 11:36:29 +01:00
2a93de675f Handle pipe delimited companyes in user importer 2026-05-19 14:38:52 +01:00
cacd6f7e9b Add pipe separator to import more than one company for a user 2026-05-19 13:26:38 +01:00