A free open source IT asset/license management system
Make version footer configurable. (#5730)
Djamon Staal32e3f748d8e1
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.phpindex d2c8fe25d8..1557991c01 100755--- a/app/Http/Controllers/SettingsController.php+++ b/app/Http/Controllers/SettingsController.php@@ -396,6 +396,7 @@ class SettingsController extends Controller$setting->brand = $request->input('brand', '1');$setting->header_color = $request->input('header_color');$setting->support_footer = $request->input('support_footer');+ $setting->version_footer = $request->input('version_footer');$setting->footer_text = $request->input('footer_text');$setting->skin = $request->input('skin');$setting->show_url_in_emails = $request->input('show_url_in_emails', '0');diff --git a/database/migrations/2018_06_21_134622_add_version_footer.php b/database/migrations/2018_06_21_134622_add_version_footer.phpnew file mode 100755index 0000000000..cb40cd6c3a--- /dev/null+++ b/database/migrations/2018_06_21_134622_add_version_footer.php@@ -0,0 +1,29 @@+<?php+use Illuminate\Support\Facades\Schema;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Database\Migrations\Migration;+class AddVersionFooter extends Migration+{+ /**+ * Run the migrations.+ *+ * @return void+ */+ public function up()+ {+ Schema::table('settings', function (Blueprint $table) {+ $table->char('version_footer', 5)->nullable()->default('on');+ });+ }+ /**+ * Reverse the migrations.+ *+ * @return void+ */+ public function down()+ {+ Schema::table('settings', function (Blueprint $table) {+ $table->dropColumn('version_footer');+ });+ }+}diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.phpindex 753fbb0d71..281fa0d5cb 100644--- a/resources/lang/en/admin/settings/general.php+++ b/resources/lang/en/admin/settings/general.php@@ -122,6 +122,8 @@ return array('snipe_version' => 'Snipe-IT version','support_footer' => 'Support Footer Links ','support_footer_help' => 'Specify who sees the links to the Snipe-IT Support info and Users Manual',+ 'version_footer' => 'Version in Footer ',+ 'version_footer_help' => 'Specify who sees the Snipe-IT version and build number.','system' => 'System Information','update' => 'Update Settings','value' => 'Value',diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.phpindex 31e219b1c6..884a69b139 100644--- a/resources/views/layouts/default.blade.php+++ b/resources/views/layouts/default.blade.php@@ -741,7 +741,11 @@<footer class="main-footer hidden-print"><div class="pull-right hidden-xs">- <b>Version</b> {{ config('version.app_version') }} - build {{ config('version.build_version') }} ({{ config('version.branch') }})+ @if ($snipeSettings->version_footer!='off')+ @if (($snipeSettings->version_footer=='on') || (($snipeSettings->version_footer=='admin') && (Auth::user()->isSuperUser()=='1')))+ <b>Version</b> {{ config('version.app_version') }} - build {{ config('version.build_version') }} ({{ config('version.branch') }})+ @endif+ @endif@if ($snipeSettings->support_footer!='off')@if (($snipeSettings->support_footer=='on') || (($snipeSettings->support_footer=='admin') && (Auth::user()->isSuperUser()=='1')))diff --git a/resources/views/settings/branding.blade.php b/resources/views/settings/branding.blade.phpindex d8a0c2d47b..2c9ffad12b 100644--- a/resources/views/settings/branding.blade.php+++ b/resources/views/settings/branding.blade.php@@ -168,6 +168,24 @@</div></div>++ <!-- Version Footer -->+ <div class="form-group {{ $errors->has('version_footer') ? 'error' : '' }}">+ <div class="col-md-3">+ {{ Form::label('version_footer', trans('admin/settings/general.version_footer')) }}+ </div>+ <div class="col-md-9">+ @if (config('app.lock_passwords')===true)+ {!! Form::select('version_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), Input::old('version_footer', $setting->version_footer), ['class' => 'form-control disabled', 'style'=>'width: 150px ;', 'disabled' => 'disabled']) !!}+ @else+ {!! Form::select('version_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), Input::old('version_footer', $setting->version_footer), array('class' => 'form-control', 'style'=>'width: 150px ;')) !!}+ @endif++ <p class="help-block">{{ trans('admin/settings/general.version_footer_help') }}</p>+ {!! $errors->first('version_footer', '<span class="alert-msg">:message</span>') !!}+ </div>+ </div>+<!-- Additional footer --><div class="form-group {{ $errors->has('footer_text') ? 'error' : '' }}"><div class="col-md-3">