Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mathieu
potage
Commits
1f672906
Commit
1f672906
authored
Jul 01, 2018
by
Mat
Browse files
aside, les autres lettres frère en préparation
parent
1795358f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/PotageBundle/Controller/LettreInfosController.php
View file @
1f672906
...
...
@@ -17,8 +17,9 @@ class LettreInfosController extends MasterController
*/
public
function
ajaxDisplayAction
(
$id
)
{
$lettre
=
$this
->
getDoctrine
()
->
getManager
()
->
getRepository
(
'PotageBundle:Lettre'
)
->
findOneForLettreInfosAjaxDisplay
(
$id
);
$em
=
$this
->
getDoctrine
()
->
getManager
();
$lettre
=
$em
->
getRepository
(
'PotageBundle:Lettre'
)
->
findOneForLettreInfosAjaxDisplay
(
$id
);
$autresLettres
=
$em
->
getRepository
(
'PotageBundle:Lettre'
)
->
findAllBrotherLettre
(
$id
);
if
(
$lettre
===
null
)
{
return
$this
->
createNotFoundException
(
'Non trouvé'
);
...
...
@@ -31,6 +32,7 @@ class LettreInfosController extends MasterController
return
$this
->
render
(
'@Potage/LettreInfos/ajaxDisplay.html.twig'
,
array
(
'id'
=>
$id
,
'lettre'
=>
$lettre
,
'autresLettres'
=>
$autresLettres
,
//'formInfo' => $form->createView(),
'formLettre'
=>
$formLettre
->
createView
(),
'formLettreSorted'
=>
$formSorted
->
createView
()
...
...
src/PotageBundle/Repository/LettreRepository.php
View file @
1f672906
<?php
namespace
PotageBundle\Repository
;
use
PotageBundle\Entity\Lettre
;
/**
* LettreRepository
...
...
@@ -109,6 +110,22 @@ class LettreRepository extends \Doctrine\ORM\EntityRepository
return
$qb
->
getQuery
()
->
getOneOrNullResult
();
}
/**
* @param $id
* @return Lettre[]
*/
public
function
findAllBrotherLettre
(
$id
)
{
$qb
=
$this
->
createQueryBuilder
(
'l'
)
->
where
(
'l.id != :id'
)
->
andWhere
(
'l.status IN( :draft , :current )'
)
->
setParameters
(
array
(
':id'
=>
$id
,
':draft'
=>
'draft'
,
':current'
=>
'current'
));
return
$qb
->
getQuery
()
->
getResult
();
}
/**
* @param $id
...
...
src/PotageBundle/Resources/views/LettreInfos/ajaxDisplay.html.twig
View file @
1f672906
...
...
@@ -75,6 +75,18 @@
</div>
{%
endif
%}
</div>
<div
class=
"mt-4"
>
<ul
class=
"list-group list-group-flush"
>
<li
class=
"list-group-item"
><h5>
En préparation
</h5></li>
{%
for
brother
in
autresLettres
%}
<li
class=
"list-group-item"
>
<i
class=
"far fa-envelope-open fa-fw"
>
</i>
<a
href=
"
{{
path
(
'potage_lettre_infos_ajax_display'
,
{
'id'
:
brother.id
}
)
}}
"
>
{{
brother.reference
}}
</a>
<span
class=
"parenth"
>
{{
brother.groupe.nom
}}
</span>
</li>
{%
endfor
%}
</ul>
</div>
</aside>
{%
endblock
%}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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