2015-03-16 22:45:25 +01:00
|
|
|
@extends('header')
|
|
|
|
|
2015-10-06 19:55:55 +02:00
|
|
|
@section('head')
|
|
|
|
@parent
|
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
<script src="{{ asset('js/select2.min.js') }}" type="text/javascript"></script>
|
|
|
|
<link href="{{ asset('css/select2.css') }}" rel="stylesheet" type="text/css"/>
|
|
|
|
|
2016-12-25 08:57:33 +01:00
|
|
|
@if ($client->showMap())
|
2015-10-06 19:55:55 +02:00
|
|
|
<style>
|
|
|
|
#map {
|
|
|
|
width: 100%;
|
|
|
|
height: 200px;
|
|
|
|
border-width: 1px;
|
|
|
|
border-style: solid;
|
|
|
|
border-color: #ddd;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2016-03-22 13:38:22 +01:00
|
|
|
<script src="https://maps.googleapis.com/maps/api/js?key={{ env('GOOGLE_MAPS_API_KEY') }}"></script>
|
2015-10-06 19:55:55 +02:00
|
|
|
@endif
|
|
|
|
@stop
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
|
2015-10-06 19:55:55 +02:00
|
|
|
@section('content')
|
|
|
|
|
2016-02-04 19:36:39 +01:00
|
|
|
<div class="row">
|
2016-02-22 11:26:26 +01:00
|
|
|
<div class="col-md-7">
|
2016-10-18 16:55:07 +02:00
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li>{{ link_to('/clients', trans('texts.clients')) }}</li>
|
|
|
|
<li class='active'>{{ $client->getDisplayName() }}</li> {!! $client->present()->statusLabel !!}
|
|
|
|
</ol>
|
2016-02-04 19:36:39 +01:00
|
|
|
</div>
|
2016-02-22 11:26:26 +01:00
|
|
|
<div class="col-md-5">
|
2016-02-04 19:36:39 +01:00
|
|
|
<div class="pull-right">
|
2018-03-14 12:03:30 +01:00
|
|
|
{!! Former::open('clients/bulk')->autocomplete('off')->addClass('mainForm') !!}
|
2016-02-04 19:36:39 +01:00
|
|
|
<div style="display:none">
|
|
|
|
{!! Former::text('action') !!}
|
|
|
|
{!! Former::text('public_id')->value($client->public_id) !!}
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-02-04 19:36:39 +01:00
|
|
|
@if ($gatewayLink)
|
2016-06-20 16:14:43 +02:00
|
|
|
{!! Button::normal(trans('texts.view_in_gateway', ['gateway'=>$gatewayName]))
|
|
|
|
->asLinkTo($gatewayLink)
|
|
|
|
->withAttributes(['target' => '_blank']) !!}
|
2016-02-04 19:36:39 +01:00
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-10-10 10:40:04 +02:00
|
|
|
@if ( ! $client->is_deleted)
|
2016-04-26 03:53:39 +02:00
|
|
|
@can('edit', $client)
|
2016-10-10 10:40:04 +02:00
|
|
|
{!! DropdownButton::normal(trans('texts.edit_client'))
|
|
|
|
->withAttributes(['class'=>'normalDropDown'])
|
|
|
|
->withContents([
|
|
|
|
($client->trashed() ? false : ['label' => trans('texts.archive_client'), 'url' => "javascript:onArchiveClick()"]),
|
|
|
|
['label' => trans('texts.delete_client'), 'url' => "javascript:onDeleteClick()"],
|
2018-03-14 18:51:49 +01:00
|
|
|
auth()->user()->is_admin ? \DropdownButton::DIVIDER : false,
|
|
|
|
auth()->user()->is_admin ? ['label' => trans('texts.purge_client'), 'url' => "javascript:onPurgeClick()"] : false,
|
2016-10-10 10:40:04 +02:00
|
|
|
]
|
|
|
|
)->split() !!}
|
2016-04-26 03:53:39 +02:00
|
|
|
@endcan
|
2016-10-10 10:40:04 +02:00
|
|
|
@if ( ! $client->trashed())
|
|
|
|
@can('create', ENTITY_INVOICE)
|
2017-01-23 16:00:44 +01:00
|
|
|
{!! DropdownButton::primary(trans('texts.view_statement'))
|
2016-10-10 10:40:04 +02:00
|
|
|
->withAttributes(['class'=>'primaryDropDown'])
|
|
|
|
->withContents($actionLinks)->split() !!}
|
|
|
|
@endcan
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($client->trashed())
|
2016-04-26 03:53:39 +02:00
|
|
|
@can('edit', $client)
|
2018-04-26 09:28:50 +02:00
|
|
|
@if (auth()->user()->is_admin)
|
|
|
|
{!! Button::danger(trans('texts.purge_client'))
|
|
|
|
->appendIcon(Icon::create('warning-sign'))
|
|
|
|
->withAttributes(['onclick' => 'onPurgeClick()']) !!}
|
|
|
|
@endif
|
2016-10-10 10:40:04 +02:00
|
|
|
{!! Button::primary(trans('texts.restore_client'))
|
|
|
|
->appendIcon(Icon::create('cloud-download'))
|
|
|
|
->withAttributes(['onclick' => 'onRestoreClick()']) !!}
|
2016-04-26 03:53:39 +02:00
|
|
|
@endcan
|
2016-02-04 19:36:39 +01:00
|
|
|
@endif
|
2016-10-10 10:40:04 +02:00
|
|
|
|
|
|
|
|
2016-02-04 19:36:39 +01:00
|
|
|
{!! Former::close() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-02-04 19:36:39 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
@if ($client->last_login > 0)
|
|
|
|
<h3 style="margin-top:0px"><small>
|
2015-03-26 07:24:02 +01:00
|
|
|
{{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)) }}
|
2015-03-16 22:45:25 +01:00
|
|
|
</small></h3>
|
|
|
|
@endif
|
|
|
|
|
2015-04-21 22:09:45 +02:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-body">
|
2015-03-16 22:45:25 +01:00
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
<h3>{{ trans('texts.details') }}</h3>
|
2015-03-31 20:50:58 +02:00
|
|
|
@if ($client->id_number)
|
2015-04-01 17:44:55 +02:00
|
|
|
<p><i class="fa fa-id-number" style="width: 20px"></i>{{ trans('texts.id_number').': '.$client->id_number }}</p>
|
2015-03-31 20:50:58 +02:00
|
|
|
@endif
|
2015-04-01 17:44:55 +02:00
|
|
|
@if ($client->vat_number)
|
|
|
|
<p><i class="fa fa-vat-number" style="width: 20px"></i>{{ trans('texts.vat_number').': '.$client->vat_number }}</p>
|
|
|
|
@endif
|
|
|
|
|
2018-04-04 15:24:59 +02:00
|
|
|
@if ($client->account->customLabel('client1') && $client->custom_value1)
|
2018-04-05 12:12:03 +02:00
|
|
|
{{ $client->account->present()->customLabel('client1') . ': ' }} {!! nl2br(e($client->custom_value1)) !!}<br/>
|
2015-04-01 17:44:55 +02:00
|
|
|
@endif
|
2018-04-04 15:24:59 +02:00
|
|
|
@if ($client->account->customLabel('client2') && $client->custom_value2)
|
2018-04-05 12:12:03 +02:00
|
|
|
{{ $client->account->present()->customLabel('client2') . ': ' }} {!! nl2br(e($client->custom_value2)) !!}<br/>
|
2015-04-01 17:44:55 +02:00
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($client->work_phone)
|
2015-10-06 19:55:55 +02:00
|
|
|
<i class="fa fa-phone" style="width: 20px"></i>{{ $client->work_phone }}
|
2015-04-01 17:44:55 +02:00
|
|
|
@endif
|
|
|
|
|
2017-10-17 12:57:20 +02:00
|
|
|
@if (floatval($client->task_rate))
|
|
|
|
<p>{{ trans('texts.task_rate') }}: {{ Utils::roundSignificant($client->task_rate) }}</p>
|
|
|
|
@endif
|
|
|
|
|
2017-11-20 09:56:02 +01:00
|
|
|
<p/>
|
|
|
|
|
2017-05-16 15:00:56 +02:00
|
|
|
@if ($client->public_notes)
|
2018-01-08 11:06:09 +01:00
|
|
|
<p><i>{!! nl2br(e($client->public_notes)) !!}</i></p>
|
2017-05-16 15:00:56 +02:00
|
|
|
@endif
|
|
|
|
|
2015-04-01 17:44:55 +02:00
|
|
|
@if ($client->private_notes)
|
2018-01-08 11:06:09 +01:00
|
|
|
<p><i>{!! nl2br(e($client->private_notes)) !!}</i></p>
|
2015-04-01 17:44:55 +02:00
|
|
|
@endif
|
2016-06-20 16:14:43 +02:00
|
|
|
|
2018-01-20 20:50:32 +01:00
|
|
|
@if ($client->industry || $client->size)
|
2018-03-13 07:14:24 +01:00
|
|
|
@if ($client->industry)
|
|
|
|
{{ $client->industry->name }}
|
|
|
|
@endif
|
2018-01-20 20:50:32 +01:00
|
|
|
@if ($client->industry && $client->size)
|
|
|
|
|
|
|
|
|
@endif
|
2018-02-26 18:53:31 +01:00
|
|
|
@if ($client->size)
|
|
|
|
{{ $client->size->name }}<br/>
|
|
|
|
@endif
|
2016-06-20 16:14:43 +02:00
|
|
|
@endif
|
2015-04-01 17:44:55 +02:00
|
|
|
|
|
|
|
@if ($client->website)
|
2015-10-13 17:44:01 +02:00
|
|
|
<p>{!! Utils::formatWebsite($client->website) !!}</p>
|
2015-04-01 17:44:55 +02:00
|
|
|
@endif
|
|
|
|
|
2015-09-10 19:50:09 +02:00
|
|
|
@if ($client->language)
|
|
|
|
<p><i class="fa fa-language" style="width: 20px"></i>{{ $client->language->name }}</p>
|
|
|
|
@endif
|
|
|
|
|
2017-02-01 12:09:26 +01:00
|
|
|
<p>{{ $client->present()->paymentTerms }}</p>
|
2017-11-30 18:33:27 +01:00
|
|
|
|
|
|
|
<div class="text-muted" style="padding-top:8px">
|
|
|
|
@if ($client->show_tasks_in_portal)
|
|
|
|
• {{ trans('texts.can_view_tasks') }}<br/>
|
|
|
|
@endif
|
|
|
|
@if ($client->account->hasReminders() && ! $client->send_reminders)
|
|
|
|
• {{ trans('texts.is_not_sent_reminders') }}</br>
|
|
|
|
@endif
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
|
2017-11-19 21:34:34 +01:00
|
|
|
<div class="col-md-3">
|
|
|
|
<h3>{{ trans('texts.address') }}</h3>
|
|
|
|
|
2018-02-14 13:05:40 +01:00
|
|
|
@if ($client->addressesMatch())
|
|
|
|
{!! $client->present()->address(ADDRESS_BILLING) !!}
|
|
|
|
@else
|
|
|
|
{!! $client->present()->address(ADDRESS_BILLING, true) !!}<br/>
|
|
|
|
{!! $client->present()->address(ADDRESS_SHIPPING, true) !!}
|
|
|
|
@endif
|
2017-11-19 21:34:34 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
<div class="col-md-3">
|
|
|
|
<h3>{{ trans('texts.contacts') }}</h3>
|
2018-03-29 09:56:20 +02:00
|
|
|
@foreach ($client->contacts as $contact)
|
2015-04-01 17:44:55 +02:00
|
|
|
@if ($contact->first_name || $contact->last_name)
|
|
|
|
<b>{{ $contact->first_name.' '.$contact->last_name }}</b><br/>
|
|
|
|
@endif
|
|
|
|
@if ($contact->email)
|
2018-03-29 09:56:20 +02:00
|
|
|
<i class="fa fa-envelope" style="width: 20px"></i>{!! HTML::mailto($contact->email, $contact->email) !!}<br/>
|
2015-04-01 17:44:55 +02:00
|
|
|
@endif
|
|
|
|
@if ($contact->phone)
|
2015-10-06 19:55:55 +02:00
|
|
|
<i class="fa fa-phone" style="width: 20px"></i>{{ $contact->phone }}<br/>
|
2016-05-24 23:02:28 +02:00
|
|
|
@endif
|
2017-04-16 13:31:14 +02:00
|
|
|
|
2018-04-04 15:24:59 +02:00
|
|
|
@if ($client->account->customLabel('contact1') && $contact->custom_value1)
|
|
|
|
{{ $client->account->present()->customLabel('contact1') . ': ' . $contact->custom_value1 }}<br/>
|
2017-04-16 13:31:14 +02:00
|
|
|
@endif
|
2018-04-04 15:24:59 +02:00
|
|
|
@if ($client->account->customLabel('contact2') && $contact->custom_value2)
|
|
|
|
{{ $client->account->present()->customLabel('contact2') . ': ' . $contact->custom_value2 }}<br/>
|
2017-04-16 13:31:14 +02:00
|
|
|
@endif
|
|
|
|
|
2016-09-06 11:12:36 +02:00
|
|
|
@if (Auth::user()->confirmed && $client->account->enable_client_portal)
|
2017-02-19 21:47:16 +01:00
|
|
|
<i class="fa fa-dashboard" style="width: 20px"></i><a href="{{ $contact->link }}"
|
2018-03-29 09:56:20 +02:00
|
|
|
onclick="window.open('{{ $contact->link }}?silent=true', '_blank');return false;">{{ trans('texts.view_in_portal') }}</a>
|
|
|
|
@if (config('services.postmark'))
|
|
|
|
| <a href="#" onclick="showEmailHistory('{{ $contact->email }}')">
|
|
|
|
{{ trans('texts.email_history') }}
|
|
|
|
</a>
|
|
|
|
@endif
|
|
|
|
<br/>
|
2016-07-04 20:47:05 +02:00
|
|
|
@endif
|
2017-02-26 13:09:57 +01:00
|
|
|
<br/>
|
2018-03-29 09:56:20 +02:00
|
|
|
@endforeach
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
|
2017-11-19 21:34:34 +01:00
|
|
|
<div class="col-md-3">
|
2015-03-16 22:45:25 +01:00
|
|
|
<h3>{{ trans('texts.standing') }}
|
2015-10-06 19:55:55 +02:00
|
|
|
<table class="table" style="width:100%">
|
2015-03-16 22:45:25 +01:00
|
|
|
<tr>
|
|
|
|
<td><small>{{ trans('texts.paid_to_date') }}</small></td>
|
2015-06-10 10:34:20 +02:00
|
|
|
<td style="text-align: right">{{ Utils::formatMoney($client->paid_to_date, $client->getCurrencyId()) }}</td>
|
2015-03-16 22:45:25 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><small>{{ trans('texts.balance') }}</small></td>
|
2015-06-10 10:34:20 +02:00
|
|
|
<td style="text-align: right">{{ Utils::formatMoney($client->balance, $client->getCurrencyId()) }}</td>
|
2015-03-16 22:45:25 +01:00
|
|
|
</tr>
|
|
|
|
@if ($credit > 0)
|
|
|
|
<tr>
|
|
|
|
<td><small>{{ trans('texts.credit') }}</small></td>
|
2015-06-10 10:34:20 +02:00
|
|
|
<td style="text-align: right">{{ Utils::formatMoney($credit, $client->getCurrencyId()) }}</td>
|
2015-03-16 22:45:25 +01:00
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
</table>
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-04-21 22:09:45 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-12-25 08:57:33 +01:00
|
|
|
@if ($client->showMap())
|
2015-10-06 19:55:55 +02:00
|
|
|
<div id="map"></div>
|
|
|
|
<br/>
|
|
|
|
@endif
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
<ul class="nav nav-tabs nav-justified">
|
2016-03-02 14:36:42 +01:00
|
|
|
{!! Form::tab_link('#activity', trans('texts.activity'), true) !!}
|
2018-03-15 22:07:20 +01:00
|
|
|
@if ($hasTasks)
|
2016-03-02 14:36:42 +01:00
|
|
|
{!! Form::tab_link('#tasks', trans('texts.tasks')) !!}
|
2015-05-27 18:52:10 +02:00
|
|
|
@endif
|
2018-03-15 22:07:20 +01:00
|
|
|
@if ($hasExpenses)
|
|
|
|
{!! Form::tab_link('#expenses', trans('texts.expenses')) !!}
|
|
|
|
@endif
|
|
|
|
@if ($hasQuotes)
|
2016-03-02 14:36:42 +01:00
|
|
|
{!! Form::tab_link('#quotes', trans('texts.quotes')) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
2016-11-24 10:22:37 +01:00
|
|
|
@if ($hasRecurringInvoices)
|
|
|
|
{!! Form::tab_link('#recurring_invoices', trans('texts.recurring')) !!}
|
|
|
|
@endif
|
2016-03-02 14:36:42 +01:00
|
|
|
{!! Form::tab_link('#invoices', trans('texts.invoices')) !!}
|
|
|
|
{!! Form::tab_link('#payments', trans('texts.payments')) !!}
|
2018-03-15 22:07:20 +01:00
|
|
|
@if ($account->isModuleEnabled(ENTITY_CREDIT))
|
|
|
|
{!! Form::tab_link('#credits', trans('texts.credits')) !!}
|
|
|
|
@endif
|
2016-11-24 10:22:37 +01:00
|
|
|
</ul><br/>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
|
|
|
|
<div class="tab-pane active" id="activity">
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Datatable::table()
|
2015-03-16 22:45:25 +01:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.date'),
|
|
|
|
trans('texts.message'),
|
|
|
|
trans('texts.balance'),
|
|
|
|
trans('texts.adjustment'))
|
|
|
|
->setUrl(url('api/activities/'. $client->public_id))
|
2015-11-29 17:00:50 +01:00
|
|
|
->setCustomValues('entityType', 'activity')
|
2016-11-25 11:53:35 +01:00
|
|
|
->setCustomValues('clientId', $client->public_id)
|
2016-12-25 22:43:57 +01:00
|
|
|
->setCustomValues('rightAlign', [2, 3])
|
2015-03-16 22:45:25 +01:00
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
|
|
|
->setOptions('aaSorting', [['0', 'desc']])
|
2015-03-26 07:24:02 +01:00
|
|
|
->render('datatable') !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
|
2015-05-27 18:52:10 +02:00
|
|
|
@if ($hasTasks)
|
|
|
|
<div class="tab-pane" id="tasks">
|
2016-11-24 10:22:37 +01:00
|
|
|
@include('list', [
|
|
|
|
'entityType' => ENTITY_TASK,
|
|
|
|
'datatable' => new \App\Ninja\Datatables\TaskDatatable(true, true),
|
|
|
|
'clientId' => $client->public_id,
|
|
|
|
])
|
2015-05-27 18:52:10 +02:00
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2018-03-15 22:07:20 +01:00
|
|
|
@if ($hasExpenses)
|
|
|
|
<div class="tab-pane" id="expenses">
|
|
|
|
@include('list', [
|
|
|
|
'entityType' => ENTITY_EXPENSE,
|
|
|
|
'datatable' => new \App\Ninja\Datatables\ExpenseDatatable(true, true),
|
|
|
|
'clientId' => $client->public_id,
|
|
|
|
])
|
|
|
|
</div>
|
|
|
|
@endif
|
2015-05-27 18:52:10 +02:00
|
|
|
|
2016-04-19 04:35:18 +02:00
|
|
|
@if (Utils::hasFeature(FEATURE_QUOTES) && $hasQuotes)
|
2015-03-16 22:45:25 +01:00
|
|
|
<div class="tab-pane" id="quotes">
|
2016-11-24 10:22:37 +01:00
|
|
|
@include('list', [
|
|
|
|
'entityType' => ENTITY_QUOTE,
|
|
|
|
'datatable' => new \App\Ninja\Datatables\InvoiceDatatable(true, true, ENTITY_QUOTE),
|
|
|
|
'clientId' => $client->public_id,
|
|
|
|
])
|
|
|
|
</div>
|
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
@if ($hasRecurringInvoices)
|
|
|
|
<div class="tab-pane" id="recurring_invoices">
|
|
|
|
@include('list', [
|
|
|
|
'entityType' => ENTITY_RECURRING_INVOICE,
|
|
|
|
'datatable' => new \App\Ninja\Datatables\RecurringInvoiceDatatable(true, true),
|
|
|
|
'clientId' => $client->public_id,
|
|
|
|
])
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
<div class="tab-pane" id="invoices">
|
2016-11-24 10:22:37 +01:00
|
|
|
@include('list', [
|
|
|
|
'entityType' => ENTITY_INVOICE,
|
|
|
|
'datatable' => new \App\Ninja\Datatables\InvoiceDatatable(true, true),
|
|
|
|
'clientId' => $client->public_id,
|
|
|
|
])
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
|
2016-11-24 10:22:37 +01:00
|
|
|
<div class="tab-pane" id="payments">
|
|
|
|
@include('list', [
|
|
|
|
'entityType' => ENTITY_PAYMENT,
|
|
|
|
'datatable' => new \App\Ninja\Datatables\PaymentDatatable(true, true),
|
|
|
|
'clientId' => $client->public_id,
|
|
|
|
])
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
|
2018-03-15 22:07:20 +01:00
|
|
|
@if ($account->isModuleEnabled(ENTITY_CREDIT))
|
2016-11-24 10:22:37 +01:00
|
|
|
<div class="tab-pane" id="credits">
|
|
|
|
@include('list', [
|
|
|
|
'entityType' => ENTITY_CREDIT,
|
|
|
|
'datatable' => new \App\Ninja\Datatables\CreditDatatable(true, true),
|
|
|
|
'clientId' => $client->public_id,
|
|
|
|
])
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
2018-03-15 22:07:20 +01:00
|
|
|
@endif
|
2016-11-24 10:22:37 +01:00
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
|
2018-02-25 09:47:15 +01:00
|
|
|
<div class="modal fade" id="emailHistoryModal" tabindex="-1" role="dialog" aria-labelledby="emailHistoryModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<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="myModalLabel">{{ trans('texts.email_history') }}</h4>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container" style="width: 100%; padding-bottom: 0px !important">
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-body">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-footer" id="signUpFooter" style="margin-top: 0px">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.close') }} </button>
|
2018-02-25 12:51:20 +01:00
|
|
|
<button type="button" class="btn btn-danger" onclick="onReactivateClick()" id="reactivateButton" style="display:none;">{{ trans('texts.reactivate') }} </button>
|
2018-02-25 09:47:15 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
2015-11-29 17:00:50 +01:00
|
|
|
var loadedTabs = {};
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
$(function() {
|
2017-10-24 19:58:22 +02:00
|
|
|
$('.normalDropDown:not(.dropdown-toggle)').click(function(event) {
|
|
|
|
openUrlOnClick('{{ URL::to('clients/' . $client->public_id . '/edit') }}', event);
|
2015-03-16 22:45:25 +01:00
|
|
|
});
|
2017-10-24 19:58:22 +02:00
|
|
|
$('.primaryDropDown:not(.dropdown-toggle)').click(function(event) {
|
|
|
|
openUrlOnClick('{{ URL::to('clients/statement/' . $client->public_id ) }}', event);
|
2015-03-16 22:45:25 +01:00
|
|
|
});
|
2015-11-11 17:24:48 +01:00
|
|
|
|
2015-11-29 17:00:50 +01:00
|
|
|
// load datatable data when tab is shown and remember last tab selected
|
2015-11-11 17:24:48 +01:00
|
|
|
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
|
|
|
var target = $(e.target).attr("href") // activated tab
|
2015-11-29 17:00:50 +01:00
|
|
|
target = target.substring(1);
|
2017-03-20 14:40:10 +01:00
|
|
|
if (isStorageSupported()) {
|
|
|
|
localStorage.setItem('client_tab', target);
|
|
|
|
}
|
2017-07-17 12:51:20 +02:00
|
|
|
if (!loadedTabs.hasOwnProperty(target) && window['load_' + target]) {
|
2015-11-29 17:00:50 +01:00
|
|
|
loadedTabs[target] = true;
|
|
|
|
window['load_' + target]();
|
|
|
|
}
|
2015-11-11 17:24:48 +01:00
|
|
|
});
|
2016-12-04 11:24:48 +01:00
|
|
|
|
|
|
|
var tab = window.location.hash || (localStorage.getItem('client_tab') || '');
|
2016-12-05 10:50:23 +01:00
|
|
|
tab = tab.replace('#', '');
|
|
|
|
var selector = '.nav-tabs a[href="#' + tab + '"]';
|
2017-07-17 12:59:44 +02:00
|
|
|
|
|
|
|
if (tab && tab != 'activity' && $(selector).length && window['load_' + tab]) {
|
2016-01-10 19:25:15 +01:00
|
|
|
$(selector).tab('show');
|
2015-11-29 17:00:50 +01:00
|
|
|
} else {
|
|
|
|
window['load_activity']();
|
2015-11-11 17:24:48 +01:00
|
|
|
}
|
2015-03-16 22:45:25 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
function onArchiveClick() {
|
|
|
|
$('#action').val('archive');
|
|
|
|
$('.mainForm').submit();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onRestoreClick() {
|
|
|
|
$('#action').val('restore');
|
|
|
|
$('.mainForm').submit();
|
|
|
|
}
|
|
|
|
|
2018-03-14 18:51:49 +01:00
|
|
|
function onDeleteClick() {
|
2016-07-28 18:55:23 +02:00
|
|
|
sweetConfirm(function() {
|
2015-03-16 22:45:25 +01:00
|
|
|
$('#action').val('delete');
|
|
|
|
$('.mainForm').submit();
|
2016-07-28 18:55:23 +02:00
|
|
|
});
|
2015-03-16 22:45:25 +01:00
|
|
|
}
|
|
|
|
|
2018-03-14 18:51:49 +01:00
|
|
|
function onPurgeClick() {
|
|
|
|
sweetConfirm(function() {
|
|
|
|
$('#action').val('purge');
|
|
|
|
$('.mainForm').submit();
|
|
|
|
}, "{{ trans('texts.purge_client_warning') . "\\n\\n" . trans('texts.no_undo') }}");
|
|
|
|
}
|
|
|
|
|
2018-02-25 09:47:15 +01:00
|
|
|
function showEmailHistory(email) {
|
2018-02-25 12:51:20 +01:00
|
|
|
window.emailBounceId = false;
|
2018-02-25 09:47:15 +01:00
|
|
|
$('#emailHistoryModal .panel-body').html("{{ trans('texts.loading') }}...");
|
2018-02-25 12:51:20 +01:00
|
|
|
$('#reactivateButton').hide();
|
2018-02-25 09:47:15 +01:00
|
|
|
$('#emailHistoryModal').modal('show');
|
|
|
|
$.post('{{ url('/email_history') }}', {email: email}, function(data) {
|
2018-02-25 12:51:20 +01:00
|
|
|
$('#emailHistoryModal .panel-body').html(data.str);
|
|
|
|
window.emailBounceId = data.bounce_id;
|
|
|
|
$('#reactivateButton').toggle(!! window.emailBounceId);
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
function onReactivateClick() {
|
|
|
|
$.post('{{ url('/reactivate_email') }}/' + window.emailBounceId, function(data) {
|
|
|
|
$('#emailHistoryModal').modal('hide');
|
|
|
|
swal("{{ trans('texts.reactivated_email') }}")
|
2018-02-25 09:47:15 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2016-12-25 08:57:33 +01:00
|
|
|
@if ($client->showMap())
|
2015-10-06 19:55:55 +02:00
|
|
|
function initialize() {
|
|
|
|
var mapCanvas = document.getElementById('map');
|
|
|
|
var mapOptions = {
|
|
|
|
zoom: {{ DEFAULT_MAP_ZOOM }},
|
|
|
|
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
|
|
|
zoomControl: true,
|
|
|
|
};
|
|
|
|
|
|
|
|
var map = new google.maps.Map(mapCanvas, mapOptions)
|
2018-01-21 07:55:40 +01:00
|
|
|
var address = {!! json_encode(e("{$client->address1} {$client->address2} {$client->city} {$client->state} {$client->postal_code} " . ($client->country ? $client->country->getName() : ''))) !!};
|
2016-06-20 16:14:43 +02:00
|
|
|
|
2015-10-06 19:55:55 +02:00
|
|
|
geocoder = new google.maps.Geocoder();
|
|
|
|
geocoder.geocode( { 'address': address}, function(results, status) {
|
|
|
|
if (status == google.maps.GeocoderStatus.OK) {
|
|
|
|
if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
|
|
|
|
var result = results[0];
|
|
|
|
map.setCenter(result.geometry.location);
|
2016-06-20 16:14:43 +02:00
|
|
|
|
2015-10-06 19:55:55 +02:00
|
|
|
var infowindow = new google.maps.InfoWindow(
|
|
|
|
{ content: '<b>'+result.formatted_address+'</b>',
|
|
|
|
size: new google.maps.Size(150, 50)
|
|
|
|
});
|
|
|
|
|
|
|
|
var marker = new google.maps.Marker({
|
|
|
|
position: result.geometry.location,
|
2016-06-20 16:14:43 +02:00
|
|
|
map: map,
|
2015-10-06 19:55:55 +02:00
|
|
|
title:address,
|
2016-06-20 16:14:43 +02:00
|
|
|
});
|
2015-10-06 19:55:55 +02:00
|
|
|
google.maps.event.addListener(marker, 'click', function() {
|
|
|
|
infowindow.open(map, marker);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
$('#map').hide();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$('#map').hide();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
google.maps.event.addDomListener(window, 'load', initialize);
|
|
|
|
@endif
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
</script>
|
|
|
|
|
2015-06-24 13:37:51 +02:00
|
|
|
@stop
|