diff --git a/.all-contributorsrc b/.all-contributorsrc index dbec0453f..4ebf2cc1b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3298,6 +3298,15 @@ "contributions": [ "code" ] + }, + { + "login": "Fiala06", + "name": "Fiala06", + "avatar_url": "https://avatars.githubusercontent.com/u/5183146?v=4", + "profile": "https://github.com/Fiala06", + "contributions": [ + "code" + ] } ] } diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4e252554b..74df7b0a7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -53,7 +53,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken | [
squintfox](https://github.com/squintfox)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=squintfox "Code") | [
Jeff Clay](https://github.com/jeffclay)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=jeffclay "Code") | [
Phil J R](https://github.com/PP-JN-RL)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=PP-JN-RL "Code") | [
i_virus](https://www.corelight.com/)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=chandanchowdhury "Code") | [
Paul Grime](https://github.com/gitgrimbo)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=gitgrimbo "Code") | [
Lee Porte](https://leeporte.co.uk)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=LeePorte "Code") | [
BRYAN ](https://github.com/bryanlopezinc)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=bryanlopezinc "Code") [⚠️](https://github.com/snipe/snipe-it/commits?author=bryanlopezinc "Tests") | | [
U-H-T](https://github.com/U-H-T)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=U-H-T "Code") | [
Matt Tyree](https://github.com/Tyree)
[πŸ“–](https://github.com/snipe/snipe-it/commits?author=Tyree "Documentation") | [
Florent Bervas](http://spoontux.net)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=FlorentDotMe "Code") | [
Daniel Albertsen](https://ditscheri.com)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=dbakan "Code") | [
r-xyz](https://github.com/r-xyz)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=r-xyz "Code") | [
Steven Mainor](https://github.com/DrekiDegga)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=DrekiDegga "Code") | [
arne-kroeger](https://github.com/arne-kroeger)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=arne-kroeger "Code") | | [
Glukose1](https://github.com/Glukose1)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=Glukose1 "Code") | [
Scarzy](https://github.com/Scarzy)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=Scarzy "Code") | [
setpill](https://github.com/setpill)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=setpill "Code") | [
swift2512](https://github.com/swift2512)
[πŸ›](https://github.com/snipe/snipe-it/issues?q=author%3Aswift2512 "Bug reports") | [
Darren Rainey](https://darrenraineys.co.uk)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=DarrenRainey "Code") | [
maciej-poleszczyk](https://github.com/maciej-poleszczyk)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=maciej-poleszczyk "Code") | [
Sebastian Groß](https://github.com/sgross-emlix)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=sgross-emlix "Code") | -| [
Anouar Touati](https://github.com/AnouarTouati)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=AnouarTouati "Code") | [
aHVzY2g](https://github.com/aHVzY2g)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=aHVzY2g "Code") | [
ζž—εšδ» Buo-ren Lin](https://brlin.me)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=brlin-tw "Code") | [
Adugna Gizaw](https://orbalia.pythonanywhere.com/)
[🌍](#translation-addex12 "Translation") | [
Jesse Ostrander](https://github.com/jostrander)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=jostrander "Code") | [
James M](https://github.com/azmcnutt)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=azmcnutt "Code") | +| [
Anouar Touati](https://github.com/AnouarTouati)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=AnouarTouati "Code") | [
aHVzY2g](https://github.com/aHVzY2g)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=aHVzY2g "Code") | [
ζž—εšδ» Buo-ren Lin](https://brlin.me)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=brlin-tw "Code") | [
Adugna Gizaw](https://orbalia.pythonanywhere.com/)
[🌍](#translation-addex12 "Translation") | [
Jesse Ostrander](https://github.com/jostrander)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=jostrander "Code") | [
James M](https://github.com/azmcnutt)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=azmcnutt "Code") | [
Fiala06](https://github.com/Fiala06)
[πŸ’»](https://github.com/snipe/snipe-it/commits?author=Fiala06 "Code") | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! diff --git a/app/Console/Commands/SendExpirationAlerts.php b/app/Console/Commands/SendExpirationAlerts.php index 1220e0cd9..2e0c2a62f 100644 --- a/app/Console/Commands/SendExpirationAlerts.php +++ b/app/Console/Commands/SendExpirationAlerts.php @@ -42,7 +42,7 @@ class SendExpirationAlerts extends Command public function handle() { $settings = Setting::getSettings(); - $threshold = $settings->alert_interval; + $alert_interval = $settings->alert_interval; if (($settings->alert_email != '') && ($settings->alerts_enabled == 1)) { @@ -51,18 +51,18 @@ class SendExpirationAlerts extends Command ->map(fn($item) => trim($item)) // Trim each email ->all(); // Expiring Assets - $assets = Asset::getExpiringWarrantee($threshold); + $assets = Asset::getExpiringWarrantee($alert_interval); if ($assets->count() > 0) { - $this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $threshold])); - Mail::to($recipients)->send(new ExpiringAssetsMail($assets, $threshold)); + $this->info(trans_choice('mail.assets_warrantee_alert', $assets->count(), ['count' => $assets->count(), 'threshold' => $alert_interval])); + Mail::to($recipients)->send(new ExpiringAssetsMail($assets, $alert_interval)); } // Expiring licenses - $licenses = License::getExpiringLicenses($threshold); + $licenses = License::getExpiringLicenses($alert_interval); if ($licenses->count() > 0) { - $this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $threshold])); - Mail::to($recipients)->send(new ExpiringLicenseMail($licenses, $threshold)); + $this->info(trans_choice('mail.license_expiring_alert', $licenses->count(), ['count' => $licenses->count(), 'threshold' => $alert_interval])); + Mail::to($recipients)->send(new ExpiringLicenseMail($licenses, $alert_interval)); } } else { if ($settings->alert_email == '') { diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 21d8197eb..6e35f8217 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -125,7 +125,9 @@ class Handler extends ExceptionHandler // This is traaaaash but it handles models that are not found while using route model binding :( // The only alternative is to set that at *each* route, which is crazypants if ($e instanceof \Illuminate\Database\Eloquent\ModelNotFoundException) { - $model_name = last(explode('\\', $e->getModel())); + + // This gets the MVC model name from the exception and formats in a way that's less fugly + $model_name = strtolower(implode(" ", preg_split('/(?=[A-Z])/', last(explode('\\', $e->getModel()))))); $route = str_plural(strtolower(last(explode('\\', $e->getModel())))).'.index'; // Sigh. diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 807c514d0..ecb21e2ab 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -850,8 +850,8 @@ class SettingsController extends Controller $setting->ldap_fname_field = $request->input('ldap_fname_field'); $setting->ldap_auth_filter_query = $request->input('ldap_auth_filter_query'); $setting->ldap_version = $request->input('ldap_version', 3); - $setting->ldap_active_flag = $request->input('ldap_active_flag'); - $setting->ldap_invert_active_flag = $request->input('ldap_invert_active_flag'); + $setting->ldap_active_flag = $request->input('ldap_active_flag', 0); + $setting->ldap_invert_active_flag = $request->input('ldap_invert_active_flag', 0); $setting->ldap_emp_num = $request->input('ldap_emp_num'); $setting->ldap_email = $request->input('ldap_email'); $setting->ldap_manager = $request->input('ldap_manager'); diff --git a/app/Models/Asset.php b/app/Models/Asset.php index c57157817..4685617b1 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -785,7 +785,7 @@ class Asset extends Depreciable ->whereNotNull('warranty_months') ->whereNotNull('purchase_date') ->whereNull('deleted_at') - ->whereRaw('DATE_ADD(`purchase_date`,INTERVAL `warranty_months` MONTH) <= DATE(NOW() + INTERVAL ' + ->whereRaw('DATE_ADD(`purchase_date`, INTERVAL `warranty_months` MONTH) <= DATE_ADD(NOW(), INTERVAL ' . $days . ' DAY) AND DATE_ADD(`purchase_date`, INTERVAL `warranty_months` MONTH) > NOW()') ->orderByRaw('DATE_ADD(`purchase_date`,INTERVAL `warranty_months` MONTH)') diff --git a/config/version.php b/config/version.php index e8c421fe3..af8add2c6 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v8.0.2', - 'full_app_version' => 'v8.0.2 - build 17048-g44dd06161', - 'build_version' => '17048', + 'app_version' => 'v8.0.3', + 'full_app_version' => 'v8.0.3 - build 17154-ged8a48672', + 'build_version' => '17154', 'prerelease_version' => '', - 'hash_version' => 'g44dd06161', - 'full_hash' => 'v8.0.2-54-g44dd06161', + 'hash_version' => 'ged8a48672', + 'full_hash' => 'v8.0.3-99-ged8a48672', 'branch' => 'develop', ); \ No newline at end of file diff --git a/database/migrations/2025_02_26_153413_add_ldap_invert_active_flag_to_setting_table.php b/database/migrations/2025_02_26_153413_add_ldap_invert_active_flag_to_setting_table.php index c435e014c..7ca354bfe 100644 --- a/database/migrations/2025_02_26_153413_add_ldap_invert_active_flag_to_setting_table.php +++ b/database/migrations/2025_02_26_153413_add_ldap_invert_active_flag_to_setting_table.php @@ -12,7 +12,7 @@ return new class extends Migration public function up(): void { Schema::table('settings', function (Blueprint $table) { - $table->boolean('ldap_invert_active_flag')->default(false); + $table->boolean('ldap_invert_active_flag')->default(0); }); } diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 90469d872..a59b0534b 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -1211,7 +1211,11 @@ {{ $component->name }} {{ $component->pivot->assigned_qty }} - {{ trans('general.cost_each', ['amount' => Helper::formatCurrencyOutput($component->purchase_cost)]) }} + + @if ($component->purchase_cost!='') + {{ trans('general.cost_each', ['amount' => Helper::formatCurrencyOutput($component->purchase_cost)]) }} + @endif + {{ $component->serial }} {{ trans('general.checkin') }} diff --git a/resources/views/settings/ldap.blade.php b/resources/views/settings/ldap.blade.php index 9d4a19b01..62e430616 100644 --- a/resources/views/settings/ldap.blade.php +++ b/resources/views/settings/ldap.blade.php @@ -171,7 +171,9 @@
- {{ Form::label('ldap_client_tls_key', trans('admin/settings/general.ldap_client_tls_key')) }} +
- {{ Form::label('ldap_invert_active_flag', trans('admin/settings/general.ldap_invert_active_flag')) }} +
@error('ldap_invert_active_flag') - + {{ $message }} @enderror +

+ {!! trans('admin/settings/general.ldap_invert_active_flag_help') !!} +

+ @if (config('app.lock_passwords')===true)

- {{ trans('general.feature_disabled') }} + {!! trans('general.feature_disabled') !!}

@endif
+
diff --git a/tests/Feature/Notifications/Email/ExpiringAlertsNotificationTest.php b/tests/Feature/Notifications/Email/ExpiringAlertsNotificationTest.php index 5bc034ba5..1d91cf255 100644 --- a/tests/Feature/Notifications/Email/ExpiringAlertsNotificationTest.php +++ b/tests/Feature/Notifications/Email/ExpiringAlertsNotificationTest.php @@ -26,20 +26,21 @@ class ExpiringAlertsNotificationTest extends TestCase $alert_email = Setting::first()->alert_email; $expiringAsset = Asset::factory()->create([ - 'purchase_date' => now()->subMonths(11)->format('Y-m-d'), + 'purchase_date' => now()->subDays(350)->format('Y-m-d'), 'warranty_months' => 12, 'archived' => 0, 'deleted_at' => null, ]); $expiredAsset = Asset::factory()->create([ - 'purchase_date' => now()->subMonths(13)->format('Y-m-d'), + 'purchase_date' => now()->subDays(370)->format('Y-m-d'), 'warranty_months' => 12, 'archived' => 0, 'deleted_at' => null, ]); + $notExpiringAsset = Asset::factory()->create([ - 'purchase_date' => now()->subMonths(10)->format('Y-m-d'), + 'purchase_date' => now()->subDays(330)->format('Y-m-d'), 'warranty_months' => 12, 'archived' => 0, 'deleted_at' => null, diff --git a/tests/Feature/Settings/LdapSettingsTest.php b/tests/Feature/Settings/LdapSettingsTest.php index 317ccb42d..154a44138 100644 --- a/tests/Feature/Settings/LdapSettingsTest.php +++ b/tests/Feature/Settings/LdapSettingsTest.php @@ -28,6 +28,7 @@ class LdapSettingsTest extends TestCase 'ldap_basedn' => 'uid=', 'ldap_fname_field' => 'SomeFirstnameField', 'ldap_server' => 'ldaps://ldap.example.com', + 'ldap_invert_active_flag' => 0, ])) ->assertStatus(302) ->assertValid('ldap_enabled')