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
38241d8e
Commit
38241d8e
authored
May 15, 2024
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re set Flux/Achat de monnaie filter in admin
parent
793313a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
AchatMonnaieAdmin.php
src/Admin/AchatMonnaieAdmin.php
+24
-7
No files found.
src/Admin/AchatMonnaieAdmin.php
View file @
38241d8e
...
...
@@ -8,6 +8,7 @@ use Sonata\AdminBundle\Datagrid\DatagridMapper;
use
Sonata\AdminBundle\Datagrid\ListMapper
;
use
Sonata\AdminBundle\Route\RouteCollection
;
use
Symfony\Component\Form\Extension\Core\Type\ChoiceType
;
use
Sonata\DoctrineORMAdminBundle\Filter\CallbackFilter
;
/**
* Administration des flux 'Achat de monnaie'.
...
...
@@ -51,18 +52,34 @@ class AchatMonnaieAdmin extends FluxAdmin
*/
protected
function
configureDatagridFilters
(
DatagridMapper
$datagridMapper
)
:
void
{
//In mode ssa_friendly_flux_type_names, we display on this page all cotisation
//initial operation (i.e. we display vente_emlc operations in addition to achat_monnaie)
//therefore filtering by type achat_monnaie_adherent VS achat_monnaie_prestataire
//would be confusing (selecting one of them would hide all vente_emlc operations)
if
(
!
$this
->
getConfigurationPool
()
->
getContainer
()
->
getParameter
(
'tav_env'
)
||
!
$this
->
getConfigurationPool
()
->
getContainer
()
->
getParameter
(
'ssa_friendly_flux_type_names'
))
{
if
(
$this
->
getConfigurationPool
()
->
getContainer
()
->
getParameter
(
'tav_env'
)
&&
$this
->
getConfigurationPool
()
->
getContainer
()
->
getParameter
(
'ssa_friendly_flux_type_names'
))
{
$datagridMapper
->
add
(
'type'
,
null
,
[
'advanced_filter'
=>
false
,
'show_filter'
=>
true
,
'field_type'
=>
ChoiceType
::
class
,
'field_options'
=>
[
'choices'
=>
[
'Achat des adhérents'
=>
'achat_monnaie_adherent'
,
'Achat des prestataires'
=>
'achat_monnaie_prestataire'
,
'Vente aux adhérents'
=>
'vente_emlc_adherent'
,
'Vente aux prestataires'
=>
'vente_emlc_prestataire'
,
],
'placeholder'
=>
'Indifférent'
,
'expanded'
=>
false
,
'multiple'
=>
false
,
],
]);
}
else
{
$datagridMapper
->
add
(
'type'
,
null
,
[
'advanced_filter'
=>
false
,
'show_filter'
=>
true
,
'field_type'
=>
ChoiceType
::
class
,
'field_options'
=>
[
'choices'
=>
[
'Adhérent'
=>
'achat_monnaie_adherent'
,
'Prestataire'
=>
'achat_monnaie_prestataire'
],
'choices'
=>
[
'Adhérent'
=>
'achat_monnaie_adherent'
,
'Prestataire'
=>
'achat_monnaie_prestataire'
,
],
'placeholder'
=>
'Indifférent'
,
'expanded'
=>
true
,
'multiple'
=>
false
,
...
...
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