Fixed #5477 - added GDPR privacy policy link in email and webpage

This commit is contained in:
snipe 2018-05-08 00:50:13 -07:00
parent f48171dcab
commit 04709dc1df
11 changed files with 98 additions and 23 deletions

View file

@ -347,6 +347,7 @@ class SettingsController extends Controller
$setting->default_eula_text = $request->input('default_eula_text');
$setting->thumbnail_max_h = $request->input('thumbnail_max_h');
$setting->privacy_policy_link = $request->input('privacy_policy_link');
if (Input::get('per_page')!='') {
$setting->per_page = $request->input('per_page');

View file

@ -76,7 +76,7 @@ trait Loggable
$checkoutClass = null;
if (method_exists($target, 'notify')) {
\Log::debug('This target is notifiable');
// \Log::debug('This target is notifiable');
$target->notify(new static::$checkoutClass($params));
}
@ -84,7 +84,7 @@ trait Loggable
$recipient = new \App\Models\Recipients\AdminRecipient();
if (($settings->admin_cc_email!='') && (static::$checkoutClass!='')) {
\Log::debug('Send an email to the admin - '.$settings->admin_cc_email);
// \Log::debug('Send an email to the admin - '.$settings->admin_cc_email);
$recipient->notify(new static::$checkoutClass($params));
}

View file

@ -43,6 +43,7 @@ class Setting extends Model
'audit_warning_days' => 'numeric|nullable',
'audit_interval' => 'numeric|nullable',
'custom_forgot_pass_url' => 'url|nullable',
'privacy_policy_link' => 'nullable|url'
];
protected $fillable = ['site_name','email_domain','email_format','username_format'];

View file

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

View file

@ -131,8 +131,11 @@ return array(
'labels_per_page' => 'Labels per page',
'label_dimensions' => 'Label dimensions (inches)',
'next_auto_tag_base' => 'Next auto-increment',
'page_padding' => 'Page margins (inches)',
'purge' => 'Purge Deleted Records',
'page_padding' => 'Page margins (inches)',
'privacy_policy_link' => 'Link to Privacy Policy',
'privacy_policy' => 'Privacy Policy',
'privacy_policy_link_help' => 'If a url is included here, a link to your privacy policy will be included in the app footer and in any emails that the system sends out, in compliance with GDPR. ',
'purge' => 'Purge Deleted Records',
'labels_display_bgutter' => 'Label bottom gutter',
'labels_display_sgutter' => 'Label side gutter',
'labels_fontsize' => 'Label font size',

View file

@ -21,5 +21,9 @@
</head>
<body>
@yield('content')
@if ($snipeSettings->privacy_policy_link!='')
<a href="{{ $snipeSettings->privacy_policy_link }}">{{ trans('admin/settings/general.privacy_policy') }}</a>
@endif
</body>
</html>

View file

@ -54,6 +54,12 @@
<div class="text-center" style="padding-top: 100px;">
@if ($snipeSettings->privacy_policy_link!='')
<a target="_blank" rel="noopener" href="{{ $snipeSettings->privacy_policy_link }}" target="_new">{{ trans('admin/settings/general.privacy_policy') }}</a>
@endif
</div>
</body>
</html>

View file

@ -750,6 +750,11 @@
@endif
@endif
@if ($snipeSettings->privacy_policy_link!='')
<a target="_blank" class="btn btn-default btn-xs" rel="noopener" href="{{ $snipeSettings->privacy_policy_link }}" target="_new">{{ trans('admin/settings/general.privacy_policy') }}</a>
@endif
</div>
@if ($snipeSettings->footer_text!='')
<div class="pull-right">
@ -757,6 +762,7 @@
</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

@ -267,6 +267,18 @@
</div>
</div>
<!-- /.form-group -->
<!-- Privacy Polict Footer-->
<div class="form-group {{ $errors->has('privacy_policy_link') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('privacy_policy_link', trans('admin/settings/general.privacy_policy_link')) }}
</div>
<div class="col-md-9">
{{ Form::text('privacy_policy_link', Input::old('privacy_policy_link', $setting->privacy_policy_link), array('class' => 'form-control')) }}
<span class="help-block">{{ trans('admin/settings/general.privacy_policy_link_help') }}</span>
{!! $errors->first('privacy_policy_link', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
</div>
</div> <!--/.box-body-->

View file

@ -35,14 +35,19 @@
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
@if($snipeSettings::setupCompleted())
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
@else
© {{ date('Y') }} Snipe-it. All rights reserved.
@endif
@endcomponent
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
@if($snipeSettings::setupCompleted())
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
@else
© {{ date('Y') }} Snipe-it. All rights reserved.
@endif
@if ($snipeSettings->privacy_policy_link!='')
<a href="{{ $snipeSettings->privacy_policy_link }}">{{ trans('admin/settings/general.privacy_policy') }}</a>
@endif
@endcomponent
@endslot
@endcomponent

View file

@ -34,14 +34,19 @@
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
@if($snipeSettings::setupCompleted())
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
@else
© {{ date('Y') }} Snipe-it. All rights reserved.
@endif
@endcomponent
@endslot
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
@if($snipeSettings::setupCompleted())
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
@else
© {{ date('Y') }} Snipe-it. All rights reserved.
@endif
@if ($snipeSettings->privacy_policy_link!='')
[{{ $snipeSettings->privacy_policy_link }}]({{ trans('admin/settings/general.privacy_policy') }})
@endif
@endcomponent
@endslot
@endcomponent