Merge pull request #11594 from Godmartinz/adds_deleted_asset_options_to_custom_reports

Adds options to include Deleted assets to custom asset reports
This commit is contained in:
snipe 2022-08-02 10:33:57 -07:00 committed by GitHub
commit e3b13143bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 0 deletions

View file

@ -645,6 +645,12 @@ class ReportsController extends Controller
if($request->filled('exclude_archived')){
$assets->notArchived();
}
if($request->input('deleted_assets') == '1'){
$assets->withTrashed();
}
if($request->input('deleted_assets') == '0'){
$assets->onlyTrashed();
}
$assets->orderBy('assets.id', 'ASC')->chunk(20, function ($assets) use ($handle, $customfields, $request) {

View file

@ -102,6 +102,7 @@ return [
'email_domain_help' => 'This is used to generate email addresses when importing',
'error' => 'Error',
'exclude_archived' => 'Exclude Archived Assets',
'exclude_deleted' => 'Exclude Deleted Assets',
'example' => 'Example: ',
'filastname_format' => 'First Initial Last Name (jsmith@example.com)',
'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)',
@ -132,6 +133,7 @@ return [
'id' => 'ID',
'image' => 'Image',
'image_delete' => 'Delete Image',
'include_deleted' => 'Include Deleted Assets',
'image_upload' => 'Upload Image',
'filetypes_accepted_help' => 'Accepted filetype is :types. Max upload size allowed is :size.|Accepted filetypes are :types. Max upload size allowed is :size.',
'filetypes_size_help' => 'Max upload size allowed is :size.',
@ -185,6 +187,7 @@ return [
'no' => 'No',
'notes' => 'Notes',
'order_number' => 'Order Number',
'only_deleted' => 'Only Deleted Assets',
'page_menu' => 'Showing _MENU_ items',
'pagination_info' => 'Showing _START_ to _END_ of _TOTAL_ items',
'pending' => 'Pending',

View file

@ -352,6 +352,20 @@
</label>
</div>
<div class="col-md-9 col-md-offset-3">
<br>
<label for= "deleted_assets">
{{ Form::radio('deleted_assets', '', true, ['aria-label'=>'deleted_assets', 'class'=>'minimal'])}}
{{ trans('general.exclude_deleted') }}
<br>
{{ Form::radio('deleted_assets', '1', old('deleted_assets'), ['aria-label'=>'deleted_assets','class' => 'minimal']) }}
{{ trans('general.include_deleted') }}
<br>
{{ Form::radio('deleted_assets', '0', old('deleted_assets'), ['aria-label'=>'deleted_assets','class' => 'minimal']) }}
{{ trans('general.only_deleted') }}
</label>
</div>
</div>