mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-12 16:44:08 -08:00
Added ability to disable the alert icon in the top menu
This commit is contained in:
parent
e9e32fdb00
commit
35ee52212f
|
@ -552,6 +552,7 @@ class SettingsController extends Controller
|
||||||
$setting->alert_threshold = $request->input('alert_threshold');
|
$setting->alert_threshold = $request->input('alert_threshold');
|
||||||
$setting->audit_interval = $request->input('audit_interval');
|
$setting->audit_interval = $request->input('audit_interval');
|
||||||
$setting->audit_warning_days = $request->input('audit_warning_days');
|
$setting->audit_warning_days = $request->input('audit_warning_days');
|
||||||
|
$setting->show_alerts_in_menu = $request->input('show_alerts_in_menu', '0');
|
||||||
|
|
||||||
if ($setting->save()) {
|
if ($setting->save()) {
|
||||||
return redirect()->route('settings.index')
|
return redirect()->route('settings.index')
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class AddAlertMenuSetting extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('settings', function (Blueprint $table) {
|
||||||
|
$table->boolean('show_alerts_in_menu')->default(1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('settings', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('show_alerts_in_menu');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,7 @@ return array(
|
||||||
'ad_domain_help' => 'This is sometimes the same as your email domain, but not always.',
|
'ad_domain_help' => 'This is sometimes the same as your email domain, but not always.',
|
||||||
'is_ad' => 'This is an Active Directory server',
|
'is_ad' => 'This is an Active Directory server',
|
||||||
'alert_email' => 'Send alerts to',
|
'alert_email' => 'Send alerts to',
|
||||||
'alerts_enabled' => 'Alerts Enabled',
|
'alerts_enabled' => 'Email Alerts Enabled',
|
||||||
'alert_interval' => 'Expiring Alerts Threshold (in days)',
|
'alert_interval' => 'Expiring Alerts Threshold (in days)',
|
||||||
'alert_inv_threshold' => 'Inventory Alert Threshold',
|
'alert_inv_threshold' => 'Inventory Alert Threshold',
|
||||||
'asset_ids' => 'Asset IDs',
|
'asset_ids' => 'Asset IDs',
|
||||||
|
@ -27,7 +27,7 @@ return array(
|
||||||
'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.',
|
'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.',
|
||||||
'default_currency' => 'Default Currency',
|
'default_currency' => 'Default Currency',
|
||||||
'default_eula_text' => 'Default EULA',
|
'default_eula_text' => 'Default EULA',
|
||||||
'default_language' => 'Default Language',
|
'default_language' => 'Default Language',
|
||||||
'default_eula_help_text' => 'You can also associate custom EULAs to specific asset categories.',
|
'default_eula_help_text' => 'You can also associate custom EULAs to specific asset categories.',
|
||||||
'display_asset_name' => 'Display Asset Name',
|
'display_asset_name' => 'Display Asset Name',
|
||||||
'display_checkout_date' => 'Display Checkout Date',
|
'display_checkout_date' => 'Display Checkout Date',
|
||||||
|
@ -91,6 +91,7 @@ return array(
|
||||||
'qr_text' => 'QR Code Text',
|
'qr_text' => 'QR Code Text',
|
||||||
'setting' => 'Setting',
|
'setting' => 'Setting',
|
||||||
'settings' => 'Settings',
|
'settings' => 'Settings',
|
||||||
|
'show_alerts_in_menu' => 'Show alerts in top menu',
|
||||||
'site_name' => 'Site Name',
|
'site_name' => 'Site Name',
|
||||||
'slack_botname' => 'Slack Botname',
|
'slack_botname' => 'Slack Botname',
|
||||||
'slack_channel' => 'Slack Channel',
|
'slack_channel' => 'Slack Channel',
|
||||||
|
|
|
@ -239,6 +239,7 @@
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
@can('admin')
|
@can('admin')
|
||||||
|
@if ($snipeSettings->show_alerts_in_menu=='1')
|
||||||
<!-- Tasks: style can be found in dropdown.less -->
|
<!-- Tasks: style can be found in dropdown.less -->
|
||||||
<?php $alert_items = \App\Helpers\Helper::checkLowInventory(); ?>
|
<?php $alert_items = \App\Helpers\Helper::checkLowInventory(); ?>
|
||||||
|
|
||||||
|
@ -281,6 +282,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@endcan
|
@endcan
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
<!-- User Account: style can be found in dropdown.less -->
|
<!-- User Account: style can be found in dropdown.less -->
|
||||||
|
|
|
@ -47,7 +47,18 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
{{ Form::checkbox('alerts_enabled', '1', Input::old('alerts_enabled', $setting->alerts_enabled),array('class' => 'minimal')) }}
|
{{ Form::checkbox('alerts_enabled', '1', Input::old('alerts_enabled', $setting->alerts_enabled),array('class' => 'minimal')) }}
|
||||||
{{ trans('admin/settings/general.alerts_enabled') }}
|
{{ trans('general.yes') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Menu Alerts Enabled -->
|
||||||
|
<div class="form-group {{ $errors->has('show_alerts_in_menu') ? 'error' : '' }}">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ Form::label('show_alerts_in_menu', trans('admin/settings/general.show_alerts_in_menu')) }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
{{ Form::checkbox('show_alerts_in_menu', '1', Input::old('show_alerts_in_menu', $setting->show_alerts_in_menu),array('class' => 'minimal')) }}
|
||||||
|
{{ trans('general.yes') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue