Compare commits

...

5 Commits

Author SHA1 Message Date
snipe cc353153d2 Added OpenDyslexic as a font option 2026-05-09 13:36:58 +01:00
snipe da6e837578 Merge pull request #18991 from uberbrady/better_scim_errors
Fixed #18987 - fix SCIM error on mismapped fields
2026-05-08 14:25:02 +01:00
snipe e36d65e695 Use carbon instead 2026-05-08 14:21:07 +01:00
snipe dda7a4f22f Format dates in custom report 2026-05-08 14:12:15 +01:00
Brady Wetherington 283a885196 Get rid of 'setCode' and just use the constructor parameter instead 2026-05-08 13:15:37 +01:00
13 changed files with 89 additions and 5 deletions
@@ -63,6 +63,7 @@ class ProfileController extends Controller
$user->enable_sounds = $request->input('enable_sounds', false);
$user->enable_confetti = $request->input('enable_confetti', false);
$user->accessible_font = $request->input('accessible_font') ?: null;
$user->link_light_color = $request->input('link_light_color', '#296282');
$user->link_dark_color = $request->input('link_dark_color', '#296282');
$user->nav_link_color = $request->input('nav_link_color', '#FFFFFF');
+2 -2
View File
@@ -852,7 +852,7 @@ class ReportsController extends Controller
}
if ($request->filled('purchase_date')) {
$row[] = ($asset->purchase_date) ? $asset->purchase_date : '';
$row[] = ($asset->purchase_date) ? Carbon::parse($asset->purchase_date)->format('Y-m-d') : '';
}
if ($request->filled('purchase_cost')) {
@@ -860,7 +860,7 @@ class ReportsController extends Controller
}
if ($request->filled('eol')) {
$row[] = ($asset->asset_eol_date != '') ? $asset->asset_eol_date : '';
$row[] = ($asset->asset_eol_date != '') ? Carbon::parse($asset->asset_eol_date)->format('Y-m-d') : '';
}
if ($request->filled('warranty')) {
+3 -3
View File
@@ -302,11 +302,11 @@ class SnipeSCIMConfig
// addresses[type eq "work"]
$matches = null;
if (!preg_match('/^.+\[type eq "([a-zA-Z]+)"](?:\.([a-zA-Z]+))?$/', (string)$path, $matches)) {
throw new SCIMException("Unknown path type '$path'")->setCode(422);
throw new SCIMException("Unknown path type '$path'", 422);
}
$type = $matches[1];
if ($type != 'work') {
throw new SCIMException("Unknown object type '$type'")->setCode(422);
throw new SCIMException("Unknown object type '$type'", 422);
}
$attribute = array_key_exists(2, $matches) ? $matches[2] : null;
if (array_key_exists($attribute, self::$addressmap)) {
@@ -315,7 +315,7 @@ class SnipeSCIMConfig
}
throw new SCIMException("Could not handle path for update $path")->setCode(422);
throw new SCIMException("Could not handle path for update $path", 422);
}
}
+1
View File
@@ -92,6 +92,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
'vip',
'autoassign_licenses',
'website',
'accessible_font',
];
protected $casts = [
@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->text('accessible_font')->nullable()->default(null)->after('website');
});
}
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('accessible_font');
});
}
};
Binary file not shown.
@@ -0,0 +1,27 @@
@font-face {
font-family: 'OpenDyslexic';
src: url('OpenDyslexic-Regular.otf') format('opentype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'OpenDyslexic !important';
src: url('OpenDyslexic-Bold.otf') format('opentype');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'OpenDyslexic';
src: url('OpenDyslexic-Italic.otf') format('opentype');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'OpenDyslexic';
src: url('OpenDyslexic-BoldItalic.otf') format('opentype');
font-weight: bold;
font-style: italic;
}
+1
View File
@@ -3,6 +3,7 @@
return [
'show_all' => 'Show All',
'2FA_reset' => '2FA reset',
'accessible_font' => 'Accessible Font',
'accessories' => 'Accessories',
'activated' => 'Activated',
'login_status' => 'Login Status',
+12
View File
@@ -37,6 +37,18 @@
</div>
</div>
<!-- Accessible Font -->
<div class="form-group {{ $errors->has('accessible_font') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="accessible_font">{{ trans('general.accessible_font') }}</label>
<div class="col-md-6">
<select name="accessible_font" id="accessible_font" class="select2" style="width: 100%">
<option value="">{{ trans('general.system_default') }}</option>
<option value="opendyslexic" {{ old('accessible_font', $user->accessible_font) === 'opendyslexic' ? 'selected' : '' }}>OpenDyslexic</option>
</select>
{!! $errors->first('accessible_font', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
<!-- Nav Link color -->
<div class="form-group {{ $errors->has('nav_link_color') ? 'error' : '' }}">
<label for="nav_link_color" class="col-md-3 control-label">{{ trans('admin/settings/general.nav_link_color') }}</label>
+20
View File
@@ -1154,6 +1154,26 @@
<script src="{{ url(asset('js/html5shiv.js')) }}" nonce="{{ csrf_token() }}"></script>
<script src="{{ url(asset('js/respond.js')) }}" nonce="{{ csrf_token() }}"></script>
@auth
@if(auth()->user()->accessible_font === 'opendyslexic')
<link rel="stylesheet" href="{{ asset('css/fonts/opendyslexic/opendyslexic.css') }}">
<style nonce="{{ csrf_token() }}">
body, body * {
font-family: 'OpenDyslexic', sans-serif !important;
}
.fa, .fa-classic, .fas, .fa-solid, .far, .fa-regular {
font-family: "Font Awesome 6 Free" !important;
}
.fa-brands, .fab {
font-family: "Font Awesome 6 Brands" !important;
}
</style>
@endif
@endauth
</head>