Compare commits

..

123 commits

Author SHA1 Message Date
Jérémy Munsch
73eeec3e75
Merge branch 'trunk' 2023-06-27 09:28:53 +02:00
Jérémy Munsch
4890e1d55f
Merge branch 'develop' into trunk 2023-06-27 09:27:47 +02:00
Jérémy Munsch
7115c777ca Merge branch 'remove-the-e' into 'develop'
Replaced civilitée by civilité and recaptacha by recaptcha

See merge request ldc-web/projets/le-gaulois!59
2023-06-27 07:25:00 +00:00
Noah Lancien
cfff5d676d Replaced civilitée by civilité and recaptacha by recaptcha 2023-06-27 08:59:13 +02:00
Vincent BRIDIER
6b86c4f4bc Merge branch 'issue-19-fix' into 'develop'
fix #19 migration on remove ocb type egg

Closes #19

See merge request ldc-web/projets/le-gaulois!58
2023-06-26 16:29:05 +00:00
Jérémy Munsch
bae249c704
fix .env.example
(cherry picked from commit d318a16d501187a6ab6fa6f6e397556408aae0d4)
2023-06-26 18:04:53 +02:00
Jérémy Munsch
ae78359251
fix #19 migration on remove ocb type egg
(cherry picked from commit d4657fd99177026061e068633c0dbe83cd9d1e7e)
2023-06-26 18:04:46 +02:00
Vincent BRIDIER
1f34c77256
Merge branch 'trunk' 2023-06-26 17:48:47 +02:00
Vincent BRIDIER
49a02d3e2d
Merge branch 'develop' into trunk 2023-06-26 17:47:49 +02:00
Vincent BRIDIER
78e388c9df Merge branch 'issue-14' into 'develop'
Issue 14

See merge request ldc-web/projets/le-gaulois!57
2023-06-26 15:46:54 +00:00
Noah Lancien
62cd74f250 Merge branch 'develop' into issue-14 2023-06-26 17:37:29 +02:00
Noah Lancien
fccb7cd3f6 fixed cookies for video : revert changes to quickly fix other videos 2023-06-26 17:33:00 +02:00
Vincent BRIDIER
c4f3ae1929 Merge branch 'issue-19' into 'develop'
Issue 19

Closes #19

See merge request ldc-web/projets/le-gaulois!56
2023-06-26 14:13:19 +00:00
Jérémy Munsch
b106e9ac67
phpcs on enums 2023-06-26 16:02:23 +02:00
Jérémy Munsch
43837f3937
Closes #19 Remove OCB completement Egg 2023-06-26 16:02:08 +02:00
Vincent BRIDIER
aca7083436
Merge branch 'trunk' 2023-06-26 15:50:13 +02:00
Jérémy Munsch
2689ec1bfc
phpcs update 2023-06-26 15:47:49 +02:00
Vincent BRIDIER
6b234cd0cc
Merge branch 'develop' into trunk 2023-06-26 15:16:34 +02:00
Vincent BRIDIER
e24bfaf301 Merge branch 'issue-14' into 'develop'
Videos from vimeo are now playable if the vimeo cookie is enabled

Closes #14

See merge request ldc-web/projets/le-gaulois!47
2023-06-21 15:16:52 +00:00
noah.lancien
a5bd28fb69 Videos from vimeo are now playable if the vimeo cookie is enabled 2023-06-21 15:16:52 +00:00
Vincent BRIDIER
7ca36a0913 Merge branch 'ts-1570' into 'develop'
Fix optin condition bug in customer informations page

See merge request ldc-web/projets/le-gaulois!55
2023-06-21 15:04:02 +00:00
sebastien.hattry
bca4fa327a Fix optin condition bug in customer informations page 2023-06-21 15:04:02 +00:00
Noah Lancien
43b63c8da1 Removed console.logs and renamed youtube-play-button -> vimeo-play-button 2023-06-21 13:21:36 +02:00
Vincent BRIDIER
a9af7cfe7a Merge branch '15-ts-1379' into 'develop'
Resolve "ts-1379"

Closes #15

See merge request ldc-web/projets/le-gaulois!54
2023-06-16 10:09:27 +00:00
nicolas.demangeat
73e4dc877e Resolve "ts-1379" 2023-06-16 10:09:26 +00:00
Vincent BRIDIER
370019285d Merge branch '16-ts-1572' into 'develop'
Resolve "ts-1572"

Closes #16

See merge request ldc-web/projets/le-gaulois!53
2023-06-16 09:40:37 +00:00
Vincent BRIDIER
512009cbe9 Merge branch 'issue-17' into 'develop'
logo remplacement in resources/assets/images/danslespres/logoDLP.png

Closes #17

See merge request ldc-web/projets/le-gaulois!51
2023-06-16 09:39:33 +00:00
Nicolas Demangeat
a0f663bdd9 URL modification opinsta 2023-06-16 11:32:49 +02:00
Nicolas Demangeat
fdde79d369 logo remplacement in resources/assets/images/danslespres/logoDLP.png 2023-06-15 16:23:33 +02:00
Vincent BRIDIER
a0b9d408d2 Merge branch 'fix-sitemap' into 'develop'
revert kwaadpepper/refresh-sitemap to 1.0.0 as not compatible with 1.1.0

See merge request ldc-web/projets/le-gaulois!48
2023-06-15 07:30:48 +00:00
Vincent BRIDIER
1b177d78f6 Merge branch 'fix-route-cache' into 'develop'
Fix route cache comme sur caliope

See merge request ldc-web/projets/le-gaulois!49
2023-06-15 07:30:16 +00:00
Jérémy Munsch
7d89800ca8
Fix route cache comme sur caliope 2023-06-15 09:21:37 +02:00
Jérémy Munsch
e2189efbbf
revert kwaadpepper/refresh-sitemap to 1.0.0 as not compatible with 1.1.0 2023-06-13 16:14:46 +02:00
Noah Lancien
7ac5a22c9b Fixed video style 2023-06-12 16:39:19 +02:00
Noah Lancien
d2ce6edec5 WIP: video can now be played but the 'play' icon doesn't display correctly 2023-06-09 17:06:20 +02:00
Noah Lancien
00b4e85525 Fixed youtube cookie script 2023-06-07 15:26:34 +02:00
Noah Lancien
7072c92832 Fixed vimeo cookie script 2023-06-07 15:25:41 +02:00
Noah Lancien
88af03ceb0 player.vimeo line was missing in SecureHeaders 2023-06-07 10:25:27 +00:00
Jérémy Munsch
9074b02916
Fix kwaadpepper/serial-int-caster to 1.0.1 Bordel de merde 2023-06-05 16:55:33 +02:00
Vincent BRIDIER
ecbf1a8837
Merge branch 'trunk' 2023-05-02 17:15:52 +02:00
Vincent BRIDIER
1c0d7bae5e
Merge branch 'develop' into trunk 2023-05-02 17:15:44 +02:00
Vincent BRIDIER
c9ba12c99d
Update OP Insta post PROD 2023-05-02 17:15:32 +02:00
Vincent BRIDIER
0d61ee8295
Merge branch 'trunk' 2023-04-27 15:14:30 +02:00
Vincent BRIDIER
cb0fa25557
Merge branch 'develop' into trunk 2023-04-27 10:59:25 +02:00
Vincent BRIDIER
0d8b4543e5 Merge branch 'opinsta' into 'develop'
Opinsta

Closes #13

See merge request ldc-web/projets/le-gaulois!46
2023-04-25 10:10:08 +00:00
Jérémy Munsch
859b1f3625 Op Insta 2023-04-25 10:10:08 +00:00
Vincent BRIDIER
00865f4eff
Merge branch 'trunk' 2023-04-17 12:57:46 +02:00
Vincent BRIDIER
8ab156452f
Merge branch 'develop' into trunk 2023-04-17 12:57:34 +02:00
Vincent BRIDIER
e8eefa158a
Bump cookie notice 2023-04-17 12:57:24 +02:00
Vincent BRIDIER
0dc4021a18
Fix nonce on error pages 2023-04-17 12:55:09 +02:00
Vincent BRIDIER
f01db43447
Merge branch 'trunk' 2023-04-17 12:16:55 +02:00
Vincent BRIDIER
37c3e78dc8
Merge branch 'develop' into trunk 2023-04-17 12:16:46 +02:00
Vincent BRIDIER
25c4905d99
Fix Cookie Notice import 2023-04-17 12:16:33 +02:00
Vincent BRIDIER
05de5830f8
Merge branch 'trunk' 2023-04-17 12:04:55 +02:00
Vincent BRIDIER
7d55cf7a39
Merge branch 'develop' into trunk 2023-04-17 12:04:42 +02:00
Vincent BRIDIER
f9e68f6ad6 Merge branch 'cookie-notice' into 'develop'
Fixes  #12

Closes #12

See merge request ldc-web/projets/le-gaulois!45
2023-04-17 10:04:13 +00:00
Jérémy Munsch
d5f12af30d
Fixed bo inline scripts 2023-04-12 11:54:04 +02:00
Jérémy Munsch
88db8dd345
fix logout btn 2023-04-12 11:04:14 +02:00
Jérémy Munsch
6144d02a76
Fixes #12
- Cookie Notice bump to 3.0.3
- Fix Recaptcha no Fallback on forms
2023-04-12 10:56:15 +02:00
Jérémy Munsch
ca36cf55ac
fix error page layouts 2023-04-12 09:46:06 +02:00
Jérémy Munsch
abb52d7d82
Actu paginator remove console log 2023-04-12 09:46:01 +02:00
Jérémy Munsch
862fe3725c
composer update 2023-04-12 09:45:44 +02:00
Vincent BRIDIER
109199f0a4 Merge branch 'issue-11-3' into 'develop'
Fixes #11

Closes #11 and #3

See merge request ldc-web/projets/le-gaulois!44
2023-03-24 18:02:33 +00:00
Vincent BRIDIER
1856c267c1 Merge branch 'issue-10' into 'develop'
Fixes #10

