18 Commits

Author SHA1 Message Date
5d877dd8ca indicateur user online sur le chat (fixes #5) 2019-10-28 11:39:08 +01:00
7265099724 ajout core-init-01.sql dans le gitignore 2019-10-28 11:37:50 +01:00
87ce3767fa svg 2019-10-23 10:45:06 +02:00
02a8b475f7 svg 2019-10-21 17:23:25 +02:00
ce5552e610 ajustement onboarding + affiche fiche utilisateur sur clique avatar 2019-10-21 17:12:03 +02:00
52ad21060b ajustement onboarding + affiche fiche utilisateur sur clique avatar 2019-10-21 17:08:46 +02:00
7ce296fd29 gestion visible et ajout colonne telephone (fixes #15 #16) 2019-10-21 14:09:24 +02:00
198ebd14f5 titre widget responsiv (fixes #20) 2019-10-21 12:16:18 +02:00
4f3efd5776 replacement mot clé #login# par username (fixes #21) 2019-10-21 11:46:36 +02:00
c08719deda ajout description évènement en survol de l'event (fixes #22) 2019-10-21 10:48:57 +02:00
7c50db02fd passage à une demi seconde de temps de reconexion (ref #23) 2019-10-18 14:10:48 +02:00
33f0d05fb6 gérer la deconnexion au websocket (ref #23) 2019-10-18 13:56:25 +02:00
b29ce57c6e essai reco websocket 2019-10-17 13:37:39 +02:00
2e34d65cbf svg 2019-10-16 16:17:56 +02:00
abd323163e svg modele scribe 2019-10-15 10:02:33 +02:00
e9b2f694fa svg 2019-10-14 13:30:50 +02:00
210b669909 mise à jour pour rest 2019-10-09 17:01:41 +02:00
1cd1174c79 adaptation theme transnum 2019-10-09 13:48:38 +02:00
67 changed files with 885 additions and 388 deletions

1
debian/compat vendored
View File

@ -1 +0,0 @@
7

24
debian/control vendored
View File

@ -1,24 +0,0 @@
Source: eole-ninegate
Section: web
Priority: optional
Maintainer: Equipe Envole <eole@ac-dijon.fr>
Build-Depends: debhelper (>= 7.0.50)
Standards-Version: 3.8.4
Homepage: http://eole.orion.education.fr/diff/
Vcs-Git: http://dev-eole.ac-dijon.fr/git/ninegate
Vcs-Browser: http://dev-eole.ac-dijon.fr/projects/ninegate/repository
Package: ninegate-sso
Architecture: all
Depends: ${misc:Depends}, eole-sso
Description: Filtre SSO pour ninegate "EOLE".
Package: eole-ninegate
Architecture: all
Depends: ${misc:Depends}, eole-web (>= 2.6.1), ninegate-sso, eole-db, eole-client-annuaire, eole-sondepiwik, eole-posh-profil, eole-envole-themes
Description: Eolisation de l'application ninegate.
Package: ninegate-apps
Architecture: all
Depends: ${misc:Depends}, eole-web-pkg (>= 2.6.1), eole-client-annuaire-pkg, sondepiwik-apps, posh-profil-apps, composer, php-zip, php-mbstring
Description: Sources pour ninegate "EOLE".

44
debian/copyright vendored
View File

@ -1,44 +0,0 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: {PROJECT}
Source: {URL}
Files: *
Copyright: YEAR {UPSTREAM} {AUTHOR} <{MAIL}>
License: {UPSTREAM LICENSE}
Files: debian/*
Copyright: 2012 Équipe EOLE <eole@ac-dijon.fr>
License: CeCILL-2
License: {UPSTREAM LICENSE}
{TEXT OF THE LICENSE}
License: CeCILL-2
This software is governed by the CeCILL-2 license under French law and
abiding by the rules of distribution of free software. You can use,
modify and or redistribute the software under the terms of the CeCILL-2
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info";.
.
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited
liability.
.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-2 license and that you accept its terms.
.
On Eole systems, the complete text of the CeCILL-2 License can be found
in '/usr/share/common-licenses/CeCILL-2-en'.

View File

@ -1 +0,0 @@
usr/share/eole

3
debian/gbp.conf vendored
View File

@ -1,3 +0,0 @@
# Set per distribution debian tag
[DEFAULT]
debian-tag = debian/envole/%(version)s

View File

@ -1 +0,0 @@
var/www/html

View File

@ -1 +0,0 @@
usr/share/sso

8
debian/rules vendored
View File

@ -1,8 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@

View File

@ -1 +0,0 @@
3.0 (native)

View File

@ -1,5 +1,6 @@
/.web-server-pid /.web-server-pid
/app/config/parameters.yml /app/config/parameters.yml
/src/Cadoles/CoreBundle/Command/data/core-init-01.sql
/build/ /build/
/phpunit.xml /phpunit.xml
/var/* /var/*

View File

@ -137,6 +137,7 @@ gos_web_socket:
server: server:
port: %websocket_port% #The port the socket server will listen on port: %websocket_port% #The port the socket server will listen on
host: %websocket_host% #The host ip to bind to host: %websocket_host% #The host ip to bind to
router: router:
resources: resources:
- "@CadolesWebsocketBundle/Resources/config/topic.yml" - "@CadolesWebsocketBundle/Resources/config/topic.yml"

View File

@ -105,7 +105,7 @@ class SecurityController extends Controller
$em->flush(); $em->flush();
// On calcule les groupes de l'utilisateur // On calcule les groupes de l'utilisateur
$user=$groups=$em->getRepository('CadolesCoreBundle:Group')->calculateGroup($user,$attributes); $groups=$em->getRepository('CadolesCoreBundle:Group')->calculateGroup($user,$attributes);
} }
} }
else { else {

View File

@ -38,6 +38,7 @@ class InitDataCommand extends ContainerAwareCommand
$em = $this->getContainer()->get('doctrine')->getEntityManager(); $em = $this->getContainer()->get('doctrine')->getEntityManager();
$masteridentity=$this->getContainer()->getParameter('masteridentity'); $masteridentity=$this->getContainer()->getParameter('masteridentity');
$ldap_template = $this->getContainer()->getParameter('ldap_template');
$finder = new Finder(); $finder = new Finder();
$finder->in('src/Cadoles/CoreBundle/Command/data'); $finder->in('src/Cadoles/CoreBundle/Command/data');
@ -138,7 +139,12 @@ class InitDataCommand extends ContainerAwareCommand
if(!$niveau01) { if(!$niveau01) {
// Si ce n'est pas le cas on positionne un filtre ultra large sur le niveau01 de base // Si ce n'est pas le cas on positionne un filtre ultra large sur le niveau01 de base
$niveau01=$group=$em->getRepository('CadolesCoreBundle:Niveau01')->find(-100); $niveau01=$group=$em->getRepository('CadolesCoreBundle:Niveau01')->find(-100);
$niveau01->setLdapfilter("(uid=*)");
if($ldap_template=="scribe")
$niveau01->setLdapfilter("(&(uid=*)(objectclass=inetOrgPerson)(!(description=Computer)))");
else
$niveau01->setLdapfilter("(uid=*)");
$em->persist($niveau01); $em->persist($niveau01);
$em->flush(); $em->flush();
} }

View File

@ -132,6 +132,7 @@ class SynchroCommand extends Command
$this->writeln(" - $label"); $this->writeln(" - $label");
if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); if(!$simulate) $this->addmodGroup($label,$ldapfilter,true);
// Classes
$this->writeln(''); $this->writeln('');
$this->writeln('== CLASSES =========================================='); $this->writeln('== CLASSES ==========================================');
$results = $this->ldap->search("type=Classe", ['cn','description','gidNumber'], $this->ldap_basedn); $results = $this->ldap->search("type=Classe", ['cn','description','gidNumber'], $this->ldap_basedn);
@ -143,6 +144,32 @@ class SynchroCommand extends Command
$this->writeln(" - $label"); $this->writeln(" - $label");
if(!$simulate) $this->addmodGroup($label,$ldapfilter,true); if(!$simulate) $this->addmodGroup($label,$ldapfilter,true);
} }
// Options
$this->writeln('');
$this->writeln('== OPTIONS ==========================================');
$results = $this->ldap->search("type=Option", ['cn','description','gidNumber'], $this->ldap_basedn);
foreach($results as $result) {
$cn=$result["cn"];
$ldapfilter="(|(&(type=Option)(cn=$cn))(&(type=Equipe)(cn=profs-$cn))(&(ENTPersonProfils=Administratif)(divcod=$cn)))";
$label="OPTION = ".$result["cn"];
$this->writeln(" - $label");
if(!$simulate) $this->addmodGroup($label,$ldapfilter,true);
}
// Groupes
$this->writeln('');
$this->writeln('== GROUPES ==========================================');
$results = $this->ldap->search("type=Groupe", ['cn','description','gidNumber'], $this->ldap_basedn);
foreach($results as $result) {
$cn=$result["cn"];
$ldapfilter="(&(type=Groupe)(cn=$cn))";
$label="GROUPE = ".$result["cn"];
$this->writeln(" - $label");
if(!$simulate) $this->addmodGroup($label,$ldapfilter,true);
}
} }
$this->writeln(''); $this->writeln('');
@ -620,7 +647,7 @@ class SynchroCommand extends Command
$criteria = '(cn=*)'; $criteria = '(cn=*)';
$subbranch=$baseGroup; $subbranch=$baseGroup;
$results = $this->search($criteria, array('cn'), $subbranch); $results = $this->ldap->search($criteria, array('cn'), $subbranch);
foreach($results as $result) { foreach($results as $result) {
$data = $this->em->getRepository('CadolesCoreBundle:Group')->findBy(array('label' => $result["cn"])); $data = $this->em->getRepository('CadolesCoreBundle:Group')->findBy(array('label' => $result["cn"]));
if($data) $this->writeln(' - Existe dans bundle >> '.$result["cn"]); if($data) $this->writeln(' - Existe dans bundle >> '.$result["cn"]);

View File

@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES
(-100, 'DRAAF', '130007107'); (-100, 'DRAAF', '130007107');
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}kiCU5m1uSvZhdgI1Ga9gdq/8HUBjSIpX (-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}wVosXEVYfrthFQKc0AqqOtZZXDWT3re1
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); ', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');

View File

@ -317,6 +317,9 @@ class ConfigController extends Controller
$fields["role"]["perm"]=1; $fields["role"]["perm"]=1;
$fields["role"]["label"]="Rôles"; $fields["role"]["label"]="Rôles";
$fields["telephonenumber"]["perm"]=1;
$fields["telephonenumber"]["label"]="Téléphone";
} }
else { else {
$fields=json_decode($fields, true); $fields=json_decode($fields, true);

View File

@ -76,6 +76,7 @@ class CoreController extends Controller
foreach($fields as $key => $field) { foreach($fields as $key => $field) {
// Si champs obligatoire // Si champs obligatoire
if($field["perm"]==2) { if($field["perm"]==2) {
dump($key);
switch($key) { switch($key) {
case "firstname": if($user->getFirstname()=="") $toprofil=true; break; case "firstname": if($user->getFirstname()=="") $toprofil=true; break;
case "visible": if($user->getVisible()=="") $toprofil=true; break; case "visible": if($user->getVisible()=="") $toprofil=true; break;
@ -93,12 +94,13 @@ class CoreController extends Controller
case "birthcountry": if($user->getBirthcountry()=="") $toprofil=true; break; case "birthcountry": if($user->getBirthcountry()=="") $toprofil=true; break;
case "birthplace": if($user->getBirthplace()=="") $toprofil=true; break; case "birthplace": if($user->getBirthplace()=="") $toprofil=true; break;
} }
dump($toprofil);
} }
} }
} }
if($toprofil) { if($toprofil) {
return $this->redirect($this->generateUrl('cadoles_core_profil',array("info"=>"Merci de compléter votre profil"))); return $this->redirect($this->generateUrl('cadoles_core_user',array("info"=>"Merci de compléter votre profil")));
} }
} }

View File

@ -188,7 +188,7 @@ class GroupController extends Controller
$userinfo=""; $userinfo="";
if($data->getOwner()) { if($data->getOwner()) {
$userinfo.="<img src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getOwner()->getAvatar()."' class='avatar' style='margin:0px 5px 0px 0px;display:inline-block;'>"; $userinfo.="<img style='cursor:pointer' onClick='seeUser(".$data->getOwner()->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getOwner()->getAvatar()."' class='avatar' style='margin:0px 5px 0px 0px;display:inline-block;'>";
$userinfo.=$data->getOwner()->getUsername(); $userinfo.=$data->getOwner()->getUsername();
} }
@ -331,7 +331,7 @@ class GroupController extends Controller
$fgmanager="<input type='checkbox' class='switch' onChange='switchManager(".$data->getId().");'>"; $fgmanager="<input type='checkbox' class='switch' onChange='switchManager(".$data->getId().");'>";
// Avatar // Avatar
$avatar="<img src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;'>"; $avatar="<img onClick='seeUser(".$data->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;cursor:pointer;'>";
array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$fgmanager)); array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$fgmanager));
} }
@ -463,7 +463,7 @@ class GroupController extends Controller
$action.="<a style='cursor:pointer' onClick='delUsers(".$data->getId().")'><i class='fa fa-minus fa-fw'></i></a>"; $action.="<a style='cursor:pointer' onClick='delUsers(".$data->getId().")'><i class='fa fa-minus fa-fw'></i></a>";
// Avatar // Avatar
$avatar="<img src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;'>"; $avatar="<img onClick='seeUser(".$data->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;cursor:pointer'>";
// Flag manager // Flag manager
$fgmanager=""; $fgmanager="";

View File

@ -54,6 +54,7 @@ class RestController extends Controller
$output["bookmarks"] = []; $output["bookmarks"] = [];
$output["items"] = []; $output["items"] = [];
$output["itemcategorys"] = []; $output["itemcategorys"] = [];
$output["groups"] = [];
$bookmarks=null; $bookmarks=null;
$items=null; $items=null;
@ -61,6 +62,7 @@ class RestController extends Controller
$weburl="https://".$this->getParameter("weburl")."/".$this->getParameter("alias")."/"; $weburl="https://".$this->getParameter("weburl")."/".$this->getParameter("alias")."/";
$em->getRepository("CadolesPortalBundle:Item")->getUserItems($user,$bookmarks,$items,$itemcategorys,null,3); $em->getRepository("CadolesPortalBundle:Item")->getUserItems($user,$bookmarks,$items,$itemcategorys,null,3);
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$entity,$pagesuser,$pagesadmin,$groupsshared);
// Construction de la réponse // Construction de la réponse
$output["user"]["firstname"] = $user->getFirstname(); $output["user"]["firstname"] = $user->getFirstname();
@ -69,6 +71,7 @@ class RestController extends Controller
$output["user"]["avatar"] = $weburl."uploads/avatar/".$user->getAvatar(); $output["user"]["avatar"] = $weburl."uploads/avatar/".$user->getAvatar();
$output["user"]["niveau01"] = $user->getNiveau01()->getLabel(); $output["user"]["niveau01"] = $user->getNiveau01()->getLabel();
$output["user"]["niveau02"] = ($user->getNiveau02()?$user->getNiveau02()->getLabel():null); $output["user"]["niveau02"] = ($user->getNiveau02()?$user->getNiveau02()->getLabel():null);
$output["user"]["role"] = $user->getRole();
if($bookmarks) { if($bookmarks) {
foreach($bookmarks as $bookmark) { foreach($bookmarks as $bookmark) {
@ -114,6 +117,16 @@ class RestController extends Controller
} }
} }
if($groupsshared) {
foreach($groupsshared as $groupshared) {
$tmp=[];
$tmp["id"] = $groupshared->getId();
$tmp["title"] = $groupshared->getLabel();
array_push($output["groups"],$tmp);
}
}
// Retour // Retour

View File

@ -65,71 +65,92 @@ class UserController extends Controller
$draw= $request->query->get('draw'); $draw= $request->query->get('draw');
$order= $request->query->get('order'); $order= $request->query->get('order');
$viewniveau02=$this->getParameter('viewniveau02'); $viewniveau02=$this->getParameter('viewniveau02');
$fields=$this->getDefaultDatauser();
$fgusevisible=!($fields["visible"]["perm"]==0);
// Nombre total d'enregistrement // Nombre total d'enregistrement
if($this->isGranted('ROLE_ADMIN')||$access=="user") if($access=="config") {
$total = $em->createQueryBuilder()->select('COUNT(user)')->from($this->labelentity,'user')->getQuery()->getSingleScalarResult(); if($this->isGranted('ROLE_ADMIN')) {
elseif($this->isGranted('ROLE_MODO')) { $total = $em->createQueryBuilder()->select('COUNT(user)')->from($this->labelentity,'user')->getQuery()->getSingleScalarResult();
$usermodo=$this->get('security.token_storage')->getToken()->getUser()->getId(); }
$total = $em->createQueryBuilder() elseif($this->isGranted('ROLE_MODO')) {
->select('COUNT(user)') $usermodo=$this->get('security.token_storage')->getToken()->getUser()->getId();
->from($this->labelentity,'user') $total = $em->createQueryBuilder()
->from("CadolesCoreBundle:UserModo",'usermodo') ->select('COUNT(user)')
->where("usermodo.niveau01 = user.niveau01") ->from($this->labelentity,'user')
->andWhere("usermodo.user = :userid") ->from("CadolesCoreBundle:UserModo",'usermodo')
->setParameter("userid", $usermodo) ->where("usermodo.niveau01 = user.niveau01")
->getQuery()->getSingleScalarResult(); ->andWhere("usermodo.user = :userid")
->setParameter("userid", $usermodo)
->getQuery()->getSingleScalarResult();
}
} }
elseif($this->isGranted('ROLE_ANIM')||$this->isGranted('ROLE_USER')) { else {
$niveau01=$this->get('security.token_storage')->getToken()->getUser()->getNiveau01(); if($fgusevisible) {
$total = $em->createQueryBuilder() $total = $em->createQueryBuilder()->select('COUNT(user)')->from($this->labelentity,'user')->where('user.visible=true')->getQuery()->getSingleScalarResult();
->select('COUNT(user)') }
->from($this->labelentity,'user') else {
->where("user.niveau01 = :niveau01") $total = $em->createQueryBuilder()->select('COUNT(user)')->from($this->labelentity,'user')->getQuery()->getSingleScalarResult();
->setParameter("niveau01", $niveau01) }
->getQuery()->getSingleScalarResult();
} }
// Nombre d'enregistrement filtré // Nombre d'enregistrement filtré
if($search["value"]=="") if($search["value"]=="")
$totalf = $total; $totalf = $total;
else { else {
if($this->isGranted('ROLE_ADMIN')||$access=="user") if($access=="config") {
$totalf= $em->createQueryBuilder() if($this->isGranted('ROLE_ADMIN')) {
->select('COUNT(user)') $totalf= $em->createQueryBuilder()
->from('CadolesCoreBundle:User','user') ->select('COUNT(user)')
->from('CadolesCoreBundle:Niveau01', 'niveau01') ->from('CadolesCoreBundle:User','user')
->where('user.niveau01=niveau01.id') ->from('CadolesCoreBundle:Niveau01', 'niveau01')
->andWhere('user.username LIKE :value OR user.firstname LIKE :value OR user.lastname LIKE :value OR user.email LIKE :value OR user.role LIKE :value OR niveau01.label LIKE :value') ->where('user.niveau01=niveau01.id')
->setParameter("value", "%".$search["value"]."%") ->andWhere('user.username LIKE :value OR user.firstname LIKE :value OR user.lastname LIKE :value OR user.email LIKE :value OR user.role LIKE :value OR niveau01.label LIKE :value')
->getQuery() ->setParameter("value", "%".$search["value"]."%")
->getSingleScalarResult(); ->getQuery()
elseif($this->isGranted('ROLE_MODO')) ->getSingleScalarResult();
$totalf= $em->createQueryBuilder() }
->select('COUNT(user)') elseif($this->isGranted('ROLE_MODO')) {
->from('CadolesCoreBundle:User','user') $totalf= $em->createQueryBuilder()
->from('CadolesCoreBundle:Niveau01', 'niveau01') ->select('COUNT(user)')
->from('CadolesCoreBundle:UserModo', 'usermodo') ->from('CadolesCoreBundle:User','user')
->where('user.niveau01=niveau01.id') ->from('CadolesCoreBundle:Niveau01', 'niveau01')
->andWhere('user.username LIKE :value OR user.firstname LIKE :value OR user.lastname LIKE :value OR user.email LIKE :value OR user.role LIKE :value OR niveau01.label LIKE :value') ->from('CadolesCoreBundle:UserModo', 'usermodo')
->andwhere("usermodo.niveau01 = user.niveau01") ->where('user.niveau01=niveau01.id')
->andWhere("usermodo.user = :userid") ->andWhere('user.username LIKE :value OR user.firstname LIKE :value OR user.lastname LIKE :value OR user.email LIKE :value OR user.role LIKE :value OR niveau01.label LIKE :value')
->setParameter("userid", $usermodo) ->andwhere("usermodo.niveau01 = user.niveau01")
->setParameter("value", "%".$search["value"]."%") ->andWhere("usermodo.user = :userid")
->getQuery() ->setParameter("userid", $usermodo)
->getSingleScalarResult(); ->setParameter("value", "%".$search["value"]."%")
elseif($this->isGranted('ROLE_ANIM')||$this->isGranted('ROLE_USER')) ->getQuery()
$totalf= $em->createQueryBuilder() ->getSingleScalarResult();
->select('COUNT(user)') }
->from('CadolesCoreBundle:User','user') }
->from('CadolesCoreBundle:Niveau01', 'niveau01') else {
->where('user.niveau01=niveau01.id') if($fgusevisible) {
->andWhere('user.username LIKE :value OR user.firstname LIKE :value OR user.lastname LIKE :value OR user.email LIKE :value OR user.role LIKE :value OR niveau01.label LIKE :value') $totalf= $em->createQueryBuilder()
->andWhere("user.niveau01 = :niveau01") ->select('COUNT(user)')
->setParameter("niveau01", $niveau01) ->from('CadolesCoreBundle:User','user')
->setParameter("value", "%".$search["value"]."%") ->from('CadolesCoreBundle:Niveau01', 'niveau01')
->getQuery() ->where('user.niveau01=niveau01.id')
->getSingleScalarResult(); ->andWhere('user.visible=true')
->andWhere('user.username LIKE :value OR user.firstname LIKE :value OR user.lastname LIKE :value OR user.email LIKE :value OR user.role LIKE :value OR niveau01.label LIKE :value')
->setParameter("value", "%".$search["value"]."%")
->getQuery()
->getSingleScalarResult();
}
else {
$totalf= $em->createQueryBuilder()
->select('COUNT(user)')
->from('CadolesCoreBundle:User','user')
->from('CadolesCoreBundle:Niveau01', 'niveau01')
->where('user.niveau01=niveau01.id')
->andWhere('user.username LIKE :value OR user.firstname LIKE :value OR user.lastname LIKE :value OR user.email LIKE :value OR user.role LIKE :value OR niveau01.label LIKE :value')
->setParameter("value", "%".$search["value"]."%")
->getQuery()
->getSingleScalarResult();
}
}
} }
// Construction du tableau de retour // Construction du tableau de retour
@ -142,22 +163,23 @@ class UserController extends Controller
// Parcours des Enregistrement // Parcours des Enregistrement
$qb = $em->createQueryBuilder(); $qb = $em->createQueryBuilder();
if($this->isGranted('ROLE_ADMIN')||$access=="user") { if($access=="config") {
if($this->isGranted('ROLE_ADMIN')) {
$qb->select('user')->from($this->labelentity,'user')->from('CadolesCoreBundle:Niveau01','niveau01');
$qb->where('user.niveau01=niveau01.id');
}
elseif($this->isGranted('ROLE_MODO')) {
$qb->select('user')->from($this->labelentity,'user')->from('CadolesCoreBundle:Niveau01','niveau01')->from('CadolesCoreBundle:UserModo', 'usermodo');
$qb->where('user.niveau01=niveau01.id')
->andwhere("usermodo.niveau01 = user.niveau01")
->andWhere("usermodo.user = :userid")
->setParameter("userid", $usermodo);
}
}
else {
$qb->select('user')->from($this->labelentity,'user')->from('CadolesCoreBundle:Niveau01','niveau01'); $qb->select('user')->from($this->labelentity,'user')->from('CadolesCoreBundle:Niveau01','niveau01');
$qb->where('user.niveau01=niveau01.id'); $qb->where('user.niveau01=niveau01.id');
} if($fgusevisible) $qb->andWhere('user.visible=true');
elseif($this->isGranted('ROLE_MODO')) {
$qb->select('user')->from($this->labelentity,'user')->from('CadolesCoreBundle:Niveau01','niveau01')->from('CadolesCoreBundle:UserModo', 'usermodo');
$qb->where('user.niveau01=niveau01.id')
->andwhere("usermodo.niveau01 = user.niveau01")
->andWhere("usermodo.user = :userid")
->setParameter("userid", $usermodo);
}
elseif($this->isGranted('ROLE_ANIM')||$this->isGranted('ROLE_USER')) {
$qb->select('user')->from($this->labelentity,'user')->from('CadolesCoreBundle:Niveau01','niveau01');
$qb->where('user.niveau01=niveau01.id')
->andwhere("user.niveau01 = :niveau01")
->setParameter("niveau01", $niveau01);
} }
if($search["value"]!="") { if($search["value"]!="") {
@ -184,10 +206,14 @@ class UserController extends Controller
break; break;
case 6 : case 6 :
$qb->orderBy('user.telephonenumber',$order[0]["dir"]);
break;
case 7 :
$qb->orderBy('niveau01.label',$order[0]["dir"]); $qb->orderBy('niveau01.label',$order[0]["dir"]);
break; break;
case 9 : case 10 :
$qb->orderBy('user.role',$order[0]["dir"]); $qb->orderBy('user.role',$order[0]["dir"]);
break; break;
} }
@ -211,10 +237,14 @@ class UserController extends Controller
break; break;
case 5 : case 5 :
$qb->orderBy('user.telephonenumber',$order[0]["dir"]);
break;
case 6 :
$qb->orderBy('niveau01.label',$order[0]["dir"]); $qb->orderBy('niveau01.label',$order[0]["dir"]);
break; break;
case 7 : case 8 :
$qb->orderBy('user.role',$order[0]["dir"]); $qb->orderBy('user.role',$order[0]["dir"]);
break; break;
} }
@ -240,11 +270,12 @@ class UserController extends Controller
$tmp=array(); $tmp=array();
if($access=="config") array_push($tmp,$action); if($access=="config") array_push($tmp,$action);
array_push($tmp,"<img src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' class='avatar' style='margin:auto;display:block;'>"); array_push($tmp,"<img style='cursor:pointer' onClick='seeUser(".$data->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' class='avatar' style='margin:auto;display:block;'>");
array_push($tmp,$data->getUsername()); array_push($tmp,$data->getUsername());
array_push($tmp,$data->getLastname()); array_push($tmp,$data->getLastname());
array_push($tmp,$data->getFirstname()); array_push($tmp,$data->getFirstname());
array_push($tmp,"<a href='mailto:".$data->getEmail()."'>".$data->getEmail()."</a>"); array_push($tmp,"<a href='mailto:".$data->getEmail()."'>".$data->getEmail()."</a>");
array_push($tmp,$data->getTelephonenumber());
array_push($tmp,$data->getNiveau01()->getLabel()); array_push($tmp,$data->getNiveau01()->getLabel());
if($viewniveau02) array_push($tmp,($data->getNiveau02()!==null?$data->getNiveau02()->getLabel():"")); if($viewniveau02) array_push($tmp,($data->getNiveau02()!==null?$data->getNiveau02()->getLabel():""));
array_push($tmp,$groups); array_push($tmp,$groups);
@ -704,7 +735,17 @@ class UserController extends Controller
return $this->updateAction($user->getId(),"user",$request); return $this->updateAction($user->getId(),"user",$request);
} }
public function viewAction($id, Request $request)
{
$user=$this->getData($id);
return $this->render('CadolesCoreBundle:User:view.html.twig', [
'useheader' => false,
'usemenu' => false,
'usesidebar' => false,
"user" => $user
]);
}
public function importuserAction(Request $request) { public function importuserAction(Request $request) {
if($this->GetParameter("masteridentity")!="SQL") if($this->GetParameter("masteridentity")!="SQL")

View File

@ -265,6 +265,10 @@ cadoles_core_user_users:
path: /user/users path: /user/users
defaults: { _controller: CadolesCoreBundle:User:list, access: user } defaults: { _controller: CadolesCoreBundle:User:list, access: user }
cadoles_core_user_view:
path: /user/view/{id}
defaults: { _controller: CadolesCoreBundle:User:view }
#== Niveau01 ============================================================================================================= #== Niveau01 =============================================================================================================
cadoles_core_config_niveau01: cadoles_core_config_niveau01:

View File

@ -128,3 +128,6 @@ services:
cadoles.saml_attribute_mapper: cadoles.saml_attribute_mapper:
public: true public: true
class: Cadoles\CoreBundle\Service\samlAttributeMapperService class: Cadoles\CoreBundle\Service\samlAttributeMapperService

View File

@ -603,6 +603,7 @@ a.item-heart {
position: absolute; position: absolute;
margin-left:50px; margin-left:50px;
cursor: pointer; cursor: pointer;
font-size: 1.5vw;
} }
.widgetheader iframe, .widgetheader iframe,
@ -619,6 +620,12 @@ a.item-heart {
height:100%; height:100%;
} }
@media (max-width: 991px) {
.widgetheader .title {
font-size: 25px;
}
}
/*== FEED ===============================================================================================================================================*/ /*== FEED ===============================================================================================================================================*/
.cat-list-feed { .cat-list-feed {

View File

@ -3,24 +3,97 @@
// Instance the tour // Instance the tour
function MyTour() { function MyTour() {
var template="<div class='popover tour' style='max-width:500px !important;'><div class='arrow'></div><h3 class='popover-title'></h3><div class='popover-content'></div><div class='popover-navigation'><button class='btn btn-sm btn-default' data-role='prev'>« Prec</button><button class='btn btn-sm btn-default' data-role='next'>Suiv »</button><button class='btn btn-sm btn-default' data-role='end'>Fin</button></div></div>";
var tour = new Tour({ var tour = new Tour({
name: "tour",
template: template,
steps: [ steps: [
{ {
element: "#logo", element: "#logo",
title: "Transnum", title: "Transnum",
content: "Bienvenue sur le portail TRANSNUM" content: "Bienvenue sur le portail TRANSNUM"
}, },
{ {
element: "#menu-profil", element: "#menu-profil",
title: "Votre Profil", title: "Votre Profil",
content: "Vous pouvez modifier les informations vous concernant à cet emplacement" placement : "left",
}, content: "Vous pouvez modifier les informations vous concernant à cet emplacement. A droite du bouton 'profil', vous trouvez le bouton vous permettant de vous déconnecter du portail"
{ },
element: "#menu-annuaire", {
title: "Annuaire", element: "#menu-notice",
content: "Vous pouvez recherche un utilisateur parmis l'annuaire du portail" title: "Charte utilisateur",
} placement : "left",
]}); content: "Vous pouvez consulter ici la charte d'utilisation du portail qui précise les conditions que vous vous engagez à respecter notamment en termes de sécurité et de protection des données"
},
{
element: "#menu-group",
title: "Vos Groupes",
placement : "left",
content: "Vous accédez ici aux groupes auxquels vous êtes inscrits"
},
{
element: "#menu-annuaire",
title: "Annuaire",
placement : "left",
content: "Vous pouvez rechercher un utilisateur dans l'annuaire du portail"
},
{
element: "#appmenu",
title: "Barre de navigation rapide",
placement : "bottom",
content: "Cette barre vous permet d'accéder rapidement à la page d'accueil et à vos groupes de travail"
},
{
element: $("iframe").first().contents().find(".widget-itemessential").find(".widgetheader"),
title: "le Bureau",
placement : "right",
content: "Dans le premier panneau d'outils ci-dessous, vous trouvez les applications qui vous sont proposées. En cliquant sur le bouton '+', vous avez accès à d'autres applications",
container: $("iframe").first().contents().find("body")
},
{
element: $("iframe").first().contents().find(".widget-group").find(".widgetheader"),
title: "Mes Groupes de travail",
placement : "right",
content: "Dans le 2nd panneau d'outils ci-dessous, vous trouvez les 'groupes de travail' auxquels vous avez été invités et ceux que vous avez créés. En cliquant sur le bouton '+', vous pouvez créer un groupe de travail. ",
container: $("iframe").first().contents().find("body")
},
{
element: $("iframe").first().contents().find(".widget-blog").find(".widgetheader"),
title: "Journaux des groupes",
placement : "right",
content: "Dans le 3ème panneau d'outils ci-dessous, vous trouvez les 'Journaux des Groupes' auxquels vous avez été invités et ceux que vous avez créés. ",
container: $("iframe").first().contents().find("body")
},
{
element: $("iframe").first().contents().find(".widget-alert").find(".widgetheader"),
title: "Radio Transnum",
placement : "left",
content: "Dans le premier panneau de droite ci-dessous, vous trouvez les annonces et nouvelles qui concernent tous les membres du portail. ",
container: $("iframe").first().contents().find("body")
},
{
element: $("iframe").first().contents().find(".widget-groupmessage").find(".widgetheader"),
title: "Actualités des groupes",
placement : "left",
content: "Dans le 2nd panneau de droite ci-dessous, vous trouvez les annonces et nouvelles qui vous concernent uniquement comme membre de groupes. ",
container: $("iframe").first().contents().find("body")
},
{
element: $("iframe").first().contents().find(".widget-calendar").find(".widgetheader"),
title: "Agenda des groupes",
placement : "left",
content: "Dans le troisième panneau de droite ci-dessous, vous trouvez les prochains évènements de vos agendas de groupes. ",
container: $("iframe").first().contents().find("body")
},
{
element: $("iframe").first().contents().find(".widget-appexternal").find(".widgetheader"),
placement : "left",
title: "Formulaires",
content: "Dans le dernier panneau de droite ci-dessous, vous trouvez les formulaires qui sont mis à votre disposition pour effectuer des demandes (par exemple faire un 'ticket de support'). ",
container: $("iframe").first().contents().find("body")
}
]
});
// Initialize the tour // Initialize the tour
tour.init(); tour.init();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -1,5 +1,5 @@
.widgetheader .title { .widgetheader .title {
font-size: 25px; font-size: 1.2vw;
} }
@ -39,7 +39,7 @@ body.simple {
.widget-bordered { .widget-bordered {
border: none !important; border: none !important;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); /* box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);*/
background-color: transparent; background-color: transparent;
border-radius: 10px; border-radius: 10px;
} }
@ -59,20 +59,9 @@ body.simple {
} }
.widget-notbordered .widgetheader {
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.widget-notbordered .widgetbody .list-item, .widget-notbordered .widgetbody .grid-item-content {
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.grid .grid-preview { .grid .grid-preview {
width: 15%; width: 15%;
min-width: 160px; min-width: 138px;
} }
.grid .grid-preview .grid-item-title { .grid .grid-preview .grid-item-title {
@ -95,3 +84,9 @@ body.simple {
border-radius: 10px; border-radius: 10px;
margin-bottom: 5px; margin-bottom: 5px;
} }
@media (max-width: 991px) {
.widgetheader .title {
font-size: 25px;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -91,6 +91,17 @@
{% endif %} {% endif %}
<script> <script>
function seeUser(id) {
{% if app.user %}
$("#mymodal").find(".modal-title").html("FICHE UTILISATEUR");
var url="{{ path('cadoles_core_user_view',{id:'xx'}) }}";
url=url.replace('xx',id);
$("#mymodal").find("#framemodal").attr("src",url);
$("#mymodal").modal().show();
{% endif %}
}
function inIframe () { function inIframe () {
try { try {
return window.self !== window.top; return window.self !== window.top;

View File

@ -32,6 +32,7 @@
<th class="{% if fields["lastname"] is defined and fields["lastname"].perm==0 %}no-visible{% endif %}">Nom</th> <th class="{% if fields["lastname"] is defined and fields["lastname"].perm==0 %}no-visible{% endif %}">Nom</th>
<th class="{% if fields["firstname"] is defined and fields["firstname"].perm==0 %}no-visible{% endif %}">Prénom</th> <th class="{% if fields["firstname"] is defined and fields["firstname"].perm==0 %}no-visible{% endif %}">Prénom</th>
<th class="{% if fields["email"] is defined and fields["email"].perm==0 %}no-visible{% endif %}">Email</th> <th class="{% if fields["email"] is defined and fields["email"].perm==0 %}no-visible{% endif %}">Email</th>
<th class="{% if fields["telephonenumber"] is defined and fields["telephonenumber"].perm==0 %}no-visible{% endif %}">Téléphone</th>
<th class="{% if fields["niveau01"] is defined and fields["niveau01"].perm==0 %}no-visible{% endif %}">{{ labelniveau01 }}</th> <th class="{% if fields["niveau01"] is defined and fields["niveau01"].perm==0 %}no-visible{% endif %}">{{ labelniveau01 }}</th>
{% if viewniveau02 %} {% if viewniveau02 %}
<th class="no-sort {% if fields["niveau02"] is defined and fields["niveau02"].perm==0 %}no-visible{% endif %}">{{ labelniveau02 }}</th> <th class="no-sort {% if fields["niveau02"] is defined and fields["niveau02"].perm==0 %}no-visible{% endif %}">{{ labelniveau02 }}</th>

View File

@ -0,0 +1,41 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
<div style='margin-auto; text-align:center'>
{% if not app.user %}
Vous n'êtes pas autorisé à visualiser les fiches utilisateurs
{% else %}
<br><img id="user_avatar_img" src="/{{ alias }}/uploads/avatar/{{ user.avatar }}" class="avatar big" ><br>
<b>Login</b> = {{ user.username }}<br>
{% if not user.visible %}
<br>L'utilisateur souhaite masquer ses informations personnelles.
{% else %}
{%if user.lastname %}<b>Nom</b> = {{ user.lastname }}<br>{%endif%}
{%if user.firstname %}<b>Prénom</b> = {{ user.firstname }}<br>{%endif%}
{%if user.email %}<b>Email</b> = <a href='mailto:{{ user.email }}'>{{ user.email }}</a><br>{%endif%}
{%if user.telephonenumber %}<b>Téléphone</b> = {{ user.telephonenumber }}<br>{%endif%}
{%if user.niveau01 %}<b>{{ labelniveau01 }}</b> = {{ user.niveau01.label }}<br>{%endif%}
{%if viewniveau02 and user.niveau02%}<b>{{ labelniveau02 }}</b> = {{ user.niveau02.label }}<br>{% endif %}
{%if user.job %}<b>Métier</b> = {{ user.job }}<br>{%endif%}
{%if user.position %}<b>Fonction</b> = {{ user.position }}<br>{%endif%}
{%if user.postaladress %}<b>Adresse</b> = {{ user.postaladress }}<br><br>{%endif%}
{% set fgtitle=false %}
{% for usergroup in user.groups %}
{% if usergroup.group.fgcanshare %}
{% if not fgtitle %}
<br><b>Groupes de Travail</b><br>
{% set fgtitle=true %}
{% endif %}
{{ usergroup.group.label }}<br>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
</div>
{% endblock %}
{% block localjavascript %}
{% endblock %}

View File

@ -133,7 +133,7 @@
<div id="page-wrapper" class="{% if maxwidth is defined and maxwidth %} page-maxed {% endif %}" style="min-height:1200px; {% if not usesidebar %} margin:0px; {% endif %}{% if not useheader %} background-color:transparent; padding: 5px 25px 10px 15px; {% endif %} "> <div id="page-wrapper" class="{% if maxwidth is defined and maxwidth %} page-maxed {% endif %}" style="min-height:1200px; {% if not usesidebar %} margin:0px; {% endif %}{% if not useheader %} background-color:transparent; {% endif %} ">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
{% block pagewrapper %} {% block pagewrapper %}

View File

@ -48,8 +48,6 @@ class CronCommand extends ContainerAwareCommand
return 0; return 0;
} }
$this->filesystem->appendToFile($this->rootlog.'cron.lock', "lock");
$crons = $entityManager->getRepository('CadolesCronBundle:Cron')->toexec(); $crons = $entityManager->getRepository('CadolesCronBundle:Cron')->toexec();
$i=0; $i=0;
@ -65,9 +63,22 @@ class CronCommand extends ContainerAwareCommand
$this->writeln ('Date = '.$now->format('Y-m-d H:i:s')); $this->writeln ('Date = '.$now->format('Y-m-d H:i:s'));
} }
// Cas particulier de la synchro
// Dans la synchro il y a un clear du manager ce qui perturbe totalement le manager de Core:Exec
// Il pert le lien avec la boucle sur crons
// Alors si dans le cron il y a la synchro alors on n'execute que lui le reste sera executé lors du prochain passage
$cronsynchro=$entityManager->getRepository('CadolesCronBundle:Cron')->find(100);
if($cronsynchro&&in_array($cronsynchro,$crons)) {
$crons=[$cronsynchro];
}
foreach($crons as $cron) { foreach($crons as $cron) {
$i++; $i++;
// Id du cron
$idcron = $cron->getId();
// Flag d'execution en cours // Flag d'execution en cours
$now=new \DateTime(); $now=new \DateTime();
$cron->setStartexecdate($now); $cron->setStartexecdate($now);
@ -96,6 +107,10 @@ class CronCommand extends ContainerAwareCommand
// Executer la commande // Executer la commande
try{ try{
$returnCode = $command->run($parameter, $output); $returnCode = $command->run($parameter, $output);
// Revenir sur le cron encours à cause du clear du manager présent dans la synchro
// Sinon le manager se pomme et génère des nouveaux enregistrement plutot que mettre à jour celui en cours
$cron=$entityManager->getRepository('CadolesCronBundle:Cron')->find($idcron);
} }
catch(\Exception $e) { catch(\Exception $e) {
$this->writelnred("JOB EN ERREUR"); $this->writelnred("JOB EN ERREUR");

View File

@ -42,6 +42,11 @@ class InitDataCommand extends ContainerAwareCommand
} }
protected function insertCron() { protected function insertCron() {
$metadata = $this->entityManager->getClassMetaData('CadolesCronBundle:Cron');
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);
$metadata->setIdGenerator(new AssignedGenerator());
// Job Mail // Job Mail
// Toute les minutes // Toute les minutes
$entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1); $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(1);
@ -60,11 +65,6 @@ class InitDataCommand extends ContainerAwareCommand
} }
// afin de forcer les ID sur certaines entités
$metadata = $this->entityManager->getClassMetaData(get_class($entity));
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);
$metadata->setIdGenerator(new AssignedGenerator());
// Job synchronisation des comptes utilisateur // Job synchronisation des comptes utilisateur
// Toute les 24h à 3h00 // Toute les 24h à 3h00
$entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(100); $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(100);
@ -83,7 +83,6 @@ class InitDataCommand extends ContainerAwareCommand
$entity->setJsonargument('{"simulate":"false"}'); $entity->setJsonargument('{"simulate":"false"}');
$this->entityManager->persist($entity); $this->entityManager->persist($entity);
} }
// Job purge des registrations obsolètes // Job purge des registrations obsolètes
// Toute les 5mn // Toute les 5mn
$entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(110); $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(110);
@ -99,7 +98,6 @@ class InitDataCommand extends ContainerAwareCommand
$entity->setNextexecdate($entity->getSubmitdate()); $entity->setNextexecdate($entity->getSubmitdate());
$this->entityManager->persist($entity); $this->entityManager->persist($entity);
} }
// Job de purge des fichiers obsolète // Job de purge des fichiers obsolète
// Toute les 24h à 3h00 // Toute les 24h à 3h00
$entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(200); $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(200);
@ -117,7 +115,6 @@ class InitDataCommand extends ContainerAwareCommand
$entity->setNextexecdate($nextdate); $entity->setNextexecdate($nextdate);
$this->entityManager->persist($entity); $this->entityManager->persist($entity);
} }
// CRON PORTAIL // CRON PORTAIL
// Job purge des registrations obsolètes // Job purge des registrations obsolètes
// Toute les 5mn // Toute les 5mn
@ -139,7 +136,6 @@ class InitDataCommand extends ContainerAwareCommand
elseif($entity&&!($portal_activate||$calendar_activate)) { elseif($entity&&!($portal_activate||$calendar_activate)) {
$this->entityManager->remove($entity); $this->entityManager->remove($entity);
} }
// Job de récupération des sondages Limesurvey // Job de récupération des sondages Limesurvey
// Toute les 6h // Toute les 6h
$activate_widlimesurvey = $this->getContainer()->getParameter('activate_widlimesurvey'); $activate_widlimesurvey = $this->getContainer()->getParameter('activate_widlimesurvey');
@ -161,7 +157,6 @@ class InitDataCommand extends ContainerAwareCommand
elseif($entity&&!$activate_widlimesurvey) { elseif($entity&&!$activate_widlimesurvey) {
$this->entityManager->remove($entity); $this->entityManager->remove($entity);
} }
// Job de récupération des cours Moodle // Job de récupération des cours Moodle
// Toute les 6h // Toute les 6h
$activate_widmoodle = $this->getContainer()->getParameter('activate_widmoodle'); $activate_widmoodle = $this->getContainer()->getParameter('activate_widmoodle');
@ -183,7 +178,6 @@ class InitDataCommand extends ContainerAwareCommand
elseif($entity&&!$activate_widmoodle) { elseif($entity&&!$activate_widmoodle) {
$this->entityManager->remove($entity); $this->entityManager->remove($entity);
} }
$this->entityManager->flush(); $this->entityManager->flush();
} }
} }

View File

@ -428,6 +428,7 @@ class PagewidgetController extends Controller
// Récupération des paramétres du widget // Récupération des paramétres du widget
$modedesktop=0; $modedesktop=0;
$iditemcategory=null; $iditemcategory=null;
$withbookmark=true;
$search=false; $search=false;
$menu=false; $menu=false;
$menuall=true; $menuall=true;
@ -1974,15 +1975,17 @@ class PagewidgetController extends Controller
$mygroups=[]; $mygroups=[];
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared); $this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared);
foreach($groupsshared as $groupshared) { if(is_array($groupsshared)) {
foreach($groupsshared as $groupshared) {
$title=$groupshared->getLabel(); $title=$groupshared->getLabel();
$idpage=$groupshared->pagesshared[0]->getId(); $idpage=$groupshared->pagesshared[0]->getId();
$icon=null; $icon=null;
if($groupshared->getIcon()) if($groupshared->getIcon())
$icon="/".$groupshared->getIcon()->getLabel(); $icon="/".$groupshared->getIcon()->getLabel();
array_push($mygroups,["title"=>$title,"icon"=>$icon,"id"=>$idpage]); array_push($mygroups,["title"=>$title,"icon"=>$icon,"id"=>$idpage]);
}
} }
// Render // Render

