Merge branch 'master' into dist/envole/6/master
This commit is contained in:
commit
30e4609f6f
|
@ -1085,29 +1085,17 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewbookmarkAction(Request $request,$id,$access="config") {
|
public function viewbookmarkAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
// Valeur par défaut
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
|
||||||
$modedesktop=0;
|
$modedesktop=0;
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
$bookmarks=null;
|
||||||
|
|
||||||
|
// Datas associées au widget
|
||||||
|
if(!$this->mini) {
|
||||||
|
// Récupération des paramétres du widget
|
||||||
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "modedesktop":
|
case "modedesktop":
|
||||||
$modedesktop=$parameter["value"];
|
$modedesktop=$parameter["value"];
|
||||||
|
@ -1115,25 +1103,14 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// Profilage
|
|
||||||
$user=$this->getUser();
|
|
||||||
|
|
||||||
// Bookmark du widget
|
// Bookmark du widget
|
||||||
$bookmarks=$em->getRepository("CadolesPortalBundle:Bookmark")->findBy(["pagewidget"=>$entity]);
|
$bookmarks=$this->em->getRepository("CadolesPortalBundle:Bookmark")->findBy(["pagewidget"=>$this->entity]);
|
||||||
|
}
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewbookmark.html.twig', [
|
return $this->getRender('viewbookmark.html.twig', [
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'modedesktop' => $modedesktop,
|
'modedesktop' => $modedesktop,
|
||||||
'bookmarks' => $bookmarks,
|
'bookmarks' => $bookmarks,
|
||||||
'access' => $access,
|
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,12 @@
|
||||||
#R1C1:first-child {
|
#R1C1:first-child {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.widget-mini .logo {
|
||||||
|
background-color: #{{color["main"]}};
|
||||||
|
padding: 3px;
|
||||||
|
border-radius: 100%;
|
||||||
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block pagewrapper %}
|
{% block pagewrapper %}
|
||||||
|
|
|
@ -51,9 +51,6 @@
|
||||||
{% if canupdate %}
|
{% if canupdate %}
|
||||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if canadd %}
|
|
||||||
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" style="{{ stylewidgetmenu }}"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -113,7 +110,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if canadd %}
|
{% if canupdate %}
|
||||||
<div class="grid-item {{ stylegrid }}">
|
<div class="grid-item {{ stylegrid }}">
|
||||||
<div title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" class="grid-item-content" style="background-color: #{{color['main']}};cursor:pointer;">
|
<div title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" class="grid-item-content" style="background-color: #{{color['main']}};cursor:pointer;">
|
||||||
<div class="item-link clearfix">
|
<div class="item-link clearfix">
|
||||||
|
|
|
@ -42,12 +42,18 @@
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-chat" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-chat" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
||||||
{% if canupdate %}
|
|
||||||
<div class="widgetmenu">
|
<div class="widgetmenu">
|
||||||
|
{% if canupdate %}
|
||||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if look=="list" %}
|
||||||
|
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
|
{% else %}
|
||||||
|
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% if onheader %}
|
{% if onheader %}
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
||||||
{% if icon %}
|
{% if icon %}
|
||||||
<img src="/{{ alias }}{{ icon }}" class="logo" />
|
<img src="/{{ alias }}{{ icon }}" class="logo" style="border-radius:100%"/>
|
||||||
{% else %}
|
{% else %}
|
||||||
<img src="/{{ alias }}/uploads/icon/icon_users.png" class="logo"/>
|
<img src="/{{ alias }}/uploads/icon/icon_users.png" class="logo"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue