Skip to content

Commit 92d24d8

Browse files
authored
Merge pull request grokability#17277 from grokability/grokability#17264-add-notes-to-bulk
Fixed grokability#17264: add notes to bulk asset edit
2 parents 040cd7d + bcbfd46 commit 92d24d8

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

app/Http/Controllers/Assets/BulkAssetsController.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ public function update(Request $request) : RedirectResponse
281281
|| ($request->filled('null_expected_checkin_date'))
282282
|| ($request->filled('null_next_audit_date'))
283283
|| ($request->filled('null_asset_eol_date'))
284+
|| ($request->filled('null_notes'))
284285
|| ($request->anyFilled($custom_field_columns))
285286
|| ($request->anyFilled(array_keys($null_custom_fields_inputs)))
286287

@@ -305,7 +306,8 @@ public function update(Request $request) : RedirectResponse
305306
->conditionallyAddItem('supplier_id')
306307
->conditionallyAddItem('warranty_months')
307308
->conditionallyAddItem('next_audit_date')
308-
->conditionallyAddItem('asset_eol_date');
309+
->conditionallyAddItem('asset_eol_date')
310+
->conditionallyAddItem('notes');
309311
foreach ($custom_field_columns as $key => $custom_field_column) {
310312
$this->conditionallyAddItem($custom_field_column);
311313
}
@@ -362,6 +364,10 @@ public function update(Request $request) : RedirectResponse
362364
}
363365
}
364366

367+
if ($request->input('null_notes')=='1') {
368+
$this->update_array['notes'] = null;
369+
}
370+
365371

366372

367373
if ($request->filled('purchase_cost')) {

resources/views/hardware/bulk.blade.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,17 @@
251251
</div>
252252
</div>
253253

254+
@include ('partials.forms.edit.notes')
255+
<div class="form-group {{ $errors->has('null_notes') ? ' has-error' : '' }}">
256+
<div class="col-md-8 col-md-offset-3">
257+
<label class="form-control">
258+
<input type="checkbox" name="null_notes" value="1">
259+
{{ trans_choice('general.set_to_null', count($assets),['selection_count' => count($assets)]) }}
260+
</label>
261+
</div>
262+
</div>
263+
264+
254265
@include("models/custom_fields_form_bulk_edit",["models" => $models])
255266

256267
@foreach($assets as $asset)

resources/views/partials/forms/edit/notes.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="form-group{{ $errors->has('notes') ? ' has-error' : '' }}">
33
<label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>
44
<div class="col-md-7 col-sm-12">
5-
<textarea class="col-md-6 form-control" id="notes" aria-label="notes" name="notes" style="min-width:100%;">{{ old('notes', $item->notes) }}</textarea>
5+
<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>
66
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
77
</div>
88
</div>

0 commit comments

Comments
 (0)