View File

@ -92,7 +92,7 @@
<a href="{{ path('cadoles_portal_'~access~'_blogarticle_view',{'id':blogarticle.id}) }}"> <a href="{{ path('cadoles_portal_'~access~'_blogarticle_view',{'id':blogarticle.id}) }}">
{% if blogarticle.image is not empty %} {% if blogarticle.image is not empty %}
<div class="grid-item-logo"> <div class="grid-item-logo">
<img class="grid-item-img" src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%"> <img class="grid-item-vignette" src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%">
</div> </div>
{% endif %} {% endif %}

View File

@ -56,6 +56,7 @@
<div class="col-md-4"> <div class="col-md-4">
{{ form_row(form.url) }} {{ form_row(form.url) }}
<em>le mot clé #login# sera remplacé par le login de l'utilisateur</em><br><br>
{{ form_row(form.target) }} {{ form_row(form.target) }}
{{ form_row(form.color) }} {{ form_row(form.color) }}

View File

@ -54,6 +54,7 @@
<div class="col-md-4"> <div class="col-md-4">
{{ form_row(form.url) }} {{ form_row(form.url) }}
<em>le mot clé #login# sera remplacé par le login de l'utilisateur</em><br><br>
{{ form_row(form.target) }} {{ form_row(form.target) }}
{{ form_row(form.itemcategory) }} {{ form_row(form.itemcategory) }}
{{ form_row(form.roles) }} {{ form_row(form.roles) }}

