diff --git a/src/ninegate-1.0/scripts/ninegate-mail.sh b/src/ninegate-1.0/scripts/ninegate-mail.sh index ee534a97..cadcbc97 100755 --- a/src/ninegate-1.0/scripts/ninegate-mail.sh +++ b/src/ninegate-1.0/scripts/ninegate-mail.sh @@ -4,7 +4,7 @@ cd /var/www/html/ninegate ninegate_activer_localmail=$(CreoleGet ninegate_activer_localmail non) if [[ "$ninegate_activer_localmail" = 'oui' ]] then - php bin/console swiftmailer:spool:send --message-limit=100 --env=prod --transport swiftmailer.mailer.sendmail.transport + php bin/console swiftmailer:spool:send --message-limit=200 --env=prod --transport swiftmailer.mailer.sendmail.transport else - php bin/console swiftmailer:spool:send --message-limit=100 --env=prod + php bin/console swiftmailer:spool:send --message-limit=200 --env=prod fi \ No newline at end of file diff --git a/src/ninegate-1.0/scripts/ninegate-websocket.sh b/src/ninegate-1.0/scripts/ninegate-websocket.sh index eeafe2ee..2f8fc83b 100755 --- a/src/ninegate-1.0/scripts/ninegate-websocket.sh +++ b/src/ninegate-1.0/scripts/ninegate-websocket.sh @@ -19,7 +19,7 @@ if [ "$1" == "restartifdown" ] && [ -n "${pid}" ] ; then restart="no" fi -if [[ "$restart" == "yes" ]]; then +if [ "$restart" == "yes" ] && [ "$1" != "stop" ] ; 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 diff --git a/src/ninegate-1.0/src/Cadoles/CASBundle/Controller/SecurityController.php b/src/ninegate-1.0/src/Cadoles/CASBundle/Controller/SecurityController.php index 664fc84e..c351f5d5 100644 --- a/src/ninegate-1.0/src/Cadoles/CASBundle/Controller/SecurityController.php +++ b/src/ninegate-1.0/src/Cadoles/CASBundle/Controller/SecurityController.php @@ -156,6 +156,12 @@ class SecurityController extends Controller $dispatcher = new EventDispatcher(); $dispatcher->dispatch("security.interactive_login", $event); + // On enregistre sa visite + $user->setVisitedate(new \DateTime()); + $user->setVisitecpt($user->getVisitecpt()+1); + $em->persist($user); + $em->flush(); + if($redirect) return $this->redirect($redirect); else diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php index 8f449b4e..1e62bac3 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php @@ -48,7 +48,6 @@ class PurgeFileCommand extends Command // Le script est-il executé via Cron:Exec $this->byexec = $input->getArgument('byexec'); if($this->byexec=="") $this->byexec=false; - echo "pouet".$this->byexec; $this->writelnred(''); $this->writelnred('== Core:PurgeFile'); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/StatisticCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/StatisticCommand.php new file mode 100644 index 00000000..a92b7b6f --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/StatisticCommand.php @@ -0,0 +1,281 @@ +setName('Core:Statistic') + ->setDescription('Calculate Statistic') + ->setHelp('This command Calculate Statistic') + ->addArgument('cronid', InputArgument::OPTIONAL, 'ID Cron Job') + ->addArgument('lastchance', InputArgument::OPTIONAL, 'Lastchance to run the cron') + ->addArgument('byexec', InputArgument::OPTIONAL, 'By Cron:Exec') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->container = $this->getApplication()->getKernel()->getContainer(); + $this->em = $this->container->get('doctrine')->getEntityManager(); + $this->output = $output; + $this->filesystem = new Filesystem(); + $this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/"; + $alias = $this->container->getParameter('alias'); + + // Le script est-il executé via Cron:Exec + $this->byexec = $input->getArgument('byexec'); + if($this->byexec=="") $this->byexec=false; + + $this->writelnred(''); + $this->writelnred('== Core:Statistic'); + $this->writelnred('=========================================================================================================='); + + $now=new \DateTime('now'); + $yesterday=clone $now; + $yesterday->sub(new \DateInterval('P1D')); + $groups=$this->em->getRepository("CadolesCoreBundle:Group")->findBy(["fgcanshare"=>true]); + + // totcptvisite + $this->writelnred(''); + $this->writelnred('== totcptvisite'); + + $stat=$this->em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptvisite"]); + if(!$stat) { + $stat=new Statistic(); + $stat->setKeyvalue("totcptvisite"); + $stat->setValue([]); + } + $value=$stat->getValue(); + $cpt= $this->em->createQueryBuilder() + ->select('SUM(user.visitecpt) as cpt') + ->from('CadolesCoreBundle:User','user') + ->getQuery()->getOneOrNullResult(); + $value[$now->format("Y-m-d")]=($cpt["cpt"]?$cpt["cpt"]:0); + $stat->setValue($value); + $this->em->persist($stat); + $this->em->flush(); + + // totcptvisitegroup + $this->writelnred(''); + $this->writelnred('== totcptvisitegroup'); + + $stat=$this->em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptvisitegroup"]); + if(!$stat) { + $stat=new Statistic(); + $stat->setKeyvalue("totcptvisitegroup"); + $stat->setValue([]); + } + $value=$stat->getValue(); + $cpt= $this->em->createQueryBuilder() + ->select('SUM(usergroup.visitecpt) as cpt') + ->from('CadolesCoreBundle:UserGroup','usergroup') + ->getQuery()->getOneOrNullResult(); + $value[$now->format("Y-m-d")]=($cpt["cpt"]?$cpt["cpt"]:0); + $stat->setValue($value); + $this->em->persist($stat); + $this->em->flush(); + + // totcptmessage + $this->writelnred(''); + $this->writelnred('== totcptmessage'); + + $stat=$this->em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptmessage"]); + if(!$stat) { + $stat=new Statistic(); + $stat->setKeyvalue("totcptmessage"); + $stat->setValue([]); + } + $value=$stat->getValue(); + $cpt= $this->em->createQueryBuilder() + ->select('COUNT(message.id) as cpt') + ->from('CadolesWebsocketBundle:Message','message') + ->getQuery()->getOneOrNullResult(); + $value[$now->format("Y-m-d")]=($cpt["cpt"]?$cpt["cpt"]:0); + $stat->setValue($value); + $this->em->persist($stat); + $this->em->flush(); + + // totcptblogarticle + $this->writelnred(''); + $this->writelnred('== totcptblogarticle'); + + $stat=$this->em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptblogarticle"]); + if(!$stat) { + $stat=new Statistic(); + $stat->setKeyvalue("totcptblogarticle"); + $stat->setValue([]); + } + $value=$stat->getValue(); + $cpt= $this->em->createQueryBuilder() + ->select('COUNT(blogarticle.id) as cpt') + ->from('CadolesPortalBundle:Blogarticle','blogarticle') + ->getQuery()->getOneOrNullResult(); + $value[$now->format("Y-m-d")]=($cpt["cpt"]?$cpt["cpt"]:0); + $stat->setValue($value); + $this->em->persist($stat); + $this->em->flush(); + + // totcptprojecttask + $this->writelnred(''); + $this->writelnred('== totcptprojecttask'); + + $stat=$this->em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptprojecttask"]); + if(!$stat) { + $stat=new Statistic(); + $stat->setKeyvalue("totcptprojecttask"); + $stat->setValue([]); + } + $value=$stat->getValue(); + $cpt= $this->em->createQueryBuilder() + ->select('COUNT(projecttask.id) as cpt') + ->from('CadolesPortalBundle:Projecttask','projecttask') + ->getQuery()->getOneOrNullResult(); + $value[$now->format("Y-m-d")]=($cpt["cpt"]?$cpt["cpt"]:0); + $stat->setValue($value); + $this->em->persist($stat); + $this->em->flush(); + + // groupcptvisite + $this->writelnred(''); + $this->writelnred('== groupcptvisite'); + + foreach($groups as $group) { + $stat=$this->em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"groupcptvisite","group"=>$group]); + if(!$stat) { + $stat=new Statistic(); + $stat->setKeyvalue("groupcptvisite"); + $stat->setValue([]); + $stat->setGroup($group); + } + $value=$stat->getValue(); + $cpt= $this->em->createQueryBuilder() + ->select(['SUM(usergroup.visitecpt) as cpt']) + ->from('CadolesCoreBundle:UserGroup','usergroup') + ->Where('usergroup.group=:group') + ->setParameter('group', $group) + ->getQuery()->getOneOrNullResult(); + $value[$now->format("Y-m-d")]=($cpt["cpt"]?$cpt["cpt"]:0); + $stat->setValue($value); + $this->em->persist($stat); + $this->em->flush(); + } + + // groupcptmessage + $this->writelnred(''); + $this->writelnred('== groupcptmessage'); + + foreach($groups as $group) { + $stat=$this->em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"groupcptmessage","group"=>$group]); + if(!$stat) { + $stat=new Statistic(); + $stat->setKeyvalue("groupcptmessage"); + $stat->setValue([]); + $stat->setGroup($group); + } + $value=$stat->getValue(); + $cpt= $this->em->createQueryBuilder() + ->select('COUNT(message.id) as cpt') + ->from('CadolesWebsocketBundle:Message','message') + ->Where('message.group=:group') + ->setParameter('group', $group) + ->getQuery()->getOneOrNullResult(); + $value[$now->format("Y-m-d")]=($cpt["cpt"]?$cpt["cpt"]:0); + $stat->setValue($value); + $this->em->persist($stat); + $this->em->flush(); + } + + // groupcptblogarticle + $this->writelnred(''); + $this->writelnred('== groupcptblogarticle'); + + foreach($groups as $group) { + $stat=$this->em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"groupcptblogarticle","group"=>$group]); + if(!$stat) { + $stat=new Statistic(); + $stat->setKeyvalue("groupcptblogarticle"); + $stat->setValue([]); + $stat->setGroup($group); + } + $value=$stat->getValue(); + $cpt= $this->em->createQueryBuilder() + ->select('COUNT(blogarticle.id) as cpt') + ->from('CadolesPortalBundle:Blogarticle','blogarticle') + ->from('CadolesPortalBundle:Blog','blog') + ->Where('blogarticle.blog=blog') + ->andwhere(":group MEMBER OF blog.groups") + ->setParameter('group', $group) + ->getQuery()->getOneOrNullResult(); + $value[$now->format("Y-m-d")]=($cpt["cpt"]?$cpt["cpt"]:0); + $stat->setValue($value); + $this->em->persist($stat); + $this->em->flush(); + } + + // groupcptprojecttask + $this->writelnred(''); + $this->writelnred('== groupcptprojecttask'); + + foreach($groups as $group) { + $stat=$this->em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"groupcptprojecttask","group"=>$group]); + if(!$stat) { + $stat=new Statistic(); + $stat->setKeyvalue("groupcptprojecttask"); + $stat->setValue([]); + $stat->setGroup($group); + } + $value=$stat->getValue(); + $cpt= $this->em->createQueryBuilder() + ->select('COUNT(projecttask.id) as cpt') + ->from('CadolesPortalBundle:Projecttask','projecttask') + ->from('CadolesPortalBundle:Project','project') + ->Where('projecttask.project=project') + ->andwhere(":group MEMBER OF project.groups") + ->setParameter('group', $group) + ->getQuery()->getOneOrNullResult(); + $value[$now->format("Y-m-d")]=($cpt["cpt"]?$cpt["cpt"]:0); + $stat->setValue($value); + $this->em->persist($stat); + $this->em->flush(); + } + + $this->writeln(''); + return 1; + } + + private function writelnred($string) { + $this->output->writeln(''.$string.''); + $this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n"); + if($this->byexec) $this->filesystem->appendToFile($this->rootlog.'exec.log', $string."\n"); + } + private function writeln($string) { + $this->output->writeln($string); + $this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n"); + if($this->byexec) $this->filesystem->appendToFile($this->rootlog.'exec.log', $string."\n"); + } +} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/ConfigController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/ConfigController.php index 6326ccf9..c4c5cf2e 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/ConfigController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/ConfigController.php @@ -203,66 +203,94 @@ class ConfigController extends Controller $session=$this->get('session'); $config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser"); $fields=$config->getValue(); + $fields=json_decode($fields,true); + if(!is_array($fields)) $fields=[]; - if($fields=="") { - // Valeur par défaut 0=caché / 1=falcultatif / 2=obligatoire + // Valeur par défaut 0=caché / 1=falcultatif / 2=obligatoire + if(!array_key_exists("firstname",$fields)) { $fields["firstname"]["perm"]=1; $fields["firstname"]["label"]="Prénom"; + } + if(!array_key_exists("visible",$fields)) { $fields["visible"]["perm"]=2; $fields["visible"]["label"]="Visible"; + } + if(!array_key_exists("authlevel",$fields)) { $fields["authlevel"]["perm"]=2; $fields["authlevel"]["label"]="Niveau d'authentification"; + } + if(!array_key_exists("belongingpopulation",$fields)) { $fields["belongingpopulation"]["perm"]=2; $fields["belongingpopulation"]["label"]="Population d'appartenance"; + } + if(!array_key_exists("job",$fields)) { $fields["job"]["perm"]=1; $fields["job"]["label"]="Métier"; + } + if(!array_key_exists("position",$fields)) { $fields["position"]["perm"]=1; $fields["position"]["label"]="Fonction"; + } + if(!array_key_exists("niveau02",$fields)) { $fields["niveau02"]["perm"]=1; - $fields["niveau02"]["label"]="Niveau 02"; + $fields["niveau02"]["label"]=$session->get('labelniveau02'); + } + if(!array_key_exists("usualname",$fields)) { $fields["usualname"]["perm"]=1; $fields["usualname"]["label"]="Nom d'Usage"; + } + if(!array_key_exists("gender",$fields)) { $fields["gender"]["perm"]=1; $fields["gender"]["label"]="Sexe"; + } + if(!array_key_exists("givensname",$fields)) { $fields["givensname"]["perm"]=1; $fields["givensname"]["label"]="Autre Prénom"; + } + if(!array_key_exists("telephonenumber",$fields)) { $fields["telephonenumber"]["perm"]=1; $fields["telephonenumber"]["label"]="Téléphone"; + } + if(!array_key_exists("postaladress",$fields)) { $fields["postaladress"]["perm"]=1; $fields["postaladress"]["label"]="Adresse"; + } + if(!array_key_exists("birthdate",$fields)) { $fields["birthdate"]["perm"]=1; $fields["birthdate"]["label"]="Date de Naissance"; + } + if(!array_key_exists("birthcountry",$fields)) { $fields["birthcountry"]["perm"]=1; $fields["birthcountry"]["label"]="Pays de Naissance"; + } + if(!array_key_exists("birthplace",$fields)) { $fields["birthplace"]["perm"]=1; $fields["birthplace"]["label"]="Ville de Naissance"; - } - else { - $fields=json_decode($fields, true); - } + } + + if(!array_key_exists("visite",$fields)) { + $fields["visite"]["perm"]=1; + $fields["visite"]["label"]="Visite"; + } - if($session->get('viewniveau02')&&!array_key_exists("niveau02",$fields)) - $fields["niveau02"]["perm"]=1; - elseif(!$session->get('viewniveau02')) + if(!$session->get('viewniveau02')) unset($fields["niveau02"]); - if(array_key_exists("niveau02",$fields)) - $fields["niveau02"]["label"]=$session->get('labelniveau02'); - + $form = $this->createForm(DatauserType::class,$config,array("mode"=>"datauser","fields" => $fields)); @@ -311,59 +339,66 @@ class ConfigController extends Controller $config=$em->getRepository('CadolesCoreBundle:Config')->find("datausers"); $fields=$config->getValue(); - if($fields=="") { - // Valeur par défaut 0=caché / 3=visible + $fields=json_decode($fields, true); + if(!is_array($fields)) $fields=[]; + + // Valeur par défaut 0=caché / 3=visible + if(!array_key_exists("avatar",$fields)) { $fields["avatar"]["perm"]=1; $fields["avatar"]["label"]="Avatar"; - + } + if(!array_key_exists("login",$fields)) { $fields["login"]["perm"]=1; $fields["login"]["label"]="Login"; - + } + if(!array_key_exists("lastname",$fields)) { $fields["lastname"]["perm"]=1; $fields["lastname"]["label"]="Nom"; - + } + if(!array_key_exists("firstname",$fields)) { $fields["firstname"]["perm"]=1; $fields["firstname"]["label"]="Prenom"; - + } + if(!array_key_exists("email",$fields)) { $fields["email"]["perm"]=1; $fields["email"]["label"]="Email"; - + } + if(!array_key_exists("niveau01",$fields)) { $fields["niveau01"]["perm"]=1; - $fields["niveau01"]["label"]="Niveau 01"; - + $fields["niveau01"]["label"]=$session->get('labelniveau01'); + } + if(!array_key_exists("niveau02",$fields)) { $fields["niveau02"]["perm"]=1; - $fields["niveau02"]["label"]="Niveau 02"; - + $fields["niveau02"]["label"]=$session->get('labelniveau02'); + } + if(!array_key_exists("group",$fields)) { $fields["group"]["perm"]=1; $fields["group"]["label"]="Groupes"; - + } + if(!array_key_exists("job",$fields)) { $fields["job"]["perm"]=1; $fields["job"]["label"]="Métier"; - + } + if(!array_key_exists("position",$fields)) { $fields["position"]["perm"]=1; $fields["position"]["label"]="Fonction"; - + } + if(!array_key_exists("role",$fields)) { $fields["role"]["perm"]=1; $fields["role"]["label"]="Rôles"; - + } + if(!array_key_exists("telephonenumber",$fields)) { $fields["telephonenumber"]["perm"]=1; $fields["telephonenumber"]["label"]="Téléphone"; } - else { - $fields=json_decode($fields, true); + if(!array_key_exists("visitedate",$fields)) { + $fields["visitedate"]["perm"]=1; + $fields["visitedate"]["label"]="Visite"; } - $fields["niveau01"]["label"]=$session->get('labelniveau01'); - if($session->get('viewniveau02')&&!array_key_exists("niveau02",$fields)) - $fields["niveau02"]["perm"]=1; - elseif(!$session->get('viewniveau02')) + if(!$session->get('viewniveau02')) unset($fields["niveau02"]); - if(array_key_exists("niveau02",$fields)) - $fields["niveau02"]["label"]=$session->get('labelniveau02'); - - - $form = $this->createForm(DatauserType::class,$config,array("mode"=>"datausers","fields" => $fields)); // Récupération des data du formulaire diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php index 87190a93..e365fbed 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/CoreController.php @@ -103,8 +103,18 @@ class CoreController extends Controller } } + // Si niveau01 commence par autre = alors niveau01other obligatoire + $message=""; + $niveau01=strtolower($user->getNiveau01()->getLabel()); + if(stripos($niveau01,"autre")===0) { + if(!$user->getNiveau01other()) { + $toprofil=true; + $message="
Merci d'indiquer votre ".$this->getParameter("labelniveau01"); + } + } + if($toprofil) { - return $this->redirect($this->generateUrl('cadoles_core_user',array("info"=>"Merci de compléter votre profil"))); + return $this->redirect($this->generateUrl('cadoles_core_user',array("info"=>"Merci de compléter votre profil".$message))); } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php index 2176e20e..67d549bc 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/GroupController.php @@ -82,7 +82,9 @@ class GroupController extends Controller $qb=$em->createQueryBuilder(); $qb->select('COUNT(table)') ->from($this->labelentity,'table') + ->leftJoin('CadolesCoreBundle:User', 'u', 'WITH', 'table.owner = u.id') ->where('table.label LIKE :value') + ->orWhere('u.username LIKE :value') ->setParameter("value", "%".$search["value"]."%"); if($access=="user") { $qb->from("CadolesCoreBundle:UserGroup","ug") @@ -107,44 +109,46 @@ class GroupController extends Controller // Parcours des Enregistrement $qb = $em->createQueryBuilder(); - $qb->select('table')->from($this->labelentity,'table'); + $qb ->select('table') + ->from($this->labelentity,'table') + ->leftJoin('CadolesCoreBundle:User', 'u', 'WITH', 'table.owner = u.id'); if($access=="user") { $qb->from("CadolesCoreBundle:UserGroup","ug") ->andWhere(("table.fgcanshare=:flag")) ->andWhere("table.id=ug.group") ->andWhere(":user=ug.user") - ->leftJoin('CadolesCoreBundle:User', 'u', 'WITH', 'table.owner = u.id') ->setParameter("flag", true) ->setParameter("user", $this->getUser()); } if($search["value"]!="") { $qb ->andwhere('table.label LIKE :value') + ->orWhere('u.username LIKE :value') ->setParameter("value", "%".$search["value"]."%"); } switch($order[0]["column"]) { - case 1 : + case 2 : $qb->orderBy('table.label',$order[0]["dir"]); break; - case 2 : + case 3 : $qb->orderBy('table.fgopen',$order[0]["dir"]); break; - case 4 : + case 5 : $qb->orderBy('table.fgcanshare',$order[0]["dir"]); break; - case 5 : + case 6 : $qb->orderBy('table.owner',$order[0]["dir"]); break; - case 6 : + case 7 : $qb->orderBy('table.fgcancreatepage',$order[0]["dir"]); break; - case 7 : + case 8 : $qb->orderBy('table.fgcancreatecalendar',$order[0]["dir"]); break; - case 8 : + case 9 : $qb->orderBy('table.fgcancreateblog',$order[0]["dir"]); break; - case 9 : + case 10 : $qb->orderBy('table.fgcancreateproject',$order[0]["dir"]); break; } @@ -169,7 +173,9 @@ class GroupController extends Controller if($data->getId()>0&&!$data->getFgall()&&!$data->getFgTemplate()&&$this->isGranted('ROLE_ADMIN')) $action.="$data->getId()))."'>"; if(!$data->getFgall()) $action .="$data->getId()))."'>"; - + + if($data->getFgcanshare()) + $action.="$data->getId()))."'>"; } else { $fgproprio=($user==$data->getOwner()); @@ -186,9 +192,11 @@ class GroupController extends Controller $action .="$data->getId()))."'>"; } else { - $action.="$data->getId()))."' data-method='out'>"; + $action.="$data->getId()))."'>"; } + if($data->getFgcanshare()) + $action.="$data->getId()))."'>"; } @@ -196,14 +204,22 @@ class GroupController extends Controller if($this->GetParameter("masteridentity")=="LDAP") $filtre=$data->getLdapfilter(); if($this->GetParameter("masteridentity")=="SSO") $filtre=$data->getAttributes(); + if ($data->getIcon()) + $groupinfo = "getIcon()->getLabel()."' class='avatar' style='background-color:transparent'/>"; + else + $groupinfo = ""; + $userinfo=""; if($data->getOwner()) { $userinfo.="getOwner()->getAvatar()."' class='avatar' style='margin:0px 5px 0px 0px;display:inline-block;'>"; - $userinfo.=$data->getOwner()->getUsername(); + $userinfo.="
".$data->getOwner()->getUsername(); } + + array_push($output["data"],array( $action, + $groupinfo, $data->getLabel(), ($data->getFgopen()?"oui":"non"), $filtre, @@ -345,7 +361,7 @@ class GroupController extends Controller // Avatar $avatar="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)); } // Retour @@ -455,11 +471,11 @@ class GroupController extends Controller $qb->setParameter("groupid",$id); switch($order[0]["column"]) { case 2 : - $qb->orderBy('user.username',$order[0]["dir"]); + $qb->orderBy('user.username',$order[0]["dir"]); break; case 3 : - $qb->orderBy('user.email',$order[0]["dir"]); + $qb->orderBy('user.email',$order[0]["dir"]); break; } @@ -487,9 +503,14 @@ class GroupController extends Controller if($fgproprio) $fgmanager="Propriétaire du groupe"; } - + + // Visite + $visite=""; + if($usergroup->getVisitedate()) { + $visite=$usergroup->getVisitedate()->format("d/m/Y H:i")."
nb = ".$usergroup->getVisitecpt(); + } - 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(),$visite,$fgmanager)); } // Retour @@ -970,8 +991,8 @@ class GroupController extends Controller public function usergroupexportAction($id,Request $request, $access="config") { // Récupération de l'enregistrement courant - $data=$this->getData($id); - $this->canManager($data,$access); + $group=$this->getData($id); + $this->canManager($group,$access); $em = $this->getDoctrine()->getManager(); $dir = $this->get('kernel')->getRootDir() . '/../uploads/export/'; @@ -985,7 +1006,7 @@ class GroupController extends Controller $e = '"'; // this is the default but i like to be explicit // Entête de colonne - $data=["id","Login","Nom","Prénom","Email","Téléphone",$this->getParameter("labelniveau01"),$this->getParameter("labelniveau02"),"Métier","Fonction","Nom Usage","Autres Prénom","Sexe","Adresse","Date Naissance","Pays Naissance","Ville Naissance"]; + $data=["id","Login","Nom","Prénom","Email","Téléphone",$this->getParameter("labelniveau01"),$this->getParameter("labelniveau02"),"Métier","Fonction","Nom Usage","Autres Prénom","Sexe","Adresse","Date Naissance","Pays Naissance","Ville Naissance","Date Visite","Nb Visites"]; fputcsv($csvh, $data, $d, $e); // Liste des utilisateurs en fonction du role de l'utilisateur en cours @@ -1036,9 +1057,18 @@ class GroupController extends Controller "birthdate"=>($user->getBirthdate()?$user->getBirthdate()->format("d/m/Y"):""), "birthcountry"=>($user->getBirthcountry()?$user->getBirthcountry()->getLabel():""), "birthplace"=>($user->getBirthplace()?$user->getBirthplace()->getLabel():""), - + "visitedate"=>"", + "visitecpt"=>"", ]; + $usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$user,"group"=>$group]); + if($usergroup) { + if($usergroup->getVisitedate()) { + $data["visitedate"]=$usergroup->getVisitedate()->format("d/m/Y H:i"); + $data["visitecpt"]=$usergroup->getVisitecpt(); + } + } + fputcsv($csvh, $data, $d, $e); } fclose($csvh); @@ -1049,6 +1079,36 @@ class GroupController extends Controller return $response; } + public function statisticAction($id,$access) { + $group=$this->getData($id); + $em = $this->getDoctrine()->getManager(); + if(!$group) throw $this->createNotFoundException('Permission denied'); + + if($access!="config") { + $usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$this->getUser(),"group"=>$group]); + if(!$usergroup) throw $this->createNotFoundException('Permission denied'); + } + + $groupcptvisite=$em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"groupcptvisite","group"=>$group]); + $groupcptmessage=$em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"groupcptmessage","group"=>$group]); + $groupcptblogarticle=$em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"groupcptblogarticle","group"=>$group]); + $groupcptprojecttask=$em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"groupcptprojecttask","group"=>$group]); + + + return $this->render('CadolesCoreBundle:Group:statistic.html.twig',[ + 'useheader' => true, + 'usemenu' => false, + 'usesidebar' => ($access=="config"), + 'access' => $access, + 'group' => $group, + 'groupcptvisite' => $groupcptvisite, + 'groupcptmessage' => $groupcptmessage, + 'groupcptblogarticle' => $groupcptblogarticle, + 'groupcptprojecttask' => $groupcptprojecttask, + + ]); + } + protected function canManager($group,$access) { if($access!="config") { $em = $this->getDoctrine()->getManager(); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RegistrationController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RegistrationController.php index bdbbf465..e2f7bf16 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RegistrationController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RegistrationController.php @@ -159,7 +159,7 @@ class RegistrationController extends Controller $action, $data->getUsername(), $data->getEmail(), - $data->getNiveau01()->getLabel(), + $data->getNiveau01()->getLabel()."
".$data->getNiveau01other(), $data->getStatut()->getLabel(), (is_null($data->getKeyexpire())?"":$data->getKeyexpire()->format('d/m/Y H:i:s')) )); @@ -195,8 +195,22 @@ class RegistrationController extends Controller // Récupération des data du formulaire $form->handleRequest($request); + // si mode de registration byuser + if($moderegistration=="byuser") { + $idstatut=2; + } + else { + // On recherche le domaine du mail dans la liste blanche + $email=explode("@",$data->getEmail()); + $domaine=end($email); + $whitelist = $em->getRepository("CadolesCoreBundle:Whitelist")->findBy(["label"=>$domaine]); + $idstatut=(!$whitelist?1:2); + } + $statut = $em->getRepository("CadolesCoreBundle:Statut")->find($idstatut); + $data->setStatut($statut); + // Sur erreur - $this->getErrorForm(null,$form,$request,$data,"submit"); + $this->getErrorForm(null,$form,$request,$data,"submit",$idstatut); // Sur validation(z) if ($form->get('submit')->isClicked() && $form->isValid()) { @@ -219,22 +233,7 @@ class RegistrationController extends Controller $password = $encoder->encodePassword($data->getPassword(),$data->getSalt()); $data->setPassword($password); */ - - - // si mode de registration byuser - if($moderegistration=="byuser") { - $idstatut=2; - } - else { - // On recherche le domaine du mail dans la liste blanche - $email=explode("@",$data->getEmail()); - $domaine=end($email); - $whitelist = $em->getRepository("CadolesCoreBundle:Whitelist")->findBy(["label"=>$domaine]); - $idstatut=(!$whitelist?1:2); - } - $statut = $em->getRepository("CadolesCoreBundle:Statut")->find($idstatut); - $data->setStatut($statut); - + // si non : validation par administrateur if($idstatut==1) { // Email à destination de l'inscript pour le prévenir qu'un administrateur doit valider @@ -287,10 +286,17 @@ class RegistrationController extends Controller } $url = $this->generateUrl('cadoles_core_config_registration', [], UrlGeneratorInterface::ABSOLUTE_URL); + $motivation = "Login = ".$data->getUsername()."\n"; + $motivation.= "Nom = ".$data->getLastname()."\n"; + $motivation.= "Prénom = ".$data->getFirstname()."\n"; + $motivation.= "Mail = ".$data->getEmail()."\n"; + $motivation.= $this->getParameter("labelniveau01")." = ".$data->getNiveau01()->getLabel()." ".$data->getNiveau01other()."\n\n"; + $motivation.= $data->getMotivation(); + $mail_params=array( "subject" => $appname." : Inscription à valider", - "body_html"=>"Un utilisateur dont le mail n’est pas en liste blanche souhaite s’inscrire au ".$appname.".\nMerci d’approuver son inscription pour finaliser celle-ci.

Veuillez vérifier cette inscription à cette adresse:
$url", - "body_text"=>"Un utilisateur dont le mail n’est pas en liste blanche souhaite s’inscrire au ".$appname.".\nMerci d’approuver son inscription pour finaliser celle-ci.\n\nVeuillez vérifier cette inscription à cette adresse:\n$url" + "body_html"=>"Un utilisateur dont le mail n’est pas en liste blanche souhaite s’inscrire au ".$appname.".\nMerci d’approuver son inscription pour finaliser celle-ci.

Veuillez vérifier cette inscription à cette adresse:
$url

".nl2br($motivation), + "body_text"=>"Un utilisateur dont le mail n’est pas en liste blanche souhaite s’inscrire au ".$appname.".\nMerci d’approuver son inscription pour finaliser celle-ci.\n\nVeuillez vérifier cette inscription à cette adresse:\n$url\n\n".$motivation ); $message = $this->container->get('cadoles.core.service.mail'); @@ -386,7 +392,7 @@ class RegistrationController extends Controller $form->handleRequest($request); // Sur erreur - $this->getErrorForm($id,$form,$request,$data,"send"); + $this->getErrorForm($id,$form,$request,$data,"send",null); // Sur validation if ($form->get('save')->isClicked() && $form->isValid()) { @@ -581,7 +587,7 @@ class RegistrationController extends Controller $form->handleRequest($request); // Sur erreur - $this->getErrorForm($id,$form,$request,$data,"delete"); + $this->getErrorForm($id,$form,$request,$data,"delete",null); // Sur validation if ($form->get('submit')->isClicked() && $form->isValid()) { @@ -838,7 +844,7 @@ class RegistrationController extends Controller } - protected function getErrorForm($id,$form,$request,$data,$mode) { + protected function getErrorForm($id,$form,$request,$data,$mode,$idstatut) { if ($form->get('submit')->isClicked()&&$mode=="delete") { } @@ -859,6 +865,20 @@ class RegistrationController extends Controller if($this->getUserBy("username",$data->getUsername())||$this->getUserBy("email",$data->getEmail())) { $form->addError(new FormError('Un utilisateur utilise déjà ce login ou cet email')); } + + // Si niveau01 commence par autre = niveau01other obligatoire + $niveau01=strtolower($data->getNiveau01()->getLabel()); + if(stripos($niveau01,"autre")===0) { + if(!$data->getNiveau01other()) { + $form->addError(new FormError("Merci d'indiquer votre ".$this->getParameter("labelniveau01"))); + } + } + + // Si validation par administrateur demander une motivation + if(is_null($data->getMotivation() )) { + $form->addError(new FormError("Attention, le suffixe de votre adresse mail n’est pas dans la liste des administrations autorisées, merci de bien vouloir privilégier votre adresse professionnelle si vous en avez une.
Si ce n’est pas le cas, il faut que vous renseigniez la case motivation de votre demande")); + } + } if ($form->get('submit')->isClicked() && !$form->isValid()) { diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/StatisticController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/StatisticController.php new file mode 100644 index 00000000..d6a8f1ad --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/StatisticController.php @@ -0,0 +1,109 @@ +getDoctrine()->getManager(); + + $totcptvisite=$em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptvisite"]); + $totcptvisitegroup=$em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptvisitegroup"]); + $totcptmessage=$em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptmessage"]); + $totcptblogarticle=$em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptblogarticle"]); + $totcptprojecttask=$em->getRepository("CadolesCoreBundle:Statistic")->findOneBy(["keyvalue"=>"totcptprojecttask"]); + + //groupcptvisite + $statistics=$em->getRepository("CadolesCoreBundle:Statistic")->findBy(["keyvalue"=>"groupcptvisite"]); + $groupcptvisite=[]; + foreach($statistics as $statistic) { + $value=$statistic->getValue(); + $tmp=[ + "id" => $statistic->getGroup()->getId(), + "name" => $statistic->getGroup()->getLabel(), + "value" => end($value), + ]; + array_push($groupcptvisite,$tmp); + } + usort($groupcptvisite, function($a, $b) { + return $a['value'] <=> $b['value']; + }); + $topgroupcptvisite = array_slice($groupcptvisite, -20); + + //groupcptmessage + $statistics=$em->getRepository("CadolesCoreBundle:Statistic")->findBy(["keyvalue"=>"groupcptmessage"]); + $groupcptmessage=[]; + foreach($statistics as $statistic) { + $value=$statistic->getValue(); + $tmp=[ + "id" => $statistic->getGroup()->getId(), + "name" => $statistic->getGroup()->getLabel(), + "value" => end($value), + ]; + array_push($groupcptmessage,$tmp); + } + usort($groupcptmessage, function($a, $b) { + return $a['value'] <=> $b['value']; + }); + $topgroupcptmessage = array_slice($groupcptmessage, -20); + + //groupcptblogarticle + $statistics=$em->getRepository("CadolesCoreBundle:Statistic")->findBy(["keyvalue"=>"groupcptblogarticle"]); + $groupcptblogarticle=[]; + foreach($statistics as $statistic) { + $value=$statistic->getValue(); + $tmp=[ + "id" => $statistic->getGroup()->getId(), + "name" => $statistic->getGroup()->getLabel(), + "value" => end($value), + ]; + array_push($groupcptblogarticle,$tmp); + } + usort($groupcptblogarticle, function($a, $b) { + return $a['value'] <=> $b['value']; + }); + $topgroupcptblogarticle = array_slice($groupcptblogarticle, -20); + + //groupcptprojecttask + $statistics=$em->getRepository("CadolesCoreBundle:Statistic")->findBy(["keyvalue"=>"groupcptprojecttask"]); + $groupcptprojecttask=[]; + foreach($statistics as $statistic) { + $value=$statistic->getValue(); + $tmp=[ + "id" => $statistic->getGroup()->getId(), + "name" => $statistic->getGroup()->getLabel(), + "value" => end($value), + ]; + array_push($groupcptprojecttask,$tmp); + } + usort($groupcptprojecttask, function($a, $b) { + return $a['value'] <=> $b['value']; + }); + $topgroupcptprojecttask = array_slice($groupcptprojecttask, -20); + + + + return $this->render('CadolesCoreBundle:Statistic:list.html.twig',[ + 'useheader' => true, + 'usemenu' => false, + 'usesidebar' => true, + 'totcptvisite' => $totcptvisite, + 'totcptvisitegroup' => $totcptvisitegroup, + 'totcptmessage' => $totcptmessage, + 'totcptblogarticle' => $totcptblogarticle, + 'totcptprojecttask' => $totcptprojecttask, + 'groupcptvisite' => $topgroupcptvisite, + 'groupcptmessage' => $topgroupcptmessage, + 'groupcptblogarticle' => $topgroupcptblogarticle, + 'groupcptprojecttask' => $topgroupcptprojecttask, + ]); + } +} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php index 0203c579..a52ad713 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/UserController.php @@ -28,6 +28,7 @@ use Cadoles\CoreBundle\Entity\Niveau02; use Cadoles\WebsocketBundle\Entity\Message; use Cadoles\CoreBundle\Form\UserType; +use Cadoles\CoreBundle\Form\MailingType; class UserController extends Controller @@ -225,6 +226,10 @@ class UserController extends Controller break; case 12 : + $qb->orderBy('user.visitedate',$order[0]["dir"]); + break; + + case 13 : $qb->orderBy('user.role',$order[0]["dir"]); break; } @@ -264,6 +269,10 @@ class UserController extends Controller break; case 10 : + $qb->orderBy('user.visitedate',$order[0]["dir"]); + break; + + case 11 : $qb->orderBy('user.role',$order[0]["dir"]); break; } @@ -295,11 +304,12 @@ class UserController extends Controller array_push($tmp,$data->getFirstname()); array_push($tmp,"".$data->getEmail().""); array_push($tmp,$data->getTelephonenumber()); - array_push($tmp,$data->getNiveau01()->getLabel()); + array_push($tmp,$data->getNiveau01()->getLabel()."
".$data->getNiveau01other()); if($viewniveau02) array_push($tmp,($data->getNiveau02()!==null?$data->getNiveau02()->getLabel():"")); array_push($tmp,$groups); array_push($tmp,$data->getJob()); array_push($tmp,$data->getPosition()); + array_push($tmp,($data->getVisitedate()?$data->getVisitedate()->format("d/m/Y H:i")."
nb = ".$data->getVisitecpt():"")); array_push($tmp,$data->getRole()); array_push($output["data"],$tmp); @@ -769,6 +779,74 @@ class UserController extends Controller } + public function mailingAction(Request $request) { + $form = $this->createForm(MailingType::class,$this->getUser(),array( + "perm"=>$this->isGranted('ROLE_ADMIN'), + "userid"=>$this->get('security.token_storage')->getToken()->getUser()->getId(), + )); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Error si pas de message + if ($form->get('submit')->isClicked()) { + if(!$form->get('message')->getData()) { + $form->addError(new FormError("Merci de renseigner un message à votre mail")); + $errors = $form->getErrors(); + foreach( $errors as $error ) { + $request->getSession()->getFlashBag()->add("error", $error->getMessage()); + } + } + } + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $users=[]; + if($this->isGranted('ROLE_ADMIN')) { + $groups=$form->get('groups')->getData(); + foreach($groups as $group) { + foreach($group->getUsers() as $usergroup) { + if(!in_array($usergroup->getUser()->getEmail(),$users)) { + array_push($users,$usergroup->getUser()->getEmail()); + } + } + } + } + $niveau01s=$form->get('niveau01')->getData(); + foreach($niveau01s as $niveau01) { + foreach($niveau01->getUsers() as $user) { + if(!in_array($user->getEmail(),$users)) { + array_push($users,$user->getEmail()); + } + } + } + + $text=$form->get("message")->getData(); + $subject=$form->get("subject")->getData(); + $template="template"; + $mail_params=array( + "subject" => $subject, + "body_html"=>nl2br($text), + "body_text"=>$text + ); + $from = $this->getParameter('noreply'); + $fromName = $this->getUser()->getFirstname()." ".$this->getUser()->getLastname(); + $message = $this->container->get('cadoles.core.service.mail'); + foreach($users as $to) { + $message->sendEmail($template, $mail_params, $to, $from, $fromName); + } + + return $this->redirectToRoute("cadoles_core_config"); + } + + return $this->render('CadolesCoreBundle:Mail:mailing.html.twig', [ + 'useheader' => true, + 'usemenu' => false, + 'usesidebar' => true, + 'form' => $form->createView() + ]); + } + public function exportuserAction(Request $request) { $em = $this->getDoctrine()->getManager(); $dir = $this->get('kernel')->getRootDir() . '/../uploads/export/'; @@ -1147,55 +1225,88 @@ class UserController extends Controller $config=$em->getRepository('CadolesCoreBundle:Config')->find("datauser"); $fields=$config->getValue(); $fields=json_decode($fields,true); + if(!is_array($fields)) $fields=[]; - if($fields=="") { - // Valeur par défaut 0=caché / 1=falcultatif / 2=obligatoire + // Valeur par défaut 0=caché / 1=falcultatif / 2=obligatoire + if(!array_key_exists("firstname",$fields)) { $fields["firstname"]["perm"]=1; $fields["firstname"]["label"]="Prénom"; + } + if(!array_key_exists("visible",$fields)) { $fields["visible"]["perm"]=2; $fields["visible"]["label"]="Visible"; + } + if(!array_key_exists("authlevel",$fields)) { $fields["authlevel"]["perm"]=2; $fields["authlevel"]["label"]="Niveau d'authentification"; + } + if(!array_key_exists("belongingpopulation",$fields)) { $fields["belongingpopulation"]["perm"]=2; $fields["belongingpopulation"]["label"]="Population d'appartenance"; + } + if(!array_key_exists("job",$fields)) { $fields["job"]["perm"]=1; $fields["job"]["label"]="Métier"; + } + if(!array_key_exists("position",$fields)) { $fields["position"]["perm"]=1; $fields["position"]["label"]="Fonction"; + } + if(!array_key_exists("niveau02",$fields)) { $fields["niveau02"]["perm"]=1; $fields["niveau02"]["label"]="Niveau 02"; + } + if(!array_key_exists("usualname",$fields)) { $fields["usualname"]["perm"]=1; $fields["usualname"]["label"]="Nom d'Usage"; + } + if(!array_key_exists("gender",$fields)) { $fields["gender"]["perm"]=1; $fields["gender"]["label"]="Sexe"; + } + if(!array_key_exists("givensname",$fields)) { $fields["givensname"]["perm"]=1; $fields["givensname"]["label"]="Autre Prénom"; + } + if(!array_key_exists("telephonenumber",$fields)) { $fields["telephonenumber"]["perm"]=1; $fields["telephonenumber"]["label"]="Téléphone"; + } + if(!array_key_exists("postaladress",$fields)) { $fields["postaladress"]["perm"]=1; $fields["postaladress"]["label"]="Adresse"; + } + if(!array_key_exists("birthdate",$fields)) { $fields["birthdate"]["perm"]=1; $fields["birthdate"]["label"]="Date de Naissance"; + } + if(!array_key_exists("birthcountry",$fields)) { $fields["birthcountry"]["perm"]=1; $fields["birthcountry"]["label"]="Pays de Naissance"; + } + if(!array_key_exists("birthplace",$fields)) { $fields["birthplace"]["perm"]=1; $fields["birthplace"]["label"]="Ville de Naissance"; } + if(!array_key_exists("visite",$fields)) { + $fields["visite"]["perm"]=1; + $fields["visite"]["label"]="Visite"; + } return $fields; } @@ -1220,6 +1331,14 @@ class UserController extends Controller if($this->getRegistrationBy("username",$data->getUsername())||$this->getRegistrationBy("email",$data->getEmail())) { $form->addError(new FormError('Une inscription utilise déjà ce login ou cet email')); } + + // Si niveau01 commence par autre = niveau01other obligatoire + $niveau01=strtolower($data->getNiveau01()->getLabel()); + if(stripos($niveau01,"autre")===0) { + if(!$data->getNiveau01other()) { + $form->addError(new FormError("Merci d'indiquer votre ".$this->getParameter("labelniveau01"))); + } + } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Group.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Group.php index e8ac35f7..d6430c7d 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Group.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Group.php @@ -176,6 +176,10 @@ class Group */ protected $messages; + /** + * @ORM\OneToMany(targetEntity="Statistic", mappedBy="group", cascade={"persist"}, orphanRemoval=true) + */ + private $statistics; // Champs temporaire protected $nosynconly; @@ -1018,4 +1022,38 @@ class Group { return $this->fgcancreateproject; } + + /** + * Add statistic + * + * @param \Cadoles\CoreBundle\Entity\Statistic $statistic + * + * @return Group + */ + public function addStatistic(\Cadoles\CoreBundle\Entity\Statistic $statistic) + { + $this->statistics[] = $statistic; + + return $this; + } + + /** + * Remove statistic + * + * @param \Cadoles\CoreBundle\Entity\Statistic $statistic + */ + public function removeStatistic(\Cadoles\CoreBundle\Entity\Statistic $statistic) + { + $this->statistics->removeElement($statistic); + } + + /** + * Get statistics + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getStatistics() + { + return $this->statistics; + } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Registration.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Registration.php index 585473b2..a19080ea 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Registration.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Registration.php @@ -123,6 +123,16 @@ class Registration implements UserInterface, \Serializable */ private $position; + /** + * @ORM\Column(type="string", length=150, nullable=true) + */ + private $niveau01other; + + /** + * @ORM\Column(name="description", type="text", nullable=true) + */ + private $motivation; + /** * @ORM\Column(type="integer", length=60, nullable=true) */ @@ -738,4 +748,52 @@ class Registration implements UserInterface, \Serializable { return $this->groupid; } + + /** + * Set niveau01other + * + * @param string $niveau01other + * + * @return Registration + */ + public function setNiveau01other($niveau01other) + { + $this->niveau01other = $niveau01other; + + return $this; + } + + /** + * Get niveau01other + * + * @return string + */ + public function getNiveau01other() + { + return $this->niveau01other; + } + + /** + * Set motivation + * + * @param string $motivation + * + * @return Registration + */ + public function setMotivation($motivation) + { + $this->motivation = $motivation; + + return $this; + } + + /** + * Get motivation + * + * @return string + */ + public function getMotivation() + { + return $this->motivation; + } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Statistic.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Statistic.php new file mode 100644 index 00000000..c3a6eea7 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/Statistic.php @@ -0,0 +1,118 @@ +id; + } + + /** + * Set keyvalue + * + * @param string $keyvalue + * + * @return Statistic + */ + public function setKeyvalue($keyvalue) + { + $this->keyvalue = $keyvalue; + + return $this; + } + + /** + * Get keyvalue + * + * @return string + */ + public function getKeyvalue() + { + return $this->keyvalue; + } + + /** + * Set value + * + * @param array $value + * + * @return Statistic + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return array + */ + public function getValue() + { + return $this->value; + } + + /** + * Set group + * + * @param \Cadoles\CoreBundle\Entity\Group $group + * + * @return Statistic + */ + public function setGroup(\Cadoles\CoreBundle\Entity\Group $group = null) + { + $this->group = $group; + + return $this; + } + + /** + * Get group + * + * @return \Cadoles\CoreBundle\Entity\Group + */ + public function getGroup() + { + return $this->group; + } +} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/User.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/User.php index aca42c5b..2006ebd8 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/User.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/User.php @@ -163,6 +163,21 @@ class User implements UserInterface, \Serializable */ private $viewcalendar; + /** + * @ORM\Column(type="datetime", nullable=true) + */ + private $visitedate; + + /** + * @ORM\Column(type="integer", nullable=true) + */ + private $visitecpt; + + /** + * @ORM\Column(type="string", length=150, nullable=true) + */ + private $niveau01other; + /** * @ORM\ManyToOne(targetEntity="Country", inversedBy="users") * @ORM\JoinColumn(nullable=true) @@ -1796,4 +1811,76 @@ class User implements UserInterface, \Serializable { return $this->projectcomments; } + + /** + * Set visitedate + * + * @param \DateTime $visitedate + * + * @return User + */ + public function setVisitedate($visitedate) + { + $this->visitedate = $visitedate; + + return $this; + } + + /** + * Get visitedate + * + * @return \DateTime + */ + public function getVisitedate() + { + return $this->visitedate; + } + + /** + * Set visitecpt + * + * @param integer $visitecpt + * + * @return User + */ + public function setVisitecpt($visitecpt) + { + $this->visitecpt = $visitecpt; + + return $this; + } + + /** + * Get visitecpt + * + * @return integer + */ + public function getVisitecpt() + { + return $this->visitecpt; + } + + /** + * Set niveau01other + * + * @param string $niveau01other + * + * @return User + */ + public function setNiveau01other($niveau01other) + { + $this->niveau01other = $niveau01other; + + return $this; + } + + /** + * Get niveau01other + * + * @return string + */ + public function getNiveau01other() + { + return $this->niveau01other; + } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php index c23bcc05..27937767 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/UserGroup.php @@ -44,7 +44,17 @@ class UserGroup * @ORM\Column(type="string", length=60, nullable=true) */ private $keyvalue; - + + /** + * @ORM\Column(type="datetime", nullable=true) + */ + private $visitedate; + + /** + * @ORM\Column(type="integer", nullable=true) + */ + private $visitecpt; + /** * Get id * @@ -150,4 +160,52 @@ class UserGroup { return $this->keyvalue; } + + /** + * Set visitedate + * + * @param \DateTime $visitedate + * + * @return UserGroup + */ + public function setVisitedate($visitedate) + { + $this->visitedate = $visitedate; + + return $this; + } + + /** + * Get visitedate + * + * @return \DateTime + */ + public function getVisitedate() + { + return $this->visitedate; + } + + /** + * Set visitecpt + * + * @param integer $visitecpt + * + * @return UserGroup + */ + public function setVisitecpt($visitecpt) + { + $this->visitecpt = $visitecpt; + + return $this; + } + + /** + * Get visitecpt + * + * @return integer + */ + public function getVisitecpt() + { + return $this->visitecpt; + } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php index ab260019..79464b1c 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/EventListener/sessionListener.php @@ -106,8 +106,9 @@ // Chargement de la sidebar $iconniveau01 =$this->container->getParameter('iconniveau01'); $labelsniveau01 =$this->container->getParameter('labelsniveau01'); - $labelniveau01 =$this->container->getParameter('labelsniveau01'); + $labelniveau01 =$this->container->getParameter('labelniveau01'); $session->set('labelniveau01',$labelniveau01); + $session->set('labelsniveau01',$labelsniveau01); $viewniveau02 =$this->container->getParameter('viewniveau02'); $iconniveau02 =$this->container->getParameter('iconniveau02'); @@ -115,6 +116,7 @@ $labelniveau02 =$this->container->getParameter('labelniveau02'); $session->set('viewniveau02',$viewniveau02); $session->set('labelniveau02',$labelniveau02); + $session->set('labelsniveau02',$labelsniveau02); $moderegistration =$this->container->getParameter('moderegistration'); if($masteridentity!="SQL") $moderegistration="none"; @@ -282,6 +284,19 @@ $session->set("sublogo", $niveau01->getLogo()); } + } + + if($curentuser!="anon.") { + $visitedate=clone $curentuser->getVisitedate(); + if($visitedate) $visitedate->add(new \DateInterval("PT1H")); + $now=new \DateTime(); + if($visitedate<$now) { + $curentuser->setVisitedate($now); + $curentuser->setVisitecpt($curentuser->getVisitecpt()+1); + $this->em->persist($curentuser); + $this->em->flush(); + } + } } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/GroupType.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/GroupType.php index e898bed0..7ed00e06 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/GroupType.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/GroupType.php @@ -58,28 +58,26 @@ class GroupType extends AbstractType "attr" => array("class" => "form-control", "style" => "margin-bottom:15px","readonly" => ($options["mode"]=="delete"?true:false)) ]); - if($options["access"]=="config") { - $builder->add('owner', - Select2EntityType::class, array( - 'label' => "Propriétaire", - 'disabled' => ($options["mode"]=="delete"?true:false), - "required" => false, - 'multiple' => false, - 'remote_route' => 'cadoles_core_config_user_ajax_selectlist', - 'class' => 'Cadoles\coreBundle\Entity\User', - 'primary_key' => 'id', - 'text_property' => 'username', - 'minimum_input_length' => 2, - 'page_limit' => 10, - 'allow_clear' => true, - 'delay' => 250, - 'cache' => false, - 'cache_timeout' => 60000, // if 'cache' is true - 'language' => 'fr', - 'placeholder' => 'Selectionner un propriétaire', - 'attr' => array("class" => "form-control", "style" => "margin-bottom:15px") - )); - } + $builder->add('owner', + Select2EntityType::class, array( + 'label' => "Propriétaire", + 'disabled' => ($options["mode"]=="delete"?true:false), + "required" => false, + 'multiple' => false, + 'remote_route' => 'cadoles_core_config_user_ajax_selectlist', + 'class' => 'Cadoles\coreBundle\Entity\User', + 'primary_key' => 'id', + 'text_property' => 'username', + 'minimum_input_length' => 2, + 'page_limit' => 10, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, // if 'cache' is true + 'language' => 'fr', + 'placeholder' => 'Selectionner un propriétaire', + 'attr' => array("class" => "form-control", "style" => "margin-bottom:15px") + )); } if($options["access"]=="config") { diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/MailingType.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/MailingType.php new file mode 100644 index 00000000..e6640993 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/MailingType.php @@ -0,0 +1,116 @@ +add('submit', + SubmitType::class, array( + "label" => "Envoyer", + "attr" => array("class" => "btn btn-success") + ) + ); + + $perm=$options["perm"]; + $userid=$options["userid"]; + + $builder + ->add('niveau01',EntityType::class,[ + "mapped" => false, + "required" => false, + "class" => "CadolesCoreBundle:Niveau01", + 'multiple' => true, + "label" => $session->get('labelsniveau01'), + 'placeholder' => '== Choisir '.$session->get('labelsniveau01').' ==', + "choice_label" => "label", + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), + "query_builder"=> function (EntityRepository $er) use($perm,$userid) { + if($perm) + return $er->createQueryBuilder('niveau01'); + else { + $result=$er->createQueryBuilder("table")->innerJoin("CadolesCoreBundle:UserModo", "usermodo", Join::WITH, "table.id = usermodo.niveau01"); + $result->andWhere("usermodo.user = :userid"); + $result->setParameter('userid', $userid); + return $result; + } + } + ]); + + if($perm) { + $builder + ->add('groups', Select2EntityType::class, [ + 'mapped' => false, + 'label' => 'Groupes', + 'class' => 'CadolesCoreBundle:Group', + 'text_property' => 'label', + 'multiple' => true, + 'remote_route' => 'cadoles_core_ajax_group_list', + 'primary_key' => 'id', + 'text_property' => 'label', + 'minimum_input_length' => 0, + 'page_limit' => 100, + 'allow_clear' => true, + 'delay' => 250, + 'cache' => false, + 'cache_timeout' => 60000, + 'language' => 'fr', + 'placeholder' => 'Selectionner des groupes', + ]); + } + + $builder + ->add('subject', TextType::class, [ + "label" =>"Sujet", + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px"), + "mapped" => false + ]); + + $builder + ->add("message",CKEditorType::class,[ + 'config_name' => 'small_config', + 'label' => "Message", + 'mapped'=> false, + 'required' => true, + 'attr' => array("class" => "form-control", "style" => "margin-bottom:15px"), + 'config' => ["height" => "400px",'filebrowserUploadRoute' => 'cadoles_portal_user_pagewidget_upload'] + ]); + + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Cadoles\CoreBundle\Entity\User', + 'perm' => "boolean", + 'userid' => "integer", + )); + } +} + diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/RegistrationType.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/RegistrationType.php index 2b3e2a85..2cdbf8db 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/RegistrationType.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/RegistrationType.php @@ -76,10 +76,21 @@ class RegistrationType extends AbstractType EntityType::class, array("class" => "CadolesCoreBundle:Niveau01", "label" => $session->get('labelniveau01'), + 'placeholder' => '== Choisir '.$session->get('labelniveau01').' ==', "choice_label" => "label", - "disabled" => ($options["mode"]=="delete"?true:false), + "disabled" => ($options["mode"]=="delete"?true:false), "attr" => array("class" => "form-control", "style" => "margin-bottom:15px","readonly" => ($options["mode"]=="delete"?true:false)))); + + $builder->add('niveau01other', + TextType::class, array( + "label" =>"Autre ".$session->get('labelniveau01'), + "disabled" => ($options["mode"]=="delete"?true:false), + "required" => false, + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px") + ) + ); + # Password if($options["mode"]!="delete"&&$options["mode"]!="send") { $builder->add('password', @@ -296,6 +307,14 @@ class RegistrationType extends AbstractType } } + $builder->add('motivation', + TextareaType::class, array( + "label" => "Motivation", + "required" => false, + "disabled" => ($options["mode"]=="delete"?true:false), + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px; height: 90px") + ) + ); } public function configureOptions(OptionsResolver $resolver) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php index 986726af..7ccbefd2 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php @@ -16,6 +16,8 @@ use Symfony\Component\Form\Extension\Core\Type\ButtonType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\DateType; +use Symfony\Component\Form\Extension\Core\Type\DateTimeType; +use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType; @@ -82,6 +84,7 @@ class UserType extends AbstractType EntityType::class, array("class" => "CadolesCoreBundle:Niveau01", "label" => $session->get('labelniveau01'), + 'placeholder' => '== Choisir '.$session->get('labelniveau01').' ==', "choice_label" => "label", "query_builder"=> function (EntityRepository $er) use($access,$perm,$userid) { if($access=="config") { @@ -100,7 +103,17 @@ class UserType extends AbstractType }, "disabled" => ($options["mode"]=="delete"||$options["masteridentity"]!="SQL"?true:false), "attr" => array("class" => "form-control", "style" => "margin-bottom:15px","readonly" => ($options["mode"]=="delete"?true:false)))); - + + + $builder->add('niveau01other', + TextType::class, array( + "label" =>"Autre ".$session->get('labelniveau01'), + "disabled" => ($options["mode"]=="delete"?true:false), + "required" => false, + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px") + ) + ); + if($options["mode"]!="delete"&&$options["masteridentity"]=="SQL") { $builder->add('password', RepeatedType::class, array( @@ -360,6 +373,22 @@ class UserType extends AbstractType } } + if(!array_key_exists("visite",$fields)) $fields["visite"]["perm"]==2; + if($fields["visite"]["perm"]!=0) { + $builder->add('visitedate', DateTimeType::class, [ + "label" => 'Date de dernière visite', + "disabled" => true, + "required" => ($fields["visite"]["perm"]==2), + "widget" => 'single_text', + ]); + + $builder->add('visitecpt', IntegerType::class, [ + "label" => 'Nombre de visites', + "required" => ($fields["visite"]["perm"]==2), + "disabled" => true, + ]); + } + # Avatar $builder->add('avatar',HiddenType::class, array("empty_data" => "noavatar.png")); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml index 338aacdc..35f0f9af 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml @@ -257,6 +257,10 @@ cadoles_core_config_user_ajax_selectlist: path: /config/user/ajax/selectlist defaults: { _controller: CadolesCoreBundle:User:selectlist, access: config } +cadoles_core_config_mailing: + path: /config/mailing + defaults: { _controller: CadolesCoreBundle:User:mailing } + cadoles_core_config_importuser: path: /config/importuser defaults: { _controller: CadolesCoreBundle:User:importuser } @@ -368,6 +372,10 @@ cadoles_core_config_group_users: path: /config/group/users/{id} defaults: { _controller: CadolesCoreBundle:Group:users, access: config } +cadoles_core_config_group_statistic: + path: /config/group/statistic/{id} + defaults: { _controller: CadolesCoreBundle:Group:statistic, access: config } + cadoles_core_config_group_ajax_usersnotin: path: /config/group/ajax/usersnotin/{id} defaults: { _controller: CadolesCoreBundle:Group:ajaxusersnotin, access: config } @@ -417,6 +425,10 @@ cadoles_core_user_group_users: path: /user/group/users/{id} defaults: { _controller: CadolesCoreBundle:Group:users, access: user } +cadoles_core_user_group_statistic: + path: /user/group/statistic/{id} + defaults: { _controller: CadolesCoreBundle:Group:statistic, access: user } + cadoles_core_user_group_out: path: /user/group/out/{id} defaults: { _controller: CadolesCoreBundle:Group:out, access: user } @@ -467,8 +479,10 @@ cadoles_core_config_whitelist_ajax_list: path: /config/whitelist/ajax/list defaults: { _controller: CadolesCoreBundle:Whitelist:ajaxlist } - - +#== Statistic ============================================================================================================= +cadoles_core_config_statistic: + path: /config/statistic + defaults: { _controller: CadolesCoreBundle:Statistic:list } #== REST ================================================================================================================== cadoles_core_rest_user: diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig index 967c63bb..1b7b1f8d 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/list.html.twig @@ -31,13 +31,14 @@ - + + {% if portal_activate %} - + {% if access=="config" %} @@ -57,10 +58,10 @@ {% block localjavascript %} $(document).ready(function() { $('#dataTables').DataTable({ - columnDefs: [ { "targets": 'no-sort', "orderable": false },{ "targets": 'no-visible', "visible": false } ], + columnDefs: [ { "targets": 'no-sort', "orderable": false },{ "targets": 'no-visible', "visible": false },{"targets": "text-center", "className": "text-center"} ], responsive: true, iDisplayLength: 100, - order: [[ 1, "asc" ]], + order: [[ 2, "asc" ]], processing: true, serverSide: true, ajax: "{{ path('cadoles_core_'~access~'_group_ajax_list') }}", diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/statistic.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/statistic.html.twig new file mode 100644 index 00000000..12d43f08 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/statistic.html.twig @@ -0,0 +1,131 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block pagewrapper %} +

