Implemented enable_client_portal_dashboard

This commit is contained in:
Hillel Coren 2016-04-13 22:08:41 +03:00
parent 3cb3126f98
commit 9b8b150766
4 changed files with 46 additions and 14 deletions

View File

@ -552,6 +552,7 @@ class AccountController extends BaseController
$account->client_view_css = $sanitized_css; $account->client_view_css = $sanitized_css;
$account->enable_client_portal = !!Input::get('enable_client_portal'); $account->enable_client_portal = !!Input::get('enable_client_portal');
$account->enable_client_portal_dashboard = !!Input::get('enable_client_portal_dashboard');
$account->enable_portal_password = !!Input::get('enable_portal_password'); $account->enable_portal_password = !!Input::get('enable_portal_password');
$account->send_portal_password = !!Input::get('send_portal_password'); $account->send_portal_password = !!Input::get('send_portal_password');

View File

@ -123,8 +123,8 @@ class PublicClientController extends BaseController
'showApprove' => $showApprove, 'showApprove' => $showApprove,
'showBreadcrumbs' => false, 'showBreadcrumbs' => false,
'hideLogo' => $account->isWhiteLabel(), 'hideLogo' => $account->isWhiteLabel(),
'hideHeader' => $account->isNinjaAccount(), 'hideHeader' => $account->isNinjaAccount() || !$account->enable_client_portal,
'hideDashboard' => !$account->enable_client_portal, 'hideDashboard' => !$account->enable_client_portal_dashboard,
'showDocuments' => $account->isPro(), 'showDocuments' => $account->isPro(),
'clientViewCSS' => $account->clientViewCSS(), 'clientViewCSS' => $account->clientViewCSS(),
'clientFontUrl' => $account->getFontsUrl(), 'clientFontUrl' => $account->getFontsUrl(),
@ -212,7 +212,7 @@ class PublicClientController extends BaseController
$client = $invoice->client; $client = $invoice->client;
$color = $account->primary_color ? $account->primary_color : '#0b4d78'; $color = $account->primary_color ? $account->primary_color : '#0b4d78';
if (!$account->enable_client_portal) { if (!$account->enable_client_portal || !$account->enable_client_portal_dashboard) {
return $this->returnError(); return $this->returnError();
} }
@ -221,6 +221,7 @@ class PublicClientController extends BaseController
'account' => $account, 'account' => $account,
'client' => $client, 'client' => $client,
'hideLogo' => $account->isWhiteLabel(), 'hideLogo' => $account->isWhiteLabel(),
'showDocuments' => $account->isPro(),
'clientViewCSS' => $account->clientViewCSS(), 'clientViewCSS' => $account->clientViewCSS(),
'clientFontUrl' => $account->getFontsUrl(), 'clientFontUrl' => $account->getFontsUrl(),
]; ];
@ -261,13 +262,19 @@ class PublicClientController extends BaseController
if (!$invitation = $this->getInvitation()) { if (!$invitation = $this->getInvitation()) {
return $this->returnError(); return $this->returnError();
} }
$account = $invitation->account; $account = $invitation->account;
if (!$account->enable_client_portal) {
return $this->returnError();
}
$color = $account->primary_color ? $account->primary_color : '#0b4d78'; $color = $account->primary_color ? $account->primary_color : '#0b4d78';
$data = [ $data = [
'color' => $color, 'color' => $color,
'hideLogo' => $account->isWhiteLabel(), 'hideLogo' => $account->isWhiteLabel(),
'hideDashboard' => !$account->enable_client_portal, 'hideDashboard' => !$account->enable_client_portal_dashboard,
'showDocuments' => $account->isPro(), 'showDocuments' => $account->isPro(),
'clientViewCSS' => $account->clientViewCSS(), 'clientViewCSS' => $account->clientViewCSS(),
'clientFontUrl' => $account->getFontsUrl(), 'clientFontUrl' => $account->getFontsUrl(),
@ -295,12 +302,16 @@ class PublicClientController extends BaseController
return $this->returnError(); return $this->returnError();
} }
$account = $invitation->account; $account = $invitation->account;
$color = $account->primary_color ? $account->primary_color : '#0b4d78';
if (!$account->enable_client_portal) {
return $this->returnError();
}
$color = $account->primary_color ? $account->primary_color : '#0b4d78';
$data = [ $data = [
'color' => $color, 'color' => $color,
'hideLogo' => $account->isWhiteLabel(), 'hideLogo' => $account->isWhiteLabel(),
'hideDashboard' => !$account->enable_client_portal, 'hideDashboard' => !$account->enable_client_portal_dashboard,
'showDocuments' => $account->isPro(), 'showDocuments' => $account->isPro(),
'clientViewCSS' => $account->clientViewCSS(), 'clientViewCSS' => $account->clientViewCSS(),
'clientFontUrl' => $account->getFontsUrl(), 'clientFontUrl' => $account->getFontsUrl(),
@ -333,13 +344,18 @@ class PublicClientController extends BaseController
if (!$invitation = $this->getInvitation()) { if (!$invitation = $this->getInvitation()) {
return $this->returnError(); return $this->returnError();
} }
$account = $invitation->account; $account = $invitation->account;
if (!$account->enable_client_portal) {
return $this->returnError();
}
$color = $account->primary_color ? $account->primary_color : '#0b4d78'; $color = $account->primary_color ? $account->primary_color : '#0b4d78';
$data = [ $data = [
'color' => $color, 'color' => $color,
'hideLogo' => $account->isWhiteLabel(), 'hideLogo' => $account->isWhiteLabel(),
'hideDashboard' => !$account->enable_client_portal, 'hideDashboard' => !$account->enable_client_portal_dashboard,
'showDocuments' => $account->isPro(), 'showDocuments' => $account->isPro(),
'clientViewCSS' => $account->clientViewCSS(), 'clientViewCSS' => $account->clientViewCSS(),
'clientFontUrl' => $account->getFontsUrl(), 'clientFontUrl' => $account->getFontsUrl(),
@ -366,13 +382,18 @@ class PublicClientController extends BaseController
if (!$invitation = $this->getInvitation()) { if (!$invitation = $this->getInvitation()) {
return $this->returnError(); return $this->returnError();
} }
$account = $invitation->account; $account = $invitation->account;
$color = $account->primary_color ? $account->primary_color : '#0b4d78';
if (!$account->enable_client_portal) {
return $this->returnError();
}
$color = $account->primary_color ? $account->primary_color : '#0b4d78';
$data = [ $data = [
'color' => $color, 'color' => $color,
'hideLogo' => $account->isWhiteLabel(), 'hideLogo' => $account->isWhiteLabel(),
'hideDashboard' => !$account->enable_client_portal, 'hideDashboard' => !$account->enable_client_portal_dashboard,
'showDocuments' => $account->isPro(), 'showDocuments' => $account->isPro(),
'clientViewCSS' => $account->clientViewCSS(), 'clientViewCSS' => $account->clientViewCSS(),
'clientFontUrl' => $account->getFontsUrl(), 'clientFontUrl' => $account->getFontsUrl(),

View File

@ -1049,8 +1049,6 @@ $LANG = array(
'custom_invoice_item_fields_help' => 'Add a field when creating an invoice item and display the label and value on the PDF.', 'custom_invoice_item_fields_help' => 'Add a field when creating an invoice item and display the label and value on the PDF.',
'recurring_invoice_number' => 'Recurring Invoice Number', 'recurring_invoice_number' => 'Recurring Invoice Number',
'recurring_invoice_number_prefix_help' => 'Speciy a prefix to be added to the invoice number for recurring invoices. The default value is \'R\'.', 'recurring_invoice_number_prefix_help' => 'Speciy a prefix to be added to the invoice number for recurring invoices. The default value is \'R\'.',
'enable_client_portal' => 'Dashboard',
'enable_client_portal_help' => 'Show/hide the dashboard page in the client portal.',
// Client Passwords // Client Passwords
'enable_portal_password'=>'Password protect invoices', 'enable_portal_password'=>'Password protect invoices',
@ -1123,6 +1121,12 @@ $LANG = array(
'documents' => 'Documents', 'documents' => 'Documents',
'document_date' => 'Document Date', 'document_date' => 'Document Date',
'document_size' => 'Size', 'document_size' => 'Size',
'enable_client_portal' => 'Client Portal',
'enable_client_portal_help' => 'Show/hide the client portal.',
'enable_client_portal_dashboard' => 'Dashboard',
'enable_client_portal_dashboard_help' => 'Show/hide the dashboard page in the client portal.',
); );
return $LANG; return $LANG;

View File

@ -13,6 +13,7 @@
->addClass('warn-on-exit') !!} ->addClass('warn-on-exit') !!}
{!! Former::populateField('enable_client_portal', intval($account->enable_client_portal)) !!} {!! Former::populateField('enable_client_portal', intval($account->enable_client_portal)) !!}
{!! Former::populateField('enable_client_portal_dashboard', intval($account->enable_client_portal_dashboard)) !!}
{!! Former::populateField('client_view_css', $client_view_css) !!} {!! Former::populateField('client_view_css', $client_view_css) !!}
{!! Former::populateField('enable_portal_password', intval($enable_portal_password)) !!} {!! Former::populateField('enable_portal_password', intval($enable_portal_password)) !!}
{!! Former::populateField('send_portal_password', intval($send_portal_password)) !!} {!! Former::populateField('send_portal_password', intval($send_portal_password)) !!}
@ -39,6 +40,11 @@
->text(trans('texts.enable')) ->text(trans('texts.enable'))
->help(trans('texts.enable_client_portal_help')) !!} ->help(trans('texts.enable_client_portal_help')) !!}
</div> </div>
<div class="col-md-10 col-md-offset-1">
{!! Former::checkbox('enable_client_portal_dashboard')
->text(trans('texts.enable'))
->help(trans('texts.enable_client_portal_dashboard_help')) !!}
</div>
<div class="col-md-10 col-md-offset-1"> <div class="col-md-10 col-md-offset-1">
{!! Former::checkbox('enable_portal_password') {!! Former::checkbox('enable_portal_password')
->text(trans('texts.enable_portal_password')) ->text(trans('texts.enable_portal_password'))