Make version footer configurable. (#5730)

This commit is contained in:
Djamon Staal 2018-06-21 16:12:16 +02:00 committed by snipe
parent fa465a84df
commit 32e3f748d8
5 changed files with 55 additions and 1 deletions

View file

@ -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');

View file

@ -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');
});
}
}

View file

@ -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',

View file

@ -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')))

View file

@ -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">