View File

@ -55,6 +55,7 @@
{{ form_row(form.name) }} {{ form_row(form.name) }}
{{ form_row(form.url) }} {{ form_row(form.url) }}
<em>le mot clé #login# sera remplacé par le login de l'utilisateur</em><br><br>
{{ form_row(form.roworder) }} {{ form_row(form.roworder) }}
{{ form_row(form.maxwidth) }} {{ form_row(form.maxwidth) }}
</div> </div>

View File

@ -5,6 +5,12 @@
#pageiframe { margin: 0px -30px;} #pageiframe { margin: 0px -30px;}
{% endblock %} {% endblock %}
{% if app.user %}
{% set username = app.user.username %}
{% else %}
{% set username = "" %}
{% endif %}
{% block pagewrapper %} {% block pagewrapper %}
{% if access=="config" %} {% if access=="config" %}
<div class="pagemenu"> <div class="pagemenu">
@ -16,7 +22,7 @@
{% endif %} {% endif %}
<div id="pageiframe" style="{% if entity.maxwidth>0%} max-width:{{ entity.maxwidth }}px; margin:auto; {% endif %}"> <div id="pageiframe" style="{% if entity.maxwidth>0%} max-width:{{ entity.maxwidth }}px; margin:auto; {% endif %}">
<iframe src="{{entity.url}}" id="frameContent" style="border:none;" width="100%" height="100%"></iframe> <iframe src="{{entity.url|replace({'#login#': username})}}" id="frameContent" style="border:none;" width="100%" height="100%"></iframe>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -12,7 +12,7 @@
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %} {% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
{% if canupdate or alerts|length>0 %} {% if canupdate or alerts|length>0 %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-alert" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>

View File

@ -26,7 +26,7 @@
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %} {% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-appexternal" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %} {% if canupdate or canadd %}
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}

View File

@ -18,7 +18,7 @@
</style> </style>
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-blog" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -60,7 +60,7 @@
<a href onClick="showFrameitem('blog','{{ path('cadoles_portal_'~access~'_blogarticle_view',{'id':blogarticle.id}) }}',true)"> <a href onClick="showFrameitem('blog','{{ path('cadoles_portal_'~access~'_blogarticle_view',{'id':blogarticle.id}) }}',true)">
{% if blogarticle.image is not empty %} {% if blogarticle.image is not empty %}
<div class="grid-item-logo"> <div class="grid-item-logo">
<img class="grid-item-img" src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%"> <img class="grid-item-vignette" src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%">
</div> </div>
{% endif %} {% endif %}

View File

@ -26,7 +26,14 @@
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %} {% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px"> {% if app.user %}
{% set username = app.user.username %}
{% else %}
{% set username = "" %}
{% endif %}
<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 %} {% if canupdate or canadd %}
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}
@ -64,11 +71,11 @@
{% endif %} {% endif %}
{% if bookmark.target == 'frame' %} {% if bookmark.target == 'frame' %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" style="cursor:pointer" onClick="showFrameitem('bookmark{{ bookmark.id }}','{{ bookmark.url }}')"> <a class="linktosonde" data-sonde="{{ bookmark.title }}" style="cursor:pointer" onClick="showFrameitem('bookmark{{ bookmark.id }}','{{ bookmark.url|replace({'#login#': username}) }}')">
{% elseif bookmark.target == "_self" %} {% elseif bookmark.target == "_self" %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.target }}{% endif %}"> <a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.target }}{% endif %}">
{% else %} {% else %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url }}" target="{{ bookmark.target }}"> <a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{{ bookmark.target }}">
{% endif %} {% endif %}
<div class="item-link clearfix"> <div class="item-link clearfix">

