notification ajout suppression widget (ref #131)

This commit is contained in:
afornerot 2020-06-08 15:21:31 +02:00
parent 354d8df055
commit 28f84e2460
3 changed files with 45 additions and 19 deletions

View File

@ -135,6 +135,20 @@ class PagewidgetController extends Controller
$em->persist($entity);
$em->flush();
// Notification création widget
$groups=$page->getGroups();
if($groups) {
if($groups[0]->getFgcanshare()) {
$message="Création Widget ".$entity->getName();
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groups[0],"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groups[0]->getId(),$message);
}
}
}
if($access=="config") {
if($by=="view")
return $this->redirect($this->generateUrl('cadoles_portal_config_page_view',["id"=>$idpage]));
@ -267,6 +281,19 @@ class PagewidgetController extends Controller
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
}
// Notification création widget
$groups=$entity->getPage()->getGroups();
if($groups) {
if($groups[0]->getFgcanshare()) {
$message="Suppression Widget ".$entity->getName();
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groups[0],"user"=>$this->getUser()]);
if($usergroup) {
$key=$usergroup->getKeyvalue();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groups[0]->getId(),$message);
}
}
}
// Supression du pagewidget
$em->remove($entity);
$em->flush();

View File

@ -328,7 +328,7 @@
// Suppression d'un widget
function delWidget(idwidget) {
var txt;
var r = confirm("Confirmez-vous la suppression de ce widget ?");
var r = confirm("ATTENTION\nConfirmez-vous la suppression de ce widget ?\n\nL'ensemble du contenu sera définitivement perdu !!");
if (r == true) {
$.ajax({
method: "POST",

View File

@ -64,17 +64,17 @@
<a title="Voir la Tâche" href="{{ path('cadoles_portal_'~access~'_projecttask_view',{'id':projecttask.id,page:entity.page.id}) }}">
<div class="item-link clearfix">
<div class="grid-item-logo" style="height:55px;width:10%; text-align: center;">
{% if projecttask.user is empty %}
<img class='grid-item-img avatar' src="/{{ alias }}/uploads/avatar/{{ projecttask.owner.avatar }}" style="width:55px; height:auto">
{% else %}
<img class='grid-item-img avatar' src="/{{ alias }}/uploads/avatar/{{ projecttask.user.avatar }}" style="width:55px; height:auto">
{% endif %}
</div>
<div class="grid-item-title" style="width:90%">
<div class="grid-item-logo" style="width:10%; margin:0px; text-align: center;">
{% if projecttask.user is empty %}
<img class='grid-item-img avatar' src="/{{ alias }}/uploads/avatar/{{ projecttask.owner.avatar }}" style="width:55px; height:auto">
{% else %}
<img class='grid-item-img avatar' src="/{{ alias }}/uploads/avatar/{{ projecttask.user.avatar }}" style="width:55px; height:auto">
{% endif %}
</div>
<div class="grid-item-title" style="width:90%; position:initial; display: inline-block; padding:0px">
<h2 style="line-height:18px;height:auto;padding-left:5px;">{{projecttask.name}}</h2>
<h2 style="max-height: 40px; overflow-y: hidden;line-height:18px;">{{projecttask.name}}</h2>
<div class="pull-left" style="font-size:9px;">Affectée à
<div style="font-size:9px; display:inline-block; width:40%;padding-left:5px;">Affectée à
{% if projecttask.user is empty %}
{{ projecttask.owner.username }}
{% else %}
@ -84,13 +84,7 @@
<br>Dans le projet {{projecttask.project.name }}
</div>
<div class="pull-right" style="margin-top:-5px; width:80px; text-align: center;">
<div style="font-size:35px; line-height:30px">
{{ projecttask.percentage }}<i style="font-size:12px">%</i>
</div>
</div>
<div class="pull-right" style="text-align: right; font-size:9px;">
<div style="text-align: right; font-size:9px; display:inline-block; width:35%;">
Priorité = {{ projecttask.priority }}</br>
Avant le = {{ projecttask.end|date("d/m/Y") }}</br>
{% if projecttask.projecttasktag %}
@ -100,6 +94,11 @@
Statut = {{ projecttask.projecttaskstatus.name }}<br>
{% endif %}
</div>
<div style="margin-top:-5px; text-align: right; display:inline-block; width:20%;">
<div style="font-size:35px; line-height:30px">
{{ projecttask.percentage }}<i style="font-size:12px">%</i>
</div>
</div>
</div>