mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Fixes for Google Maps (#2652)
This commit is contained in:
parent
febb465c71
commit
8eaa382604
@ -6,19 +6,6 @@
|
||||
<script src="{{ asset('js/select2.min.js') }}" type="text/javascript"></script>
|
||||
<link href="{{ asset('css/select2.css') }}" rel="stylesheet" type="text/css"/>
|
||||
|
||||
@if ($client->showMap())
|
||||
<style>
|
||||
#map {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #ddd;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key={{ env('GOOGLE_MAPS_API_KEY') }}"></script>
|
||||
@endif
|
||||
@stop
|
||||
|
||||
|
||||
@ -86,23 +73,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($client->last_login > 0)
|
||||
<h3 style="margin-top:0px"><small>
|
||||
{{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)) }}
|
||||
</small></h3>
|
||||
@endif
|
||||
@if ($client->last_login > 0)
|
||||
<h3 style="margin-top:0px"><small>
|
||||
{{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)) }}
|
||||
</small></h3>
|
||||
@endif
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3>{{ trans('texts.details') }}</h3>
|
||||
<div class="col-md-3">
|
||||
<h3>{{ trans('texts.details') }}</h3>
|
||||
@if ($client->id_number)
|
||||
<p><i class="fa fa-id-number" style="width: 20px"></i>{{ trans('texts.id_number').': '.$client->id_number }}</p>
|
||||
@endif
|
||||
@if ($client->vat_number)
|
||||
<p><i class="fa fa-vat-number" style="width: 20px"></i>{{ trans('texts.vat_number').': '.$client->vat_number }}</p>
|
||||
<p><i class="fa fa-vat-number" style="width: 20px"></i>{{ trans('texts.vat_number').': '.$client->vat_number }}</p>
|
||||
@endif
|
||||
|
||||
@if ($client->account->customLabel('client1') && $client->custom_value1)
|
||||
@ -130,7 +117,7 @@
|
||||
<p><i>{!! nl2br(e($client->private_notes)) !!}</i></p>
|
||||
@endif
|
||||
|
||||
@if ($client->industry || $client->size)
|
||||
@if ($client->industry || $client->size)
|
||||
@if ($client->industry)
|
||||
{{ $client->industry->name }}
|
||||
@endif
|
||||
@ -142,8 +129,8 @@
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if ($client->website)
|
||||
<p>{!! Utils::formatWebsite($client->website) !!}</p>
|
||||
@if ($client->website)
|
||||
<p>{!! Utils::formatWebsite($client->website) !!}</p>
|
||||
@endif
|
||||
|
||||
@if ($client->language)
|
||||
@ -160,10 +147,10 @@
|
||||
• {{ trans('texts.is_not_sent_reminders') }}</br>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3>{{ trans('texts.address') }}</h3>
|
||||
<h3>{{ trans('texts.address') }}</h3>
|
||||
|
||||
@if ($client->addressesMatch())
|
||||
{!! $client->present()->address(ADDRESS_BILLING) !!}
|
||||
@ -174,8 +161,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3>{{ trans('texts.contacts') }}</h3>
|
||||
<div class="col-md-3">
|
||||
<h3>{{ trans('texts.contacts') }}</h3>
|
||||
@foreach ($client->contacts as $contact)
|
||||
@if ($contact->first_name || $contact->last_name)
|
||||
<b>{{ $contact->first_name.' '.$contact->last_name }}</b><br/>
|
||||
@ -206,78 +193,81 @@
|
||||
@endif
|
||||
<br/>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3>{{ trans('texts.standing') }}
|
||||
<table class="table" style="width:100%">
|
||||
<tr>
|
||||
<td><small>{{ trans('texts.paid_to_date') }}</small></td>
|
||||
<td style="text-align: right">{{ Utils::formatMoney($client->paid_to_date, $client->getCurrencyId()) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><small>{{ trans('texts.balance') }}</small></td>
|
||||
<td style="text-align: right">{{ Utils::formatMoney($client->balance, $client->getCurrencyId()) }}</td>
|
||||
</tr>
|
||||
@if ($credit > 0)
|
||||
<tr>
|
||||
<td><small>{{ trans('texts.credit') }}</small></td>
|
||||
<td style="text-align: right">{{ Utils::formatMoney($credit, $client->getCurrencyId()) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{ trans('texts.standing') }}
|
||||
<table class="table" style="width:100%">
|
||||
<tr>
|
||||
<td><small>{{ trans('texts.paid_to_date') }}</small></td>
|
||||
<td style="text-align: right">{{ Utils::formatMoney($client->paid_to_date, $client->getCurrencyId()) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><small>{{ trans('texts.balance') }}</small></td>
|
||||
<td style="text-align: right">{{ Utils::formatMoney($client->balance, $client->getCurrencyId()) }}</td>
|
||||
</tr>
|
||||
@if ($credit > 0)
|
||||
<tr>
|
||||
<td><small>{{ trans('texts.credit') }}</small></td>
|
||||
<td style="text-align: right">{{ Utils::formatMoney($credit, $client->getCurrencyId()) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($client->showMap())
|
||||
<div id="map"></div>
|
||||
<br/>
|
||||
|
||||
<iframe
|
||||
width="100%"
|
||||
height="200px"
|
||||
frameborder="0" style="border:0"
|
||||
src="https://www.google.com/maps/embed/v1/place?key={{ env('GOOGLE_MAPS_API_KEY') }}&q={!! e("{$client->address1} {$client->address2} {$client->city} {$client->state} {$client->postal_code} " . ($client->country ? $client->country->getName() : '')) !!}" allowfullscreen>
|
||||
</iframe>
|
||||
|
||||
@endif
|
||||
|
||||
<ul class="nav nav-tabs nav-justified">
|
||||
{!! Form::tab_link('#activity', trans('texts.activity'), true) !!}
|
||||
<ul class="nav nav-tabs nav-justified">
|
||||
{!! Form::tab_link('#activity', trans('texts.activity'), true) !!}
|
||||
@if ($hasTasks)
|
||||
{!! Form::tab_link('#tasks', trans('texts.tasks')) !!}
|
||||
@endif
|
||||
@if ($hasExpenses)
|
||||
{!! Form::tab_link('#expenses', trans('texts.expenses')) !!}
|
||||
@endif
|
||||
@if ($hasRecurringQuotes)
|
||||
{!! Form::tab_link('#recurring_quotes', trans('texts.recurring_quotes')) !!}
|
||||
@if ($hasQuotes)
|
||||
{!! Form::tab_link('#quotes', trans('texts.quotes')) !!}
|
||||
@endif
|
||||
@if ($hasQuotes)
|
||||
{!! Form::tab_link('#quotes', trans('texts.quotes')) !!}
|
||||
@endif
|
||||
@if ($hasRecurringInvoices)
|
||||
{!! Form::tab_link('#recurring_invoices', trans('texts.recurring_invoices')) !!}
|
||||
{!! Form::tab_link('#recurring_invoices', trans('texts.recurring')) !!}
|
||||
@endif
|
||||
{!! Form::tab_link('#invoices', trans('texts.invoices')) !!}
|
||||
{!! Form::tab_link('#payments', trans('texts.payments')) !!}
|
||||
{!! Form::tab_link('#invoices', trans('texts.invoices')) !!}
|
||||
{!! Form::tab_link('#payments', trans('texts.payments')) !!}
|
||||
@if ($account->isModuleEnabled(ENTITY_CREDIT))
|
||||
{!! Form::tab_link('#credits', trans('texts.credits')) !!}
|
||||
@endif
|
||||
</ul><br/>
|
||||
</ul><br/>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane active" id="activity">
|
||||
{!! Datatable::table()
|
||||
->addColumn(
|
||||
trans('texts.date'),
|
||||
trans('texts.message'),
|
||||
trans('texts.balance'),
|
||||
trans('texts.adjustment'))
|
||||
->setUrl(url('api/activities/'. $client->public_id))
|
||||
{!! Datatable::table()
|
||||
->addColumn(
|
||||
trans('texts.date'),
|
||||
trans('texts.message'),
|
||||
trans('texts.balance'),
|
||||
trans('texts.adjustment'))
|
||||
->setUrl(url('api/activities/'. $client->public_id))
|
||||
->setCustomValues('entityType', 'activity')
|
||||
->setCustomValues('clientId', $client->public_id)
|
||||
->setCustomValues('rightAlign', [2, 3])
|
||||
->setOptions('sPaginationType', 'bootstrap')
|
||||
->setOptions('bFilter', false)
|
||||
->setOptions('aaSorting', [['0', 'desc']])
|
||||
->render('datatable') !!}
|
||||
->setOptions('sPaginationType', 'bootstrap')
|
||||
->setOptions('bFilter', false)
|
||||
->setOptions('aaSorting', [['0', 'desc']])
|
||||
->render('datatable') !!}
|
||||
</div>
|
||||
|
||||
@if ($hasTasks)
|
||||
@ -323,18 +313,8 @@
|
||||
])
|
||||
</div>
|
||||
@endif
|
||||
@if ($hasRecurringQuotes)
|
||||
<div class="tab-pane" id="recurring_quotes">
|
||||
@include('list', [
|
||||
'entityType' => ENTITY_RECURRING_QUOTE,
|
||||
'datatable' => new \App\Ninja\Datatables\RecurringInvoiceDatatable(true, true),
|
||||
'clientId' => $client->public_id,
|
||||
'url' => url('api/recurring_quotes/' . $client->public_id),
|
||||
])
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="tab-pane" id="invoices">
|
||||
<div class="tab-pane" id="invoices">
|
||||
@include('list', [
|
||||
'entityType' => ENTITY_INVOICE,
|
||||
'datatable' => new \App\Ninja\Datatables\InvoiceDatatable(true, true),
|
||||
@ -390,17 +370,17 @@
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
var loadedTabs = {};
|
||||
|
||||
$(function() {
|
||||
$('.normalDropDown:not(.dropdown-toggle)').click(function(event) {
|
||||
$(function() {
|
||||
$('.normalDropDown:not(.dropdown-toggle)').click(function(event) {
|
||||
openUrlOnClick('{{ URL::to('clients/' . $client->public_id . '/edit') }}', event);
|
||||
});
|
||||
$('.primaryDropDown:not(.dropdown-toggle)').click(function(event) {
|
||||
});
|
||||
$('.primaryDropDown:not(.dropdown-toggle)').click(function(event) {
|
||||
openUrlOnClick('{{ URL::to('clients/statement/' . $client->public_id ) }}', event);
|
||||
});
|
||||
});
|
||||
|
||||
// load datatable data when tab is shown and remember last tab selected
|
||||
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
||||
@ -424,31 +404,31 @@
|
||||
} else {
|
||||
window['load_activity']();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function onArchiveClick() {
|
||||
$('#action').val('archive');
|
||||
$('.mainForm').submit();
|
||||
}
|
||||
function onArchiveClick() {
|
||||
$('#action').val('archive');
|
||||
$('.mainForm').submit();
|
||||
}
|
||||
|
||||
function onRestoreClick() {
|
||||
$('#action').val('restore');
|
||||
$('.mainForm').submit();
|
||||
}
|
||||
function onRestoreClick() {
|
||||
$('#action').val('restore');
|
||||
$('.mainForm').submit();
|
||||
}
|
||||
|
||||
function onDeleteClick() {
|
||||
sweetConfirm(function() {
|
||||
$('#action').val('delete');
|
||||
$('.mainForm').submit();
|
||||
});
|
||||
}
|
||||
sweetConfirm(function() {
|
||||
$('#action').val('delete');
|
||||
$('.mainForm').submit();
|
||||
});
|
||||
}
|
||||
|
||||
function onPurgeClick() {
|
||||
sweetConfirm(function() {
|
||||
$('#action').val('purge');
|
||||
$('.mainForm').submit();
|
||||
}, "{{ trans('texts.purge_client_warning') . "\\n\\n" . trans('texts.mobile_refresh_warning') . "\\n\\n" . trans('texts.no_undo') }}");
|
||||
}
|
||||
sweetConfirm(function() {
|
||||
$('#action').val('purge');
|
||||
$('.mainForm').submit();
|
||||
}, "{{ trans('texts.purge_client_warning') . "\\n\\n" . trans('texts.mobile_refresh_warning') . "\\n\\n" . trans('texts.no_undo') }}");
|
||||
}
|
||||
|
||||
function showEmailHistory(email) {
|
||||
window.emailBounceId = false;
|
||||
@ -469,50 +449,6 @@
|
||||
})
|
||||
}
|
||||
|
||||
@if ($client->showMap())
|
||||
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)
|
||||
var address = {!! json_encode(e("{$client->address1} {$client->address2} {$client->city} {$client->state} {$client->postal_code} " . ($client->country ? $client->country->getName() : ''))) !!};
|
||||
|
||||
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);
|
||||
|
||||
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,
|
||||
map: map,
|
||||
title:address,
|
||||
});
|
||||
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
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@stop
|
||||
|
Loading…
Reference in New Issue
Block a user