Working on the portal

This commit is contained in:
Hillel Coren 2018-01-21 08:48:18 +02:00
parent 78da1246ae
commit 4fb50f75cf
4 changed files with 23 additions and 10 deletions

View File

@ -269,6 +269,7 @@ class ClientPortalController extends BaseController
if (! $account->enable_client_portal) { if (! $account->enable_client_portal) {
return $this->returnError(); return $this->returnError();
} elseif (! $account->enable_client_portal_dashboard) { } elseif (! $account->enable_client_portal_dashboard) {
session()->reflash();
return redirect()->to('/client/invoices/'); return redirect()->to('/client/invoices/');
} }
@ -987,7 +988,7 @@ class ClientPortalController extends BaseController
$client = $contact->client; $client = $contact->client;
$account = $contact->account; $account = $contact->account;
if (! $account->enable_client_portal || ! $account->enable_client_portal_dashboard) { if (! $account->enable_client_portal) {
return $this->returnError(); return $this->returnError();
} }
@ -1022,6 +1023,7 @@ class ClientPortalController extends BaseController
event(new \App\Events\ClientWasUpdated($client)); event(new \App\Events\ClientWasUpdated($client));
return redirect('/client/dashboard')->withMessage(trans('texts.updated_client_details')); return redirect($account->enable_client_portal_dashboard ? '/client/dashboard' : '/client/payment_methods')
->withMessage(trans('texts.updated_client_details'));
} }
} }

View File

@ -133,7 +133,7 @@
<p>&nbsp;</p> <p>&nbsp;</p>
<center> <center>
{!! Button::normal(strtoupper(trans('texts.cancel') ))->asLinkTo('/client/dashboard')->large() !!} &nbsp; {!! Button::normal(strtoupper(trans('texts.cancel') ))->asLinkTo($account->enable_client_portal_dashboard ? '/client/dashboard' : '/client/payment_methods')->large() !!} &nbsp;
{!! Button::success(strtoupper(trans('texts.save') ))->submit()->large() !!} {!! Button::success(strtoupper(trans('texts.save') ))->submit()->large() !!}
</center> </center>

View File

@ -3,8 +3,19 @@
@section('content') @section('content')
<div class="container main-container"> <div class="container main-container">
@include('payments.paymentmethods_list') <p>&nbsp;</p>
<p></p> <div class="row">
<div class="col-xs-12">
<div class="pull-left">
@include('payments.paymentmethods_list')
</div>
<div class="pull-right">
{!! Button::success(strtoupper(trans("texts.edit_details")))->asLinkTo(URL::to('/client/details'))->withAttributes(['id' => 'editDetailsButton']) !!}
</div>
</div>
</div>
<p>&nbsp;</p>
</div> </div>
@stop @stop

View File

@ -106,11 +106,6 @@
{!! link_to('/client/documents', trans('texts.documents') ) !!} {!! link_to('/client/documents', trans('texts.documents') ) !!}
</li> </li>
@endif @endif
@if (isset($hasPaymentMethods) && $hasPaymentMethods)
<li {!! Request::is('*client/payment_methods') ? 'class="active"' : '' !!}>
{!! link_to('/client/payment_methods', trans('texts.payment_methods') ) !!}
</li>
@endif
<li {!! Request::is('*client/payments') ? 'class="active"' : '' !!}> <li {!! Request::is('*client/payments') ? 'class="active"' : '' !!}>
{!! link_to('/client/payments', trans('texts.payments') ) !!} {!! link_to('/client/payments', trans('texts.payments') ) !!}
</li> </li>
@ -119,6 +114,11 @@
{!! link_to('/client/credits', trans('texts.credits') ) !!} {!! link_to('/client/credits', trans('texts.credits') ) !!}
</li> </li>
@endif @endif
@if (isset($hasPaymentMethods) && $hasPaymentMethods)
<li {!! Request::is('*client/payment_methods') ? 'class="active"' : '' !!}>
{!! link_to('/client/payment_methods', trans('texts.payment_methods') ) !!}
</li>
@endif
@if ($account->enable_portal_password && request()->contact->password) @if ($account->enable_portal_password && request()->contact->password)
<li> <li>
{!! link_to('/client/logout', trans('texts.logout')) !!} {!! link_to('/client/logout', trans('texts.logout')) !!}