diff --git a/app/Models/Traits/Inviteable.php b/app/Models/Traits/Inviteable.php index 098c65cf5f..d1411d1bec 100644 --- a/app/Models/Traits/Inviteable.php +++ b/app/Models/Traits/Inviteable.php @@ -42,7 +42,7 @@ trait Inviteable } if ($iframe_url && ! $forceOnsite) { - return "{$iframe_url}?{$this->invitation_key}"; + return "{$iframe_url}?{$this->invitation_key}/{$type}"; } elseif ($this->account->subdomain && ! $forcePlain) { $url = Utils::replaceSubdomain($url, $account->subdomain); } diff --git a/resources/views/accounts/client_portal.blade.php b/resources/views/accounts/client_portal.blade.php index 509273b60a..29b5cb65f6 100644 --- a/resources/views/accounts/client_portal.blade.php +++ b/resources/views/accounts/client_portal.blade.php @@ -345,11 +345,13 @@
{{ trans('texts.iframe_url_help1') }}
<center> <iframe id="invoiceIFrame" width="100%" height="1200" style="max-width:1000px"></iframe> -<center> +</center> <script language="javascript"> var iframe = document.getElementById('invoiceIFrame'); -iframe.src = '{{ rtrim(SITE_URL ,'/') }}/view/' - + window.location.search.substring(1, 33); +var search = window.location.search + '//'; +var silent = search.indexOf('silent') > 0; +var parts = search.replace('?silent=true', '').split('/'); +iframe.src = '{{ rtrim(SITE_URL ,'/') }}/' + parts[1] + '/' + parts[0].substring(1, 33) + '/' + parts[2] + (silent ? '?silent=true' : ''); </script>
{{ trans('texts.iframe_url_help2') }}
{{ trans('texts.iframe_url_help3') }}