View File

@ -17,7 +17,7 @@
</style> </style>
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-calendar" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -30,7 +30,7 @@
{% if usage=="group" and firstcalendar is defined %} {% if usage=="group" and firstcalendar is defined %}
{% set url= path('cadoles_portal_'~access~'_calendar_view',{id:firstcalendar}) %} {% set url= path('cadoles_portal_'~access~'_calendar_view',{id:firstcalendar}) %}
{% endif %} {% endif %}
<a onClick="showFrameitem('calendar','{{url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-calendar fa-fw"></i></a> <a onClick="showFrameitem('calendar','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-calendar fa-fw"></i></a>
{% endif %} {% endif %}
</div> </div>
@ -68,7 +68,7 @@
<div style="margin-top:15px; font-weight:bold; font-size:18px;">{{ libday ~ " " ~ dateeventstart|date("d/m/Y") }}</div> <div style="margin-top:15px; font-weight:bold; font-size:18px;">{{ libday ~ " " ~ dateeventstart|date("d/m/Y") }}</div>
{% endif %} {% endif %}
<div class="widget-event" style="background-color:{{ event.color }}; color: #FFF; padding:2px;"> <div class="widget-event" style="background-color:{{ event.color }}; color: #FFF; padding:2px;" title="{{ event.description }}">
{% if not event.allDay %} {% if not event.allDay %}
{{ event.start | date("H:i") }} - {{ event.start | date("H:i") }} -
{%endif%} {%endif%}
@ -80,7 +80,9 @@
{% endfor %} {% endfor %}
{% if url is defined %}
<div style="cursor:pointer; text-align: right; margin-top:20px;"><a onClick="showFrameitem('calendar','{{url }}',true)" style="{{ stylewidgetbody }}">Voir mes Agendas</a></div> <div style="cursor:pointer; text-align: right; margin-top:20px;"><a onClick="showFrameitem('calendar','{{url }}',true)" style="{{ stylewidgetbody }}">Voir mes Agendas</a></div>
{% endif %}
</div> </div>
{% endif %} {% endif %}
</div> </div>

