Bladeren bron

[Backend] Adresses : inBesanconLoop

feature/export_comptable
Guillaume 4 jaren geleden
bovenliggende
commit
4e102a2f78
3 gewijzigde bestanden met toevoegingen van 22 en 5 verwijderingen
  1. +2
    -0
      ShopBundle/Resources/translations/lcshop.fr.yaml
  2. +5
    -0
      ShopBundle/Resources/views/backend/default/block/form_address.html.twig
  3. +15
    -5
      ShopBundle/Services/Utils.php

+ 2
- 0
ShopBundle/Resources/translations/lcshop.fr.yaml Bestand weergeven

@@ -80,6 +80,8 @@ group:
email: Email
delivery: Livraison
maintenance: Maintenance
Address:
listLoopBesancon: Adresses de Besançon à spécifier (lat / long)


None: Aucune valeur

+ 5
- 0
ShopBundle/Resources/views/backend/default/block/form_address.html.twig Bestand weergeven

@@ -51,6 +51,11 @@
<div class="col-12">
{{ form_row(form.deliveryInfos) }}
</div>
{% if merchantUtils.getMerchantCurrent().isHubBesancon() %}
<div class="col-12">
{{ form_row(form.inBesanconLoop) }}
</div>
{% endif %}
<div class="col-6">
{{ form_row(form.latitude) }}
</div>

+ 15
- 5
ShopBundle/Services/Utils.php Bestand weergeven

@@ -267,16 +267,26 @@ class Utils

public function getGeocoderProvider()
{
$provider = false ;
$symfonyClient = new HttplugClient();
$configGeocoderProvider = $this->parameterBag->get('geocoder.provider') ;

/* API du gouvernement */
$provider = new Addok($symfonyClient, 'https://api-adresse.data.gouv.fr') ;

if($configGeocoderProvider == 'addok') {
$provider = new Addok($symfonyClient, 'https://api-adresse.data.gouv.fr') ;
}
/* Google Maps */
//$provider = new GoogleMaps($symfonyClient, null, '') ;

elseif($configGeocoderProvider == 'googlemaps') {
$provider = new GoogleMaps($symfonyClient, null, $this->parameterBag->get('geocoder.api_key')) ;
}
/* Nominatim : OpenStreetMap */
//$provider = Nominatim::withOpenStreetMapServer($symfonyClient, 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion');
elseif($configGeocoderProvider == 'nominatim') {
$provider = Nominatim::withOpenStreetMapServer($symfonyClient, 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion');
}

if(!$provider) {
throw new \ErrorException('Aucun provider (geocoding) défini') ;
}

return $provider ;
}

Laden…
Annuleren
Opslaan