Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
potage
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mathieu
potage
Commits
a0eeaf43
Commit
a0eeaf43
authored
Sep 18, 2018
by
Mat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Page qui résume les commandes de l'utilisateur
parent
6c6e9051
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
14 deletions
+57
-14
src/PotageBundle/Controller/MembreController.php
src/PotageBundle/Controller/MembreController.php
+14
-4
src/PotageBundle/Repository/CommandeRepository.php
src/PotageBundle/Repository/CommandeRepository.php
+16
-0
src/PotageBundle/Resources/views/Default/navbar.html.twig
src/PotageBundle/Resources/views/Default/navbar.html.twig
+4
-0
src/PotageBundle/Resources/views/Membre/resume.html.twig
src/PotageBundle/Resources/views/Membre/resume.html.twig
+23
-10
No files found.
src/PotageBundle/Controller/MembreController.php
View file @
a0eeaf43
...
...
@@ -285,10 +285,20 @@ class MembreController extends MasterController
*/
public
function
resumeAction
()
{
return
$this
->
render
(
'PotageBundle:Membre:resume.html.twig'
,
array
(
));
$user
=
$this
->
getUser
();
if
(
$user
!==
null
)
{
$em
=
$this
->
getDoctrine
()
->
getManager
();
$commandes
=
$em
->
getRepository
(
'PotageBundle:Commande'
)
->
findAllCurrentByUser
(
$user
->
getId
());
return
$this
->
render
(
'PotageBundle:Membre:resume.html.twig'
,
array
(
'commandes'
=>
$commandes
));
}
}
}
src/PotageBundle/Repository/CommandeRepository.php
View file @
a0eeaf43
...
...
@@ -10,4 +10,20 @@ namespace PotageBundle\Repository;
*/
class
CommandeRepository
extends
\Doctrine\ORM\EntityRepository
{
/**
* Toutes les commandes d'un utilisateur
* TODO introduire un status sur les commandes
*
* @param $id
* @return array
*/
public
function
findAllCurrentByUser
(
$id
)
{
$qb
=
$this
->
createQueryBuilder
(
'c'
)
->
where
(
'c.user = :id'
)
->
setParameter
(
':id'
,
$id
)
->
orderBy
(
'c.createdAt'
,
'DESC'
);
return
$qb
->
getQuery
()
->
getResult
();
}
}
src/PotageBundle/Resources/views/Default/navbar.html.twig
View file @
a0eeaf43
...
...
@@ -96,6 +96,10 @@
<a
href=
"
{{
path
(
'fos_user_profile_show'
)
}}
"
class=
"dropdown-item"
>
Mon profil
</a>
<a
href=
"
{{
path
(
'potage_resume'
)
}}
"
class=
"dropdown-item"
>
Mes commandes
</a>
<div
class=
"dropdown-divider"
></div>
<a
href=
"
{{
path
(
'fos_user_security_logout'
)
}}
"
class=
"dropdown-item"
>
{{
'layout.logout'
|
trans
(
{}
,
'FOSUserBundle'
)
}}
...
...
src/PotageBundle/Resources/views/Membre/resume.html.twig
View file @
a0eeaf43
...
...
@@ -11,18 +11,31 @@
<div
class=
"col-md-10 offset-md-1 bloc"
>
<div
class=
"row"
>
{%
for
label
,
messages
in
app.flashes
()
%}
{%
for
message
in
messages
%}
<div
class=
"alert alert-
{{
label
}}
"
role=
"alert"
>
{{
message
}}
</div>
{%
endfor
%}
{%
for
label
,
messages
in
app.flashes
()
%}
{%
for
message
in
messages
%}
<div
class=
"alert alert-
{{
label
}}
"
role=
"alert"
>
{{
message
}}
</div>
{%
endfor
%}
{%
endfor
%}
<h1>
Commandes en cours
</h1>
<ul>
<li>
<a
href=
"
{{
path
(
'potage_today'
)
}}
"
>
Passer une nouvelle commande
</a>
</li>
{%
for
commande
in
commandes
%}
<li>
<a
href=
"#"
>
Commande n°
{{
commande.id
}}
</a>
,
<small>
enregistrée le
{{
commande.createdAt
|
date
(
'd/m/Y, à H:i:s'
)
}}
(→ offre
{{
commande.offre.reference
}}
)
</small>
</li>
{%
endfor
%}
</ul>
<
/div
>
<
h1>
Historique des commandes
</h1
>
{#
<div class="row ">
...
...
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