View File

@ -24,7 +24,7 @@
{% endif %} {% endif %}
{% if app.user %} {% if app.user %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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 %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>

View File

@ -24,7 +24,7 @@
{% set colorbodyfont = color['fontcolorhover'] %} {% set colorbodyfont = color['fontcolorhover'] %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-file" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %} {% if canupdate or canadd %}
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}

View File

@ -36,7 +36,7 @@
{% set stylegrid="grid-list" %} {% set stylegrid="grid-list" %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-flux" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>

View File

@ -22,7 +22,7 @@
{% set colorbodyfont = color['fontcolorhover'] %} {% set colorbodyfont = color['fontcolorhover'] %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-frame" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>

View File

@ -24,7 +24,7 @@
{% set colorbodyfont = color['fontcolorhover'] %} {% set colorbodyfont = color['fontcolorhover'] %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-galery" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %} {% if canupdate or canadd %}
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}

View File

@ -17,7 +17,7 @@
{% set canadd = true %} {% set canadd = true %}
{% endif %} {% endif %}
<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"> <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 %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}

View File

@ -37,7 +37,7 @@
{% set stylegrid="grid-list" %} {% set stylegrid="grid-list" %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-groupmessage" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -75,7 +75,7 @@
<div class="grid-item-content"> <div class="grid-item-content">
<div class="item-link clearfix"> <div class="item-link clearfix">
<div class="grid-item-logo"> <div class="grid-item-logo">
<img class="grid-item-img avatar" src="/{{alias}}/uploads/avatar/{{message.user.avatar}}" width="100%"> <img style='cursor:pointer' onClick="seeUser({{message.user.id}})" class="grid-item-img avatar" src="/{{alias}}/uploads/avatar/{{message.user.avatar}}" width="100%">
<a onClick="hideMessage({{message.id}})" style="cursor:pointer;" title="Ne plus afficher"><i class="fa fa-eye-slash"></i></a> <a onClick="hideMessage({{message.id}})" style="cursor:pointer;" title="Ne plus afficher"><i class="fa fa-eye-slash"></i></a>
</div> </div>

View File

@ -20,7 +20,7 @@
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-info" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -29,12 +29,12 @@
{% endif %} {% endif %}
{% set canadd = false %} {% set canadd = false %}
<div class="widgetheader" style="{{ stylewidgetheader }};"> <div class="widgetheader" style="{{ stylewidgetheader }}; padding-top:10px;">
{% set style = "width: 90px;display: block;margin: auto; padding: 10px 0px 10px 0px; position: inherit;height: auto;" %} {% set style = "margin: auto; display: inherit;background-color:transparent;" %}
{% if icon %} {% if icon %}
<img src="/{{ alias }}{{ icon }}" class="logo" style="{{ style }}" /> <img src="/{{ alias }}{{ icon }}" class="avatar big" style="{{ style }}" />
{% else %} {% else %}
<img src="/{{ alias }}/uploads/icon/icon_users.png" style="{{ style }}" /> <img src="/{{ alias }}/uploads/icon/icon_users.png" class="avatar big" style="{{ style }}" />
{% endif %} {% endif %}
</div> </div>
@ -42,7 +42,7 @@
<div class="widgetbody" style="{{ stylewidgetbody }}"> <div class="widgetbody" style="{{ stylewidgetbody }}">
<div style="text-align: center; margin-top:40px;"> <div style="text-align: center; margin-top:50px;">
{%if usage=="group" %}<small>Groupe<br></small>{% endif %} {%if usage=="group" %}<small>Groupe<br></small>{% endif %}
<span style="font-size:120%">{{ title }}</span><br><br> <span style="font-size:120%">{{ title }}</span><br><br>
{{ description | raw }} {{ description | raw }}
@ -55,7 +55,7 @@
<div class="grid-item grid-small" style="{{ stylewidgetbodyreverse }};"> <div class="grid-item grid-small" style="{{ stylewidgetbodyreverse }};">
<div class="grid-item-content"> <div class="grid-item-content">
<div class="grid-item-logo"> <div class="grid-item-logo">
<img src="/{{ alias }}/uploads/avatar/{{ member.user.avatar}}" class="grid-item-img avatar" height="110" > <img onclick="seeUser({{member.user.id}})" src="/{{ alias }}/uploads/avatar/{{ member.user.avatar}}" class="grid-item-img avatar" height="110" style="cursor:pointer;">
</div> </div>
<div class="grid-item-title"> <div class="grid-item-title">
@ -75,7 +75,7 @@
{% endfor %} {% endfor %}
{% if canadd==true %} {% if canadd==true %}
<div class="grid-item grid-small" style="{{ stylewidgetbodyreverse }};"> <div class="grid-item grid-small" style="{{ stylewidgetbodyreverse }}; height:150px">
<a href="{{path('cadoles_core_user_group_users',{'id':id})}}" target="_top" style="{{ stylewidgetbodyreverse }};"> <a href="{{path('cadoles_core_user_group_users',{'id':id})}}" target="_top" style="{{ stylewidgetbodyreverse }};">
<div class="grid-item-content"> <div class="grid-item-content">
<div class="grid-item-logo"> <div class="grid-item-logo">

View File

@ -27,7 +27,13 @@
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %} {% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px"> {% if app.user %}
{% set username = app.user.username %}
{% else %}
{% set username = "" %}
{% endif %}
<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 %} {% if canupdate or canadd %}
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}
@ -100,11 +106,11 @@
<a style="cursor:pointer" onClick="modBookmark({{ bookmark.id }})" class="item-update"><i style="color: #FFF" class="fa fa-file" title="Modifier le favori"></i></a> <a style="cursor:pointer" onClick="modBookmark({{ bookmark.id }})" class="item-update"><i style="color: #FFF" class="fa fa-file" title="Modifier le favori"></i></a>
{% if bookmark.target == 'frame' %} {% if bookmark.target == 'frame' %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" style="cursor:pointer" onClick="showFrameitem('bookmark{{ bookmark.id }}','{{ bookmark.url }}')"> <a class="linktosonde" data-sonde="{{ bookmark.title }}" style="cursor:pointer" onClick="showFrameitem('bookmark{{ bookmark.id }}','{{ bookmark.url|replace({'#login#': username}) }}')">
{% elseif bookmark.target == "_self" %} {% elseif bookmark.target == "_self" %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.target }}{% endif %}"> <a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.target }}{% endif %}">
{% else %} {% else %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url }}" target="{{ bookmark.target }}"> <a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{{ bookmark.target }}">
{% endif %} {% endif %}
<div class="item-link clearfix"> <div class="item-link clearfix">
@ -209,11 +215,11 @@
{% else %} {% else %}
{% if item.target == 'frame' %} {% if item.target == 'frame' %}
<a class="linktosonde" data-sonde="{{ item.title }}" style="cursor:pointer" onClick="showFrameitem({{ item.id }},'{{ item.url }}')"> <a class="linktosonde" data-sonde="{{ item.title }}" style="cursor:pointer" onClick="showFrameitem({{ item.id }},'{{ item.url|replace({'#login#': username}) }}')">
{% elseif item.target == "_self" %} {% elseif item.target == "_self" %}
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url }}" target="{% if access=="user" %}_top{% else %}{{ item.target }}{% endif %}"> <a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ item.target }}{% endif %}">
{% else %} {% else %}
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url }}" target="{{ item.target }}"> <a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url|replace({'#login#': username}) }}" target="{{ item.target }}">
{% endif %} {% endif %}
{% endif %} {% endif %}

