Merge branch 'develop' into trunk

This commit is contained in:
Vincent BRIDIER 2022-08-11 09:24:16 +02:00
commit 3f08a381ff
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
6 changed files with 57 additions and 9 deletions

View file

@ -44,3 +44,8 @@ LDC_STATUS_CHECKER_API_KEY="MY_KEY"
LDC_STATUS_CHECKER_UUID="UUID_PROJECT"
## LDC WEB ADMIN SECURE
LDC_WEB_API_KEY="MY_KEY"
## GOOGLE
ANALYTICS_GOOGLE_ID=
GOOGLE_MAP_API_KEY=

View file

@ -1,6 +1,7 @@
# BOGT / Tracabilité Loué
## Installation
```
composer install
cp .env.example .env
@ -9,56 +10,71 @@ php artisan storage:link
```
Éditez le fichier .env puis :
```
php artisan migrate
```
Front :
```
npm install && npm run prod
```
Pour créer un compte admin :
```
php artisan user:create
```
## Crons
Put every min in PROD :
```
php artisan schedule:run
```
## Données
Pour synchroniser les aliments :
```
php artisan cafel:food
```
Pour synchroniser les données BEA (volaille) :
```
php artisan cafel:bea_vol
```
Pour synchroniser les mises en place (oeuf) :
```
php artisan cafel:mep_egg
```
Pour synchroniser les éleveurs (oeuf) :
```
php artisan cafel:breeder_egg
```
Pour synchroniser les éleveurs (volaille) :
```
php artisan cafel:breeder_poultry
```
Pour importer les XML (oeuf) :
```
php artisan xml:egg
```
Pour importer les XML (volaille) :
```
php artisan xml:poultry
```
## TODO
- Mettre analytics dans cookie notice
- Cacher la colonne Code EDE dans le cas du filtrage sur volaille (/bo/eleveurs)
- Dans la partie oeuf faire matcher les civility avec l'enum

View file

@ -2,6 +2,7 @@
namespace App\Http\Controllers\Fo;
use App\Enums\BreederCivilty;
use App\Http\Controllers\Controller;
use App\Models\CafelEggBreeder;
use App\Models\CafelEggMiseEnPlace;
@ -143,16 +144,16 @@ class EggController extends Controller
}
if ($eleveur->vocation != null && !empty($eleveur->vocation)) {
switch ($eleveur->civilite) {
case '0':
case BreederCivilty::elle():
array_push($questions, array('Tu as toujours été éleveuse ?', $eleveur->vocation));
break;
case '1':
case BreederCivilty::il():
array_push($questions, array('Tu as toujours été éleveur ?', $eleveur->vocation));
break;
case '2':
case BreederCivilty::elles():
array_push($questions, array('Vous avez toujours été éleveuses ?', $eleveur->vocation));
break;
case '3':
case BreederCivilty::ils():
array_push($questions, array('Vous avez toujours été éleveurs ?', $eleveur->vocation));
break;
default:

5
config/google.php Normal file
View file

@ -0,0 +1,5 @@
<?php
return [
'analyticsKey' => env('ANALYTICS_GOOGLE_ID')
];

View file

@ -36,7 +36,9 @@
@if(count($breeders))
<table class="table table-striped table-hover table-borderless table-dark">
<thead class="thead-dark">
@if(is_null(request()->type) or request()->type == App\Enums\BreederType::egg()->value)
<th>Code EDE</th>
@endif
<th>Code CAFEL</th>
<th>{{ __('Type') }}</th>
<th>INUAV</th>
@ -49,7 +51,9 @@
<tbody>
@foreach ($breeders as $breeder)
<tr>
@if(is_null(request()->type) or request()->type == App\Enums\BreederType::egg()->value)
<td>{{$breeder->ede_code}}</td>
@endif
<td>{{$breeder->cafel_code}}</td>
@if(get_class($breeder) === \App\Models\CafelEggBreeder::class)
<td><span class="badge bg-warning text-dark">{{ BreederType::egg()->label }}</span></td>

View file

@ -100,6 +100,23 @@
@push('scripts')
<script nonce="{{ $nonce }}">
window._cookie_notice = {
'analytics': {
'name': "Google Analytics",
'description': 'Service d\'analyse d\'audience',
'link': 'https://support.google.com/analytics/answer/6004245',
'cookies': ['_ga', '_gat_gtag_{{ str_replace('-','_', config('google.analyticsKey')) }}', '_gid'],
'script': function () {
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src='https://www.googletagmanager.com/gtag/js?id={{ config('google.analyticsKey') }}';g.id='analytics';
s.parentNode.insertBefore(g,s)}(document,'script'));
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ config('google.analyticsKey') }}');
}
},
'youtube': {
'name': "VIDEOS - Youtube",
'description': '{{ __('Les cookies déposés via les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.') }}',