ソースを参照

[Backend] Adresses : inBesanconLoop

feature/export_comptable
Guillaume 4年前
コミット
4e102a2f78
3個のファイルの変更22行の追加5行の削除
  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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ;
}

読み込み中…
キャンセル
保存