Skip to content

Commit b6ad69f

Browse files
authored
Merge pull request #15793 from snipe/allow_eol_explicit
Allow user to specify null for calculation or explicit on bulk edit
2 parents 357ef7e + 47b2cdb commit b6ad69f

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

app/Http/Controllers/Assets/BulkAssetsController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,11 @@ public function update(Request $request) : RedirectResponse
321321

322322
if ($request->input('null_asset_eol_date')=='1') {
323323
$this->update_array['asset_eol_date'] = null;
324-
$this->update_array['eol_explicit'] = 1;
324+
325+
// If they are nulling the EOL date to allow it to calculate, set eol explicit to 0
326+
if ($request->input('calc_eol')=='1') {
327+
$this->update_array['eol_explicit'] = 0;
328+
}
325329
}
326330

327331

resources/lang/en-US/admin/hardware/form.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@
5959
'asset_deployable' => 'That status is deployable. This asset can be checked out.',
6060
'processing_spinner' => 'Processing... (This might take a bit of time on large files)',
6161
'optional_infos' => 'Optional Information',
62-
'order_details' => 'Order Related Information'
62+
'order_details' => 'Order Related Information',
63+
'calc_eol' => 'If nulling the EOL date, use automatic EOL calculation based on the purchase date and EOL rate.',
6364
];

resources/views/hardware/bulk.blade.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
</div>
9292
</div>
9393

94-
<!-- Purchase Date -->
94+
<!-- EOL Date -->
9595
<div class="form-group {{ $errors->has('asset_eol_date') ? ' has-error' : '' }}">
9696
<label for="eol_date" class="col-md-3 control-label">{{ trans('admin/hardware/form.eol_date') }}</label>
9797
<div class="col-md-4">
@@ -109,6 +109,15 @@
109109
</div>
110110
</div>
111111

112+
<div class="form-group">
113+
<div class="col-md-9 col-md-offset-3">
114+
<label class="form-control">
115+
{{ Form::checkbox('calc_eol', '1', false) }}
116+
{{ trans('admin/hardware/form.calc_eol') }}
117+
</label>
118+
</div>
119+
</div>
120+
112121

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

0 commit comments

Comments
 (0)