Added - ability to add custom footer text, hide user’s manual/support links

This commit is contained in:
snipe 2018-01-24 07:02:30 -08:00
parent 7579333ad3
commit 765295136a
6 changed files with 103 additions and 4 deletions

View file

@ -375,6 +375,8 @@ 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->footer_text = $request->input('footer_text');
$setting->show_url_in_emails = $request->input('show_url_in_emails', '0');

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddFooterSettingsToSettings extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->char('support_footer', 5)->nullable()->default('on');
$table->text('footer_text')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->text('support_footer');
$table->text('footer_text');
});
}
}

View file

@ -40,6 +40,8 @@ return array(
'alt_barcode_type' => '1D barcode type',
'eula_settings' => 'EULA Settings',
'eula_markdown' => 'This EULA allows <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
'footer_text' => 'Additional Footer Text ',
'footer_text_help' => 'This text will appear in the right-side footer. Links are allowed using <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>. Line breaks, headers, images, etc may result in unpredictable results.',
'general_settings' => 'General Settings',
'generate_backup' => 'Generate Backup',
'header_color' => 'Header Color',
@ -71,6 +73,7 @@ return array(
'ldap_active_flag' => 'LDAP Active Flag',
'ldap_emp_num' => 'LDAP Employee Number',
'ldap_email' => 'LDAP Email',
'license' => 'Software License',
'load_remote_text' => 'Remote Scripts',
'load_remote_help_text' => 'This Snipe-IT install can load scripts from the outside world.',
'login_note' => 'Login Note',
@ -103,6 +106,8 @@ return array(
'slack_integration' => 'Slack Settings',
'slack_integration_help' => 'Slack integration is optional, however the endpoint and channel are required if you wish to use it. To configure Slack integration, you must first <a href=":slack_link" target="_new">create an incoming webhook</a> on your Slack account.',
'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',
'system' => 'System Information',
'update' => 'Update Settings',
'value' => 'Value',

View file

@ -726,13 +726,25 @@
</div><!-- /.content-wrapper -->
<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->support_footer!='off')
@if (($snipeSettings->support_footer=='on') || (($snipeSettings->support_footer=='admin') && (Auth::user()->isSuperUser()=='1')))
<a target="_blank" class="btn btn-default btn-xs" href="https://snipe-it.readme.io/docs/overview" rel="noopener">User's Manual</a>
<a target="_blank" class="btn btn-default btn-xs" href="https://snipeitapp.com/support/" rel="noopener">Report a Bug</a>
@endif
@endif
</div>
<a target="_blank" href="https://snipeitapp.com" rel="noopener">Snipe-IT</a> is an open source
project, made with <i class="fa fa-heart" style="color: #a94442; font-size: 10px"></i> by <a href="https://twitter.com/snipeitapp" rel="noopener">@snipeitapp</a> under the <a href="https://www.gnu.org/licenses/agpl-3.0.en.html" rel="noopener">AGPL3 license</a>.
@if ($snipeSettings->footer_text!='')
<div class="pull-right">
{!! Parsedown::instance()->text(e($snipeSettings->footer_text)) !!}
</div>
@endif
<a target="_blank" href="https://snipeitapp.com" rel="noopener">Snipe-IT</a> is open source software, made with <i class="fa fa-heart" style="color: #a94442; font-size: 10px"></i> by <a href="https://twitter.com/snipeitapp" rel="noopener">@snipeitapp</a>.
</footer>

View file

@ -139,6 +139,42 @@
</div>
<!-- Support Footer -->
<div class="form-group {{ $errors->has('support_footer') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('support_footer', trans('admin/settings/general.support_footer')) }}
</div>
<div class="col-md-9">
@if (config('app.lock_passwords')===true)
{!! Form::select('support_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), Input::old('support_footer', $setting->support_footer), ['class' => 'form-control disabled', 'style'=>'width: 150px ;', 'disabled' => 'disabled']) !!}
@else
{!! Form::select('support_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), Input::old('support_footer', $setting->support_footer), array('class' => 'form-control', 'style'=>'width: 150px ;')) !!}
@endif
<p class="help-block">{{ trans('admin/settings/general.support_footer_help') }}</p>
{!! $errors->first('support_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">
{{ Form::label('custom_css', trans('admin/settings/general.footer_text')) }}
</div>
<div class="col-md-9">
@if (config('app.lock_passwords')===true)
{{ Form::textarea('footer_text', Input::old('footer_text', $setting->footer_text), array('class' => 'form-control', 'rows' => '4', 'placeholder' => 'Optional footer text','disabled'=>'disabled')) }}
<p class="help-block">{{ trans('general.lock_passwords') }}</p>
@else
{{ Form::textarea('footer_text', Input::old('footer_text', $setting->footer_text), array('class' => 'form-control','rows' => '4','placeholder' => 'Optional footer text')) }}
@endif
<p class="help-block">{!! trans('admin/settings/general.footer_text_help') !!}</p>
{!! $errors->first('footer_text', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
</div>

View file

@ -215,6 +215,12 @@
{{ config('version.app_version') }} build {{ config('version.build_version') }} ({{ config('version.hash_version') }})
</td>
</tr>
<tr>
<td>{{ trans('admin/settings/general.license') }}</td>
<td>
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html" rel="noopener">AGPL3</a>
</td>
</tr>
<tr>
<td>{{ trans('admin/settings/general.php') }}</td>
<td> {{ phpversion() }}</td>
@ -225,6 +231,10 @@
{{ $snipeSettings->lar_ver() }}
</td>
</tr>
</tbody>
</table>
</div>