mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-01 16:36:45 +01:00
Bugfix
Sistemato plugin sedi Fix problemi focus search select2 nelle modal
This commit is contained in:
parent
6b9dae3b9d
commit
5601418042
@ -16,8 +16,8 @@ if (Auth::check()) {
|
||||
'.tr('OpenSTAManager').'
|
||||
</footer>
|
||||
|
||||
<div class="modal fade" id="bs-popup" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false"></div>
|
||||
<div class="modal fade" id="bs-popup2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false"></div>';
|
||||
<div class="modal fade" id="bs-popup" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="true"></div>
|
||||
<div class="modal fade" id="bs-popup2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="true"></div>';
|
||||
}
|
||||
echo '
|
||||
</div><!-- ./wrapper -->';
|
||||
|
@ -412,6 +412,10 @@ function start_widgets($widgets) {
|
||||
|
||||
// Modal
|
||||
function launch_modal(title, href, init_modal, id) {
|
||||
|
||||
//Fix - Select2 does not function properly when I use it inside a Bootstrap modal.
|
||||
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
|
||||
|
||||
if (id == null) {
|
||||
id = '#bs-popup';
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ $_SESSION['superselect']['id_categoria'] = $records[0]['id_categoria'];
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
{[ "type": "number", "label": "<?php echo tr('Soglia minima quantità'); ?>", "name": "threshold_qta", "value": "$threshold_qta$", "decimals": "qta" ]}
|
||||
{[ "type": "number", "label": "<?php echo tr('Soglia minima quantità'); ?>", "name": "threshold_qta", "value": "$threshold_qta$", "decimals": "qta|undefined" ]}
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
@ -24,7 +24,7 @@ echo '
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Indirizzo').'", "name": "indirizzo", "required": 1, "value": "$indirizzo$" ]}
|
||||
{[ "type": "text", "label": "'.tr('Indirizzo').'", "name": "indirizzo", "id": "indirizzo_", "required": 1, "value": "$indirizzo$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
@ -44,7 +44,7 @@ echo '
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-3">
|
||||
{[ "type": "text", "label": "'.tr('Città').'", "name": "citta", "value": "$citta$" ]}
|
||||
{[ "type": "text", "label": "'.tr('Città').'", "name": "citta", "id": "citta_", "value": "$citta$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-3">
|
||||
@ -91,39 +91,40 @@ echo '
|
||||
</div>';
|
||||
|
||||
if (!empty($google)) {
|
||||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-md-4" id="geocomplete">
|
||||
{[ "type": "text", "label": "'.tr('Indirizzo Google').'", "name": "gaddress", "value": "$gaddress$", "extra": "data-geo=\'formatted_address\'" ]}
|
||||
</div>
|
||||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-6" id="geocomplete">
|
||||
{[ "type": "text", "label": "'.tr('Indirizzo Google').'", "name": "gaddress", "value": "$gaddress$", "extra": "data-geo=\'formatted_address\'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "'.tr('Latitudine').'", "name": "lat", "value": "$lat$", "extra": "data-geo=\'lat\'", "class": "text-right" ]}
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
{[ "type": "text", "label": "'.tr('Latitudine').'", "name": "lat", "id": "lat_", "value": "$lat$", "extra": "data-geo=\'lat\'", "class": "text-right" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "'.tr('Longitudine').'", "name": "lng", "value": "$lng$", "extra": "data-geo=\'lng\'", "class": "text-right" ]}
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
<div class="col-md-2">
|
||||
{[ "type": "text", "label": "'.tr('Longitudine').'", "name": "lng", "id": "lng_", "value": "$lng$", "extra": "data-geo=\'lng\'", "class": "text-right" ]}
|
||||
</div>';
|
||||
|
||||
// Vedi su google maps
|
||||
if (!empty($records[0]['indirizzo']) || (empty($records[0]['citta'])) ) {
|
||||
|
||||
// Calcola percorso
|
||||
if (empty($records[0]['gaddress']) || (empty($records[0]['lat']) && empty($records[0]['lng']))) {
|
||||
echo '
|
||||
<div class="col-md-3">
|
||||
<label> </label><br>
|
||||
<a class="btn btn-info" onclick="window.open(\'https://maps.google.com/maps/search/\'+encodeURI( $(\'#indirizzo\').val() )+\', \'+encodeURI( $(\'#citta\').val() ) );"><i class="fa fa-map-marker"></i> Cerca su Google Maps...</a>
|
||||
</div>';
|
||||
<div class="btn-group col-md-2" >
|
||||
<label> </label><br>
|
||||
<a class="btn btn-info" title="'.tr('Mostra la sede su Google Maps').'" onclick="window.open(\'https://maps.google.com/maps/search/\'+encodeURI( $(\'#indirizzo_\').val() )+\', \'+encodeURI( $(\'#citta_\').val() ) );"> <i class="fa fa-map-marker"> </i></a>
|
||||
';
|
||||
|
||||
echo '
|
||||
<a title="'.tr('Calcola percoso da sede legale a questa sede').'" class="btn btn-primary btn-secondary" onclick="window.open(\'https://maps.google.com/maps/dir/\'+encodeURI( $(\'#indirizzo_\').val() )+\', \'+encodeURI( $(\'#citta_\').val() )+\'/\'+encodeURI( $(\'#indirizzo\').val() )+\',\'+encodeURI( $(\'#citta\').val() )+\',8z\');"><i class="fa fa-car"></i></a>
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</div>';
|
||||
|
||||
if (!empty($records[0]['gaddress']) || (!empty($records[0]['lat']) && !empty($records[0]['lng']))) {
|
||||
echo '
|
||||
<div id="map" style="height:400px; width:100%"></div>';
|
||||
echo '
|
||||
<div id="map" style="height:400px; width:100%"></div><br>';
|
||||
}
|
||||
} else {
|
||||
echo '
|
||||
@ -153,12 +154,12 @@ echo '
|
||||
$(document).ready( function(){
|
||||
$("#form_sedi #geocomplete input").geocomplete({
|
||||
map: $("#form_sedi #map").length ? "#form_sedi #map" : false,
|
||||
location: $("#form_sedi #gaddress").val() ? $("#form_sedi #gaddress").val() : [$("#form_sedi #lat").val(), $("#form_sedi #lng").val()],
|
||||
location: $("#form_sedi #gaddress").val() ? $("#form_sedi #gaddress").val() : [$("#form_sedi #lat_").val(), $("#form_sedi #lng_").val()],
|
||||
details: "#form_sedi .details",
|
||||
detailsAttribute: "data-geo"
|
||||
}).bind("geocode:result", function (event, result) {
|
||||
$("#form_sedi #lat").val(result.geometry.location.lat());
|
||||
$("#form_sedi #lng").val(result.geometry.location.lng());
|
||||
$("#form_sedi #lat_").val(result.geometry.location.lat());
|
||||
$("#form_sedi #lng_").val(result.geometry.location.lng());
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
Loading…
x
Reference in New Issue
Block a user