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
fedcd0ea
Commit
fedcd0ea
authored
Oct 14, 2024
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user must be active to be found by comptoir during payment procedure
parent
856eb656
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
VenteEmlcAdherentFormType.php
src/Form/Type/VenteEmlcAdherentFormType.php
+5
-3
AdherentRepository.php
src/Repository/AdherentRepository.php
+16
-0
No files found.
src/Form/Type/VenteEmlcAdherentFormType.php
View file @
fedcd0ea
...
@@ -16,13 +16,15 @@ class VenteEmlcAdherentFormType extends VenteEmlcFormType
...
@@ -16,13 +16,15 @@ class VenteEmlcAdherentFormType extends VenteEmlcFormType
if
(
empty
(
$this
->
security
)
||
empty
(
$this
->
security
->
getUser
()))
{
if
(
empty
(
$this
->
security
)
||
empty
(
$this
->
security
->
getUser
()))
{
throw
new
\Exception
(
'[FORM VENTE EMLC ADHERENT] Opération impossible !'
);
throw
new
\Exception
(
'[FORM VENTE EMLC ADHERENT] Opération impossible !'
);
}
}
$tav
=
$this
->
container
->
getParameter
(
'tav_env'
);
$adherentRepo
=
$this
->
em
->
getRepository
(
Adherent
::
class
);
$builder
$builder
->
add
(
'destinataire'
,
EntityType
::
class
,
[
->
add
(
'destinataire'
,
EntityType
::
class
,
[
'class'
=>
Adherent
::
class
,
'class'
=>
Adherent
::
class
,
'choices'
=>
$t
his
->
em
->
getRepository
(
Adherent
::
class
)
->
findOrderByName
(),
'choices'
=>
$t
av
?
$adherentRepo
->
findOrderByNameExcludeInactiveUser
()
:
$adherentRepo
->
findOrderByName
(),
'placeholder'
=>
$t
his
->
container
->
getParameter
(
'tav_env'
)
?
'Habitant'
:
'Adherent'
,
'placeholder'
=>
$t
av
?
'Habitant'
:
'Adherent'
,
'required'
=>
true
,
'required'
=>
true
,
'label'
=>
$t
his
->
container
->
getParameter
(
'tav_env'
)
?
'Habitant :'
:
'Adherent :'
,
'label'
=>
$t
av
?
'Habitant :'
:
'Adherent :'
,
])
])
->
add
(
'reference'
,
HiddenType
::
class
,
[
->
add
(
'reference'
,
HiddenType
::
class
,
[
'data'
=>
'Achat e'
.
$this
->
em
->
getRepository
(
GlobalParameter
::
class
)
->
val
(
GlobalParameter
::
MLC_SYMBOL
)
.
' Adhérent'
,
'data'
=>
'Achat e'
.
$this
->
em
->
getRepository
(
GlobalParameter
::
class
)
->
val
(
GlobalParameter
::
MLC_SYMBOL
)
.
' Adhérent'
,
...
...
src/Repository/AdherentRepository.php
View file @
fedcd0ea
...
@@ -112,6 +112,22 @@ class AdherentRepository extends ServiceEntityRepository
...
@@ -112,6 +112,22 @@ class AdherentRepository extends ServiceEntityRepository
;
;
}
}
public
function
findOrderByNameExcludeInactiveUser
()
{
$qb
=
$this
->
createQueryBuilder
(
'p'
);
return
$qb
->
leftjoin
(
'p.user'
,
'u'
)
->
where
(
'p.enabled = :enabled'
)
->
where
(
'u.enabled = :userEnabled'
)
->
setParameter
(
'enabled'
,
true
)
->
setParameter
(
'userEnabled'
,
true
)
->
orderBy
(
'u.lastname'
,
'ASC'
)
->
getQuery
()
->
getResult
()
;
}
/**
/**
* @return Adherent[] Returns an array of Adherent objects
* @return Adherent[] Returns an array of Adherent objects
*/
*/
...
...
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