Merge pull request #9889 from ncareau/api-licenses

Add licenses api parameters and fix a missing variable in license view.
This commit is contained in:
snipe 2021-10-28 17:20:09 -07:00 committed by GitHub
commit 645529ba78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View file

@ -76,6 +76,18 @@ class LicensesController extends Controller
$licenses->where('supplier_id', '=', $request->input('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')) { if ($request->filled('search')) {
$licenses = $licenses->TextSearch($request->input('search')); $licenses = $licenses->TextSearch($request->input('search'));
} }

View file

@ -338,6 +338,17 @@
</div> </div>
@endif @endif
<div class="row">
<div class="col-md-4">
<strong>
{{ trans('admin/licenses/form.maintained') }}
</strong>
</div>
<div class="col-md-8">
{{ $license->maintained ? 'Yes' : 'No' }}
</div>
</div>
@if (($license->seats) && ($license->seats) > 0) @if (($license->seats) && ($license->seats) > 0)
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">