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
5dfe0e01
Commit
5dfe0e01
authored
Jan 04, 2023
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP create button to disable cotisation bonification
parent
f0844afc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
1 deletions
+55
-1
services.yaml
config/services.yaml
+1
-1
ProfilDeCotisationAdmin.php
src/Admin/ProfilDeCotisationAdmin.php
+23
-0
ProfilDeCotisationAdminController.php
src/Controller/ProfilDeCotisationAdminController.php
+31
-0
No files found.
config/services.yaml
View file @
5dfe0e01
...
@@ -308,7 +308,7 @@ services:
...
@@ -308,7 +308,7 @@ services:
admin.adherent.profilsdecotisation
:
admin.adherent.profilsdecotisation
:
class
:
App\Admin\ProfilDeCotisationAdmin
class
:
App\Admin\ProfilDeCotisationAdmin
arguments
:
[
~
,
App\Entity\ProfilDeCotisation
,
~
]
arguments
:
[
~
,
App\Entity\ProfilDeCotisation
,
App\Controller\ProfilDeCotisationAdminController
]
tags
:
tags
:
-
name
:
sonata.admin
-
name
:
sonata.admin
manager_type
:
orm
manager_type
:
orm
...
...
src/Admin/ProfilDeCotisationAdmin.php
View file @
5dfe0e01
...
@@ -9,7 +9,11 @@ use Sonata\AdminBundle\Form\FormMapper;
...
@@ -9,7 +9,11 @@ use Sonata\AdminBundle\Form\FormMapper;
use
Sonata\Form\Type\DateTimeRangePickerType
;
use
Sonata\Form\Type\DateTimeRangePickerType
;
use
Symfony\Component\Form\Extension\Core\Type\NumberType
;
use
Symfony\Component\Form\Extension\Core\Type\NumberType
;
use
Sonata\AdminBundle\Admin\FieldDescriptionInterface
;
use
Sonata\AdminBundle\Admin\FieldDescriptionInterface
;
use
Knp\Menu\ItemInterface
as
MenuItemInterface
;
use
Sonata\AdminBundle\Admin\AdminInterface
;
use
App\Enum\CurrencyEnum
;
use
App\Enum\CurrencyEnum
;
use
Sonata\AdminBundle\Route\RouteCollection
;
use
Symfony\Component\Routing\Generator\UrlGeneratorInterface
;
/**
/**
* Administration des profils de cotisation.
* Administration des profils de cotisation.
...
@@ -87,4 +91,23 @@ class ProfilDeCotisationAdmin extends AbstractAdmin
...
@@ -87,4 +91,23 @@ class ProfilDeCotisationAdmin extends AbstractAdmin
])
])
;
;
}
}
protected
function
configureRoutes
(
RouteCollection
$collection
)
{
$collection
->
add
(
'disablepositivecotisations'
);
}
protected
function
configureSideMenu
(
MenuItemInterface
$menu
,
$action
,
AdminInterface
$childAdmin
=
null
)
{
if
(
!
$childAdmin
&&
!
in_array
(
$action
,
[
'list'
]))
{
return
;
}
// TODO exception rendered: route doesn't exist
$menu
->
addChild
(
"Désactiver les cotisations bonifiées"
,
[
'uri'
=>
"#"
,
// 'uri' => $this->getConfigurationPool()->getContainer()->get('router')->generate('disablepositivecotisations', [], UrlGeneratorInterface::ABSOLUTE_URL),
]);
}
}
}
src/Controller/ProfilDeCotisationAdminController.php
0 → 100644
View file @
5dfe0e01
<?php
namespace
App\Controller
;
use
App\Utils\CustomEntityManager
;
use
Sonata\AdminBundle\Controller\CRUDController
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\Security\Core\Security
;
class
ProfilDeCotisationAdminController
extends
CRUDController
{
protected
$em
;
protected
$security
;
public
function
__construct
(
CustomEntityManager
$em
,
Security
$security
)
{
$this
->
em
=
$em
;
$this
->
security
=
$security
;
}
/**
*
*/
public
function
disablepositivecotisationsAction
()
:
Response
{
$this
->
addFlash
(
'sonata_flash_success'
,
'Youpi ça marche'
);
return
new
RedirectResponse
(
$this
->
admin
->
generateUrl
(
'list'
));
}
}
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