indiquer en sous titre le groupe emetteur du message avec lien qui permet d'y accéder (fixes #33)

This commit is contained in:
afornerot 2019-11-08 16:31:32 +01:00
parent e553a9fdeb
commit 7f23665454
2 changed files with 6 additions and 2 deletions

View File

@ -2038,6 +2038,10 @@ class PagewidgetController extends Controller
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared); $this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared);
if(is_array($groupsshared)) { if(is_array($groupsshared)) {
foreach($groupsshared as $groupshared) { foreach($groupsshared as $groupshared) {
// On récupère les info du groupe
$title=$groupshared->getLabel();
$idpage=$groupshared->pagesshared[0]->getId();
// On récupère l'ensemble des messages du groupes // On récupère l'ensemble des messages du groupes
$messages=$this->getDoctrine()->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$groupshared]); $messages=$this->getDoctrine()->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$groupshared]);
foreach($messages as $key => $message) { foreach($messages as $key => $message) {
@ -2051,7 +2055,7 @@ class PagewidgetController extends Controller
} }
foreach($messages as $key => $message) { foreach($messages as $key => $message) {
$tmp=["id" => $message->getId(), "user" => $message->getUser(), "date"=>$message->getSubmitdate(), "topic"=>$message->getTopic()]; $tmp=["id" => $message->getId(), "user" => $message->getUser(), "date"=>$message->getSubmitdate(), "topic"=>$message->getTopic(), "pageid" => $idpage, "pagetitle" => $title];
array_push($mymsg,$tmp); array_push($mymsg,$tmp);
} }
} }

View File

@ -82,7 +82,7 @@
<div class="caption"> <div class="caption">
<div class="grid-item-title" style="position:inherit; width:85%"> <div class="grid-item-title" style="position:inherit; width:85%">
{{message.user.lastname}} {{message.user.firstname}}<br> {{message.user.lastname}} {{message.user.firstname}}<br>
<small>{{message.date|date('d/m/Y H:i')}}</small><br><br> <small>{{message.date|date('d/m/Y H:i')}} dans le groupe <u><a href="{{path('cadoles_core_home',{id:message.pageid})}}" target="_top">{{ message.pagetitle }}</a></u></small><br><br>
{{ message.topic | raw }} {{ message.topic | raw }}
</div> </div>
</div> </div>