Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2024-09-25 10:52:19 +01:00
commit a425c2b765
3 changed files with 35 additions and 33 deletions

View file

@ -56,6 +56,11 @@ class AssetsController extends Controller
public function index(Request $request, $action = null, $upcoming_status = null) : JsonResponse | array
{
// This handles the legacy audit endpoints :(
if ($action == 'audit') {
$action = 'audits';
}
$filter_non_deprecable_assets = false;
/**
@ -154,8 +159,8 @@ class AssetsController extends Controller
* Handle due and overdue audits and checkin dates
*/
switch ($action) {
case 'audits':
// Audit (singular) is left over from earlier legacy APIs
case 'audits' :
switch ($upcoming_status) {
case 'due':
$assets->DueForAudit($settings);

View file

@ -356,21 +356,22 @@
<h2 class="box-title">{{ trans('admin/settings/general.system') }}</h2>
</div>
<div class="box-body">
<div class="container row row-striped" style="width:97%">
<div class="row" style="margin-right:4px;">
<div class="row row-new-striped" style="line-height: 23px;">
<!-- row -->
<div class="row">
<div class="col-md-2">
<div class="col-md-2" style="padding-top: 3px; padding-bottom: 3px;">
<strong>{{ trans('admin/settings/general.snipe_version') }}:</strong>
</div>
<div class="col-md-4">
{{ config('version.app_version') }} build {{ config('version.build_version') }} ({{ config('version.hash_version') }})
<div class="col-md-4" style="padding-top: 3px; padding-bottom: 3px;">
{{ config('version.app_version') }} build {{ config('version.build_version') }} ({{ config('version.hash_version') }})
</div>
<div class="col-md-2">
<div class="col-md-2" style="padding-top: 3px; padding-bottom: 3px;">
<strong>{{ trans('admin/settings/general.license') }}:</strong>
</div>
<div class="col-md-4">
<div class="col-md-4" style="padding-top: 3px; padding-bottom: 3px;">
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html" rel="noopener">AGPL3</a>
</div>
</div>
@ -378,52 +379,52 @@
<!-- row -->
<div class="row">
<div class="col-md-2">
<div class="col-md-2" style="padding-top: 3px; padding-bottom: 3px;">
<strong>{{ trans('admin/settings/general.php') }}:</strong>
</div>
<div class="col-md-4">
<div class="col-md-4" style="padding-top: 3px; padding-bottom: 3px;">
{{ phpversion() }}
</div>
<div class="col-md-2">
<div class="col-md-2" style="padding-top: 3px; padding-bottom: 3px;">
<strong>{{ trans('admin/settings/general.laravel') }}:</strong>
</div>
<div class="col-md-4">
<div class="col-md-4" style="padding-top: 3px; padding-bottom: 3px;">
{{ $snipeSettings->lar_ver() }}
</div>
</div>
<!-- row -->
<div class="row">
<div class="col-md-2">
<div class="col-md-2" style="padding-top: 3px; padding-bottom: 3px;">
<strong>{{ trans('admin/settings/general.timezone') }}:</strong>
</div>
<div class="col-md-4">
<div class="col-md-4" style="padding-top: 3px; padding-bottom: 3px;">
{{ config('app.timezone') }}
</div>
<div class="col-md-2">
<div class="col-md-2" style="padding-top: 3px; padding-bottom: 3px;">
<strong>{{ trans('admin/settings/general.database_driver') }}:</strong>
</div>
<div class="col-md-4">
<div class="col-md-4" style="padding-top: 3px; padding-bottom: 3px;">
{{ config('database.default') }}
</div>
</div>
<!-- row -->
<div class="row">
<div class="col-md-2">
<div class="col-md-2" style="padding-top: 3px; padding-bottom: 3px;">
<strong>{{ trans('admin/settings/general.mail_from') }}:</strong>
</div>
<div class="col-md-4">
<div class="col-md-4" style="padding-top: 3px; padding-bottom: 3px;">
{{ config('mail.from.name') }}
<code>&lt;{{ config('mail.from.address') }}&gt;</code>
</div>
<div class="col-md-2">
<div class="col-md-2" style="padding-top: 3px; padding-bottom: 3px;">
<strong>{{ trans('admin/settings/general.mail_reply_to') }}:</strong>
</div>
<div class="col-md-4">
<div class="col-md-4" style="padding-top: 3px; padding-bottom: 3px;">
{{ config('mail.reply_to.name') }}
<code>&lt;{{ config('mail.reply_to.address') }}&gt;</code>
</div>
@ -431,15 +432,18 @@
<!-- row -->
<div class="row">
<div class="col-md-2">
<div class="col-md-2" style="padding-top: 3px; padding-bottom: 3px;">
<strong>{{ trans('admin/settings/general.bs_table_storage') }}:</strong>
</div>
<div class="col-md-10">
<div class="col-md-4" style="padding-top: 3px; padding-bottom: 3px;">
{{ config('session.bs_table_storage') }}
</div>
<div class="col-md-2">
</div>
<div class="col-md-4">
</div>
</div>
</div>
</div>
</div>
<!--/ row -->

View file

@ -495,24 +495,17 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi
)->name('api.assets.show.byserial')
->where('any', '.*');
// LEGACY URL - Get assets that are due or overdue for audit
Route::get('audit/{status}',
[
Api\AssetsController::class,
'index'
]
)->name('api.asset.to-audit');
// This gets the "due or overdue" API endpoints for audits and checkins
// This gets the "due or overdue" API endpoints for audit/audits and checkins
Route::get('{action}/{upcoming_status}',
[
Api\AssetsController::class,
'index'
]
)->name('api.assets.list-upcoming')
->where(['action' => 'audits|checkins', 'upcoming_status' => 'due|overdue|due-or-overdue']);
->where(['action' => 'audit|audits|checkins', 'upcoming_status' => 'due|overdue|due-or-overdue']);