Closes #10

See merge request ldc-web/projets/le-gaulois!43
2023-03-24 17:59:41 +00:00
Vincent BRIDIER
a3e4c1d08a Merge branch 'issue-7' into 'develop'
Fixes #7

Closes #7

See merge request ldc-web/projets/le-gaulois!42
2023-03-24 17:59:06 +00:00
Vincent BRIDIER
3dbfbe940f Merge branch 'issue-5' into 'develop'
Fixes #5 : CustomerRegisterRequest : change 'username' attribute name from default to 'pseudo'

Closes #5

See merge request ldc-web/projets/le-gaulois!41
2023-03-24 17:58:16 +00:00
Jérémy Munsch
979a1cf613
Fixes #3 Remove HTML min 2023-03-23 16:04:33 +01:00
Jérémy Munsch
c0d8fdb73f
Fixes #11
CSP ISSUES Add missing nonces everywhere + add strict dynamic
2023-03-23 16:02:56 +01:00
Jérémy Munsch
8fd8ccd17d
Fixes #10
UpdateEngagement request : correct status validation
2023-03-23 13:43:09 +01:00
Jérémy Munsch
901b3c263d
Fixes #5 : CustomerRegisterRequest : change 'username' attribute name from default to 'pseudo' 2023-03-23 13:32:52 +01:00
Jérémy Munsch
33cf96b21f
Fixes #7
BourseComponent.vue :  tigger 'wantsLink' or 'givesLink' buttons on anchor links
2023-03-23 13:27:46 +01:00
Jérémy Munsch
58bbdafe43
update forgotten composer lock file while updating to new gitlab 2023-03-23 13:27:13 +01:00
Jérémy Munsch
94f9e1fd32
migrate DEP to new gitlab 2023-03-23 13:15:58 +01:00
Jérémy Munsch
e0d33a9c2b
update ci for new gitlab + removes unsupported tasks 2023-03-23 13:11:14 +01:00
Vincent BRIDIER
765f9a06df
Merge branch 'trunk' 2023-03-23 12:06:36 +01:00
Vincent BRIDIER
1dc9c3e4d1
Merge branch 'develop' into trunk 2023-03-23 12:06:25 +01:00
Vincent BRIDIER
47672f1745
Fix OP BR Charcut 2023-03-23 12:06:09 +01:00
Vincent BRIDIER
74aa0de294 add issue templates 2023-03-20 13:50:03 +00:00
Vincent BRIDIER
a57525226f
Merge branch 'trunk' 2023-03-20 14:20:50 +01:00
Vincent BRIDIER
e4656628f7
Merge branch 'develop' into trunk 2023-03-20 14:20:37 +01:00
Vincent BRIDIER
fd8680c327
Add Matomo 2023-03-20 14:18:03 +01:00
Vincent BRIDIER
550c035248 Merge branch 'ticket-1145' into 'develop'
Hide buttons when no link associated

See merge request ldc-web/projets/le-gaulois!40
2023-03-20 11:42:33 +00:00
Vincent BRIDIER
3f24dc5b06 clean block link value 2023-03-20 11:41:58 +00:00
Vincent BRIDIER
00c8d872c2 Merge branch 'ticket-1102' into 'develop'
Add recaptcha

See merge request ldc-web/projets/le-gaulois!39
2023-03-20 11:36:39 +00:00
Vincent BRIDIER
552cd2616a Update comment 2023-03-02 08:10:47 +00:00
Sebastien Hattry
82cefd1c4c Hide buttons when no link associated 2023-02-24 08:28:17 +00:00
Sebastien Hattry
718bfc11eb Add recaptcha 2023-02-23 11:26:03 +00:00
Vincent BRIDIER
b6d081ec26
Merge branch 'trunk' 2023-02-16 10:15:44 +01:00
Vincent BRIDIER
81b2bed386
Merge branch 'develop' into trunk 2023-02-16 10:15:05 +01:00
Vincent BRIDIER
451a69151f Merge branch 'ticket1360' into 'develop'
remove breeder page access prevention, update breeder page content

See merge request service-web-lab/le-gaulois!38
2023-02-16 08:52:54 +00:00
Vincent BRIDIER
88520498fb Merge branch 'ticket1361' into 'develop'
fix html tags apearing in breeder bloc on map

See merge request service-web-lab/le-gaulois!37
2023-02-16 08:52:00 +00:00
Vincent BRIDIER
d4db7c57e6 Merge branch 'fixTracaDates' into 'develop'
XmlTracaReader : Refix traca dates

See merge request service-web-lab/le-gaulois!36
2023-02-14 16:46:02 +00:00
Olivier Legat
dd13b99968
remove breeder page access prevention, update breeder page content 2023-02-07 10:20:44 +01:00
Olivier Legat
1704708902
fix html tags apearing in breeder bloc on map 2023-02-07 09:35:02 +01:00
Jérémy Munsch
fe928b1d80
XmlTracaReader : Refix traca dates 2023-01-27 18:36:33 +01:00
Vincent BRIDIER
61783b8e28
Fix MPDF 2023-01-27 12:25:45 +01:00
Vincent BRIDIER
993d1358a6
Merge branch 'trunk' 2023-01-27 10:33:20 +01:00
Vincent BRIDIER
7d956a54df
Merge branch 'develop' into trunk 2023-01-27 10:30:35 +01:00
Vincent BRIDIER
0eb3b011a3 Merge branch 'ticket-733' into 'develop'
Ticket 733: fix navigation

See merge request service-web-lab/le-gaulois!35
2023-01-27 09:23:29 +00:00
Vincent BRIDIER
a3ecba6625 Merge branch 'ticket-1326' into 'develop'
Ticket 1306/1326 : delete some words

See merge request service-web-lab/le-gaulois!34
2023-01-27 09:22:58 +00:00
Vincent BRIDIER
56fba36df2 Merge branch 'ticket1219' into 'develop'
Ticket1219

See merge request service-web-lab/le-gaulois!33
2023-01-27 09:22:08 +00:00
Alexis Gousseau
5014f9196f Ticket 733: fix navigation 2023-01-26 16:35:41 +01:00
Alexis Gousseau
52dbb15a3f Ticket 1326 : delete some words 2023-01-25 14:44:58 +01:00
Jérémy Munsch
b796e93d91
Fix vue-router import suite au bump npm de version security 2023-01-23 16:49:26 +01:00
Jérémy Munsch
e793ce664e
Ticket 1219 Fix actu paginator + order by descending created_at 2023-01-19 10:55:41 +01:00
Jérémy Munsch
bdb44ab3a7
npm update 2023-01-19 10:04:14 +01:00
Vincent BRIDIER
f37200aedf
Merge branch 'trunk' 2023-01-11 18:31:00 +01:00
Vincent BRIDIER
cb77f9bb14
Merge branch 'develop' into trunk 2023-01-11 18:30:38 +01:00
Vincent BRIDIER
29d818b5f0
Update title 2023-01-11 18:30:19 +01:00
Vincent BRIDIER
d352ae64f1
Remove OnOneServer jobs 2023-01-11 18:28:37 +01:00
Vincent BRIDIER
785a6db60f
Merge branch 'trunk' 2023-01-11 18:06:32 +01:00
Vincent BRIDIER
2c26ecb874
Merge branch 'develop' into trunk 2023-01-11 17:49:56 +01:00
Vincent BRIDIER
48e2383b5f Merge branch 'remove-handler-add-sentry' into 'develop'
Remove handler + Add Sentry + some PHPCS

See merge request service-web-lab/le-gaulois!32
2023-01-11 16:48:54 +00:00
Vincent BRIDIER
7e99d60b71
Update DocBlocks 2023-01-11 17:45:12 +01:00
Jérémy Munsch
1bbb8c0f57
phpcs XmlJobs 2023-01-10 16:15:04 +01:00
Jérémy Munsch
819d964c15
Merge branch 'develop' into trunk 2022-11-07 10:43:48 +01:00
Vincent BRIDIER
d6b3cb767e
Merge branch 'trunk' 2022-09-19 09:14:22 +02:00
Vincent BRIDIER
fcc2e101d9
Merge branch 'develop' into trunk 2022-09-19 09:13:34 +02:00
Olivier Legat
7d768bda93 Merge branch 'hotfix' 2022-09-13 15:31:44 +02:00
Olivier Legat
c346fb350b Merge branch 'hotfix' 2022-09-12 13:51:57 +02:00
Vincent BRIDIER
9e460153d6
Merge branch 'develop' into trunk 2022-08-26 12:55:56 +02:00
Jérémy Munsch
aa4de0d001
Merge branch 'hotfix' 2022-08-24 12:55:26 +02:00
Vincent BRIDIER
642316cb5b
Merge branch 'develop' into trunk 2022-08-23 10:30:29 +02:00
231 changed files with 11492 additions and 3026 deletions

View file

@ -21,6 +21,13 @@ DB_DATABASE_2016=legaulois2016
DB_USERNAME_2016=
DB_PASSWORD_2016=
## DATABASE OPINSTA
DB_DATABASE_OPINSTA=
DB_USERNAME_OPINSTA=
DB_PASSWORD_OPINSTA=
DB_HOST_OPINSTA=
DB_PORT_OPINSTA=
## MIGRATION
MIGRATIONPAGINATION=20000
@ -70,6 +77,14 @@ MESBR_COUPON_3_CHARCUT=""
ANALYTICS_GOOGLE_ID=
GOOGLE_MAP_API_KEY=
# Google Recaptcha
GOOGLE_RECAPTCHA_PUBLIC=
GOOGLE_RECAPTCHA_PRIVATE=
GOOGLE_RECAPTCHA_VERSION=
# Matomo
MATOMO_SITE_ID=
## MERCANET
MERCANET_SECRET=
MERCANET_MERCHAND_ID=
@ -77,3 +92,9 @@ MERCANET_ENV=
# BYPASS THE CRM JUST LOGIN (needs debug mode)
NOCRM=false
#OP INSTA
## Démarre le à d-m-YYYY
OPINSTA_START=
## Fin le à d-m-YYYY
OPINSTA_END=

