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
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
8 deletions
+45
-8
dev-fixture.yaml
fixtures/test/dev-fixture.yaml
+4
-0
GlobalParameter.php
src/Entity/GlobalParameter.php
+2
-1
CotiserFormType.php
src/Form/Type/CotiserFormType.php
+6
-2
GlobalConfigurationFormType.php
src/Form/Type/GlobalConfigurationFormType.php
+10
-0
AppExtension.php
src/Twig/AppExtension.php
+10
-3
useradmin.html.twig
templates/block/useradmin.html.twig
+6
-2
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:
...
@@ -631,6 +631,10 @@ App\Entity\GlobalParameter:
name
:
"
MAP_ZOOM"
name
:
"
MAP_ZOOM"
value
:
'
9'
value
:
'
9'
mandatory
:
1
mandatory
:
1
gp14
:
name
:
"
USE_PAYZEN"
value
:
'
true'
mandatory
:
1
App\Entity\Siege
:
App\Entity\Siege
:
siege_1
:
siege_1
:
...
...
src/Entity/GlobalParameter.php
View file @
81227837
...
@@ -27,6 +27,7 @@ class GlobalParameter
...
@@ -27,6 +27,7 @@ class GlobalParameter
const
RECONVERSION_PRESTATAIRE
=
'RECONVERSION_PRESTATAIRE'
;
const
RECONVERSION_PRESTATAIRE
=
'RECONVERSION_PRESTATAIRE'
;
const
MAP_CENTER
=
'MAP_CENTER'
;
const
MAP_CENTER
=
'MAP_CENTER'
;
const
MAP_ZOOM
=
'MAP_ZOOM'
;
const
MAP_ZOOM
=
'MAP_ZOOM'
;
const
USE_PAYZEN
=
'USE_PAYZEN'
;
/**
/**
* @ORM\Id()
* @ORM\Id()
...
@@ -92,7 +93,7 @@ class GlobalParameter
...
@@ -92,7 +93,7 @@ class GlobalParameter
{
{
return
$this
->
mandatory
;
return
$this
->
mandatory
;
}
}
/**
/**
* Set mandatory
* Set mandatory
* @return $this
* @return $this
...
...
src/Form/Type/CotiserFormType.php
View file @
81227837
...
@@ -54,6 +54,8 @@ class CotiserFormType extends AbstractType
...
@@ -54,6 +54,8 @@ class CotiserFormType extends AbstractType
$canPayWithMlc
=
(
$this
->
session
->
get
(
'_prestagere'
)
->
getEcompte
()
>=
$montant
);
$canPayWithMlc
=
(
$this
->
session
->
get
(
'_prestagere'
)
->
getEcompte
()
>=
$montant
);
}
}
$canPayWithCB
=
$this
->
em
->
getRepository
(
GlobalParameter
::
class
)
->
val
(
GlobalParameter
::
USE_PAYZEN
)
===
'true'
?
true
:
false
;
$builder
$builder
->
add
(
'operateur'
,
HiddenType
::
class
,
array
(
->
add
(
'operateur'
,
HiddenType
::
class
,
array
(
'entity_class'
=>
User
::
class
,
'entity_class'
=>
User
::
class
,
...
@@ -94,8 +96,10 @@ class CotiserFormType extends AbstractType
...
@@ -94,8 +96,10 @@ class CotiserFormType extends AbstractType
if
(
$canPayWithMlc
)
{
if
(
$canPayWithMlc
)
{
$builder
->
add
(
'payMLC'
,
SubmitType
::
class
,
[
'label'
=>
"Payer en eMLC"
]);
$builder
->
add
(
'payMLC'
,
SubmitType
::
class
,
[
'label'
=>
"Payer en eMLC"
]);
}
}
$builder
->
add
(
'payCB'
,
SubmitType
::
class
,
[
'label'
=>
"Payer en CB"
]);
if
(
$canPayWithCB
)
{
$builder
->
add
(
'payCB'
,
SubmitType
::
class
,
[
'label'
=>
"Payer en CB"
]);
}
if
(
$this
->
security
->
getUser
()
->
isGranted
(
'ROLE_ADHERENT'
))
{
if
(
$this
->
security
->
getUser
()
->
isGranted
(
'ROLE_ADHERENT'
))
{
$builder
$builder
->
add
(
'expediteur'
,
HiddenType
::
class
,
array
(
->
add
(
'expediteur'
,
HiddenType
::
class
,
array
(
...
...
src/Form/Type/GlobalConfigurationFormType.php
View file @
81227837
...
@@ -118,6 +118,16 @@ class GlobalConfigurationFormType extends AbstractType
...
@@ -118,6 +118,16 @@ class GlobalConfigurationFormType extends AbstractType
],
],
'help'
=>
''
'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;
...
@@ -11,6 +11,7 @@ use App\Entity\Prestataire;
use
App\Entity\Rubrique
;
use
App\Entity\Rubrique
;
use
App\Entity\Siege
;
use
App\Entity\Siege
;
use
App\Entity\User
;
use
App\Entity\User
;
use
App\Entity\GlobalParameter
;
use
Doctrine\ORM\EntityManagerInterface
;
use
Doctrine\ORM\EntityManagerInterface
;
use
Knp\Component\Pager\PaginatorInterface
;
use
Knp\Component\Pager\PaginatorInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
@@ -61,10 +62,16 @@ class AppExtension extends AbstractExtension
...
@@ -61,10 +62,16 @@ class AppExtension extends AbstractExtension
new
\Twig_SimpleFunction
(
'getWordpressApiKey'
,
array
(
$this
,
'getWordpressApiKey'
)),
new
\Twig_SimpleFunction
(
'getWordpressApiKey'
,
array
(
$this
,
'getWordpressApiKey'
)),
new
\Twig_SimpleFunction
(
'parameter'
,
function
(
$name
)
{
new
\Twig_SimpleFunction
(
'parameter'
,
function
(
$name
)
{
return
$this
->
container
->
getParameter
(
$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
()
public
function
getFilters
()
{
{
return
array
(
return
array
(
...
@@ -105,7 +112,7 @@ class AppExtension extends AbstractExtension
...
@@ -105,7 +112,7 @@ class AppExtension extends AbstractExtension
}
}
return
$this
->
em
->
getRepository
(
Comptoir
::
class
)
->
findOneById
(
$this
->
session
->
get
(
'_comptoirgere'
)
->
getId
());
return
$this
->
em
->
getRepository
(
Comptoir
::
class
)
->
findOneById
(
$this
->
session
->
get
(
'_comptoirgere'
)
->
getId
());
}
}
public
function
getCurrentGroupe
()
public
function
getCurrentGroupe
()
{
{
if
(
!
$this
->
session
->
has
(
'_groupegere'
))
{
if
(
!
$this
->
session
->
has
(
'_groupegere'
))
{
...
@@ -113,7 +120,7 @@ class AppExtension extends AbstractExtension
...
@@ -113,7 +120,7 @@ class AppExtension extends AbstractExtension
}
}
return
$this
->
em
->
getRepository
(
Groupe
::
class
)
->
findOneById
(
$this
->
session
->
get
(
'_groupegere'
)
->
getId
());
return
$this
->
em
->
getRepository
(
Groupe
::
class
)
->
findOneById
(
$this
->
session
->
get
(
'_groupegere'
)
->
getId
());
}
}
public
function
getCurrentPrestataire
()
public
function
getCurrentPrestataire
()
{
{
if
(
!
$this
->
session
->
has
(
'_prestagere'
))
{
if
(
!
$this
->
session
->
has
(
'_prestagere'
))
{
...
...
templates/block/useradmin.html.twig
View file @
81227837
...
@@ -155,7 +155,9 @@
...
@@ -155,7 +155,9 @@
{%
include
'block/cotisations.html.twig'
%}
{%
include
'block/cotisations.html.twig'
%}
{%
include
'groupepresta/block/inscription.html.twig'
%}
{%
include
'groupepresta/block/inscription.html.twig'
%}
{%
endif
%}
{%
endif
%}
{%
include
'presta/block/achat_monnaie.html.twig'
%}
{%
if
isPayzenEnabled
()
%}
{%
include
'presta/block/achat_monnaie.html.twig'
%}
{%
endif
%}
{%
include
'presta/block/transaction_presta.html.twig'
%}
{%
include
'presta/block/transaction_presta.html.twig'
%}
{%
include
'presta/block/transaction_adherent.html.twig'
%}
{%
include
'presta/block/transaction_adherent.html.twig'
%}
{%
if
getCurrentPrestataire
()
.
mlc
==
false
and
getCurrentPrestataire
()
.
ecompte
>
0
%}
{%
if
getCurrentPrestataire
()
.
mlc
==
false
and
getCurrentPrestataire
()
.
ecompte
>
0
%}
...
@@ -170,7 +172,9 @@
...
@@ -170,7 +172,9 @@
{%
include
'block/userpassword.html.twig'
%}
{%
include
'block/userpassword.html.twig'
%}
{%
include
'block/cotisations.html.twig'
%}
{%
include
'block/cotisations.html.twig'
%}
{%
include
'block/transactions.html.twig'
%}
{%
include
'block/transactions.html.twig'
%}
{%
include
'adherent/block/achat_monnaie.html.twig'
%}
{%
if
isPayzenEnabled
()
%}
{%
include
'adherent/block/achat_monnaie.html.twig'
%}
{%
endif
%}
{%
include
'adherent/block/transaction_presta.html.twig'
%}
{%
include
'adherent/block/transaction_presta.html.twig'
%}
{%
include
'adherent/block/transaction_adherent.html.twig'
%}
{%
include
'adherent/block/transaction_adherent.html.twig'
%}
...
...
templates/cotiser.html.twig
View file @
81227837
...
@@ -26,8 +26,15 @@
...
@@ -26,8 +26,15 @@
{%
else
%}
{%
else
%}
<div
class=
'col-12'
>
<div
class=
'col-12'
>
{%
endif
%}
{%
endif
%}
{%
if
form.payCB
is
defined
%}
<div
class=
'col-6'
>
{{
form_widget
(
form.payCB
)
}}
{{
form_widget
(
form.payCB
)
}}
</div>
</div>
<div
class=
'col-6'
>
{%
else
%}
<div
class=
'col-12'
>
{%
endif
%}
</div>
</div>
</div>
{{
form_end
(
form
)
}}
{{
form_end
(
form
)
}}
</div>
</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