diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 553df8dae94d..56a3df9e24bd 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -834,6 +834,7 @@ class AccountController extends BaseController $account->client_view_css = $request->client_view_css; $account->subdomain = $request->subdomain; $account->iframe_url = $request->iframe_url; + $account->is_custom_domain = $request->is_custom_domain; $account->save(); if ($fireUpdateSubdomainEvent) { diff --git a/app/Models/Traits/Inviteable.php b/app/Models/Traits/Inviteable.php index d1411d1becf8..fc82845a3f9d 100644 --- a/app/Models/Traits/Inviteable.php +++ b/app/Models/Traits/Inviteable.php @@ -42,7 +42,11 @@ trait Inviteable } if ($iframe_url && ! $forceOnsite) { - return "{$iframe_url}?{$this->invitation_key}/{$type}"; + if ($account->is_custom_domain) { + $url = $iframe_url; + } else { + return "{$iframe_url}?{$this->invitation_key}/{$type}"; + } } elseif ($this->account->subdomain && ! $forcePlain) { $url = Utils::replaceSubdomain($url, $account->subdomain); } diff --git a/database/migrations/2018_04_16_142434_add_custom_domain.php b/database/migrations/2018_04_16_142434_add_custom_domain.php new file mode 100644 index 000000000000..289c096fc740 --- /dev/null +++ b/database/migrations/2018_04_16_142434_add_custom_domain.php @@ -0,0 +1,30 @@ +boolean('is_custom_domain')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/resources/views/accounts/client_portal.blade.php b/resources/views/accounts/client_portal.blade.php index 29b5cb65f689..0c7d958aef4e 100644 --- a/resources/views/accounts/client_portal.blade.php +++ b/resources/views/accounts/client_portal.blade.php @@ -84,8 +84,9 @@ ->label(trans('texts.customize')) ->radios([ trans('texts.subdomain') => ['value' => 'subdomain', 'name' => 'custom_link'], - trans('texts.website') => ['value' => 'website', 'name' => 'custom_link'], - ])->check($account->iframe_url ? 'website' : 'subdomain') !!} + 'iFrame' => ['value' => 'iframe', 'name' => 'custom_link'], + trans('texts.domain') => ['value' => 'domain', 'name' => 'custom_link'], + ])->check($account->iframe_url ? ($account->is_custom_domain ? 'domain' : 'iframe') : 'subdomain') !!} {{ Former::setOption('capitalize_translations', false) }} {!! Former::text('subdomain') @@ -97,12 +98,23 @@ @endif {!! Former::text('iframe_url') - ->placeholder('https://www.example.com/invoice') + ->placeholder('https://www.example.com') ->appendIcon('question-sign') ->addGroupClass('iframe_url') ->label(Utils::isNinja() ? ' ' : trans('texts.website')) ->help(trans(Utils::isNinja() ? 'texts.subdomain_help' : 'texts.website_help')) !!} + @if (Utils::isNinja()) +
+ @endif + + + {!! Former::plaintext('preview') ->value($account->getSampleLink()) !!} @@ -341,7 +353,7 @@{{ trans('texts.iframe_url_help1') }}
<center> <iframe id="invoiceIFrame" width="100%" height="1200" style="max-width:1000px"></iframe> @@ -355,7 +367,13 @@ iframe.src = '{{ rtrim(SITE_URL ,'/') }}/' + parts[1] + '/' + parts[0].substring </script>
{{ trans('texts.iframe_url_help2') }}
{{ trans('texts.iframe_url_help3') }}
-