A free open source IT asset/license management system
Added ability to disable the alert icon in the top menu
snipe35ee52212f1f
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.phpindex 4223ea02cf..810d610d67 100755--- a/app/Http/Controllers/SettingsController.php+++ b/app/Http/Controllers/SettingsController.php@@ -552,6 +552,7 @@ class SettingsController extends Controller$setting->alert_threshold = $request->input('alert_threshold');$setting->audit_interval = $request->input('audit_interval');$setting->audit_warning_days = $request->input('audit_warning_days');+ $setting->show_alerts_in_menu = $request->input('show_alerts_in_menu', '0');if ($setting->save()) {return redirect()->route('settings.index')diff --git a/database/migrations/2017_11_08_025918_add_alert_menu_setting.php b/database/migrations/2017_11_08_025918_add_alert_menu_setting.phpnew file mode 100644index 0000000000..5833f157c3--- /dev/null+++ b/database/migrations/2017_11_08_025918_add_alert_menu_setting.php@@ -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');+ });+ }+}diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.phpindex 63c3d473f0..d6b6abbc23 100644--- a/resources/lang/en/admin/settings/general.php+++ b/resources/lang/en/admin/settings/general.php@@ -6,7 +6,7 @@ return array('ad_domain_help' => 'This is sometimes the same as your email domain, but not always.','is_ad' => 'This is an Active Directory server','alert_email' => 'Send alerts to',- 'alerts_enabled' => 'Alerts Enabled',+ 'alerts_enabled' => 'Email Alerts Enabled','alert_interval' => 'Expiring Alerts Threshold (in days)','alert_inv_threshold' => 'Inventory Alert Threshold','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.','default_currency' => 'Default Currency','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.','display_asset_name' => 'Display Asset Name','display_checkout_date' => 'Display Checkout Date',@@ -91,6 +91,7 @@ return array('qr_text' => 'QR Code Text','setting' => 'Setting','settings' => 'Settings',+ 'show_alerts_in_menu' => 'Show alerts in top menu','site_name' => 'Site Name','slack_botname' => 'Slack Botname','slack_channel' => 'Slack Channel',diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.phpindex 0a4e347b70..9b11df8001 100644--- a/resources/views/layouts/default.blade.php+++ b/resources/views/layouts/default.blade.php@@ -239,6 +239,7 @@@endcan@can('admin')+ @if ($snipeSettings->show_alerts_in_menu=='1')<!-- Tasks: style can be found in dropdown.less --><?php $alert_items = \App\Helpers\Helper::checkLowInventory(); ?>@@ -281,6 +282,7 @@</ul></li>@endcan+ @endif<!-- User Account: style can be found in dropdown.less -->diff --git a/resources/views/settings/alerts.blade.php b/resources/views/settings/alerts.blade.phpindex bf1ccdc7ad..57041a9706 100644--- a/resources/views/settings/alerts.blade.php+++ b/resources/views/settings/alerts.blade.php@@ -47,7 +47,18 @@</div><div class="col-md-5">{{ 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>