1
.gitignore vendored
View file

@ -29,3 +29,4 @@ mix-manifest.json
workspace.code-workspace
storage/crm_migration.csv
auth.json
.npmrc

View file

@ -1,74 +1,11 @@
include:
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'lint/lint7.3.yml'
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'security/security7.3.yml'
stages:
- Security
- CodingStandards
- Builds
composer-security:
stage: Security
image: $CI_REGISTRY/service-web-lab/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
script:
- local-php-security-checker --format=json --path=./composer.lock > composer-security-checker-report.json
artifacts:
when: on_failure
expose_as: 'composer-security-checker'
paths:
- composer-security-checker-report.json
allow_failure: true
needs: []
npm-security:
stage: Security
image: node:17.9.1
before_script:
- npm install --location=global audit-ci@^6
script:
- audit-ci -p npm -o json > npm-security-checker-report.json
artifacts:
when: on_failure
expose_as: 'npm-security-checker'
paths:
- npm-security-checker-report.json
allow_failure: true
needs: []
phpcs:
stage: CodingStandards
image: $CI_REGISTRY/service-web-lab/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
before_script:
- composer config gitlab-token.gitlab.com $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
- composer install
cache:
paths:
- vendor/
script:
- vendor/bin/phpcs --report=junit --report-file=phpcs-report.xml
artifacts:
when: on_failure
expose_as: 'phpcs'
paths:
- phpcs-report.xml
reports:
junit: phpcs-report.xml
allow_failure: false
needs:
- composer-security
- npm-security
front-build:
stage: Builds
image: node:17.9.1
before_script:
- npm install
cache:
paths:
- node_modules/
script:
- npm run prod > front-build-report.json
artifacts:
when: on_failure
expose_as: 'front-build-report'
paths:
- front-build-report.json
allow_failure: false
needs:
- phpcs
- lint
- security

View file

@ -0,0 +1,11 @@
## Comportement constaté
## Comportement attendu
## Solution envisagée
## Étapes pour la reproduction du bug
*

View file

@ -0,0 +1,7 @@
## Présentation du besoin
## Implémentation
## Maquettes, documentations...

View file

