Explorar el Código

Merge branch 'develop'

feature/symfony6.1
Guillaume Bourgeois hace 2 años
padre
commit
68f2a5ee70
Se han modificado 4 ficheros con 33 adiciones y 21 borrados
  1. +11
    -10
      Component/CitiesComponent.php
  2. +1
    -1
      Definition/Field/AbstractFieldDefinition.php
  3. +9
    -0
      Resources/assets/functions/tools.js
  4. +12
    -10
      Resources/assets/functions/widgets.js

+ 11
- 10
Component/CitiesComponent.php Ver fichero

@@ -85,19 +85,20 @@ class CitiesComponent

public function callAddressApi($query)
{
if(is_null($query)) {
$query = '';
}
$resultsToReturn = [];

if(!is_null($query)) {
$provider = $this->getGeocoderProvider() ;
$query = GeocodeQuery::create($query)->withData('type', 'housenumber');
$results = $provider->geocodeQuery($query);

$provider = $this->getGeocoderProvider() ;
$query = GeocodeQuery::create($query)->withData('type', 'housenumber');
$results = $provider->geocodeQuery($query);
$resultsToReturn = array();
foreach($results as $result) {
if ($result->getStreetNumber() && strlen($result->getStreetNumber()) > 0) {
$resultsToReturn[] = $result;
foreach($results as $result) {
if ($result->getStreetNumber() && strlen($result->getStreetNumber()) > 0) {
$resultsToReturn[] = $result;
}
}
}

return $resultsToReturn;
}


+ 1
- 1
Definition/Field/AbstractFieldDefinition.php Ver fichero

@@ -146,7 +146,7 @@ abstract class AbstractFieldDefinition
$fieldArray = [];
foreach($configureFieldArray as $fieldName) {
if(isset($allFieldArray[$fieldName])) {
$fieldArray[] = $allFieldArray[$fieldName];
$fieldArray[$fieldName] = $allFieldArray[$fieldName];
}
else {
throw new \ErrorException('Le field "'.$fieldName.'" n\'est pas défini dans configureFields()');

+ 9
- 0
Resources/assets/functions/tools.js Ver fichero

@@ -65,6 +65,15 @@ export class SovTools {
else return null;
}

static formatNumberWithoutRounding(number, toFixed) {
if (number){
let factor = Math.pow(10, toFixed);
return Math.floor(number * factor) / factor
}else{
return null
}
}

static formatNumberWithoutFixed(number) {
if (typeof number == 'string') number = number.replace(',', '.');
if (number) return Number(number);

+ 12
- 10
Resources/assets/functions/widgets.js Ver fichero

@@ -100,16 +100,18 @@ export class SovWidgets {
static setAutoCompleteField() {
var autocompleteFields = $('[data-lc-autocomplete-url]');
autocompleteFields.each(function () {
var $this = $(this),
url = $this.data('lc-autocomplete-url');

$this.autoComplete({
//bootstrapVersion: 4,
//noResultsText: 'Aucun résultat n\'a été trouvé.',
resolverSettings: {
url: url
}
});
if(!$(this).hasClass('autocomplete-disabled')) {
var $this = $(this),
url = $this.data('lc-autocomplete-url');

$this.autoComplete({
//bootstrapVersion: 4,
//noResultsText: 'Aucun résultat n\'a été trouvé.',
resolverSettings: {
url: url
}
});
}
});
}


Cargando…
Cancelar
Guardar