Merge branch 'master' into dist/envole/6/master

This commit is contained in:
Arnaud Fornerot 2020-10-06 17:12:50 +02:00
commit cc71a435f7
33 changed files with 2481 additions and 2036 deletions

View File

@ -78,6 +78,9 @@ class RegistrationType extends AbstractType
"label" => $session->get('labelniveau01'),
'placeholder' => '== Choisir '.$session->get('labelniveau01').' ==',
"choice_label" => "label",
"query_builder"=> function (EntityRepository $er) {
return $er->createQueryBuilder('niveau01')->orderBy('niveau01.label','ASC');
},
"disabled" => ($options["mode"]=="delete"?true:false),
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px","readonly" => ($options["mode"]=="delete"?true:false))));

View File

@ -89,16 +89,16 @@ class UserType extends AbstractType
"query_builder"=> function (EntityRepository $er) use($access,$perm,$userid) {
if($access=="config") {
if($perm)
return $er->createQueryBuilder('niveau01');
return $er->createQueryBuilder('niveau01')->orderBy('niveau01.label','ASC');
else {
$result=$er->createQueryBuilder("table")->innerJoin("CadolesCoreBundle:UserModo", "usermodo", Join::WITH, "table.id = usermodo.niveau01");
$result=$er->createQueryBuilder("table")->innerJoin("CadolesCoreBundle:UserModo", "usermodo", Join::WITH, "table.id = usermodo.niveau01")->orderBy('table.label','ASC');
$result->andWhere("usermodo.user = :userid");
$result->setParameter('userid', $userid);
return $result;
}
}
else {
return $er->createQueryBuilder('niveau01');
return $er->createQueryBuilder('niveau01')->orderBy('niveau01.label','ASC');
}
},
"disabled" => ($options["mode"]=="delete"||$options["masteridentity"]!="SQL"?true:false),

View File

@ -671,6 +671,13 @@ a.item-heart {
margin-top:30px;
}
.widget-mini {
display: inline-block;
height:50px;
width:50px;
margin-top:0px;
}
.widgetmenu {
right: 20px;
position: absolute;

View File

@ -455,6 +455,8 @@ class PageController extends Controller
// usage soit portal / user / group
$usage=$request->query->get('usage');
$groupid=$request->query->get('group');
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
@ -482,44 +484,6 @@ class PageController extends Controller
}
}
// On marque tt les messages comme lu par l'utilisateur
/* Se fait à présent sur le controleur message au moment meme l'on affiche l'ensemble des messages
if($usage=="group") {
// On calcule le nombre de message non lu pour le groupe
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
$qb = $em ->createQueryBuilder();
$tm = $qb ->select($qb->expr()->count('m.id'))
->from('CadolesWebsocketBundle:Message', 'm')
->where('m.group = :group')
->andWhere('m.user != :user')
->setParameter('group', $group)
->setParameter('user', $this->getUser())
->getQuery()->getSingleScalarResult();
$qb = $em ->createQueryBuilder();
$tr = $qb ->select($qb->expr()->count('m.id'))
->from('CadolesWebsocketBundle:Message', 'm')
->where('m.group = :group')
->andWhere('m.user != :user')
->andWhere(':user MEMBER OF m.readers')
->setParameter('group', $group)
->setParameter('user', $this->getUser())
->getQuery()->getSingleScalarResult();
if($tm-$tr>0) {
$messages=$em->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$group]);
foreach($messages as $message) {
$readers=$message->getReaders();
if ( !$readers->contains($this->getUser()) ) {
$message->addReader($this->getUser());
}
$em->persist($message);
$em->flush();
}
}
}
*/
// Compteur de visite
if($this->getUser()) {
if($groupid) {
@ -587,6 +551,19 @@ class PageController extends Controller
// Type Widgets
if($entity->getPageCategory()->getId()==2) {
$user=$this->getUser();
if($user) {
// Sauvegarder les préférences
if($look) $this->setPreference($user,"pagelook",$id,$look);
if($selwidget) $this->setPreference($user,"pageselwidget",$id,$selwidget);
// Récupérer les préférences
$look=$this->getPreference($user,"pagelook",$id,"view");
$selwidget=$this->getPreference($user,"pageselwidget",$id,null);
}
if($look=="list") $entity->setMaxwidth(0);
return $this->render($this->labelentity.':viewwidget.html.twig', [
'useheader' => ($access=="config"),
'usemenu' => false,
@ -595,6 +572,8 @@ class PageController extends Controller
'access' => $access,
'canupdate' => $canupdate,
'mode' => "view",
'look' => $look,
'selwidget' => $selwidget,
'widgets' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->getWidgetAccess($access,'config'),
'usage' => $usage,
'group' => $groupid
@ -643,7 +622,9 @@ class PageController extends Controller
'mode' => "view",
'widgets' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->getWidgetAccess($access,'config'),
'usage' => $usage,
'group' => $group
'group' => $group,
'look' => 'view',
'selwidget' => null,
]);
}
@ -720,4 +701,42 @@ class PageController extends Controller
}
}
}
protected function getPreference($user,$key,$id,$default) {
$preference=$user->getPreference();
$return=$default;
if(is_array($preference)) {
if(array_key_exists($key,$preference)) {
if(array_key_exists($id,$preference[$key]))
$return=$preference[$key][$id];
}
}
return $return;
}
protected function setPreference($user,$key,$id,$value) {
$preference=$user->getPreference();
$toupdate=false;
if(!array_key_exists($key,$preference)) {
$toupdate=true;
$preference[$key]=[];
}
if((!array_key_exists($id,$preference[$key]))) {
$toupdate=true;
$preference[$key][$id]=$value;
}
if($value&&$preference[$key][$id]!=$value) {
$toupdate=true;
$preference[$key][$id]=$value;
}
// Mise à jour des préferences
if($toupdate) {
$em = $this->getDoctrine()->getManager();
$user->setPreference($preference);
$em->persist($this->getUser());
$em->flush();
}
}
}

View File

@ -297,7 +297,9 @@ class PagetemplateController extends Controller
'mode' => "viewtemplate",
'widgets' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->getWidgetAccess($access),
'usage' => "config",
'group' => ""
'group' => "",
'look' => "view",
'selwidget' => null,
]);
}

View File