View File

@ -27,7 +27,13 @@
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %} {% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px"> {% if app.user %}
{% set username = app.user.username %}
{% else %}
{% set username = "" %}
{% endif %}
<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 %} {% if canupdate or canadd %}
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}
@ -65,11 +71,11 @@
<a style="cursor:pointer" onClick="modBookmark({{ bookmark.id }})" class="item-update"><i style="color: #FFF" class="fa fa-file" title="Modifier le favori"></i></a> <a style="cursor:pointer" onClick="modBookmark({{ bookmark.id }})" class="item-update"><i style="color: #FFF" class="fa fa-file" title="Modifier le favori"></i></a>
{% if bookmark.target == 'frame' %} {% if bookmark.target == 'frame' %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" style="cursor:pointer" onClick="showFrameitem('bookmark{{ bookmark.id }}','{{ bookmark.url }}')"> <a class="linktosonde" data-sonde="{{ bookmark.title }}" style="cursor:pointer" onClick="showFrameitem('bookmark{{ bookmark.id }}','{{ bookmark.url|replace({'#login#': username}) }}')">
{% elseif bookmark.target == "_self" %} {% elseif bookmark.target == "_self" %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.target }}{% endif %}"> <a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ bookmark.target }}{% endif %}">
{% else %} {% else %}
<a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url }}" target="{{ bookmark.target }}"> <a class="linktosonde" data-sonde="{{ bookmark.title }}" href="{{ bookmark.url|replace({'#login#': username}) }}" target="{{ bookmark.target }}">
{% endif %} {% endif %}
<div class="item-link clearfix"> <div class="item-link clearfix">
@ -113,11 +119,11 @@
{% else %} {% else %}
{% if item.target == 'frame' %} {% if item.target == 'frame' %}
<a class="linktosonde" data-sonde="{{ item.title }}" style="cursor:pointer" onClick="showFrameitem({{ item.id }},'{{ item.url }}')"> <a class="linktosonde" data-sonde="{{ item.title }}" style="cursor:pointer" onClick="showFrameitem({{ item.id }},'{{ item.url|replace({'#login#': username}) }}')">
{% elseif item.target == "_self" %} {% elseif item.target == "_self" %}
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url }}" target="{% if access=="user" %}_top{% else %}{{ item.target }}{% endif %}"> <a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ item.target }}{% endif %}">
{% else %} {% else %}
<a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url }}" target="{{ item.target }}"> <a class="linktosonde" data-sonde="{{ item.title }}" href="{{ item.url|replace({'#login#': username}) }}" target="{{ item.target }}">
{% endif %} {% endif %}
{% endif %} {% endif %}

View File

@ -18,7 +18,13 @@
{% set stylelink = "color:#" ~ color['fontcolorhover'] %} {% set stylelink = "color:#" ~ color['fontcolorhover'] %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px"> {% if app.user %}
{% set username = app.user.username %}
{% else %}
{% set username = "" %}
{% endif %}
<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 %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}
@ -31,11 +37,11 @@
<div class="widgetheader" style="{{ stylewidgetbodyimage }}; height:100%;"> <div class="widgetheader" style="{{ stylewidgetbodyimage }}; height:100%;">
{% if target == 'frame' %} {% if target == 'frame' %}
<a class="linktosonde" data-sonde="{{ entity.name }}" style="cursor:pointer; {{ stylelink }}" onClick="showFrameitem('link{{ entity.id }}','{{ url }}')"> <a class="linktosonde" data-sonde="{{ entity.name }}" style="cursor:pointer; {{ stylelink }}" onClick="showFrameitem('link{{ entity.id }}','{{ url|replace({'#login#': username}) }}')">
{% elseif target == "_self" %} {% elseif target == "_self" %}
<a class="linktosonde" data-sonde="{{ entity.name }}" style="{{ stylelink }}"href="{{ url }}" target="{% if access=="user" %}_top{% else %}{{ target }}{% endif %}"> <a class="linktosonde" data-sonde="{{ entity.name }}" style="{{ stylelink }}"href="{{ url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ target }}{% endif %}">
{% else %} {% else %}
<a class="linktosonde" data-sonde="{{ entity.name }}" style="{{ stylelink }}" href="{{ url }}" target="{{ target }}"> <a class="linktosonde" data-sonde="{{ entity.name }}" style="{{ stylelink }}" href="{{ url|replace({'#login#': username}) }}" target="{{ target }}">
{% endif %} {% endif %}
{% if entity.icon %} {% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" style="max-height: 100%; width: auto; display: block; margin: auto; padding-top: 10px;" /> <img src="/{{ alias }}/{{ entity.icon.label }}" style="max-height: 100%; width: auto; display: block; margin: auto; padding-top: 10px;" />

View File

@ -17,7 +17,7 @@
{% set colorbodyfont = color['main'] %} {% set colorbodyfont = color['main'] %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" 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-separator" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>

View File

@ -17,7 +17,13 @@
{% set stylelink = "color:#" ~ color['fontcolorhover'] ~ ";" %} {% set stylelink = "color:#" ~ color['fontcolorhover'] ~ ";" %}
{% endif %} {% endif %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px"> {% if app.user %}
{% set username = app.user.username %}
{% else %}
{% set username = "" %}
{% endif %}
<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 %} {% if canupdate or canadd %}
<div class="widgetmenu"> <div class="widgetmenu">
{% if canupdate %} {% if canupdate %}
@ -44,11 +50,11 @@
{% if slide.url is not empty %} {% if slide.url is not empty %}
{% if slide.target == 'frame' %} {% if slide.target == 'frame' %}
<a class="slicklink" style="{{ stylelink }} cursor:pointer" onClick="showFrameitem('slide{{ slide.id }}','{{ slide.url }}')"> <a class="slicklink" style="{{ stylelink }} cursor:pointer" onClick="showFrameitem('slide{{ slide.id }}','{{ slide.url|replace({'#login#': username}) }}')">
{% elseif slide.target == "_self" %} {% elseif slide.target == "_self" %}
<a class="slicklink" style="{{ stylelink }}" href="{{ slide.url }}" target="{% if access=="user" %}_top{% else %}{{ slide.target }}{% endif %}"> <a class="slicklink" style="{{ stylelink }}" href="{{ slide.url|replace({'#login#': username}) }}" target="{% if access=="user" %}_top{% else %}{{ slide.target }}{% endif %}">
{% else %} {% else %}
<a class="slicklink" style="{{ stylelink }}" href="{{ slide.url }}" target="{{ slide.target }}"> <a class="slicklink" style="{{ stylelink }}" href="{{ slide.url|replace({'#login#': username}) }}" target="{{ slide.target }}">
{% endif %} {% endif %}
<i class="fa fa-link"></i></a> <i class="fa fa-link"></i></a>

View File

@ -11,7 +11,13 @@
{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %} {% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %}
{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %} {% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px"> {% if app.user %}
{% set username = app.user.username %}
{% else %}
{% set username = "" %}
{% endif %}
<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 %} {% if canupdate %}
<div class="widgetmenu"> <div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i> <i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -30,10 +36,10 @@
<span class="title">{{ entity.name }}</span> <span class="title">{{ entity.name }}</span>
</div> </div>
<div class="widgetbody" style="{{ stylewidgetbodyframe }}"> <div class="widgetbody" style="{{ stylewidgetbodyframe }}">
<img src="{{ url }}" width="100%" > <img src="{{ url|replace({'#login#': username}) }}" width="100%" >
</div> </div>
{% else %} {% else %}
<div class="widgetheader" style="{{ stylewidgetbodyimage }} width:100%; background-image: url({{url}}); background-size:cover; background-position:center;")></div> <div class="widgetheader" style="{{ stylewidgetbodyimage }} width:100%; background-image: url({{ url|replace({'#login#': username}) }}); background-size:cover; background-position:center;")></div>
{% endif %} {% endif %}
{% else %} {% else %}
<div class="widgetheader" style="{{ stylewidgetheader }}"> <div class="widgetheader" style="{{ stylewidgetheader }}">
@ -46,7 +52,7 @@
</div> </div>
<div class="widgetbody" style="{{ stylewidgetbodyframe }}"> <div class="widgetbody" style="{{ stylewidgetbodyframe }}">
<iframe src="{{ url }}" class="{% if entity.autoajust %}frameajust {% endif %}" style="{{ stylewidgetbodyframe }}"></iframe> <iframe src="{{ url|replace({'#login#': username}) }}" class="{% if entity.autoajust %}frameajust {% endif %}" style="{{ stylewidgetbodyframe }}"></iframe>
</div> </div>
{% endif %} {% endif %}
</div> </div>

View File

@ -59,6 +59,7 @@
<div class="col-md-4"> <div class="col-md-4">
{{ form_row(form.roworder) }} {{ form_row(form.roworder) }}
{{ form_row(form.url) }} {{ form_row(form.url) }}
<em>le mot clé #login# sera remplacé par le login de l'utilisateur</em><br><br>
{{ form_row(form.target) }} {{ form_row(form.target) }}
</div> </div>
</div> </div>

