Commit ccd72873 by Julien Jorry

Ajout geocoder, openstreetmap provider, gmap, cache bundles + Update Back office menu

parent 83248460
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -39,4 +39,5 @@ return [
Sonata\MediaBundle\SonataMediaBundle::class => ['all' => true],
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
App\Application\Sonata\MediaBundle\ApplicationSonataMediaBundle::class => ['all' => true],
Bazinga\GeocoderBundle\BazingaGeocoderBundle::class => ['all' => true],
];
# See the docs at https://github.com/geocoder-php/BazingaGeocoderBundle
bazinga_geocoder:
# The local IP (127.0.0.1) will be replaced by the fake_ip
# see https://github.com/geocoder-php/BazingaGeocoderBundle/blob/5.0.0/Resources/doc/index.md#fake-local-ip
fake_ip: 123.123.123.123
providers:
# cache:
# adapter: mlc_cache_adapter
# provider: factory
# bing_maps:
# api_key: ~ # Required
# locale: ~
# cache:
# adapter: ~ # Required
# provider: ~ # Required
# locale: ~
# lifetime: 86400
# ip_info_db:
# api_key: ~ # Required
# cloudmade:
# api_key: ~ # Required
google_maps:
factory: Bazinga\GeocoderBundle\ProviderFactory\GoogleMapsFactory
options:
# httplug_client: '@httplug.client' # When using HTTPlugBundle
region: 'France'
api_key: 'XXXXXXXXX'
locale: fr
# region: ~
# use_ssl: false
# google_maps_business:
# client_id: ~ # Required
# api_key: ~
# region: ~
# use_ssl: false
openstreetmap:
factory: Bazinga\GeocoderBundle\ProviderFactory\NominatimFactory
locale: fr
# cache: '@Symfony\Component\Cache\Simple\ApcuCache'
# cache_lifetime: 3600
# cache_precision: ~
# host_ip: []
# geoip: []
# free_geo_ip: []
# mapquest:
# api_key: ~ # Required
# oiorest: []
# geocoder_ca: []
# geocoder_us: []
# ign_openls:
# api_key: ~ # Required
# data_science_toolkit: []
# yandex:
# locale: ~
# toponym: ~
# geo_ips:
# api_key: ~
# geo_plugin: []
# maxmind:
# api_key: ~ # Required
# maxmind_binary:
# binary_file: ~ # Required
# open_flag: ~
# chain:
# providers: []
\ No newline at end of file
......@@ -76,6 +76,97 @@ sonata_admin:
# filters: # filter values
# edited: { value: 1 } # filtre on admin (settings:code)
groups:
sonata.admin.group.users:
keep_open: false
label: Utilisateurs
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-users"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE ]
items:
- sonata.user.admin.user
- sonata.user.admin.group
sonata.admin.group.media:
keep_open: false
label: Média
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-image"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE ]
items:
- sonata.media.admin.media
- sonata.media.admin.gallery
sonata.admin.group.adherent:
keep_open: false
label: Adhérents
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-address-card"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT ]
items:
- admin.adherent.gerer
- admin.adherent.cotisations
sonata.admin.group.prestataire:
keep_open: false
label: Prestataires
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-user-circle-o"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT ]
items:
- admin.prestataire.gerer
- admin.prestataire.cotisations
- admin.groupepresta.gerer
sonata.admin.group.groupe:
on_top: true
label: Groupes locaux
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-bandcamp"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE ]
items:
- admin.groupe.gerer
sonata.admin.group.comptoir:
on_top: true
label: "Comptoirs"
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-home"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE ]
items:
- admin.comptoir.gerer
# sonata.admin.group.compta:
# keep_open: false
# on_top: true
# label: "Comptabilité"
# label_catalogue: SonataAdminBundle
# icon: '<i class="fa fa-list"></i>'
# roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER ]
# items:
# - admin.flux.gerer
sonata.admin.group.document:
keep_open: false
on_top: true
label: "Documents"
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-file-text"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT, ROLE_REDACTEUR ]
items:
- admin.document.gerer
sonata.admin.group.rubrique:
keep_open: false
on_top: true
label: "Rubriques"
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-list"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT, ROLE_REDACTEUR ]
items:
- admin.rubrique.gerer
sonata.admin.group.faq:
keep_open: false
on_top: true
label: "FAQ"
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-question"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT, ROLE_REDACTEUR ]
items:
- admin.faq.gerer
# Gérer l'affichage du menu de l'admin en fonction des roles
# groups:
# app.admin.group.content:
......
......@@ -30,6 +30,10 @@ services:
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
# cache doctrine for bazinga geocoder
mlc_cache_adapter:
class: Doctrine\Common\Cache\ApcCache
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
redirect.after.login:
......@@ -100,8 +104,7 @@ services:
tags:
- name: sonata.admin
manager_type: orm
group: "Groupe"
label: "Gérer"
label: "Groupes locaux"
public: true
admin.comptoir.gerer:
......@@ -110,8 +113,7 @@ services:
tags:
- name: sonata.admin
manager_type: orm
group: "Comptoir"
label: "Gérer"
label: "Comptoirs"
public: true
admin.groupepresta.gerer:
......@@ -121,7 +123,7 @@ services:
- name: sonata.admin
manager_type: orm
group: "Prestataire"
label: "Groupes"
label: "AMAP / Marchés"
public: true
admin.document.gerer:
......@@ -153,3 +155,13 @@ services:
group: "Contenu"
label: "FAQs"
public: true
# admin.flux.gerer:
# class: App\Admin\FluxAdmin
# arguments: [~, App\Entity\Transaction, ~]
# tags:
# - name: sonata.admin
# manager_type: orm
# group: "Comptabilité"
# label: "Flux"
# public: true
......@@ -29,9 +29,17 @@ App\Entity\Comptoir:
App\Entity\Groupeprestataire:
grppresta_1:
name: 'AMAP'
name: 'AMAP de test'
horaires: 'Tous les Jeudis<br/>de 12h à 14h'
grppresta_2:
name: 'MARCHÉ'
name: 'AMAP de test 2'
horaires: 'Tous les Mercredis<br/>de 12h à 14h'
grppresta_3:
name: 'Marché de test'
horaires: 'Tous les Dimanches<br/>de 8h à 12h'
grppresta_4:
name: 'Marché de test 2'
horaires: 'Tous les 1er Dimanches du mois<br/>de 8h à 12h<br/>et de 18h à 20h'
App\Entity\TypePrestataire:
typepresta_prestataire:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,6 +2,7 @@
namespace App\Admin;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
......@@ -9,6 +10,7 @@ use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class GroupeprestataireAdmin extends AbstractAdmin
{
......@@ -37,6 +39,10 @@ class GroupeprestataireAdmin extends AbstractAdmin
'label' => 'Nom du groupe :',
'required' => true
))
->add('horaires', TextareaType::class, array(
'label' => 'Horaires :',
'required' => false
))
->add('enabled', CheckboxType::class, array(
'label' => 'Activé ?',
'required' => false,
......@@ -45,16 +51,6 @@ class GroupeprestataireAdmin extends AbstractAdmin
;
}
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
// $datagridMapper
// ->add('phone')
// ->add('email', null, [
// 'show_filter' => true
// ])
// ;
}
/**
* {@inheritdoc}
*/
......@@ -62,7 +58,14 @@ class GroupeprestataireAdmin extends AbstractAdmin
{
unset($this->listModes['mosaic']);
$listMapper
->addIdentifier('name', null, array('label' => 'Nom du groupe'))
->addIdentifier('name', null, array(
'label' => 'Nom du groupe'
))
->addIdentifier('horaires', 'html', array(
'label' => 'Horaires',
'strip' => true,
'truncate' => 50
))
->add(
'getPrestatairesCount',
null,
......@@ -72,7 +75,11 @@ class GroupeprestataireAdmin extends AbstractAdmin
'sort_parent_association_mappings' => [],
]
)
->addIdentifier('enabled', null, array('label' => 'Activé', 'datatype' => 'App.Groupeprestataire', 'template' => '@SonataAdmin/Boolean/editable_boolean.html.twig'))
->addIdentifier('enabled', null, array(
'label' => 'Activé',
'datatype' => 'App.Groupeprestataire',
'template' => '@SonataAdmin/Boolean/editable_boolean.html.twig'
))
;
}
......
......@@ -4,6 +4,8 @@ namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Geocoder\Query\GeocodeQuery;
use Geocoder\Provider\Nominatim\Nominatim;
class IndexController extends AbstractController
{
......@@ -21,6 +23,15 @@ class IndexController extends AbstractController
// // no need to include %count% here; Symfony does that for you
// array('%name%' => $user->getName())
// );
// GEOCODING ADDRESS :
// $httpClient = new \Http\Adapter\Guzzle6\Client();
// $provider = Nominatim::withOpenStreetMapServer($httpClient, 'test');
// $geocoder = new \Geocoder\StatefulGeocoder($provider, 'fr');
// $result = $geocoder->geocodeQuery(GeocodeQuery::create("19300 Rosiers-d'Egletons"));
// dump($result);
// exit();
return $this->render('index.html.twig', [
'news' => array(),
]);
......
......@@ -25,6 +25,7 @@ class Groupeprestataire
{
use NameSlugContentEntityTrait,
TimestampableEntity,
GeolocEntityTrait,
EnablableEntityTrait;
/**
......
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190114185423 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE groupeprestaire ADD geoloc_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE groupeprestaire ADD CONSTRAINT FK_FB9ABBCEEF390162 FOREIGN KEY (geoloc_id) REFERENCES geoloc (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_FB9ABBCEEF390162 ON groupeprestaire (geoloc_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE groupeprestaire DROP FOREIGN KEY FK_FB9ABBCEEF390162');
$this->addSql('DROP INDEX UNIQ_FB9ABBCEEF390162 ON groupeprestaire');
$this->addSql('ALTER TABLE groupeprestaire DROP geoloc_id');
}
}
......@@ -2,6 +2,9 @@
"behat/transliterator": {
"version": "v1.2.0"
},
"clue/stream-filter": {
"version": "v1.4.0"
},
"cocur/slugify": {
"version": "v3.1"
},
......@@ -134,6 +137,27 @@
"gedmo/doctrine-extensions": {
"version": "v2.4.36"
},
"geocoder-php/cache-provider": {
"version": "4.1.0"
},
"geocoder-php/common-http": {
"version": "4.2.0"
},
"geocoder-php/google-maps-provider": {
"version": "4.3.0"
},
"geocoder-php/nominatim-provider": {
"version": "5.0.0"
},
"geocoder-php/plugin": {
"version": "1.1.0"
},
"guzzlehttp/guzzle": {
"version": "6.3.3"
},
"guzzlehttp/promises": {
"version": "v1.3.1"
},
"guzzlehttp/psr7": {
"version": "1.5.2"
},
......@@ -230,6 +254,24 @@
"ocramius/proxy-manager": {
"version": "2.1.1"
},
"php-http/discovery": {
"version": "1.5.2"
},
"php-http/guzzle6-adapter": {
"version": "v2.0.1"
},
"php-http/httplug": {
"version": "v2.0.0"
},
"php-http/message": {
"version": "1.7.2"
},
"php-http/message-factory": {
"version": "v1.0.2"
},
"php-http/promise": {
"version": "v1.0.0"
},
"phpcollection/phpcollection": {
"version": "0.5.0"
},
......@@ -254,6 +296,9 @@
"psr/container": {
"version": "1.0.0"
},
"psr/http-client": {
"version": "1.0.0"
},
"psr/http-message": {
"version": "1.0.1"
},
......@@ -689,6 +734,18 @@
"webmozart/assert": {
"version": "1.3.0"
},
"willdurand/geocoder": {
"version": "4.2.1"
},
"willdurand/geocoder-bundle": {
"version": "5.0",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "5.0",
"ref": "b272ad4fbfcd45a20e7cbfdc4ad1b0e27a62fd3b"
}
},
"willdurand/jsonp-callback-validator": {
"version": "v1.1.0"
},
......
app.admin.group.adherent: Adherent
app.admin.group.prestataire: Prestataire
app.admin.group.groupe: Groupe
groups: Roles
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment