Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
agplv3
kohinos-tav
Commits
d3417d3c
Commit
d3417d3c
authored
Oct 17, 2023
by
Damien Moulard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop'
parents
0ece0ca1
33462cd4
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
124 additions
and
25 deletions
+124
-25
fixtures-tav.yaml
fixtures/tavtest/fixtures-tav.yaml
+5
-0
dev-fixture.yaml
fixtures/test/dev-fixture.yaml
+5
-0
AdherentAdmin.php
src/Admin/AdherentAdmin.php
+5
-4
PrestataireAdmin.php
src/Admin/PrestataireAdmin.php
+4
-3
GlobalParameter.php
src/Entity/GlobalParameter.php
+1
-0
CustomDoctrineORMQuerySourceIterator.php
src/Exporter/CustomDoctrineORMQuerySourceIterator.php
+44
-8
GlobalConfigurationFormType.php
src/Form/Type/GlobalConfigurationFormType.php
+7
-0
useradmin.html.twig
templates/themes/kohinos/block/useradmin.html.twig
+5
-1
menu_tree_macro.html.twig
templates/themes/kohinos/common/menu_tree_macro.html.twig
+9
-1
contact.html.twig
templates/themes/kohinos/contact.html.twig
+3
-0
carte.html.twig
templates/themes/kohinos/presta/carte.html.twig
+7
-2
liste_prestataires.html.twig
templates/themes/kohinos/presta/liste_prestataires.html.twig
+11
-1
liste_prestataires_bygroupelocal.html.twig
...kohinos/presta/liste_prestataires_bygroupelocal.html.twig
+6
-1
rubriques.html.twig
templates/themes/kohinos/presta/rubriques.html.twig
+5
-1
show_rubrique.html.twig
templates/themes/kohinos/presta/show_rubrique.html.twig
+5
-1
security.fr.xlf
translations/security.fr.xlf
+1
-1
security.fr.yml
translations/security.fr.yml
+1
-1
No files found.
fixtures/tavtest/fixtures-tav.yaml
View file @
d3417d3c
...
...
@@ -784,6 +784,11 @@ App\Entity\GlobalParameter:
description
:
"
Paiement
par
chèque
:
Ordre
à
mettre
sur
ceux-ci"
value
:
'
'
mandatory
:
1
gp30
:
name
:
"
CONTACT_FORM_PHONE_NUMBER"
description
:
"
Numéro
de
téléphone
à
afficher
dans
le
formulaire
de
contact
si
défini"
value
:
'
'
mandatory
:
1
App\Entity\Siege
:
...
...
fixtures/test/dev-fixture.yaml
View file @
d3417d3c
...
...
@@ -784,6 +784,11 @@ App\Entity\GlobalParameter:
description
:
"
Paiement
par
chèque
:
Ordre
à
mettre
sur
ceux-ci"
value
:
'
'
mandatory
:
1
gp30
:
name
:
"
CONTACT_FORM_PHONE_NUMBER"
description
:
"
Numéro
de
téléphone
à
afficher
dans
le
formulaire
de
contact
si
défini"
value
:
'
'
mandatory
:
1
App\Entity\Siege
:
...
...
src/Admin/AdherentAdmin.php
View file @
d3417d3c
...
...
@@ -191,7 +191,7 @@ class AdherentAdmin extends AbstractAdmin
->
add
(
'profilDeCotisation'
,
ChoiceType
::
class
,
[
'required'
=>
true
,
'label'
=>
'Choix du profil de cotisation :'
,
'choices'
=>
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'doctrine'
)
->
getRepository
(
ProfilDeCotisation
::
class
)
->
find
All
(
),
'choices'
=>
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'doctrine'
)
->
getRepository
(
ProfilDeCotisation
::
class
)
->
find
By
([],
[
'montant'
=>
'ASC'
]
),
'empty_data'
=>
null
,
'placeholder'
=>
'Choisir un profil'
,
'choice_label'
=>
function
(
$choice
,
$key
,
$value
)
{
...
...
@@ -585,10 +585,11 @@ class AdherentAdmin extends AbstractAdmin
}
}
$em
=
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'doctrine'
)
->
getManager
();
$cotisationUtils
=
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'app.utils.cotisations'
);
$container
=
$this
->
getConfigurationPool
()
->
getContainer
();
$em
=
$container
->
get
(
'doctrine'
)
->
getManager
();
$cotisationUtils
=
$container
->
get
(
'app.utils.cotisations'
);
$iterator
=
new
CustomDoctrineORMQuerySourceIterator
(
$cotisationUtils
,
$em
,
$query
,
$fields
);
$iterator
=
new
CustomDoctrineORMQuerySourceIterator
(
$cotisationUtils
,
$em
,
$
container
,
$
query
,
$fields
);
$iterator
->
setDateTimeFormat
(
'd/m/Y H:i:s'
);
//change this to suit your needs
return
$iterator
;
...
...
src/Admin/PrestataireAdmin.php
View file @
d3417d3c
...
...
@@ -875,10 +875,11 @@ class PrestataireAdmin extends AbstractAdmin
}
}
$em
=
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'doctrine'
)
->
getManager
();
$cotisationUtils
=
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'app.utils.cotisations'
);
$container
=
$this
->
getConfigurationPool
()
->
getContainer
();
$em
=
$container
->
get
(
'doctrine'
)
->
getManager
();
$cotisationUtils
=
$container
->
get
(
'app.utils.cotisations'
);
$iterator
=
new
CustomDoctrineORMQuerySourceIterator
(
$cotisationUtils
,
$em
,
$query
,
$fields
);
$iterator
=
new
CustomDoctrineORMQuerySourceIterator
(
$cotisationUtils
,
$em
,
$
container
,
$
query
,
$fields
);
$iterator
->
setDateTimeFormat
(
'd/m/Y H:i:s'
);
//change this to suit your needs
return
$iterator
;
...
...
src/Entity/GlobalParameter.php
View file @
d3417d3c
...
...
@@ -50,6 +50,7 @@ class GlobalParameter
const
HELLOASSO_URL_EMLC_PRESTATAIRE
=
'HELLOASSO_URL_EMLC_PRESTATAIRE'
;
const
HELLOASSO_URL_COTISATION_ADHERENT
=
'HELLOASSO_URL_COTISATION_ADHERENT'
;
const
HELLOASSO_URL_COTISATION_PRESTATAIRE
=
'HELLOASSO_URL_COTISATION_PRESTATAIRE'
;
const
CONTACT_FORM_PHONE_NUMBER
=
'CONTACT_FORM_PHONE_NUMBER'
;
/**
* @var \Ramsey\Uuid\UuidInterface
...
...
src/Exporter/CustomDoctrineORMQuerySourceIterator.php
View file @
d3417d3c
...
...
@@ -15,11 +15,14 @@ namespace App\Exporter;
use
App\Entity\Adherent
;
use
App\Entity\Prestataire
;
use
App\Entity\Flux
;
use
App\Entity\GlobalParameter
;
use
App\Utils\CotisationUtils
;
use
Doctrine\ORM\EntityManagerInterface
;
use
Doctrine\ORM\Query
;
use
Sonata\Exporter\Source\AbstractPropertySourceIterator
;
use
Sonata\Exporter\Source\SourceIteratorInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* @final since sonata-project/exporter 2.4.
...
...
@@ -32,14 +35,22 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato
protected
$query
;
protected
$em
;
protected
$cotisationUtils
;
protected
$container
;
/**
* @param array<string> $fields Fields to export
*/
public
function
__construct
(
CotisationUtils
$cotisationUtils
,
EntityManagerInterface
$em
,
Query
$query
,
array
$fields
,
string
$dateTimeFormat
=
'r'
)
{
public
function
__construct
(
CotisationUtils
$cotisationUtils
,
EntityManagerInterface
$em
,
ContainerInterface
$container
,
Query
$query
,
array
$fields
,
string
$dateTimeFormat
=
'r'
)
{
$this
->
em
=
$em
;
$this
->
cotisationUtils
=
$cotisationUtils
;
$this
->
container
=
$container
;
$this
->
query
=
clone
$query
;
$this
->
query
->
setParameters
(
$query
->
getParameters
());
foreach
(
$query
->
getHints
()
as
$name
=>
$value
)
{
...
...
@@ -74,12 +85,37 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato
}
elseif
(
!
empty
(
$data
[
'Id'
])
&&
!
empty
(
$data
[
'Email'
]))
{
//adherent
$adherent
=
$this
->
em
->
getRepository
(
Adherent
::
class
)
->
findOneById
(
$data
[
'Id'
]);
$cotisEnd
=
$this
->
cotisationUtils
->
isCotisationValidForAdherent
(
$adherent
);
$cotisEnd
=
is_string
(
$cotisEnd
)
?
new
\DateTime
(
$cotisEnd
)
:
$cotisEnd
;
$data
[
'Cotisation à jour'
]
=
false
==
$cotisEnd
?
''
:
(
$cotisEnd
->
format
(
'd/m/Y'
));
$firstCotis
=
$this
->
cotisationUtils
->
getFirstCotisationForAdherent
(
$adherent
);
$firstCotis
=
is_string
(
$firstCotis
)
?
new
\DateTime
(
$firstCotis
)
:
$firstCotis
;
$data
[
'Première Cotisation'
]
=
false
==
$firstCotis
?
''
:
(
$firstCotis
->
format
(
'd/m/Y'
));
if
(
$this
->
container
->
getParameter
(
'tav_env'
))
{
// Last TAV cotisation
$cotisations
=
$this
->
em
->
getRepository
(
Flux
::
class
)
->
getLastTavCotisation
(
$adherent
);
if
(
count
(
$cotisations
)
>
0
)
{
$cotisDate
=
date
(
"d/m/Y H:i:s"
,
strtotime
(
$cotisations
[
0
][
"created_at"
]));
$data
[
'Dernière Cotisation'
]
=
$cotisDate
;
}
else
{
$data
[
'Dernière Cotisation'
]
=
"Aucune"
;
}
// Current emlc balance
$balance
=
$adherent
->
getEmlcAccount
()
->
getBalance
();
$mlc
=
$this
->
em
->
getRepository
(
GlobalParameter
::
class
)
->
val
(
GlobalParameter
::
MLC_SYMBOL
);
$data
[
'Solde'
]
=
$balance
.
" "
.
$mlc
;
// Profil de cotisation
$cotisationProfile
=
$adherent
->
getProfilDeCotisation
();
if
(
!
is_null
(
$cotisationProfile
)
)
{
$data
[
'Profil de cotisation'
]
=
$cotisationProfile
;
}
else
{
$data
[
'Profil de cotisation'
]
=
"Aucun profil assigné"
;
}
}
else
{
$cotisEnd
=
$this
->
cotisationUtils
->
isCotisationValidForAdherent
(
$adherent
);
$cotisEnd
=
is_string
(
$cotisEnd
)
?
new
\DateTime
(
$cotisEnd
)
:
$cotisEnd
;
$data
[
'Cotisation à jour'
]
=
false
==
$cotisEnd
?
''
:
(
$cotisEnd
->
format
(
'd/m/Y'
));
$firstCotis
=
$this
->
cotisationUtils
->
getFirstCotisationForAdherent
(
$adherent
);
$firstCotis
=
is_string
(
$firstCotis
)
?
new
\DateTime
(
$firstCotis
)
:
$firstCotis
;
$data
[
'Première Cotisation'
]
=
false
==
$firstCotis
?
''
:
(
$firstCotis
->
format
(
'd/m/Y'
));
}
$adminRoles
=
''
;
if
(
!
empty
(
$adherent
->
getUser
()))
{
foreach
(
$adherent
->
getUser
()
->
getPossiblegroups
()
as
$group
)
{
...
...
src/Form/Type/GlobalConfigurationFormType.php
View file @
d3417d3c
...
...
@@ -324,6 +324,13 @@ class GlobalConfigurationFormType extends AbstractType
// 'label_attr' => ['class' => 'checkbox-inline'], ],
'help'
=>
'Si cette option est à "true", les prestataires pourront ajouter un don lors de leur acaht d\'e-mlc.'
,
])
->
add
(
'contactformphonenumber'
,
GlobalParameterType
::
class
,
[
'label'
=>
'Numéro de téléphone à afficher dans le formulaire de contact si défini'
,
'_description'
=>
'Numéro de téléphone à afficher dans le formulaire de contact si défini'
,
'name_param'
=>
GlobalParameter
::
CONTACT_FORM_PHONE_NUMBER
,
'required'
=>
false
,
'_placeholder'
=>
''
,
])
;
}
...
...
templates/themes/kohinos/block/useradmin.html.twig
View file @
d3417d3c
...
...
@@ -67,7 +67,11 @@
{# Affichage de la carte des prestataires pour les adhérents #}
{%
if
KOH_USE_WORDPRESS
is
defined
and
KOH_USE_WORDPRESS
==
'false'
and
((
app.user
and
is_granted
(
'ROLE_ADHERENT'
))
or
not
app.user
)
%}
<div
class=
'd-none d-md-block'
>
{%
include
'@kohinos/presta/block/carte.html.twig'
with
{
'title'
:
'Situer les Prestataires'
|
trans
}
%}
{%
if
tav_env
==
1
%}
{%
include
'@kohinos/presta/block/carte.html.twig'
with
{
'title'
:
'Situer les points de vente'
|
trans
}
%}
{%
else
%}
{%
include
'@kohinos/presta/block/carte.html.twig'
with
{
'title'
:
'Situer les Prestataires'
|
trans
}
%}
{%
endif
%}
</div>
{%
endif
%}
{%
if
app.user
and
is_granted
(
'ROLE_ADMIN'
)
%}
...
...
templates/themes/kohinos/common/menu_tree_macro.html.twig
View file @
d3417d3c
...
...
@@ -33,6 +33,13 @@
{%
import
_self
as
self
%}
{%
for
menuItem
in
items
%}
{%
set
url
=
menuItem.url
%}
<a
href=
"
{{
url
}}
"
class=
"dropdown-item
{%
if
currentPath
==
url
%}
current
{%
endif
%}
"
{%
if
menuItem.target
%}
target=
"_blank"
{%
endif
%}
>
{{
menuItem.name
}}
</a>
{%
if
tav_env
==
1
and
menuItem.name
==
"Carte des prestataires"
%}
{%
set
name
=
"Carte des points de vente"
%}
{%
elseif
tav_env
==
1
and
menuItem.name
==
"Liste des prestataires"
%}
{%
set
name
=
"Liste des points de vente"
%}
{%
else
%}
{%
set
name
=
menuItem.name
%}
{%
endif
%}
<a
href=
"
{{
url
}}
"
class=
"dropdown-item
{%
if
currentPath
==
url
%}
current
{%
endif
%}
"
{%
if
menuItem.target
%}
target=
"_blank"
{%
endif
%}
>
{{
name
}}
</a>
{%
endfor
%}
{%
endmacro
%}
\ No newline at end of file
templates/themes/kohinos/contact.html.twig
View file @
d3417d3c
...
...
@@ -40,6 +40,9 @@
{{
form_row
(
form.captcha
)
}}
{{
form_row
(
form.save
)
}}
{{
form_end
(
form
)
}}
{%
if
KOH_CONTACT_FORM_PHONE_NUMBER
|
default
(
''
)
!=
''
%}
<p
style=
"margin-top: 30px;"
>
Vous pouvez aussi nous contacter au
{{
KOH_CONTACT_FORM_PHONE_NUMBER
}}
</p>
{%
endif
%}
</div>
</div>
</div>
...
...
templates/themes/kohinos/presta/carte.html.twig
View file @
d3417d3c
...
...
@@ -2,9 +2,14 @@
{%
block
content
%}
<div
class=
'container prestalist mt-2'
>
{%
include
'@kohinos/block/breadcrumb.html.twig'
with
{
'label'
:
'Carte des prestataires'
}
%}
{%
if
tav_env
==
1
%}
{%
set
name
=
"Carte des points de vente"
%}
{%
else
%}
{%
set
name
=
"Carte des prestataires"
%}
{%
endif
%}
{%
include
'@kohinos/block/breadcrumb.html.twig'
with
{
'label'
:
name
}
%}
<div
class=
'card'
>
<div
class=
"card-header"
><h3>
{{
'Carte des prestataires :'
|
trans
}}
</h3></div>
<div
class=
"card-header"
><h3>
{{
name
|
trans
}}
</h3></div>
<div
class=
"card-body"
>
<div
class=
"card-text"
>
{%
include
'@kohinos/presta/block/carte.html.twig'
with
{
style
:
"height: 400px;"
}
%}
...
...
templates/themes/kohinos/presta/liste_prestataires.html.twig
View file @
d3417d3c
...
...
@@ -2,7 +2,17 @@
{%
block
content
%}
<div
class=
'container prestalist mt-2'
>
{%
include
'@kohinos/block/breadcrumb.html.twig'
with
{
'label'
:
type
,
'label2'
:
'Prestataires'
,
'url2'
:
path
(
'liste_prestataire'
,
{
'order'
:
'groupelocal'
}
)
}
%}
{%
if
type
==
'Prestataires'
and
tav_env
==
1
%}
{%
set
label
=
'Points de vente'
%}
{%
else
%}
{%
set
label
=
type
%}
{%
endif
%}
{%
if
tav_env
==
1
%}
{%
set
label2
=
'Points de vente'
%}
{%
else
%}
{%
set
label2
=
'Prestataires'
%}
{%
endif
%}
{%
include
'@kohinos/block/breadcrumb.html.twig'
with
{
'label'
:
label
,
'label2'
:
label2
,
'url2'
:
path
(
'liste_prestataire'
,
{
'order'
:
'groupelocal'
}
)
}
%}
{%
if
type
==
'Prestataires'
%}
<div
class=
"d-flex justify-content-center"
>
<div
class=
"btn-group text-center mb-2"
role=
"group"
aria-label=
"Basic example"
>
...
...
templates/themes/kohinos/presta/liste_prestataires_bygroupelocal.html.twig
View file @
d3417d3c
...
...
@@ -2,7 +2,12 @@
{%
block
content
%}
<div
class=
'container prestalist mt-2'
>
{%
include
'@kohinos/block/breadcrumb.html.twig'
with
{
'label'
:
type
}
%}
{%
if
type
==
'Prestataires'
and
tav_env
==
1
%}
{%
set
label
=
'Points de vente'
%}
{%
else
%}
{%
set
label
=
type
%}
{%
endif
%}
{%
include
'@kohinos/block/breadcrumb.html.twig'
with
{
'label'
:
label
}
%}
<div
class=
"d-flex justify-content-center"
>
<div
class=
"btn-group text-center mb-2"
role=
"group"
aria-label=
"Basic example"
>
<a
href=
'
{{
path
(
'liste_prestataire'
,
{
'order'
:
'raison'
}
)
}}
'
type=
"button"
class=
"btn btn-secondary"
>
Par nom
</a>
...
...
templates/themes/kohinos/presta/rubriques.html.twig
View file @
d3417d3c
...
...
@@ -24,7 +24,11 @@
{%
endif
%}
<div
class=
"card-text mx-auto text-center mt-2"
>
<h5
class=
'btn btn-secondary'
><a
href=
"#"
class=
"card-text mt-3"
style=
'cursor:pointer;'
data-toggle=
"collapse"
data-target=
"#collapsepresta
{{
rubrique.id
}}
"
aria-expanded=
"false"
aria-controls=
"collapsepresta
{{
rubrique.id
}}
"
>
{{
'Voir le(s)'
|
trans
}}
{{
rubrique.prestataires
|
length
}}
{{
'prestataire(s)'
|
trans
}}
{%
if
tav_env
==
1
%}
{{
'Voir le(s)'
|
trans
}}
{{
rubrique.prestataires
|
length
}}
{{
'point(s) de vente'
|
trans
}}
{%
else
%}
{{
'Voir le(s)'
|
trans
}}
{{
rubrique.prestataires
|
length
}}
{{
'prestataire(s)'
|
trans
}}
{%
endif
%}
</a></h5>
</div>
<ul
class=
"list-group list-group-flush collapse mx-2 my-2"
id=
"collapsepresta
{{
rubrique.id
}}
"
>
...
...
templates/themes/kohinos/presta/show_rubrique.html.twig
View file @
d3417d3c
...
...
@@ -10,7 +10,11 @@
</h1>
<div
class=
"my-3 p-3 bg-white rounded box-shadow"
>
<p>
{{
rubrique.content
|
raw
}}
</p>
<h3>
{{
'Prestataires'
|
trans
}}
:
</h3>
{%
if
tav_env
==
1
%}
<h3>
{{
'Points de vente'
|
trans
}}
:
</h3>
{%
else
%}
<h3>
{{
'Prestataires'
|
trans
}}
:
</h3>
{%
endif
%}
{%
for
presta
in
prestataires
%}
<div
class=
'my-2'
>
{%
include
'@kohinos/presta/onepresta.html.twig'
with
{
'withrubrique'
:
false
}
%}
...
...
translations/security.fr.xlf
View file @
d3417d3c
...
...
@@ -31,7 +31,7 @@
</trans-unit>
<trans-unit
id=
"dLzMRPR"
resname=
"Invalid CSRF token."
>
<source>
Invalid CSRF token.
</source>
<target>
Jeton CSRF invalide.
</target>
<target>
Jeton CSRF invalide.
Pas de panique, il suffit de vous reconnecter.
</target>
</trans-unit>
<trans-unit
id=
"PhhlLem"
resname=
"No authentication provider found to support the authentication token."
>
<source>
No authentication provider found to support the authentication token.
</source>
...
...
translations/security.fr.yml
View file @
d3417d3c
...
...
@@ -4,7 +4,7 @@
'
Invalid
credentials.'
:
'
Identifiants
invalides.'
'
Cookie
has
already
been
used
by
someone
else.'
:
'
Le
cookie
a
déjà
été
utilisé
par
quelqu'
'
un
d'
'
autre.'
'
Not
privileged
to
request
the
resource.'
:
'
Privilèges
insuffisants
pour
accéder
à
la
ressource.'
'
Invalid
CSRF
token.'
:
'
Jeton
CSRF
invalide.'
'
Invalid
CSRF
token.'
:
'
Jeton
CSRF
invalide.
Pas
de
panique,
il
suffit
de
vous
reconnecter.
'
'
No
authentication
provider
found
to
support
the
authentication
token.'
:
'
Aucun
fournisseur
d'
'
authentification
n'
'
a
été
trouvé
pour
supporter
le
jeton
d'
'
authentification.'
'
No
session
available,
it
either
timed
out
or
cookies
are
not
enabled.'
:
'
Aucune
session
disponible,
celle-ci
a
expiré
ou
les
cookies
ne
sont
pas
activés.'
'
No
token
could
be
found.'
:
'
Aucun
jeton
n'
'
a
pu
être
trouvé.'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment