Skip to content

Commit

Permalink
Use queues in send reminders command
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Mar 28, 2018
1 parent a439da5 commit 25feebd
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/Libraries/Utils.php
Expand Up @@ -182,6 +182,11 @@ public static function getTermsLink()
return static::isNinja() ? NINJA_WEB_URL.'/terms' : NINJA_WEB_URL.'/self-hosting-the-invoice-ninja-platform';
}

public static function getPrivacyLink()
{
return static::isNinja() ? NINJA_WEB_URL.'/terms' : NINJA_WEB_URL.'/self-hosting-the-invoice-ninja-platform';
}

public static function isOAuthEnabled()
{
$providers = [
Expand Down
3 changes: 3 additions & 0 deletions app/Ninja/Repositories/AccountRepository.php
Expand Up @@ -67,6 +67,8 @@ public function create($firstName = '', $lastName = '', $email = '', $password =
$account->currency_id = DEFAULT_CURRENCY;

// Set default language/currency based on IP
// TODO Disabled until GDPR implications are understood
/*
if (\Cache::get('currencies')) {
if ($data = unserialize(@file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $account->ip))) {
$currencyCode = strtolower($data['geoplugin_currencyCode']);
Expand Down Expand Up @@ -94,6 +96,7 @@ public function create($firstName = '', $lastName = '', $email = '', $password =
}
}
}
*/

$account->save();

Expand Down
3 changes: 2 additions & 1 deletion bower.json
Expand Up @@ -41,7 +41,8 @@
"jt.timepicker": "jquery-timepicker-jt#^1.11.12",
"qrcode.js": "qrcode-js#*",
"money.js": "^0.1.3",
"grapesjs": "^0.13.8"
"grapesjs": "^0.13.8",
"cookieconsent": "^3.0.6"
},
"resolutions": {
"jquery": "~1.11"
Expand Down
3 changes: 3 additions & 0 deletions config/ninja.php
Expand Up @@ -23,4 +23,7 @@
'exchange_rates_url' => env('EXCHANGE_RATES_URL', 'https://api.fixer.io/latest'),
'exchange_rates_base' => env('EXCHANGE_RATES_BASE', 'EUR'),

// privacy policy
'privacy_policy_url' => env('PRIVACY_POLICY_URL', ''),

];
2 changes: 2 additions & 0 deletions resources/lang/en/texts.php
Expand Up @@ -2796,6 +2796,8 @@
'send_item_details_help' => 'Send the line item details to the payment gateway.',
'view_proposal' => 'View Proposal',
'view_in_portal' => 'View in Portal',
'cookie_message' => 'This website uses cookies to ensure you get the best experience on our website.',
'got_it' => 'Got it!',

);

Expand Down
27 changes: 27 additions & 0 deletions resources/views/master.blade.php
Expand Up @@ -198,6 +198,31 @@ function fbq() {
</script>

<link rel="stylesheet" type="text/css" href="{{ asset('css/cookieconsent.min.css') }}"/>
<script src="{{ asset('js/cookieconsent.min.js') }}"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
},
},
"cookie": {
"domain": "{{ config('session.domain') }}"
},
"content": {
"href": "{{ Utils::isNinja() ? Utils::getPrivacyLink() : (config('ninja.privacy_policy_url') ?: 'https://cookiesandyou.com/' ) }}",
"message": {!! json_encode(trans('texts.cookie_message')) !!},
"dismiss": {!! json_encode(trans('texts.got_it')) !!},
"link": {!! json_encode(trans('texts.learn_more')) !!},
}
})}
);
</script>

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand Down Expand Up @@ -231,6 +256,8 @@ function trackEvent(category, action) {
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', '{{ $_ENV['ANALYTICS_KEY'] }}', 'auto');
ga('set', 'anonymizeIp', true);
@if (request()->invitation_key || request()->proposal_invitation_key || request()->contact_key)
ga('send', 'pageview', { 'page': '/client/portal' });
@else
Expand Down
2 changes: 1 addition & 1 deletion resources/views/partials/accept_terms.blade.php
Expand Up @@ -15,7 +15,7 @@
<div class="panel-body">
{!! Former::checkbox('accepted_terms')->text(trans('texts.agree_to_terms', [
'terms' => link_to(Utils::getTermsLink(), trans('texts.terms_of_service'), ['target' => '_blank']),
'privacy' => link_to(Utils::getTermsLink(), trans('texts.privacy_policy'), ['target' => '_blank']),
'privacy' => link_to(Utils::getPrivacyLink(), trans('texts.privacy_policy'), ['target' => '_blank']),
]))->raw()->value(1) !!}
</div>
</div>
Expand Down

0 comments on commit 25feebd

Please sign in to comment.