Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
cooperatic-mlc
kohinos
Commits
81227837
Commit
81227837
authored
Jul 08, 2020
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Choix d'utiliser ou non payzen dans la config
parent
7d6d9e20
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
1 deletions
+38
-1
dev-fixture.yaml
fixtures/test/dev-fixture.yaml
+4
-0
GlobalParameter.php
src/Entity/GlobalParameter.php
+1
-0
CotiserFormType.php
src/Form/Type/CotiserFormType.php
+4
-0
GlobalConfigurationFormType.php
src/Form/Type/GlobalConfigurationFormType.php
+10
-0
AppExtension.php
src/Twig/AppExtension.php
+8
-1
useradmin.html.twig
templates/block/useradmin.html.twig
+4
-0
cotiser.html.twig
templates/cotiser.html.twig
+7
-0
No files found.
fixtures/test/dev-fixture.yaml
View file @
81227837
...
...
@@ -631,6 +631,10 @@ App\Entity\GlobalParameter:
name
:
"
MAP_ZOOM"
value
:
'
9'
mandatory
:
1
gp14
:
name
:
"
USE_PAYZEN"
value
:
'
true'
mandatory
:
1
App\Entity\Siege
:
siege_1
:
...
...
src/Entity/GlobalParameter.php
View file @
81227837
...
...
@@ -27,6 +27,7 @@ class GlobalParameter
const
RECONVERSION_PRESTATAIRE
=
'RECONVERSION_PRESTATAIRE'
;
const
MAP_CENTER
=
'MAP_CENTER'
;
const
MAP_ZOOM
=
'MAP_ZOOM'
;
const
USE_PAYZEN
=
'USE_PAYZEN'
;
/**
* @ORM\Id()
...
...
src/Form/Type/CotiserFormType.php
View file @
81227837
...
...
@@ -54,6 +54,8 @@ class CotiserFormType extends AbstractType
$canPayWithMlc
=
(
$this
->
session
->
get
(
'_prestagere'
)
->
getEcompte
()
>=
$montant
);
}
$canPayWithCB
=
$this
->
em
->
getRepository
(
GlobalParameter
::
class
)
->
val
(
GlobalParameter
::
USE_PAYZEN
)
===
'true'
?
true
:
false
;
$builder
->
add
(
'operateur'
,
HiddenType
::
class
,
array
(
'entity_class'
=>
User
::
class
,
...
...
@@ -94,7 +96,9 @@ class CotiserFormType extends AbstractType
if
(
$canPayWithMlc
)
{
$builder
->
add
(
'payMLC'
,
SubmitType
::
class
,
[
'label'
=>
"Payer en eMLC"
]);
}
if
(
$canPayWithCB
)
{
$builder
->
add
(
'payCB'
,
SubmitType
::
class
,
[
'label'
=>
"Payer en CB"
]);
}
if
(
$this
->
security
->
getUser
()
->
isGranted
(
'ROLE_ADHERENT'
))
{
$builder
...
...
src/Form/Type/GlobalConfigurationFormType.php
View file @
81227837
...
...
@@ -118,6 +118,16 @@ class GlobalConfigurationFormType extends AbstractType
],
'help'
=>
''
))
->
add
(
'usepayzen'
,
GlobalParameterType
::
class
,
array
(
'label'
=>
"Utiliser le paiement par CB avec Payzen :"
,
'name_param'
=>
GlobalParameter
::
USE_PAYZEN
,
'required'
=>
true
,
'_placeholder'
=>
'false'
,
'constraints_param'
=>
[
new
RegexConstraint
([
'pattern'
=>
'/^true$|^false$/'
,
'message'
=>
'La valeur doit être "true" ou "false"'
])
],
'help'
=>
'Si cette option est activée (true), les utilisateurs pourront cotiser et acheter de la monnaie locale par CB sur l\'application.'
))
;
}
...
...
src/Twig/AppExtension.php
View file @
81227837
...
...
@@ -11,6 +11,7 @@ use App\Entity\Prestataire;
use
App\Entity\Rubrique
;
use
App\Entity\Siege
;
use
App\Entity\User
;
use
App\Entity\GlobalParameter
;
use
Doctrine\ORM\EntityManagerInterface
;
use
Knp\Component\Pager\PaginatorInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -61,10 +62,16 @@ class AppExtension extends AbstractExtension
new
\Twig_SimpleFunction
(
'getWordpressApiKey'
,
array
(
$this
,
'getWordpressApiKey'
)),
new
\Twig_SimpleFunction
(
'parameter'
,
function
(
$name
)
{
return
$this
->
container
->
getParameter
(
$name
);
})
}),
new
\Twig_SimpleFunction
(
'isPayzenEnabled'
,
array
(
$this
,
'isPayzenEnabled'
))
];
}
public
function
isPayzenEnabled
()
{
return
$this
->
em
->
getRepository
(
GlobalParameter
::
class
)
->
val
(
GlobalParameter
::
USE_PAYZEN
)
===
'true'
?
true
:
false
;
}
public
function
getFilters
()
{
return
array
(
...
...
templates/block/useradmin.html.twig
View file @
81227837
...
...
@@ -155,7 +155,9 @@
{%
include
'block/cotisations.html.twig'
%}
{%
include
'groupepresta/block/inscription.html.twig'
%}
{%
endif
%}
{%
if
isPayzenEnabled
()
%}
{%
include
'presta/block/achat_monnaie.html.twig'
%}
{%
endif
%}
{%
include
'presta/block/transaction_presta.html.twig'
%}
{%
include
'presta/block/transaction_adherent.html.twig'
%}
{%
if
getCurrentPrestataire
()
.
mlc
==
false
and
getCurrentPrestataire
()
.
ecompte
>
0
%}
...
...
@@ -170,7 +172,9 @@
{%
include
'block/userpassword.html.twig'
%}
{%
include
'block/cotisations.html.twig'
%}
{%
include
'block/transactions.html.twig'
%}
{%
if
isPayzenEnabled
()
%}
{%
include
'adherent/block/achat_monnaie.html.twig'
%}
{%
endif
%}
{%
include
'adherent/block/transaction_presta.html.twig'
%}
{%
include
'adherent/block/transaction_adherent.html.twig'
%}
...
...
templates/cotiser.html.twig
View file @
81227837
...
...
@@ -26,8 +26,15 @@
{%
else
%}
<div
class=
'col-12'
>
{%
endif
%}
{%
if
form.payCB
is
defined
%}
<div
class=
'col-6'
>
{{
form_widget
(
form.payCB
)
}}
</div>
<div
class=
'col-6'
>
{%
else
%}
<div
class=
'col-12'
>
{%
endif
%}
</div>
</div>
{{
form_end
(
form
)
}}
</div>
...
...
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