@ -16,7 +16,6 @@ use App\Jobs\DeleteOldNotifications;
use App\Jobs\DeleteOrders;
use App\Jobs\PurgeNotifications as JobsPurgeNotifications;
use App\Jobs\PurgeOldResetPasswords;
use App\Jobs\SendOcbMissingBreederReminder;
use App\Jobs\UpdateReductions as JobsUpdateReductions;
use App\Jobs\XmlEleveursReader as JobsXmlEleveursReader;
use App\Jobs\XmlIncoReader as JobsXmlIncoReader;
@ -52,19 +51,19 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
//$schedule->job(SendOcbMissingBreederReminder::class)->onOneServer()->dailyAt('07:30');
// $schedule->job(SendOcbMissingBreederReminder::class)->dailyAt('07:30');
$schedule->job(DeleteOrders::class)->dailyAt('14:00');
$schedule->job(DeleteOldMessages::class)->dailyAt('14:15');
$schedule->job(DeleteOldNotifications::class)->dailyAt('14:30');
$schedule->job(JobsUpdateReductions::class)->dailyAt('14:45');
$schedule->job(JobsXmlIncoReader::class)->name('xml-inco-reader')->onOneServer()->dailyAt('15:00');
$schedule->job(JobsXmlTracaReader::class)->name('xml-traca-reader')->onOneServer()->dailyAt('15:15');
$schedule->job(JobsXmlEleveursReader::class)->name('xml-eleveurs-reader')->onOneServer()->dailyAt('15:30');
$schedule->job(JobsXSCVMepReader::class)->name('csv-mep-reader')->onOneServer()->dailyAt('16:00');
$schedule->job(JobsXmlIncoReader::class)->name('xml-inco-reader')->dailyAt('15:00');
$schedule->job(JobsXmlTracaReader::class)->name('xml-traca-reader')->dailyAt('15:15');
$schedule->job(JobsXmlEleveursReader::class)->name('xml-eleveurs-reader')->dailyAt('15:30');
$schedule->job(JobsXSCVMepReader::class)->name('csv-mep-reader')->dailyAt('16:00');
$schedule->job(JobsPurgeNotifications::class)->dailyAt('00:15');
$schedule->job(PurgeOldResetPasswords::class)->dailyAt('00:25');
// * Remove Old traca
$schedule->command('xml:clean_olds')->onOneServer()->dailyAt('06:00');
$schedule->command('xml:clean_olds')->dailyAt('06:00');
}
}

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class ArticleCategory extends BaseEnumRoutable
{
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class BreedingBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -17,6 +22,11 @@ final class BreedingBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class ContactFormCivility extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class ContactFormCivility extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -26,6 +36,11 @@ final class ContactFormCivility extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -52,6 +52,7 @@ final class ContactFormType extends BaseEnumRoutable
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string

View file

@ -16,6 +16,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class Days extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -30,6 +35,11 @@ final class Days extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -44,6 +54,11 @@ final class Days extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -6,6 +6,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
abstract class Departaimant extends BaseEnumRoutable
{
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class DepartaimantCollectionType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class DepartaimantCollectionType extends BaseEnumRoutable
];
}
/**
* Enum label
*
* @return array
*/
protected static function labels(): array
{
return [
@ -26,6 +36,11 @@ final class DepartaimantCollectionType extends BaseEnumRoutable
];
}
/**
* Json serialize implementation.
*
* @return array
*/
public function jsonSerialize(): array
{
return [

View file

@ -107,6 +107,11 @@ namespace App\Enums;
*/
final class DepartaimantCurrent extends Departaimant
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -214,6 +219,11 @@ final class DepartaimantCurrent extends Departaimant
];
}
/**
* Enum label
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class DepartaimantStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -22,6 +27,11 @@ final class DepartaimantStatus extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -32,11 +42,21 @@ final class DepartaimantStatus extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;
}
/**
* To Array
*
* @return \Kwaadpepper\Enum\BaseEnum[]
*/
public static function toArray(): array
{
$array = [];
@ -49,6 +69,11 @@ final class DepartaimantStatus extends BaseEnumRoutable
return $array;
}
/**
* Json serialize implementation.
*
* @return array
*/
public function jsonSerialize(): array
{
return [

View file

@ -105,6 +105,11 @@ namespace App\Enums;
*/
final class DepartaimantVintage extends Departaimant
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -210,6 +215,11 @@ final class DepartaimantVintage extends Departaimant
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class EleveurOcbStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -21,6 +26,12 @@ final class EleveurOcbStatus extends BaseEnumRoutable
'yes' => 3
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -31,6 +42,11 @@ final class EleveurOcbStatus extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class EngagementBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -24,6 +29,11 @@ final class EngagementBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class EngagementType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class EngagementType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class GMapDataType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class GeneralConfigType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -22,6 +27,11 @@ final class GeneralConfigType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class GeoType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class GeoType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -21,6 +21,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class InputType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class NotificationType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -24,6 +29,11 @@ final class NotificationType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -18,6 +18,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class NutritionBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -29,6 +34,11 @@ final class NutritionBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class NutritionPageType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class NutritionPageType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -5,25 +5,32 @@ namespace App\Enums;
use Kwaadpepper\Enum\BaseEnumRoutable;
/**
* @method static self egg()
* @method static self rabbit()
* @method static self poultry()
*/
final class OCBType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
'egg' => 0,
'rabbit' => 1,
'poultry' => 2
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
'egg' => __('Oeuf'),
'rabbit' => __('Lapin'),
'poultry' => __('Volaille')
];

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class OrderStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -24,6 +29,11 @@ final class OrderStatus extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class OrderType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class OrderType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class PoultryBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -20,6 +25,11 @@ final class PoultryBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class PoultryPageType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class PoultryPageType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class PresentationType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class PresentationType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -19,6 +19,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RangeColor extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -35,6 +40,12 @@ final class RangeColor extends BaseEnumRoutable
'color11' => 'color-11'
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeDifficulty extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -22,6 +27,11 @@ final class RecipeDifficulty extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -32,6 +42,11 @@ final class RecipeDifficulty extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -13,6 +13,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeFilter extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
$labels = self::labels();
@ -24,6 +29,11 @@ final class RecipeFilter extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeFilterTimes extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
$labels = self::labels();
@ -22,6 +27,11 @@ final class RecipeFilterTimes extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,6 +10,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -18,6 +23,11 @@ final class RecipeType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -7,6 +7,7 @@ use Exception;
/**
* This class Exception is used to skip a row import from
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class AbortContactMailer extends Exception

View file

@ -7,6 +7,7 @@ use Exception;
/**
* This class Exception is used to skip a row import from
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class AbortRowImportException extends Exception

View file

@ -7,6 +7,7 @@ use Exception;
/**
* This class Exception is used in CB payement process
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class CBPayementError extends Exception

View file

@ -0,0 +1,9 @@
<?php
namespace App\Exceptions;
use Exception;
class InstaApiLimitReachedException extends Exception
{
}

View file

@ -7,6 +7,7 @@ use Exception;
/**
* This class Exception is used to skip a row import from
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class RedirectTo extends Exception

View file

@ -5,26 +5,36 @@ namespace App\Http\Controllers;
use App\Enums\GeneralConfigType;
use App\Models\Actu;
use App\Models\Tag;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Cache;
class ActuController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Contracts\View\View
*/
public function index()
{
$tags = Tag::has('actus')->get();
$actus = Actu::where('status', true)
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\Tag> */
$tags = Tag::query()->whereHas('actus', function (Builder $q) {
$q->where('status', true);
})->get();
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\Actu> */
$actus = Actu::query()->where('status', true)
->with('tags:id')
->orderBy('created_at', 'DESC')
->get(['id'])
->mapWithKeys(function ($actu) {
->map(function ($actu) {
return [
$actu->id => [
'id' => $actu->id,
'tags' => $actu->tags->mapWithKeys(function ($tag) {
return [$tag->id => $tag->id];
})->all()
]
'id' => $actu->id,
'tags' => $actu->tags->map(function ($tag) {
return $tag->id;
})->all()
];
})->all();
$generalConfig = app()->view->getShared()['GeneralConfigGlobal'] ?? null;
$generalConfig = $generalConfig ? $generalConfig->where('type', GeneralConfigType::actu())->first() : null;
return view('front.actu.index', [
@ -35,6 +45,12 @@ class ActuController extends Controller
]);
}
/**
* Display a news
*
* @param \App\Models\Actu $actu
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
public function view(Actu $actu)
{
$relatedActus = Actu::whereHas('tags', function ($q) use ($actu) {
@ -50,6 +66,12 @@ class ActuController extends Controller
]);
}
/**
* Render a news for JS usage (ajax)
*
* @param \App\Models\Actu $actu
* @return string Base64 rendered view.
*/
public function renderActu(Actu $actu)
{
if (!request()->wantsJson()) {

View file

@ -40,8 +40,8 @@ class AuthController extends Controller
/**
* Enregistre le customer dans la base de données
*
* @param CustomerRegisterRequest $request
* @return \Illuminate\Http\RedirectResponse
* @param \App\Http\Requests\CustomerRegisterRequest $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
*/
public function registerSubmit(CustomerRegisterRequest $request)
{
@ -143,6 +143,7 @@ class AuthController extends Controller
/**
* Retourne la page de connexion
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
@ -253,9 +254,11 @@ class AuthController extends Controller
/**
* Handle Api error exception
*
* @param ApiErrorException $e
* @param LoginRequest $request
* @param \LDC\LDCCRM\Exceptions\ApiErrorException $e
* @param \App\Http\Requests\LoginRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Exception Exception.
*/
private function handleLoginApiErrorException(ApiErrorException $e, LoginRequest $request)
{
@ -327,9 +330,12 @@ class AuthController extends Controller
/**
* Login a customer
*
* @param Customers $customer
* @param boolean $remember
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
* @param \App\Models\Customers $customer
* @param boolean $remember
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Exception Exception.
* @throws \RuntimeException RuntimeException.
*/
private function processLogin(Customers $customer, bool $remember)
{
@ -358,11 +364,12 @@ class AuthController extends Controller
}
/**
* Fomulaire reset mot de passe
* sur la page login
* Fomulaire reset mot de passe sur la page login
*
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse|void
* @throws \Exception Exception.
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function passwordReset(Request $request)
{
@ -452,12 +459,13 @@ class AuthController extends Controller
}
/**
* Modification du mot de passe par lien via le formulaire
* reset mot de passe
* Modification du mot de passe par lien via le formulaire reset mot de passe
*
* @param ResetCustomerPassword $request
* @param string $token
* @param \App\Http\Requests\ResetCustomerPassword $request
* @param string $token
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \LDC\LDCCRM\Exceptions\CrmException CrmException.
*/
public function changePassword(ResetCustomerPassword $request, string $token)
{
@ -503,8 +511,9 @@ class AuthController extends Controller
/**
* Mettre à jour le mot de passe lorsque l'on est connecté
*
* @param CustomerUpdatePassword $request
* @param \App\Http\Requests\CustomerUpdatePassword $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function changePasswordWhenAuthenticated(CustomerUpdatePassword $request)
{

View file

@ -444,6 +444,7 @@ class MomentsController extends Controller
/**
* Passe un moment en moment star. Si il y avait déjà un moment star, il ne l'est plus et le nouveau le remplace
*
* @param id L'id du moment qui doit devenir moment star
*/
public function setStar($id)

View file

@ -406,6 +406,7 @@ class BoutiqueController extends Controller
/**
* Get Mercanet ref and responseCode for request
*
* @return array['ref' => 'value', 'responseCode' => 'value']
*/
private function getMercanetData(Request $request): array

View file

@ -42,8 +42,8 @@ class BreedingPageController extends Controller
*/
public function list(BreedingPageType $pageType)
{
$pages = BreedingPage::where('type', $pageType)->whereStatus(true)->get();
$bannerUrl = $this->getBannerUrlFromGeneralConfig($pageType);
$pages = BreedingPage::where('type', $pageType)->whereStatus(true)->get();
$bannerUrl = $this->getBannerUrlFromGeneralConfig($pageType);
$headerText = $this->getTextHeaderFromGeneralConfig($pageType);
return view('front.breeding-page.list', compact('pages', 'pageType', 'bannerUrl', 'headerText'));

View file

@ -51,10 +51,11 @@ class ClubController extends Controller
}
/**
* index
* Index
*
* @param ArticleCategory|null $tag
* @param \App\Enums\ArticleCategory|null $tag
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function index(ArticleCategory $tag = null)
{
@ -110,8 +111,10 @@ class ClubController extends Controller
*
* nom, prénom, adresse, code postal, ville
*
* @param UpdateInfosRequest $request
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
* @param \App\Http\Requests\UpdateInfosRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Illuminate\Validation\ValidationException ValidationException.
*/
public function updateInfos(UpdateInfosRequest $request)
{
@ -151,8 +154,11 @@ class ClubController extends Controller
/**
* missingCrmInfosSubmit
*
* @param UpdateInfosRequest $request
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
* @param \App\Http\Requests\UpdateInfosRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Illuminate\Validation\ValidationException ValidationException.
* @throws \Symfony\Component\Routing\Exception\RouteNotFoundException RouteNotFoundException.
*/
public function missingCrmInfosSubmit(UpdateInfosRequest $request)
{
@ -171,9 +177,11 @@ class ClubController extends Controller
/**
* Updates user info
*
* @param UpdateInfosRequest $request
* @return boolean|string return strictly true if success,
* false il failed, could be a string with message error if failed
* @param \App\Http\Requests\UpdateInfosRequest $request
* @return \Illuminate\Http\RedirectResponse|string|boolean return strictly true if success,
* false il failed, could be a string with message error if failed
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Illuminate\Validation\ValidationException ValidationException.
*/
private function updateUserInfo(UpdateInfosRequest $request)
{
@ -307,9 +315,9 @@ class ClubController extends Controller
/**
* reductionsGet
*
* @param DownloadBRFileRequest $request
* @return Response
* @throws Exception Exception.
* @param \App\Http\Requests\DownloadBRFileRequest $request
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
* @throws \Exception Exception.
*/
public function reductionsGet(DownloadBRFileRequest $request)
{
@ -347,9 +355,11 @@ class ClubController extends Controller
/**
* Call the article page with a slug for the article to print
* @param ArticleCategory $tag
* @param Articles $publishedArticle
* @return View The view that the article have to print
*
* @param \App\Enums\ArticleCategory $tag
* @param \App\Models\Articles $publishedArticle
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
*/
public function article(ArticleCategory $tag, Articles $publishedArticle)
@ -382,8 +392,11 @@ class ClubController extends Controller
/**
* Handle the request of a customer that answered a survey
* @param SurveyAnswersRequest $request
* @return View View to go to
*
* @param \App\Http\Requests\SurveyAnswersRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \InvalidArgumentException InvalidArgumentException.
*/
public function answerSurvey(SurveyAnswersRequest $request)
{
@ -436,8 +449,10 @@ class ClubController extends Controller
/**
* Send a message to a user
*
* @param SendMessageRequest $request
* @param \App\Http\Requests\SendMessageRequest $request
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Throwable Throwable.
*/
public function sendMessage(SendMessageRequest $request)
{
@ -485,8 +500,11 @@ class ClubController extends Controller
/**
* Destroy a message
*
* @param DeleteMessagesRequest $request
* @param \App\Http\Requests\DeleteMessagesRequest $request
* @return \Illuminate\Http\JsonResponse
* @throws \LogicException LogicException.
* @throws \Throwable Throwable.
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function deleteMessage(DeleteMessagesRequest $request)
{
@ -520,9 +538,10 @@ class ClubController extends Controller
/**
* Block a customer to prevent him sending messages
*
* @param BlockCustomerRequest $request
* @param boolean $status
* @param \App\Http\Requests\BlockCustomerRequest $request
* @param boolean $status
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function blockCustomer(BlockCustomerRequest $request, bool $status)
{

View file

@ -102,6 +102,7 @@ class ContactController extends Controller
/**
* Propose meal recipe
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/

View file

@ -94,9 +94,10 @@ class CustomerController extends Controller
/**
* setFavoriteRecipe
*
* @param Recipes $recipe
* @param boolean $status
* @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory
* @param \App\Models\Recipes $recipe
* @param boolean $status
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function setFavoriteRecipe(Recipes $recipe, bool $status)
{

View file

@ -0,0 +1,99 @@
<?php
namespace App\Http\Controllers\Fo;
use App\Http\Controllers\Controller;
use App\Models\OpInsta\InstaMedia;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\ValidationException;
use Illuminate\View\View;
class OpInstaController extends Controller
{
/**
* Show OpInsta page
*
* @return \Illuminate\View\View
*/
public function index(): View
{
$this->assertConfigIsValid();
$has_started = $this->hasStarted();
$instaMediaList = InstaMedia::query()->orderBy('id')->get()
->map(function (InstaMedia $media) {
$path = \explode('/', \rtrim(\parse_url(
$media->permalink,
\PHP_URL_PATH
), '/'));
$media->pictures = $this->fetchPicture(\collect($path)->last());
return $media;
});
return \view('front.opinsta.index', \compact('instaMediaList', 'has_started'));
}
/**
* Assert config is valid
*
* @return void
* @throws \ErrorException If config is invalid.
*/
private function assertConfigIsValid(): void
{
try {
$start = config('opinsta.start');
$end = config('opinsta.end');
Validator::validate([
'start' => $start,
'end' => $end,
], [
'start' => 'date_format:d-m-Y|before:end',
'end' => 'date_format:d-m-Y|after:start',
]);
} catch (ValidationException $e) {
$message = \collect($e->errors())->map(function ($el) {
return \collect($el)->implode(', ');
})->implode(', ');
throw new \ErrorException("Op install config is invalid, {$message}");
}
}
/**
* Le jeu a démaré ?
*
* Démarre à la date de départ (0h00) et s'arrête à la date de fin (23h59)
*
* @return boolean
*/
private function hasStarted(): bool
{
$start = Carbon::createFromFormat('d-m-Y', config('opinsta.start'), 'Europe/Paris')->setTime(0, 0);
$end = Carbon::createFromFormat('d-m-Y', config('opinsta.end'), 'Europe/Paris')->setTime(0, 0);
$now = Carbon::now('Europe/Paris')->setTime(0, 0);
return $now->isBetween($start, $end);
}
/**
* Fetch Media Picture Object
*
* @param string $ig_media_hash
* @return array<integer,string[]>
*/
private function fetchPicture(string $ig_media_hash): array
{
return Cache::remember(
"media_picture_ajax_fetch{$ig_media_hash}",
// * 3H cache
3 * 60 * 60,
function () use ($ig_media_hash) {
return InstaMedia::fetchInstagramMediaPictures($ig_media_hash);
}
);
}
}

View file

@ -52,8 +52,11 @@ class HomeController extends Controller
/**
* Call the CRM to add a single optin
* @param SingleOptinRequest $request
* @return string Message to print to the customer
*
* @param \App\Http\Requests\SingleOptinRequest $request
* @return string|array|null|\Illuminate\Contracts\Translation\Translator
* @throws \LDC\LDCCRM\Exceptions\ValidationException ValidationException.
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function addOptIn(SingleOptinRequest $request)
{

View file

@ -77,17 +77,4 @@ class OCBController extends Controller
->inRandomOrder()->first();
return view('front.ocb.poultry', compact('breeder', 'ocbContents'));
}
/**
* Show ocb egg content
*
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
public function egg()
{
$ocbContents = OCBContent::where('type', OCBType::egg())
->orderBy('order')
->where('status', true)->get();
return view('front.ocb.egg', compact('ocbContents'));
}
}

View file

@ -23,8 +23,9 @@ class EnterCodeController extends Controller
/**
* Participate Method
*
* @param ParticipateRequest $request
* @param \App\Http\Requests\OpBrCharcut\ParticipateRequest $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function participate(ParticipateRequest $request)
{
@ -32,12 +33,11 @@ class EnterCodeController extends Controller
}
/**
* Détermine si un BR doit être servi
* renvoi la vue de gain BR
* Détermine si un BR doit être servi, renvoi la vue de gain BR
*
* @param
*
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
* @param mixed $code
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
private function serveCouponWin($code)
{
@ -68,7 +68,9 @@ class EnterCodeController extends Controller
* Update a coupon
*
* @param mixed $id_coupon
* @return \App\Models\Reduction|null
* @param mixed $qtty
* @return mixed
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
private function updateCoupon($id_coupon, $qtty)
{
@ -107,6 +109,15 @@ class EnterCodeController extends Controller
return $reduction;
}
/**
* updateCustomer
*
* @param mixed $hascode
* @param mixed $email
* @param mixed $country
* @return mixed
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
private function updateCustomer($hascode, $email, $country)
{
/** @var \App\Lib\MesBR */

View file

@ -3,19 +3,38 @@
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\View;
class SecureHeaders
{
// Enumerate headers which you do not want in your application's responses.
// Great starting point would be to go check out @Scott_Helme's:
// https://securityheaders.com/
/**
* Enumerate headers which you do not want in your application's responses.
* Great starting point would be to go check out @Scott_Helme's:
* https://securityheaders.com/
*
* @var array
*/
private $unwantedHeaderList = [
'X-Powered-By',
'Server',
];
public function handle($request, Closure $next)
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
View::share('nonce', $nonce = \uniqid());
// * For VueJS dev tool to execute
$jsDev = config('app.debug') ? "'unsafe-eval' 'unsafe-inline'" : "'nonce-{$nonce}' 'strict-dynamic'";
$reportUri = Route::has('cspReportUri') ?
\sprintf('report-uri %s', \parse_url(route('cspReportUri'), \PHP_URL_PATH)) : '';
$this->removeUnwantedHeaders($this->unwantedHeaderList);
$response = $next($request);
$response->headers->set('Referrer-Policy', 'no-referrer-when-downgrade');
@ -24,19 +43,48 @@ class SecureHeaders
$response->headers->set('X-Frame-Options', 'SAMEORIGIN');
$response->headers->set('Strict-Transport-Security', 'max-age=31536000; includeSubDomains;');
$cspPolicies = [
'frame-src ' . implode(" ", [
'\'self\'',
'https://www.youtube.com',
'https://vimeo.com/',
'https://player.vimeo.com/',
'https://www.google.com/recaptcha/',
'https://recaptcha.google.com/recaptcha/'
]) . ';',
"style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://fonts.googleapis.com;",
// phpcs:ignore Generic.Files.LineLength.TooLong
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com https://www.googletagmanager.com https://www.google-analytics.com https://maps.googleapis.com https://fonts.googleapis.com;"
'script-src ' . implode(" ", [
'\'self\'',
'\'unsafe-inline\'',
'\'unsafe-eval\'',
'https://cdnjs.cloudflare.com',
'https://*.googletagmanager.com',
'https://www.google-analytics.com',
'https://maps.googleapis.com',
'https://fonts.googleapis.com',
'https://www.google.com/recaptcha/',
'https://www.gstatic.com/recaptcha/',
'https://yl.s-web.fr',
]) . ' ' . $jsDev . ';'
];
$response->headers->set(
'Content-Security-Policy',
implode(' ', $cspPolicies)
implode(' ', $cspPolicies) . $reportUri
);
$response->headers->set('Feature-Policy', 'fullscreen \'self\';');
$response->headers->set('Feature-Policy', \implode(',', [
'fullscreen', 'accelerometer', 'encrypted-media',
'gyroscope', 'picture-in-picture'
]) . ';');
return $response;
}
private function removeUnwantedHeaders($headerList)
/**
* Remove unwanted headers
*
* @param array $headerList
* @return void
*/
private function removeUnwantedHeaders(array $headerList)
{
foreach ($headerList as $header) {
header_remove($header);

View file

@ -67,7 +67,7 @@ class BoutiqueBuyRequest extends FormRequest
{
return [
'coords' => trans('vos coordonnées'),
'coords.civility' => trans('civilitée dans vos coordonnées'),
'coords.civility' => trans('civilité dans vos coordonnées'),
'coords.firstname' => trans('prénom dans vos coordonnées'),
'coords.lastname' => trans('nom dans vos coordonnées'),
'coords.address' => trans('adresse dans vos coordonnées'),
@ -76,7 +76,7 @@ class BoutiqueBuyRequest extends FormRequest
'coords.city' => trans('ville dans vos coordonnées'),
'coords.email' => trans('e-mail dans vos coordonnées'),
'shipping' => trans('votre adresse de livraison'),
'shipping.civility' => trans('civilitée dans votre adresse de livraison'),
'shipping.civility' => trans('civilité dans votre adresse de livraison'),
'shipping.firstname' => trans('prénom dans votre adresse de livraison'),
'shipping.lastname' => trans('nom dans votre adresse de livraison'),
'shipping.address' => trans('adresse dans votre adresse de livraison'),

View file

@ -4,6 +4,7 @@ namespace App\Http\Requests;
use App\Enums\ContactFormCivility;
use App\Enums\ContactFormType;
use App\Lib\Helpers\ToolboxHelper;
use Illuminate\Foundation\Http\FormRequest;
use Kwaadpepper\Enum\Rules\EnumIsValidRule;
@ -26,6 +27,8 @@ class ContactFormRequest extends FormRequest
*/
public function rules()
{
ToolboxHelper::validateRecaptcha($this, \config('services.google.recaptcha.version'));
if ($this->type == ContactFormType::onepage()->value) {
app()->setLocale('nl');
}

View file

@ -2,6 +2,7 @@
namespace App\Http\Requests;
use App\Lib\Helpers\ToolboxHelper;
use Carbon\Carbon;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;
@ -36,6 +37,8 @@ class CustomerRegisterRequest extends FormRequest
*/
public function rules()
{
ToolboxHelper::validateRecaptcha($this, \config('services.google.recaptcha.version'));
return [
'email' => 'required|email:rfc,dns,spoof,filter|max:255|unique:customers,email',
'username' => 'required|string|min:1|max:255|unique:customers,username',
@ -78,13 +81,22 @@ class CustomerRegisterRequest extends FormRequest
];
}
/**
*
* @return array
*/
public function attributes()
{
return [
'postcode' => 'Code postal'
'postcode' => 'Code postal',
'username' => 'pseudo'
];
}
/**
*
* @return array
*/
public function messages()
{
return [

View file

@ -17,13 +17,19 @@ class UpdateEngagement extends FormRequest
*/
public function authorize()
{
if (auth()->check()) {
$this->merge([
'status' => $this->status === null ? 0 : 1
]);
return true;
}
return false;
return auth()->check();
}
/**
* Prepare the data for validation.
*
* @return void
*/
public function prepareForValidation()
{
$this->merge([
'status' => $this->status ? true : false
]);
}
/**
@ -34,7 +40,8 @@ class UpdateEngagement extends FormRequest
public function rules()
{
$rules = [
'title' => 'required|string|min:7'
'title' => 'required|string|min:7',
'status' => 'required|boolean'
];
if ($this->engagement->type == EngagementType::header()) {
$rules = array_merge($rules, [
@ -129,9 +136,14 @@ class UpdateEngagement extends FormRequest
}//end if
break;
case InputType::url()->value:
if ($iptName === "link") {
$ruleAtt = "sometimes";
} else {
$ruleAtt = "required";
}
$rules = array_merge($rules, [
"content.$i.content.$iptName.value" => [
'required', 'url',
$ruleAtt, 'url',
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function ($attribute, $value, $fail) {
try {
@ -172,10 +184,10 @@ class UpdateEngagement extends FormRequest
"content.$i.content.$iptName.value" => 'boolean'
]);
break;
}//end switch
}//end foreach
}//end foreach
}//end if
} //end switch
} //end foreach
} //end foreach
} //end if
return $rules;
}
}

View file

@ -17,6 +17,7 @@ class SendArchadiaMail implements ShouldQueue
/**
* To be serialized by jobs system
*
* @var MailContactData
* */
private $data;

View file

@ -16,6 +16,7 @@ class SendNLMail implements ShouldQueue
/**
* To be serialized by jobs system
*
* @var MailContactData
* */
private $data;

View file

@ -28,6 +28,7 @@ class SendOrderToArchadia implements ShouldQueue
/**
* Create a new job instance.
*
* @param \App\Models\Order $order
* @return void
*/

View file

@ -17,6 +17,7 @@ class SendPasserelleMail implements ShouldQueue
/**
* To be serialized by jobs system
*
* @var MailContactData
* */
private $data;

View file

@ -469,7 +469,6 @@ class XmlIncoReader extends XmlJobs
* <TYP_PORTION><![CDATA[Approximatif]]></TYP_PORTION>
* extracted as "TYP_PORTION" => "Approximatif"
*
*
* @param \SimpleXMLElement|false $sxe
* @return array
*/
@ -484,15 +483,18 @@ class XmlIncoReader extends XmlJobs
if ($value->count()) {
$extraction = $this->extract($value);
if(count($extraction)
&& array_key_exists("code",$extraction)
&& array_key_exists("libelle",$extraction)) {
$val = strval($extraction['libelle']);
if (
count($extraction)
&& array_key_exists("code", $extraction)
&& array_key_exists("libelle", $extraction)
) {
$val = strval($extraction['libelle']);
$extract[$key] = strlen($val) ? $val : null;
continue;
}
$extract[$key][] = $extraction; //$this->extract($value);
$extract[$key][] = $extraction;
// $this->extract($value);
continue;
}
$value = strval($value);
@ -501,7 +503,7 @@ class XmlIncoReader extends XmlJobs
} else {
$extract[$key] = strlen($value) ? $value : null;
}
}
}//end foreach
return $extract;
}
}

View file

@ -127,6 +127,7 @@ abstract class XmlJobs extends XArcadiaFlux
} catch (InvalidXmlException $e) {
$message = $e->getMessage();
if (get_class($e) === QueryException::class) {
/** @var \Illuminate\Database\QueryException $e */
$message = implode(' ', $e->errorInfo);
}
$this->log(

View file

@ -63,13 +63,13 @@ class XmlTracaReader extends XmlJobs
XmlTraceability::class,
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function (\SimpleXMLElement $xmlContent, array &$line) {
$abatage_date = \explode('-', $line['abatage_date']);
// * Inverser année et jours a cause du flux de merde
$abatage_date = \explode('.', $line['abatage_date']);
// * Inverser année et jours a cause du flux
$line['abatage_date'] = \sprintf(
'20%s-%s-%s',
'20%s/%s/%s',
$abatage_date[2],
$abatage_date[1],
substr($abatage_date[0], 2)
$abatage_date[0]
);
}
);

View file

@ -0,0 +1,65 @@
<?php
namespace App\Lib\Helpers;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Validator;
class ToolboxHelper
{
/**
* Validate recaptcha
*
* @param Request $request
* @param boolean $isV3
* @return void
*/
public static function validateRecaptcha(Request $request, bool $isV3 = true)
{
Validator::validate($request->all(), [
'g-recaptcha-response' => [
'required', 'string',
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed, Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
function ($attribute, $value, $fail) use ($isV3) {
try {
$response = Http::asForm()->post('https://www.google.com/recaptcha/api/siteverify', [
'secret' => config('services.google.recaptcha.private'),
'response' => \strval($value),
'remoteip' => app('clientIp')
]);
if ($e = $response->toException()) {
throw $e;
}
if ($isV3) {
if (
!$response->json('success') or
!$response->json('challenge_ts') or
Carbon::parse($response->json('challenge_ts'))->lessThan(\now('utc')->subMinutes(5)) or
$response->json('hostname') !== \parse_url(config('app.url'), \PHP_URL_HOST) or
!$response->json('score')
) {
throw new \RuntimeException();
}
if (\floatval($response->json('score')) < 0.8) {
$fail("Vous n'avez pas obtenu un score assez élevé lors de la validation du recaptcha");
}
return;
}
if (
!$response->json('success') or
!$response->json('challenge_ts') or
Carbon::parse($response->json('challenge_ts'))->lessThan(\now('utc')->subMinutes(5)) or
$response->json('hostname') !== \parse_url(config('app.url'), \PHP_URL_HOST)
) {
throw new \RuntimeException();
}
} catch (\Exception $e) {
$fail('Erreur lors de la validation du formulaire veuillez réssayer');
} //end try
}
]
], [], ['g-recaptcha-response' => 'reCaptcha']);
}
}

View file

@ -0,0 +1,91 @@
<?php
namespace App\Lib\Instagram;
use App\Exceptions\InstaApiLimitReachedException as InstaApiException;
use Illuminate\Http\Client\HttpClientException;
use Illuminate\Http\Client\Response;
use Illuminate\Support\Facades\Http;
/**
* Fetch Instagram Top Media List
*
* @package App\Lib
*/
class ApiFetcher
{
/**
* Try to fetch media pictures from a permalink using og data.
*
* @param string $url
* @return array
* @throws \RuntimeException If a call error or a response parsing error occurs.
*/
public function fetchMediaPicturesFromPostPermalink(string $url): array
{
try {
$response = $this->httpCall('GET', $url);
$html = $response->body();
$dom = new \DOMDocument();
$dom->loadHTML($html);
$scripts = $dom->getElementsByTagName('script');
return collect($scripts)->filter()->map(function (\DOMElement $script) {
if ($script->getAttribute('type') != 'application/ld+json') {
return null;
}
$entity = json_decode($script->nodeValue, true);
if ($entity['@type'] !== 'SocialMediaPosting') {
return null;
}
return \collect($entity['image'])->map(function (array $picture) {
return $picture['url'];
})->all();
})->filter(function ($el) {
return !empty($el);
})->first() ?? [];
} catch (\Exception $e) {
throw new \RuntimeException($e->getMessage(), $e->getCode(), $e);
} //end try
}
/**
* Call url and fetch result in array.
*
* @param string $method The HTTP VERB to use (GET, POST).
* @param string|\Psr\Http\Message\UriInterface $uri The uri to call.
* @param array $parameters The call parameters to pass on.
* @return \Illuminate\Http\Client\Response
* @throws \Error If the request method is not supported.
* @throws \RuntimeException If something goes wrong.
* @throws \App\Exceptions\InstaApiException If the api denies access for some reason.
*/
private function httpCall(
string $method,
$uri = '',
array $parameters = []
): Response {
try {
if (!\in_array(\strtoupper($method), ['GET', 'POST'])) {
throw new \Error("Unsupported method {$method}");
}
/** @var \Illuminate\Http\Client\Response */
$response = Http::timeout(\config('app.debug') ? 3 : 30)
->retry(2, 100)
->{strtolower($method)}($uri, $parameters);
// * Throw an exception if an error occured.
$response->throw();
return $response;
} catch (HttpClientException $e) {
/** @var \Illuminate\Http\Client\Response $response */
if ($e instanceof \Illuminate\Http\Client\RequestException and $e->getCode() === 403) {
$response = $e->response;
$message = $response->json('error.message');
$code = $response->json('error.code');
throw new InstaApiException($message, $code, $e);
}
throw new \RuntimeException($e);
} //end try
}
}

View file

@ -0,0 +1,50 @@
<?php
namespace App\Lib\Instagram\Objects;
use Illuminate\Support\Carbon;
/**
* Top Media object
*
* @property integer $insta_id A unique instagram id that can be used for api calls.
* @property string $type The instagram object type, commonly IMAGE or CAROUSEL_ALBUM.
* @property string $username The instagram user name, scrapped using OG description.
* @property string $caption The object text content.
* @property string $permalink The uri where is stored the Instagram object.
* @property \Carbon\Carbon $timestamp UTC timestamp from instagram api.
* @property integer $comments_count The number of comments.
* @property null|integer $like_count The number of likes.
*
* @package App\Lib\Instagram\Objects
*/
class TopMedia extends \stdClass
{
/**
* Set this object data from Ig api data
*
* @param object $ig_media
* @return void
*/
public function setData(object $ig_media): void
{
$this->insta_id = \intval($ig_media->id);
$this->type = $ig_media->media_type;
$this->permalink = $ig_media->permalink;
$this->timestamp = Carbon::parse($ig_media->timestamp);
$this->comments_count = \intval($ig_media->comments_count);
$this->like_count = \optional($ig_media)->like_count ? \intval($ig_media->like_count) : null;
$this->caption = $ig_media->caption;
}
/**
* Set this object username
*
* @param string $username
* @return void
*/
public function setUserName(string $username): void
{
$this->username = $username;
}
}

View file

@ -558,6 +558,7 @@ class Mercanet
/**
* Filter http request parameters
*
* @param array $requestParameters
*/
private function filterRequestParameters(array $httpRequest)
@ -595,6 +596,7 @@ class Mercanet
/**
* Checks if the response is valid
*
* @return boolean
*/
public function isValid()
@ -658,6 +660,7 @@ class Mercanet
/**
* Retrieves a response parameter
*
* @param string $param
* @throws \InvalidArgumentException
*/

View file

@ -5,6 +5,7 @@ namespace App\Lib;
class MesBR
{
private $endpoint;
private $refCamp;
public function __construct($endpoint, $refCamp)

View file

@ -9,20 +9,23 @@ namespace App\Lib;
class MesBROld
{
private $endpoint;
private $refSite;
private $refCamp;
public function __construct($endpoint, $refSite, $refCamp)
{
$this->endpoint = $endpoint;
$this->refSite = $refSite;
$this->refCamp = $refCamp;
$this->refSite = $refSite;
$this->refCamp = $refCamp;
}
/** Update contact *
* NOT USED - SHOULD BE DELETED
*
* @param $oCrmUser
* @return bool
* @return boolean
*/
public function updateContact($oCrmUser)
{
@ -46,9 +49,10 @@ class MesBROld
}
/** Update panier *
*
* @param $oCrmUser
* @param $couponId
* @param int $quantity
* @param integer $quantity
* @return array
*/
public function updatePanier($oCrmUser, $refid, $couponId, $quantity = 1)
@ -56,7 +60,7 @@ class MesBROld
$datas = [
'refsite' => $this->refSite,
'refcamp' => $this->refCamp,
//TODO : ici il faut une id qui est ajoutée au code barre du coupon donc un hascode c'est trop long
// TODO : ici il faut une id qui est ajoutée au code barre du coupon donc un hascode c'est trop long
'refadherent' => $refid,
'nom' => $oCrmUser->lastname,
'prenom' => $oCrmUser->firstname,
@ -66,7 +70,7 @@ class MesBROld
'pays' => $this->getCountry($oCrmUser->country),
'panier' => "($quantity)$couponId"
];
$res = $this->callAPI("GET", "/updatebasket", $datas);
$res = $this->callAPI("GET", "/updatebasket", $datas);
if (!$res) {
error_log("MESBR - CODE : 999 - MESSAGE : Cannot read API Response (non json)");
return ['status' => 'KO', 'code' => 999, 'message' => 'Cannot read API Response (non json)'];
@ -76,7 +80,7 @@ class MesBROld
return ['status' => 'KO', 'code' => $res->Code, 'message' => $res->Message];
}
$panierVerification = $this->endpoint . '/showbasket?basketid=' . $res->Panier->Panier;
$panier_link = $this->endpoint . '/?basketid=' . $res->Panier->Panier;
$panier_link = $this->endpoint . '/?basketid=' . $res->Panier->Panier;
return ['status' => 'OK', 'link' => $panier_link, 'verif' => $panierVerification, 'basketId' => $res->Panier->Panier];
}
/** Génère le lien vers le mur (ou panier préprogrammé) **/
@ -94,7 +98,8 @@ class MesBROld
return 442;
break;
default:
return 250; //France
return 250;
// France
break;
}
}
@ -104,20 +109,23 @@ class MesBROld
switch ($method) {
case "POST":
curl_setopt($curl, CURLOPT_POST, 1);
if ($data)
if ($data) {
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
break;
case "PUT":
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
if ($data)
if ($data) {
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
break;
default:
if ($data)
if ($data) {
$url = sprintf("%s?%s", $url, http_build_query($data));
}
}
curl_setopt($curl, CURLOPT_URL, $this->endpoint . $url);
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($curl, CURLOPT_COOKIESESSION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
if (!$result) {

View file

@ -25,6 +25,7 @@ class Utils
* Replace stange accents
*
* https://stackoverflow.com/questions/3371697/replacing-accented-characters-php
*
* @author Jérémy Munsch <jeremy.munsch@jeremydev.ovh>
* @param string $subject
* @return string

View file

@ -51,7 +51,7 @@ class Order extends Mailable
protected function makePdfFile(): string
{
/** @var \Meneses\LaravelMpdf\LaravelMpdfWrapper */
$mpdf = app('mpdf.wrapper');
$mpdf = app('laravel-mpdf');
/** @var \Meneses\LaravelMpdf\LaravelMpdf */
$pdf = $mpdf->loadView(
'documents.order',

View file

@ -21,8 +21,8 @@ class ReductionWon extends Mailable implements ShouldQueue
*/
public function __construct($user, $linkpanier)
{
$this->user = $user;
$this->linkpanier = $linkpanier;
$this->user = $user;
$this->linkpanier = $linkpanier;
}
/**

View file

@ -126,6 +126,7 @@ class Contact extends Model
/**
* Get Counter skeleton
*
* @return array
*/
private function counterSkeleton(): array

View file

@ -4,7 +4,6 @@ namespace App\Models;
use App\Enums\DepartaimantCollectionType;
use App\Http\Resources\CustomerCrmResource;
use App\Lib\Utils;
use Illuminate\Support\Str;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

View file

@ -34,22 +34,52 @@ class DepartaimantsCollection extends Model
protected $table = 'departaimants';
private static $columnTableNamePrefix = 'col';
// Le prefix d'un table departaimant
/**
* Le prefix d'un table departaimant
*
* @var integer
*/
private static $tableFields = 4;
// Le nombre de colonnes des departaimants
/**
* Le nombre de colonnes des departaimants
*
* @var integer
*/
private static $departementWidth = 2;
// La largeur en bits d'un départaimant
/**
* La largeur en bits d'un départaimant
* * to be set in construct
*
* @var array
*/
public $attributes = [
'type' => 'current'
// to be set in construct
];
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
public $fillable = [
'collection'
];
/**
* Handle dynamic static method calls into the model.
*
* @param string $name
* @param array $arguments
* @return mixed
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
* @phpcs:disable Squiz.Commenting.FunctionComment.ScalarTypeHintMissing
*/
public static function __callStatic($name, $arguments)
{
// phpcs:enable
if ($name === 'defaultType') {
return DepartaimantCollectionType::current();
}
@ -59,8 +89,8 @@ class DepartaimantsCollection extends Model
/**
* @param array $attributes
* @throws TypeError
* @throws BadMethodCallException
* @throws \TypeError
* @throws \BadMethodCallException
*/
public function __construct(array $attributes = [])
{

View file

@ -11,16 +11,25 @@ use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Kwaadpepper\Enum\Traits\CastsEnums;
// old Breeders
class OCBBreeder extends BreederForGmap
{
use CastsEnums;
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'display' => 'boolean',
'inuavs' => 'array'
];
/**
* The attributes that should be cast to Enums.
*
* @var array
*/
protected $enumCasts = [
'presentation_type' => PresentationType::class,
'ocbStatus' => EleveurOcbStatus::class,
@ -28,8 +37,18 @@ class OCBBreeder extends BreederForGmap
'geo_type' => GeoType::class
];
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'ocb_breeders';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'breeder_code',
'first_name',
@ -51,6 +70,11 @@ class OCBBreeder extends BreederForGmap
'inuavs',
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted()
{
static::creating(function ($breeder) {
@ -96,11 +120,18 @@ class OCBBreeder extends BreederForGmap
});
}
/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName()
{
return "slug";
}
// * METHODS
/**
* Get ocb validated breeders query
*
@ -111,28 +142,55 @@ class OCBBreeder extends BreederForGmap
return static::where('ocbStatus', EleveurOcbStatus::yes());
}
/**
* Getter picture attribute
*
* @return mixed
*/
protected function getPictureAttribute()
{
return $this->pictureAttribute('picture');
}
/**
* Getter picture_1 attribute
*
* @return mixed
*/
protected function getPicture1Attribute()
{
return $this->pictureAttribute('picture1');
}
/**
* Getter picture_2 attribute
*
* @return mixed
*/
protected function getPicture2Attribute()
{
return $this->pictureAttribute('picture2');
}
/**
* Getter picture_3 attribute
*
* @return mixed
*/
protected function getPicture3Attribute()
{
return $this->pictureAttribute('picture3');
}
/**
* Refactored picture attribute
*
* @param string $prop
* @return mixed
*/
private function pictureAttribute(string $prop)
{
$p = $this->attributes[$prop];
// For migrated urls from 2016
// For migrated urls from 2016.
if (
is_null($p) or
!strlen($p) or

View file

@ -10,12 +10,27 @@ class OCBContent extends Model
{
use CastsEnums;
/**
* The attributes that should be cast to Enums.
*
* @var array
*/
protected $enumCasts = [
'type' => OCBType::class
];
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'ocb_content';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'picture',
'content',
@ -24,6 +39,11 @@ class OCBContent extends Model
'status'
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted()
{
static::creating(function ($ocbContent) {

View file

@ -11,6 +11,7 @@ use Kwaadpepper\Serial\Exceptions\SerialCasterException;
class Code extends Model
{
protected $table = 'opbrcharcut_codes';
/**
* The attributes that are mass assignable.
*
@ -29,7 +30,6 @@ class Code extends Model
public $timestamps = false;
// * RELATIONS
public function customer()
{
return $this->belongsTo(Customers::class);
@ -83,7 +83,7 @@ class Code extends Model
);
} catch (SerialCasterException $e) {
Log::error($e->getMessage() . " code utilisé : " . $serial);
//return 0 invalid value for code
// return 0 invalid value for code
return 0;
}
}

View file

@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
class CodeEan extends Model
{
protected $table = 'opbrcharcut_codes_eans';
/**
* The attributes that are mass assignable.
*

View file

@ -0,0 +1,91 @@
<?php
namespace App\Models\OpInsta;
use Illuminate\Database\Eloquent\Casts\AsStringable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @mixin \App\Lib\Instagram\Objects\TopMedia
*
* @package App\Models\OpInsta
*/
class InstaMedia extends Model
{
use HasFactory;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'opinsta';
/**
* The attributes that should be cast.
*
* @var string[]
*/
protected $casts = [
'caption' => AsStringable::class,
'permalink' => AsStringable::class,
'timestamp' => 'immutable_datetime'
];
// * METHODS
/**
* Fetch Media picture using ig media hash
*
* @param string $ig_media_hash
* @return array
* @throws \RuntimeException If a call error or a response parsing error occurs.
*/
public static function fetchInstagramMediaPictures(string $ig_media_hash): array
{
/** @var \App\Lib\Instagram\ApiFetcher */
$igFetcherClient = \app('Instagram');
return $igFetcherClient->fetchMediaPicturesFromPostPermalink("https://www.instagram.com/p/{$ig_media_hash}/");
}
/**
* Fetch and check config elements
*
* @return array 'hashtag_id', 'user_id', 'media_count', 'fields'
* @throws \RuntimeException If config is not valid.
*/
private static function fetchConfigParameters(): array
{
$hashtag_id = config('services.facebook.enpoints.ig_top_media.hashtag_id');
$user_id = config('services.facebook.enpoints.ig_top_media.user_id');
$media_count = config('services.facebook.enpoints.ig_top_media.media_count');
if (empty($hashtag_id)) {
throw new \RuntimeException(
'Missing services.facebook.enpoints.ig_top_media.hashtag_id,
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_HASHTAGID'
);
}
if (empty($user_id)) {
throw new \RuntimeException(
'Missing services.facebook.enpoints.ig_top_media.user_id,
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_USERID'
);
}
if (empty($media_count)) {
throw new \RuntimeException(
'Missing services.facebook.enpoints.ig_top_media.media_count,
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_NBMEDIA'
);
}
$hashtag_id = \intval($hashtag_id);
$user_id = \intval($user_id);
$media_count = \intval($media_count);
return \compact(
'hashtag_id',
'user_id',
'media_count'
);
}
}

View file

@ -70,6 +70,7 @@ class Recipes extends Model
/**
* Get Associated Recipes
*
* @return \Illuminate\Database\Eloquent\Collection<Recipes>
*/
public function associatedRecipes()
@ -137,6 +138,7 @@ class Recipes extends Model
/**
* Check if recipe has been rated by the user (in session also if not Auth)
*
* @return boolean
*/
public function hasBeenRatedByUser()
@ -152,6 +154,7 @@ class Recipes extends Model
/**
* Check if recipe has been rated by the user (in session also if not Auth)
*
* @return boolean
*/
public function getUserRating()
@ -167,6 +170,7 @@ class Recipes extends Model
/**
* Set the recipes rating and memorize in session, or user
*
* @param string $rating
* @return void
*/

View file

@ -2,6 +2,7 @@
namespace App\Providers;
use App\Lib\Instagram\ApiFetcher;
use App\Models\Actu;
use App\Models\Articles;
use App\Models\GeneralConfig;
@ -82,6 +83,11 @@ class AppServiceProvider extends ServiceProvider
Log::critical($e->getMessage());
View::share('GeneralConfigGlobal', []);
}
// * Instagram Singleton
App::singleton('Instagram', function () {
return new ApiFetcher();
});
}//end if
Blade::directive('svg', function ($arguments) {

View file

@ -207,7 +207,10 @@ class RouteServiceProvider extends ServiceProvider
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
->group(base_path('routes/web-bo.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web-fo.php'));
}
/**

View file

@ -27,9 +27,6 @@ trait GoogleMapSerialize
case OCBType::poultry()->value:
$ocbType = trans('Éleveur de volaille');
break;
case OCBType::egg()->value:
$ocbType = trans('Producteur d\'oeufs');
break;
case OCBType::rabbit()->value:
$ocbType = trans('Éleveur de lapins');
break;

View file

@ -18,11 +18,10 @@
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.4",
"htmlmin/htmlmin": "^8.0",
"kwaadpepper/enum": "^2.1",
"kwaadpepper/image-resizer": "^0.1.0",
"kwaadpepper/refresh-sitemap": "^1.0",
"kwaadpepper/serial-int-caster": "^1.0",
"kwaadpepper/refresh-sitemap": "1.0.0",
"kwaadpepper/serial-int-caster": "1.0.1",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^3.0",
@ -47,9 +46,9 @@
"slevomat/coding-standard": "^7.0"
},
"repositories": {
"gitlab.com/16669037": {
"lab.s-web.fr/23": {
"type": "composer",
"url": "https://gitlab.com/api/v4/group/16669037/-/packages/composer/packages.json"
"url": "https://lab.s-web.fr/api/v4/group/23/-/packages/composer/packages.json"
}
},
"config": {
@ -57,8 +56,12 @@
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": true
},
"gitlab-domains": [
"lab.s-web.fr"
]
},
"extra": {
"laravel": {

990
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -148,6 +148,7 @@ return [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
@ -174,11 +175,11 @@ return [
/*
* Package Service Providers...
*/
HTMLMin\HTMLMin\HTMLMinServiceProvider::class,
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,

View file

@ -82,6 +82,26 @@ return [
]) : [],
],
'opinsta' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL_OPINSTA'),
'host' => env('DB_HOST_OPINSTA', '127.0.0.1'),
'port' => env('DB_PORT_OPINSTA', '3306'),
'database' => env('DB_DATABASE_OPINSTA', 'forge'),
'username' => env('DB_USERNAME_OPINSTA', 'forge'),
'password' => env('DB_PASSWORD_OPINSTA', ''),
'unix_socket' => env('DB_SOCKET_OPINSTA', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA_2016'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),

View file

@ -1,70 +0,0 @@
<?php
/*
* This file is part of Laravel HTMLMin.
*
* (c) Graham Campbell <graham@alt-three.com>
* (c) Raza Mehdi <srmk@outlook.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
/*
|--------------------------------------------------------------------------
| Automatic Blade Optimizations
|--------------------------------------------------------------------------
|
| This option enables minification of the blade views as they are
| compiled. These optimizations have little impact on php processing time
| as the optimizations are only applied once and are cached. This package
| will do nothing by default to allow it to be used without minifying
| pages automatically.
|
| Default: false
|
*/
'blade' => env('APP_DEBUG') ? false : 'html',
/*
|--------------------------------------------------------------------------
| Force Blade Optimizations
|--------------------------------------------------------------------------
|
| This option forces blade minification on views where there such
| minification may be dangerous. This should only be used if you are fully
| aware of the potential issues this may cause. Obviously, this setting is
| dependent on blade minification actually being enabled.
|
| PLEASE USE WITH CAUTION
|
| Default: false
|
*/
'force' => false,
/*
|--------------------------------------------------------------------------
| Ignore Blade Files
|--------------------------------------------------------------------------
|
| Here you can specify paths, which you don't want to minify.
|
*/
'ignore' => [
'resources/views/emails',
'resources/views/html',
'resources/views/notifications',
'resources/views/markdown',
'resources/views/vendor/emails',
'resources/views/vendor/html',
'resources/views/vendor/notifications',
'resources/views/vendor/markdown',
],
];

View file

@ -11,7 +11,7 @@ return [
'paginate' => env('CODE_PAGINATE', 65530),
// Dictionnary of chars to use fo generating unique codes.
'codeCharList' => 'ABCDEFGHJKMNPQRSTUWXYZ123456789',
'codeCharList' => 'ABCDEFGHJKMNPRSTUWXYZ123456789',
// Code length.
'codeLength' => 9
];

6
config/opinsta.php Normal file
View file

@ -0,0 +1,6 @@
<?php
return [
'start' => env('OPINSTA_START'),
'end' => env('OPINSTA_END')
];

View file

@ -38,7 +38,8 @@ return [
'publishedProduct' => [Products::class, 'slug']
],
'products.range' => [
'slugRange' => [Range::class, 'slug']
'slugRange' => [Range::class, 'slug'],
'slugSubRange' => [Range::class, 'slug'],
],
'products.consumption-times' => [
'slugConsumptionTime' => [ConsumptionTimes::class, 'slug']
@ -85,7 +86,7 @@ return [
*/
'queryConditions' => [
'status' => true,
'ocbStatus' => EleveurOcbStatus::yes()->value,
'ocbStatus' => strval(EleveurOcbStatus::yes()->value),
'star_moment' => true
],

View file

@ -30,4 +30,16 @@ return [
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'google' => [
'recaptcha' => [
'public' => env('GOOGLE_RECAPTCHA_PUBLIC'),
'private' => env('GOOGLE_RECAPTCHA_PRIVATE'),
'version' => env('GOOGLE_RECAPTCHA_VERSION', "3") === "3" ? true : false
]
],
'matomo' => [
'site_id' => env('MATOMO_SITE_ID')
],
];

View file

@ -269,8 +269,6 @@ class MigrateOldDataBase extends LeGaulois2016Migration
case 'lapin':
$model->ocbType = OCBType::rabbit();
break;
case 'oeuf':
$model->ocbType = OCBType::egg();
}
} catch (Exception $e) {
$model->ocbType = OCBType::poultry();
@ -408,8 +406,6 @@ class MigrateOldDataBase extends LeGaulois2016Migration
return OCBType::poultry();
case 'LAPIN':
return OCBType::rabbit();
case 'OEUF':
return OCBType::egg();
}
},
'name' => 'ocb_type',

View file

@ -84,8 +84,6 @@ class RemigrateOcbBreeders extends LeGaulois2016Migration
case 'lapin':
$model->ocbType = OCBType::rabbit();
break;
case 'oeuf':
$model->ocbType = OCBType::egg();
}
} catch (Exception $e) {
$model->ocbType = OCBType::poultry();

View file

@ -78,8 +78,6 @@ class RemigrateOcbBreeders2 extends LeGaulois2016Migration
case 'lapin':
$model->ocbType = OCBType::rabbit();
break;
case 'oeuf':
$model->ocbType = OCBType::egg();
}
} catch (Exception $e) {
$model->ocbType = OCBType::poultry();

View file

@ -0,0 +1,30 @@
<?php
use App\Models\OCBBreeder;
use App\Models\OCBContent;
use Illuminate\Database\Migrations\Migration;
class RemoveOcbEgg extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// * 0 OCB type EGG.
OCBContent::query()->where('type', 0)->delete();
OCBBreeder::query()->where('ocbType', 0)->delete();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// * Wont undo this.
}
}

Some files were not shown because too many files have changed in this diff Show more