Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Nov 10, 2024
2 parents c6b9556 + 357ef7e commit 7596717
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/Http/Controllers/Assets/BulkAssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,12 @@ public function update(Request $request) : RedirectResponse
|| ($request->filled('status_id'))
|| ($request->filled('model_id'))
|| ($request->filled('next_audit_date'))
|| ($request->filled('asset_eol_date'))
|| ($request->filled('null_name'))
|| ($request->filled('null_purchase_date'))
|| ($request->filled('null_expected_checkin_date'))
|| ($request->filled('null_next_audit_date'))
|| ($request->filled('null_asset_eol_date'))
|| ($request->anyFilled($custom_field_columns))

) {
Expand All @@ -271,7 +273,8 @@ public function update(Request $request) : RedirectResponse
->conditionallyAddItem('requestable')
->conditionallyAddItem('supplier_id')
->conditionallyAddItem('warranty_months')
->conditionallyAddItem('next_audit_date');
->conditionallyAddItem('next_audit_date')
->conditionallyAddItem('asset_eol_date');
foreach ($custom_field_columns as $key => $custom_field_column) {
$this->conditionallyAddItem($custom_field_column);
}
Expand Down Expand Up @@ -316,6 +319,13 @@ public function update(Request $request) : RedirectResponse
$this->update_array['next_audit_date'] = null;
}

if ($request->input('null_asset_eol_date')=='1') {
$this->update_array['asset_eol_date'] = null;
$this->update_array['eol_explicit'] = 1;
}



if ($request->filled('purchase_cost')) {
$this->update_array['purchase_cost'] = $request->input('purchase_cost');
}
Expand Down
18 changes: 18 additions & 0 deletions resources/views/hardware/bulk.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@
</div>
</div>

<!-- Purchase Date -->
<div class="form-group {{ $errors->has('asset_eol_date') ? ' has-error' : '' }}">
<label for="eol_date" class="col-md-3 control-label">{{ trans('admin/hardware/form.eol_date') }}</label>
<div class="col-md-4">
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="asset_eol_date" id="asset_eol_date" value="{{ old('asset_eol_date') }}">
<span class="input-group-addon"><x-icon type="calendar" /></span>
</div>
{!! $errors->first('asset_eol_date', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
</div>
<div class="col-md-5">
<label class="form-control">
{{ Form::checkbox('null_asset_eol_date', '1', false) }}
{{ trans_choice('general.set_to_null', count($assets),['selection_count' => count($assets)]) }}
</label>
</div>
</div>


<!-- Status -->
<div class="form-group {{ $errors->has('status_id') ? ' has-error' : '' }}">
Expand Down

0 comments on commit 7596717

Please sign in to comment.