show maps on customer view
This commit is contained in:
parent
58c4037d8c
commit
5426d9f35f
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 2024.3.23
|
||||||
|
|
||||||
|
- Maps full height
|
||||||
|
- Show Get Directions instead Coordinates
|
||||||
|
- Maps Label always show
|
||||||
|
|
||||||
## 2024.3.22
|
## 2024.3.22
|
||||||
|
|
||||||
- Fix Broadcast Message by @Focuslinkstech
|
- Fix Broadcast Message by @Focuslinkstech
|
||||||
|
@ -245,6 +245,7 @@ switch ($action) {
|
|||||||
$ui->assign('v', $v);
|
$ui->assign('v', $v);
|
||||||
$ui->assign('d', $customer);
|
$ui->assign('d', $customer);
|
||||||
$ui->assign('customFields', $customFields);
|
$ui->assign('customFields', $customFields);
|
||||||
|
$ui->assign('xheader', $leafletpickerHeader);
|
||||||
$ui->display('customers-view.tpl');
|
$ui->display('customers-view.tpl');
|
||||||
} else {
|
} else {
|
||||||
r2(U . 'customers/list', 'e', $_L['Account_Not_Found']);
|
r2(U . 'customers/list', 'e', $_L['Account_Not_Found']);
|
||||||
|
@ -37,14 +37,6 @@
|
|||||||
onclick="this.select()">
|
onclick="this.select()">
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
{if $d['coordinates']}
|
|
||||||
<li class="list-group-item">
|
|
||||||
<b>{Lang::T('Coordinates')}</b> <span class="pull-right">
|
|
||||||
<a href="https://www.google.com/maps/dir//{$d['coordinates']}/" target="_blank">Get
|
|
||||||
Directions</a>
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
{/if}
|
|
||||||
<!--Customers Attributes view start -->
|
<!--Customers Attributes view start -->
|
||||||
{if $customFields}
|
{if $customFields}
|
||||||
{foreach $customFields as $customField}
|
{foreach $customFields as $customField}
|
||||||
@ -82,6 +74,16 @@
|
|||||||
<b>{Lang::T('Last Login')}</b> <span
|
<b>{Lang::T('Last Login')}</b> <span
|
||||||
class="pull-right">{Lang::dateTimeFormat($d['last_login'])}</span>
|
class="pull-right">{Lang::dateTimeFormat($d['last_login'])}</span>
|
||||||
</li>
|
</li>
|
||||||
|
{if $d['coordinates']}
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Coordinates')}</b> <span class="pull-right">
|
||||||
|
<i class="glyphicon glyphicon-road"></i> <a style="color: black;"
|
||||||
|
href="https://www.google.com/maps/dir//{$d['coordinates']}/" target="_blank">Get
|
||||||
|
Directions</a>
|
||||||
|
</span>
|
||||||
|
<div id="map" style="width: '100%'; height: 100px;"></div>
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
@ -230,4 +232,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{if $d['coordinates']}
|
||||||
|
{literal}
|
||||||
|
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"></script>
|
||||||
|
<script>
|
||||||
|
function setupMap(lat, lon) {
|
||||||
|
var map = L.map('map').setView([lat, lon], 17);
|
||||||
|
L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/light_all/{z}/{x}/{y}.png', {
|
||||||
|
attribution:
|
||||||
|
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',
|
||||||
|
subdomains: 'abcd',
|
||||||
|
maxZoom: 20
|
||||||
|
}).addTo(map);
|
||||||
|
var marker = L.marker([lat, lon]).addTo(map);
|
||||||
|
}
|
||||||
|
window.onload = function() {
|
||||||
|
{/literal}setupMap({$d['coordinates']});{literal}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{/literal}
|
||||||
|
{/if}
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
@ -18,8 +18,8 @@
|
|||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<form id="site-search" method="post" action="{$_url}customers/list/">
|
<form id="site-search" method="post" action="{$_url}customers/list/">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" id="search-input" name="search" value="{$search}" class="form-control"
|
<input type="text" id="search-input" name="search" value="{$search}"
|
||||||
placeholder="{Lang::T('Search')}...">
|
class="form-control" placeholder="{Lang::T('Search')}...">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success" type="submit"><span
|
<button class="btn btn-success" type="submit"><span
|
||||||
class="fa fa-search"></span></button>
|
class="fa fa-search"></span></button>
|
||||||
@ -28,8 +28,8 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<a href="{$_url}customers/add" class="btn btn-primary btn-block"><i
|
<a href="{$_url}customers/add" class="btn btn-primary btn-block"><i class="ion ion-android-add">
|
||||||
class="ion ion-android-add"> </i> {Lang::T('Add New Contact')}</a>
|
</i> {Lang::T('Add New Contact')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive table_mobile">
|
<div class="table-responsive table_mobile">
|
||||||
@ -83,14 +83,14 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Functionality to filter table rows based on admin input
|
// Functionality to filter table rows based on admin input
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
var searchInput = document.getElementById('search-input');
|
var searchInput = document.getElementById('search-input');
|
||||||
var tableRows = document.querySelectorAll('tbody tr');
|
var tableRows = document.querySelectorAll('tbody tr');
|
||||||
|
|
||||||
searchInput.addEventListener('input', function () {
|
searchInput.addEventListener('input', function() {
|
||||||
var searchText = this.value.toLowerCase();
|
var searchText = this.value.toLowerCase();
|
||||||
|
|
||||||
tableRows.forEach(function (row) {
|
tableRows.forEach(function(row) {
|
||||||
var rowData = row.textContent.toLowerCase();
|
var rowData = row.textContent.toLowerCase();
|
||||||
|
|
||||||
if (rowData.includes(searchText)) {
|
if (rowData.includes(searchText)) {
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "2024.3.22.1"
|
"version": "2024.3.23"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user