Statistiques {{ group.label }}

+ Fermer +

+ +
+
+ Compteur de visites journalière +
+ +
+
+
+
+ +
+
+
+
+ Evolution du nombre de message dans les tchat +
+ +
+
+
+
+
+ +
+
+
+ Evolution du nombre d'articles de blog +
+ +
+
+
+
+
+ +
+
+
+ Evolution du nombre de tâches +
+ +
+
+
+
+
+
+ +{% endblock %} + +{% block localjavascript %} + $(document).ready(function() { + groupcptvisite(); + groupcptmessage(); + groupcptblogarticle(); + groupcptprojecttask(); + + $(window).resize(function() { + window.groupcptvisite.redraw(); + window.groupcptmessage.redraw(); + window.groupcptblogarticle.redraw(); + window.groupcptprojecttask.redraw(); + }); + }); + + function groupcptvisite() { + window.groupcptvisite = Morris.Area({ + element: 'groupcptvisite', + data: [ + {% set before = 0 %} + {% for date, cpt in groupcptvisite.value %} + {% set now = cpt - before %} + {% set before = cpt %} + { x: '{{ date }}', a: {{ now }} }{% if not loop.last %},{%endif%} + {% endfor %} + ], + xkey: 'x', + ykeys: ['a'], + labels: ['Nombre de visites'] + }); + } + + function groupcptmessage() { + window.groupcptmessage = Morris.Area({ + element: 'groupcptmessage', + data: [ + {% for date, cpt in groupcptmessage.value %} + { x: '{{ date }}', a: {{ cpt }} }{% if not loop.last %},{%endif%} + {% endfor %} + ], + xkey: 'x', + ykeys: ['a'], + labels: ['Nombre total de messages tchat'] + }); + } + + function groupcptblogarticle() { + window.groupcptblogarticle = Morris.Area({ + element: 'groupcptblogarticle', + data: [ + {% for date, cpt in groupcptblogarticle.value %} + { x: '{{ date }}', a: {{ cpt }} }{% if not loop.last %},{%endif%} + {% endfor %} + ], + xkey: 'x', + ykeys: ['a'], + labels: ["Nombre total d'articles de blog"] + }); + } + + function groupcptprojecttask() { + window.groupcptprojecttask = Morris.Area({ + element: 'groupcptprojecttask', + data: [ + {% for date, cpt in groupcptprojecttask.value %} + { x: '{{ date }}', a: {{ cpt }} }{% if not loop.last %},{%endif%} + {% endfor %} + ], + xkey: 'x', + ykeys: ['a'], + labels: ["Nombre total de tâches"] + }); + } +{% endblock %} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/users.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/users.html.twig index 6b2b4789..91710c09 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/users.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Group/users.html.twig @@ -29,7 +29,8 @@ - + + {% if group.fgcanshare %} {% endif %} @@ -56,6 +57,7 @@ + {% if group.fgcanshare %} {% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Mail/mailing.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Mail/mailing.html.twig new file mode 100755 index 00000000..455a876a --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Mail/mailing.html.twig @@ -0,0 +1,54 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block pagewrapper %} +{{ form_start(form) }} +

