Merge pull request #17277 from grokability/#17264-add-notes-to-bulk

Fixed #17264: add notes to bulk asset edit
This commit is contained in:
snipe
2025-06-23 12:36:50 +01:00
committed by GitHub
3 changed files with 19 additions and 2 deletions

View File

@@ -281,6 +281,7 @@ class BulkAssetsController extends Controller
|| ($request->filled('null_expected_checkin_date'))
|| ($request->filled('null_next_audit_date'))
|| ($request->filled('null_asset_eol_date'))
|| ($request->filled('null_notes'))
|| ($request->anyFilled($custom_field_columns))
|| ($request->anyFilled(array_keys($null_custom_fields_inputs)))
@@ -305,7 +306,8 @@ class BulkAssetsController extends Controller
->conditionallyAddItem('supplier_id')
->conditionallyAddItem('warranty_months')
->conditionallyAddItem('next_audit_date')
->conditionallyAddItem('asset_eol_date');
->conditionallyAddItem('asset_eol_date')
->conditionallyAddItem('notes');
foreach ($custom_field_columns as $key => $custom_field_column) {
$this->conditionallyAddItem($custom_field_column);
}
@@ -362,6 +364,10 @@ class BulkAssetsController extends Controller
}
}
if ($request->input('null_notes')=='1') {
$this->update_array['notes'] = null;
}
if ($request->filled('purchase_cost')) {

View File

@@ -251,6 +251,17 @@
</div>
</div>
@include ('partials.forms.edit.notes')
<div class="form-group {{ $errors->has('null_notes') ? ' has-error' : '' }}">
<div class="col-md-8 col-md-offset-3">
<label class="form-control">
<input type="checkbox" name="null_notes" value="1">
{{ trans_choice('general.set_to_null', count($assets),['selection_count' => count($assets)]) }}
</label>
</div>
</div>
@include("models/custom_fields_form_bulk_edit",["models" => $models])
@foreach($assets as $asset)

View File

@@ -2,7 +2,7 @@
<div class="form-group{{ $errors->has('notes') ? ' has-error' : '' }}">
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
<div class="col-md-7 col-sm-12">
<textarea class="col-md-6 form-control" id="notes" aria-label="notes" name="notes" style="min-width:100%;">{{ old('notes', $item->notes) }}</textarea>
<textarea class="col-md-6 form-control" id="notes" aria-label="notes" name="notes" style="min-width:100%;">{{ old('notes', (isset($item) ? $item->notes : '')) }}</textarea>
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>