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
e36d1a2a
Commit
e36d1a2a
authored
May 06, 2024
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccas : num anonymisation dans export adherent + filtre avec num anonymisation
parent
6f067521
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
1 deletions
+35
-1
AdherentAdmin.php
src/Admin/AdherentAdmin.php
+32
-1
CustomDoctrineORMQuerySourceIterator.php
src/Exporter/CustomDoctrineORMQuerySourceIterator.php
+3
-0
No files found.
src/Admin/AdherentAdmin.php
View file @
e36d1a2a
...
...
@@ -581,7 +581,18 @@ class AdherentAdmin extends AbstractAdmin
;
if
(
$this
->
getConfigurationPool
()
->
getContainer
()
->
getParameter
(
'tav_env'
))
{
$datagridMapper
->
remove
(
'cotisationajour'
);
$datagridMapper
->
remove
(
'cotisationajour'
);
if
(
$this
->
getConfigurationPool
()
->
getContainer
()
->
getParameter
(
'ccas_mode'
))
{
$datagridMapper
->
add
(
'anonymoustoken'
,
CallbackFilter
::
class
,
[
'callback'
=>
[
$this
,
'getAnynomousTokenFilter'
],
'field_type'
=>
CheckboxType
::
class
,
'label'
=>
'Avec numéro d\'anonymisation'
,
'show_filter'
=>
true
,
'advanced_filter'
=>
false
,
]);
}
}
}
...
...
@@ -641,6 +652,26 @@ class AdherentAdmin extends AbstractAdmin
return
true
;
}
public
function
getAnynomousTokenFilter
(
$queryBuilder
,
$alias
,
$field
,
$value
)
{
if
(
!
$value
[
'value'
])
{
return
false
;
}
$container
=
$this
->
getConfigurationPool
()
->
getContainer
();
$em
=
$container
->
get
(
'doctrine.orm.entity_manager'
);
$expr
=
$em
->
getExpressionBuilder
();
// Use `andWhere` instead of `where` to prevent overriding existing `where` conditions
if
(
$value
[
"value"
])
{
$queryBuilder
->
andWhere
(
'('
.
$alias
.
'.anonymousToken is not null and '
.
$alias
.
'.anonymousToken != false)'
);
}
return
true
;
}
/**
* @param EventDispatcherInterface $userManager
*/
...
...
src/Exporter/CustomDoctrineORMQuerySourceIterator.php
View file @
e36d1a2a
...
...
@@ -108,6 +108,9 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato
}
else
{
$data
[
'Profil de cotisation'
]
=
"Aucun profil assigné"
;
}
if
(
$this
->
container
->
getParameter
(
'ccas_mode'
))
{
$data
[
'Numéro d\'anonymisation'
]
=
$adherent
->
getAnonymousToken
();
}
}
else
{
$cotisEnd
=
$this
->
cotisationUtils
->
isCotisationValidForAdherent
(
$adherent
);
$cotisEnd
=
is_string
(
$cotisEnd
)
?
new
\DateTime
(
$cotisEnd
)
:
$cotisEnd
;
...
...
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