@ -24,6 +24,18 @@ class PagewidgetController extends Controller
private $labelentity="CadolesPortalBundle:Pagewidget";
private $routeprimary="cadoles_portal_config_pagewidget";
private $entity;
private $page;
private $id;
private $access;
private $look;
private $mini;
private $selwidget;
private $cansee;
private $canudate;
private $canadd;
private function searchArray($array, $key, $value)
{
$results = array();
@ -386,6 +398,36 @@ class PagewidgetController extends Controller
}
}
protected function setRequest($request,$id,$access) {
$this->em = $this->getDoctrine()->getManager();
$this->user = $this->getUser();
$this->id = $id;
$this->access = $access;
$this->look = $request->query->get('look');
$this->selwidget = $request->query->get('selwidget');
// Le widget existe-t-il ?
$this->entity = $this->em->getRepository($this->labelentity)->find($this->id);
if (!$this->entity) throw $this->createNotFoundException('Unable to find entity.');
// Permissions
if($this->access=="config") {
$this->canupdate = true;
}
else {
// On s'assure que l'utilisateur à la permission de voir
$this->page=$this->entity->getPage();
$this->em->getRepository("CadolesPortalBundle:Page")->getPermission($this->user,$this->page,$this->cansee,$this->canupdate);
if(!$this->cansee) throw $this->createNotFoundException('Permission denied');
}
// Affichage miniature ?
$this->mini = ($this->look=="list"&&$this->entity->getId()!=$this->selwidget);
// Préference utilisateur
if(!$this->mini) $this->getPreference($this->entity);
}
protected function getPreference(&$entity) {
$user=$this->getUser();
if($user) {
@ -393,6 +435,11 @@ class PagewidgetController extends Controller
$id=$entity->getId();
// Preference widgetshowhide
if($this->look=="list") {
$entity->setOpened(true);
$entity->setBorder(false);
}
else {
if(is_array($preference)) {
if(array_key_exists("widgetshowhide",$preference)) {
if(array_key_exists($id,$preference["widgetshowhide"]))
@ -401,40 +448,46 @@ class PagewidgetController extends Controller
}
}
}
public function viewurlAction($id,$access="config") {
$em = $this->getDoctrine()->getManager();
$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
protected function getRender($view,$params) {
// Paramétres toujours présent dans un rendu de widget
$allways = [
'entity' => $this->entity,
'canupdate' => $this->canupdate,
'access' => $this->access,
'look' => $this->look,
'mini' => $this->mini,
];
// Parametres spéficiques
$params=array_merge($allways,$params);
// Rendu
return $this->render($this->labelentity.':'.$view, $params);
}
public function viewurlAction(Request $request,$id,$access="config") {
// Récupération de la requete
$this->setRequest($request,$id,$access);
// Valeur par défaut
$url="";
foreach($entity->getParameter()["fields"] as $parameter) {
$imagemedia=false;
// Datas associées au widget
if(!$this->mini) {
// Récupération des paramétres du widget
foreach($this->entity->getParameter()["fields"] as $parameter) {
if($parameter["id"]=="url")
$url=$parameter["value"];
}
// Préference utilisateur
$this->getPreference($entity);
// Gestion des url youtuve
$url=str_replace("http://www.youtube.com","https://www.youtube.com",$url);
$url=str_replace("https://www.youtube.com/watch?v=","https://www.youtube.com/embed/",$url);
// Detecter le type de lien
$imagemedia=false;
$pathinfo = pathinfo($url);
// Type image
@ -446,36 +499,26 @@ class PagewidgetController extends Controller
// Spécifique Deviant Art
if(strpos($url, "images-wixmp") !== false) $imagemedia=true;
}
return $this->render($this->labelentity.':viewurl.html.twig', [
'entity' => $entity,
'canupdate' => $canupdate,
return $this->getRender('viewurl.html.twig', [
'url' => $url,
'imagemedia' => $imagemedia,
'access' => $access
]);
}
public function viewurlfixeAction($id,$access="config") {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
public function viewurlfixeAction(Request $request,$id,$access="config") {
// Récupération de la requete
$this->setRequest($request,$id,$access);
// 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
// Valeur par défaut
$url="";
$widgettype= $entity->getWidget();
$imagemedia=false;
// Datas associées au widget
if(!$this->mini) {
// Récupération des paramétres du widget
$widgettype= $this->entity->getWidget();
$jsons=$widgettype->getParameter();
$param=array();
$param["fields"]=array();
@ -484,15 +527,11 @@ class PagewidgetController extends Controller
$url=$field->value;
}
// Préference utilisateur
$this->getPreference($entity);
// Gestion des url youtuve
$url=str_replace("http://www.youtube.com","https://www.youtube.com",$url);
$url=str_replace("https://www.youtube.com/watch?v=","https://www.youtube.com/embed/",$url);
// Detecter le type de lien
$imagemedia=false;
$pathinfo = pathinfo($url);
// Type image
@ -504,41 +543,33 @@ class PagewidgetController extends Controller
// Spécifique Deviant Art
if(strpos($url, "images-wixmp") !== false) $imagemedia=true;
}
return $this->render($this->labelentity.':viewurl.html.twig', [
'entity' => $entity,
'canupdate' => $canupdate,
return $this->getRender('viewurl.html.twig', [
'url' => $url,
'imagemedia' => $imagemedia,
'access' => $access
]);
}
public function viewitemAction($id,$access="config") {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
public function viewitemAction(Request $request,$id,$access="config") {
// Récupération de la requete
$this->setRequest($request,$id,$access);
// 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
// Valeur par défaut
$modedesktop=0;
$iditemcategory=null;
$withbookmark=true;
$search=false;
$menu=false;
$menuall=true;
foreach($entity->getParameter()["fields"] as $parameter) {
$search=false;
$withbookmark=true;
$bookmarks=null;
$itemsordered=null;
$itemcategorys=null;
// Datas associées au widget
if(!$this->mini) {
// Récupération des paramétres du widget
$iditemcategory=null;
foreach($this->entity->getParameter()["fields"] as $parameter) {
switch($parameter["id"]) {
case "modedesktop":
$modedesktop=$parameter["value"];
@ -550,7 +581,7 @@ class PagewidgetController extends Controller
case "itemcategory":
$iditemcategory=$parameter["value"];
if($iditemcategory) $itemcategoryfilter=$em->getRepository("CadolesPortalBundle:Itemcategory")->findBy(["id"=>$iditemcategory]);
if($iditemcategory) $itemcategoryfilter=$this->em->getRepository("CadolesPortalBundle:Itemcategory")->findBy(["id"=>$iditemcategory]);
break;
case "search":
@ -568,49 +599,37 @@ class PagewidgetController extends Controller
}
}
// Préference utilisateur
$this->getPreference($entity);
// Profilage
$user=$this->getUser();
$itemsordered = $em->getRepository("CadolesPortalBundle:Item")->getUserItems($user,$bookmarks,$items,$itemcategorys,$iditemcategory,$withbookmark);
$itemsordered = $this->em->getRepository("CadolesPortalBundle:Item")->getUserItems($this->user,$bookmarks,$items,$itemcategorys,$iditemcategory,$withbookmark,false);
}
// Render
return $this->render($this->labelentity.':viewitem.html.twig', [
'entity' => $entity,
'canadd' => ($user),
'canupdate' => $canupdate,
return $this->getRender('viewitem.html.twig', [
'canadd' => ($this->user),
'modedesktop' => $modedesktop,
'items' => $itemsordered,
'itemcategorys' => $itemcategorys,
'bookmarks' => $bookmarks,
'access' => $access,
'search' => $search,
'menu' => $menu,
'menuall' => $menuall,
'withbookmark' => $withbookmark,
'bookmarks' => $bookmarks,
'items' => $itemsordered,
'itemcategorys' => $itemcategorys,
]);
}
public function viewitemessentialAction($id,$access="config") {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
public function viewitemessentialAction(Request $request,$id,$access="config") {
// Récupération de la requete
$this->setRequest($request,$id,$access);
// 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
// Valeur par défaut
$modedesktop=0;
foreach($entity->getParameter()["fields"] as $parameter) {
$itemsordered=null;
$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"]) {
case "modedesktop":
$modedesktop=$parameter["value"];
@ -618,169 +637,64 @@ class PagewidgetController extends Controller
}
}
// Préference utilisateur
$this->getPreference($entity);
// Profilage
$user=$this->getUser();
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
$groups=($user?$user->getGroups():[]);
$niveau01=($user?$user->getNiveau01():[]);
// Bookmark de l'utilisateur
$bookmarks = array();
if($user)
$bookmarks=$em->getRepository("CadolesPortalBundle:Bookmark")->findBy(["user"=>$user]);
// Bookmark lié à un item
$bookmarksitems=new ArrayCollection();
foreach($bookmarks as $bookmark) {
if($bookmark->getItem()) $bookmarksitems->add($bookmark->getItem());
$itemsordered = $this->em->getRepository("CadolesPortalBundle:Item")->getUserItems($this->user,$bookmarks,$items,$itemcategorys,null,true,true);
}
// Initialisation du calcul des items
$items=new ArrayCollection();
// Récupération des items par rôles
foreach($roles as $role) {
$qb = $em->createQueryBuilder();
$qb->select('item')
->from("CadolesPortalBundle:Item", 'item')
->where($qb->expr()->like('item.roles', $qb->expr()->literal("%$role%")))
->andWhere("item.essential=:flag")
->setParameter("flag",true);
$itemsroles=$qb->getQuery()->getResult();
foreach($itemsroles as $itemrole) {
if(!$bookmarksitems->contains($itemrole) && !$items->contains($itemrole)) $items->add($itemrole);
}
}
// Récupération des items par group
foreach($groups as $group) {
$qb = $em->createQueryBuilder();
$qb->select('item')
->from("CadolesPortalBundle:Item", 'item')
->where(":group MEMBER OF item.groups")
->andWhere("item.essential=:flag")
->setParameter("flag",true)
->setParameter("group",$group->getGroup());
$itemsgroups=$qb->getQuery()->getResult();
foreach($itemsgroups as $itemgroup) {
if(!$bookmarksitems->contains($itemgroup) && !$items->contains($itemgroup)) $items->add($itemgroup);
}
}
// Récupération des items par niveau01
if($niveau01) {
$qb = $em->createQueryBuilder();
$qb->select('item')
->from("CadolesPortalBundle:Item", 'item')
->where(":niveau01 MEMBER OF item.niveau01s")
->andWhere("item.essential=:flag")
->setParameter("flag",true)
->setParameter("niveau01",$niveau01);
$itemsniveau01s=$qb->getQuery()->getResult();
foreach($itemsniveau01s as $itemniveau01) {
if(!$bookmarksitems->contains($itemniveau01) && !$items->contains($itemniveau01)) $items->add($itemniveau01);
}
}
// Trie des items
$itemsordered = $items->getIterator();
$itemsordered->uasort(function ($first, $second) {
if((int) $first->getRowOrder() > (int) $second->getRowOrder())
$return=1;
elseif((int) $first->getRowOrder() == (int) $second->getRowOrder()) {
if($first->getTitle() > $second->getTitle())
$return=1;
else
$return=-1;
}
else
$return=-1;
return $return;
});
// Render
return $this->render($this->labelentity.':viewitemessential.html.twig', [
'entity' => $entity,
'canadd' => ($user),
'canupdate' => $canupdate,
return $this->getRender('viewitemessential.html.twig', [
'canadd' => ($this->user),
'modedesktop' => $modedesktop,
'items' => $itemsordered,
'bookmarks' => $bookmarks,
'access' => $access,
]);
}
public function viewalertAction($id,$access="config") {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
public function viewalertAction(Request $request,$id,$access="config") {
// Récupération de la requete
$this->setRequest($request,$id,$access);
// 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');
}
// Valeur par défaut
$alertsordered=null;
// Datas associées au widget
if(!$this->mini) {
// Récupération des paramétres du widget
$idalertcategory=null;
$alertcategoryfilter=null;
foreach($entity->getParameter()["fields"] as $parameter) {
foreach($this->entity->getParameter()["fields"] as $parameter) {
switch($parameter["id"]) {
case "alertcategory":
$idalertcategory=$parameter["value"];
if($idalertcategory) $alertcategoryfilter=$em->getRepository("CadolesPortalBundle:Alertcategory")->find($idalertcategory);
if($idalertcategory) $alertcategoryfilter=$this->em->getRepository("CadolesPortalBundle:Alertcategory")->find($idalertcategory);
break;
}
}
// Préference utilisateur
$this->getPreference($entity);
// Profilage
$user=$this->getUser();
$alertsordered=$em->getRepository("CadolesPortalBundle:Alert")->getUserAlerts($user,$idalertcategory,$alertcategoryfilter);
$alertsordered=$this->em->getRepository("CadolesPortalBundle:Alert")->getUserAlerts($this->user,$idalertcategory,$alertcategoryfilter);
}
// Render
return $this->render($this->labelentity.':viewalert.html.twig', [
'entity' => $entity,
'canupdate' => $canupdate,
return $this->getRender('viewalert.html.twig', [
'alerts' => $alertsordered,
'access' => $access
]);
}
public function viewfluxAction($id,$access="config") {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
public function viewfluxAction(Request $request,$id,$access="config") {
// Récupération de la requete
$this->setRequest($request,$id,$access);
// 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
// Valeur par défaut
$modelist=0;
foreach($entity->getParameter()["fields"] as $parameter) {
$fluxsordered=null;
$feeds=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"]) {
case "modelist":
$modelist=$parameter["value"];
@ -788,49 +702,13 @@ class PagewidgetController extends Controller
}
}
// Préference utilisateur
$this->getPreference($entity);
// Profilage
$user=$this->getUser();
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
$groups=($user?$user->getGroups():[]);
// Initialisation du calcul des fluxs
$fluxs=new ArrayCollection();
// Récupération des fluxs par rôles
foreach($roles as $role) {
$qb = $em->createQueryBuilder();
$qb->select('flux')
->from("CadolesPortalBundle:Flux", 'flux')
->where($qb->expr()->like('flux.roles', $qb->expr()->literal("%$role%")));
$fluxsroles=$qb->getQuery()->getResult();
foreach($fluxsroles as $fluxrole) {
if(!$fluxs->contains($fluxrole)) $fluxs->add($fluxrole);
}
}
// Récupération des fluxs par group
foreach($groups as $group) {
$qb = $em->createQueryBuilder();
$qb->select('flux')
->from("CadolesPortalBundle:Flux", 'flux')
->where(":group MEMBER OF flux.groups")
->setParameter("group",$group->getGroup());
$fluxsgroups=$qb->getQuery()->getResult();
foreach($fluxsgroups as $fluxgroup) {
if(!$fluxs->contains($fluxgroup)) $fluxs->add($fluxgroup);
}
}
$fluxs=$this->em->getRepository("CadolesPortalBundle:Flux")->getUserFluxs($this->user);
$feeds=array();
$filesystem = new Filesystem();
// Généraltion du cache associés aux flux
foreach($fluxs as $keyflux => $flux) {
// On regarde si le flux a été lu il y a peu
$toregen=true;
@ -868,7 +746,7 @@ class PagewidgetController extends Controller
// Si le fichier est trop ancien on relit le flus
if($toregen) {
$PROXYactivate = $em->getRepository("CadolesCoreBundle:Config")->find("PROXYactivate")->getValue();
$PROXYactivate = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYactivate")->getValue();
$weburl=$this->getParameter('weburl');
if(stripos($url,"/")==0) {
@ -879,8 +757,8 @@ class PagewidgetController extends Controller
if(stripos($url,"http://".$weburl)===0) $PROXYactivate=false;
if($PROXYactivate) {
$PROXYserver = $em->getRepository("CadolesCoreBundle:Config")->find("PROXYserver")->getValue();
$PROXYport = $em->getRepository("CadolesCoreBundle:Config")->find("PROXYport")->getValue();
$PROXYserver = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYserver")->getValue();
$PROXYport = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYport")->getValue();
$clientguzzle = new \GuzzleHttp\Client(array('timeout' => 3,'verify'=>false,'proxy' => ['http' => 'http://'.$PROXYserver.':'.$PROXYport,'https' => 'http://'.$PROXYserver.':'.$PROXYport]));
}
else
@ -958,7 +836,6 @@ class PagewidgetController extends Controller
}
// Garder le flux
$tmp=array(
"feedtitle" => $feedtitle,
"title" => $title,
@ -1001,41 +878,33 @@ class PagewidgetController extends Controller
$libelle[$key] = $valeur["date"];
}
array_multisort($libelle, SORT_DESC, $feeds);
}
// Render
return $this->render($this->labelentity.':viewflux.html.twig', [
'entity' => $entity,
'canupdate' => $canupdate,
return $this->getRender('viewflux.html.twig', [
'modelist' => $modelist,
'fluxs' => $fluxsordered,
'access' => $access,
'feeds' => $feeds,
]);
}
public function viewrssAction($id,$access="config") {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
public function viewrssAction(Request $request,$id,$access="config") {
// Récupération de la requete
$this->setRequest($request,$id,$access);
// 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');
}
// Valeur par défaut
$modelist=0;
$fluxs=["id"=>0];
$feeds=null;
// Datas associées au widget
if(!$this->mini) {
// Récupération des paramétres du widget
$url="";
$nbarticle="_blank";
$modelist=0;
foreach($entity->getParameter()["fields"] as $parameter) {
foreach($this->entity->getParameter()["fields"] as $parameter) {
switch($parameter["id"]) {
case "url":
$url=$parameter["value"];
@ -1049,9 +918,6 @@ class PagewidgetController extends Controller
}
}
// Préference utilisateur
$this->getPreference($entity);
// On regarde si le flux a été lu il y a peu
$toregen=true;
$filecache=$filecache='uploads/flux/widget-'.$id.'.txt';
@ -1085,7 +951,7 @@ class PagewidgetController extends Controller
// Si le fichier est trop ancien on relit le flus
if($toregen) {
// Connexion au client
$PROXYactivate = $em->getRepository("CadolesCoreBundle:Config")->find("PROXYactivate")->getValue();
$PROXYactivate = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYactivate")->getValue();
$weburl=$this->getParameter('weburl');
if(stripos($url,"/")==0) {
$url="https://".$weburl.$url;
@ -1095,8 +961,8 @@ class PagewidgetController extends Controller
if(stripos($url,"http://".$weburl)===0) $PROXYactivate=false;
if($PROXYactivate) {
$PROXYserver = $em->getRepository("CadolesCoreBundle:Config")->find("PROXYserver")->getValue();
$PROXYport = $em->getRepository("CadolesCoreBundle:Config")->find("PROXYport")->getValue();
$PROXYserver = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYserver")->getValue();
$PROXYport = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYport")->getValue();
$clientguzzle = new \GuzzleHttp\Client(array('timeout' => 3,'verify'=>false,'proxy' => ['http' => 'http://'.$PROXYserver.':'.$PROXYport,'https' => 'http://'.$PROXYserver.':'.$PROXYport]));
}
else
@ -1108,11 +974,10 @@ class PagewidgetController extends Controller
if ($e->hasResponse()) {
// Render
$feeds=[];
return $this->render($this->labelentity.':viewflux.html.twig', [
'entity' => $entity,
'canupdate' => $canupdate,
'access' => $access,
return $this->getRender('viewflux.html.twig', [
'fluxs' => $fluxs,
'feeds' => $feeds,
'modelist' => $modelist,
]);
}
}
@ -1191,7 +1056,7 @@ class PagewidgetController extends Controller
"image" => $imgurl,
// "color" => $flux->getColor(),
"fluxid" => 0,
"fluxtitle" => $entity->getName(),
"fluxtitle" => $this->entity->getName(),
));
$nbflux++;
@ -1209,19 +1074,20 @@ class PagewidgetController extends Controller
$filesystem->dumpFile($filecache, serialize($feeds));
}
}
}
// Render
return $this->render($this->labelentity.':viewflux.html.twig', [
'entity' => $entity,
'canupdate' => $canupdate,
'fluxs' => ["id"=>0],
'access' => $access,
return $this->getRender('viewflux.html.twig', [
'fluxs' => $fluxs,
'feeds' => $feeds,
'modelist' => $modelist,
]);
}
public function viewbookmarkAction($id,$access="config") {
public function viewbookmarkAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1266,10 +1132,15 @@ class PagewidgetController extends Controller
'modedesktop' => $modedesktop,
'bookmarks' => $bookmarks,
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewlinkAction($id,$access="config") {
public function viewlinkAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1310,10 +1181,15 @@ class PagewidgetController extends Controller
'url' => $url,
'target' => $target,
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function vieweditorAction($id,$access="config") {
public function vieweditorAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1350,10 +1226,15 @@ class PagewidgetController extends Controller
'canupdate' => $canupdate,
'html' => $html,
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewslideAction($id,$access="config") {
public function viewslideAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1393,10 +1274,15 @@ class PagewidgetController extends Controller
'slides' => $slides,
'interval' => $interval,
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewfileAction($id,$access="config") {
public function viewfileAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1432,13 +1318,18 @@ class PagewidgetController extends Controller
'access' => $access,
'directory' => "widget-".$id,
'view' => $view,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewgaleryAction($id,$access="config") {
public function viewgaleryAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1491,12 +1382,16 @@ class PagewidgetController extends Controller
'canupdate' => $canupdate,
'files' => $files,
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewcalendarAction(Request $request,$id,$access="config") {
$usage=$request->query->get('usage');
$group=$request->query->get('group');
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
@ -1541,13 +1436,17 @@ class PagewidgetController extends Controller
'nbday' => $nbday,
'access' => $access,
'firstcalendar' => $firstcalendar,
'usage' => $usage
'usage' => $usage,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewblogAction(Request $request,$id,$access="config") {
$usage=$request->query->get('usage');
$group=$request->query->get('group');
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
@ -1602,13 +1501,17 @@ class PagewidgetController extends Controller
'nbarticle' => $nbarticle,
'access' => $access,
'firstblog' => $firstblog,
'usage' => $usage
'usage' => $usage,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewprojectAction(Request $request,$id,$access="config") {
$usage=$request->query->get('usage');
$group=$request->query->get('group');
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
@ -1676,11 +1579,16 @@ class PagewidgetController extends Controller
'nbarticle' => $nbarticle,
'access' => $access,
'firstproject' => $firstproject,
'usage' => $usage
'usage' => $usage,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewseparatorAction($id,$access="config") {
public function viewseparatorAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1721,10 +1629,15 @@ class PagewidgetController extends Controller
'seetitle' => $seetitle,
'seeicon' => $seeicon,
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewclockAction($id,$access="config") {
public function viewclockAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1754,17 +1667,22 @@ class PagewidgetController extends Controller
$this->getPreference($entity);
// Render
return $this->render($this->labelentity.':viewurl.html.twig', [
return $this->render($this->labelentity.':viewframe.html.twig', [
'entity' => $entity,
'canadd' => $canupdate,
'canupdate' => $canupdate,
'onheader' => true,
'tool' => ($clock==0?"cadoles_portal_user_tool_clockanalogique":"cadoles_portal_user_tool_clocknumerique"),
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewcalculatorAction($id,$access="config") {
public function viewcalculatorAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1791,10 +1709,15 @@ class PagewidgetController extends Controller
'onheader' => true,
'tool' => "cadoles_portal_user_tool_calculator",
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewappexternalAction($id,$access="config") {
public function viewappexternalAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
@ -1892,12 +1815,16 @@ class PagewidgetController extends Controller
'items' => $items,
'itemcategorys' => $itemcategorys,
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewinfoAction(Request $request,$id,$access="config") {
$usage=$request->query->get('usage');
$group=$request->query->get('group');
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$user=$this->getUser();
$em = $this->getDoctrine()->getManager();
@ -1960,12 +1887,16 @@ class PagewidgetController extends Controller
'members' => $members,
'id' => $id,
'idpage' => $page->getId(),
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewchatAction(Request $request,$id,$access="config") {
$usage=$request->query->get('usage');
$group=$request->query->get('group');
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
@ -1999,6 +1930,8 @@ class PagewidgetController extends Controller
'access' => $access,
'usage' => $usage,
'group' => $group,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
@ -2006,6 +1939,9 @@ class PagewidgetController extends Controller
public function viewgroupAction(Request $request,$id,$access="config") {
$usage=$request->query->get('usage');
$group=$request->query->get('group');
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$user=$this->getUser();
$em = $this->getDoctrine()->getManager();
@ -2049,13 +1985,17 @@ class PagewidgetController extends Controller
'canupdate' => $canupdate,
'usage' => $usage,
'groups' => $mygroups,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewgroupmessageAction(Request $request,$id,$access="config") {
$usage=$request->query->get('usage');
$group=$request->query->get('group');
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$user=$this->getUser();
$em = $this->getDoctrine()->getManager();
@ -2135,13 +2075,17 @@ class PagewidgetController extends Controller
'modelist' => $modelist,
'messages' => $mymsg,
'nbarticle' => $nbarticle,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
public function viewOnlydocAction(Request $request,$id,$access="config") {
$usage=$request->query->get('usage');
$group=$request->query->get('group');
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
$user=$this->getUser();
$em = $this->getDoctrine()->getManager();
@ -2185,6 +2129,8 @@ class PagewidgetController extends Controller
'access' => $access,
'directory' => $id,
'view' => $view,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}
}

View File

@ -32,7 +32,7 @@ class SlideController extends Controller
// Vérifier que l'on générer un slide
if($access=="user") {
if($usage=="user") {
$user=$data->getPagewidget()->getPage()->getUser();
$user=$pagewidget->getPage()->getUser();
if($user!=$this->getUser()) throw $this->createNotFoundException('Permission denied');
}
else {
@ -76,7 +76,7 @@ class SlideController extends Controller
// Vérifier que l'on générer un slide
if($access=="user") {
if($usage=="user") {
$user=$data->getPagewidget()->getPage()->getUser();
$user=$pagewidget->getPage()->getUser();
if($user!=$this->getUser()) throw $this->createNotFoundException('Permission denied');
}
else {

View File

@ -11,7 +11,8 @@ use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="flux")
* @ORM\HasLifecycleCallbacks
* @ORM\HasLifecycleCallbacks.
* @ORM\Entity(repositoryClass="Cadoles\PortalBundle\Repository\FluxRepository")
*/
class Flux
{

View File

@ -0,0 +1,47 @@
<?php
namespace Cadoles\PortalBundle\Repository;
use Doctrine\ORM\EntityRepository;
use Doctrine\Common\Collections\ArrayCollection;
class FluxRepository extends EntityRepository
{
public function getUserFluxs($user) {
// Profilage
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
$groups=($user?$user->getGroups():[]);
// Initialisation du calcul des alerts
$fluxs=new ArrayCollection();
// Récupération des fluxs par rôles
foreach($roles as $role) {
$qb = $this->createQueryBuilder('a');
$qb->select('flux')
->from("CadolesPortalBundle:Flux", 'flux')
->where($qb->expr()->like('flux.roles', $qb->expr()->literal("%$role%")));
$fluxsroles=$qb->getQuery()->getResult();
foreach($fluxsroles as $fluxrole) {
if(!$fluxs->contains($fluxrole)) $fluxs->add($fluxrole);
}
}
// Récupération des fluxs par group
foreach($groups as $group) {
$qb = $this->createQueryBuilder('a');
$qb->select('flux')
->from("CadolesPortalBundle:Flux", 'flux')
->where(":group MEMBER OF flux.groups")
->setParameter("group",$group->getGroup());
$fluxsgroups=$qb->getQuery()->getResult();
foreach($fluxsgroups as $fluxgroup) {
if(!$fluxs->contains($fluxgroup)) $fluxs->add($fluxgroup);
}
}
return $fluxs;
}
}

View File

@ -7,7 +7,7 @@ use Doctrine\Common\Collections\ArrayCollection;
class ItemRepository extends EntityRepository
{
public function getUserItems($user,&$bookmarks,&$itemsordered,&$itemcategorys,$iditemcategory=null,$withbookmark=1) {
public function getUserItems($user,&$bookmarks,&$itemsordered,&$itemcategorys,$iditemcategory=null,$withbookmark=1,$fgessential=false) {
// Profilage
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
$groups=($user?$user->getGroups():[]);
@ -40,6 +40,12 @@ class ItemRepository extends EntityRepository
$qb->andWhere("item.itemcategory=:itemcategory")
->setParameter("itemcategory",$itemcategoryfilter);
}
if($fgessential) {
$qb->andWhere("item.essential=:flag")
->setParameter("flag",true);
}
$itemsroles=$qb->getQuery()->getResult();
foreach($itemsroles as $itemrole) {
if(!$bookmarksitems->contains($itemrole) && !$items->contains($itemrole)) $items->add($itemrole);
@ -58,6 +64,12 @@ class ItemRepository extends EntityRepository
$qb->andWhere("item.itemcategory=:itemcategory")
->setParameter("itemcategory",$itemcategoryfilter);
}
if($fgessential) {
$qb->andWhere("item.essential=:flag")
->setParameter("flag",true);
}
$itemsgroups=$qb->getQuery()->getResult();
foreach($itemsgroups as $itemgroup) {
@ -78,6 +90,12 @@ class ItemRepository extends EntityRepository
$qb->andWhere("item.itemcategory=:itemcategory")
->setParameter("itemcategory",$itemcategoryfilter);
}
if($fgessential) {
$qb->andWhere("item.essential=:flag")
->setParameter("flag",true);
}
$itemsniveau01s=$qb->getQuery()->getResult();
foreach($itemsniveau01s as $itemniveau01) {
if(!$bookmarksitems->contains($itemniveau01) && !$items->contains($itemniveau01)) $items->add($itemniveau01);

View File

@ -1,6 +1,13 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block localstyle %}
{% if look=="list" %}
#R1C1:first-child {
margin-top: 30px;
}
{% endif %}
{% endblock %}
{% block pagewrapper %}
{% if access=="config" %}
<div class="pagemenu">
@ -25,8 +32,8 @@
<div id="tolocalize" style="display:none">
{% for pagewidget in entity.pagewidgets %}
<a href="{{ url(pagewidget.widget.routeview|replace({'_config_':'_'~access~'_'}),{id:pagewidget.id,by:mode,usage:usage,group:group}) }}"></a>
{{ render(url(pagewidget.widget.routeview|replace({'_config_':'_'~access~'_'}),{id:pagewidget.id,by:mode,usage:usage,group:group})) }}
<a href="{{ url(pagewidget.widget.routeview|replace({'_config_':'_'~access~'_'}),{id:pagewidget.id,by:mode,usage:usage,group:group,look:look,selwidget:selwidget}) }}"></a>
{{ render(url(pagewidget.widget.routeview|replace({'_config_':'_'~access~'_'}),{id:pagewidget.id,by:mode,usage:usage,group:group,look:look,selwidget:selwidget})) }}
{% endfor %}
</div>
@ -98,7 +105,11 @@
});
// Création de la grille des widgets
{% if look == "list" %}
var template = '{"rows":[{"id":0,"cols":[{"id":0,"size": 1,"rows":[]},{"id":1,"size": 11,"rows":[]}]}]}';
{% else %}
var template = '{{ entity.template | raw }}';
{% endif %}
// Template de base
if(template=="") {
@ -157,10 +168,19 @@
// On déplace les widgets à leur emplacement
$("#tolocalize").children(".widget").each(function( element ) {
{% if look=="list" %}
if($(this).data("id")=="{{selwidget}}") {
$(this).appendTo('#R1C2');
}
else
$(this).appendTo('#R1C1');
{% else %}
if($('#'+$(this).attr("loc")).length)
$(this).appendTo('#'+$(this).attr("loc"));
else
$(this).appendTo('#R1C1');
{% endif %}
});
// On ajoute un widget vide à chaque colonne
@ -168,7 +188,7 @@
$("<div class='widgetempty'>&nbsp;</div>").appendTo($(this));
});
{% if canupdate %}
{% if canupdate and look!="list" %}
// Mettre une taille mini de colonne sinon on ne pourra pas déplacer le widget dans la colonne
$(".colcontainer .col").css("min-height","80px");
@ -365,6 +385,26 @@
}
}
// Aggrandir widget
function bigWidget(idwidget) {
var url="{{ path('cadoles_portal_'~access~'_page_view',{id:entity.id,group:group,usage:usage,by:mode,look:'list',selwidget:'xx'})}}";
url=url.replace('xx',idwidget);
url=url.replace(/&amp;/g,"&");
$(location).attr('href', url);
}
// Réduire widget
function smallWidget(idwidget) {
var url="{{ path('cadoles_portal_'~access~'_page_view',{id:entity.id,group:group,usage:usage,by:mode,look:'view',selwidget:'xx'})}}";
url=url.replace('xx',idwidget);
url=url.replace(/&amp;/g,"&");
$(location).attr('href', url);
}
// Ajout d'un bookmark
function addBookmark(idwidget,touser) {
var url="{{ path('cadoles_portal_'~access~'_bookmark_submit',{idpage:entity.id,idwidget:'xx',touser:'yy',group:group,usage:usage,by:mode})}}";

View File

@ -12,14 +12,35 @@
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
{% if canupdate or alerts|length>0 %}
{%if mini %}
<div class="widget widget-mini widget-projalertect" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-alert" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
@ -57,5 +78,6 @@
</div>
</div>
{% endif %}
{% endif %}

View File

@ -26,15 +26,32 @@
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-appexternal" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-appexternal" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
@ -89,6 +106,7 @@
{% endfor %}
</div>
</div>
{% endif %}

View File

@ -12,12 +12,19 @@
{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
{% set color = app.session.get('color') %}
<style>
</style>
{%if mini %}
<div class="widget widget-mini widget-blog" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-blog" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
<div class="widgetmenu">
{% if canupdate %}
@ -36,6 +43,13 @@
<a title="Créer un Article" onClick="showFrameitem('blog','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
@ -79,6 +93,6 @@
</div>
{% endif %}
</div>
{% endif %}

View File

@ -33,9 +33,20 @@
{% set username = "" %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-bookmark" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-bookmark" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -45,9 +56,13 @@
{% if canadd %}
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" style="{{ stylewidgetmenu }}"></i>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
@ -117,6 +132,7 @@
</div>
{% endif %}
</div>
{% endif %}

View File

@ -11,12 +11,19 @@
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
{% set color = app.session.get('color') %}
<style>
</style>
{%if mini %}
<div class="widget widget-mini widget-calendar" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-calendar" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
<div class="widgetmenu">
{% if canupdate %}
@ -32,6 +39,12 @@
{% endif %}
<a title="Gérer mes Calendriers" onClick="showFrameitem('calendar','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-calendar fa-fw"></i></a>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
@ -86,6 +99,7 @@
</div>
{% endif %}
</div>
{% endif %}

View File

@ -28,6 +28,19 @@
{% if app.user %}
<style>.msgtopic a { color: #{{colorbodyfont}}; font-weight: bold; }</style>
{%if mini %}
<div class="widget widget-mini widget-chat" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% 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">
{% if canupdate %}
<div class="widgetmenu">
@ -62,5 +75,6 @@
</div>
{% endif %}
</div>
{% endif %}
{%endif%}

View File

@ -10,15 +10,32 @@
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
{%if mini %}
<div class="widget widget-mini widget-editor" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-editor" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
@ -34,6 +51,6 @@
{{ html | raw }}
</div>
</div>
{% endif %}

View File

@ -28,17 +28,32 @@
{% set colorbodyfont = color['main'] %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-file" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-file" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
@ -53,6 +68,7 @@
<iframe id="frame-{{directory}}" src="{{ path("cadoles_core_"~access~"_file_list",{'directory':directory,'defaultview':view}) }}" data-color="#{{colorbodyfont}}" style="{{ stylewidgetbodyframe }}" class="{% if not entity.autoajust %}notframeajust {% endif %}"></iframe>
</div>
</div>
{% endif %}

View File

@ -36,14 +36,32 @@
{% set stylegrid="grid-list" %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-flux" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-flux" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
@ -116,8 +134,8 @@
{% endfor %}
</div>
</div>
</div>
{% endif %}

View File

@ -23,14 +23,35 @@
{% set colorbodyfont = color['fontcolorhover'] %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-frame" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-frame" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
</div>
{% 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 %}
<div class="widgetheader" style="{{ stylewidgetbodyimage }}">
@ -51,8 +72,6 @@
</div>
{% endif %}
</div>
{% endif %}
<script>
</script>

View File

@ -24,8 +24,20 @@
{% set colorbodyfont = color['fontcolorhover'] %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-galery" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-galery" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -35,9 +47,13 @@
{% if canadd %}
<a style="{{ stylewidgetmenu }}" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Fichiers','{{ path('cadoles_core_'~access~'_file_upload',{'id': 'widget-'~entity.id,'type':'image'}) }}');" title='Ajouter des Images'><i class="fa fa-plus fa-fw"></i></a>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
@ -101,6 +117,7 @@
</div>
{% endif %}
</div>
{% endif %}

View File

@ -18,8 +18,20 @@
{% set canadd = true %}
{% endif %}
{% if mini %}
<div class="widget widget-mini widget-group" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-group" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
{% if canupdate %}
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -31,9 +43,13 @@
<i class="fa fa-plus fa-fw" style="{{ stylewidgetmenu }}"></i>
</a>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
@ -95,6 +111,6 @@
</div>
</div>
</div>
{% endif %}

View File

@ -38,14 +38,35 @@
{% set stylegrid="grid-list" %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-groupmessage" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-groupmessage" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
@ -95,6 +116,6 @@
</div>
{% endif %}
</div>
{% endif %}

View File

@ -19,36 +19,49 @@
{% set stylelink = "color:#" ~ color['fontcolorhover'] %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-info" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if icon %}
{% if icon=="/uploads/avatar/noavatar.png" %}
<img src="/{{ alias }}/uploads/icon/icon_profle.png" class="logo" title="{{ title }}"/>
{% else %}
<img src="/{{ alias }}{{ icon }}" class="logo" title="{{ title }}"/>
{% endif %}
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_users.png" class="logo" title="{{ title }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-info" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
</div>
{% endif %}
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% if look=="list" %}
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if icon %}
<img src="/{{ alias }}{{ icon }}" class="logo" />
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_users.png" class="logo"/>
{% endif %}
<span class="title">{{ title }}</span>
</div>
<div class="widgetbody" style="{{ stylewidgetbody }}">
{% set style = "margin: auto; display: inherit;background-color:transparent;" %}
{% if icon %}
<img src="/{{ alias }}{{ icon }}" class="avatar big" style="{{ style }}" />
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_users.png" class="avatar big" style="{{ style }}" />
{% endif %}
<div style="text-align: center;">
{%if usage=="group" %}<small>Groupe<br></small>{% endif %}
<span style="font-size:120%">{{ title }}</span><br>
{{ description | raw }}
{%if usage=="group" %}
@ -102,6 +115,7 @@
</div>
</div>
</div>
{% endif %}

View File

@ -33,8 +33,20 @@
{% set username = "" %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-project" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-item" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -44,9 +56,13 @@
{% if canadd and access!="config"%}
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},true)" style="{{ stylewidgetmenu }}"></i>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
@ -293,6 +309,6 @@
{% endfor %}
</div>
</div>
{% endif %}

View File

@ -33,8 +33,20 @@
{% set username = "" %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-itemessential" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-itemessential" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -46,8 +58,13 @@
<i class="fa fa-plus fa-fw" style="{{ stylewidgetmenu }}"></i>
</a>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
@ -212,8 +229,7 @@
</div>
</div>
{% endif %}
</div>
{% endif %}

View File

@ -24,15 +24,32 @@
{% set username = "" %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-link" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
{% if target == 'frame' %}
<a class="linktosonde" data-sonde="{{ entity.name }}" style="cursor:pointer; {{ stylelink }}" onClick="showFrameitem('link{{ entity.id }}','{{ url|replace({'#login#': username}) }}')">
{% elseif target == "_self" %}
<a class="linktosonde" data-sonde="{{ entity.name }}" style="{{ stylelink }}"href="{{ url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ target }}{% endif %}">
{% else %}
<a class="linktosonde" data-sonde="{{ entity.name }}" style="{{ stylelink }}" href="{{ url|replace({'#login#': username}) }}" target="{{ target }}">
{% endif %}
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{entity.name}}" />
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}" />
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-link" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% endif %}
</div>
{% endif %}
<div class="widgetheader" style="{{ stylewidgetbodyimage }}; height:100%;">
@ -54,6 +71,6 @@
</a>
</div>
</div>
{% endif %}

View File

@ -28,16 +28,31 @@
{% set colorbodyfont = color['main'] %}
{% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-file" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
{%if mini %}
<div class="widget widget-mini widget-onlydoc" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-onlydoc" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
@ -55,6 +70,7 @@
</div>
</div>
{% endif %}

View File

@ -18,6 +18,19 @@
</style>
{%if mini %}
<div class="widget widget-mini widget-project" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-project" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
<div class="widgetmenu">
{% if canupdate %}
@ -35,6 +48,12 @@
{% endif %}
<a onClick="showFrameitem('project','{{ url }}',true)" style="{{ stylewidgetmenu }}" title="Ajouter une Tâche"><i class="fa fa-plus fa-fw"></i></a>
{% 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>
<div class="widgetheader" style="{{ stylewidgetheader }}">
@ -111,6 +130,7 @@
</div>
{% endif %}
</div>
{% endif %}

View File

@ -17,6 +17,7 @@
{% set colorbodyfont = color['main'] %}
{% endif %}
{%if not mini %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-separator" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
@ -54,6 +55,7 @@
{% endif %}
</div>
</div>
{% endif %}
<script>

View File

@ -23,8 +23,20 @@
{% set username = "" %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-slide" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-slide" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -34,9 +46,13 @@
{% if canadd %}
<i title="Gérer le Carrousel" class="fa fa-th fa-fw" onClick="listSlide({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% endif %}
</div>
{% 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>
<div class="widgetheader" style="{{ stylewidgetbodyimage }}">
{% set intervalmilli = interval * 1000 %}
@ -72,7 +88,7 @@
</div>
</div>
</div>
{% endif %}

View File

@ -17,13 +17,32 @@
{% set username = "" %}
{% endif %}
{%if mini %}
<div class="widget widget-mini widget-project" data-id="{{ entity.id }}" loc="{{ entity.loc }}">
<div class="widgetheader">
<a style="cursor:pointer" onClick="bigWidget({{entity.id}})">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo" title="{{ entity.name }}"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo" title="{{ entity.name }}"/>
{% endif %}
</a>
</div>
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-url" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<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-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
</div>
{% 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 imagemedia %}
{% if entity.autoajust %}
@ -52,11 +71,15 @@
</div>
<div class="widgetbody" style="{{ stylewidgetbodyframe }}">
<iframe src="{{ url|replace({'#login#': username}) }}" class="{% if entity.autoajust %}frameajust {% endif %}" style="{{ stylewidgetbodyframe }}"></iframe>
{% set minheight="" %}
{%if look=="list" %}
{% set minheight="min-height:1300px;" %}
{% endif %}
<iframe src="{{ url|replace({'#login#': username}) }}" class="{% if entity.autoajust %}frameajust {% endif %}" style="{{ stylewidgetbodyframe }} {{minheight}}"></iframe>
</div>
{% endif %}
</div>
{% endif %}
<script>
</script>