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
b932702c
Commit
b932702c
authored
4 years ago
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix impossible de cotiser par cb quand solde emlc à 0
parent
cf595865
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
17 deletions
+23
-17
app.js
assets/js/app.js
+12
-1
app.a1cf5950.js
public/build/app.a1cf5950.js
+0
-0
entrypoints.json
public/build/entrypoints.json
+1
-1
manifest.json
public/build/manifest.json
+1
-1
UserController.php
src/Controller/UserController.php
+2
-7
CotiserFormType.php
src/Form/Type/CotiserFormType.php
+7
-7
No files found.
assets/js/app.js
View file @
b932702c
...
...
@@ -154,11 +154,16 @@ jQuery(document).ready(function() {
form
.
submit
()
}
});
$
(
'.cotisationSubmit'
).
on
(
'click'
,
function
(
e
){
$
(
'.cotisationMLCSubmit'
).
on
(
'click'
,
function
(
e
){
// Stop form submition
e
.
preventDefault
();
var
form
=
this
.
closest
(
'form'
)
// Set form moyen
$
(
'#'
+
form
.
name
+
'_moyen'
)[
0
].
value
=
'mlc'
if
(
form
.
checkValidity
())
{
var
div
=
'.confirmCotisation'
...
...
@@ -172,5 +177,11 @@ jQuery(document).ready(function() {
form
.
submit
()
}
});
$
(
'.cotisationCBSubmit'
).
on
(
'click'
,
function
(
e
){
var
form
=
this
.
closest
(
'form'
)
// Set form moyen
$
(
'#'
+
form
.
name
+
'_moyen'
)[
0
].
value
=
'cb'
});
});
This diff is collapsed.
Click to expand it.
public/build/app.a
5bdb92a
.js
→
public/build/app.a
1cf5950
.js
View file @
b932702c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
This diff is collapsed.
Click to expand it.
public/build/entrypoints.json
View file @
b932702c
...
...
@@ -3,7 +3,7 @@
"app"
:
{
"js"
:
[
"/build/runtime.420770e4.js"
,
"/build/app.a
5bdb92a
.js"
"/build/app.a
1cf5950
.js"
],
"css"
:
[
"/build/app.0ecb0d81.css"
...
...
This diff is collapsed.
Click to expand it.
public/build/manifest.json
View file @
b932702c
...
...
@@ -2,7 +2,7 @@
"build/admin.css"
:
"/build/admin.4d653142.css"
,
"build/admin.js"
:
"/build/admin.3024c297.js"
,
"build/app.css"
:
"/build/app.0ecb0d81.css"
,
"build/app.js"
:
"/build/app.a
5bdb92a
.js"
,
"build/app.js"
:
"/build/app.a
1cf5950
.js"
,
"build/runtime.js"
:
"/build/runtime.420770e4.js"
,
"build/ckeditor/adapters/jquery.js"
:
"/build/ckeditor/adapters/jquery.js"
,
"build/ckeditor/ckeditor.js"
:
"/build/ckeditor/ckeditor.js"
,
...
...
This diff is collapsed.
Click to expand it.
src/Controller/UserController.php
View file @
b932702c
...
...
@@ -52,13 +52,8 @@ class UserController extends AbstractController
if
(
$form
->
isSubmitted
())
{
$cotisation
=
$form
->
getData
();
if
(
$form
->
get
(
'payMLC'
)
->
isClicked
())
{
$cotisation
->
setMoyen
(
MoyenEnum
::
MOYEN_MLC
);
}
else
{
$cotisation
->
setMoyen
(
MoyenEnum
::
MOYEN_CB
);
}
if
(
$form
->
isValid
())
{
if
(
$
form
->
get
(
'payMLC'
)
->
isClicked
()
||
!
$form
->
get
(
'payMLC'
)
->
isClicked
()
&&
!
$form
->
get
(
'payCB'
)
->
isClicked
()
)
{
if
(
$
cotisation
->
getMoyen
()
==
MoyenEnum
::
MOYEN_MLC
)
{
$cotisation
->
setRecu
(
true
);
$this
->
em
->
persist
(
$cotisation
);
$this
->
em
->
flush
();
...
...
@@ -78,7 +73,7 @@ class UserController extends AbstractController
}
else
{
$this
->
addFlash
(
'error'
,
$this
->
translator
->
trans
(
'Problème avec la cotisation !'
)
$this
->
translator
->
trans
(
'Problème avec la cotisation !'
)
.
' '
.
$form
->
getErrors
()
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/Form/Type/CotiserFormType.php
View file @
b932702c
...
...
@@ -88,21 +88,21 @@ class CotiserFormType extends AbstractType
'data'
=>
MoyenEnum
::
MOYEN_MLC
,
))
;
// ->add('moyen', ChoiceType::class, array(
// 'required' => true,
// 'label' => 'Moyen de paiement :',
// 'choices' => $canPayWithMlc ? [MoyenEnum::getTypeName(MoyenEnum::MOYEN_MLC) => MoyenEnum::MOYEN_MLC, MoyenEnum::getTypeName(MoyenEnum::MOYEN_CB) => MoyenEnum::MOYEN_CB] : [MoyenEnum::getTypeName(MoyenEnum::MOYEN_CB) => MoyenEnum::MOYEN_CB]
// ))
if
(
$canPayWithMlc
)
{
$builder
->
add
(
'payMLC'
,
SubmitType
::
class
,
array
(
'label'
=>
"Payer en eMLC"
,
'attr'
=>
[
'class'
=>
'btn-primary btn cotisationSubmit'
'class'
=>
'btn-primary btn cotisation
MLC
Submit'
]
));
}
if
(
$canPayWithCB
)
{
$builder
->
add
(
'payCB'
,
SubmitType
::
class
,
[
'label'
=>
"Payer en CB"
]);
$builder
->
add
(
'payCB'
,
SubmitType
::
class
,
array
(
'label'
=>
"Payer en CB"
,
'attr'
=>
[
'class'
=>
'btn-primary btn cotisationCBSubmit'
]
));
}
if
(
$this
->
security
->
getUser
()
->
isGranted
(
'ROLE_ADHERENT'
))
{
...
...
This diff is collapsed.
Click to expand it.
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