Compare commits

..

No commits in common. "8fcd736dfe112753fa3f5ea931937a3a02152759" and "4b0d392e5893dfa0eb58efb38f0b30a582aa4beb" have entirely different histories.

61 changed files with 195 additions and 1126 deletions

View File

@ -8,7 +8,6 @@ EOLE_VERSION=2.6
EOLE_RELEASE=2.6.2
PKGAPPS=web
################################
# Début de zone à ne pas éditer
################################

View File

@ -62,8 +62,8 @@
<variable type='string' name='ninegate_niveau01name' description="Nom de la première orgranisation de Niveau 01 (idem valeur Cadoles ldap)" mandatory='True'><value>cadoles</value></variable>
<variable type='string' name='ninegate_niveau01siren' description="SIREN de la première orgranisation de Niveau 01 (idem valeur Cadoles ldap)" mandatory='True'><value>cadoles</value></variable>
<variable type='string' name='ninegate_niveau01label' description="Label singulier du niveau 01 d'organisation" mandatory='True'><value>Ecole</value></variable>
<variable type='string' name='ninegate_niveau01labels' description="Label pluriel du niveau 01 d'organisation" mandatory='True'><value>Ecoles</value></variable>
<variable type='string' name='ninegate_niveau01label' description="Label singulier du niveau 01 d'organisation" mandatory='True'><value>Département</value></variable>
<variable type='string' name='ninegate_niveau01labels' description="Label pluriel du niveau 01 d'organisation" mandatory='True'><value>Départements</value></variable>
<variable type='string' name='ninegate_niveau01icon' description="Icon du niveau 01 d'organisation" mandatory='True'><value>fa-building</value></variable>
<variable type='oui/non' name='ninegate_niveau02view' description="Gérer un niveau 02 d'organisation"><value>non</value></variable>

View File

@ -154,7 +154,7 @@ ivory_ck_editor:
language: fr
toolbar: "my_toolbar_1"
uiColor: "#ffffff"
extraPlugins: ["html5video"]
extraPlugins: ["html5video","pastebase64"]
light_config:
language: fr
toolbar: "my_toolbar_2"

View File