+ Mailing +

+ + {{ form_widget(form.submit) }} + +

+ + {% if app.session.flashbag.has('error') %} +
+ Erreur
+ {% for flashMessage in app.session.flashbag.get('error') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + {% if app.session.flashbag.has('notice') %} +
+ Information
+ {% for flashMessage in app.session.flashbag.get('notice') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} +
+
+ Destinataires +
+ +
+ {{ form_row(form.niveau01) }} + {% if form.groups is defined %} + {{ form_row(form.groups) }} + {% endif %} +
+
+ +
+
+ Mail +
+ +
+ {{ form_row(form.subject) }} + {{ form_row(form.message) }} +
+
+{{ form_end(form) }} +{% endblock %} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig index 61aac292..e17afb0f 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Registration/edit.html.twig @@ -32,7 +32,7 @@
Erreur
{% for flashMessage in app.session.flashbag.get('error') %} - {{ flashMessage }}
+ {{ flashMessage | raw }}
{% endfor %}
{% endif %} @@ -41,7 +41,7 @@
Information
{% for flashMessage in app.session.flashbag.get('notice') %} - {{ flashMessage }}
+ {{ flashMessage | raw }}
{% endfor %}
{% endif %} @@ -68,8 +68,8 @@
Caractères interdits = accent, espace, caractères spéciaux sauf @ . - _
- Taille minimum = {{keyterm}} caractères - Doit être constitué de chiffres, de lettres et caractères spéciaux + Taille minimum = 5 caractères
+ Formatez votre login sous la forme prenom.nom dans la mesure du possible
{% if form.password is defined %} @@ -94,6 +94,16 @@ {% if form.visible is defined %} {{ form_row(form.visible) }} {% endif %} + +
+
+ Motivations +
+ +
+ {{ form_row(form.motivation) }} +
+
@@ -105,6 +115,7 @@ {% if form.job is defined %} {{ form_row(form.job) }} {% endif %} {% if form.position is defined %} {{ form_row(form.position) }} {% endif %} {{ form_row(form.niveau01) }} +
{{ form_row(form.niveau01other) }}
{% if form.niveau02 is defined %} {{ form_row(form.niveau02) }} {% endif %}
@@ -164,6 +175,10 @@ hideshow(); }); + $(document.body).on("change","#registration_niveau01",function(){ + hideshow(); + }); + $(document.body).on("change","#registration_niveau02",function(){ $.ajax({ method: "POST", @@ -188,6 +203,15 @@ $("#blockcity").hide(); $("#registration_birthplace").val([]).trigger('change'); } + + niveau01=$("#registration_niveau01 option:selected").text().toLowerCase(); + if(niveau01.startsWith("autre")) { + $("#niveau01other").show(); + } + else { + $("#registration_niveau01other").val(""); + $("#niveau01other").hide(); + } } $(document).ready(function() { diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Statistic/list.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Statistic/list.html.twig new file mode 100644 index 00000000..ee72eae2 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Statistic/list.html.twig @@ -0,0 +1,263 @@ +{% extends '@CadolesCore/base.html.twig' %} + +{% block pagewrapper %} +

Statistiques

+ +
+
+ Compteur de visites journalière +
+ +
+
+
+
+ +
+
+ Compteur de visites journalière des groupes de travail +
+ +
+
+
+
+ +
+
+
+
+ Evolution du nombre de message dans les tchat +
+ +
+
+
+
+
+ +
+
+
+ Evolution du nombre d'articles de blog +
+ +
+
+
+
+
+ +
+
+
+ Evolution du nombre de tâches +
+ +
+
+
+
+
+ +
+
+
+ TOP 20 des groupes les plus visités +
+ +
+
+
+
+
+ +
+
+
+ TOP 20 des groupes avec le plus de messages chat +
+ +
+
+
+
+
+ +
+
+
+ TOP 20 des groupes avec le plus d'articles de blog +
+ +
+
+
+
+
+ +
+
+
+ TOP 20 des groupes avec le plus de tâches +
+ +
+
+
+
+
+
+ +{% endblock %} + +{% block localjavascript %} + $(document).ready(function() { + totcptvisite(); + totcptvisitegroup(); + totcptmessage(); + totcptblogarticle(); + totcptprojecttask(); + groupcptvisite(); + groupcptmessage(); + groupcptblogarticle(); + groupcptprojecttask(); + + $(window).resize(function() { + window.totcptvisite.redraw(); + window.totcptvisitegroup.redraw(); + window.totcptmessage.redraw(); + window.totcptblogarticle.redraw(); + window.totcptprojecttask.redraw(); + }); + }); + + function totcptvisite() { + window.totcptvisite = Morris.Area({ + element: 'totcptvisite', + data: [ + {% set before = 0 %} + {% for date, cpt in totcptvisite.value %} + {% set now = cpt - before %} + {% set before = cpt %} + { x: '{{ date }}', a: {{ now }} }{% if not loop.last %},{%endif%} + {% endfor %} + ], + xkey: 'x', + ykeys: ['a'], + labels: ['Nombre de visites'] + }); + } + + + function totcptvisitegroup() { + window.totcptvisitegroup = Morris.Area({ + element: 'totcptvisitegroup', + data: [ + {% set before = 0 %} + {% for date, cpt in totcptvisitegroup.value %} + {% set now = cpt - before %} + {% set before = cpt %} + { x: '{{ date }}', a: {{ now }} }{% if not loop.last %},{%endif%} + {% endfor %} + ], + xkey: 'x', + ykeys: ['a'], + labels: ['Nombre de visites des groupes'] + }); + } + + function totcptmessage() { + window.totcptmessage = Morris.Area({ + element: 'totcptmessage', + data: [ + {% for date, cpt in totcptmessage.value %} + { x: '{{ date }}', a: {{ cpt }} }{% if not loop.last %},{%endif%} + {% endfor %} + ], + xkey: 'x', + ykeys: ['a'], + labels: ['Nombre total de messages tchat'] + }); + } + + function totcptblogarticle() { + window.totcptblogarticle = Morris.Area({ + element: 'totcptblogarticle', + data: [ + {% for date, cpt in totcptblogarticle.value %} + { x: '{{ date }}', a: {{ cpt }} }{% if not loop.last %},{%endif%} + {% endfor %} + ], + xkey: 'x', + ykeys: ['a'], + labels: ["Nombre total d'articles de blog"] + }); + } + + function totcptprojecttask() { + window.totcptprojecttask = Morris.Area({ + element: 'totcptprojecttask', + data: [ + {% for date, cpt in totcptprojecttask.value %} + { x: '{{ date }}', a: {{ cpt }} }{% if not loop.last %},{%endif%} + {% endfor %} + ], + xkey: 'x', + ykeys: ['a'], + labels: ["Nombre total de tâches"] + }); + } + + function groupcptvisite() { + window.groupcptvisite = Morris.Donut({ + element: 'groupcptvisite', + data: [ + {% for cpt in groupcptvisite %} + {label: "{{ cpt.name|raw }}", value: {{ cpt.value }}}{% if not loop.last %},{%endif%} + {% endfor %} + ], + resize: true, + redraw: true + }); + } + + function groupcptmessage() { + window.groupcptmessage = Morris.Donut({ + element: 'groupcptmessage', + data: [ + {% for cpt in groupcptmessage %} + {label: "{{ cpt.name|raw }}", value: {{ cpt.value }}}{% if not loop.last %},{%endif%} + {% endfor %} + ], + resize: true, + redraw: true + }); + } + + function groupcptblogarticle() { + window.groupcptblogarticle = Morris.Donut({ + element: 'groupcptblogarticle', + data: [ + {% for cpt in groupcptblogarticle %} + {label: "{{ cpt.name|raw }}", value: {{ cpt.value }}}{% if not loop.last %},{%endif%} + {% endfor %} + ], + resize: true, + redraw: true + }); + } + + function groupcptprojecttask() { + window.groupcptprojecttask = Morris.Donut({ + element: 'groupcptprojecttask', + data: [ + {% for cpt in groupcptprojecttask %} + {label: "{{ cpt.name|raw }}", value: {{ cpt.value }}}{% if not loop.last %},{%endif%} + {% endfor %} + ], + resize: true, + redraw: true + }); + } +{% endblock %} diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig index ad422948..779f071b 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig @@ -27,7 +27,7 @@
Erreur
{% for flashMessage in app.session.flashbag.get('error') %} - {{ flashMessage }}
+ {{ flashMessage | raw }}
{% endfor %}

@@ -37,7 +37,7 @@
Information
{% for flashMessage in app.session.flashbag.get('notice') %} - {{ flashMessage }}
+ {{ flashMessage | raw }}
{% endfor %}

@@ -46,7 +46,7 @@ {% if info is defined and info %}
Information
- {{ info }}
+ {{ info | raw }}

{% endif %} @@ -75,8 +75,8 @@
Caractères interdits = accent, espace, caractères spéciaux sauf @ . - _
- Taille minimum = {{keyterm}} caractères - Doit être constitué de chiffres, de lettres et caractères spéciaux + Taille minimum = 5 caractères
+ Formatez votre login sous la forme prenom.nom dans la mesure du possible
{% if form.password is defined %} @@ -114,6 +114,7 @@ {% if form.job is defined %}{{ form_row(form.job) }}{% endif %} {% if form.position is defined %}{{ form_row(form.position) }}{% endif %} {{ form_row(form.niveau01) }} +
{{ form_row(form.niveau01other) }}
{% if form.niveau02 is defined %}{{ form_row(form.niveau02) }}{% endif %} @@ -261,6 +262,20 @@ + + {% if form.visitedate is defined %} +
+
+ Visite +
+ +
+ {{ form_row(form.visitedate) }} + {{ form_row(form.visitecpt) }} +
+
+ {% endif %} + @@ -280,7 +295,7 @@
ActionActionIcone Label Ouvert FiltreGroupe de TravailPropriétairePropriétaireCréation Pages Création CalendriersAction Avatar LoginEmailEmailVisiteManagerAvatar Login EmailVisiteManager
- + @@ -299,7 +314,7 @@ {% endif %} - + @@ -366,13 +381,15 @@ {% block localjavascript %} $(document).ready(function() { - {% if access=="profil" %} + {% if access=="user" %} + {% set color = app.session.get('color') %} $(".sidebar").remove(); $("body").removeClass("body"); $("body").addClass("simple"); + $("body").attr('style', 'background-color: #{{ color['colorbody'] }} !important'); $("#page-wrapper").css("margin","auto"); - $("#page-wrapper").css("max-width","1000px"); $("#page-wrapper").css("border-left","none"); + {% endif %} // Vider le password @@ -402,6 +419,10 @@ hideshow(); }); + $(document.body).on("change","#user_niveau01",function(){ + hideshow(); + }); + $(document.body).on("change","#user_niveau02",function(){ $.ajax({ method: "POST", @@ -433,6 +454,15 @@ else { $("#panelmodos").hide(); } + + niveau01=$("#user_niveau01 option:selected").text().toLowerCase(); + if(niveau01.startsWith("autre")) { + $("#niveau01other").show(); + } + else { + $("#user_niveau01other").val(""); + $("#niveau01other").hide(); + } } @@ -450,6 +480,14 @@ linkmodos+={{ modo.niveau01.id }}+","; {% endfor %} $("#user_linkmodos").val(linkmodos); + + $('#tbllistgroup').DataTable({ + columnDefs: [ { "targets": 'no-sort', "orderable": false },{ "targets": 'no-visible', "visible": false } ], + responsive: true, + iDisplayLength: 100, + processing: true, + order: [[ 1, "asc" ]], + }); }); function removeLinkGroup(id) { diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/list.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/list.html.twig index 9c05c2f4..a462021b 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/list.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/list.html.twig @@ -45,6 +45,7 @@ td { font-size: 10px; } + diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/view.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/view.html.twig index 09c38fff..341f3c4c 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/view.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/view.html.twig @@ -18,8 +18,10 @@ {%if viewniveau02 and user.niveau02%}{{ labelniveau02 }} = {{ user.niveau02.label }}
{% endif %} {%if user.job %}Métier = {{ user.job }}
{%endif%} {%if user.position %}Fonction = {{ user.position }}
{%endif%} - {%if user.postaladress %}Adresse = {{ user.postaladress }}

{%endif%} - + {%if user.postaladress %}Adresse = {{ user.postaladress }}
{%endif%} + {%if user.visitedate %}Date de dernière visite = {{ user.visitedate|date('d/m/Y H:i') }}
{%endif%} + {%if user.visitecpt %}Nombre de visites = {{ user.visitecpt }}
{%endif%} +
{% set fgtitle=false %} {% for usergroup in user.groups %} {% if usergroup.group.fgcanshare %} diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php index b772dbcb..d9dccff0 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php @@ -15,9 +15,13 @@ use Cadoles\CronBundle\Entity\Cron; class CronCommand extends ContainerAwareCommand { + private $container; + private $em; private $output; private $filesystem; private $rootlog; + + use LockableTrait; protected function configure() @@ -30,8 +34,8 @@ class CronCommand extends ContainerAwareCommand protected function execute(InputInterface $input, OutputInterface $output) { - $entityManager = $this->getContainer()->get('doctrine')->getManager(); - + $this->container = $this->getApplication()->getKernel()->getContainer(); + $this->em = $this->container->get('doctrine')->getEntityManager(); $this->output = $output; $this->filesystem = new Filesystem(); $this->rootlog = $this->getContainer()->get('kernel')->getRootDir()."/../var/logs/"; @@ -48,9 +52,9 @@ class CronCommand extends ContainerAwareCommand return 0; } - $crons = $entityManager->getRepository('CadolesCronBundle:Cron')->toexec(); + $crons = $this->em->getRepository('CadolesCronBundle:Cron')->toexec(); $i=0; - + if($crons) { $now=new \DateTime(); $this->writelnred(''); @@ -67,7 +71,7 @@ class CronCommand extends ContainerAwareCommand // 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); + $cronsynchro=$this->em->getRepository('CadolesCronBundle:Cron')->find(100); if($cronsynchro&&in_array($cronsynchro,$crons)) { $crons=[$cronsynchro]; @@ -83,8 +87,8 @@ class CronCommand extends ContainerAwareCommand $now=new \DateTime(); $cron->setStartexecdate($now); //$cron->setStatut(1); - $entityManager->persist($cron); - $entityManager->flush(); + $this->em->persist($cron); + $this->em->flush(); // Récupération de la commande $command = $this->getApplication()->find($cron->getCommand()); @@ -111,7 +115,7 @@ class CronCommand extends ContainerAwareCommand // 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); + $cron=$this->em->getRepository('CadolesCronBundle:Cron')->find($idcron); } catch(\Exception $e) { $this->writelnred("JOB EN ERREUR"); @@ -139,11 +143,14 @@ class CronCommand extends ContainerAwareCommand if($returnCode!=1) { $cron->setStatut(3); if($cron->getRepeatcall()>0) $cron->setRepeatexec($cron->getRepeatexec()+1); + + // Envoyer un mail à l'ensemble des administrateurs + $this->sendMailerror(); } } - $entityManager->persist($cron); - $entityManager->flush(); + $this->em->persist($cron); + $this->em->flush(); } if($crons) { @@ -154,6 +161,37 @@ class CronCommand extends ContainerAwareCommand } } + private function sendMailerror() { + $appname=""; + $config = $this->em->getRepository("CadolesCoreBundle:Config")->findOneBy(["id"=>"appname"]); + if($config) $appname = $config->getValue(); + $noreply = $this->container->getParameter('noreply'); + + // Email à l'ensemble administrateurs pour les prévenir qu'il y a une personne à valider + $emailadmins= $this->em->createQueryBuilder() + ->select('table.email') + ->from("CadolesCoreBundle:User",'table') + ->where('table.role = :value') + ->setParameter("value", "ROLE_ADMIN") + ->getQuery() + ->getResult(\Doctrine\ORM\Query::HYDRATE_SCALAR); + $to=array(); + $from = $noreply; + $fromName = $appname; + foreach($emailadmins as $emailadmin) { + array_push($to,$emailadmin["email"]); + } + + $mail_params=array( + "subject" => $appname." : ERREUR SUR EXECUTION JOB", + "body_html"=> "ATTENTION UN JOB EST EN ERREUR. MERCI DE VERIFIER LES LOGS.", + "body_text"=> "ATTENTION UN JOB EST EN ERREUR. MERCI DE VERIFIER LES LOGS." + ); + + $message = $this->container->get('cadoles.core.service.mail'); + $message->sendEmail("template", $mail_params, $to, $from, $fromName); + } + private function writelnred($string) { $this->output->writeln(''.$string.''); $this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n"); diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronexecCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronexecCommand.php index cb8c23fb..32e29580 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronexecCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronexecCommand.php @@ -26,7 +26,7 @@ class CronexecCommand extends ContainerAwareCommand protected function configure() { $this - ->setName('Cron:Exec') + ->setName('Cron:Run') ->setDescription("Executer les commandes présente dans le bus des commandes à exécuter à la volet") ; } @@ -48,7 +48,7 @@ class CronexecCommand extends ContainerAwareCommand $cronexecs=$this->em->getRepository("CadolesCronBundle:Cronexec")->findAll(); if($cronexecs) { $this->writelnred(''); - $this->writelnred('== Cron:Exec'); + $this->writelnred('== Cron:Run'); $this->writelnred('=========================================================================================================='); foreach($cronexecs as $cron) { diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/DumpCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/DumpCommand.php new file mode 100644 index 00000000..a1439a45 --- /dev/null +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/DumpCommand.php @@ -0,0 +1,95 @@ +setName('Cron:Dump') + ->setDescription('Dump database for backup') + ->addArgument('env', InputArgument::OPTIONAL, 'env Mail') + ->addArgument('cronid', InputArgument::OPTIONAL, 'ID Cron Job') + ->addArgument('lastchance', InputArgument::OPTIONAL, 'Lastchance to run the cron') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + + $this->container = $this->getApplication()->getKernel()->getContainer(); + $this->em = $this->container->get('doctrine')->getEntityManager(); + $this->output = $output; + $this->filesystem = new Filesystem(); + $this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/"; + + $mailer_host = $this->getContainer()->getParameter('mailer_host'); + + $this->writelnred(''); + $this->writelnred('== Cron:Dump'); + $this->writelnred('=========================================================================================================='); + + $this->datahost = $this->getContainer()->getParameter('database_host'); + $this->database = $this->getContainer()->getParameter('database_name') ; + $this->username = $this->getContainer()->getParameter('database_user') ; + $this->password = $this->getContainer()->getParameter('database_password') ; + + $cmd = sprintf('mysqldump -h %s -B %s -u %s --password=%s' + , $this->datahost + , $this->database + , $this->username + , $this->password + ); + + $result = $this->runCommand($cmd); + if($result['exit_status'] == 0) { + $this->filesystem->dumpFile($this->rootlog."ninegate.sql", $result['output']); + } + + $this->writeln(''); + return 1; + } + + protected function runCommand($command) + { + $command .=" >&1"; + exec($command, $output, $exit_status); + return array( + "output" => $output + , "exit_status" => $exit_status + ); + } + + private function writelnred($string) { + $this->output->writeln(''.$string.''); + $this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n"); + } + private function writeln($string) { + $this->output->writeln($string); + $this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n"); + } +} diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php index 25b6da84..735f30ad 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/InitDataCommand.php @@ -60,9 +60,9 @@ class InitDataCommand extends ContainerAwareCommand $entity->setRepeatexec(0); $entity->setRepeatinterval(60); $entity->setNextexecdate($entity->getSubmitdate()); - $entity->setJsonargument('{"message-limit":"100","env":"prod"}'); - $this->entityManager->persist($entity); } + $entity->setJsonargument('{"message-limit":"200","env":"prod"}'); + $this->entityManager->persist($entity); // Job synchronisation des comptes utilisateur @@ -139,6 +139,43 @@ class InitDataCommand extends ContainerAwareCommand $entity->setNextexecdate($nextdate); $this->entityManager->persist($entity); } + + // Job Statistic + // Toute les 24h à 23h30 + $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(210); + if(!$entity) { + $entity = new Cron; + $nextdate=$entity->getSubmitdate(); + $nextdate->setTime(23,30); + $entity->setCommand("Core:Statistic"); + $entity->setDescription("Cacul des indicateurs d'usages"); + $entity->setId(210); + $entity->setStatut(2); + $entity->setRepeatcall(0); + $entity->setRepeatexec(0); + $entity->setRepeatinterval(86400); + $entity->setNextexecdate($nextdate); + $this->entityManager->persist($entity); + } + + // Job Dump + // Toute les 24h à 2h00 + $entity = $this->entityManager->getRepository('CadolesCronBundle:Cron')->find(220); + if(!$entity) { + $entity = new Cron; + $nextdate=$entity->getSubmitdate(); + $nextdate->setTime(2,0); + $entity->setCommand("Cron:Dump"); + $entity->setDescription("Sauvegarde de la BDD"); + $entity->setId(220); + $entity->setStatut(2); + $entity->setRepeatcall(0); + $entity->setRepeatexec(0); + $entity->setRepeatinterval(86400); + $entity->setNextexecdate($nextdate); + $this->entityManager->persist($entity); + } + // CRON PORTAIL // Job purge des registrations obsolètes // Toute les 5mn diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Controller/CronController.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Controller/CronController.php index 98e69db3..c597ca9e 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Controller/CronController.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Controller/CronController.php @@ -10,6 +10,9 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\HttpFoundation\BinaryFileResponse; +use Symfony\Component\HttpFoundation\ResponseHeaderBag; + use Cadoles\CronBundle\Entity\Cron; use Cadoles\CronBundle\Form\CronType; @@ -70,7 +73,7 @@ class CronController extends Controller // Order switch($order[0]["column"]) { case 1 : - $qb->orderBy('table.id',$order[0]["dir"]); + $qb->orderBy('table.nextexecdate',$order[0]["dir"]); break; case 2 : $qb->orderBy('table.command',$order[0]["dir"]); @@ -81,9 +84,6 @@ class CronController extends Controller case 4 : $qb->orderBy('table.statut',$order[0]["dir"]); break; - case 5 : - $qb->orderBy('table.nextexecdate',$order[0]["dir"]); - break; } // Execution de la requete d'affichage @@ -104,7 +104,7 @@ class CronController extends Controller if($data->getRepeatCall()>0 AND $data->getRepeatCall()<=$data->getRepeatExec()) $nextexec="Déjà rejoué ".$data->getRepeatExec()." fois"; - array_push($output["data"],array($action,$data->getId(),$data->getCommand(),$data->getDescription(),$data->getStatutLabel(),$nextexec)); + array_push($output["data"],array($action,$nextexec,$data->getCommand(),$data->getDescription(),$data->getStatutLabel())); } // Retour @@ -189,18 +189,25 @@ class CronController extends Controller return new Response(json_encode($content), 200); } - public function logAction(Request $request, $id) + public function logAction() { - $kernel = $this->get('kernel'); - $path = $this->get('kernel')->getRootDir() . '/../var/logs/'.$id.'.log'; - $content = file_get_contents($path); - return $this->render('CadolesCronBundle:Cron:logs.html.twig', [ 'useheader' => true, 'usemenu' => false, - 'usesidebar' => true, - "title" => "LOG = ".$id, - "content" => $content + 'usesidebar' => true ]); } + + public function getlogAction(Request $request, $id) + { + $kernel = $this->get('kernel'); + if($id=="dump") + $file = $this->get('kernel')->getRootDir() . '/../var/logs/ninegate.sql'; + else + $file = $this->get('kernel')->getRootDir() . '/../var/logs/'.$id.'.log'; + + $response = new BinaryFileResponse($file); + $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT); + return $response; + } } diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/config/routing.yml b/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/config/routing.yml index 923f9672..57264b35 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/config/routing.yml +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/config/routing.yml @@ -23,6 +23,9 @@ cadoles_cron_config_cronexecread: defaults: { _controller: CadolesCronBundle:Cron:cronexecread } cadoles_cron_config_log: - path: /config/cron/log/{id} + path: /config/cron/log controller: CadolesCronBundle:Cron:log - defaults: { id: "cron" } \ No newline at end of file + +cadoles_cron_config_getlog: + path: /config/cron/getlog/{id} + controller: CadolesCronBundle:Cron:getlog diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/views/Cron/list.html.twig b/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/views/Cron/list.html.twig index cc4977fe..4c551340 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/views/Cron/list.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/views/Cron/list.html.twig @@ -17,11 +17,10 @@ - + -
ActionAction Groupe
{{ group.label }} Groupes Métier FonctionVisite Rôle
ActionOrderProchaine exécution Command Description StatutProchaine exécution
diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/views/Cron/logs.html.twig b/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/views/Cron/logs.html.twig index 8e2100b3..b007f791 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/views/Cron/logs.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Resources/views/Cron/logs.html.twig @@ -1,19 +1,10 @@ {% extends '@CadolesCore/base.html.twig' %} {% block pagewrapper %} -

{{ title }}

+

Télécharger les logs

- Log CRON - Log PROD - Log DEV -

-
-
- Logs -
- -
- {{ content | nl2br }} -
-
+ Log CRON + Log PROD + Log DEV + Dump de la Base {% endblock %} \ No newline at end of file diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php index 21933970..f59166b9 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PageController.php @@ -515,6 +515,24 @@ class PageController extends Controller } */ + // Compteur de visite + if($this->getUser()) { + $group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid); + if($group && $group->getFgcanshare()) { + $usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["group"=>$group,"user"=>$this->getUser()]); + if($usergroup) { + $visitedate=$usergroup->getVisitedate(); + if($visitedate) $visitedate->add(new \DateInterval("PT1H")); + $now=new \DateTime(); + if($visitedate<$now) { + $usergroup->setVisitedate($now); + $usergroup->setVisitecpt($usergroup->getVisitecpt()+1); + $em->persist($usergroup); + $em->flush(); + } + } + } + } // Type Calendrier if($entity->getPageCategory()->getId()==-100) { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php index 17d2be3c..ac6abe8f 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -130,11 +130,25 @@ class PagewidgetController extends Controller } $entity->setParameter($param); - + $em = $this->getDoctrine()->getManager(); $em->persist($entity); $em->flush(); + + // Notification création widget + $groups=$page->getGroups(); + if($groups[0]) { + if($groups[0]->getFgcanshare()) { + $message="Création Widget ".$entity->getName(); + $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groups[0],"user"=>$this->getUser()]); + if($usergroup) { + $key=$usergroup->getKeyvalue(); + $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groups[0]->getId(),$message); + } + } + } + if($access=="config") { if($by=="view") return $this->redirect($this->generateUrl('cadoles_portal_config_page_view',["id"=>$idpage])); @@ -267,6 +281,19 @@ class PagewidgetController extends Controller if(!$canupdate) throw $this->createNotFoundException('Permission denied'); } + // Notification création widget + $groups=$entity->getPage()->getGroups(); + if($groups[0]) { + if($groups[0]->getFgcanshare()) { + $message="Suppression Widget ".$entity->getName(); + $usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$groups[0],"user"=>$this->getUser()]); + if($usergroup) { + $key=$usergroup->getKeyvalue(); + $websocket = $this->container->get('cadoles.websocket.pushmessage')->send($key,$this->getUser()->getId(),$groups[0]->getId(),$message); + } + } + } + // Supression du pagewidget $em->remove($entity); $em->flush(); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectController.php index 51918b4a..fbdc9164 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjectController.php @@ -352,6 +352,22 @@ class ProjectController extends Controller if (!$entity) throw $this->createNotFoundException('Unable to find entity.'); } + // On recherche la premiere page associé au groupe du projet + $idpage=null; + if($id!=0) { + $groups=$entity->getGroups(); + if($groups) { + if($groups[0]->getFgcanshare()) { + $pages=$groups[0]->getPages(); + if($pages) { + $idpage=$pages[0]->getId(); + $groups=$pages[0]->getGroups(); + $idgroup=$groups[0]->getId(); + } + } + } + } + // Permissions $user=$this->getUser(); if($access=="config") { @@ -415,7 +431,9 @@ class ProjectController extends Controller 'projects' => $projects, 'countarticles' => $count, 'pagination' => $pagination, - 'page' => $page + 'page' => $page, + 'idpage' => $idpage, + 'idgroup' => $idgroup ]); } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php index d966ae55..063af716 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ProjecttaskController.php @@ -28,14 +28,16 @@ class ProjecttaskController extends Controller return $this->createForm(ProjecttaskType::class, $entity, [ "mode" => "update", "access" => $access, - "user" => $this->getUser() + "user" => $this->getUser(), + "projecttask" => $entity ]); } else { return $this->createForm(ProjecttaskType::class, $entity, [ "mode" => "submit", "access" => $access, - "user" => $this->getUser() + "user" => $this->getUser(), + "projecttask" => $entity ]); } } @@ -48,7 +50,13 @@ class ProjecttaskController extends Controller if($project) $entity->setProject($project); $entity->setPriority(0); $entity->setPercentage(0); - + $pageid=$request->get("page"); + if($pageid) { + $page=$em->getRepository("CadolesPortalBundle:Page")->find($pageid); + $groups=$page->getGroups(); + $idgroup=$groups[0]->getId(); + } + $form = $this->entityForm($entity,$access); $form->handleRequest($request); @@ -76,7 +84,10 @@ class ProjecttaskController extends Controller } } - return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_projecttask_view',["id"=>$entity->getId()])); + if(is_null($pageid)) + return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_projecttask_view',["id"=>$entity->getId()])); + else + return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$pageid,"usage"=>"group","group"=>$idgroup])); } return $this->render($this->labelentity.':edit.html.twig', [ @@ -87,7 +98,8 @@ class ProjecttaskController extends Controller 'entity' => $entity, 'mode' => "submit", 'access' => $access, - 'form' => $form->createView() + 'form' => $form->createView(), + 'pageid' => $pageid ]); } @@ -186,6 +198,21 @@ class ProjecttaskController extends Controller $entity = $em->getRepository($this->labelentity)->find($id); if (!$entity) throw $this->createNotFoundException('Unable to find entity.'); + // On recherche la premiere page associé au groupe du projet + $groups=$entity->getProject()->getGroups(); + $idpage=null; + $idgroup=null; + if($groups) { + if($groups[0]->getFgcanshare()) { + $pages=$groups[0]->getPages(); + if($pages) { + $idpage=$pages[0]->getId(); + $groups=$pages[0]->getGroups(); + $idgroup=$groups[0]->getId(); + } + } + } + // Permissions $user=$this->getUser(); if($access=="config") { @@ -278,7 +305,9 @@ class ProjecttaskController extends Controller 'canadd' => $canadd, 'projects' => $projects, 'projecttasks' => $projecttasks, - 'files' => $files + 'files' => $files, + 'idpage' => $idpage, + 'idgroup' => $idgroup, ]); } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ProjecttaskType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ProjecttaskType.php index 3c8b0737..9e8a26f6 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ProjecttaskType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ProjecttaskType.php @@ -23,6 +23,7 @@ class ProjecttaskType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $user=$options['user']; + $projecttask=$options['projecttask']; $builder ->add('submit', SubmitType::class, [ @@ -49,6 +50,7 @@ class ProjecttaskType extends AbstractType ->add('end', DateType::class, [ "label" => 'A Réaliser avant le', "required" => false, + "widget" => 'single_text', ]) ->add('percentage', IntegerType::class, [ @@ -79,28 +81,46 @@ class ProjecttaskType extends AbstractType ]); } else { - $builder - ->add('project', EntityType::class, [ - 'label' => 'Projet associé', - 'class' => 'CadolesPortalBundle:Project', - 'choice_label' => 'name', - "disabled" => ($options["mode"]=="update"?true:false), - 'placeholder' => '-- Sélectionnez un Projet --', - 'query_builder' => function(EntityRepository $er) use ($user) { - $qb=$er->createQueryBuilder('project'); - return $qb->select('project') - ->where('project.user=:user') - ->orwhere(':user MEMBER OF project.writers') + if(!$projecttask->getProject()) { + $builder + ->add('project', EntityType::class, [ + 'label' => 'Projet associé', + 'class' => 'CadolesPortalBundle:Project', + 'choice_label' => 'name', + "disabled" => ($options["mode"]=="update"?true:false), + 'placeholder' => '-- Sélectionnez un Projet --', + 'query_builder' => function(EntityRepository $er) use ($user) { + $qb=$er->createQueryBuilder('project'); + return $qb->select('project') + ->where('project.user=:user') + ->orwhere(':user MEMBER OF project.writers') - ->from('CadolesCoreBundle:UserGroup','usergroup') - ->orwhere('usergroup.group MEMBER OF project.groups AND usergroup.user=:user') + ->from('CadolesCoreBundle:UserGroup','usergroup') + ->orwhere('usergroup.group MEMBER OF project.groups AND usergroup.user=:user') - ->from('CadolesCoreBundle:User','user') - ->andwhere("user=:user") + ->from('CadolesCoreBundle:User','user') + ->andwhere("user=:user") - ->setparameter('user',$user); - }, - ]); + ->setparameter('user',$user); + }, + ]); + } + else { + $builder + ->add('project', EntityType::class, [ + 'label' => 'Projet associé', + 'class' => 'CadolesPortalBundle:Project', + 'choice_label' => 'name', + "disabled" => ($options["mode"]=="update"?true:false), + 'placeholder' => '-- Sélectionnez un Projet --', + 'query_builder' => function(EntityRepository $er) use ($projecttask) { + $qb=$er->createQueryBuilder('project'); + return $qb->select('project') + ->where('project.id=:project') + ->setparameter('project',$projecttask->getProject()->getId()); + }, + ]); + } } $builder->add('user', @@ -132,7 +152,8 @@ class ProjecttaskType extends AbstractType 'data_class' => 'Cadoles\PortalBundle\Entity\Projecttask', 'mode' => 'string', 'access' => 'string', - 'user' => 'Cadoles\CoreBundle\Entity\User' + 'user' => 'Cadoles\CoreBundle\Entity\User', + 'projecttask' => 'Cadoles\PortalBundle\Entity\Projecttask' ]); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/pages.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/pages.html.twig index a2518162..1d42fada 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/pages.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/pages.html.twig @@ -386,7 +386,7 @@ else { var myclass=""; if(forcereload) myclass="pageframereload"; - $("#pagecontainer").append(""); + $("#pagecontainer").append(""); } resizeFrame(); @@ -428,7 +428,7 @@ else { var myclass=""; if(forcereload) myclass="pageframereload"; - $("#pagecontainer").append(""); + $("#pagecontainer").append(""); } // Détruire le badge associé car normalement de fait on a lu les notif @@ -436,7 +436,6 @@ $("#badge-"+groupid).remove() } - // Cacher les actions possibles sur la page $("#menuupdate").hide(); $("#menushare").hide(); @@ -456,14 +455,17 @@ if(usage=="group") $("#menuwidgetgroup").show(); } - + // On resize les frame resizeFrame(); + + // Mettre le focus dans la frame + //$("#page-"+id).contentWindow.focus(); } // Affichages des pages function showGoto(url) { - $("#pagecontainer").append(""); + $("#pagecontainer").append(""); // On resize les frame resizeFrame(); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/viewurl.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/viewurl.html.twig index f24dc29e..e4882547 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/viewurl.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/viewurl.html.twig @@ -22,7 +22,7 @@ {% endif %}
- +
{% endblock %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/viewwidget.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/viewwidget.html.twig index 11c4927d..53727cd2 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/viewwidget.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/viewwidget.html.twig @@ -328,7 +328,7 @@ // Suppression d'un widget function delWidget(idwidget) { var txt; - var r = confirm("Confirmez-vous la suppression de ce widget ?"); + var r = confirm("ATTENTION\nConfirmez-vous la suppression de ce widget ?\n\nL'ensemble du contenu sera définitivement perdu !!"); if (r == true) { $.ajax({ method: "POST", diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewalert.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewalert.html.twig index 9cdfa329..460f8d3f 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewalert.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewalert.html.twig @@ -15,8 +15,8 @@
{% if canupdate %}
- - + +
{% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewappexternal.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewappexternal.html.twig index f788e321..2bef057b 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewappexternal.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewappexternal.html.twig @@ -30,8 +30,8 @@ {% if canupdate or canadd %}
{% if canupdate %} - - + + {% endif %}
{% endif %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewblog.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewblog.html.twig index 80fa0fc6..28c84cd9 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewblog.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewblog.html.twig @@ -21,19 +21,19 @@
{% if canupdate %} - - + + {% endif %} {% if access=="config" %} - + {% else %} {% set idblog = "" %} {% set url= path('cadoles_portal_user_blog_view') %} {% if usage=="group" and firstblog is defined %} {% set url= path('cadoles_portal_user_blog_view',{id:firstblog}) %} {% endif %} - + {% endif %}
diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewbookmark.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewbookmark.html.twig index 7796af53..315146b2 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewbookmark.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewbookmark.html.twig @@ -37,12 +37,12 @@ {% if canupdate or canadd %}
{% if canupdate %} - - + + {% endif %} {% if canadd %} - + {% endif %}
{% endif %} @@ -99,7 +99,7 @@ {% if canadd %}
-
+