A free open source IT asset/license management system
Added - ability to add custom footer text, hide user’s manual/support links
snipe765295136add
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.phpindex 807f5466f8..a5f50e5bd8 100755--- a/app/Http/Controllers/SettingsController.php+++ b/app/Http/Controllers/SettingsController.php@@ -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');diff --git a/database/migrations/2018_01_24_062633_add_footer_settings_to_settings.php b/database/migrations/2018_01_24_062633_add_footer_settings_to_settings.phpnew file mode 100644index 0000000000..5b9de3ce59--- /dev/null+++ b/database/migrations/2018_01_24_062633_add_footer_settings_to_settings.php@@ -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');+ });+ }+}diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.phpindex 76159635b1..012cedb08a 100644--- a/resources/lang/en/admin/settings/general.php+++ b/resources/lang/en/admin/settings/general.php@@ -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',diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.phpindex ab99bba216..ca83c89232 100644--- a/resources/views/layouts/default.blade.php+++ b/resources/views/layouts/default.blade.php@@ -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') }})- <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>++ @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>diff --git a/resources/views/settings/branding.blade.php b/resources/views/settings/branding.blade.phpindex ec0ed0b531..1f724f9ebc 100644--- a/resources/views/settings/branding.blade.php+++ b/resources/views/settings/branding.blade.php@@ -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>diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.phpindex 103b6751ae..c17f4013b9 100755--- a/resources/views/settings/index.blade.php+++ b/resources/views/settings/index.blade.php@@ -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>