@ -22,7 +22,6 @@ composer install
./perm.sh www-data
# Nettoyage du cache
rm /var/www/html/ninegate/var/cache/* -rf
php bin/console cache:clear --env=prod --no-debug
# Migration si nécessaire du schéma de la base
@ -56,5 +55,13 @@ fi
# Server Websocket
if [[ "$ninegate_websocket" = 'oui' ]]
then
/var/www/html/ninegate/scripts/ninegate-websocket.sh
echo ""
echo WEBSOCKET = STOP
pid="$(pgrep -f gos:websocket)"
if [ -n "${pid}" ]; then
kill -9 ${pid};
fi
echo WEBSOCKET = START
bin/console gos:websocket:server --port $websocket_portinterne -a $websocket_url --no-debug -n -q --env=prod & disown
fi

View File

@ -3,24 +3,11 @@ websocket_url=$(CreoleGet adresse_ip_eth0 non)
websocket_portinterne=$(CreoleGet ninegate_websocket_portinterne non)
# Server Websocket
if [[ "$1" != "restartifdown" ]]; then
echo WEBSOCKET = STOP
pid="$(pgrep -a -f gos:websocket | grep $websocket_portinterne)"
pid="$(pgrep -f gos:websocket)"
if [ -n "${pid}" ]; then
IFS=' ' read -r -a array <<< "$pid"
kill -9 ${array[0]};
fi
kill -9 ${pid};
fi
# Port LISTEN ?
pid="$(pgrep -a -f gos:websocket | grep $websocket_portinterne)"
restart="yes"
if [ "$1" == "restartifdown" ] && [ -n "${pid}" ] ; then
restart="no"
fi
if [[ "$restart" == "yes" ]]; then
echo WEBSOCKET = START
cd /var/www/html/ninegate
bin/console gos:websocket:server --port $websocket_portinterne -a $websocket_url --no-debug -n -q --env=prod & disown
fi

View File

@ -16,11 +16,6 @@ use Cadoles\CoreBundle\Entity\Niveau02;
use Cadoles\CoreBundle\Entity\User;
use Cadoles\CoreBundle\Entity\Group;
use Cadoles\CoreBundle\Entity\UserGroup;
use Cadoles\PortalBundle\Entity\Calendar;
use Cadoles\PortalBundle\Entity\Blog;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
global $bdd01;
global $config;
@ -33,8 +28,6 @@ class SynchroCommand extends Command
private $output;
private $filesystem;
private $rootlog;
private $ldap;
private $ldap_basedn;
protected function configure()
{
@ -83,9 +76,8 @@ class SynchroCommand extends Command
$this->writeln('== SYNCHONISATION ANNUAIRE ==========================');
$this->writeln('=====================================================');
$this->ldap = $this->container->get('cadoles.core.service.ldap');
if(!$this->ldap->isEnabled()) {
$ldap = $this->container->get('cadoles.core.service.ldap');
if(!$ldap->isEnabled()) {
if($masteridentity =="LDAP") {
$this->writeln('');
$this->writeln('=====================================================');
@ -93,7 +85,7 @@ class SynchroCommand extends Command
$this->writeln('=====================================================');
$this->ldap_basedn = $this->container->getParameter('ldap_basedn');
$ldap_basedn = $this->container->getParameter('ldap_basedn');
$ldap_template = $this->container->getParameter('ldap_template');
$ldap_username = $this->container->getParameter('ldap_username');
$ldap_firstname = $this->container->getParameter('ldap_firstname');
@ -134,7 +126,7 @@ class SynchroCommand extends Command
$this->writeln('');
$this->writeln('== CLASSES ==========================================');
$results = $this->ldap->search("type=Classe", ['cn','description','gidNumber'], $this->ldap_basedn);
$results = $ldap->search("type=Classe", ['cn','description','gidNumber'], $ldap_basedn);
foreach($results as $result) {
$cn=$result["cn"];
$ldapfilter="(|(&(type=Classe)(cn=$cn))(&(type=Equipe)(cn=profs-$cn))(&(ENTPersonProfils=Administratif)(divcod=$cn)))";
@ -163,7 +155,7 @@ class SynchroCommand extends Command
// On execute le filtre d'appartenance à ce niveau
$this->writeln("== Récupération des utilisateurs de l'annuaire");
$niveau01=$this->em->getRepository('CadolesCoreBundle:Niveau01')->find($data["id"]);
$results = $this->ldap->search($niveau01->getLdapfilter(), $fieldstoread, $this->ldap_basedn);
$results = $ldap->search($niveau01->getLdapfilter(), $fieldstoread, $ldap_basedn);
$nbuserstotal=count($results);
// Pour chaque utilisateur ldap
@ -255,8 +247,7 @@ class SynchroCommand extends Command
$this->writeln('== '.$group->getLabel());
if(!is_null($ldapfilter)) {
$results = $this->ldap->search($ldapfilter,[$ldap_username,"memberuid"] , $this->ldap_basedn);
$results = $ldap->search($ldapfilter,[$ldap_username,"memberuid"] , $ldap_basedn);
foreach($results as $result) {
if(isset($result["memberuid"])) {
// Si memberid est un tableau il y a plusieur user dedans
@ -342,7 +333,7 @@ class SynchroCommand extends Command
}
else {
//on peut unset les recherches suivantes seront plus rapide
unset($flipped[$data["username"]]);
unset($flipped[$user->getUsername()]);
}
$this->em->clear();
@ -369,17 +360,17 @@ class SynchroCommand extends Command
foreach($datas as $data) {
$criteria = '(cn='.$data->getLabel().')';
$subbranch=$baseNiveau01;
$results = $this->ldap->search($criteria, array('cn'), $subbranch);
$results = $ldap->search($criteria, array('cn'), $subbranch);
// Mise à jour si elle existe
if(count($results) > 0) {
$this->writeln(' - Modification dans annuaire >> '.$data->getLabel());
if(!$simulate) $this->ldap->modifyNiveau01($data,$data->getLabel());
if(!$simulate) $ldap->modifyNiveau01($data,$data->getLabel());
}
// Sinon création de la fiche
else {
$this->writeln(' - Création dans annuaire >> '.$data->getLabel());
if(!$simulate) $this->ldap->addNiveau01($data);
if(!$simulate) $ldap->addNiveau01($data);
}
}
@ -396,17 +387,17 @@ class SynchroCommand extends Command
foreach($datas as $data) {
$criteria = '(cn='.$data->getLabel().')';
$subbranch=$baseNiveau02;
$results = $this->ldap->search($criteria, array('cn'), $subbranch);
$results = $ldap->search($criteria, array('cn'), $subbranch);
// Mise à jour si elle existe
if(count($results) > 0) {
$this->writeln(' - Modification dans annuaire >> '.$data->getLabel());
if(!$simulate) $this->ldap->modifyNiveau02($data,$data->getLabel());
if(!$simulate) $ldap->modifyNiveau02($data,$data->getLabel());
}
// Sinon création de la fiche
else {
$this->writeln(' - Création dans annuaire >> '.$data->getLabel());
if(!$simulate) $this->ldap->addNiveau02($data);
if(!$simulate) $ldap->addNiveau02($data);
}
}
@ -423,17 +414,17 @@ class SynchroCommand extends Command
foreach($datas as $data) {
$criteria = '(cn='.$data->getLabel().')';
$subbranch=$baseGroup;
$results = $this->ldap->search($criteria, array('cn'), $subbranch);
$results = $ldap->search($criteria, array('cn'), $subbranch);
// Mise à jour si elle existe
if(count($results) > 0) {
$this->writeln(' - Modification dans annuaire >> '.$data->getLabel());
if(!$simulate) $this->ldap->modifyGroup($data,$data->getLabel());
if(!$simulate) $ldap->modifyGroup($data,$data->getLabel());
}
// Sinon création de la fiche
else {
$this->writeln(' - Création dans annuaire >> '.$data->getLabel());
if(!$simulate) $this->ldap->addGroup($data);
if(!$simulate) $ldap->addGroup($data);
}
}
@ -450,7 +441,7 @@ class SynchroCommand extends Command
foreach($datas as $data) {
$criteria = '(uid='.$data->getUsername().')';
$subbranch=$baseUser;
$results = $this->ldap->search($criteria, array('uid'), $subbranch);
$results = $ldap->search($criteria, array('uid'), $subbranch);
// S'assurer que SIREN correspond au Niveau01
if($data->getNiveau01()->getSiren()!=$data->getSiren()) {
@ -467,16 +458,16 @@ class SynchroCommand extends Command
// Mise à jour si elle existe
if(count($results) > 0) {
$this->writeln(' - Modification dans annuaire >> '.$data->getUsername());
if(!$simulate) $this->ldap->modifyUser($data);
if(!$simulate) $ldap->modifyUser($data);
}
// Sinon création de la fiche
else {
$this->writeln(' - Création dans annuaire >> '.$data->getUsername());
if(!$simulate) $this->ldap->addUser($data);
if(!$simulate) $ldap->addUser($data);
}
// Rattachement à Niveau01 et Niveau02
if(!$simulate) $this->ldap->addGroupUser($data);
if(!$simulate) $ldap->addGroupUser($data);
}
$this->writeln('');
@ -492,21 +483,21 @@ class SynchroCommand extends Command
foreach($datas as $data) {
$criteria = '(cn='.$data->getLabel().')';
$subbranch=$baseniveau01;
$results = $this->ldap->search($criteria, array('cn'), $subbranch);
$results = $ldap->search($criteria, array('cn'), $subbranch);
// Mise à jour des membres du groupes
if(count($results) > 0) {
$this->writeln(' - '.$data->getLabel());
$dn=$this->ldap->getNiveau01DN($data->getLabel());
$dn=$ldap->getNiveau01DN($data->getLabel());
$attrs["memberuid"]=array();
$attrs["cadolesMember"]=array();
foreach($data->getUsers() as $userniveau01) {
array_push($attrs["memberuid"],$userniveau01->getUsername());
array_push($attrs["cadolesMember"],$this->ldap->getUserDN($userniveau01));
array_push($attrs["cadolesMember"],$ldap->getUserDN($userniveau01));
$this->writeln(' > '.$userniveau01->getUsername());
}
if(!$simulate) $this->ldap->ldapModify($dn, $attrs);
if(!$simulate) $ldap->ldapModify($dn, $attrs);
}
}
@ -523,21 +514,21 @@ class SynchroCommand extends Command
foreach($datas as $data) {
$criteria = '(cn='.$data->getLabel().')';
$subbranch=$baseniveau02;
$results = $this->ldap->search($criteria, array('cn'), $subbranch);
$results = $ldap->search($criteria, array('cn'), $subbranch);
// Mise à jour des membres du groupes
if(count($results) > 0) {
$this->writeln(' - '.$data->getLabel());
$dn=$this->ldap->getNiveau02DN($data->getLabel());
$dn=$ldap->getNiveau02DN($data->getLabel());
$attrs["memberuid"]=array();
$attrs["cadolesMember"]=array();
foreach($data->getUsers() as $userniveau01) {
array_push($attrs["memberuid"],$userniveau01->getUsername());
array_push($attrs["cadolesMember"],$this->ldap->getUserDN($userniveau01));
array_push($attrs["cadolesMember"],$ldap->getUserDN($userniveau01));
$this->writeln(' > '.$userniveau01->getUsername());
}
if(!$simulate) $this->ldap->ldapModify($dn, $attrs);
if(!$simulate) $ldap->ldapModify($dn, $attrs);
}
}
@ -555,21 +546,21 @@ class SynchroCommand extends Command
foreach($datas as $data) {
$criteria = '(cn='.$data->getLabel().')';
$subbranch=$baseGroup;
$results = $this->ldap->search($criteria, array('cn'), $subbranch);
$results = $ldap->search($criteria, array('cn'), $subbranch);
// Mise à jour des membres du groupes
if(count($results) > 0) {
$this->writeln(' - '.$data->getLabel());
$dn=$this->ldap->getGroupDN($data->getLabel());
$dn=$ldap->getGroupDN($data->getLabel());
$attrs["memberuid"]=array();
$attrs["cadolesMember"]=array();
foreach($data->getUsers() as $usergroupe) {
array_push($attrs["memberuid"],$usergroupe->getUser()->getUsername());
array_push($attrs["cadolesMember"],$this->ldap->getUserDN($usergroupe->getUser()));
array_push($attrs["cadolesMember"],$ldap->getUserDN($usergroupe->getUser()));
$this->writeln(' > '.$usergroupe->getUser()->getUsername());
}
if(!$simulate) $this->ldap->ldapModify($dn, $attrs);
if(!$simulate) $ldap->ldapModify($dn, $attrs);
}
}
@ -585,14 +576,14 @@ class SynchroCommand extends Command
$criteria = '(cn=*)';
$subbranch=$baseNiveau01;
$results = $this->ldap->search($criteria, array('cn'), $subbranch);
$results = $ldap->search($criteria, array('cn'), $subbranch);
foreach($results as $result) {
$data = $this->em->getRepository('CadolesCoreBundle:Niveau01')->findBy(array('label' => $result["cn"]));
if($data) $this->writeln(' - Existe dans bundle >> '.$result["cn"]);
else {
$this->writeln(' - A supprimer dans annuaire >> '.$result["cn"]);
$dn=$this->ldap->getNiveau01DN($result["cn"]);
if(!$simulate) $this->ldap->deleteByDN($dn);
$dn=$ldap->getNiveau01DN($result["cn"]);
if(!$simulate) $ldap->deleteByDN($dn);
}
}
@ -602,14 +593,14 @@ class SynchroCommand extends Command
$criteria = '(cn=*)';
$subbranch=$baseNiveau02;
$results = $this->ldap->search($criteria, array('cn'), $subbranch);
$results = $ldap->search($criteria, array('cn'), $subbranch);
foreach($results as $result) {
$data = $this->em->getRepository('CadolesCoreBundle:Niveau02')->findBy(array('label' => $result["cn"]));
if($data) $this->writeln(' - Existe dans bundle >> '.$result["cn"]);
else {
$this->writeln(' - A supprimer dans annuaire >> '.$result["cn"]);
$dn=$this->ldap->getNiveau02DN($result["cn"]);
if(!$simulate) $this->ldap->deleteByDN($dn);
$dn=$ldap->getNiveau02DN($result["cn"]);
if(!$simulate) $ldap->deleteByDN($dn);
}
}
@ -620,14 +611,14 @@ class SynchroCommand extends Command
$criteria = '(cn=*)';
$subbranch=$baseGroup;
$results = $this->search($criteria, array('cn'), $subbranch);
$results = $ldap->search($criteria, array('cn'), $subbranch);
foreach($results as $result) {
$data = $this->em->getRepository('CadolesCoreBundle:Group')->findBy(array('label' => $result["cn"]));
if($data) $this->writeln(' - Existe dans bundle >> '.$result["cn"]);
else {
$this->writeln(' - A supprimer dans annuaire >> '.$result["cn"]);
$dn=$this->ldap->getGroupDN($result["cn"]);
if(!$simulate) $this->ldap->deleteByDN($dn);
$dn=$ldap->getGroupDN($result["cn"]);
if(!$simulate) $ldap->deleteByDN($dn);
}
}
@ -637,14 +628,14 @@ class SynchroCommand extends Command
$criteria = '(uid=*)';
$subbranch=$baseUser;
$results = $this->ldap->search($criteria, array('uid'), $subbranch);
$results = $ldap->search($criteria, array('uid'), $subbranch);
foreach($results as $result) {
$data = $this->em->getRepository('CadolesCoreBundle:User')->findBy(array('username' => $result["uid"]));
if($data) $this->writeln(' - Existe dans bundle >> '.$result["uid"]);
else {
$this->writeln(' - A supprimer dans annuaire >> '.$result["uid"]);
$dn='uid='.$result["uid"].','.$baseUser;
if(!$simulate) $this->ldap->deleteByDN($dn);
if(!$simulate) $ldap->deleteByDN($dn);
}
}
}
@ -663,14 +654,14 @@ class SynchroCommand extends Command
}
protected function addmodGroup($label,$ldapfilter,$fgcanshare) {
$portal_activate = $this->container->getParameter('portal_activate');
$group=$this->em->getRepository('CadolesCoreBundle:Group')->findOneBy(array('fgtemplate' => true, 'label' => $label));
if(!$group) {
$group=new Group();
$group->setFgcanshare($fgcanshare);
$group->setFgcancreatepage(false);
$group->setFgcancreateblog(false);
$group->setFgcancreatecalendar(false);
$group->setFgcancreatepage(true);
$group->setFgcancreateblog(true);
$group->setFgcancreatecalendar(true);
}
$group->setLabel($label);
@ -679,52 +670,8 @@ class SynchroCommand extends Command
$group->setLdapfilter($ldapfilter);
$group->setFgtemplate(true);
if($portal_activate) {
$pagetemplate=$this->em->getRepository("CadolesPortalBundle:Page")->find(-110);
if($pagetemplate) $group->setPagetemplate($pagetemplate);
}
$this->em->persist($group);
$this->em->flush();
if($fgcanshare && $portal_activate) {
// On regarde s'il a au moins une page
if($group->getPages()->isEmpty()) {
$page=$this->em->getRepository("CadolesPortalBundle:Page")->clonePage(null,$group->getPagetemplate());
$group->addPage($page);
$page->setName($group->getLabel());
$this->em->persist($page);
$this->em->persist($group);
$this->em->flush();
}
// On regarde s'il a au moins un calendrier
if($group->getCalendars()->isEmpty()) {
$calendar=new Calendar();
$key = Uuid::uuid4();
$calendar->setName($group->getLabel());
$calendar->setKeyvalue($key);
$calendar->addGroup($group);
$calendar->setColor($group->getColor());
$calendar->setType(0);
$this->em->persist($calendar);
$this->em->flush();
}
// On regarde s'il a au moins un blog
if($group->getBlogs()->isEmpty()) {
$blog=new Blog();
$blog->setName($group->getLabel());
$blog->addGroup($group);
$this->em->persist($blog);
$this->em->flush();
}
}
}
protected function addtoGroup($user,$group) {
@ -733,19 +680,11 @@ class SynchroCommand extends Command
$member= new UserGroup();
$member->setGroup($group);
$member->setUser($user);
}
// Si modèle scribe
$ldap_template = $this->container->getParameter('ldap_template');
if($ldap_template=="scribe") {
$ldapfilter="(|(&(uid=".$user->getUsername().")(ENTPersonProfils=enseignant))(&(uid=".$user->getUsername().")(typeadmin=0))(&(uid=".$user->getUsername().")(typeadmin=2)))";
$results = $this->ldap->search($ldapfilter, ['uid'], $this->ldap_basedn);
if($results) $member->setFgmanager(true);
}
$this->em->persist($member);
$this->em->flush();
}
}
protected function addUser($niveau01,$username,$firstname,$lastname,$email,$usersadmin) {
$user = new User();
@ -763,18 +702,9 @@ class SynchroCommand extends Command
if(in_array($username,$usersadmin))
$user->setRole("ROLE_ADMIN");
else {
else
$user->setRole("ROLE_USER");
// Si modèle scribe
$ldap_template = $this->container->getParameter('ldap_template');
if($ldap_template=="scribe") {
$ldapfilter="(|(&(uid=".$user->getUsername().")(ENTPersonProfils=enseignant))(&(uid=".$user->getUsername().")(typeadmin=0))(&(uid=".$user->getUsername().")(typeadmin=2)))";
$results = $this->ldap->search($ldapfilter, ['uid'], $this->ldap_basedn);
if($results) $user->setRole("ROLE_ANIM");
}
}
$this->em->persist($user);
$this->em->flush();
}

View File

@ -5,10 +5,11 @@ SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES
(-100, 'scribe26', '0000000A');
(-100, 'DRAAF', '130007107');
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
(-100, -100, 'admin', 'Administrateur', 'scribe26', 'PWD_CAS', 'admin@scribe26.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '0000000A', 'simple');
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}30Z8NQIFHi2TUxnZr8sENMbBiOWgonju
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');
@ -24,6 +25,7 @@ INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `f
(1200, NULL, 1200, 'ORGANISATION', NULL, 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''),
(1210, 1200, 1210, 'Listes Blanche', 'cadoles_core_config_whitelist', 'fa-tasks', 'ROLE_ADMIN,ROLE_MODO', ''),
(1220, 1200, 1220, 'Niveau 01', 'cadoles_core_config_niveau01', 'fa-building', 'ROLE_ADMIN,ROLE_MODO', ''),
(1230, 1200, 1230, 'Niveau 02', 'cadoles_core_config_niveau02', 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''),
(1240, 1200, 1240, 'Groupes', 'cadoles_core_config_group', 'fa-users', 'ROLE_ADMIN,ROLE_MODO', ''),
(1250, 1200, 1250, 'Inscriptions', 'cadoles_core_config_registration', 'fa-pencil-square-o', 'ROLE_ADMIN,ROLE_MODO', ''),
(1260, 1200, 1260, 'Utilisateurs', 'cadoles_core_config_user', 'fa-child', 'ROLE_ADMIN,ROLE_MODO', ''),

View File

@ -509,28 +509,10 @@ class GroupController extends Controller
$em->persist($usergroup);
$em->flush();
// Notification message
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
$message="Inscription de l'utilisateur<br>".$user->getLastname()." ".$user->getFirstname()."<br>Par ".$this->getUser()->getLastname()." ".$this->getUser()->getFirstname();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key->toString(),$userid,$groupid,$message);
// Notification mail auprès de la personne inscrite
if($group->getFgcanshare()) {
$text="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel();
$template="template";
$mail_params=array(
"subject" => $this->get('session')->get('appname')." : Inscription au groupe de travail : ".$group->getLabel()."\n\n".$group->getDescription(),
"body_html"=>nl2br($text),
"body_text"=>$text
);
$to = $user->getEmail();
$from = $this->getParameter('noreply');;
$fromName = $this->get('session')->get('appname');
$message = $this->container->get('cadoles.core.service.mail');
$message->sendEmail($template, $mail_params, $to, $from, $fromName);
}
// Retour
$response = new Response(json_encode($output));
$response->headers->set('Content-Type', 'application/json');
return $response;
@ -553,36 +535,15 @@ class GroupController extends Controller
if($group->getFgAll()||$group->getFgTemplate())
throw $this->createNotFoundException('Permission denied');
// Notification message
$data = $em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(array("user"=>$userid,"group"=>$groupid));
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
$message="Désinscription de l'utilisateur<br>".$user->getLastname()." ".$user->getFirstname()."<br>Par ".$this->getUser()->getLastname()." ".$this->getUser()->getFirstname();;
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($data->getKeyvalue(),$userid,$groupid,$message);
// Desinscription
$em->remove($data);
$em->flush();
// Notification mail auprès des managers
if($group->getFgcanshare()) {
$text=$user->getUsername()." a été désinscrit dugroupe de travail : ".$group->getLabel();
$template="template";
$mail_params=array(
"subject" => $this->get('session')->get('appname')." : ".$user->getUsername()." = Désinscription au groupe de travail ".$group->getLabel()."\n\n".$group->getDescription(),
"body_html"=>nl2br($text),
"body_text"=>$text
);
$managers=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$groupid,"fgmanager"=>true));
$to=array();
foreach($managers as $manager) {
array_push($to,$manager->getUser()->getEmail());
}
$from = $this->getParameter('noreply');;
$fromName = $this->get('session')->get('appname');
$message = $this->container->get('cadoles.core.service.mail');
$message->sendEmail($template, $mail_params, $to, $from, $fromName);
}
$response = new Response(json_encode($output));
$response->headers->set('Content-Type', 'application/json');
@ -596,39 +557,14 @@ class GroupController extends Controller
if($group->getFgAll()||$group->getFgTemplate())
throw $this->createNotFoundException('Permission denied');
// Notification message
$usergroup = $em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(array("user"=>$this->getUser(),"group"=>$id));
$user=$em->getRepository("CadolesCoreBundle:User")->find($this->getUser());
$message="Désinscription de l'utilisateur<br>".$user->getLastname()." ".$user->getFirstname()."<br>Par ".$this->getUser()->getLastname()." ".$this->getUser()->getFirstname();;
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($usergroup->getKeyvalue(),$this->getUser()->getId(),$id,$message);
// Desinscription
$em->remove($usergroup);
$em->flush();
// Notification mail auprès des managers
if($group->getFgcanshare()) {
$text=$user->getUsername()." a été désinscrit dugroupe de travail : ".$group->getLabel();
$template="template";
$mail_params=array(
"subject" => $this->get('session')->get('appname')." : ".$user->getUsername()." = Désinscription au groupe de travail ".$group->getLabel()."\n\n".$group->getDescription(),
"body_html"=>nl2br($text),
"body_text"=>$text
);
$managers=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group,"fgmanager"=>true));
$to=array();
foreach($managers as $manager) {
array_push($to,$manager->getUser()->getEmail());
}
$from = $this->getParameter('noreply');;
$fromName = $this->get('session')->get('appname');
$message = $this->container->get('cadoles.core.service.mail');
$message->sendEmail($template, $mail_params, $to, $from, $fromName);
}
return $this->redirect($this->generateUrl("cadoles_core_user_group"));
}

View File

@ -298,7 +298,10 @@ class UserController extends Controller
$data->setVisible(true);
$data->setBelongingpopulation("authlevel");
$data->setAuthlevel("simple");
$fields=$this->getDefaultDatauser();
$config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser");
$fields=$config->getValue();
$fields=json_decode($fields,true);
// Création du formulaire
$form = $this->createForm(UserType::class,$data,array(
@ -348,25 +351,8 @@ class UserController extends Controller
$em->persist($usergroup);
$em->flush();
// Notification message
$message="Inscription de l'utilisateur<br>".$data->getLastname()." ".$data->getFirstname()."<br>Par ".$this->getUser()->getLastname()." ".$this->getUser()->getFirstname();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key->toString(),$iduser,$idgroup,$message);
// Notification mail auprès de la personne inscrite
if($group->getFgcanshare()) {
$text="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel();
$template="template";
$mail_params=array(
"subject" => $this->get('session')->get('appname')." : Inscription au groupe de travail : ".$group->getLabel()."\n\n".$group->getDescription(),
"body_html"=>nl2br($text),
"body_text"=>$text
);
$to = $data->getEmail();
$from = $this->getParameter('noreply');;
$fromName = $this->get('session')->get('appname');
$message = $this->container->get('cadoles.core.service.mail');
$message->sendEmail($template, $mail_params, $to, $from, $fromName);
}
}
// Ajout des modos
@ -407,7 +393,9 @@ class UserController extends Controller
// Récupération de l'enregistrement courant
$data=$this->getData($id);
$oldpassword=$data->getPassword();
$fields=$this->getDefaultDatauser();
$config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser");
$fields=$config->getValue();
$fields=json_decode($fields,true);
// Si un acces modo via console d'admin on s'assure qu'il a les droit dessus sinon retour à la liste
if($this->isGranted('ROLE_MODO')&&$access=="config") {
@ -488,25 +476,8 @@ class UserController extends Controller
$em->persist($usergroup);
$em->flush();
// notification message
$message="Inscription de l'utilisateur<br>".$data->getLastname()." ".$data->getFirstname()."<br>Par ".$this->getUser()->getLastname()." ".$this->getUser()->getFirstname();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key->toString(),$id,$idgroup,$message);
// Notification mail auprès de la personne inscrite
if($group->getFgcanshare()) {
$text="Vous venez d'être inscrit dans le groupe de travail : ".$group->getLabel();
$template="template";
$mail_params=array(
"subject" => $this->get('session')->get('appname')." : Inscription au groupe de travail : ".$group->getLabel()."\n\n".$group->getDescription(),
"body_html"=>nl2br($text),
"body_text"=>$text
);
$to = $data->getEmail();
$from = $this->getParameter('noreply');;
$fromName = $this->get('session')->get('appname');
$message = $this->container->get('cadoles.core.service.mail');
$message->sendEmail($template, $mail_params, $to, $from, $fromName);
}
}
// Suppression des groupes obsolètes
@ -523,34 +494,11 @@ class UserController extends Controller
->getQuery()
->getResult();
foreach($usergroups as $usergroup) {
// Notification message
$message="Désinscription de l'utilisateur<br>".$data->getLastname()." ".$data->getFirstname()."<br>Par ".$this->getUser()->getLastname()." ".$this->getUser()->getFirstname();
$websocket = $this->container->get('cadoles.websocket.pushmessage')->send($usergroup->getKeyvalue(),$id,$idgroup,$message);
// Déscription
$em->remove($usergroup);
$em->flush();
// Notification mail auprès des managers
if($group->getFgcanshare()) {
$text=$data->getUsername()." a été désinscrit dugroupe de travail : ".$group->getLabel();
$template="template";
$mail_params=array(
"subject" => $this->get('session')->get('appname')." : ".$data->getUsername()." = Désinscription au groupe de travail ".$group->getLabel()."\n\n".$group->getDescription(),
"body_html"=>nl2br($text),
"body_text"=>$text
);
$managers=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group,"fgmanager"=>true));
$to=array();
foreach($managers as $manager) {
array_push($to,$manager->getUser()->getEmail());
}
$from = $this->getParameter('noreply');;
$fromName = $this->get('session')->get('appname');
$message = $this->container->get('cadoles.core.service.mail');
$message->sendEmail($template, $mail_params, $to, $from, $fromName);
}
}
}
@ -620,7 +568,9 @@ class UserController extends Controller
// Récupération de l'enregistrement courant
$data=$this->getData($id);
$fields=$this->getDefaultDatauser();
$config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser");
$fields=$config->getValue();
$fields=json_decode($fields,true);
// Si un acces modo via console d'admin on s'assure qu'il a les droit dessus sinon retour à la liste
if($this->isGranted('ROLE_MODO')&&$access=="config") {
@ -893,7 +843,7 @@ class UserController extends Controller
$em->persist($user);
$em->flush();
// Email à destination de l'inscrit pour le prévenir qu'il dispose d'un compte
// Email à destination de l'inscript pour le prévenir qu'il dispose d'un compte
$url = $this->generateUrl('cadoles_core_resetpwd01', [], UrlGeneratorInterface::ABSOLUTE_URL);
$text ="Vous venez d'être inscrit au portail = ".$appname."\n\n";
$text.="Login = ".$username."\n";
@ -980,64 +930,6 @@ class UserController extends Controller
return $datas;
}
protected function getDefaultDatauser()
{
$em = $this->getDoctrine()->getManager();
$config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser");
$fields=$config->getValue();
$fields=json_decode($fields,true);
if($fields=="") {
// Valeur par défaut 0=caché / 1=falcultatif / 2=obligatoire
$fields["firstname"]["perm"]=1;
$fields["firstname"]["label"]="Prénom";
$fields["visible"]["perm"]=2;
$fields["visible"]["label"]="Visible";
$fields["authlevel"]["perm"]=2;
$fields["authlevel"]["label"]="Niveau d'authentification";
$fields["belongingpopulation"]["perm"]=2;
$fields["belongingpopulation"]["label"]="Population d'appartenance";
$fields["job"]["perm"]=1;
$fields["job"]["label"]="Métier";
$fields["position"]["perm"]=1;
$fields["position"]["label"]="Fonction";
$fields["niveau02"]["perm"]=1;
$fields["niveau02"]["label"]="Niveau 02";
$fields["usualname"]["perm"]=1;
$fields["usualname"]["label"]="Nom d'Usage";
$fields["gender"]["perm"]=1;
$fields["gender"]["label"]="Sexe";
$fields["givensname"]["perm"]=1;
$fields["givensname"]["label"]="Autre Prénom";
$fields["telephonenumber"]["perm"]=1;
$fields["telephonenumber"]["label"]="Téléphone";
$fields["postaladress"]["perm"]=1;
$fields["postaladress"]["label"]="Adresse";
$fields["birthdate"]["perm"]=1;
$fields["birthdate"]["label"]="Date de Naissance";
$fields["birthcountry"]["perm"]=1;
$fields["birthcountry"]["label"]="Pays de Naissance";
$fields["birthplace"]["perm"]=1;
$fields["birthplace"]["label"]="Ville de Naissance";
}
return $fields;
}
protected function getErrorForm($id,$form,$request,$data,$mode) {
if ($form->get('submit')->isClicked()&&$mode=="delete") {
}

View File

@ -869,38 +869,4 @@ class Group
{
return $this->messages;
}
/**
* Add calendarevent
*
* @param \Cadoles\PortalBundle\Entity\Calendarevent $calendarevent
*
* @return Group
*/
public function addCalendarevent(\Cadoles\PortalBundle\Entity\Calendarevent $calendarevent)
{
$this->calendarevents[] = $calendarevent;
return $this;
}
/**
* Remove calendarevent
*
* @param \Cadoles\PortalBundle\Entity\Calendarevent $calendarevent
*/
public function removeCalendarevent(\Cadoles\PortalBundle\Entity\Calendarevent $calendarevent)
{
$this->calendarevents->removeElement($calendarevent);
}
/**
* Get calendarevents
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getCalendarevents()
{
return $this->calendarevents;
}
}

View File

@ -266,10 +266,6 @@ class User implements UserInterface, \Serializable
*/
protected $messagereaders;
/**
* @ORM\ManyToMany(targetEntity="Cadoles\WebsocketBundle\Entity\Message", mappedBy="sees")
*/
protected $messagesees;
//== CODE A NE PAS REGENERER
/**
@ -1425,38 +1421,4 @@ class User implements UserInterface, \Serializable
{
return $this->messagereaders;
}
/**
* Add messagesee
*
* @param \Cadoles\WebsocketBundle\Entity\Message $messagesee
*
* @return User
*/
public function addMessagesee(\Cadoles\WebsocketBundle\Entity\Message $messagesee)
{
$this->messagesees[] = $messagesee;
return $this;
}
/**
* Remove messagesee
*
* @param \Cadoles\WebsocketBundle\Entity\Message $messagesee
*/
public function removeMessagesee(\Cadoles\WebsocketBundle\Entity\Message $messagesee)
{
$this->messagesees->removeElement($messagesee);
}
/**
* Get messagesees
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getMessagesees()
{
return $this->messagesees;
}
}

View File

@ -591,6 +591,7 @@ a.item-heart {
position: absolute;
height:40px;
width:40px;
border-radius: 100%;
margin: 5px;
cursor: pointer;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,12 +1,12 @@
{% set logo = "transnum-logo.png" %}
{% set fgheader = "" %}
{% set header = "transnum-header.png" %}
{% set header = "transnum-header.jpg" %}
{% set heightheader = "" %}
{% set colormain = "2176ad" %}
{% set fontcolorhover = "" %}
{% set colorbody = "eeeeee" %}
{% set colorbody = "" %}
{% set fontfacetitle = "LexendDeca-Regular" %}
{% set fontfacebody = "" %}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -3,16 +3,7 @@
}
body {
background-color: #2e3339 !important;
}
body.simple {
background-color: transparent !important;
}
.navbar-default,.sidebar ul li {
background-color: #2e3339 !important;
border-color: #2e3339 !important;
}
@ -59,17 +50,6 @@ 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 {
width: 15%;
min-width: 160px;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -159,7 +159,7 @@
<h3>Mes Icônes</h3>
{% for icon in iconsuser %}
<a style="cursor:pointer" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px; margin-bottom:2px; background-color: #{{ color["main"]}}">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
</a>
{% endfor %}
@ -167,7 +167,7 @@
{% endif %}
{% for icon in icons %}
<a style="cursor:pointer" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px; margin-bottom:2px; background-color: #{{ color["main"]}}">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
</a>
{% endfor %}
</div>

View File

@ -10,7 +10,7 @@
</h1>
{% set permgroup = app.session.get('permgroup') %}
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODO') or (is_granted('ROLE_ANIM') and (permgroup=="ROLE_ADMIN" or permgroup=="ROLE_ANIM")) or (is_granted('ROLE_USER') and permgroup=="ROLE_USER") %}
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODO') or (is_granted('ROLE_ANIM') and (permgroup=="ROLE_ADMIN" or permgroup=="ROLE_USER")) or (is_granted('ROLE_USER') and permgroup=="ROLE_USER") %}
<p><a class="btn btn-success" href={{ path('cadoles_core_'~access~'_group_submit') }}>
{% if access=="config" %}
Ajouter

View File

@ -156,9 +156,7 @@
<tbody>
{% for group in user.groups %}
<tr id="linkgroup{{ group.group.id }}">
{% if access=="config" and not group.group.fgall and group.group.ldapfilter=="" and group.group.attributes =="" %}
<td><a style="cursor:pointer" title="Se Désinscrire"><i class="fa fa-sign-out fa-fw" onclick="removeLinkGroup({{ group.group.id }})"></i></a></td>
{% elseif (group.group.fgopen or group.group.fgcanshare) and group.group.owner!=app.user and not group.group.fgall and group.group.ldapfilter=="" and group.group.attributes =="" %}
{% if (access=="config" or group.group.fgopen or group.group.fgcanshare) and group.group.owner!=app.user and not group.group.fgall and group.group.ldapfilter=="" and group.group.attributes =="" %}
<td><a style="cursor:pointer" title="Se Désinscrire"><i class="fa fa-sign-out fa-fw" onclick="removeLinkGroup({{ group.group.id }})"></i></a></td>
{% else %}
<td></td>

View File

@ -733,25 +733,6 @@ class InitDataCommand extends ContainerAwareCommand
$entityWidget->setParameter($parameter);
$em->persist($entityWidget);
// Actualités des groupes
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1820);
if(!$entityWidget) $entityWidget = new Widget();
$entityicon = $em->getRepository('CadolesPortalBundle:Icon')->findoneby(["label"=>"uploads/icon/icon_megaphone2.png"]);
$entityWidget->setId(-1820);
$entityWidget->setRoworder(2);
$entityWidget->setIcon($entityicon);
$entityWidget->setName('Actualités de mes Groupes');
$entityWidget->setDescription("Affiche la liste actualités de vos groupes de travail");
$entityWidget->setRouteview("cadoles_portal_config_panelwidget_view_groupmessage");
$entityWidget->setHeight("630");
$entityWidget->setAutoajust(true);
$entityWidget->setBorder(false);
$entityWidget->setOpened(true);
$entityWidget->setAccess(["config","user","group"]);
$parameter = json_decode('{"fields": [{"id": "nbarticle", "loc": "col1", "type": "integer", "label": "Nombre d\'actualitées affichées (0 pour tout)", "value": "5", "mandatory": "true"},{"id": "modelist", "loc": "col1", "type": "modelist", "label": "Mode Affichage", "value": "1", "mandatory": "true"}]}');
$entityWidget->setParameter($parameter);
$em->persist($entityWidget);
// Widget Séparateur
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find(-1600);
if(!$entityWidget) $entityWidget = new Widget();
@ -861,73 +842,6 @@ class InitDataCommand extends ContainerAwareCommand
}
}
// Template Group
$entityPage = $em->getRepository('CadolesPortalBundle:Page')->find(-110);
if(!$entityPage) {
$entityPagecategory = $em->getRepository('CadolesPortalBundle:Pagecategory')->find(2);
$entityPage = new Page();
$entityPage->setId(-110);
$entityPage->setRowOrder(0);
$entityPage->setName('Accueil Groupe');
$entityPage->setParentfor('Groupe');
$entityPage->setMaxwidth(1500);
$entityPage->setPagecategory($entityPagecategory);
$entityPage->setTemplate('{"rows":[{"id":0,"cols":[{"id":0,"size": 4,"rows":[]},{"id":1,"size": 8,"rows":[{"id":0,"cols":[{"id":0,"size": 12}]},{"id":1,"cols":[{"id":0,"size": 6},{"id":1,"size": 6}]}]}]}]}');
$em->persist($entityPage);
$em->flush();
// Widget Nos Liens
$fields=["fields"=>[["id"=>"modedesktop","value"=>2]]];
$this->addWidget(-120,$entityPage,-1960,"R1C1",1,"Nos Liens",true,$fields);
// Widget Nos Fichiers
$fields=["fields"=>[]];
$this->addWidget(-130,$entityPage,-1920,"R1C1",2,"Nos Fichiers",true,$fields);
// Widget Info Page
$fields=["fields"=>[]];
$this->addWidget(-140,$entityPage,-1860,"R1C1",3,"Information Page",true,$fields);
// Widget Notre Blog
$fields=["fields"=>[["id"=>"nbarticle","value"=>5]]];
$this->addWidget(-150,$entityPage,-1890,"R1C2R1C1",1,"Notre Blog",false,$fields);
// Widget Notre Calendrier
$fields=["fields"=>[["id"=>"nbday","value"=>30]]];
$this->addWidget(-160,$entityPage,-1900,"R1C2R2C1",1,"Notre Calendrier",true,$fields);
// Chat
$fields=["fields"=>[]];
$this->addWidget(-170,$entityPage,-1840,"R1C2R2C2",1,"Chat",true,$fields);
}
$output->writeln('');
}
private function addWidget($id,$entityPage,$widgetid,$loc,$order,$title,$border,$fields) {
$em = $this->getContainer()->get('doctrine')->getEntityManager();
$entityPagewidget = $em->getRepository('CadolesPortalBundle:Pagewidget')->find($id);
if(!$entityPagewidget) {
$entityWidget = $em->getRepository('CadolesPortalBundle:Widget')->find($widgetid);
$entityPagewidget = new Pagewidget();
$entityPagewidget->setId($id);
$entityPagewidget->setLoc($loc);
$entityPagewidget->setRoworder($order);
$entityPagewidget->setName($title);
$entityPagewidget->setHeight($entityWidget->getHeight());
$entityPagewidget->setAutoajust($entityWidget->getAutoajust());
$entityPagewidget->setBorder($border);
$entityPagewidget->setOpened($entityWidget->getOpened());
$entityPagewidget->setIcon($entityWidget->getIcon());
$entityPagewidget->setPage($entityPage);
$entityPagewidget->setWidget($entityWidget);
$entityPagewidget->setParameter($fields);
$em->persist($entityPagewidget);
$em->flush();
}
}
}

View File

@ -646,27 +646,6 @@ class PageController extends Controller
}
public function msgcounterAction(Request $request,$access="config")
{
// S'assurer que c'est un appel ajax
if (!$request->isXmlHttpRequest()) {
return new JsonResponse(array('message' => 'Interdit'), 400);
}
$user=$this->getUser();
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$entity,$pagesuser,$pagesadmin,$groupsshared);
$output=[];
foreach($groupsshared as $groupshared) {
$output[$groupshared->getId()]=$groupshared->pagesshared[0]->getCounterRead();
}
$response = new Response(json_encode($output));
$response->headers->set('Content-Type', 'application/json');
return $response;
}
protected function getErrorForm($id,$form,$request,$data,$mode) {
if ($form->get('submit')->isClicked() && $mode=="submit") {
$usage = $form->get('usage')->getData();

View File

@ -1878,7 +1878,6 @@ class PagewidgetController extends Controller
$group=$em->getRepository("CadolesCoreBundle:Group")->find($group);
if($group) {
$title=$group->getLabel();
$id=$group->getId();
if($group->getDescription())
$description="<strong>Description</strong><br>".$group->getDescription();
if($group->getIcon())
@ -1894,7 +1893,6 @@ class PagewidgetController extends Controller
else {
$title=$entity->getPage()->getName();
$proprio=$entity->getPage()->getUser();
$id=0;
if($proprio) {
$description="Propriétaire de la page<br>".$proprio->getLastname()." ".$proprio->getLastname();
$icon="/uploads/avatar/".$proprio->getAvatar();
@ -1909,8 +1907,7 @@ class PagewidgetController extends Controller
'icon' => $icon,
'title' => $title,
'description' => $description,
'members' => $members,
'id' => $id,
'members' => $members
]);
}
@ -1933,10 +1930,11 @@ class PagewidgetController extends Controller
if(!$cansee) throw $this->createNotFoundException('Permission denied');
}
if($usage!="group"||!$group) {
if($usage!="group") {
$group=$em->getRepository("CadolesCoreBundle:Group")->findOneBy(["fgall"=>true])->getId();
}
dump($group);
// Render
return $this->render($this->labelentity.':viewchat.html.twig', [
@ -1995,85 +1993,4 @@ class PagewidgetController extends Controller
]);
}
public function viewgroupmessageAction(Request $request,$id,$access="config") {
$usage=$request->query->get('usage');
$group=$request->query->get('group');
$user=$this->getUser();
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
// Permissions
if($access=="config") {
$canupdate = true;
}
else {
// On s'assure que l'utilisateur à la permission de voir
$page=$entity->getPage();
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
if(!$cansee) throw $this->createNotFoundException('Permission denied');
}
// Récupération des paramétres du widget
$modelist=1;
$nbarticle=5;
foreach($entity->getParameter()["fields"] as $parameter) {
switch($parameter["id"]) {
case "modelist":
$modelist=$parameter["value"];
break;
case "nbarticle":
$nbarticle=$parameter["value"];
break;
}
}
$mygroups=[];
$mymsg= [];
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared);
if(is_array($groupsshared)) {
foreach($groupsshared as $groupshared) {
// On récupère l'ensemble des messages du groupes
$messages=$this->getDoctrine()->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$groupshared]);
foreach($messages as $key => $message) {
// persistante collection à revoir
if($message->getSees()->count()>0) {
if($message->getSees()->contains($user) ) {
unset($messages[$key]);
}
}
}
foreach($messages as $key => $message) {
$tmp=["id" => $message->getId(), "user" => $message->getUser(), "date"=>$message->getSubmitdate(), "topic"=>$message->getTopic()];
array_push($mymsg,$tmp);
}
}
$ord = array();
foreach ($mymsg as $key => $value){
$ord[] = $value['date'];
}
array_multisort($ord, SORT_DESC, $mymsg);
}
// Render
return $this->render($this->labelentity.':viewgroupmessage.html.twig', [
'entity' => $entity,
'canadd' => ($user),
'canupdate' => $canupdate,
'usage' => $usage,
'modelist' => $modelist,
'messages' => $mymsg,
'nbarticle' => $nbarticle,
]);
}
}

View File

@ -260,20 +260,6 @@ class PageRepository extends EntityRepository
$id=$pages->current()->getId();
$entity = $this->find($id);
}
// Si aucune page profilé on récupère la premiere page perso
if(!$entity) {
if($pagesuser)
$entity=$pagesuser[0];
}
// Si aucune page profilé on récupère la premiere page perso
if(!$entity) {
if($groupsshared) {
if($groupsshared[0])
$entity=$groupsshared[0]->pagesshared[0];
}
}
}
// ou On récupère la premiere page de l'utilisateur

View File

@ -325,10 +325,6 @@ cadoles_portal_user_page_application:
path: /page/application
defaults: { _controller: CadolesPortalBundle:Page:application, access: user }
cadoles_portal_user_page_ajax_msgcounter:
path: /page/ajax/msgcounter
defaults: { _controller: CadolesPortalBundle:Page:msgcounter, access: user }
#== BOOKMARK =============================================================================================================================================
@ -771,10 +767,6 @@ cadoles_portal_config_panelwidget_view_group:
path: /config/pagewidget/view/group/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewgroup, access: config }
cadoles_portal_config_panelwidget_view_groupmessage:
path: /config/pagewidget/view/groupmessage/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewgroupmessage, access: config }
#-- Access user
cadoles_portal_user_pagewidget_widget_sumbit:
path: /user/pagewidget/submit/{idpage}/{idwidgettype}
@ -880,7 +872,3 @@ cadoles_portal_user_panelwidget_view_group:
path: /pagewidget/view/group/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewgroup, access: user }
cadoles_portal_user_panelwidget_view_groupmessage:
path: /pagewidget/view/groupmessage/{id}
defaults: { _controller: CadolesPortalBundle:Pagewidget:viewgroupmessage, access: user }

View File

@ -80,7 +80,7 @@
<div class="col-md-12">
{% for icon in icons %}
<a href="#" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px; margin-bottom:2px; background-color: #{{ color["main"]}}">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
</a>
{% endfor %}
</div>

View File

@ -47,7 +47,7 @@
<div class="panel-body">
<div style="width:90px; margin:10px auto;">
<img id="icon_label_img" src="/{{ alias }}/{{ icon.label }}" style="width:90px;height:auto;margin:auto;display:block;margin-bottom:5px;background-color: #{{color["main"]}}">
<img id="icon_label_img" src="/{{ alias }}/{{ icon.label }}" style="width:90px;height:auto;margin:auto;display:block;margin-bottom:5px;">
{{ form_widget(form.label) }}
<a class="btn btn-info" style="width:90px" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Icône','{{ path('cadoles_portal_config_icon_icon') }}');" title='Ajouter un Logo'>Modifier</a>
</div>

View File

@ -7,7 +7,7 @@
<div class="row">
{% for icon in icons %}
<a href="{{ path('cadoles_portal_'~access~'_icon_update', {id : icon.id}) }}"><img class="icon" height="90" src="/{{ alias }}/{{ icon.label }}" style="padding:10px; margin-bottom:2px; background-color: #{{color["main"]}}"></a>
<a href="{{ path('cadoles_portal_'~access~'_icon_update', {id : icon.id}) }}"><img class="icon" height="90" src="/{{ alias }}/{{ icon.label }}" style="padding:10px"></a>
{% endfor %}
</div>
{% endblock %}

View File

@ -92,7 +92,7 @@
<div class="col-md-12">
{% for icon in icons %}
<a href="#" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px;; margin-bottom:2px; background-color: #{{ color["main"]}}">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
</a>
{% endfor %}
</div>

View File

@ -269,14 +269,7 @@
order: [[ 1, "asc" ]],
});
{% if app.user %}
setInterval(function(){
loadmsgCounter()
}, 10000);
{% endif %}
// Init socket de counter
/* Désactiver car il semble préférable de faire un appel ajax régulier plutot qu'ouvrir un channel websocket
{% if websocket_activate %}
var _WS_URI = "wss://{{ gos_web_socket_server_host }}:{{ gos_web_socket_server_port }}";
@ -316,7 +309,6 @@
});
});
{% endif %}
*/
});
$(window).resize(function() {
@ -344,7 +336,6 @@
// Affichage des frames associés aux items de bureau
function showFrameitem(id,url,forcereload) {
$(".pageframereload").remove();
$(".pageframe").hide();
// Si force le rechargement et frame existante on la détruit
@ -355,11 +346,9 @@
if($("#frameitem-"+id).length)
$("#frameitem-"+id).show();
// Sinon on la génère
else {
var myclass="";
if(forcereload) myclass="pageframereload";
$("#pagecontainer").append("<iframe id='frameitem-"+id+"' class='pageframe "+myclass+"' src='"+url+"' style='border:none; width:100%'></iframe>");
}
else
$("#pagecontainer").append("<iframe id='frameitem-"+id+"' class='pageframe' src='"+url+"' style='border:none; width:100%'></iframe>");
resizeFrame();
}
@ -370,7 +359,6 @@
idpage=id;
// Cacher toutes les pages
$(".pageframereload").remove();
$(".pageframe").hide();
// Rendre actif le page en cours dans le menu
@ -390,11 +378,8 @@
if($("#page-"+id).length)
$("#page-"+id).show();
// Sinon on la génère
else {
var myclass="";
if(forcereload) myclass="pageframereload";
$("#pagecontainer").append("<iframe id='page-"+id+"' data-category='"+catid+"' class='pageframe "+myclass+"' src='"+url+"' style='border:none; width:100%'></iframe>");
}
else
$("#pagecontainer").append("<iframe id='page-"+id+"' data-category='"+catid+"' class='pageframe' src='"+url+"' style='border:none; width:100%'></iframe>");
// Détruire le badge associé car normalement de fait on a lu les notif
if(usage=="group") {
@ -470,73 +455,9 @@
$(location).attr('href', url);
};
function loadmsgCounter() {
/*
menu=$("a[data-group='"+payload.group+"']");
if(menu.length) {
if(payload.add) {
console.log("Ajout counter pour group "+payload.group+" by "+payload.from);
if(menu.children(".badge").length) {
menu.children(".badge").html(+(menu.children(".badge").html())+1);
}
else menu.append("<span id='badge-"+payload.group+"' class='badge'>1</span");
}
}
*/
$.ajax({
method: "POST",
url: "{{ path('cadoles_portal_user_page_ajax_msgcounter') }}",
success: function(data) {
$.each(data, function(group, counter) {
menu=$("a[data-group='"+group+"']");
if(menu.length) {
if(menu.children(".badge").length) {
if(counter==0)
menu.remove();
else
menu.children(".badge").html(counter);
}
else if(counter>0)
menu.append("<span id='badge-"+group+"' class='badge'>"+counter+"</span");
}
});
}
});
/*
$.ajax({
method: "GET",
url: "process.php?process=process-notifuser.php",
success: function(data, dataType)
{
if(data.trim()!="") {
var result=data.split(",");
if(parseInt(result[0])) {
$("#notif").show();
if(result[1]!=0) {
$("#notifbadge").html(result[1]);
$("#notifbadge").css('display', 'inline-block');
}
else {
$("#notifbadge").hide();
}
}
else $("#notifbadge").hide();
}
else {
$("#notif").hide();
}
}
});
*/
}
// Permet de déclencher l'évenement de modification des counter
/* Plus nécessaire on passe par de l'ajax
function counter(event) {
$('#refreshcounter').data("event",event);
$('#refreshcounter').click();
};
*/
{% endblock %}

View File

@ -531,25 +531,4 @@
var optiongrid={columnWidth: '.grid-sizer',itemSelector: '.grid-item'};
var grid = $('.grid').masonry(optiongrid);
}
// Place un message en leur
function hideMessage(id) {
$.ajax({
method: "POST",
url: "{{ path('cadoles_websocket_message_see') }}",
data: {
id:id
},
success: function() {
$(".msg-"+id).remove();
var ele = $(".msg-hidden").first();
ele.show();
ele.removeClass("msg-hidden");
var optiongrid={columnWidth: '.grid-sizer',itemSelector: '.grid-item'};
var grid = $('.grid').masonry(optiongrid);
}
});
}
{% endblock %}

View File

@ -242,6 +242,9 @@
{% set stylewidgetbodyframe = "" %}
{% set stylewidgetbodyframe = stylewidgetbodyframe ~ "background-color: #" ~ colorbodyback ~ "; " %}
{% set stylewidgetbodyframe = stylewidgetbodyframe ~ "color: #" ~ colorbodyfont ~ "; " %}
{% if entity.border %}
{% set stylewidgetbodyframe = stylewidgetbodyframe ~ "padding: 0px 0px 0px 10px; " %}
{% endif %}
{% if not entity.autoajust %}
{% set stylewidgetbodyframe = stylewidgetbodyframe ~ "height: " ~ (entity.height-50-2) ~ "px;" %}
{% endif %}

View File

@ -54,7 +54,7 @@
</div>
<div class="col-xs-4">
<div id="diviconsel" class="col-md-12 text-left" style="height:140px; padding:20px; text-align:center; background-color: #{{ color["main"] }};">
<div id="diviconsel" class="col-md-12 text-left" style="height:140px; padding:20px; text-align:center; background-color: {{ entity.colorheaderback ? entity.colorheaderback : '#000000' }};">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" height="100" />
{% endif %}
@ -110,7 +110,7 @@
<h3>Mes Icônes</h3>
{% for icon in iconsuser %}
<a style="cursor:pointer" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px; margin-bottom:2px; background-color: #{{ color["main"]}}">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
</a>
{% endfor %}
@ -119,7 +119,7 @@
{% for icon in icons %}
<a href="#" onClick="selIcon({{ icon.id }})">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px; margin-bottom:2px; background-color: #{{ color["main"]}}">
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px">
</a>
{% endfor %}
</div>

View File

@ -12,7 +12,7 @@
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
<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 %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}

