Browse Source

#204 Allow staff to see "friendly" street name

merge-requests/2/head
Mike Koch 7 years ago
parent
commit
259e8d79a0
  1. 6
      admin/admin_ticket.php
  2. 9
      js/modsForHesk-javascript.js
  3. 1
      language/en/text.php

6
admin/admin_ticket.php

@ -903,6 +903,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<div class="modal-body">
<?php if ($hasLocation): ?>
<div id="map" style="height: 500px"></div><br>
<address id="friendly-location" style="font-size: 13px"></address>
<p id="save-for-address" style="font-size: 13px;display:none"><?php echo $hesklang['save_to_see_updated_address']; ?></p>
<script>
getFriendlyLocation(<?php echo $ticket['latitude']; ?>,
<?php echo $ticket['longitude']; ?>);
</script>
<div class="row">
<form action="admin_ticket.php" method="post" role="form">
<input type="hidden" name="track" value="<?php echo $trackingID; ?>">

9
js/modsForHesk-javascript.js

@ -182,6 +182,8 @@ function initializeMapForStaff(latitude, longitude, usersLocationText) {
setLatLon(event.target.getLatLng().lat, event.target.getLatLng().lng);
$('#save-group').show();
$('#close-button').hide();
$('#friendly-location').hide();
$('#save-for-address').show();
});
$('#map-modal').on('shown.bs.modal', function(){
@ -191,4 +193,11 @@ function initializeMapForStaff(latitude, longitude, usersLocationText) {
});
}
function getFriendlyLocation(latitude, longitude) {
var URL = 'http://nominatim.openstreetmap.org/reverse?format=json&lat='+ latitude +'&lon='+ longitude +'&zoom=15&addressdetails=1';
$.getJSON(URL, function(data) {
$('#friendly-location').text(data.display_name);
});
}
jQuery(document).ready(loadJquery);

1
language/en/text.php

@ -65,6 +65,7 @@ $hesklang['location_colon'] = 'Location:';
$hesklang['your_current_location'] = 'Your location';
$hesklang['requesting_location_ellipsis'] = 'Requesting location...';
$hesklang['unable_to_determine_location'] = 'Unable to determine your location, or you declined to share it.';
$hesklang['save_to_see_updated_address'] = 'Save the new location to see the updated address';
// ADDED OR MODIFIED IN Mods for HESK 2.2.1
$hesklang['popart_no_colon']='Top Knowledgebase Articles'; // same as $hesklang['popart'] but without a colon (:)

Loading…
Cancel
Save