View File

@ -105,4 +105,47 @@ class ChatController extends Controller
$response->headers->set('Content-Type', 'application/json'); $response->headers->set('Content-Type', 'application/json');
return $response; return $response;
} }
public function listAction(Request $request) {
// S'assurer que c'est un appel ajax
if (!$request->isXmlHttpRequest()) {
return new JsonResponse(array('message' => 'Interdit'), 400);
}
$em = $this->getDoctrine()->getManager();
$id=$request->request->get('id');
$output=array();
// On récupère le groupe
$group=$em->getRepository("CadolesCoreBundle:Group")->find($id);
if(!$group) die();
// On récupere le user
$user=$this->getUser();
if(!$user) die();
// On récupère le lien usergroup
$usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["group"=>$group,"user"=>$user]);
if(!$usergroup) die();
// On récupere les messages
$messages=$em->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$group],["submitdate"=>"DESC"],10);
foreach($messages as $message) {
$tmp=[];
$tmp["id"]=$message->getId();
$tmp["message"]=$message->getTopic();
$tmp["submitdate"]=$message->getSubmitdate();
$tmp["userid"]=$message->getUser()->getId();
$tmp["userlastname"]=$message->getUser()->getLastname();
$tmp["userfirstname"]=$message->getUser()->getFirstname();
$tmp["useravatar"]=$message->getUser()->getAvatar();
array_push($output,$tmp);
}
$response = new Response(json_encode($output));
$response->headers->set('Content-Type', 'application/json');
return $response;
}
} }

View File

@ -5,3 +5,7 @@ cadoles_websocket_chat:
cadoles_websocket_message_see: cadoles_websocket_message_see:
path: /user/message/see path: /user/message/see
defaults: { _controller: CadolesWebsocketBundle:Chat:see } defaults: { _controller: CadolesWebsocketBundle:Chat:see }
cadoles_websocket_message_list:
path: /user/message/list
defaults: { _controller: CadolesWebsocketBundle:Chat:list }

View File

@ -9,7 +9,7 @@
} }
{% else %} {% else %}
#page-wrapper { #page-wrapper {
//padding: 5px 25px 0px 15px; padding: 5px 25px 0px 15px;
//background: transparent; //background: transparent;
} }
{% endif %} {% endif %}
@ -58,6 +58,7 @@
<input id="sendbymail" type="checkbox" id="item_essential" name="item[essential]" style="float:right" class='switch' ></input> <input id="sendbymail" type="checkbox" id="item_essential" name="item[essential]" style="float:right" class='switch' ></input>
<label class="custom-control-label" for="sendbymail">Envoyer par Mail ?</label> <label class="custom-control-label" for="sendbymail">Envoyer par Mail ?</label>
<a id="sendbtn" class="btn btn-success" style="margin-top:5px; width:100%; margin-bottom:15px">Envoyer</a> <a id="sendbtn" class="btn btn-success" style="margin-top:5px; width:100%; margin-bottom:15px">Envoyer</a>
<div id="useronline" style="margin-bottom:10px"></div>
</div> </div>
@ -66,7 +67,7 @@
{% for message in messages %} {% for message in messages %}
<div id='message-{{message.id}}' class='message row'> <div id='message-{{message.id}}' class='message row'>
<div class='msgavatar'> <div class='msgavatar'>
<img id='user_avatar_img' src='/{{ alias }}/uploads/avatar/{{message.user.avatar}}' class='avatar'><br> <img style='cursor:pointer' onclick='seeUser({{message.user.id}})' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/{{message.user.avatar}}' class='avatar'><br>
{% if fgmanager or message.user == app.user %} {% if fgmanager or message.user == app.user %}
<i class='delmessage fa fa-trash fa-fw' data-id='{{message.id}}' style='cursor: pointer;'></i> <i class='delmessage fa fa-trash fa-fw' data-id='{{message.id}}' style='cursor: pointer;'></i>
{% endif %} {% endif %}
@ -115,12 +116,90 @@
{% block localexternalscript %} {% block localexternalscript %}
<script src="/{{alias}}/bundles/goswebsocket/js/vendor/autobahn.min.js"></script> <script src="/{{alias}}/bundles/goswebsocket/js/vendor/autobahn.min.js"></script>
<script src="/{{alias}}/bundles/goswebsocket/js/gos_web_socket_client.js"></script>
<script type="text/javascript" src="/{{alias}}/ckeditor/adapters/jquery.js"></script> <script type="text/javascript" src="/{{alias}}/ckeditor/adapters/jquery.js"></script>
{% endblock %} {% endblock %}
{% block localjavascript %} {% block localjavascript %}
var webSocket; {% if websocket_activate and app.user %}
var WS = (function()
{
var GosSocket = function(uri, sessionConfig){
this._uri = uri;
this._session = false;
this._listeners = {};
this.connect(sessionConfig);
};
GosSocket.prototype.connect = function (sessionConfig) {
var that = this;
ab.connect(this._uri,
//Function on connect
function(session){
that.fire({type: "socket/connect", data: session });
},
//Function on disconnect / error
function(code, reason){
that._session = false;
that.fire({type: "socket/disconnect", data: {code: code, reason: reason}});
},
sessionConfig
);
};
GosSocket.prototype.on = function(type, listener){
if (typeof this._listeners[type] == "undefined"){
this._listeners[type] = [];
}
this._listeners[type].push(listener);
};
GosSocket.prototype.fire = function(event){
if (typeof event == "string"){
event = { type: event };
}
if (!event.target){
event.target = this;
}
if (!event.type){ //falsy
throw new Error("Event object missing 'type' property.");
}
if (this._listeners[event.type] instanceof Array){
var listeners = this._listeners[event.type];
for (var i=0, len=listeners.length; i < len; i++){
listeners[i].call(this, event.data);
}
}
};
GosSocket.prototype.off = function(type, listener){
if (this._listeners[type] instanceof Array){
var listeners = this._listeners[type];
for (var i=0, len=listeners.length; i < len; i++){
if (listeners[i] === listener){
listeners.splice(i, 1);
break;
}
}
}
};
return {
connect: function(uri, sessionConfig)
{
return new GosSocket(uri, sessionConfig);
}
}
})();
{% endif %}
$(document).ready(function(){ $(document).ready(function(){
if (CKEDITOR.instances["chat_message"]) CKEDITOR.instances["chat_message"].destroy(); if (CKEDITOR.instances["chat_message"]) CKEDITOR.instances["chat_message"].destroy();
@ -144,28 +223,64 @@
], ],
height: 150 height: 150
}); });
},500); },1000);
$(".switch").bootstrapSwitch(); $(".switch").bootstrapSwitch();
var dateoptions = {weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "2-digit", minute: "2-digit" };
$("#mymodal-sendmail").removeAttr("tabindex"); $("#mymodal-sendmail").removeAttr("tabindex");
{% if websocket_activate and app.user %} websocket();
var _WS_URI = "wss://{{ gos_web_socket_server_host }}:{{ gos_web_socket_server_port }}";
webSocket = WS.connect(_WS_URI);
var timer;
webSocket.on("socket/connect", function (session) { /*
// Reinit du tps de tentative de reco setInterval(function(){
$('#modalinfo').modal('hide'); islive();
clearInterval(timer); }, 15000);
*/
});
{% if websocket_activate and app.user %}
var session;
var dateoptions = {weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "2-digit", minute: "2-digit" };
var timer;
var delayRetry=500;
var isdeco=false;
var tosend=false;
var tosendmail=false;
var todelete=false;
var idtodelete;
var isalive;
function websocket()
{
var _WS_URI = "wss://{{ gos_web_socket_server_host }}:{{ gos_web_socket_server_port }}";
webSocket = WS.connect(_WS_URI,{retryDelay: delayRetry});
webSocket.on("socket/connect", function (sess) {
console.log("=== CONNECT ===");
// Sauvegardce de la session
session=sess;
//the callback function in "subscribe" is called everytime an event is published in that channel. //the callback function in "subscribe" is called everytime an event is published in that channel.
session.subscribe("websocket/channel/{{groupid}}", function (uri, payload) { sess.subscribe("websocket/channel/{{groupid}}", function (uri, payload) {
if(!isalive||isdeco) islive();
// Récupération lastmessage
if(isdeco) recuplastmsg();
// Si action en cours
if(tosend) sendbtn();
if(tosendmail) sendbtnmail();
if(todelete) delmessage(idtodelete);
// Il est co
isdeco=false;
if(payload.msg) { if(payload.msg) {
html ="<div id='message-"+payload.msg.id+"' class='message row'>"; html ="<div id='message-"+payload.msg.id+"' class='message row'>";
html+="<div class='msgavatar'>"; html+="<div class='msgavatar'>";
html+="<img id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+payload.msg.avatar+"' class='avatar'><br>"; html+="<img style='pointer:cursor' onclick='seeUser("+payload.msg.userid+")' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+payload.msg.avatar+"' class='avatar'><br>";
if(payload.msg.userid=={{app.user.id}} || '{{ fgmanager }}'=='1') { if(payload.msg.userid=={{app.user.id}} || '{{ fgmanager }}'=='1') {
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+payload.msg.id+"' style='cursor: pointer;'></i>"; html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+payload.msg.id+"' style='cursor: pointer;'></i>";
} }
@ -191,108 +306,217 @@
if(payload.alert) { if(payload.alert) {
alert(payload.alert); alert(payload.alert);
} }
});
$( "#sendbtn" ).click(function() { if(payload.islive) {
var data = CKEDITOR.instances["chat_message"].getData(); if(payload.userid!={{app.user.id}}) {
if($("#sendbymail").bootstrapSwitch('state')) { console.log("Received message islive", payload.userid);
CKEDITOR.instances["chat_messagemail"].setData(data); addOnline(payload.userid, payload.useravatar, payload.userlastname, payload.userfirstname);
$("#mailsuject").val("{{app.session.get('appname')}} = Notification {{ group.label }}"); {% if app.user.visible %}
$("#mailto").val(""); event={mykey: "{{userkey}}", type: "meto", userid: {{app.user.id}}, useravatar: "{{app.user.avatar}}", userlastname: "{{ app.user.lastname}}", userfirstname: "{{ app.user.firstname }}" };
$("#listtoavatar").html("");
{% for user in group.users %}
{%if(user.user!=app.user)%}
$("#mailto").val($("#mailto").val()+";{{user.user.email}}");
$("#listtoavatar").append($("<img class='avatar' title='{{user.user.lastname}} {{user.user.firstname}}' data-mail='{{user.user.email}}' src='\\{{alias}}\\uploads\\avatar\\{{user.user.avatar}}'>"));
{%endif%}
{% endfor %}
$('#mymodal-sendmail').modal('show');
}
else {
if(data) {
event={mykey: "{{userkey}}", type: "add", message: data};
session.publish("websocket/channel/{{groupid}}", event); session.publish("websocket/channel/{{groupid}}", event);
CKEDITOR.instances["chat_message"].setData(''); {% endif %}
/* Ne plus envoyer d'event compteur on passe par de l'ajax
event={type: "add", group:{{groupid}}};
parent.parent.counter(event);
*/
} }
} }
});
$( "#sendbtnmail" ).click(function() { if(payload.meto) {
var data = CKEDITOR.instances["chat_messagemail"].getData(); console.log("Received message meto", payload.userid, payload.useravatar, payload.userlastname, payload.userfirstname);
var subject=$("#mailsuject").val(); addOnline(payload.userid, payload.useravatar, payload.userlastname, payload.userfirstname);
var mailto=$("#mailto").val();
if(data&&subject&&mailto) {
event={mykey: "{{userkey}}", type: "add", message: data, mail: "true", to: mailto, subject: subject};
session.publish("websocket/channel/{{groupid}}", event);
CKEDITOR.instances["chat_message"].setData('');
/* Ne plus envoyer d'event compteur on passe par de l'ajax
event={type: "add", group:{{groupid}}};
parent.parent.counter(event);
*/
$("#sendbymail").bootstrapSwitch('state',false);
$('#mymodal-sendmail').modal('hide');
} }
else alert("Sujet, corps et destinataire(s) obligatoire");
});
$(document).on('click', '.delmessage', function(){ if(payload.isdead) {
id=$(this).data("id"); console.log("Received message isdead", payload.userid);
event={mykey: "{{userkey}}", type: "del", id: id}; $("#online"+payload.userid).remove();
session.publish("websocket/channel/{{groupid}}", event); }
});
$(document).on('click', '#listtoavatar img', function(){
var mail = ";"+$(this).data("mail");
$("#mailto").val($("#mailto").val().replace(mail, ""));
$(this).remove();
}); });
}); });
webSocket.on("socket/disconnect", function(error){ webSocket.on("socket/disconnect", function(error){
laberror="Disconnected for " + error.reason + " with code " + error.code; laberror="Disconnected for " + error.reason + " with code " + error.code;
console.log("=== DISCONNECT ===");
console.log(laberror); console.log(laberror);
isdeco=true;
});
}
$('#modalinfo').modal('show'); $( "#sendbtn" ).click(function() {
if(error.code==2) { sendbtn();
$('#modalinfotext').html("<center>Impossible de se connecter au serveur.<br>Vous avez dépassé le nombre de reconnexion maximum<br><br>Veuillez retentez d'ici quelques secondes<br><br><code>"+laberror+"</code><br><br><div id='modalinfotimer'></div><br><a class='btn btn-primary' onclick='location.reload(true);'>Forcer la tentative de reconnexion</a></center>"); });
clearInterval(timer); function sendbtn() {
var nbtentative=10; var data = CKEDITOR.instances["chat_message"].getData();
timer=setInterval(function(){ $('#modalinfotimer').html((nbtentative--)+"s") }, 1000); if($("#sendbymail").bootstrapSwitch('state')) {
CKEDITOR.instances["chat_messagemail"].setData(data);
$("#mailsuject").val("{{app.session.get('appname')}} = Notification {{ group.label }}");
$("#mailto").val("");
$("#listtoavatar").html("");
setTimeout(function(){ location.reload(true); }, 10000); {% for user in group.users %}
{%if(user.user!=app.user)%}
$("#mailto").val($("#mailto").val()+";{{user.user.email}}");
$("#listtoavatar").append($("<img class='avatar' title='{{user.user.lastname}} {{user.user.firstname}}' data-mail='{{user.user.email}}' src='\\{{alias}}\\uploads\\avatar\\{{user.user.avatar}}'>"));
{%endif%}
{% endfor %}
$('#mymodal-sendmail').modal('show');
}
else {
if(data) {
try {
// Flager que l'envoit c'est fait
tosend=false;
$("#sendbtn").html("Envoyer");
$("#sendbtn").removeClass("btn-danger");
$("#sendbtn").css('cursor','auto');
// Push envent sur le websocket
event={mykey: "{{userkey}}", type: "add", message: data};
session.publish("websocket/channel/{{groupid}}", event);
CKEDITOR.instances["chat_message"].setData('');
}
catch(error) {
// L'envoi ne s'est pas fait
console.log("Retry to send");
// On flag le fait de retenter l'envoit à la reconnexion
tosend=true;
// On signal que l'envoi est en cours sur le bouton
$("#sendbtn").html("Envoi en cours");
$("#sendbtn").addClass("btn-danger");
$("#sendbtn").css('cursor','progress');
}
}
}
}
$( "#sendbtnmail" ).click(function() {
sendbtnmail();
});
function sendbtnmail() {
var data = CKEDITOR.instances["chat_messagemail"].getData();
var subject=$("#mailsuject").val();
var mailto=$("#mailto").val();
if(data&&subject&&mailto) {
try {
// Flager que l'envoit c'est fait
tosendmail=false;
$("#sendbtnmail").html("Envoyer");
$("#sendbtnmail").removeClass("btn-danger");
$("#sendbtnmail").css('cursor','auto');
// Push envent sur le websocket
event={mykey: "{{userkey}}", type: "add", message: data, mail: "true", to: mailto, subject: subject};
session.publish("websocket/channel/{{groupid}}", event);
CKEDITOR.instances["chat_message"].setData('');
// Cacher la popup
$("#sendbymail").bootstrapSwitch('state',false);
$('#mymodal-sendmail').modal('hide');
}
catch(error) {
// L'envoi ne s'est pas fait
console.log("Retry to send");
// On flag le fait de retenter l'envoit à la reconnexion
tosendmail=true;
// On signal que l'envoi est en cours sur le bouton
$("#sendbtnmail").html("Envoi en cours");
$("#sendbtnmail").addClass("btn-danger");
$("#sendbtnmail").css('cursor','progress');
} }
if(error.code==3) { }
$('#modalinfotext').html("<center>Impossible de se connecter au serveur.<br>Veuillez retentez d'ici quelques secondes<br><br><code>"+laberror+"</code><br><br><div id='modalinfotimer'></div><br><a class='btn btn-primary' onclick='location.reload(true);'>Forcer la tentative de reconnexion</a></center>"); else alert("Sujet, corps et destinataire(s) obligatoire");
}
clearInterval(timer); $(document).on('click', '.delmessage', function(){
var nbtentative=10; delmessage($(this).data("id"));
timer=setInterval(function(){ $('#modalinfotimer').html((nbtentative--)+"s") }, 1000); });
setTimeout(function(){ location.reload(true); }, 10000); function delmessage(id) {
} try {
// Flager que l'envoit c'est fait
todelete=false;
idtodelete=null;
if(error.code==6 || error.code==5) { // Push envent sur le websocket
$('#modalinfotext').html("<center>Impossible de se connecter au serveur.<br>Vous allez être reconnecté d'ici quelques secondes<br><br><code>"+laberror+"</code><br><br><div id='modalinfotimer'></div><br><a class='btn btn-primary' onclick='location.reload(true);'>Forcer la tentative de reconnexion</a></center>"); event={mykey: "{{userkey}}", type: "del", id: id};
session.publish("websocket/channel/{{groupid}}", event);
}
catch(error){
// Le delete ne s'est pas fait
console.log("Retry to delete");
clearInterval(timer); // On flag le fait de retenter l'envoit à la reconnexion
var nbtentative=5; todelete=true;
timer=setInterval(function(){ $('#modalinfotimer').html((nbtentative--)+"s") }, 1000); idtodelete=id;
}
}
$(document).on('click', '#listtoavatar img', function(){
var mail = ";"+$(this).data("mail");
$("#mailto").val($("#mailto").val().replace(mail, ""));
$(this).remove();
});
function recuplastmsg() {
$.ajax({
method: "POST",
url: "{{ path('cadoles_websocket_message_list') }}",
data: {
"id": {{ groupid }},
},
success: function(datas) {
$.each(datas, function(i,data) {
// Le message a-t-il été déposé durant la déconnexion ?
if(!$("#message-"+data.id).length) {
html ="<div id='message-"+data.id+"' class='message row'>";
html+="<div class='msgavatar'>";
html+="<img style='cursor:pointer' onclick='seeUser("+data.userid+")' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+data.useravatar+"' class='avatar'><br>";
if(data.userid=={{app.user.id}} || '{{ fgmanager }}'=='1') {
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+data.id+"' style='cursor: pointer;'></i>";
}
html+="</div>";
html+="<div class='msgdiv'>"
html+="<div class='msgtitle'>"+data.userlastname+"<br><small>"+new Date(data.submitdate.date).toLocaleDateString("fr-FR", dateoptions)+"</small></div>";
html+="<div class='msgtopic'>"+data.message+"</div>";
html+="</div>";
html+="</div>";
$(".mychat").prepend(html);
}
});
} }
}); });
}
{% endif %} // islive
}); function islive() {
if(!session) return;
isalive=true;
{% if app.user.visible %}
addOnline({{app.user.id}}, "{{app.user.avatar}}", "{{app.user.lastname}}", "{{app.user.firstname}}");
event={mykey: "{{userkey}}", type: "islive", userid: {{app.user.id}}, useravatar: "{{app.user.avatar}}", userlastname: "{{app.user.lastname}}", userfirstname: "{{app.user.firstname}}" };
console.log("send islive");
session.publish("websocket/channel/{{groupid}}", event);
{% endif %}
}
function addOnline(userid, useravatar, userlastname, userfirstname) {
if(!$("#online"+userid).length) {
html = "<span id='online"+userid+"'>";
html+= "<img style='cursor:pointer; width:30px; height:30px; margin-right:5px;' onclick='seeUser("+userid+")' title='"+userlastname+" "+userfirstname+"' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+useravatar+"' class='avatar'>";
html+= "</span>";
$("#useronline").append(html);
}
}
{% endif %}
{% endblock %} {% endblock %}