View File

@ -18,7 +18,7 @@
</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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
<div class="widgetmenu">
{% if canupdate %}
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>

View File

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

View File

@ -17,7 +17,7 @@
</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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
<div class="widgetmenu">
{% if canupdate %}
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>

View File

@ -23,8 +23,7 @@
{% set colorbodyfont = color['fontcolorhover'] %}
{% endif %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -47,10 +46,8 @@
<span class="title">{{ entity.name }}</span>
</div>
<div class="widgetbody" style="{{ stylewidgetbodyframe }}; overflow-y:auto; {%if entity.border %} padding-left: 10px; {%endif%}">
{% if group is not null %}
<div class="widgetbody" style="{{ stylewidgetbodyframe }}; overflow-y:auto;">
{{ render(url('cadoles_websocket_chat',{'id':group,'framed':true,'border':entity.border,'colorbodybacklight':colorbodyback, 'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont})) }}
{% endif %}
<!--
<iframe src="{{ path(tool,{'id':group,'framed':true,'border':entity.border,'colorbodybacklight':colorbodyback, 'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont}) }}" class="{% if entity.autoajust %}frameajust {% endif %}"></iframe>
-->
@ -59,4 +56,7 @@
{% endif %}
</div>
{%endif%}
<script>
</script>

View File

@ -10,7 +10,7 @@
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
<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 {%endif%} widget-editor" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
{% if canupdate %}

View File

@ -9,7 +9,7 @@
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
{% set color = app.session.get('color') %}
@ -24,7 +24,7 @@
{% set colorbodyfont = color['fontcolorhover'] %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}
@ -48,16 +48,11 @@
<span class="title">{{ entity.name }}</span>
</div>
{% if files|length >= 1 or canupdate %}
{% if files|length >= 1 %}
<div class="widgetbody" style="{{ stylewidgetbody }}">
<div class="grid clearfix">
{% if canupdate %}
<div class="grid-sizer grid-small"></div>
<div class="grid-gutter-sizer"></div>
{% endif %}
{% for file in files|sort %}
{% if loop.index==1 and not canupdate%}
{% if loop.index==1 %}
<div class="grid-sizer grid-small"></div>
<div class="grid-gutter-sizer"></div>
{% endif %}
@ -95,7 +90,7 @@
{% endfor %}
{% if canadd %}
<div class="grid-item grid-small" style="{{ stylewidgetbodyreverse }}">
<div class="grid-item grid-small">
<div class="grid-item-content">
<a style="{{ stylewidgetmenu }}" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Fichiers','{{ path('cadoles_core_'~access~'_file_upload',{'id': 'widget-'~entity.id,'type':'all'}) }}');" title='Ajouter des fichiers'>
<div class="item-link clearfix">
@ -104,7 +99,7 @@
</div>
<div class="grid-item-title">
<h2 style="{{ stylewidgetbodyreverse }}">Ajouter un fichier</h2>
<h2 style="{{ stylewidgetbody }}">Ajouter un fichier</h2>
</div>
</div>
</a>

View File

@ -36,7 +36,7 @@
{% set stylegrid="grid-list" %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -56,7 +56,6 @@
{% set firstflux="" %}
{% if fluxs is not empty %}
<div class="widgetbody" style="{{ stylewidgetbody }} ">
{% if fluxs is defined %}
{% if fluxs|length > 1 %}
@ -117,7 +116,6 @@
{% endfor %}
</div>
</div>
{% endif %}
</div>

View File

@ -22,7 +22,7 @@
{% set colorbodyfont = color['fontcolorhover'] %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -33,7 +33,7 @@
{% if onheader %}
<div class="widgetheader" style="{{ stylewidgetbodyimage }}">
<iframe src="{{ path(tool,{'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont}) }}" style="margin-top:30px; {{ stylewidgetbodyframe }}" class="{% if entity.autoajust %}frameajust {% endif %}"></iframe>
<iframe src="{{ path(tool,{'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont}) }}" style="margin-top:30px" class="{% if entity.autoajust %}frameajust {% endif %}"></iframe>
</div>
{% else %}
<div class="widgetheader" style="{{ stylewidgetheader }}">
@ -46,7 +46,7 @@
</div>
<div class="widgetbody" style="{{ stylewidgetbodyframe }}">
<iframe src="{{ path(tool) }}" class="{% if entity.autoajust %}frameajust {% endif %}" style="{{ stylewidgetbodyframe }}"></iframe>
<iframe src="{{ path(tool) }}" class="{% if entity.autoajust %}frameajust {% endif %}"></iframe>
</div>
{% endif %}
</div>

View File

@ -9,7 +9,7 @@
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
{% set color = app.session.get('color') %}
@ -24,7 +24,7 @@
{% set colorbodyfont = color['fontcolorhover'] %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}
@ -48,16 +48,11 @@
<span class="title">{{ entity.name }}</span>
</div>
{% if files|length>0 or canupdate %}
{% if files|length>0 %}
<div class="widgetbody" style="{{ stylewidgetbody }}">
<div class="grid clearfix">
{% if canupdate %}
<div class="grid-sizer grid-image"></div>
<div class="grid-gutter-sizer"></div>
{% endif %}
{% for file in files|sort %}
{% if loop.index==1 and not canupdate %}
{% if loop.index==1 %}
<div class="grid-sizer grid-image"></div>
<div class="grid-gutter-sizer grid-gutter-sizer-image"></div>
{% endif %}
@ -79,24 +74,6 @@
</div>
</div>
{% endfor %}
{% if canadd %}
<div class="grid-item grid-list" style="{{ stylewidgetbodyreverse }};">
<div class="grid-item-content">
<a style="{{ stylewidgetmenu }}" data-toggle="modal" data-target="#mymodal" onClick="ModalLoad('mymodal','Fichiers','{{ path('cadoles_core_'~access~'_file_upload',{'id': 'widget-'~entity.id,'type':'image'}) }}');" title='Ajouter des fichiers'>
<div class="item-link clearfix">
<div class="grid-item-logo">
<img class="grid-item-img" height="110" src="/{{ alias }}/uploads/icon/icon_add.png" />
</div>
<div class="grid-item-title">
<h2 style="{{ stylewidgetbodyreverse }}">Ajouter une image</h2>
</div>
</div>
</a>
</div>
</div>
{% endif %}
</div>
</div>
{% endif %}

View File

@ -17,7 +17,7 @@
{% set canadd = true %}
{% 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 {%endif%} widget-editor" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
{% if canupdate %}

View File

@ -1,99 +0,0 @@
{% set theme = app.session.get('theme') %}
{% if theme is not empty %}
{{ include('@Theme/'~theme~'/function.html.twig') }}
{% endif %}
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
{% set stylewidget = constants.mystylewidget(entity) %}
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %}
{% set color = app.session.get('color') %}
{% set colorbodyfont = entity.colorbodyfont %}
{% if colorbodyfont is null %}
{% set colorbodyfont = color['fontcolorhover'] %}
{% endif %}
{% set colorbodyback = entity.colorbodyback %}
{% if colorbodyback is null %}
{% set colorbodyback = color['main'] %}
{% endif %}
{% set colorbodyfont = entity.colorbodyfont %}
{% if colorbodyfont is null %}
{% if colorbodyback==color['fontcolorhover'] %}
{% set colorbodyfont = color['main'] %}
{% else %}
{% set colorbodyfont = color['fontcolorhover'] %}
{% endif %}
{% endif %}
{% if modelist==0 %}
{% set stylegrid="grid-preview" %}
{% elseif modelist==1 %}
{% set stylegrid="grid-list" %}
{% 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 canupdate %}
<div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
<i class="fa fa-file fa-fw" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
</div>
{% endif %}
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if entity.icon %}
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_pin.png" class="logo"/>
{% endif %}
<span class="title">{{ entity.name }}</span>
</div>
{% if messages is not empty %}
<div class="widgetbody" style="{{ stylewidgetbody }} ">
<div class="grid clearfix">
<div class="grid-sizer {{stylegrid}}"></div>
<div class="grid-gutter-sizer {{stylegrid}}-gutter-sizer"></div>
{% set nbaff=0 %}
{% for message in messages %}
{% set nbaff=nbaff+1 %}
{% set class="" %}
{% set style="" %}
{% if nbaff > nbarticle %}
{% set class="msg-hidden" %}
{% set style="display:none" %}
{% endif %}
<div class="grid-item {{ stylegrid }} msg-{{ message.id }} {{class}}" style="{{ stylewidgetbodyreverse }}; {{style}};">
<div class="grid-item-content">
<div class="item-link clearfix">
<div class="grid-item-logo">
<img 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>
</div>
<div class="caption">
<div class="grid-item-title" style="position:inherit">
{{message.user.lastname}} {{message.user.firstname}}<br>
<small>{{message.date|date('d/m/Y H:i')}}</small><br><br>
{{ message.topic | raw }}
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>

View File

@ -19,7 +19,7 @@
{% set stylelink = "color:#" ~ color['fontcolorhover'] %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -37,7 +37,6 @@
{% endif %}
</div>
{% set canadd = false %}
<div class="widgetbody" style="{{ stylewidgetbody }}">
<div style="text-align: center;">
{%if usage=="group" %}<small>Groupe<br></small>{% endif %}
@ -56,34 +55,13 @@
</div>
<div class="grid-item-title">
{%if member.fgmanager%}
<i style="color: #FFF" class="fa fa-star" title="Manager"></i>
{% if member.user==app.user %}
{% set canadd=true %}
{% endif %}
{%endif%}<br>
{%if member.fgmanager%}<i style="color: #FFF" class="fa fa-star" title="Manager"></i>{%endif%}<br>
{{ member.user.lastname }} {{ member.user.firstname }}
</div>
</div>
</div>
{% endfor %}
{% if canadd==true %}
<div class="grid-item grid-small" 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-logo">
<img class="grid-item-img" height="110" src="/{{ alias }}/uploads/icon/icon_add.png" />
</div>
<div class="grid-item-title">
Ajouter un membre
</div>
</div>
</a>
</div>
{% endif %}
</div>
{% endif %}
</div>

View File

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

View File

@ -27,7 +27,7 @@
{% set colorbodyfont = "color: #" ~ entity.colorbodyfont %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}
@ -53,7 +53,6 @@
<span class="title">{{ entity.name }}</span>
</div>
{% if canadd or bookmarks is not empty or items is not empty %}
<div class="widgetbody" style="{{ stylewidgetbody }}">
<div class="grid clearfix">
<div class="grid-sizer {{ stylegrid }}"></div>
@ -163,8 +162,6 @@
{% endif %}
</div>
</div>
{% endif %}
</div>

View File

@ -18,7 +18,7 @@
{% set stylelink = "color:#" ~ color['fontcolorhover'] %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
{% if canupdate %}

View File

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

View File

@ -17,7 +17,7 @@
{% set stylelink = "color:#" ~ color['fontcolorhover'] ~ ";" %}
{% 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 {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate or canadd %}
<div class="widgetmenu">
{% if canupdate %}

View File

@ -11,7 +11,7 @@
{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(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">
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
@ -46,7 +46,7 @@
</div>
<div class="widgetbody" style="{{ stylewidgetbodyframe }}">
<iframe src="{{ url }}" class="{% if entity.autoajust %}frameajust {% endif %}" style="{{ stylewidgetbodyframe }}"></iframe>
<iframe src="{{ url }}" class="{% if entity.autoajust %}frameajust {% endif %}"></iframe>
</div>
{% endif %}
</div>

View File

@ -48,11 +48,12 @@ class ChatController extends Controller
// Génération d'une clé temporaire d'accès au chat
$key = Uuid::uuid4();
$usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["group"=>$group,"user"=>$user]);
if($usergroup) {
if(!$usergroup) die("noingroup".$user->getUserName());
$usergroup->setKeyvalue($key);
// Sauvegarde
$em->persist($usergroup);
$em->flush();
}
// Récupération des message du groupe
@ -74,35 +75,9 @@ class ChatController extends Controller
'border' => $border,
'colorbodyback' => $colorbodyback,
'colorbodyfont' => $colorbodyfont,
'ingroup' => ($usergroup),
'fgmanager' => ($usergroup&&($usergroup->getFgmanager()||$user->getRole()=="ROLE_ADMIN"||$user->getRole()=="ROLE_MODO")),
'fgmanager' => ($usergroup->getFgmanager()||$user->getRole()=="ROLE_ADMIN"||$user->getRole()=="ROLE_MODO"),
'form' => $form->createView()
]);
}
}
public function seeAction(Request $request)
{
// S'assurer que c'est un appel ajax
if (!$request->isXmlHttpRequest()) {
return new JsonResponse(array('message' => 'Interdit'), 400);
}
$em = $this->getDoctrine()->getManager();
$output=array();
$id=$request->request->get('id');
$user=$this->getUser();
if($user) {
$message=$em->getRepository("CadolesWebsocketBundle:Message")->find($id);
$message->addSee($user);
// Sauvegarde
$em->persist($message);
$em->flush();
}
$response = new Response(json_encode($output));
$response->headers->set('Content-Type', 'application/json');
return $response;
}
}

View File

@ -42,21 +42,13 @@ class Message
/**
* @ORM\ManyToMany(targetEntity="Cadoles\CoreBundle\Entity\User", inversedBy="messagereaders", cascade={"persist"})
* @ORM\JoinTable(name="messageuserread",
* @ORM\JoinTable(name="messageuser",
* joinColumns={@ORM\JoinColumn(name="message", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="user", referencedColumnName="id")}
* )
*/
protected $readers;
/**
* @ORM\ManyToMany(targetEntity="Cadoles\CoreBundle\Entity\User", inversedBy="messagesees", cascade={"persist"})
* @ORM\JoinTable(name="messageusersee",
* joinColumns={@ORM\JoinColumn(name="message", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="user", referencedColumnName="id")}
* )
*/
protected $sees;
/**
@ -208,38 +200,4 @@ class Message
{
return $this->readers;
}
/**
* Add see
*
* @param \Cadoles\CoreBundle\Entity\User $see
*
* @return Message
*/
public function addSee(\Cadoles\CoreBundle\Entity\User $see)
{
$this->sees[] = $see;
return $this;
}
/**
* Remove see
*
* @param \Cadoles\CoreBundle\Entity\User $see
*/
public function removeSee(\Cadoles\CoreBundle\Entity\User $see)
{
$this->sees->removeElement($see);
}
/**
* Get sees
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getSees()
{
return $this->sees;
}
}

View File

@ -1,7 +1,3 @@
cadoles_websocket_chat:
path: /websocket/chat/{id}
defaults: { _controller: CadolesWebsocketBundle:Chat:client }
cadoles_websocket_message_see:
path: /user/message/see
defaults: { _controller: CadolesWebsocketBundle:Chat:see }

View File

@ -51,7 +51,6 @@
{% endblock %}
{% block pagewrapper %}
{% if app.user and ingroup %}
{{ form_start(form) }}
<div class='row'>
{{ form_widget(form.message) }}
@ -110,7 +109,6 @@
</div>
{{ form_end(form) }}
{% endif %}
{% endblock %}
{% block localexternalscript %}
@ -120,13 +118,10 @@
{% endblock %}
{% block localjavascript %}
var webSocket;
$(document).ready(function(){
if (CKEDITOR.instances["chat_message"]) CKEDITOR.instances["chat_message"].destroy();
if (CKEDITOR.instances["chat_messagemail"]) CKEDITOR.instances["chat_messagemail"].destroy();
setTimeout(function(){
CKEDITOR.replace( 'chat_message', {
toolbar: [
{ name: 'custo01', items: [ 'Bold','Italic','Underline','RemoveFormat' ] },
@ -144,7 +139,6 @@
],
height: 150
});
},500);
$(".switch").bootstrapSwitch();
var dateoptions = {weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "2-digit", minute: "2-digit" };
@ -152,14 +146,10 @@
{% if websocket_activate and app.user %}
var _WS_URI = "wss://{{ gos_web_socket_server_host }}:{{ gos_web_socket_server_port }}";
webSocket = WS.connect(_WS_URI);
var timer;
var webSocket = WS.connect(_WS_URI);
webSocket.on("socket/connect", function (session) {
// Reinit du tps de tentative de reco
$('#modalinfo').modal('hide');
clearInterval(timer);
//the callback function in "subscribe" is called everytime an event is published in that channel.
session.subscribe("websocket/channel/{{groupid}}", function (uri, payload) {
if(payload.msg) {
@ -216,10 +206,8 @@
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);
*/
}
}
});
@ -234,13 +222,12 @@
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");
});
@ -256,42 +243,7 @@
$("#mailto").val($("#mailto").val().replace(mail, ""));
$(this).remove();
});
});
webSocket.on("socket/disconnect", function(error){
laberror="Disconnected for " + error.reason + " with code " + error.code;
console.log(laberror);
$('#modalinfo').modal('show');
if(error.code==2) {
$('#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);
var nbtentative=10;
timer=setInterval(function(){ $('#modalinfotimer').html((nbtentative--)+"s") }, 1000);
setTimeout(function(){ location.reload(true); }, 10000);
}
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>");
clearInterval(timer);
var nbtentative=10;
timer=setInterval(function(){ $('#modalinfotimer').html((nbtentative--)+"s") }, 1000);
setTimeout(function(){ location.reload(true); }, 10000);
}
if(error.code==6 || error.code==5) {
$('#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>");
clearInterval(timer);
var nbtentative=5;
timer=setInterval(function(){ $('#modalinfotimer').html((nbtentative--)+"s") }, 1000);
}
});
})
{% endif %}
});

View File

@ -37,7 +37,7 @@ class WebsocketTopic implements TopicInterface
public function onSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)
{
//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)
{
//this will broadcast the message to ALL subscribers of this topic.
$topic->broadcast(['log' => $connection->resourceId . " has left " . $topic->getId()]);
//$topic->broadcast(['msg' => $connection->resourceId . " has left " . $topic->getId()]);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -1,6 +1 @@
* * * * * root /var/www/html/ninegate/scripts/ninegate-cron.sh &>/dev/null
%if %%getVar("ninegate_activate_websocket", 'non') == "oui"
* * * * * root /var/www/html/ninegate/scripts/ninegate-websocket.sh restartifdown &>/dev/null
0 5 * * * root /var/www/html/ninegate/scripts/ninegate-websocket.sh &>/dev/null
%end if