2015-12-30 19:11:51 +01:00
|
|
|
@extends('header')
|
|
|
|
|
|
|
|
@section('head')
|
2016-03-04 03:57:15 +01:00
|
|
|
@parent
|
2015-12-30 19:11:51 +01:00
|
|
|
|
2016-07-12 22:46:41 +02:00
|
|
|
@include('money_script')
|
|
|
|
|
|
|
|
<link href='https://fonts.googleapis.com/css?family=Roboto+Mono' rel='stylesheet' type='text/css'>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.checkbox-inline input[type="checkbox"] {
|
|
|
|
margin-left:-20px !important;
|
|
|
|
}
|
2017-01-12 14:12:02 +01:00
|
|
|
.iframe_url {
|
|
|
|
display: none;
|
|
|
|
}
|
2016-07-12 22:46:41 +02:00
|
|
|
</style>
|
|
|
|
|
2015-12-30 19:11:51 +01:00
|
|
|
@stop
|
|
|
|
|
2016-05-15 22:16:08 +02:00
|
|
|
@section('content')
|
2016-03-04 03:57:15 +01:00
|
|
|
@parent
|
2015-12-30 19:11:51 +01:00
|
|
|
|
2016-03-04 03:57:15 +01:00
|
|
|
{!! Former::open_for_files()
|
2017-01-12 12:52:37 +01:00
|
|
|
->rules([
|
|
|
|
'iframe_url' => 'url',
|
|
|
|
])
|
|
|
|
->addClass('warn-on-exit') !!}
|
2015-12-30 19:11:51 +01:00
|
|
|
|
2017-01-12 12:52:37 +01:00
|
|
|
{!! Former::populate($account) !!}
|
2016-03-04 03:57:15 +01:00
|
|
|
{!! Former::populateField('enable_client_portal', intval($account->enable_client_portal)) !!}
|
2016-04-13 21:08:41 +02:00
|
|
|
{!! Former::populateField('enable_client_portal_dashboard', intval($account->enable_client_portal_dashboard)) !!}
|
2016-03-08 18:42:22 +01:00
|
|
|
{!! Former::populateField('enable_portal_password', intval($enable_portal_password)) !!}
|
|
|
|
{!! Former::populateField('send_portal_password', intval($send_portal_password)) !!}
|
2016-07-13 11:03:39 +02:00
|
|
|
{!! Former::populateField('enable_buy_now_buttons', intval($account->enable_buy_now_buttons)) !!}
|
2016-11-04 14:34:15 +01:00
|
|
|
{!! Former::populateField('show_accept_invoice_terms', intval($account->show_accept_invoice_terms)) !!}
|
|
|
|
{!! Former::populateField('show_accept_quote_terms', intval($account->show_accept_quote_terms)) !!}
|
|
|
|
{!! Former::populateField('require_invoice_signature', intval($account->require_invoice_signature)) !!}
|
|
|
|
{!! Former::populateField('require_quote_signature', intval($account->require_quote_signature)) !!}
|
2015-12-30 19:11:51 +01:00
|
|
|
|
2017-02-26 08:44:47 +01:00
|
|
|
@include('accounts.nav', ['selected' => ACCOUNT_CLIENT_PORTAL, 'advanced' => true])
|
2016-03-04 03:57:15 +01:00
|
|
|
|
|
|
|
<div class="row">
|
2016-03-22 11:08:48 +01:00
|
|
|
<div class="col-md-12">
|
2016-05-22 19:31:26 +02:00
|
|
|
|
2016-03-22 11:08:48 +01:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2017-01-12 12:52:37 +01:00
|
|
|
<h3 class="panel-title">{!! trans('texts.settings') !!}</h3>
|
2016-03-22 11:08:48 +01:00
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
2017-01-12 12:52:37 +01:00
|
|
|
|
2017-01-12 14:12:02 +01:00
|
|
|
<div role="tabpanel">
|
|
|
|
<ul class="nav nav-tabs" role="tablist" style="border: none">
|
2017-04-06 15:52:04 +02:00
|
|
|
<li role="presentation" class="active">
|
|
|
|
<a href="#link" aria-controls="link" role="tab" data-toggle="tab">{{ trans('texts.link') }}</a>
|
|
|
|
</li>
|
|
|
|
<li role="presentation">
|
2017-01-12 14:12:02 +01:00
|
|
|
<a href="#navigation" aria-controls="navigation" role="tab" data-toggle="tab">{{ trans('texts.navigation') }}</a>
|
|
|
|
</li>
|
|
|
|
<li role="presentation">
|
|
|
|
<a href="#custom_css" aria-controls="custom_css" role="tab" data-toggle="tab">{{ trans('texts.custom_css') }}</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
<div role="tabpanel" class="tab-pane active" id="link">
|
|
|
|
<div class="panel-body">
|
|
|
|
|
2017-04-06 15:52:04 +02:00
|
|
|
@if (Utils::isNinja() && ! Utils::isReseller())
|
2017-01-12 14:12:02 +01:00
|
|
|
{!! Former::inline_radios('domain_id')
|
|
|
|
->label(trans('texts.domain'))
|
|
|
|
->radios([
|
|
|
|
'invoiceninja.com' => ['value' => \Domain::INVOICENINJA_COM, 'name' => 'domain_id'],
|
|
|
|
'invoice.services' => ['value' => \Domain::INVOICE_SERVICES, 'name' => 'domain_id'],
|
|
|
|
])->check($account->domain_id)
|
|
|
|
->help($account->iframe_url ? 'domain_help_website' : 'domain_help') !!}
|
|
|
|
@endif
|
|
|
|
|
2017-04-06 15:52:04 +02:00
|
|
|
@if (Utils::isNinja())
|
|
|
|
|
|
|
|
{!! Former::inline_radios('custom_invoice_link')
|
|
|
|
->onchange('onCustomLinkChange()')
|
|
|
|
->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') !!}
|
|
|
|
{{ Former::setOption('capitalize_translations', false) }}
|
|
|
|
|
|
|
|
{!! Former::text('subdomain')
|
|
|
|
->placeholder(Utils::isNinja() ? 'app' : trans('texts.www'))
|
|
|
|
->onchange('onSubdomainChange()')
|
|
|
|
->addGroupClass('subdomain')
|
|
|
|
->label(' ')
|
|
|
|
->help(trans('texts.subdomain_help')) !!}
|
|
|
|
@endif
|
2017-01-12 14:12:02 +01:00
|
|
|
|
|
|
|
{!! Former::text('iframe_url')
|
|
|
|
->placeholder('https://www.example.com/invoice')
|
|
|
|
->appendIcon('question-sign')
|
|
|
|
->addGroupClass('iframe_url')
|
2017-04-06 15:52:04 +02:00
|
|
|
->label(Utils::isNinja() ? ' ' : trans('texts.website'))
|
|
|
|
->help(trans(Utils::isNinja() ? 'texts.subdomain_help' : 'texts.website_help')) !!}
|
2017-01-12 14:12:02 +01:00
|
|
|
|
|
|
|
{!! Former::plaintext('preview')
|
|
|
|
->value($account->getSampleLink()) !!}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-04-06 15:52:04 +02:00
|
|
|
<div role="tabpanel" class="tab-pane" id="navigation">
|
2017-01-12 14:12:02 +01:00
|
|
|
<div class="panel-body">
|
|
|
|
|
|
|
|
{!! Former::checkbox('enable_client_portal')
|
|
|
|
->text(trans('texts.enable'))
|
|
|
|
->help(trans('texts.enable_client_portal_help'))
|
|
|
|
->value(1) !!}
|
|
|
|
|
|
|
|
|
|
|
|
{!! Former::checkbox('enable_client_portal_dashboard')
|
|
|
|
->text(trans('texts.enable'))
|
|
|
|
->help(trans('texts.enable_client_portal_dashboard_help'))
|
|
|
|
->value(1) !!}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div role="tabpanel" class="tab-pane" id="custom_css">
|
|
|
|
<div class="panel-body">
|
|
|
|
|
|
|
|
{!! Former::textarea('client_view_css')
|
|
|
|
->label(trans('texts.custom_css'))
|
|
|
|
->rows(10)
|
|
|
|
->raw()
|
|
|
|
->maxlength(60000)
|
|
|
|
->style("min-width:100%;max-width:100%;font-family:'Roboto Mono', 'Lucida Console', Monaco, monospace;font-size:14px;'") !!}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-04-13 21:08:41 +02:00
|
|
|
</div>
|
2016-05-22 19:31:26 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2016-11-06 12:44:58 +01:00
|
|
|
<h3 class="panel-title">{!! trans('texts.authorization') !!}</h3>
|
2016-05-22 19:31:26 +02:00
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
2016-11-04 14:34:15 +01:00
|
|
|
<div role="tabpanel">
|
|
|
|
<ul class="nav nav-tabs" role="tablist" style="border: none">
|
|
|
|
<li role="presentation" class="active"><a href="#password" aria-controls="password" role="tab" data-toggle="tab">{{ trans('texts.password') }}</a></li>
|
|
|
|
<li role="presentation"><a href="#checkbox" aria-controls="checkbox" role="tab" data-toggle="tab">{{ trans('texts.checkbox') }}</a></li>
|
|
|
|
<li role="presentation"><a href="#signature" aria-controls="signature" role="tab" data-toggle="tab">{{ trans('texts.invoice_signature') }}</a></li>
|
|
|
|
</ul>
|
2016-03-22 11:08:48 +01:00
|
|
|
</div>
|
2016-11-04 14:34:15 +01:00
|
|
|
<div class="tab-content">
|
|
|
|
<div role="tabpanel" class="tab-pane active" id="password">
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-10 col-md-offset-1">
|
|
|
|
{!! Former::checkbox('enable_portal_password')
|
|
|
|
->text(trans('texts.enable'))
|
|
|
|
->help(trans('texts.enable_portal_password_help'))
|
2017-01-09 16:01:51 +01:00
|
|
|
->label(trans('texts.enable_portal_password'))
|
|
|
|
->value(1) !!}
|
2016-11-04 14:34:15 +01:00
|
|
|
</div>
|
|
|
|
<div class="col-md-10 col-md-offset-1">
|
|
|
|
{!! Former::checkbox('send_portal_password')
|
|
|
|
->text(trans('texts.enable'))
|
|
|
|
->help(trans('texts.send_portal_password_help'))
|
2017-01-09 16:01:51 +01:00
|
|
|
->label(trans('texts.send_portal_password'))
|
|
|
|
->value(1) !!}
|
2016-11-04 14:34:15 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div role="tabpanel" class="tab-pane" id="checkbox">
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-10 col-md-offset-1">
|
|
|
|
{!! Former::checkbox('show_accept_invoice_terms')
|
|
|
|
->text(trans('texts.enable'))
|
|
|
|
->help(trans('texts.show_accept_invoice_terms_help'))
|
2017-01-09 16:01:51 +01:00
|
|
|
->label(trans('texts.show_accept_invoice_terms'))
|
|
|
|
->value(1) !!}
|
2016-11-04 14:34:15 +01:00
|
|
|
</div>
|
|
|
|
<div class="col-md-10 col-md-offset-1">
|
|
|
|
{!! Former::checkbox('show_accept_quote_terms')
|
|
|
|
->text(trans('texts.enable'))
|
|
|
|
->help(trans('texts.show_accept_quote_terms_help'))
|
2017-01-09 16:01:51 +01:00
|
|
|
->label(trans('texts.show_accept_quote_terms'))
|
|
|
|
->value(1) !!}
|
2016-11-04 14:34:15 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div role="tabpanel" class="tab-pane" id="signature">
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-10 col-md-offset-1">
|
|
|
|
{!! Former::checkbox('require_invoice_signature')
|
|
|
|
->text(trans('texts.enable'))
|
|
|
|
->help(trans('texts.require_invoice_signature_help'))
|
2017-01-09 16:01:51 +01:00
|
|
|
->label(trans('texts.require_invoice_signature'))
|
|
|
|
->value(1) !!}
|
2016-11-04 14:34:15 +01:00
|
|
|
</div>
|
|
|
|
<div class="col-md-10 col-md-offset-1">
|
|
|
|
{!! Former::checkbox('require_quote_signature')
|
|
|
|
->text(trans('texts.enable'))
|
|
|
|
->help(trans('texts.require_quote_signature_help'))
|
2017-01-09 16:01:51 +01:00
|
|
|
->label(trans('texts.require_quote_signature'))
|
|
|
|
->value(1) !!}
|
2016-11-04 14:34:15 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-03-22 11:08:48 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-05-22 19:31:26 +02:00
|
|
|
|
2016-09-05 20:40:02 +02:00
|
|
|
<div class="panel panel-default" id="buy_now">
|
2016-07-12 22:46:41 +02:00
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">{!! trans('texts.buy_now_buttons') !!}</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
2016-07-13 15:33:49 +02:00
|
|
|
<div class="col-md-10 col-md-offset-1">
|
2016-07-13 11:03:39 +02:00
|
|
|
|
|
|
|
@if (count($gateway_types) && count($products))
|
|
|
|
|
|
|
|
{!! Former::checkbox('enable_buy_now_buttons')
|
|
|
|
->text(trans('texts.enable'))
|
|
|
|
->label(' ')
|
2017-01-09 16:01:51 +01:00
|
|
|
->help(trans('texts.enable_buy_now_buttons_help'))
|
|
|
|
->value(1) !!}
|
2016-07-13 11:03:39 +02:00
|
|
|
|
|
|
|
@if ($account->enable_buy_now_buttons)
|
|
|
|
{!! Former::select('product')
|
|
|
|
->onchange('updateBuyNowButtons()')
|
|
|
|
->addOption('', '')
|
|
|
|
->inlineHelp('buy_now_buttons_warning')
|
|
|
|
->addGroupClass('product-select') !!}
|
|
|
|
|
2017-03-30 11:40:04 +02:00
|
|
|
@if (count($account->present()->customTextFields))
|
|
|
|
{!! Former::inline_checkboxes('custom_fields')
|
|
|
|
->onchange('updateBuyNowButtons()')
|
|
|
|
->checkboxes($account->present()->customTextFields) !!}
|
|
|
|
@endif
|
|
|
|
|
2016-07-13 11:03:39 +02:00
|
|
|
{!! Former::inline_radios('landing_page')
|
|
|
|
->onchange('showPaymentTypes();updateBuyNowButtons();')
|
|
|
|
->radios([
|
|
|
|
trans('texts.invoice') => ['value' => 'invoice', 'name' => 'landing_page_type'],
|
|
|
|
trans('texts.payment') => ['value' => 'payment', 'name' => 'landing_page_type'],
|
|
|
|
])->check('invoice') !!}
|
|
|
|
|
|
|
|
<div id="paymentTypesDiv" style="display:none">
|
|
|
|
{!! Former::select('payment_type')
|
|
|
|
->onchange('updateBuyNowButtons()')
|
|
|
|
->options($gateway_types) !!}
|
|
|
|
</div>
|
|
|
|
|
2017-01-29 16:32:59 +01:00
|
|
|
{!! Former::text('redirect_url')
|
|
|
|
->onchange('updateBuyNowButtons()')
|
|
|
|
->placeholder('https://www.example.com')
|
|
|
|
->help('redirect_url_help') !!}
|
|
|
|
|
|
|
|
|
|
|
|
{!! Former::checkbox('is_recurring')
|
|
|
|
->text('enable')
|
|
|
|
->label('recurring')
|
|
|
|
->onchange('showRecurring();updateBuyNowButtons();')
|
|
|
|
->value(1) !!}
|
|
|
|
|
|
|
|
<div id="recurringDiv" style="display:none">
|
|
|
|
|
|
|
|
{!! Former::select('frequency_id')
|
|
|
|
->options(\App\Models\Frequency::selectOptions())
|
2017-02-02 21:42:40 +01:00
|
|
|
->onchange('updateBuyNowButtons()')
|
2017-01-29 16:32:59 +01:00
|
|
|
->value(FREQUENCY_MONTHLY) !!}
|
|
|
|
|
|
|
|
{!! Former::select('auto_bill')
|
2017-02-02 21:42:40 +01:00
|
|
|
->onchange('updateBuyNowButtons()')
|
2017-01-29 16:32:59 +01:00
|
|
|
->options([
|
|
|
|
AUTO_BILL_OFF => trans('texts.off'),
|
|
|
|
AUTO_BILL_OPT_IN => trans('texts.opt_in'),
|
|
|
|
AUTO_BILL_OPT_OUT => trans('texts.opt_out'),
|
|
|
|
AUTO_BILL_ALWAYS => trans('texts.always'),
|
|
|
|
]) !!}
|
|
|
|
</div>
|
|
|
|
|
2016-07-13 11:03:39 +02:00
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<div role="tabpanel">
|
|
|
|
<ul class="nav nav-tabs" role="tablist" style="border: none">
|
|
|
|
<li role="presentation" class="active">
|
2017-02-20 20:08:55 +01:00
|
|
|
<a href="#buy_now_link" aria-controls="buy_now_link" role="tab" data-toggle="tab">{{ trans('texts.link') }}</a>
|
2016-07-13 11:03:39 +02:00
|
|
|
</li>
|
|
|
|
<li role="presentation">
|
2017-02-20 20:08:55 +01:00
|
|
|
<a href="#form" aria-controls="form" role="tab" data-toggle="tab">{{ trans('texts.form') }}</a>
|
2016-07-13 11:03:39 +02:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="tab-content">
|
2017-02-20 20:08:55 +01:00
|
|
|
<div role="tabpanel" class="tab-pane active" id="buy_now_link">
|
2016-07-13 11:03:39 +02:00
|
|
|
<textarea id="linkTextarea" class="form-control" rows="4" readonly></textarea>
|
|
|
|
</div>
|
2017-02-20 20:08:55 +01:00
|
|
|
<div role="tabpanel" class="tab-pane" id="form">
|
|
|
|
<textarea id="formTextarea" class="form-control" rows="4" readonly></textarea>
|
|
|
|
</div>
|
2016-07-13 11:03:39 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
@endif
|
2017-02-20 20:13:06 +01:00
|
|
|
|
2016-07-13 11:03:39 +02:00
|
|
|
@else
|
|
|
|
|
|
|
|
<center style="font-size:16px;color:#888888;">
|
|
|
|
{{ trans('texts.buy_now_buttons_disabled') }}
|
|
|
|
</center>
|
|
|
|
|
|
|
|
@endif
|
2016-07-12 22:46:41 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-03-22 11:08:48 +01:00
|
|
|
</div>
|
2016-03-04 03:57:15 +01:00
|
|
|
</div>
|
2017-01-12 14:13:58 +01:00
|
|
|
|
2015-12-30 19:11:51 +01:00
|
|
|
|
2017-02-26 08:44:47 +01:00
|
|
|
@if (Auth::user()->isPro())
|
|
|
|
<center>
|
|
|
|
{!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}
|
|
|
|
</center>
|
|
|
|
@endif
|
2015-12-30 19:11:51 +01:00
|
|
|
|
2016-03-04 03:57:15 +01:00
|
|
|
{!! Former::close() !!}
|
2016-07-12 22:46:41 +02:00
|
|
|
|
2017-01-12 12:52:37 +01:00
|
|
|
|
|
|
|
<div class="modal fade" id="iframeHelpModal" tabindex="-1" role="dialog" aria-labelledby="iframeHelpModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog" style="min-width:150px">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
|
<h4 class="modal-title" id="iframeHelpModalLabel">{{ trans('texts.iframe_url') }}</h4>
|
|
|
|
</div>
|
|
|
|
|
2017-02-18 22:20:03 +01:00
|
|
|
<div class="container" style="width: 100%; padding-bottom: 0px !important">
|
2017-03-26 10:45:17 +02:00
|
|
|
<div class="panel panel-default">
|
2017-02-18 22:20:03 +01:00
|
|
|
<div class="panel-body">
|
2017-01-12 12:52:37 +01:00
|
|
|
<p>{{ trans('texts.iframe_url_help1') }}</p>
|
|
|
|
<pre><center>
|
|
|
|
<iframe id="invoiceIFrame" width="100%" height="1200" style="max-width:1000px"></iframe>
|
|
|
|
<center>
|
|
|
|
<script language="javascript">
|
|
|
|
var iframe = document.getElementById('invoiceIFrame');
|
|
|
|
iframe.src = '{{ rtrim(SITE_URL ,'/') }}/view/'
|
2017-03-26 22:18:25 +02:00
|
|
|
+ window.location.search.substring(1, 33);
|
2017-01-12 12:52:37 +01:00
|
|
|
</script></pre>
|
|
|
|
<p>{{ trans('texts.iframe_url_help2') }}</p>
|
|
|
|
<p><b>{{ trans('texts.iframe_url_help3') }}</b></p>
|
|
|
|
</div>
|
2017-02-18 22:20:03 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-01-12 12:52:37 +01:00
|
|
|
|
2017-03-26 10:45:17 +02:00
|
|
|
<div class="modal-footer">
|
2017-01-12 12:52:37 +01:00
|
|
|
<button type="button" class="btn btn-primary" data-dismiss="modal">{{ trans('texts.close') }}</button>
|
|
|
|
</div>
|
|
|
|
|
2017-02-18 22:20:03 +01:00
|
|
|
|
2017-01-12 12:52:37 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2017-02-07 08:10:20 +01:00
|
|
|
<script type="text/javascript">
|
2016-07-12 22:46:41 +02:00
|
|
|
|
2017-05-08 21:10:39 +02:00
|
|
|
var products = {!! $products !!};
|
2016-07-12 22:46:41 +02:00
|
|
|
|
|
|
|
$(function() {
|
|
|
|
var $productSelect = $('select#product');
|
|
|
|
for (var i=0; i<products.length; i++) {
|
|
|
|
var product = products[i];
|
|
|
|
|
|
|
|
$productSelect.append(new Option(formatMoney(product.cost) + ' - ' + product.product_key, product.public_id));
|
|
|
|
}
|
|
|
|
$productSelect.combobox();
|
|
|
|
|
|
|
|
fixCheckboxes();
|
|
|
|
updateBuyNowButtons();
|
|
|
|
})
|
|
|
|
|
2016-03-04 03:57:15 +01:00
|
|
|
$('#enable_portal_password').change(fixCheckboxes);
|
2016-07-12 22:46:41 +02:00
|
|
|
|
|
|
|
function fixCheckboxes() {
|
2016-03-04 03:57:15 +01:00
|
|
|
var checked = $('#enable_portal_password').is(':checked');
|
|
|
|
$('#send_portal_password').prop('disabled', !checked);
|
|
|
|
}
|
2016-07-12 22:46:41 +02:00
|
|
|
|
|
|
|
function showPaymentTypes() {
|
|
|
|
var val = $('input[name=landing_page_type]:checked').val()
|
|
|
|
if (val == '{{ ENTITY_PAYMENT }}') {
|
|
|
|
$('#paymentTypesDiv').fadeIn();
|
|
|
|
} else {
|
2017-01-29 16:32:59 +01:00
|
|
|
$('#paymentTypesDiv').fadeOut();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function showRecurring() {
|
|
|
|
var val = $('input[name=is_recurring]:checked').val()
|
|
|
|
if (val) {
|
|
|
|
$('#recurringDiv').fadeIn();
|
|
|
|
} else {
|
|
|
|
$('#recurringDiv').fadeOut();
|
2016-07-12 22:46:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateBuyNowButtons() {
|
|
|
|
var productId = $('#product').val();
|
|
|
|
var landingPage = $('input[name=landing_page_type]:checked').val()
|
2016-12-26 12:50:52 +01:00
|
|
|
var paymentType = (landingPage == 'payment') ? '/' + $('#payment_type').val() : '/';
|
2016-12-02 13:51:05 +01:00
|
|
|
var redirectUrl = $('#redirect_url').val();
|
2017-02-02 21:42:40 +01:00
|
|
|
var isRecurring = $('input[name=is_recurring]:checked').val()
|
2017-01-29 16:32:59 +01:00
|
|
|
var frequencyId = $('#frequency_id').val();
|
|
|
|
var autoBillId = $('#auto_bill').val();
|
2016-07-12 22:46:41 +02:00
|
|
|
|
|
|
|
var form = '';
|
|
|
|
var link = '';
|
|
|
|
|
|
|
|
if (productId) {
|
2017-08-22 20:19:42 +02:00
|
|
|
@if (Utils::isNinjaProd())
|
|
|
|
var domain = '{{ $account->present()->clientPortalLink(true) }}';
|
|
|
|
@else
|
|
|
|
var domain = '{{ url('/buy_now') }}';
|
|
|
|
@endif
|
|
|
|
var link = domain + paymentType +
|
2016-07-12 22:46:41 +02:00
|
|
|
'?account_key={{ $account->account_key }}' +
|
|
|
|
'&product_id=' + productId;
|
|
|
|
|
2016-12-26 12:50:52 +01:00
|
|
|
var form = '<form action="' + link + '" method="post" target="_top">' + "\n";
|
2016-07-12 22:46:41 +02:00
|
|
|
|
2017-03-30 11:52:53 +02:00
|
|
|
@foreach ($account->present()->customTextFields as $field => $val)
|
|
|
|
if ($('input#{{ $val['name'] }}').is(':checked')) {
|
|
|
|
form += '<input type="text" name="{{ $val['name'] }}" placeholder="{{ $field }}" required/>' + "\n";
|
|
|
|
link += '&{{ $val['name'] }}=';
|
2017-03-30 11:40:04 +02:00
|
|
|
}
|
|
|
|
@endforeach
|
|
|
|
|
2016-12-02 13:51:05 +01:00
|
|
|
if (redirectUrl) {
|
|
|
|
link += '&redirect_url=' + encodeURIComponent(redirectUrl);
|
|
|
|
form += '<input type="hidden" name="redirect_url" value="' + redirectUrl + '"/>' + "\n";
|
|
|
|
}
|
|
|
|
|
2017-01-29 16:32:59 +01:00
|
|
|
if (isRecurring) {
|
|
|
|
link += "&is_recurring=true&frequency_id=" + frequencyId + "&auto_bill_id=" + autoBillId;
|
|
|
|
form += '<input type="hidden" name="is_recurring" value="true"/>' + "\n"
|
|
|
|
+ '<input type="hidden" name="frequency_id" value="' + frequencyId + '"/>' + "\n"
|
|
|
|
+ '<input type="hidden" name="auto_bill_id" value="' + autoBillId + '"/>' + "\n";
|
|
|
|
}
|
|
|
|
|
2016-07-12 22:46:41 +02:00
|
|
|
form += '<input type="submit" value="Buy Now" name="submit"/>' + "\n" + '</form>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#formTextarea').text(form);
|
|
|
|
$('#linkTextarea').text(link);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-01-12 12:52:37 +01:00
|
|
|
function onSubdomainChange() {
|
|
|
|
var input = $('#subdomain');
|
|
|
|
var val = input.val();
|
|
|
|
if (!val) return;
|
|
|
|
val = val.replace(/[^a-zA-Z0-9_\-]/g, '').toLowerCase().substring(0, {{ MAX_SUBDOMAIN_LENGTH }});
|
|
|
|
input.val(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onCustomLinkChange() {
|
|
|
|
var val = $('input[name=custom_link]:checked').val()
|
|
|
|
if (val == 'subdomain') {
|
|
|
|
$('.subdomain').show();
|
|
|
|
$('.iframe_url').hide();
|
|
|
|
} else {
|
|
|
|
$('.subdomain').hide();
|
|
|
|
$('.iframe_url').show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$('.iframe_url .input-group-addon').click(function() {
|
|
|
|
$('#iframeHelpModal').modal('show');
|
|
|
|
});
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
onCustomLinkChange();
|
|
|
|
|
|
|
|
$('#subdomain').change(function() {
|
|
|
|
$('#iframe_url').val('');
|
|
|
|
});
|
|
|
|
$('#iframe_url').change(function() {
|
|
|
|
$('#subdomain').val('');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-12 22:46:41 +02:00
|
|
|
|
2016-05-15 22:16:08 +02:00
|
|
|
</script>
|
2016-07-12 22:46:41 +02:00
|
|
|
|
2016-05-15 22:16:08 +02:00
|
|
|
@stop
|