Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added #15312: Add checkin due in days setting #15314

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ public function postAlerts(Request $request) : RedirectResponse
$setting->alert_threshold = $request->input('alert_threshold');
$setting->audit_interval = $request->input('audit_interval');
$setting->audit_warning_days = $request->input('audit_warning_days');
$setting->due_checkin_days = $request->input('due_checkin_days');
$setting->show_alerts_in_menu = $request->input('show_alerts_in_menu', '0');

if ($setting->save()) {
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ public function scopeDueOrOverdueForAudit($query, $settings)

public function scopeDueForCheckin($query, $settings)
{
$interval = $settings->audit_warning_days ?? 0;
$interval = $settings->due_checkin_days ?? 0;
$today = Carbon::now();
$interval_date = $today->copy()->addDays($interval)->format('Y-m-d');

Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en-US/admin/settings/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,5 +379,7 @@
'default_avatar_help' => 'This image will be displayed as a profile if a user does not have a profile photo.',
'restore_default_avatar' => 'Restore <a href=":default_avatar" data-toggle="lightbox" data-type="image">original system default avatar</a>',
'restore_default_avatar_help' => '',
'due_checkin_days' => 'Due For Checkin Warning',
'due_checkin_days_help' => 'How many days before the expected checkin of an asset should it be listed in the "Due for checkin" page?',

];
2 changes: 1 addition & 1 deletion resources/views/hardware/checkin-due.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{-- Page title --}}
@section('title')
{{ trans_choice('general.checkin_due_days', $settings->audit_warning_days, ['days' => $settings->audit_warning_days]) }}
{{ trans_choice('general.checkin_due_days', $settings->due_checkin_days, ['days' => $settings->due_checkin_days]) }}
@stop

{{-- Page content --}}
Expand Down
19 changes: 19 additions & 0 deletions resources/views/settings/alerts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,25 @@
</div>
</div>

<!-- Due for checkin days -->
<div class="form-group {{ $errors->has('due_checkin_days') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('due_checkin_days', trans('admin/settings/general.due_checkin_days')) }}
</div>
<div class="input-group col-md-2">
{{ Form::text('due_checkin_days', old('due_checkin_days', $setting->due_checkin_days), array('class' => 'form-control','placeholder' => '14', 'maxlength'=>'3', 'style'=>'width: 60px;')) }}
<span class="input-group-addon">{{ trans('general.days') }}</span>




</div>
<div class="col-md-9 col-md-offset-3">
{!! $errors->first('due_checkin_days', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">{{ trans('admin/settings/general.due_checkin_days_help') }}</p>
</div>
</div>

</div>

</div> <!--/.box-body-->
Expand Down
Loading