View File

@ -19,6 +19,7 @@ class WebsocketTopic implements TopicInterface
protected $em; protected $em;
protected $container; protected $container;
protected $clientManipulator; protected $clientManipulator;
protected $users;
public function __construct(ClientManipulatorInterface $clientManipulator, EntityManager $em, ContainerInterface $container) { public function __construct(ClientManipulatorInterface $clientManipulator, EntityManager $em, ContainerInterface $container) {
$this->clientManipulator = $clientManipulator; $this->clientManipulator = $clientManipulator;
@ -38,7 +39,6 @@ class WebsocketTopic implements TopicInterface
{ {
//this will broadcast the message to ALL subscribers of this topic. //this will broadcast the message to ALL subscribers of this topic.
$topic->broadcast(['log' => $connection->resourceId." has joined ".$topic->getId()]); $topic->broadcast(['log' => $connection->resourceId." has joined ".$topic->getId()]);
} }
/** /**
@ -52,7 +52,7 @@ class WebsocketTopic implements TopicInterface
public function onUnSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request) public function onUnSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)
{ {
//this will broadcast the message to ALL subscribers of this topic. //this will broadcast the message to ALL subscribers of this topic.
$topic->broadcast(['log' => $connection->resourceId . " has left " . $topic->getId()]); $topic->broadcast(['isdead' => 'isdead','userid'=>$connection->userId]);
} }
@ -87,6 +87,27 @@ class WebsocketTopic implements TopicInterface
} }
if($group&&$usergroup&&$user) { if($group&&$usergroup&&$user) {
if($event["type"]=="islive") {
$topic->broadcast([
"islive" => "islive",
"userid" => $event["userid"],
"useravatar" => $event["useravatar"],
"userlastname" => $event["userlastname"],
"userfirstname" => $event["userfirstname"],
]);
$connection->userId=$event["userid"];
}
if($event["type"]=="meto") {
$topic->broadcast([
"meto" => "meto",
"userid" => $event["userid"],
"useravatar" => $event["useravatar"],
"userlastname" => $event["userlastname"],
"userfirstname" => $event["userfirstname"],
]);
}
if($event["type"]=="add") { if($event["type"]=="add") {
if(array_key_exists("mail",$event)) { if(array_key_exists("mail",$event)) {
$mail = $this->container->get('cadoles.core.service.mail'); $mail = $this->container->get('cadoles.core.service.mail');

View File

@ -8,7 +8,6 @@ parameters:
masteridentity: %%ninegate_masteridentity masteridentity: %%ninegate_masteridentity
# Mode d'authentification soit SQL / LDAP / CAS / SAML # Mode d'authentification soit SQL / LDAP / CAS / SAML
# Pour l'instant SQL - CAS - SAML Reste à faire LDAP
# Attention si le masteridentity est différent de SQL le mode d'authentification est forcement différent de SQL # Attention si le masteridentity est différent de SQL le mode d'authentification est forcement différent de SQL
# Car aucune synchronisation des password n'est possible # Car aucune synchronisation des password n'est possible
mode_auth: %%ninegate_mode_auth mode_auth: %%ninegate_mode_auth