Compare commits
4 Commits
74c0a44f56
...
75925d4969
Author | SHA1 | Date |
---|---|---|
Arnaud Fornerot | 75925d4969 | |
afornerot | 4aa766759c | |
afornerot | dbade2fce4 | |
afornerot | ae4debf6b9 |
|
@ -2,6 +2,7 @@
|
||||||
/app/config/parameters.yml
|
/app/config/parameters.yml
|
||||||
/app/config/template.yml
|
/app/config/template.yml
|
||||||
/src/Cadoles/CoreBundle/Command/data/core-init-01.sql
|
/src/Cadoles/CoreBundle/Command/data/core-init-01.sql
|
||||||
|
/src/Cadoles/CoreBundle/Command/LocalCommand.php
|
||||||
/build/
|
/build/
|
||||||
/phpunit.xml
|
/phpunit.xml
|
||||||
/var/*
|
/var/*
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
namespace Cadoles\CoreBundle\Command;
|
||||||
|
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Symfony\Component\Finder\Finder;
|
||||||
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
|
||||||
|
class LocalCommand extends Command
|
||||||
|
{
|
||||||
|
private $container;
|
||||||
|
private $em;
|
||||||
|
private $output;
|
||||||
|
private $filesystem;
|
||||||
|
private $rootlog;
|
||||||
|
|
||||||
|
protected function configure()
|
||||||
|
{
|
||||||
|
$this
|
||||||
|
->setName('Core:Local')
|
||||||
|
->setDescription('Lauch Local Script')
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
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/";
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function writelnred($string) {
|
||||||
|
$this->output->writeln('<fg=red>'.$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");
|
||||||
|
}
|
||||||
|
}
|
|
@ -49,6 +49,11 @@ rm -f /var/www/html/ninegate/var/logs/dev.log
|
||||||
# Copie des polices du projet dans le rep web
|
# Copie des polices du projet dans le rep web
|
||||||
cp -rf src/Cadoles/CoreBundle/Resources/public/fonts web/
|
cp -rf src/Cadoles/CoreBundle/Resources/public/fonts web/
|
||||||
|
|
||||||
|
# Copie de la commande local de base si elle la commande n'existe pas
|
||||||
|
if [ ! -f src/Cadoles/CoreBundle/Command/LocalCommand.php ]; then
|
||||||
|
cp -rf scripts/LocalCommand.php src/Cadoles/CoreBundle/Command/LocalCommand.php
|
||||||
|
fi
|
||||||
|
|
||||||
# Nettoyage du cache
|
# Nettoyage du cache
|
||||||
echo
|
echo
|
||||||
echo CACHE = Refresh
|
echo CACHE = Refresh
|
||||||
|
@ -66,6 +71,9 @@ php bin/console Portal:InitData --env=prod
|
||||||
# Passage des scripts
|
# Passage des scripts
|
||||||
php bin/console Core:Script --env=prod
|
php bin/console Core:Script --env=prod
|
||||||
|
|
||||||
|
# Passage des scripts locaux
|
||||||
|
php bin/console Core:Local --env=prod
|
||||||
|
|
||||||
# Generation des assets
|
# Generation des assets
|
||||||
echo ASSET = Dump
|
echo ASSET = Dump
|
||||||
bin/console assetic:dump --env=prod --quiet
|
bin/console assetic:dump --env=prod --quiet
|
||||||
|
|
|
@ -138,6 +138,7 @@ class InitDataCommand extends ContainerAwareCommand
|
||||||
$usergroup->setUser($user);
|
$usergroup->setUser($user);
|
||||||
$usergroup->setGroup($group);
|
$usergroup->setGroup($group);
|
||||||
$usergroup->setKeyvalue($key);
|
$usergroup->setKeyvalue($key);
|
||||||
|
$usergroup->setRolegroup(0);
|
||||||
$em->persist($usergroup);
|
$em->persist($usergroup);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
$em->clear();
|
$em->clear();
|
||||||
|
|
|
@ -287,7 +287,7 @@ class OnlyCommand extends Command
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
// On ajoute le propriétaire en tant que membre du groupe
|
// On ajoute le propriétaire en tant que membre du groupe
|
||||||
$this->addMember($group,$user,true);
|
$this->addMember($group,$user,100);
|
||||||
|
|
||||||
// On controle que le groupe a bien page / calendrier / blog / project
|
// On controle que le groupe a bien page / calendrier / blog / project
|
||||||
$this->ctrlFgcanshare($group,$user,$pagetemplate);
|
$this->ctrlFgcanshare($group,$user,$pagetemplate);
|
||||||
|
@ -318,7 +318,7 @@ class OnlyCommand extends Command
|
||||||
// On s'assure qu'il n'es pas déjà rattaché
|
// On s'assure qu'il n'es pas déjà rattaché
|
||||||
$usergroup=$this->em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$user,"group"=>$group]);
|
$usergroup=$this->em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$user,"group"=>$group]);
|
||||||
if(!$usergroup) {
|
if(!$usergroup) {
|
||||||
$this->addMember($group,$user,false);
|
$this->addMember($group,$user,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -578,12 +578,12 @@ class OnlyCommand extends Command
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function addMember($group,$user,$fgmanager) {
|
private function addMember($group,$user,$role) {
|
||||||
$key = Uuid::uuid4();
|
$key = Uuid::uuid4();
|
||||||
$usergroup=new Usergroup;
|
$usergroup=new UserGroup();
|
||||||
$usergroup->setUser($user);
|
$usergroup->setUser($user);
|
||||||
$usergroup->setGroup($group);
|
$usergroup->setGroup($group);
|
||||||
$usergroup->setFgmanager($fgmanager);
|
$usergroup->setRolegroup($role);
|
||||||
$usergroup->setKeyvalue($key);
|
$usergroup->setKeyvalue($key);
|
||||||
$this->em->persist($usergroup);
|
$this->em->persist($usergroup);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
|
@ -239,6 +239,7 @@ class ScribeToNinegateCommand extends Command
|
||||||
$member= new UserGroup();
|
$member= new UserGroup();
|
||||||
$member->setGroup($group);
|
$member->setGroup($group);
|
||||||
$member->setUser($user);
|
$member->setUser($user);
|
||||||
|
$member->setRolegroup(0);
|
||||||
|
|
||||||
$this->em->persist($member);
|
$this->em->persist($member);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
|
@ -132,6 +132,18 @@ class ScriptCommand extends Command
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"rolegroup"]);
|
||||||
|
if(!$script) {
|
||||||
|
$this->writelnred("== SCRIPT = rolegroup");
|
||||||
|
$this->rolegroup();
|
||||||
|
|
||||||
|
$script=new Script();
|
||||||
|
$script->setName("rolegroup");
|
||||||
|
$this->em->persist($script);
|
||||||
|
$this->em->flush();
|
||||||
|
$this->writeln("");
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,7 +301,23 @@ class ScriptCommand extends Command
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function rolegroup(){
|
||||||
|
|
||||||
|
$usergroups = $this->em->getRepository('CadolesCoreBundle:UserGroup')->findAll();
|
||||||
|
foreach($usergroups as $usergroup) {
|
||||||
|
if(!$usergroup->getRolegroup()) {
|
||||||
|
$role=0;
|
||||||
|
if($usergroup->getFgmanager()) {
|
||||||
|
$role=50;
|
||||||
|
if($usergroup->getUser()==$usergroup->getGroup()->getOwner()) $role=100;
|
||||||
|
}
|
||||||
|
|
||||||
|
$usergroup->setRolegroup($role);
|
||||||
|
$this->em->persist($usergroup);
|
||||||
|
$this->em->flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -899,6 +899,7 @@ class SynchroCommand extends Command
|
||||||
$member= new UserGroup();
|
$member= new UserGroup();
|
||||||
$member->setGroup($group);
|
$member->setGroup($group);
|
||||||
$member->setUser($user);
|
$member->setUser($user);
|
||||||
|
$member->setRolegroup(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si modèle scribe
|
// Si modèle scribe
|
||||||
|
@ -907,7 +908,7 @@ class SynchroCommand extends Command
|
||||||
if($ldap_template=="scribe"&&$scribe_master) {
|
if($ldap_template=="scribe"&&$scribe_master) {
|
||||||
$ldapfilter="(|(&(uid=".$user->getUsername().")(ENTPersonProfils=enseignant))(&(uid=".$user->getUsername().")(typeadmin=0))(&(uid=".$user->getUsername().")(typeadmin=2)))";
|
$ldapfilter="(|(&(uid=".$user->getUsername().")(ENTPersonProfils=enseignant))(&(uid=".$user->getUsername().")(typeadmin=0))(&(uid=".$user->getUsername().")(typeadmin=2)))";
|
||||||
$results = $this->ldap->search($ldapfilter, ['uid'], $this->ldap_basedn);
|
$results = $this->ldap->search($ldapfilter, ['uid'], $this->ldap_basedn);
|
||||||
if($results) $member->setFgmanager(true);
|
if($results) $member->setRolegroup(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->em->persist($member);
|
$this->em->persist($member);
|
||||||
|
|
|
@ -720,8 +720,9 @@ class FileController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
// On s'assure que l'utilisateur à la permission de voir
|
||||||
$page=$widget->getPage();
|
$page=$widget->getPage();
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate,$canadd);
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
|
return $canadd;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "projecttask":
|
case "projecttask":
|
||||||
|
@ -734,6 +735,7 @@ class FileController extends Controller
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$project,$cansee,$canupdate,$canadd);
|
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$project,$cansee,$canupdate,$canadd);
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
|
return $canupdate;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "calendarevent":
|
case "calendarevent":
|
||||||
|
@ -744,13 +746,12 @@ class FileController extends Controller
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
// On s'assure que l'utilisateur à la permission de voir
|
||||||
$calendar=$calendarevent->getCalendar();
|
$calendar=$calendarevent->getCalendar();
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($user,$calendar,$cansee,$canupdate);
|
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($user,$calendar,$cansee,$canupdate,$canadd);
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
|
return $canadd;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else $canupdate=true;
|
else $canupdate=true;
|
||||||
|
|
||||||
return $canupdate;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,19 +178,19 @@ class GroupController extends Controller
|
||||||
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-chart-area fa-fw fa-2x'></i></a>";
|
$action.="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_statistic', array('id'=>$data->getId()))."'><i class='fa fa-chart-area fa-fw fa-2x'></i></a>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$fgproprio=($user==$data->getOwner());
|
$fgcanupdate=($user==$data->getOwner());
|
||||||
$fgmanager=false;
|
$fgcanmanage=false;
|
||||||
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$this->getUser(),"group"=>$data]);
|
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$this->getUser(),"group"=>$data]);
|
||||||
if($usergroup) $fgmanager=$usergroup->getFgmanager();
|
if($usergroup) $fgcanmanage=($usergroup->getRolegroup()>=90);
|
||||||
|
|
||||||
// Modification possible uniquement si l'utilisateur est propriétaire du groupe
|
// Modification possible uniquement si l'utilisateur est propriétaire du groupe
|
||||||
if($fgproprio) {
|
if($fgcanupdate) {
|
||||||
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-2x fa-fw'></i></a>";
|
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-2x fa-fw'></i></a>";
|
||||||
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_delete', array('id'=>$data->getId()))."'><i class='fa fa-trash fa-2x fa-fw'></i></a>";
|
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_delete', array('id'=>$data->getId()))."'><i class='fa fa-trash fa-2x fa-fw'></i></a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gestion des utilisateurs du groupe uniquement pour le proprio ou les managers
|
// Gestion des utilisateurs du groupe uniquement pour le proprio ou les managers
|
||||||
if($fgproprio||$fgmanager) {
|
if($fgcanupdate||$fgcanmanage) {
|
||||||
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_users', array('id'=>$data->getId()))."'><i class='fa fa-users fa-2x fa-fw'></i></a>";
|
$action .="<a href='".$this->generateUrl('cadoles_core_'.$access.'_group_users', array('id'=>$data->getId()))."'><i class='fa fa-users fa-2x fa-fw'></i></a>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -370,12 +370,10 @@ class GroupController extends Controller
|
||||||
if($group->getLdapfilter()==""&&$group->getAttributes()=="")
|
if($group->getLdapfilter()==""&&$group->getAttributes()=="")
|
||||||
$action.="<a style='cursor:pointer' onClick='addUsers(".$data->getId().")'><i class='fa fa-plus fa-fw'></i></a>";
|
$action.="<a style='cursor:pointer' onClick='addUsers(".$data->getId().")'><i class='fa fa-plus fa-fw'></i></a>";
|
||||||
|
|
||||||
$fgmanager="<input type='checkbox' class='switch' onChange='switchManager(".$data->getId().");'>";
|
|
||||||
|
|
||||||
// Avatar
|
// Avatar
|
||||||
$avatar="<img onClick='seeUser(".$data->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;cursor:pointer;'>";
|
$avatar="<img onClick='seeUser(".$data->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;cursor:pointer;'>";
|
||||||
|
|
||||||
array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),"",$fgmanager));
|
array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),"",""));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retour
|
// Retour
|
||||||
|
@ -494,6 +492,7 @@ class GroupController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult();
|
$datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult();
|
||||||
|
$user=$this->getUser();
|
||||||
|
|
||||||
foreach($datas as $data) {
|
foreach($datas as $data) {
|
||||||
// Propriétaire
|
// Propriétaire
|
||||||
|
@ -509,13 +508,17 @@ class GroupController extends Controller
|
||||||
$avatar="<img onClick='seeUser(".$data->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;cursor:pointer'>";
|
$avatar="<img onClick='seeUser(".$data->getId().")' src='/".$this->container->getParameter('alias')."/uploads/avatar/".$data->getAvatar()."' style='width:30px;background-color:#337ab7;margin:auto;display:block;cursor:pointer'>";
|
||||||
|
|
||||||
// Flag manager
|
// Flag manager
|
||||||
$fgmanager="";
|
$rolegroup="";
|
||||||
if($fgcanshare) {
|
if($fgcanshare) {
|
||||||
|
if($fgproprio) $rolegroup="Propriétaire du groupe";
|
||||||
$checked=($usergroup->getFgmanager()?"checked":"");
|
elseif($user==$usergroup->getUser()) $rolegroup="Gestionnaire";
|
||||||
$fgmanager="<input type='checkbox' class='switch' onChange='switchManager(".$data->getId().");' $checked>";
|
else {
|
||||||
if($fgproprio) $fgmanager="Propriétaire du groupe";
|
$selectuser=($usergroup->getRolegroup()==0?"selected='selected'":"");
|
||||||
|
$selectwritter=($usergroup->getRolegroup()==50?"selected='selected'":"");
|
||||||
|
$selectmanager=($usergroup->getRolegroup()==90?"selected='selected'":"");
|
||||||
|
|
||||||
|
$rolegroup='<select id="roleuser-'.$data->getId().'" name="user[visible]" onChange="changeRole('.$data->getId().');"><option value="0" '.$selectuser.'>Utilisateur</option><option value="50" '.$selectwritter.'>Collaborateur</option><option value="90" '.$selectmanager.'>Gestionnaire</option></select>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Visite
|
// Visite
|
||||||
|
@ -524,7 +527,7 @@ class GroupController extends Controller
|
||||||
$visite=$usergroup->getVisitedate()->format("d/m/Y H:i")."<br>nb = ".$usergroup->getVisitecpt();
|
$visite=$usergroup->getVisitedate()->format("d/m/Y H:i")."<br>nb = ".$usergroup->getVisitecpt();
|
||||||
}
|
}
|
||||||
|
|
||||||
array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$visite,$fgmanager));
|
array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$visite,$rolegroup));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retour
|
// Retour
|
||||||
|
@ -557,11 +560,12 @@ class GroupController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = Uuid::uuid4();
|
$key = Uuid::uuid4();
|
||||||
$usergroup=new Usergroup;
|
$usergroup=new UserGroup();
|
||||||
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
|
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
|
||||||
$usergroup->setUser($user);
|
$usergroup->setUser($user);
|
||||||
$usergroup->setGroup($group);
|
$usergroup->setGroup($group);
|
||||||
$usergroup->setKeyvalue($key);
|
$usergroup->setKeyvalue($key);
|
||||||
|
$usergroup->setRolegroup(0);
|
||||||
$em->persist($usergroup);
|
$em->persist($usergroup);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
|
@ -633,10 +637,11 @@ class GroupController extends Controller
|
||||||
"body_html"=>nl2br($text),
|
"body_html"=>nl2br($text),
|
||||||
"body_text"=>$text
|
"body_text"=>$text
|
||||||
);
|
);
|
||||||
$managers=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$groupid,"fgmanager"=>true));
|
$usergroups=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$groupid));
|
||||||
$to=array();
|
$to=array();
|
||||||
foreach($managers as $manager) {
|
foreach($usergroups as $usergroup) {
|
||||||
array_push($to,$manager->getUser()->getEmail());
|
if($usergroup->getRolegroup()>=90)
|
||||||
|
array_push($to,$usergroup->getUser()->getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
$from = $this->getParameter('noreply');;
|
$from = $this->getParameter('noreply');;
|
||||||
|
@ -678,10 +683,11 @@ class GroupController extends Controller
|
||||||
"body_html"=>nl2br($text),
|
"body_html"=>nl2br($text),
|
||||||
"body_text"=>$text
|
"body_text"=>$text
|
||||||
);
|
);
|
||||||
$managers=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group,"fgmanager"=>true));
|
$usergroups=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group));
|
||||||
$to=array();
|
$to=array();
|
||||||
foreach($managers as $manager) {
|
foreach($usergroups as $usergroup) {
|
||||||
array_push($to,$manager->getUser()->getEmail());
|
if($usergroup->getRolegroup()>=90)
|
||||||
|
array_push($to,$usergroup->getUser()->getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
$from = $this->getParameter('noreply');;
|
$from = $this->getParameter('noreply');;
|
||||||
|
@ -695,7 +701,7 @@ class GroupController extends Controller
|
||||||
return $this->redirect($this->generateUrl("cadoles_core_user_group"));
|
return $this->redirect($this->generateUrl("cadoles_core_user_group"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function switchmanagerAction(Request $request,$access="config")
|
public function changeroleAction(Request $request,$access="config")
|
||||||
{
|
{
|
||||||
// S'assurer que c'est un appel ajax
|
// S'assurer que c'est un appel ajax
|
||||||
if (!$request->isXmlHttpRequest()) {
|
if (!$request->isXmlHttpRequest()) {
|
||||||
|
@ -707,12 +713,13 @@ class GroupController extends Controller
|
||||||
$output=array();
|
$output=array();
|
||||||
$userid=$request->request->get('user');
|
$userid=$request->request->get('user');
|
||||||
$groupid=$request->request->get('group');
|
$groupid=$request->request->get('group');
|
||||||
|
$role=$request->request->get('role');
|
||||||
|
|
||||||
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
||||||
$this->canManager($group,$access);
|
$this->canManager($group,$access);
|
||||||
|
|
||||||
$data = $em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(array("user"=>$userid,"group"=>$groupid));
|
$data = $em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(array("user"=>$userid,"group"=>$groupid));
|
||||||
if($data) $data->setFgmanager(!$data->getFgmanager());
|
if($data) $data->setRolegroup($role);
|
||||||
|
|
||||||
$em->persist($data);
|
$em->persist($data);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
@ -1241,8 +1248,8 @@ class GroupController extends Controller
|
||||||
protected function canManager($group,$access) {
|
protected function canManager($group,$access) {
|
||||||
if($access!="config") {
|
if($access!="config") {
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$ismanager=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser(),"fgmanager"=>true]);
|
$user=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$this->getUser()]);
|
||||||
if(!$ismanager)
|
if(!$user||$user->getRolegroup()<90)
|
||||||
throw $this->createNotFoundException('Permission denied');
|
throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1258,19 +1265,27 @@ class GroupController extends Controller
|
||||||
|
|
||||||
protected function ctrlOwner($group) {
|
protected function ctrlOwner($group) {
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
// Le propriétaire passe manager
|
||||||
|
$usergroups=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(["group"=>$group,"rolegroup"=>"100"]);
|
||||||
|
foreach($usergroups as $usergroup) {
|
||||||
|
$usergroup->setRolegroup(90);
|
||||||
|
$em->persist($usergroup);
|
||||||
|
$em->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Le propriétaire prend son role dans le groupe
|
||||||
if($group->getOwner()) {
|
if($group->getOwner()) {
|
||||||
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$group->getOwner()]);
|
$usergroup=$em->getRepository("CadolesCoreBundle:Usergroup")->findOneBy(["group"=>$group,"user"=>$group->getOwner()]);
|
||||||
if(!$usergroup) {
|
if(!$usergroup) {
|
||||||
$key = Uuid::uuid4();
|
$key = Uuid::uuid4();
|
||||||
$usergroup=new Usergroup;
|
$usergroup=new UserGroup();
|
||||||
$usergroup->setUser($group->getOwner());
|
$usergroup->setUser($group->getOwner());
|
||||||
$usergroup->setGroup($group);
|
$usergroup->setGroup($group);
|
||||||
$usergroup->setKeyvalue($key);
|
$usergroup->setKeyvalue($key);
|
||||||
}
|
}
|
||||||
$usergroup->setFgmanager(true);
|
$usergroup->setRolegroup(100);
|
||||||
$em->persist($usergroup);
|
$em->persist($usergroup);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -544,11 +544,12 @@ class RegistrationController extends Controller
|
||||||
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
$group=$em->getRepository("CadolesCoreBundle:Group")->find($groupid);
|
||||||
if($group) {
|
if($group) {
|
||||||
$key = Uuid::uuid4();
|
$key = Uuid::uuid4();
|
||||||
$usergroup=new Usergroup;
|
$usergroup=new UserGroup();
|
||||||
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
|
$user=$em->getRepository("CadolesCoreBundle:User")->find($userid);
|
||||||
$usergroup->setUser($user);
|
$usergroup->setUser($user);
|
||||||
$usergroup->setGroup($group);
|
$usergroup->setGroup($group);
|
||||||
$usergroup->setKeyvalue($key);
|
$usergroup->setKeyvalue($key);
|
||||||
|
$usergroup->setRolegroup(0);
|
||||||
$em->persist($usergroup);
|
$em->persist($usergroup);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
|
|
|
@ -419,6 +419,7 @@ class UserController extends Controller
|
||||||
$datagroup = $group;
|
$datagroup = $group;
|
||||||
$usergroup->setGroup($datagroup);
|
$usergroup->setGroup($datagroup);
|
||||||
$usergroup->setKeyvalue($key);
|
$usergroup->setKeyvalue($key);
|
||||||
|
$usergroup->setRolegroup(0);
|
||||||
$em->persist($usergroup);
|
$em->persist($usergroup);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
}
|
}
|
||||||
|
@ -569,6 +570,7 @@ class UserController extends Controller
|
||||||
$datagroup = $group;
|
$datagroup = $group;
|
||||||
$usergroup->setGroup($datagroup);
|
$usergroup->setGroup($datagroup);
|
||||||
$usergroup->setKeyvalue($key);
|
$usergroup->setKeyvalue($key);
|
||||||
|
$usergroup->setRolegroup(0);
|
||||||
$em->persist($usergroup);
|
$em->persist($usergroup);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
}
|
}
|
||||||
|
@ -629,12 +631,14 @@ class UserController extends Controller
|
||||||
"body_html"=>nl2br($text),
|
"body_html"=>nl2br($text),
|
||||||
"body_text"=>$text
|
"body_text"=>$text
|
||||||
);
|
);
|
||||||
$managers=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group,"fgmanager"=>true));
|
$usergroups=$em->getRepository("CadolesCoreBundle:Usergroup")->findBy(array("group"=>$group));
|
||||||
$to=array();
|
$to=array();
|
||||||
foreach($managers as $manager) {
|
foreach($usergroups as $usergroup) {
|
||||||
array_push($to,$manager->getUser()->getEmail());
|
if($usergroup->getRolegroup()>=90)
|
||||||
|
array_push($to,$usergroup->getUser()->getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$from = $this->getParameter('noreply');;
|
$from = $this->getParameter('noreply');;
|
||||||
$fromName = $this->get('session')->get('appname');
|
$fromName = $this->get('session')->get('appname');
|
||||||
$message = $this->container->get('cadoles.core.service.mail');
|
$message = $this->container->get('cadoles.core.service.mail');
|
||||||
|
|
|
@ -37,9 +37,15 @@ class UserGroup
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="boolean", options={"default" : false})
|
* @ORM\Column(type="boolean", options={"default" : false})
|
||||||
|
* CE CHAMP N'EST PLUS UTILSE
|
||||||
*/
|
*/
|
||||||
private $fgmanager = false;
|
private $fgmanager = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="integer", length=60, nullable=true)
|
||||||
|
*/
|
||||||
|
private $rolegroup;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string", length=60, nullable=true)
|
* @ORM\Column(type="string", length=60, nullable=true)
|
||||||
*/
|
*/
|
||||||
|
@ -208,4 +214,28 @@ class UserGroup
|
||||||
{
|
{
|
||||||
return $this->visitecpt;
|
return $this->visitecpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set rolegroup
|
||||||
|
*
|
||||||
|
* @param integer $rolegroup
|
||||||
|
*
|
||||||
|
* @return UserGroup
|
||||||
|
*/
|
||||||
|
public function setRolegroup($rolegroup)
|
||||||
|
{
|
||||||
|
$this->rolegroup = $rolegroup;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get rolegroup
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function getRolegroup()
|
||||||
|
{
|
||||||
|
return $this->rolegroup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,6 +181,7 @@ class syncUser implements EventSubscriber
|
||||||
$data->setUser($user);
|
$data->setUser($user);
|
||||||
$data->setGroup($fgall[0]);
|
$data->setGroup($fgall[0]);
|
||||||
$data->setKeyvalue($key);
|
$data->setKeyvalue($key);
|
||||||
|
$data->setRolegroup(0);
|
||||||
$this->em->persist($data);
|
$this->em->persist($data);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,7 @@ class GroupRepository extends \Doctrine\ORM\EntityRepository
|
||||||
$usergroup->setUser($user);
|
$usergroup->setUser($user);
|
||||||
$usergroup->setGroup($retgroup);
|
$usergroup->setGroup($retgroup);
|
||||||
$usergroup->setKeyvalue($key);
|
$usergroup->setKeyvalue($key);
|
||||||
|
$usergroup->setRolegroup(0);
|
||||||
|
|
||||||
$this->_em->persist($usergroup);
|
$this->_em->persist($usergroup);
|
||||||
$this->_em->flush();
|
$this->_em->flush();
|
||||||
|
|
|
@ -494,9 +494,9 @@ cadoles_core_config_group_ajax_usergroup_del:
|
||||||
path: /config/group/ajax/usergroupdel
|
path: /config/group/ajax/usergroupdel
|
||||||
defaults: { _controller: CadolesCoreBundle:Group:usergroupdel, access: config }
|
defaults: { _controller: CadolesCoreBundle:Group:usergroupdel, access: config }
|
||||||
|
|
||||||
cadoles_core_config_group_ajax_switchmanager:
|
cadoles_core_config_group_ajax_changerole:
|
||||||
path: /config/group/ajax/switchmanager
|
path: /config/group/ajax/changerole
|
||||||
defaults: { _controller: CadolesCoreBundle:Group:switchmanager, access: config }
|
defaults: { _controller: CadolesCoreBundle:Group:changerole, access: config }
|
||||||
|
|
||||||
cadoles_core_config_group_export:
|
cadoles_core_config_group_export:
|
||||||
path: /config/group/export
|
path: /config/group/export
|
||||||
|
@ -559,9 +559,9 @@ cadoles_core_user_group_ajax_usergroup_del:
|
||||||
path: /user/group/ajax/usergroupdel
|
path: /user/group/ajax/usergroupdel
|
||||||
defaults: { _controller: CadolesCoreBundle:Group:usergroupdel, access: user }
|
defaults: { _controller: CadolesCoreBundle:Group:usergroupdel, access: user }
|
||||||
|
|
||||||
cadoles_core_user_group_ajax_switchmanager:
|
cadoles_core_user_group_ajax_changerole:
|
||||||
path: /user/group/ajax/switchmanager
|
path: /user/group/ajax/changerole
|
||||||
defaults: { _controller: CadolesCoreBundle:Group:switchmanager, access: user }
|
defaults: { _controller: CadolesCoreBundle:Group:changerole, access: user }
|
||||||
|
|
||||||
cadoles_core_user_group_usergroup_export:
|
cadoles_core_user_group_usergroup_export:
|
||||||
path: /user/group/users/export/{id}
|
path: /user/group/users/export/{id}
|
||||||
|
|
|
@ -9,10 +9,15 @@
|
||||||
<a class="btn btn-default" href={{ path('cadoles_core_home',{'id':idreturn}) }}>Fermer</a>
|
<a class="btn btn-default" href={{ path('cadoles_core_home',{'id':idreturn}) }}>Fermer</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if moderegistration!="none" and masteridentity=="SQL"%}
|
{% if moderegistration!="none" and masteridentity=="SQL" and group.fgcanshare %}
|
||||||
<a class="btn btn-primary" style="cursor:pointer" onClick="showMail();">Inviter des personnes non listées ci-dessous</a>
|
<a class="btn btn-primary" style="cursor:pointer" onClick="showMail();">Inviter des personnes non listées ci-dessous</a>
|
||||||
<a class="btn btn-primary" style="cursor:pointer" onClick="showInvitations();">Suivi des Invitations</a>
|
<a class="btn btn-primary" style="cursor:pointer" onClick="showInvitations();">Suivi des Invitations</a>
|
||||||
{%endif%}
|
{%endif%}
|
||||||
|
|
||||||
|
{% if group.fgcanshare %}
|
||||||
|
<button class="btn btn-default pull-right" style="margin-left:10px" data-toggle="modal" data-target="#modalperm">Matrice des permissions</button>
|
||||||
|
{%endif%}
|
||||||
|
|
||||||
<a class="btn btn-default pull-right" href={{ path('cadoles_core_'~access~'_group_usergroup_export',{'id':group.id}) }}>Exporter CSV</a>
|
<a class="btn btn-default pull-right" href={{ path('cadoles_core_'~access~'_group_usergroup_export',{'id':group.id}) }}>Exporter CSV</a>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
@ -70,6 +75,333 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="modalperm" class="modal fade bs-item-modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">MATRICE DES PERMISSIONS</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="dataTable_wrapper">
|
||||||
|
<table class="table table-striped table-bordered table-hover" id="dataTablesnotin" style="width:100%; text-align:center; zoom:80%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Permissions</th>
|
||||||
|
<th>Propriétaire</th>
|
||||||
|
<th>Gestionnaire</th>
|
||||||
|
<th>Collaborateur</th>
|
||||||
|
<th>Utilisateur</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" style="font-weight: bold;">GROUPE</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier le groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Supprimer le groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Changer le propriétaire du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Affecter des utilisateurs au groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Désaffecter des utilisateurs au groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Inviter des utilisateurs dans le groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Visualiser les statistiques du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">S’inscrire par soit même sur les groupes ouverts</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Se désinscrire par soit même </td>
|
||||||
|
<td></td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" style="font-weight: bold;">PAGE</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager des Pages sur le groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Placer en favoris une page du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" style="font-weight: bold;">WIDGET</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Widget Favoris = Ajouter / Modifier / Supprimer Lien</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Widget Fichier = Ajouter / Modifier / Supprimer Fichiers</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Widget Lien = Modifier Lien</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Widget Editeur = Modifier Texte</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Widget Carrousel = Créer / Modifier / Supprimer Image</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Widget Gallerie Images = Créer / Modifier / Supprimer Image</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Widget Chat = Ajouter commentaires</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Widget Chat = Modifier / Supprimer Commentaires des membres du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Widget Chat = Masquer Commentaires des membres du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" style="font-weight: bold;">BLOG</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager un blog sur le groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Créer des articles sur les blogs du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer ses articles sur les blogs du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer des articles de blog des autres membres du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Ajouter des commentaires sur les articles du blog</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer ses propres commentaires</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer les commentaires des autres membre du groupe de ses articles</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer les commentaires des autres membre du groupe sur l'ensemble du blog</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" style="font-weight: bold;">PROJET</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager des projets sur le groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Créer des taches sur les projets du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer ses propres tâches</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Affecter des tâches aux autres membres du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer des Tâches à des autres membres du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Ajouter des commentaires sur les tâches</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer ses propres commentaires de tâches</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer les commentaires des autres membre du groupe de ses taches</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Modifier / Supprimer les commentaires des taches sur l'ensemble du projet</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" style="font-weight: bold;">CALENDRIER</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager un calendrier sur le groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Créer des évènements sur les calendriers du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;">Créer / Modifier / Supprimer / Partager des évènements sur les calendriers du groupe</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td>x</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block localjavascript %}
|
{% block localjavascript %}
|
||||||
|
@ -152,15 +484,17 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchManager(id) {
|
function changeRole(id) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "{{ path('cadoles_core_'~access~'_group_ajax_switchmanager') }}",
|
url: "{{ path('cadoles_core_'~access~'_group_ajax_changerole') }}",
|
||||||
data: {
|
data: {
|
||||||
"group": {{ group.id }},
|
"group": {{ group.id }},
|
||||||
"user": id,
|
"user": id,
|
||||||
|
"role": $("#roleuser-"+id).val(),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMail() {
|
function showMail() {
|
||||||
|
|
|
@ -106,6 +106,7 @@ class BlogarticleController extends Controller
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlog(),$cansee,$canupdate,$canadd);
|
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlog(),$cansee,$canupdate,$canadd);
|
||||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
|
elseif(!$canupdate&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Création du formulaire
|
// Création du formulaire
|
||||||
|
@ -157,6 +158,7 @@ class BlogarticleController extends Controller
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlog(),$cansee,$canupdate,$canadd);
|
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlog(),$cansee,$canupdate,$canadd);
|
||||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
|
elseif(!$canupdate&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Suppression
|
// Suppression
|
||||||
|
@ -208,12 +210,10 @@ class BlogarticleController extends Controller
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($user,$entity->getBlog(),$cansee,$canupdate,$canadd);
|
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($user,$entity->getBlog(),$cansee,$canupdate,$canadd);
|
||||||
|
if(!$canupdate&&$this->getUser()==$entity->getUser()) $canupdate=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
|
|
||||||
$canupdate=false;
|
|
||||||
if($user) $canupdate=true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,10,$count,$blogarticles);
|
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,10,$count,$blogarticles);
|
||||||
|
|
|
@ -145,7 +145,8 @@ class BlogcommentController extends Controller
|
||||||
// On s'assure que l'utilisateur à la permission de modifier
|
// On s'assure que l'utilisateur à la permission de modifier
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlogarticle()->getBlog(),$cansee,$canupdate,$canadd);
|
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlogarticle()->getBlog(),$cansee,$canupdate,$canadd);
|
||||||
if(!$canadd&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate&&$this->getUser()==$entity->getBlogarticle()->getUser()) $canupdate=true;
|
||||||
|
if(!$canupdate&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Création du formulaire
|
// Création du formulaire
|
||||||
|
@ -196,7 +197,7 @@ class BlogcommentController extends Controller
|
||||||
// On s'assure que l'utilisateur à la permission de supprimer
|
// On s'assure que l'utilisateur à la permission de supprimer
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlogarticle()->getBlog(),$cansee,$canupdate,$canadd);
|
$em->getRepository("CadolesPortalBundle:Blog")->getPermission($this->getUser(),$entity->getBlogarticle()->getBlog(),$cansee,$canupdate,$canadd);
|
||||||
if(!$canadd&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate&&$this->getUser()!=$entity->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Suppression
|
// Suppression
|
||||||
|
|
|
@ -35,6 +35,19 @@ class BookmarkController extends Controller
|
||||||
if (!$pagewidget) throw $this->createNotFoundException('Unable to find entity.');
|
if (!$pagewidget) throw $this->createNotFoundException('Unable to find entity.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Vérifier que cet enregistrement est modifiable
|
||||||
|
if($access=="user") {
|
||||||
|
if($usage=="user") {
|
||||||
|
$user=$pagewidget->getPage()->getUser();
|
||||||
|
if($user!=$this->getUser()) throw $this->createNotFoundException('Permission denied');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||||
|
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||||
|
if(!$usergroup or $usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Création du formulaire
|
// Création du formulaire
|
||||||
$form = $this->createForm(BookmarkType::class,$data,array("mode"=>"submit"));
|
$form = $this->createForm(BookmarkType::class,$data,array("mode"=>"submit"));
|
||||||
|
|
||||||
|
@ -123,8 +136,8 @@ class BookmarkController extends Controller
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
if(!$usergroup or $usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,8 +227,8 @@ class BookmarkController extends Controller
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
if(!$usergroup or $usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,7 +220,7 @@ class CalendarController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de modifier
|
// On s'assure que l'utilisateur à la permission de modifier
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
$oldpassword=$entity->getPasswordDecrypt();
|
$oldpassword=$entity->getPasswordDecrypt();
|
||||||
|
@ -272,7 +272,7 @@ class CalendarController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de modifier
|
// On s'assure que l'utilisateur à la permission de modifier
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ class CalendarController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de supprimer
|
// On s'assure que l'utilisateur à la permission de supprimer
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,6 +369,7 @@ class CalendarController extends Controller
|
||||||
$calendar->setType(0);
|
$calendar->setType(0);
|
||||||
$calendar->setUser($user);
|
$calendar->setUser($user);
|
||||||
$calendar->setCanupdate(true);
|
$calendar->setCanupdate(true);
|
||||||
|
$calendar->setCanadd(true);
|
||||||
$key = Uuid::uuid4();
|
$key = Uuid::uuid4();
|
||||||
$calendar->setKeyvalue($key);
|
$calendar->setKeyvalue($key);
|
||||||
$em->persist($calendar);
|
$em->persist($calendar);
|
||||||
|
|
|
@ -40,9 +40,10 @@ class CalendareventController extends Controller
|
||||||
if($access=="config")
|
if($access=="config")
|
||||||
$calendar->setCanupdate(true);
|
$calendar->setCanupdate(true);
|
||||||
else {
|
else {
|
||||||
$this->getDoctrine()->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
$this->getDoctrine()->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
$calendar->setCanupdate($canupdate);
|
$calendar->setCanupdate($canupdate);
|
||||||
|
$calendar->setCanadd($canadd);
|
||||||
}
|
}
|
||||||
|
|
||||||
$calendars=[$calendar];
|
$calendars=[$calendar];
|
||||||
|
@ -67,7 +68,7 @@ class CalendareventController extends Controller
|
||||||
$tmp['color'] = "#".(is_null($calendar->getColor())?$this->get('session')->get('color')["main"]:$calendar->getColor());
|
$tmp['color'] = "#".(is_null($calendar->getColor())?$this->get('session')->get('color')["main"]:$calendar->getColor());
|
||||||
$tmp['allDay'] = $calendarevent->getAllday();
|
$tmp['allDay'] = $calendarevent->getAllday();
|
||||||
$tmp['calendar'] = $calendar->getId();
|
$tmp['calendar'] = $calendar->getId();
|
||||||
$tmp['editable'] = $calendarevent->getCalendar()->getCanupdate();
|
$tmp['editable'] = $calendarevent->getCalendar()->getCanadd();
|
||||||
$tmp['files'] = $this->loadpj($tmp['id'] );
|
$tmp['files'] = $this->loadpj($tmp['id'] );
|
||||||
|
|
||||||
array_push($events,$tmp);
|
array_push($events,$tmp);
|
||||||
|
@ -154,8 +155,8 @@ class CalendareventController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de supprimer
|
// On s'assure que l'utilisateur à la permission de supprimer
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
$calendarevent=new Calendarevent();
|
$calendarevent=new Calendarevent();
|
||||||
|
@ -208,8 +209,8 @@ class CalendareventController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission
|
// On s'assure que l'utilisateur à la permission
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
$calendarevent = $this->getDoctrine()->getRepository("CadolesPortalBundle:Calendarevent")->find($id);
|
$calendarevent = $this->getDoctrine()->getRepository("CadolesPortalBundle:Calendarevent")->find($id);
|
||||||
|
@ -266,8 +267,8 @@ class CalendareventController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission
|
// On s'assure que l'utilisateur à la permission
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
$calendarevent = $this->getDoctrine()->getRepository("CadolesPortalBundle:Calendarevent")->find($id);
|
$calendarevent = $this->getDoctrine()->getRepository("CadolesPortalBundle:Calendarevent")->find($id);
|
||||||
|
@ -291,8 +292,8 @@ class CalendareventController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de modifier
|
// On s'assure que l'utilisateur à la permission de modifier
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Création du formulaire
|
// Création du formulaire
|
||||||
|
@ -329,8 +330,8 @@ class CalendareventController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission
|
// On s'assure que l'utilisateur à la permission
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate);
|
$em->getRepository("CadolesPortalBundle:Calendar")->getPermission($this->getUser(),$calendar,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
$files = $this->loadpj($id);
|
$files = $this->loadpj($id);
|
||||||
|
|
|
@ -286,7 +286,7 @@ class PageController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de modifier
|
// On s'assure que l'utilisateur à la permission de modifier
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ class PageController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de modifier
|
// On s'assure que l'utilisateur à la permission de modifier
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,7 +408,7 @@ class PageController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de supprimer
|
// On s'assure que l'utilisateur à la permission de supprimer
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@ class PageController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission
|
// On s'assure que l'utilisateur à la permission
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ class PageController extends Controller
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
// On s'assure que l'utilisateur à la permission de voir
|
||||||
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate);
|
$em->getRepository($this->labelentity)->getPermission($this->getUser(),$entity,$cansee,$canupdate,$canadd);
|
||||||
if(!$cansee) {
|
if(!$cansee) {
|
||||||
return $this->render('CadolesCoreBundle:Core:reconnect.html.twig', [
|
return $this->render('CadolesCoreBundle:Core:reconnect.html.twig', [
|
||||||
'useheader' => false,
|
'useheader' => false,
|
||||||
|
|
|
@ -30,14 +30,15 @@ class PagewidgetController extends Controller
|
||||||
private $access;
|
private $access;
|
||||||
private $look;
|
private $look;
|
||||||
private $mini;
|
private $mini;
|
||||||
private $selwidget;
|
private $selwidget;
|
||||||
|
private $usage;
|
||||||
|
private $group;
|
||||||
|
|
||||||
private $cansee;
|
private $cansee;
|
||||||
private $canudate;
|
private $canupdate;
|
||||||
private $canadd;
|
private $canadd;
|
||||||
|
|
||||||
private function searchArray($array, $key, $value)
|
private function searchArray($array, $key, $value) {
|
||||||
{
|
|
||||||
$results = array();
|
$results = array();
|
||||||
|
|
||||||
if (is_array($array))
|
if (is_array($array))
|
||||||
|
@ -52,8 +53,7 @@ class PagewidgetController extends Controller
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function entityForm(Pagewidget $entity,$idpage,$id,$access="config",$by="view")
|
private function entityForm(Pagewidget $entity,$idpage,$id,$access="config",$by="view") {
|
||||||
{
|
|
||||||
if ($this->getDoctrine()->getManager()->contains($entity)) {
|
if ($this->getDoctrine()->getManager()->contains($entity)) {
|
||||||
$widgettype= $this->getDoctrine()->getManager()->getRepository("CadolesPortalBundle:Pagewidget")->find($id)->getWidget();
|
$widgettype= $this->getDoctrine()->getManager()->getRepository("CadolesPortalBundle:Pagewidget")->find($id)->getWidget();
|
||||||
$params = $widgettype->getParameter();
|
$params = $widgettype->getParameter();
|
||||||
|
@ -97,8 +97,7 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function submitAction(Request $request,$idpage,$idwidgettype,$access="config")
|
public function submitAction(Request $request,$idpage,$idwidgettype,$access="config") {
|
||||||
{
|
|
||||||
$by=$request->query->get('by');
|
$by=$request->query->get('by');
|
||||||
$entity = new Pagewidget();
|
$entity = new Pagewidget();
|
||||||
$form = $this->entityForm($entity,$idpage,$idwidgettype,$access,$by);
|
$form = $this->entityForm($entity,$idpage,$idwidgettype,$access,$by);
|
||||||
|
@ -190,8 +189,7 @@ class PagewidgetController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateAction(Request $request,$idpage,$idwidget,$access="config")
|
public function updateAction(Request $request,$idpage,$idwidget,$access="config") {
|
||||||
{
|
|
||||||
$by=$request->query->get('by');
|
$by=$request->query->get('by');
|
||||||
$usage=$request->query->get('usage');
|
$usage=$request->query->get('usage');
|
||||||
$group=$request->query->get('group');
|
$group=$request->query->get('group');
|
||||||
|
@ -203,7 +201,7 @@ class PagewidgetController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de modifier
|
// On s'assure que l'utilisateur à la permission de modifier
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$entity->getPage(),$cansee,$canupdate);
|
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$entity->getPage(),$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,8 +271,7 @@ class PagewidgetController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteAction(Request $request,$access="config")
|
public function deleteAction(Request $request,$access="config") {
|
||||||
{
|
|
||||||
// S'assurer que c'est un appel ajax
|
// S'assurer que c'est un appel ajax
|
||||||
if (!$request->isXmlHttpRequest()) return new JsonResponse(array('message' => 'Interdit'), 400);
|
if (!$request->isXmlHttpRequest()) return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||||
|
|
||||||
|
@ -289,7 +286,7 @@ class PagewidgetController extends Controller
|
||||||
|
|
||||||
// On s'assure que l'utilisateur à la permission de supprimer
|
// On s'assure que l'utilisateur à la permission de supprimer
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$entity->getPage(),$cansee,$canupdate);
|
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$entity->getPage(),$cansee,$canupdate,$canadd);
|
||||||
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
if(!$canupdate) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,8 +312,7 @@ class PagewidgetController extends Controller
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function orderAction(Request $request)
|
public function orderAction(Request $request) {
|
||||||
{
|
|
||||||
// S'assurer que c'est un appel ajax
|
// S'assurer que c'est un appel ajax
|
||||||
if (!$request->isXmlHttpRequest()) return new JsonResponse(array('message' => 'Interdit'), 400);
|
if (!$request->isXmlHttpRequest()) return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||||
|
|
||||||
|
@ -367,7 +363,6 @@ class PagewidgetController extends Controller
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getErrorForm($id,$form,$request,$idwidgettype,$page,$data,$mode) {
|
protected function getErrorForm($id,$form,$request,$idwidgettype,$page,$data,$mode) {
|
||||||
if ($form->get('submit')->isClicked()&&$mode=="delete") {
|
if ($form->get('submit')->isClicked()&&$mode=="delete") {
|
||||||
|
|
||||||
|
@ -405,7 +400,9 @@ class PagewidgetController extends Controller
|
||||||
$this->access = $access;
|
$this->access = $access;
|
||||||
$this->look = $request->query->get('look');
|
$this->look = $request->query->get('look');
|
||||||
$this->selwidget = $request->query->get('selwidget');
|
$this->selwidget = $request->query->get('selwidget');
|
||||||
|
$this->usage = $request->query->get('usage');
|
||||||
|
$this->group = $request->query->get('group');
|
||||||
|
|
||||||
// Le widget existe-t-il ?
|
// Le widget existe-t-il ?
|
||||||
$this->entity = $this->em->getRepository($this->labelentity)->find($this->id);
|
$this->entity = $this->em->getRepository($this->labelentity)->find($this->id);
|
||||||
if (!$this->entity) throw $this->createNotFoundException('Unable to find entity.');
|
if (!$this->entity) throw $this->createNotFoundException('Unable to find entity.');
|
||||||
|
@ -417,7 +414,7 @@ class PagewidgetController extends Controller
|
||||||
else {
|
else {
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
// On s'assure que l'utilisateur à la permission de voir
|
||||||
$this->page=$this->entity->getPage();
|
$this->page=$this->entity->getPage();
|
||||||
$this->em->getRepository("CadolesPortalBundle:Page")->getPermission($this->user,$this->page,$this->cansee,$this->canupdate);
|
$this->em->getRepository("CadolesPortalBundle:Page")->getPermission($this->user,$this->page,$this->cansee,$this->canupdate,$this->canadd);
|
||||||
if(!$this->cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$this->cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,7 +684,6 @@ class PagewidgetController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function viewfluxAction(Request $request,$id,$access="config") {
|
public function viewfluxAction(Request $request,$id,$access="config") {
|
||||||
// Récupération de la requete
|
// Récupération de la requete
|
||||||
$this->setRequest($request,$id,$access);
|
$this->setRequest($request,$id,$access);
|
||||||
|
@ -894,7 +890,6 @@ class PagewidgetController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function viewrssAction(Request $request,$id,$access="config") {
|
public function viewrssAction(Request $request,$id,$access="config") {
|
||||||
// Récupération de la requete
|
// Récupération de la requete
|
||||||
$this->setRequest($request,$id,$access);
|
$this->setRequest($request,$id,$access);
|
||||||
|
@ -1115,34 +1110,20 @@ class PagewidgetController extends Controller
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->getRender('viewbookmark.html.twig', [
|
return $this->getRender('viewbookmark.html.twig', [
|
||||||
|
'canadd' => $this->canadd,
|
||||||
'modedesktop' => $modedesktop,
|
'modedesktop' => $modedesktop,
|
||||||
'bookmarks' => $bookmarks,
|
'bookmarks' => $bookmarks,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewlinkAction(Request $request,$id,$access="config") {
|
public function viewlinkAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$url="";
|
$url="";
|
||||||
$target="_blank";
|
$target="_blank";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "url":
|
case "url":
|
||||||
$url=$parameter["value"];
|
$url=$parameter["value"];
|
||||||
|
@ -1153,44 +1134,21 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewlink.html.twig', [
|
return $this->getRender('viewlink.html.twig', [
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => false,
|
'canadd' => false,
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
'target' => $target,
|
'target' => $target,
|
||||||
'access' => $access,
|
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vieweditorAction(Request $request,$id,$access="config") {
|
public function vieweditorAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$html="";
|
$html="";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "html":
|
case "html":
|
||||||
$html=$parameter["value"];
|
$html=$parameter["value"];
|
||||||
|
@ -1199,91 +1157,45 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':vieweditor.html.twig', [
|
return $this->getRender('vieweditor.html.twig', [
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => false,
|
'canadd' => false,
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'html' => $html,
|
'html' => $html,
|
||||||
'access' => $access,
|
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewslideAction(Request $request,$id,$access="config") {
|
public function viewslideAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$interval="2";
|
$interval="2";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "interval":
|
case "interval":
|
||||||
$interval=$parameter["value"];
|
$interval=$parameter["value"];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// Récupération des slides
|
// Récupération des slides
|
||||||
$slides=$em->getRepository("CadolesPortalBundle:Slide")->findBy(["pagewidget"=>$entity],['roworder'=>'ASC','title'=>'ASC']);
|
$slides=$this->em->getRepository("CadolesPortalBundle:Slide")->findBy(["pagewidget"=>$this->entity],['roworder'=>'ASC','title'=>'ASC']);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewslide.html.twig', [
|
return $this->getRender('viewslide.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canadd,
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'slides' => $slides,
|
'slides' => $slides,
|
||||||
'interval' => $interval,
|
'interval' => $interval,
|
||||||
'access' => $access,
|
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewfileAction(Request $request,$id,$access="config") {
|
public function viewfileAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$view="small";
|
$view="small";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "modelist":
|
case "modelist":
|
||||||
$view=($parameter["value"]==0?"small":"list");
|
$view=($parameter["value"]==0?"small":"list");
|
||||||
|
@ -1291,45 +1203,17 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
// Render
|
||||||
$this->getPreference($entity);
|
return $this->getRender('viewfile.html.twig', [
|
||||||
|
'canadd' => $this->canadd,
|
||||||
return $this->render($this->labelentity.':viewfile.html.twig', [
|
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'access' => $access,
|
|
||||||
'directory' => "widget-".$id,
|
'directory' => "widget-".$id,
|
||||||
'view' => $view,
|
'view' => $view,
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewgaleryAction(Request $request,$id,$access="config") {
|
public function viewgaleryAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
$directory=$this->get('kernel')->getRootDir()."/../uploads/file/widget-".$id;
|
$directory=$this->get('kernel')->getRootDir()."/../uploads/file/widget-".$id;
|
||||||
$files=[];
|
$files=[];
|
||||||
|
@ -1359,96 +1243,47 @@ class PagewidgetController extends Controller
|
||||||
|
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewgalery.html.twig', [
|
return $this->getRender('viewgalery.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canadd,
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'files' => $files,
|
'files' => $files,
|
||||||
'access' => $access,
|
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewcalendarAction(Request $request,$id,$access="config") {
|
public function viewcalendarAction(Request $request,$id,$access="config") {
|
||||||
$usage=$request->query->get('usage');
|
// Récupération de la requete
|
||||||
$group=$request->query->get('group');
|
$this->setRequest($request,$id,$access);
|
||||||
$look=$request->query->get('look');
|
|
||||||
$selwidget=$request->query->get('selwidget');
|
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
if($group) $groupentity=$em->getRepository("CadolesCoreBundle:Group")->find($group);
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$nbday="0";
|
$nbday="0";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "nbday":
|
case "nbday":
|
||||||
$nbday=$parameter["value"];
|
$nbday=$parameter["value"];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// Récupérer les events de l'utilisateur
|
// Récupérer les events de l'utilisateur
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$events=$em->getRepository("CadolesPortalBundle:Calendarevent")->getUserCalendarevents($user,$this->get('session')->get('color')["main"],$usage,$group,$firstcalendar);
|
$events=$this->em->getRepository("CadolesPortalBundle:Calendarevent")->getUserCalendarevents($user,$this->get('session')->get('color')["main"],$this->usage,$this->group,$firstcalendar);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewcalendar.html.twig', [
|
return $this->getRender('viewcalendar.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canadd,
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'events' => $events,
|
'events' => $events,
|
||||||
'nbday' => $nbday,
|
'nbday' => $nbday,
|
||||||
'access' => $access,
|
|
||||||
'firstcalendar' => $firstcalendar,
|
'firstcalendar' => $firstcalendar,
|
||||||
'usage' => $usage,
|
'usage' => $this->usage,
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewblogAction(Request $request,$id,$access="config") {
|
public function viewblogAction(Request $request,$id,$access="config") {
|
||||||
$usage=$request->query->get('usage');
|
// Récupération de la requete
|
||||||
$group=$request->query->get('group');
|
$this->setRequest($request,$id,$access);
|
||||||
$look=$request->query->get('look');
|
|
||||||
$selwidget=$request->query->get('selwidget');
|
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$nbarticle=10;
|
$nbarticle=10;
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "nbarticle":
|
case "nbarticle":
|
||||||
$nbarticle=$parameter["value"];
|
$nbarticle=$parameter["value"];
|
||||||
|
@ -1456,64 +1291,38 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// On récupère soit les blogs du group en cours soit l'ensemble des blogs de l'utilisateur
|
// On récupère soit les blogs du group en cours soit l'ensemble des blogs de l'utilisateur
|
||||||
if($usage=="group") {
|
if($this->usage=="group") {
|
||||||
$blogs=$em->getRepository("CadolesPortalBundle:Blog")->getBlogsGroup($this->getUser(),$group);
|
$blogs=$this->em->getRepository("CadolesPortalBundle:Blog")->getBlogsGroup($this->getUser(),$this->group);
|
||||||
if($blogs) $firstblog=$blogs[0]->getId();
|
if($blogs) $firstblog=$blogs[0]->getId();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$em->getRepository("CadolesPortalBundle:Blog")->getBlogsUser($this->getUser(),$blogsuser,$blogsadmin,$blogsshared);
|
$this->em->getRepository("CadolesPortalBundle:Blog")->getBlogsUser($this->getUser(),$blogsuser,$blogsadmin,$blogsshared);
|
||||||
$blogs=array_merge($blogsuser,$blogsadmin->toArray(),$blogsshared);
|
$blogs=array_merge($blogsuser,$blogsadmin->toArray(),$blogsshared);
|
||||||
$firstblog="all";
|
$firstblog="all";
|
||||||
}
|
}
|
||||||
|
|
||||||
// On récupère les nbarticle de ses blogs
|
// On récupère les nbarticle de ses blogs
|
||||||
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,$nbarticle,$count,$blogarticles);
|
$this->em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,$nbarticle,$count,$blogarticles);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewblog.html.twig', [
|
return $this->getRender('viewblog.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canadd,
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'blogarticles' => $blogarticles,
|
'blogarticles' => $blogarticles,
|
||||||
'nbarticle' => $nbarticle,
|
'nbarticle' => $nbarticle,
|
||||||
'access' => $access,
|
|
||||||
'firstblog' => $firstblog,
|
'firstblog' => $firstblog,
|
||||||
'usage' => $usage,
|
'usage' => $this->usage,
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewprojectAction(Request $request,$id,$access="config") {
|
public function viewprojectAction(Request $request,$id,$access="config") {
|
||||||
$usage=$request->query->get('usage');
|
// Récupération de la requete
|
||||||
$group=$request->query->get('group');
|
$this->setRequest($request,$id,$access);
|
||||||
$look=$request->query->get('look');
|
|
||||||
$selwidget=$request->query->get('selwidget');
|
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parametres
|
// Parametres
|
||||||
$nbarticle=10;
|
$nbarticle=10;
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "nbarticle":
|
case "nbarticle":
|
||||||
$nbarticle=$parameter["value"];
|
$nbarticle=$parameter["value"];
|
||||||
|
@ -1521,76 +1330,56 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// On récupère soit les projects du group en cours soit l'ensemble des projects de l'utilisateur
|
// On récupère soit les projects du group en cours soit l'ensemble des projects de l'utilisateur
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
if($usage=="group") {
|
if($this->usage=="group") {
|
||||||
$projects=$em->getRepository("CadolesPortalBundle:Project")->getProjectsGroup($this->getUser(),$group);
|
$projects=$this->em->getRepository("CadolesPortalBundle:Project")->getProjectsGroup($this->getUser(),$this->group);
|
||||||
if($projects) $firstproject=$projects[0]->getId();
|
if($projects) $firstproject=$projects[0]->getId();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$em->getRepository("CadolesPortalBundle:Project")->getProjectsUser($user,$projectsuser,$projectsadmin,$projectsshared);
|
$this->em->getRepository("CadolesPortalBundle:Project")->getProjectsUser($user,$projectsuser,$projectsadmin,$projectsshared);
|
||||||
$projects=array_merge($projectsuser,$projectsadmin->toArray(),$projectsshared);
|
$projects=array_merge($projectsuser,$projectsadmin->toArray(),$projectsshared);
|
||||||
$firstproject="all";
|
$firstproject="all";
|
||||||
}
|
}
|
||||||
|
|
||||||
// On récupère les nbarticle de ses projects
|
// On récupère les nbarticle de ses projects
|
||||||
$em->getRepository("CadolesPortalBundle:Projecttask")->getProjectsTasks($projects,0,$nbarticle,$count,$projecttasks);
|
$this->em->getRepository("CadolesPortalBundle:Projecttask")->getProjectsTasks($projects,0,$nbarticle,$count,$projecttasks);
|
||||||
|
|
||||||
foreach($projecttasks as $key => $projecttask) {
|
foreach($projecttasks as $key => $projecttask) {
|
||||||
if($projecttask->getPercentage()==100) unset($projecttasks[$key]);
|
if($projecttask->getPercentage()==100) unset($projecttasks[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($usage!="group") {
|
if($this->usage!="group") {
|
||||||
foreach($projecttasks as $key => $projecttask) {
|
foreach($projecttasks as $key => $projecttask) {
|
||||||
if(!$user) unset($projecttasks[$key]);
|
if(!$user) unset($projecttasks[$key]);
|
||||||
else {
|
else {
|
||||||
if($projecttask->getUser() && $projecttask->getUser()!=$user) unset($projecttasks[$key]);
|
if($projecttask->getUser() && $projecttask->getUser()!=$user)
|
||||||
elseif($projecttask->getOwner() && $projecttask->getOwner()!=$user) unset($projecttasks[$key]);
|
unset($projecttasks[$key]);
|
||||||
|
elseif(!$projecttask->getUser() && $projecttask->getOwner() && $projecttask->getOwner()!=$user)
|
||||||
|
unset($projecttasks[$key]);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewproject.html.twig', [
|
return $this->getRender('viewproject.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canupdate,
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'projecttasks' => $projecttasks,
|
'projecttasks' => $projecttasks,
|
||||||
'nbarticle' => $nbarticle,
|
'nbarticle' => $nbarticle,
|
||||||
'access' => $access,
|
|
||||||
'firstproject' => $firstproject,
|
'firstproject' => $firstproject,
|
||||||
'usage' => $usage,
|
'usage' => $this->usage,
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewseparatorAction(Request $request,$id,$access="config") {
|
public function viewseparatorAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parametres
|
// Parametres
|
||||||
$seetitle=false;
|
$seetitle=false;
|
||||||
$seeicon=false;
|
$seeicon=false;
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "seetitle":
|
case "seetitle":
|
||||||
$seetitle=boolval($parameter["value"]);
|
$seetitle=boolval($parameter["value"]);
|
||||||
|
@ -1601,44 +1390,21 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewseparator.html.twig', [
|
return $this->getRender('viewseparator.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canupdate,
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'seetitle' => $seetitle,
|
'seetitle' => $seetitle,
|
||||||
'seeicon' => $seeicon,
|
'seeicon' => $seeicon,
|
||||||
'access' => $access,
|
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewclockAction(Request $request,$id,$access="config") {
|
public function viewclockAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parametres
|
// Parametres
|
||||||
$clock="0";
|
$clock="0";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "clock":
|
case "clock":
|
||||||
$clock=$parameter["value"];
|
$clock=$parameter["value"];
|
||||||
|
@ -1646,79 +1412,33 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewframe.html.twig', [
|
return $this->getRender('viewframe.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canupdate,
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'onheader' => true,
|
'onheader' => true,
|
||||||
'tool' => ($clock==0?"cadoles_portal_user_tool_clockanalogique":"cadoles_portal_user_tool_clocknumerique"),
|
'tool' => ($clock==0?"cadoles_portal_user_tool_clockanalogique":"cadoles_portal_user_tool_clocknumerique"),
|
||||||
'access' => $access,
|
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewcalculatorAction(Request $request,$id,$access="config") {
|
public function viewcalculatorAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewframe.html.twig', [
|
return $this->getRender('viewframe.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canupdate,
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'onheader' => true,
|
'onheader' => true,
|
||||||
'tool' => "cadoles_portal_user_tool_calculator",
|
'tool' => "cadoles_portal_user_tool_calculator",
|
||||||
'access' => $access,
|
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewappexternalAction(Request $request,$id,$access="config") {
|
public function viewappexternalAction(Request $request,$id,$access="config") {
|
||||||
$look=$request->query->get('look');
|
// Récupération de la requete
|
||||||
$selwidget=$request->query->get('selwidget');
|
$this->setRequest($request,$id,$access);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$idappexternal=null;
|
$idappexternal=null;
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "appexternal":
|
case "appexternal":
|
||||||
$idappexternal=$parameter["value"];
|
$idappexternal=$parameter["value"];
|
||||||
|
@ -1729,15 +1449,12 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$items=[];
|
$items=[];
|
||||||
$itemcategorys=[];
|
$itemcategorys=[];
|
||||||
if($user) {
|
if($user) {
|
||||||
if($idappexternal) $appextenals=$em->getRepository("CadolesPortalBundle:Appexternal")->findBy(["id"=>$idappexternal]);
|
if($idappexternal) $appextenals=$this->em->getRepository("CadolesPortalBundle:Appexternal")->findBy(["id"=>$idappexternal]);
|
||||||
else $appextenals=$em->getRepository("CadolesPortalBundle:Appexternal")->findAll();
|
else $appextenals=$this->em->getRepository("CadolesPortalBundle:Appexternal")->findAll();
|
||||||
foreach($appextenals as $appexternal) {
|
foreach($appextenals as $appexternal) {
|
||||||
switch($appexternal->getName()) {
|
switch($appexternal->getName()) {
|
||||||
case "Limesurvey":
|
case "Limesurvey":
|
||||||
|
@ -1790,161 +1507,86 @@ class PagewidgetController extends Controller
|
||||||
array_multisort($title, SORT_ASC, $items);
|
array_multisort($title, SORT_ASC, $items);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewappexternal.html.twig', [
|
return $this->getRender('viewappexternal.html.twig', [
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => ($user),
|
'canadd' => ($user),
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'modedesktop' => $modedesktop,
|
'modedesktop' => $modedesktop,
|
||||||
'items' => $items,
|
'items' => $items,
|
||||||
'itemcategorys' => $itemcategorys,
|
'itemcategorys' => $itemcategorys,
|
||||||
'access' => $access,
|
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewinfoAction(Request $request,$id,$access="config") {
|
public function viewinfoAction(Request $request,$id,$access="config") {
|
||||||
$usage=$request->query->get('usage');
|
// Récupération de la requete
|
||||||
$group=$request->query->get('group');
|
$this->setRequest($request,$id,$access);
|
||||||
$look=$request->query->get('look');
|
|
||||||
$selwidget=$request->query->get('selwidget');
|
|
||||||
$user=$this->getUser();
|
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
$page=$entity->getPage();
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
$icon=null;
|
$icon=null;
|
||||||
$title=null;
|
$title=null;
|
||||||
$description=null;
|
$description=null;
|
||||||
$members=[];
|
$members=[];
|
||||||
if($usage=="group") {
|
if($this->usage=="group") {
|
||||||
$group=$em->getRepository("CadolesCoreBundle:Group")->find($group);
|
$groupentity=$this->em->getRepository("CadolesCoreBundle:Group")->find($this->group);
|
||||||
if($group) {
|
if($groupentity) {
|
||||||
$title=$group->getLabel();
|
$title=$groupentity->getLabel();
|
||||||
$id=$group->getId();
|
$id=$groupentity->getId();
|
||||||
if($group->getDescription())
|
if($groupentity->getDescription())
|
||||||
$description="<strong>Description</strong><br>".$group->getDescription();
|
$description="<strong>Description</strong><br>".$groupentity->getDescription();
|
||||||
if($group->getIcon())
|
if($groupentity->getIcon())
|
||||||
$icon="/".$group->getIcon()->getLabel();
|
$icon="/".$groupentity->getIcon()->getLabel();
|
||||||
|
|
||||||
|
|
||||||
foreach($group->getUsers() as $usergroup) {
|
foreach($groupentity->getUsers() as $usergroup) {
|
||||||
|
|
||||||
array_push($members,$usergroup);
|
array_push($members,$usergroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$title=$entity->getPage()->getName();
|
$title=$this->entity->getPage()->getName();
|
||||||
$proprio=$entity->getPage()->getUser();
|
$proprio=$this->entity->getPage()->getUser();
|
||||||
$id=0;
|
$id=0;
|
||||||
if($proprio) {
|
if($proprio) {
|
||||||
$description="Propriétaire de la page<br>".$proprio->getLastname()." ".$proprio->getLastname();
|
$description="Propriétaire de la page<br>".$proprio->getLastname()." ".$proprio->getLastname();
|
||||||
$icon="/uploads/avatar/".$proprio->getAvatar();
|
$icon="/uploads/avatar/".$proprio->getAvatar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewinfo.html.twig', [
|
return $this->getRender('viewinfo.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canupdate,
|
||||||
'canadd' => $canupdate,
|
'usage' => $this->usage,
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'usage' => $usage,
|
|
||||||
'icon' => $icon,
|
'icon' => $icon,
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
'members' => $members,
|
'members' => $members,
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'idpage' => $page->getId(),
|
'idpage' => $this->entity->getPage()->getId(),
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewchatAction(Request $request,$id,$access="config") {
|
public function viewchatAction(Request $request,$id,$access="config") {
|
||||||
$usage=$request->query->get('usage');
|
// Récupération de la requete
|
||||||
$group=$request->query->get('group');
|
$this->setRequest($request,$id,$access);
|
||||||
$look=$request->query->get('look');
|
|
||||||
$selwidget=$request->query->get('selwidget');
|
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$group=$this->group;
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
if($this->usage!="group"||!$group) {
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
$group=$this->em->getRepository("CadolesCoreBundle:Group")->findOneBy(["fgall"=>true])->getId();
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
if($usage!="group"||!$group) {
|
|
||||||
$group=$em->getRepository("CadolesCoreBundle:Group")->findOneBy(["fgall"=>true])->getId();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewchat.html.twig', [
|
return $this->getRender('viewchat.html.twig', [
|
||||||
'entity' => $entity,
|
'canadd' => $this->canupdate,
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'onheader' => false,
|
'onheader' => false,
|
||||||
'tool' => "cadoles_websocket_chat",
|
'tool' => "cadoles_websocket_chat",
|
||||||
'access' => $access,
|
'usage' => $this->usage,
|
||||||
'usage' => $usage,
|
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function viewgroupAction(Request $request,$id,$access="config") {
|
public function viewgroupAction(Request $request,$id,$access="config") {
|
||||||
$usage=$request->query->get('usage');
|
// Récupération de la requete
|
||||||
$group=$request->query->get('group');
|
$this->setRequest($request,$id,$access);
|
||||||
$look=$request->query->get('look');
|
|
||||||
$selwidget=$request->query->get('selwidget');
|
|
||||||
|
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
$mygroups=[];
|
$mygroups=[];
|
||||||
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared);
|
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared);
|
||||||
if(is_array($groupsshared)) {
|
if(is_array($groupsshared)) {
|
||||||
|
@ -1962,47 +1604,21 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewgroup.html.twig', [
|
return $this->getRender('viewgroup.html.twig', [
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => ($user),
|
'canadd' => ($user),
|
||||||
'canupdate' => $canupdate,
|
'usage' => $this->usage,
|
||||||
'usage' => $usage,
|
|
||||||
'groups' => $mygroups,
|
'groups' => $mygroups,
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewgroupmessageAction(Request $request,$id,$access="config") {
|
public function viewgroupmessageAction(Request $request,$id,$access="config") {
|
||||||
$usage=$request->query->get('usage');
|
// Récupération de la requete
|
||||||
$group=$request->query->get('group');
|
$this->setRequest($request,$id,$access);
|
||||||
$look=$request->query->get('look');
|
|
||||||
$selwidget=$request->query->get('selwidget');
|
|
||||||
|
|
||||||
$user=$this->getUser();
|
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Préference utilisateur
|
|
||||||
$this->getPreference($entity);
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$modelist=1;
|
$modelist=1;
|
||||||
$nbarticle=5;
|
$nbarticle=5;
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "modelist":
|
case "modelist":
|
||||||
$modelist=$parameter["value"];
|
$modelist=$parameter["value"];
|
||||||
|
@ -2013,8 +1629,8 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mygroups=[];
|
|
||||||
$mymsg= [];
|
$mymsg= [];
|
||||||
|
$user=$this->getUser();
|
||||||
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared);
|
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,null,$default,$pagesuser,$pagesadmin,$groupsshared);
|
||||||
if(is_array($groupsshared)) {
|
if(is_array($groupsshared)) {
|
||||||
foreach($groupsshared as $groupshared) {
|
foreach($groupsshared as $groupshared) {
|
||||||
|
@ -2050,48 +1666,23 @@ class PagewidgetController extends Controller
|
||||||
|
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewgroupmessage.html.twig', [
|
return $this->getRender('viewgroupmessage.html.twig', [
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => ($user),
|
'canadd' => ($user),
|
||||||
'canupdate' => $canupdate,
|
'usage' => $this->usage,
|
||||||
'usage' => $usage,
|
|
||||||
'modelist' => $modelist,
|
'modelist' => $modelist,
|
||||||
'messages' => $mymsg,
|
'messages' => $mymsg,
|
||||||
'nbarticle' => $nbarticle,
|
'nbarticle' => $nbarticle,
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewOnlydocAction(Request $request,$id,$access="config") {
|
public function viewOnlydocAction(Request $request,$id,$access="config") {
|
||||||
$usage=$request->query->get('usage');
|
// Récupération de la requete
|
||||||
$group=$request->query->get('group');
|
$this->setRequest($request,$id,$access);
|
||||||
$look=$request->query->get('look');
|
|
||||||
$selwidget=$request->query->get('selwidget');
|
|
||||||
|
|
||||||
$user=$this->getUser();
|
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
|
||||||
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
if($access=="config") {
|
|
||||||
$canupdate = true;
|
|
||||||
$cansee = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On s'assure que l'utilisateur à la permission de voir
|
|
||||||
$page=$entity->getPage();
|
|
||||||
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$apponly=0;
|
$apponly=0;
|
||||||
$view="small";
|
$view="small";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($this->entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
case "apponly":
|
case "apponly":
|
||||||
$apponly=$parameter["value"];
|
$apponly=$parameter["value"];
|
||||||
|
@ -2101,19 +1692,11 @@ class PagewidgetController extends Controller
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Préference utilisateur
|
return $this->getRender('viewonlydoc.html.twig', [
|
||||||
$this->getPreference($entity);
|
'canadd' => $this->canupdate,
|
||||||
|
|
||||||
return $this->render($this->labelentity.':viewonlydoc.html.twig', [
|
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'access' => $access,
|
|
||||||
'directory' => $id,
|
'directory' => $id,
|
||||||
'view' => $view,
|
'view' => $view,
|
||||||
'look' => $look,
|
|
||||||
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,7 +410,6 @@ class ProjectController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
|
|
||||||
$canupdate=$this->get('session')->get('cancreateproject');
|
$canupdate=$this->get('session')->get('cancreateproject');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,6 +116,7 @@ class ProjecttaskController extends Controller
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
||||||
if($user && ((is_null($entity->getUser()) && $user==$entity->getOwner()) || $user==$entity->getUser())) $canadd=true;
|
if($user && ((is_null($entity->getUser()) && $user==$entity->getOwner()) || $user==$entity->getUser())) $canadd=true;
|
||||||
|
else $canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$entity->getProject());
|
||||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,6 +181,7 @@ class ProjecttaskController extends Controller
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
||||||
if($user && ((is_null($entity->getUser()) && $user==$entity->getOwner()) || $user==$entity->getUser())) $canadd=true;
|
if($user && ((is_null($entity->getUser()) && $user==$entity->getOwner()) || $user==$entity->getUser())) $canadd=true;
|
||||||
|
else $canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$entity->getProject());
|
||||||
|
|
||||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
@ -233,6 +235,7 @@ class ProjecttaskController extends Controller
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
||||||
|
$canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$entity->getProject());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
|
@ -266,17 +269,6 @@ class ProjecttaskController extends Controller
|
||||||
$tmp["thumb"]="";
|
$tmp["thumb"]="";
|
||||||
if($tmp["extension"]=="pdf") {
|
if($tmp["extension"]=="pdf") {
|
||||||
$tmp["thumb"]="/".$this->getParameter('alias')."/bundles/cadolescore/images/files/".$tmp["extension"].".png";
|
$tmp["thumb"]="/".$this->getParameter('alias')."/bundles/cadolescore/images/files/".$tmp["extension"].".png";
|
||||||
|
|
||||||
/* ne plus afficher l'apercu du pdf
|
|
||||||
if($fs->exists($directory."/thumbmini/".$tmp["name"])) {
|
|
||||||
$data = file_get_contents($directory."/thumbmini/".$tmp["name"]);
|
|
||||||
$tmp["thumb"]="data:image/jpg;base64," . base64_encode($data);
|
|
||||||
}
|
|
||||||
elseif($fs->exists($directory."/thumb/".$tmp["name"])) {
|
|
||||||
$data = file_get_contents($directory."/thumb/".$tmp["name"]);
|
|
||||||
$tmp["thumb"]="data:image/jpg;base64," . base64_encode($data);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
elseif($fs->exists($directory."/thumbmini/".$tmp["name"])) {
|
elseif($fs->exists($directory."/thumbmini/".$tmp["name"])) {
|
||||||
$data = file_get_contents($directory."/thumbmini/".$tmp["name"]);
|
$data = file_get_contents($directory."/thumbmini/".$tmp["name"]);
|
||||||
|
@ -353,7 +345,7 @@ class ProjecttaskController extends Controller
|
||||||
$project=$em->getRepository("CadolesPortalBundle:Project")->find($projectid);
|
$project=$em->getRepository("CadolesPortalBundle:Project")->find($projectid);
|
||||||
if($project) {
|
if($project) {
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$project,$cansee,$canupdate,$canadd);
|
$canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$project);
|
||||||
|
|
||||||
// Si permission alors il peut affecter tt les personnes du groupe
|
// Si permission alors il peut affecter tt les personnes du groupe
|
||||||
if($canadd||$access=="config") {
|
if($canadd||$access=="config") {
|
||||||
|
@ -405,9 +397,8 @@ class ProjecttaskController extends Controller
|
||||||
// On s'assure que l'utilisateur à la permission de modifier
|
// On s'assure que l'utilisateur à la permission de modifier
|
||||||
if($access=="user") {
|
if($access=="user") {
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$em->getRepository("CadolesPortalBundle:Project")->getPermission($user,$entity->getProject(),$cansee,$canupdate,$canadd);
|
|
||||||
if($user && ((is_null($entity->getUser()) && $user==$entity->getOwner()) || $user==$entity->getUser())) $canadd=true;
|
if($user && ((is_null($entity->getUser()) && $user==$entity->getOwner()) || $user==$entity->getUser())) $canadd=true;
|
||||||
|
else $canadd = $em->getRepository("CadolesPortalBundle:Project")->getInvalideur($user,$entity->getProject());
|
||||||
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
if(!$canadd) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ class SlideController extends Controller
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
if(!$usergroup||$usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,8 +81,8 @@ class SlideController extends Controller
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
if(!$usergroup||$usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,8 +142,8 @@ class SlideController extends Controller
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
if(!$usergroup||$usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,8 +206,8 @@ class SlideController extends Controller
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
$groupentity=$this->getDoctrine()->getRepository("CadolesCoreBundle:Group")->find($group);
|
||||||
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity,"fgmanager"=>true]);
|
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findoneby(["user"=>$this->getUser(),"group"=>$groupentity]);
|
||||||
if(!$fgmanager) throw $this->createNotFoundException('Permission denied');
|
if(!$usergroup||$usergroup->getRolegroup()<50) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,6 +132,17 @@ class Calendar
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private $canadd;
|
||||||
|
public function getCanadd()
|
||||||
|
{
|
||||||
|
return $this->canadd;
|
||||||
|
}
|
||||||
|
public function setCanadd($canadd)
|
||||||
|
{
|
||||||
|
$this->canadd = $canadd;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/* Password User */
|
/* Password User */
|
||||||
public function setPassword($password)
|
public function setPassword($password)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,8 +35,9 @@ class BlogShareType extends AbstractType
|
||||||
->where('g.fgcanshare=:fgcanshare')
|
->where('g.fgcanshare=:fgcanshare')
|
||||||
->andWhere('g=ug.group')
|
->andWhere('g=ug.group')
|
||||||
->andWhere('ug.user=:user')
|
->andWhere('ug.user=:user')
|
||||||
->andWhere('ug.fgmanager=:fgcanshare')
|
->andWhere('ug.rolegroup>=:role')
|
||||||
->setParameter('fgcanshare',true)
|
->setParameter('fgcanshare',true)
|
||||||
|
->setParameter('role',90)
|
||||||
->setParameter('user',$user);
|
->setParameter('user',$user);
|
||||||
},
|
},
|
||||||
'choice_label' => 'label',
|
'choice_label' => 'label',
|
||||||
|
|
|
@ -75,13 +75,13 @@ class BlogarticleType extends AbstractType
|
||||||
->orwhere(':user MEMBER OF blog.writers')
|
->orwhere(':user MEMBER OF blog.writers')
|
||||||
|
|
||||||
->from('CadolesCoreBundle:UserGroup','usergroup')
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
->orwhere('usergroup.group MEMBER OF blog.groups AND usergroup.user=:user AND usergroup.fgmanager=:flag')
|
->orwhere('usergroup.group MEMBER OF blog.groups AND usergroup.user=:user AND usergroup.rolegroup>=:role')
|
||||||
|
|
||||||
->from('CadolesCoreBundle:User','user')
|
->from('CadolesCoreBundle:User','user')
|
||||||
->andwhere("user=:user")
|
->andwhere("user=:user")
|
||||||
|
|
||||||
->setparameter('user',$user)
|
->setparameter('user',$user)
|
||||||
->setparameter('flag',true);
|
->setparameter('role',50);
|
||||||
|
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -35,8 +35,9 @@ class CalendarShareType extends AbstractType
|
||||||
->where('g.fgcanshare=:fgcanshare')
|
->where('g.fgcanshare=:fgcanshare')
|
||||||
->andWhere('g=ug.group')
|
->andWhere('g=ug.group')
|
||||||
->andWhere('ug.user=:user')
|
->andWhere('ug.user=:user')
|
||||||
->andWhere('ug.fgmanager=:fgcanshare')
|
->andWhere('ug.rolegroup>=:role')
|
||||||
->setParameter('fgcanshare',true)
|
->setParameter('fgcanshare',true)
|
||||||
|
->setParameter('role',90)
|
||||||
->setParameter('user',$user);
|
->setParameter('user',$user);
|
||||||
},
|
},
|
||||||
'choice_label' => 'label',
|
'choice_label' => 'label',
|
||||||
|
|
|
@ -35,8 +35,9 @@ class PageShareType extends AbstractType
|
||||||
->where('g.fgcanshare=:fgcanshare')
|
->where('g.fgcanshare=:fgcanshare')
|
||||||
->andWhere('g=ug.group')
|
->andWhere('g=ug.group')
|
||||||
->andWhere('ug.user=:user')
|
->andWhere('ug.user=:user')
|
||||||
->andWhere('ug.fgmanager=:fgcanshare')
|
->andWhere('ug.rolegroup>=:role')
|
||||||
->setParameter('fgcanshare',true)
|
->setParameter('fgcanshare',true)
|
||||||
|
->setParameter('role',90)
|
||||||
->setParameter('user',$user);
|
->setParameter('user',$user);
|
||||||
},
|
},
|
||||||
'choice_label' => 'label',
|
'choice_label' => 'label',
|
||||||
|
|
|
@ -100,8 +100,9 @@ class PageSubmitType extends AbstractType
|
||||||
->where('g.fgcanshare=:fgcanshare')
|
->where('g.fgcanshare=:fgcanshare')
|
||||||
->andWhere('g=ug.group')
|
->andWhere('g=ug.group')
|
||||||
->andWhere('ug.user=:user')
|
->andWhere('ug.user=:user')
|
||||||
->andWhere('ug.fgmanager=:fgcanshare')
|
->andWhere('ug.rolegroup>=:role')
|
||||||
->setParameter('fgcanshare',true)
|
->setParameter('fgcanshare',true)
|
||||||
|
->setParameter('role',90)
|
||||||
->setParameter('user',$user);
|
->setParameter('user',$user);
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
|
@ -35,8 +35,9 @@ class ProjectShareType extends AbstractType
|
||||||
->where('g.fgcanshare=:fgcanshare')
|
->where('g.fgcanshare=:fgcanshare')
|
||||||
->andWhere('g=ug.group')
|
->andWhere('g=ug.group')
|
||||||
->andWhere('ug.user=:user')
|
->andWhere('ug.user=:user')
|
||||||
->andWhere('ug.fgmanager=:fgcanshare')
|
->andWhere('ug.rolegroup>=:role')
|
||||||
->setParameter('fgcanshare',true)
|
->setParameter('fgcanshare',true)
|
||||||
|
->setParameter('role',90)
|
||||||
->setParameter('user',$user);
|
->setParameter('user',$user);
|
||||||
},
|
},
|
||||||
'choice_label' => 'label',
|
'choice_label' => 'label',
|
||||||
|
|
|
@ -129,7 +129,7 @@ class BlogRepository extends EntityRepository
|
||||||
|
|
||||||
// Permission sur les blogs
|
// Permission sur les blogs
|
||||||
foreach($blogsadmin as $blogadmin) {
|
foreach($blogsadmin as $blogadmin) {
|
||||||
$blogadmin->setCanupdate(false);
|
$blogadmin->setCanupdate($this->getInmanager($user,$blogadmin));
|
||||||
$blogadmin->setCanadd($this->getInwriter($user,$blogadmin));
|
$blogadmin->setCanadd($this->getInwriter($user,$blogadmin));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,28 +150,6 @@ class BlogRepository extends EntityRepository
|
||||||
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
|
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
|
||||||
$groups=($user?$user->getGroups():[]);
|
$groups=($user?$user->getGroups():[]);
|
||||||
|
|
||||||
// La blog est-elle dans les blogs associées à un partage de group ?
|
|
||||||
/*
|
|
||||||
$inblogsshared=$this->createQueryBuilder('blog')
|
|
||||||
->from('CadolesCoreBundle:Group','g')
|
|
||||||
->from('CadolesCoreBundle:UserGroup','ug')
|
|
||||||
->from('CadolesCoreBundle:UserGroup','proprio')
|
|
||||||
->where('g.fgcanshare=:fgcanshare')
|
|
||||||
->andWhere('blog.id = :id')
|
|
||||||
->andWhere('g=ug.group')
|
|
||||||
->andWhere('ug.user=:user')
|
|
||||||
->andWhere('g MEMBER OF blog.groups')
|
|
||||||
->andWhere('blog.user != :user')
|
|
||||||
->andWhere('blog.user is not null')
|
|
||||||
->andWhere('proprio.user=blog.user')
|
|
||||||
->andWhere('proprio.group=g')
|
|
||||||
->setParameter("id",$blog->getId())
|
|
||||||
->setParameter('fgcanshare',true)
|
|
||||||
->setParameter('user',$user)
|
|
||||||
->getQuery()->getResult();
|
|
||||||
if($inblogsshared) $cansee=true;
|
|
||||||
*/
|
|
||||||
|
|
||||||
// La blog est-elle dans les blogs associées au role de l'utilisateur ?
|
// La blog est-elle dans les blogs associées au role de l'utilisateur ?
|
||||||
foreach($roles as $role) {
|
foreach($roles as $role) {
|
||||||
$qb = $this->createQueryBuilder("blog");
|
$qb = $this->createQueryBuilder("blog");
|
||||||
|
@ -196,9 +174,12 @@ class BlogRepository extends EntityRepository
|
||||||
if($inbloggroup) {
|
if($inbloggroup) {
|
||||||
$cansee=true;
|
$cansee=true;
|
||||||
|
|
||||||
// Est-il manager du groupe
|
|
||||||
if($group->getGroup()->getFgcanshare()) {
|
if($group->getGroup()->getFgcanshare()) {
|
||||||
if($group->getFgmanager()) $canadd=true;
|
// Est-il collaborateur du groupe
|
||||||
|
if($group->getRolegroup()>=50) $canadd=true;
|
||||||
|
|
||||||
|
// Est-il gestionnaire du groupe
|
||||||
|
if($group->getRolegroup()>=90) $canupdate=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,7 +191,7 @@ class BlogRepository extends EntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInwriter($user,$blog) {
|
public function getInwriter($user,$blog) {
|
||||||
$canadd=false;
|
$can=false;
|
||||||
|
|
||||||
if($user) {
|
if($user) {
|
||||||
// Peut ecrire ceux qui sont déclaré comme écrivain
|
// Peut ecrire ceux qui sont déclaré comme écrivain
|
||||||
|
@ -229,9 +210,9 @@ class BlogRepository extends EntityRepository
|
||||||
->setparameter('user',$user);
|
->setparameter('user',$user);
|
||||||
|
|
||||||
$inblogwriters=$qb->getQuery()->getResult();
|
$inblogwriters=$qb->getQuery()->getResult();
|
||||||
if($inblogwriters) $canadd=true;
|
if($inblogwriters) $can=true;
|
||||||
|
|
||||||
// Peut ecrire ceux qui sont manager du groupe auquel est rattaché le blog
|
// Peut ecrire ceux qui sont collaborateur du groupe auquel est rattaché le blog
|
||||||
$qb = $this->createQueryBuilder("blog");
|
$qb = $this->createQueryBuilder("blog");
|
||||||
$qb ->andWhere("blog.id=:id")
|
$qb ->andWhere("blog.id=:id")
|
||||||
->from('CadolesCoreBundle:User','user')
|
->from('CadolesCoreBundle:User','user')
|
||||||
|
@ -240,7 +221,7 @@ class BlogRepository extends EntityRepository
|
||||||
->from('CadolesCoreBundle:UserGroup','usergroup')
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
->andwhere('usergroup.group MEMBER OF blog.groups')
|
->andwhere('usergroup.group MEMBER OF blog.groups')
|
||||||
->andwhere('usergroup.user=:user')
|
->andwhere('usergroup.user=:user')
|
||||||
->andwhere('usergroup.fgmanager=:flag')
|
->andwhere('usergroup.rolegroup>=:role')
|
||||||
|
|
||||||
->from('CadolesCoreBundle:Group','groupe')
|
->from('CadolesCoreBundle:Group','groupe')
|
||||||
->andwhere('groupe=usergroup.group')
|
->andwhere('groupe=usergroup.group')
|
||||||
|
@ -248,13 +229,47 @@ class BlogRepository extends EntityRepository
|
||||||
|
|
||||||
->setParameter("id",$blog->getId())
|
->setParameter("id",$blog->getId())
|
||||||
->setparameter('user',$user)
|
->setparameter('user',$user)
|
||||||
->setparameter('flag',true);
|
->setparameter('flag',true)
|
||||||
|
->setparameter('role',50);
|
||||||
|
|
||||||
|
$inblogwriters=$qb->getQuery()->getResult();
|
||||||
|
if($inblogwriters) $can=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $can;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getInmanager($user,$blog) {
|
||||||
|
$can=false;
|
||||||
|
|
||||||
|
if($user) {
|
||||||
|
// Peut ecrire ceux qui sont manager du groupe auquel est rattaché le calendar
|
||||||
|
$qb = $this->createQueryBuilder("blog");
|
||||||
|
$qb ->andWhere("blog.id=:id")
|
||||||
|
->from('CadolesCoreBundle:User','user')
|
||||||
|
->andwhere("user=:user")
|
||||||
|
|
||||||
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
|
->andwhere('usergroup.group MEMBER OF blog.groups')
|
||||||
|
->andwhere('usergroup.user=:user')
|
||||||
|
->andwhere('usergroup.rolegroup>=:role')
|
||||||
|
|
||||||
|
->from('CadolesCoreBundle:Group','groupe')
|
||||||
|
->andwhere('groupe=usergroup.group')
|
||||||
|
->andwhere('groupe.fgcanshare=:flag')
|
||||||
|
|
||||||
|
->setParameter("id",$blog->getId())
|
||||||
|
->setparameter('user',$user)
|
||||||
|
->setparameter('flag',true)
|
||||||
|
->setparameter('role',90);
|
||||||
|
|
||||||
|
|
||||||
$inblogwriters=$qb->getQuery()->getResult();
|
$inblogwriters=$qb->getQuery()->getResult();
|
||||||
if($inblogwriters) $canadd=true;
|
|
||||||
|
if($inblogwriters) $can=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $canadd;
|
return $can;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ class CalendarRepository extends EntityRepository
|
||||||
if($calendarsuser) {
|
if($calendarsuser) {
|
||||||
foreach($calendarsuser as $calendaruser) {
|
foreach($calendarsuser as $calendaruser) {
|
||||||
$calendaruser->setCanupdate(true);
|
$calendaruser->setCanupdate(true);
|
||||||
|
$calendaruser->setCanadd(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,18 +110,21 @@ class CalendarRepository extends EntityRepository
|
||||||
|
|
||||||
// Permission sur les calendars
|
// Permission sur les calendars
|
||||||
foreach($calendarsadmin as $calendaradmin) {
|
foreach($calendarsadmin as $calendaradmin) {
|
||||||
$calendaradmin->setCanupdate($this->getInwriter($user,$calendaradmin));
|
$calendaradmin->setCanupdate($this->getInmanager($user,$calendaradmin));
|
||||||
|
$calendaradmin->setCanadd($this->getInwriter($user,$calendaradmin));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPermission($user,$calendar,&$cansee,&$canupdate) {
|
public function getPermission($user,$calendar,&$cansee,&$canupdate,&$canadd) {
|
||||||
// si calendar de l'utilisateur
|
// si calendar de l'utilisateur
|
||||||
if($calendar->getUser()==$user&&!is_null($user)) {
|
if($calendar->getUser()==$user&&!is_null($user)) {
|
||||||
$cansee=true;
|
$cansee=true;
|
||||||
$canupdate=true;
|
$canupdate=true;
|
||||||
|
$canadd=true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$canupdate=false;
|
$canupdate=false;
|
||||||
|
$canadd=false;
|
||||||
$cansee=false;
|
$cansee=false;
|
||||||
|
|
||||||
// Profilage
|
// Profilage
|
||||||
|
@ -153,7 +157,8 @@ class CalendarRepository extends EntityRepository
|
||||||
|
|
||||||
// Est-il manager du groupe
|
// Est-il manager du groupe
|
||||||
if($group->getGroup()->getFgcanshare()) {
|
if($group->getGroup()->getFgcanshare()) {
|
||||||
if($group->getFgmanager()) $canupdate=true;
|
if($group->getRolegroup()>=90) $canupdate=true;
|
||||||
|
if($group->getRolegroup()>=50) $canadd=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,7 +166,7 @@ class CalendarRepository extends EntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInwriter($user,$calendar) {
|
public function getInwriter($user,$calendar) {
|
||||||
$canadd=false;
|
$can=false;
|
||||||
|
|
||||||
if($user) {
|
if($user) {
|
||||||
// Peut ecrire ceux qui sont manager du groupe auquel est rattaché le calendar
|
// Peut ecrire ceux qui sont manager du groupe auquel est rattaché le calendar
|
||||||
|
@ -173,22 +178,56 @@ class CalendarRepository extends EntityRepository
|
||||||
->from('CadolesCoreBundle:UserGroup','usergroup')
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
->andwhere('usergroup.group MEMBER OF calendar.groups')
|
->andwhere('usergroup.group MEMBER OF calendar.groups')
|
||||||
->andwhere('usergroup.user=user')
|
->andwhere('usergroup.user=user')
|
||||||
->andwhere('usergroup.fgmanager=:flag')
|
->andwhere('usergroup.rolegroup>=:role')
|
||||||
|
|
||||||
->from('CadolesCoreBundle:Group','groupe')
|
->from('CadolesCoreBundle:Group','groupe')
|
||||||
->andwhere('groupe=usergroup.group')
|
->andwhere('groupe=usergroup.group')
|
||||||
->andwhere('groupe.fgcanshare=:flag')
|
->andwhere('groupe.fgcanshare=:flag')
|
||||||
|
|
||||||
->setParameter("id",$calendar->getId())
|
->setParameter("id",$calendar->getId())
|
||||||
|
->setParameter("role",50)
|
||||||
->setparameter('user',$user)
|
->setparameter('user',$user)
|
||||||
->setparameter('flag',true);
|
->setparameter('flag',true);
|
||||||
|
|
||||||
|
|
||||||
$inblogwriters=$qb->getQuery()->getResult();
|
$inblogwriters=$qb->getQuery()->getResult();
|
||||||
|
|
||||||
if($inblogwriters) $canadd=true;
|
if($inblogwriters) $can=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $canadd;
|
return $can;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getInmanager($user,$calendar) {
|
||||||
|
$can=false;
|
||||||
|
|
||||||
|
if($user) {
|
||||||
|
// Peut ecrire ceux qui sont manager du groupe auquel est rattaché le calendar
|
||||||
|
$qb = $this->createQueryBuilder("calendar");
|
||||||
|
$qb ->andWhere("calendar.id=:id")
|
||||||
|
->from('CadolesCoreBundle:User','user')
|
||||||
|
->andwhere("user=:user")
|
||||||
|
|
||||||
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
|
->andwhere('usergroup.group MEMBER OF calendar.groups')
|
||||||
|
->andwhere('usergroup.user=user')
|
||||||
|
->andwhere('usergroup.rolegroup>=:role')
|
||||||
|
|
||||||
|
->from('CadolesCoreBundle:Group','groupe')
|
||||||
|
->andwhere('groupe=usergroup.group')
|
||||||
|
->andwhere('groupe.fgcanshare=:flag')
|
||||||
|
|
||||||
|
->setParameter("id",$calendar->getId())
|
||||||
|
->setParameter("role",90)
|
||||||
|
->setparameter('user',$user)
|
||||||
|
->setparameter('flag',true);
|
||||||
|
|
||||||
|
|
||||||
|
$inblogwriters=$qb->getQuery()->getResult();
|
||||||
|
|
||||||
|
if($inblogwriters) $can=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $can;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,10 +100,12 @@ class CalendareventRepository extends EntityRepository
|
||||||
// On récupère soit les calendriers du group en cours soit l'ensemble des calendriers de l'utilisateur
|
// On récupère soit les calendriers du group en cours soit l'ensemble des calendriers de l'utilisateur
|
||||||
if($usage=="group") {
|
if($usage=="group") {
|
||||||
$calendars=$em->getRepository("CadolesPortalBundle:Calendar")->getCalendarsGroup($user,$group);
|
$calendars=$em->getRepository("CadolesPortalBundle:Calendar")->getCalendarsGroup($user,$group);
|
||||||
|
if($calendars) $firstcalendar=$calendars[0]->getId();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$em->getRepository("CadolesPortalBundle:Calendar")->getCalendarsUser($user,$calendarssuser,$calendarsadmin,$calendarsshared);
|
$em->getRepository("CadolesPortalBundle:Calendar")->getCalendarsUser($user,$calendarssuser,$calendarsadmin,$calendarsshared);
|
||||||
$calendars=array_merge($calendarssuser,$calendarsadmin->toArray(),$calendarsshared);
|
$calendars=array_merge($calendarssuser,$calendarsadmin->toArray(),$calendarsshared);
|
||||||
|
$firstcalendar="all";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Début & fin
|
// Début & fin
|
||||||
|
@ -184,7 +186,6 @@ class CalendareventRepository extends EntityRepository
|
||||||
else {
|
else {
|
||||||
$em->getRepository("CadolesPortalBundle:Project")->getProjectsUser($user,$projectssuser,$projectsadmin,$projectsshared);
|
$em->getRepository("CadolesPortalBundle:Project")->getProjectsUser($user,$projectssuser,$projectsadmin,$projectsshared);
|
||||||
$projects=array_merge($projectssuser,$projectsadmin->toArray(),$projectsshared);
|
$projects=array_merge($projectssuser,$projectsadmin->toArray(),$projectsshared);
|
||||||
$firstcalendar="all";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($projects as $project) {
|
foreach($projects as $project) {
|
||||||
|
|
|
@ -128,7 +128,7 @@ class PageRepository extends EntityRepository
|
||||||
else {
|
else {
|
||||||
// Si l'utilisateur est manager du group il aura les permissions de modification sur la page
|
// Si l'utilisateur est manager du group il aura les permissions de modification sur la page
|
||||||
$usergroup=$this->getEntityManager()->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$user,"group"=>$groupshared]);
|
$usergroup=$this->getEntityManager()->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$user,"group"=>$groupshared]);
|
||||||
if($usergroup&&$usergroup->getFgmanager()) {
|
if($usergroup&&$usergroup->getRolegroup()>=90) {
|
||||||
foreach($pagesshared as $key2 => $pageshared) {
|
foreach($pagesshared as $key2 => $pageshared) {
|
||||||
$pagesshared[$key2]->setCanupdate(true);
|
$pagesshared[$key2]->setCanupdate(true);
|
||||||
}
|
}
|
||||||
|
@ -298,11 +298,12 @@ class PageRepository extends EntityRepository
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPermission($user,$page,&$cansee,&$canupdate) {
|
public function getPermission($user,$page,&$cansee,&$canupdate,&$canadd) {
|
||||||
// si page de l'utilisateur
|
// si page de l'utilisateur
|
||||||
if($page->getUser()==$user&&!is_null($user)) {
|
if($page->getUser()==$user&&!is_null($user)) {
|
||||||
$cansee=true;
|
$cansee=true;
|
||||||
$canupdate=true;
|
$canupdate=true;
|
||||||
|
$canadd=true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$canupdate=false;
|
$canupdate=false;
|
||||||
|
@ -361,7 +362,8 @@ class PageRepository extends EntityRepository
|
||||||
$cansee=true;
|
$cansee=true;
|
||||||
// Est-il manager du groupe
|
// Est-il manager du groupe
|
||||||
if($group->getGroup()->getFgcanshare()) {
|
if($group->getGroup()->getFgcanshare()) {
|
||||||
if($group->getFgmanager()) $canupdate=true;
|
if($group->getRolegroup()>=90) $canupdate=true;
|
||||||
|
if($group->getRolegroup()>=50) $canadd=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,34 +68,6 @@ class ProjectRepository extends EntityRepository
|
||||||
|
|
||||||
// projects partagées
|
// projects partagées
|
||||||
$projectsshared=[];
|
$projectsshared=[];
|
||||||
/*
|
|
||||||
if($user) {
|
|
||||||
$projectsshared=$this->createQueryBuilder('project')
|
|
||||||
->from('CadolesCoreBundle:Group','g')
|
|
||||||
->from('CadolesCoreBundle:UserGroup','ug')
|
|
||||||
->from('CadolesCoreBundle:UserGroup','proprio')
|
|
||||||
->where('g.fgcanshare=:fgcanshare')
|
|
||||||
->andWhere('g=ug.group')
|
|
||||||
->andWhere('ug.user=:user')
|
|
||||||
->andWhere('g MEMBER OF project.groups')
|
|
||||||
->andWhere('project.user != :user')
|
|
||||||
->andWhere('project.user is not null')
|
|
||||||
->andWhere('proprio.user=project.user')
|
|
||||||
->andWhere('proprio.group=g')
|
|
||||||
->setParameter('fgcanshare',true)
|
|
||||||
->setParameter('user',$user)
|
|
||||||
->addOrderBy('project.name', 'ASC')
|
|
||||||
->getQuery()->getResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Permission sur les projects
|
|
||||||
if($projectsshared) {
|
|
||||||
foreach($projectsshared as $projectshared) {
|
|
||||||
$projectshared->setCanupdate(false);
|
|
||||||
$projectshared->setCanadd($this->getInwriter($user,$projectshared));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Initialisation du calcul des projects
|
// Initialisation du calcul des projects
|
||||||
$projectsadmin=new ArrayCollection();
|
$projectsadmin=new ArrayCollection();
|
||||||
|
@ -129,7 +101,7 @@ class ProjectRepository extends EntityRepository
|
||||||
|
|
||||||
// Permission sur les projects
|
// Permission sur les projects
|
||||||
foreach($projectsadmin as $projectadmin) {
|
foreach($projectsadmin as $projectadmin) {
|
||||||
$projectadmin->setCanupdate(false);
|
$projectadmin->setCanupdate($this->getInmanager($user,$projectadmin));
|
||||||
$projectadmin->setCanadd($this->getInwriter($user,$projectadmin));
|
$projectadmin->setCanadd($this->getInwriter($user,$projectadmin));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,28 +122,6 @@ class ProjectRepository extends EntityRepository
|
||||||
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
|
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
|
||||||
$groups=($user?$user->getGroups():[]);
|
$groups=($user?$user->getGroups():[]);
|
||||||
|
|
||||||
// Le project est-il dans les projects associés à un partage de group ?
|
|
||||||
/*
|
|
||||||
$inprojectsshared=$this->createQueryBuilder('project')
|
|
||||||
->from('CadolesCoreBundle:Group','g')
|
|
||||||
->from('CadolesCoreBundle:UserGroup','ug')
|
|
||||||
->from('CadolesCoreBundle:UserGroup','proprio')
|
|
||||||
->where('g.fgcanshare=:fgcanshare')
|
|
||||||
->andWhere('project.id = :id')
|
|
||||||
->andWhere('g=ug.group')
|
|
||||||
->andWhere('ug.user=:user')
|
|
||||||
->andWhere('g MEMBER OF project.groups')
|
|
||||||
->andWhere('project.user != :user')
|
|
||||||
->andWhere('project.user is not null')
|
|
||||||
->andWhere('proprio.user=project.user')
|
|
||||||
->andWhere('proprio.group=g')
|
|
||||||
->setParameter("id",$project->getId())
|
|
||||||
->setParameter('fgcanshare',true)
|
|
||||||
->setParameter('user',$user)
|
|
||||||
->getQuery()->getResult();
|
|
||||||
if($inprojectsshared) $cansee=true;
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Le project est-il dans les projects associés au role de l'utilisateur ?
|
// Le project est-il dans les projects associés au role de l'utilisateur ?
|
||||||
foreach($roles as $role) {
|
foreach($roles as $role) {
|
||||||
$qb = $this->createQueryBuilder("project");
|
$qb = $this->createQueryBuilder("project");
|
||||||
|
@ -198,7 +148,8 @@ class ProjectRepository extends EntityRepository
|
||||||
|
|
||||||
// Est-il manager du groupe
|
// Est-il manager du groupe
|
||||||
if($group->getGroup()->getFgcanshare()) {
|
if($group->getGroup()->getFgcanshare()) {
|
||||||
if($group->getFgmanager()) $canadd=true;
|
if($group->getRolegroup()>=90) $canupdate=true;
|
||||||
|
if($group->getRolegroup()>=0) $canadd=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,7 +161,7 @@ class ProjectRepository extends EntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInwriter($user,$project) {
|
public function getInwriter($user,$project) {
|
||||||
$canadd=false;
|
$can=false;
|
||||||
|
|
||||||
if($user) {
|
if($user) {
|
||||||
// Peut ecrire ceux qui sont déclaré comme écrivain
|
// Peut ecrire ceux qui sont déclaré comme écrivain
|
||||||
|
@ -229,7 +180,7 @@ class ProjectRepository extends EntityRepository
|
||||||
->setparameter('user',$user);
|
->setparameter('user',$user);
|
||||||
|
|
||||||
$inprojectwriters=$qb->getQuery()->getResult();
|
$inprojectwriters=$qb->getQuery()->getResult();
|
||||||
if($inprojectwriters) $canadd=true;
|
if($inprojectwriters) $can=true;
|
||||||
|
|
||||||
// Peut ecrire ceux qui sont manager du groupe auquel est rattaché le project
|
// Peut ecrire ceux qui sont manager du groupe auquel est rattaché le project
|
||||||
$qb = $this->createQueryBuilder("project");
|
$qb = $this->createQueryBuilder("project");
|
||||||
|
@ -240,7 +191,7 @@ class ProjectRepository extends EntityRepository
|
||||||
->from('CadolesCoreBundle:UserGroup','usergroup')
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
->andwhere('usergroup.group MEMBER OF project.groups')
|
->andwhere('usergroup.group MEMBER OF project.groups')
|
||||||
->andwhere('usergroup.user=:user')
|
->andwhere('usergroup.user=:user')
|
||||||
->andwhere('usergroup.fgmanager=:flag')
|
->andwhere('usergroup.rolegroup>=:role')
|
||||||
|
|
||||||
->from('CadolesCoreBundle:Group','groupe')
|
->from('CadolesCoreBundle:Group','groupe')
|
||||||
->andwhere('groupe=usergroup.group')
|
->andwhere('groupe=usergroup.group')
|
||||||
|
@ -248,13 +199,80 @@ class ProjectRepository extends EntityRepository
|
||||||
|
|
||||||
->setParameter("id",$project->getId())
|
->setParameter("id",$project->getId())
|
||||||
->setparameter('user',$user)
|
->setparameter('user',$user)
|
||||||
->setparameter('flag',true);
|
->setparameter('flag',true)
|
||||||
|
->setparameter('role',0);
|
||||||
|
|
||||||
|
|
||||||
$inprojectwriters=$qb->getQuery()->getResult();
|
$inprojectwriters=$qb->getQuery()->getResult();
|
||||||
if($inprojectwriters) $canadd=true;
|
if($inprojectwriters) $can=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $canadd;
|
return $can;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getInmanager($user,$project) {
|
||||||
|
$can=false;
|
||||||
|
|
||||||
|
if($user) {
|
||||||
|
// Peut ecrire ceux qui sont manager du groupe auquel est rattaché le project
|
||||||
|
$qb = $this->createQueryBuilder("project");
|
||||||
|
$qb ->andWhere("project.id=:id")
|
||||||
|
->from('CadolesCoreBundle:User','user')
|
||||||
|
->andwhere("user=:user")
|
||||||
|
|
||||||
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
|
->andwhere('usergroup.group MEMBER OF project.groups')
|
||||||
|
->andwhere('usergroup.user=user')
|
||||||
|
->andwhere('usergroup.rolegroup>=:role')
|
||||||
|
|
||||||
|
->from('CadolesCoreBundle:Group','groupe')
|
||||||
|
->andwhere('groupe=usergroup.group')
|
||||||
|
->andwhere('groupe.fgcanshare=:flag')
|
||||||
|
|
||||||
|
->setParameter("id",$project->getId())
|
||||||
|
->setParameter("role",90)
|
||||||
|
->setparameter('user',$user)
|
||||||
|
->setparameter('flag',true);
|
||||||
|
|
||||||
|
|
||||||
|
$inblogwriters=$qb->getQuery()->getResult();
|
||||||
|
|
||||||
|
if($inblogwriters) $can=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $can;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getInvalideur($user,$project) {
|
||||||
|
$can=false;
|
||||||
|
|
||||||
|
if($user) {
|
||||||
|
// Peut ecrire ceux qui sont manager du groupe auquel est rattaché le project
|
||||||
|
$qb = $this->createQueryBuilder("project");
|
||||||
|
$qb ->andWhere("project.id=:id")
|
||||||
|
->from('CadolesCoreBundle:User','user')
|
||||||
|
->andwhere("user=:user")
|
||||||
|
|
||||||
|
->from('CadolesCoreBundle:UserGroup','usergroup')
|
||||||
|
->andwhere('usergroup.group MEMBER OF project.groups')
|
||||||
|
->andwhere('usergroup.user=user')
|
||||||
|
->andwhere('usergroup.rolegroup>=:role')
|
||||||
|
|
||||||
|
->from('CadolesCoreBundle:Group','groupe')
|
||||||
|
->andwhere('groupe=usergroup.group')
|
||||||
|
->andwhere('groupe.fgcanshare=:flag')
|
||||||
|
|
||||||
|
->setParameter("id",$project->getId())
|
||||||
|
->setParameter("role",50)
|
||||||
|
->setparameter('user',$user)
|
||||||
|
->setparameter('flag',true);
|
||||||
|
|
||||||
|
|
||||||
|
$inblogwriters=$qb->getQuery()->getResult();
|
||||||
|
|
||||||
|
if($inblogwriters) $can=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $can;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
<div class="blogtitle">
|
<div class="blogtitle">
|
||||||
<legend><h1>{{entity.name}}</h1></legend>
|
<legend><h1>{{entity.name}}</h1></legend>
|
||||||
<small>publié par {{ entity.user.username }} le {{ entity.submit|date("d/m/Y à H:i") }} dans le blog {{entity.blog.name }}</small>
|
<small>publié par {{ entity.user.username }} le {{ entity.submit|date("d/m/Y à H:i") }} dans le blog {{entity.blog.name }}</small>
|
||||||
{% if canadd %}
|
{% if canupdate %}
|
||||||
<a href="{{ path("cadoles_portal_"~access~"_blogarticle_update",{'id':entity.id}) }}"><i class="fa fa-file"></i></a>
|
<a href="{{ path("cadoles_portal_"~access~"_blogarticle_update",{'id':entity.id}) }}"><i class="fa fa-file"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
<div class="blogtitle">
|
<div class="blogtitle">
|
||||||
<legend><h2>{{comment.name}}</h2></legend>
|
<legend><h2>{{comment.name}}</h2></legend>
|
||||||
<small>publié par {{ comment.user.username }} le {{ comment.submit|date("d/m/Y à H:i") }}</small>
|
<small>publié par {{ comment.user.username }} le {{ comment.submit|date("d/m/Y à H:i") }}</small>
|
||||||
{% if canadd or app.user==comment.user%}
|
{% if canupdate or app.user==comment.user%}
|
||||||
<a href="{{ path("cadoles_portal_"~access~"_blogcomment_update",{'id':comment.id}) }}"><i class="fa fa-file"></i></a>
|
<a href="{{ path("cadoles_portal_"~access~"_blogcomment_update",{'id':comment.id}) }}"><i class="fa fa-file"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
<div class="blogtitle">
|
<div class="blogtitle">
|
||||||
<legend><h2 style="font-size:85%">{{reply.name}}</h2></legend>
|
<legend><h2 style="font-size:85%">{{reply.name}}</h2></legend>
|
||||||
<small>publié par {{ reply.user.username }} le {{ reply.submit|date("d/m/Y à H:i") }}</small>
|
<small>publié par {{ reply.user.username }} le {{ reply.submit|date("d/m/Y à H:i") }}</small>
|
||||||
{% if canadd or app.user==reply.user%}
|
{% if canupdate or app.user==reply.user%}
|
||||||
<a href="{{ path("cadoles_portal_"~access~"_blogcomment_update",{'id':reply.id}) }}"><i class="fa fa-file"></i></a>
|
<a href="{{ path("cadoles_portal_"~access~"_blogcomment_update",{'id':reply.id}) }}"><i class="fa fa-file"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
|
|
||||||
{% for calendar in calendars %}
|
{% for calendar in calendars %}
|
||||||
<li id="menucalendar-{{calendar.id}}" data-open="{% if calendar.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==calendar.id%}active{%endif%}" style="cursor:pointer">
|
<li id="menucalendar-{{calendar.id}}" data-open="{% if calendar.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==calendar.id%}active{%endif%}" style="cursor:pointer">
|
||||||
|
|
||||||
|
|
||||||
<a href="{{ path("cadoles_portal_user_calendar_view",{'id':calendar.id}) }}">
|
<a href="{{ path("cadoles_portal_user_calendar_view",{'id':calendar.id}) }}">
|
||||||
{% if not calendar.groups is empty %}
|
{% if not calendar.groups is empty %}
|
||||||
<i class="fa fa-users fa-fw"></i>
|
<i class="fa fa-users fa-fw"></i>
|
||||||
|
@ -33,7 +31,7 @@
|
||||||
<i class="fa fa-user fa-fw"></i>
|
<i class="fa fa-user fa-fw"></i>
|
||||||
{%endif%}
|
{%endif%}
|
||||||
{{ calendar.name }}
|
{{ calendar.name }}
|
||||||
{% if calendar.canupdate %}
|
{% if calendar.canadd %}
|
||||||
<i class="fa fa-pencil"></i>
|
<i class="fa fa-pencil"></i>
|
||||||
{% else %}
|
{% else %}
|
||||||
<i class="fa fa-lock"></i>
|
<i class="fa fa-lock"></i>
|
||||||
|
@ -81,7 +79,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for calendar in calendars %}
|
{% for calendar in calendars %}
|
||||||
{% if calendar.canupdate %}
|
{% if calendar.canadd %}
|
||||||
<option value='{{ calendar.id}}'>{{ calendar.name}}</option>
|
<option value='{{ calendar.id}}'>{{ calendar.name}}</option>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -162,7 +160,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for calendar in calendars %}
|
{% for calendar in calendars %}
|
||||||
{% if calendar.canupdate %}
|
{% if calendar.canadd %}
|
||||||
<option value='{{ calendar.id}}'>{{ calendar.name}}</option>
|
<option value='{{ calendar.id}}'>{{ calendar.name}}</option>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -290,13 +288,13 @@
|
||||||
{% if entity.id is defined %}
|
{% if entity.id is defined %}
|
||||||
{% for calendar in calendars %}
|
{% for calendar in calendars %}
|
||||||
{% if calendar.id==entity.id %}
|
{% if calendar.id==entity.id %}
|
||||||
showCalendar({{ calendar.id }}, {{ calendar.canupdate }});
|
showCalendar({{ calendar.id }}, {{ calendar.canadd }});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set onecalendarcanupdate = false %}
|
{% set onecalendarcanupdate = false %}
|
||||||
{% for calendar in calendars %}
|
{% for calendar in calendars %}
|
||||||
{% if calendar.canupdate %}
|
{% if calendar.canadd %}
|
||||||
{% set onecalendarcanupdate = true %}
|
{% set onecalendarcanupdate = true %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -334,7 +332,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affichages des calendars
|
// Affichages des calendars
|
||||||
function showCalendar(id,canupdate) {
|
function showCalendar(id,canadd) {
|
||||||
|
|
||||||
|
|
||||||
idcalendar=id;
|
idcalendar=id;
|
||||||
|
@ -359,9 +357,9 @@
|
||||||
$('#calendar').fullCalendar( 'destroy' );
|
$('#calendar').fullCalendar( 'destroy' );
|
||||||
$('#calendar').fullCalendar({
|
$('#calendar').fullCalendar({
|
||||||
lang: 'fr',
|
lang: 'fr',
|
||||||
selectable: canupdate,
|
selectable: canadd,
|
||||||
selectHelper: true,
|
selectHelper: true,
|
||||||
editable: canupdate,
|
editable: canadd,
|
||||||
eventLimit: true,
|
eventLimit: true,
|
||||||
defaultView: defautView,
|
defaultView: defautView,
|
||||||
|
|
||||||
|
|
|
@ -33,18 +33,26 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if access=="config" %}
|
{% if access=="config" %}
|
||||||
<a title="Gérer mes Blogs" href='{{ path('cadoles_portal_config_blog') }}' style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
<a title="Gérer mes Blogs" href='{{ path('cadoles_portal_config_blog') }}' style="{{ stylewidgetmenu }}"><i class="fa fa-th fa-fw"></i></a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set idblog = "" %}
|
{% if canadd %}
|
||||||
{% set url= path('cadoles_portal_user_blogarticle_submit') %}
|
{% set idblog = "" %}
|
||||||
{% if usage=="group" and firstblog is defined %}
|
{% set url= path('cadoles_portal_user_blogarticle_submit') %}
|
||||||
{% set url= path('cadoles_portal_user_blogarticle_submit',{idblog:firstblog,page:entity.page.id}) %}
|
{% if usage=="group" and firstblog is defined %}
|
||||||
|
{% set url= path('cadoles_portal_user_blogarticle_submit',{idblog:firstblog,page:entity.page.id}) %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<a title="Créer un Article" onClick="showFrameitem('blog','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% 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 %}
|
||||||
|
|
||||||
|
<a title="Voir mes Blogs" onClick="showFrameitem('blog','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-th fa-fw"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<a title="Créer un Article" onClick="showFrameitem('blog','{{ url }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
{% if look=="list" %}
|
{% if look=="list" %}
|
||||||
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -51,7 +51,10 @@
|
||||||
{% if canupdate %}
|
{% if canupdate %}
|
||||||
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
||||||
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" style="{{ stylewidgetmenu }}"></i>
|
{% endif %}
|
||||||
|
|
||||||
|
{% if canadd %}
|
||||||
|
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" style="{{ stylewidgetmenu }}"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if look=="list" %}
|
{% if look=="list" %}
|
||||||
|
@ -70,7 +73,7 @@
|
||||||
<span class="title">{{ entity.name }}</span>
|
<span class="title">{{ entity.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if bookmarks is not empty or canupdate %}
|
{% if bookmarks is not empty or canadd %}
|
||||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||||
<div class="bookmark-container">
|
<div class="bookmark-container">
|
||||||
<div class="grid clearfix">
|
<div class="grid clearfix">
|
||||||
|
@ -79,7 +82,7 @@
|
||||||
{% for bookmark in bookmarks %}
|
{% for bookmark in bookmarks %}
|
||||||
<div class="grid-item {{ stylegrid }}">
|
<div class="grid-item {{ stylegrid }}">
|
||||||
<div class="grid-item-content" style="background-color: {{ bookmark.color ? "#"~bookmark.color : "#"~color['main'] }};">
|
<div class="grid-item-content" style="background-color: {{ bookmark.color ? "#"~bookmark.color : "#"~color['main'] }};">
|
||||||
{% if canupdate %}
|
{% if canadd %}
|
||||||
<a style="cursor:pointer" onClick="modBookmark({{ bookmark.id }})" class="item-update"><i style="color: #FFF" class="fa fa-file" title="Modifier le favori"></i></a>
|
<a style="cursor:pointer" onClick="modBookmark({{ bookmark.id }})" class="item-update"><i style="color: #FFF" class="fa fa-file" title="Modifier le favori"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -110,7 +113,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if canupdate %}
|
{% if canadd %}
|
||||||
<div class="grid-item {{ stylegrid }}">
|
<div class="grid-item {{ stylegrid }}">
|
||||||
<div title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" class="grid-item-content" style="background-color: #{{color['main']}};cursor:pointer;">
|
<div title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" class="grid-item-content" style="background-color: #{{color['main']}};cursor:pointer;">
|
||||||
<div class="item-link clearfix">
|
<div class="item-link clearfix">
|
||||||
|
|
|
@ -64,16 +64,16 @@
|
||||||
<span class="title">{{ entity.name }}</span>
|
<span class="title">{{ entity.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if files|length>0 or canupdate %}
|
{% if files|length>0 or canadd %}
|
||||||
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||||
<div class="grid clearfix">
|
<div class="grid clearfix">
|
||||||
{% if canupdate %}
|
{% if canadd %}
|
||||||
<div class="grid-sizer grid-image"></div>
|
<div class="grid-sizer grid-image"></div>
|
||||||
<div class="grid-gutter-sizer"></div>
|
<div class="grid-gutter-sizer"></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for file in files|sort %}
|
{% for file in files|sort %}
|
||||||
{% if loop.index==1 and not canupdate %}
|
{% if loop.index==1 and not canadd %}
|
||||||
<div class="grid-sizer grid-image"></div>
|
<div class="grid-sizer grid-image"></div>
|
||||||
<div class="grid-gutter-sizer grid-gutter-sizer-image"></div>
|
<div class="grid-gutter-sizer grid-gutter-sizer-image"></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -99,7 +99,11 @@
|
||||||
<div class="grid-item-title">
|
<div class="grid-item-title">
|
||||||
<h2 style="{{ stylewidgetbodyreverse }};">
|
<h2 style="{{ stylewidgetbodyreverse }};">
|
||||||
{{ member.user.lastname }} {{ member.user.firstname }}
|
{{ member.user.lastname }} {{ member.user.firstname }}
|
||||||
{% if member.fgmanager %}
|
{% if member.rolegroup==100 %}
|
||||||
|
<br><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i>
|
||||||
|
{% elseif member.rolegroup==90 %}
|
||||||
|
<br><i class="fa fa-star"></i><i class="fa fa-star"></i>
|
||||||
|
{% elseif member.rolegroup==50 %}
|
||||||
<br><i class="fa fa-star"></i>
|
<br><i class="fa fa-star"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
|
|
||||||
{% if (bookmarks is not empty or (canadd and access!="config")) and withbookmark==0 %}
|
{% if (bookmarks is not empty or (canadd and access!="config")) and withbookmark==0 %}
|
||||||
<div class="bookmark-container">
|
<div class="bookmark-container">
|
||||||
<h3 class="grid-title bookmark-container" data-idcategory="bookmark" style="{{ colorbodyfont }}">Favoris</h3>
|
<h3 class="grid-title bookmark-container" data-idcategory="bookmark" style="{{ colorbodyfont }}">{{app.session.get('labelbookmarkuser')}}</h3>
|
||||||
<div class="grid clearfix">
|
<div class="grid clearfix">
|
||||||
<div class="grid-sizer {{ stylegrid }}" data-idcategory="bookmark"></div>
|
<div class="grid-sizer {{ stylegrid }}" data-idcategory="bookmark"></div>
|
||||||
<div class="grid-gutter-sizer {{ stylegrid }}-gutter-sizer"></div>
|
<div class="grid-gutter-sizer {{ stylegrid }}-gutter-sizer"></div>
|
||||||
|
@ -169,7 +169,7 @@
|
||||||
{% for bookmark in bookmarks if bookmark.item %}
|
{% for bookmark in bookmarks if bookmark.item %}
|
||||||
{% if loop.first %}
|
{% if loop.first %}
|
||||||
{% set haveressource=true %}
|
{% set haveressource=true %}
|
||||||
<h3 class="grid-title bookmark-container" data-idcategory="bookmark" style="{{ colorbodyfont }}">Mes Ressources</h3>
|
<h3 class="grid-title bookmark-container" data-idcategory="bookmark" style="{{ colorbodyfont }}">{{app.session.get('labelbookmarkitem')}}</h3>
|
||||||
<div class="grid clearfix">
|
<div class="grid clearfix">
|
||||||
<div class="grid-sizer {{ stylegrid }}" data-idcategory="bookmark"></div>
|
<div class="grid-sizer {{ stylegrid }}" data-idcategory="bookmark"></div>
|
||||||
<div class="grid-gutter-sizer {{ stylegrid }}-gutter-sizer"></div>
|
<div class="grid-gutter-sizer {{ stylegrid }}-gutter-sizer"></div>
|
||||||
|
|
|
@ -40,13 +40,16 @@
|
||||||
|
|
||||||
{% if access=="config" %}
|
{% if access=="config" %}
|
||||||
<a href='{{ path('cadoles_portal_config_project') }}' style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
<a href='{{ path('cadoles_portal_config_project') }}' style="{{ stylewidgetmenu }}"><i class="fa fa-plus fa-fw"></i></a>
|
||||||
{% else %}
|
{% elseif app.user %}
|
||||||
{% set idproject = "" %}
|
{% set idproject = "" %}
|
||||||
{% set url= path('cadoles_portal_user_projecttask_submit') %}
|
{% set urladd= path('cadoles_portal_user_projecttask_submit') %}
|
||||||
|
{% set urlview= path('cadoles_portal_user_project_view') %}
|
||||||
{% if usage=="group" and firstproject is defined %}
|
{% if usage=="group" and firstproject is defined %}
|
||||||
{% set url= path('cadoles_portal_user_projecttask_submit',{idproject:firstproject,page:entity.page.id}) %}
|
{% set urladd= path('cadoles_portal_user_projecttask_submit',{idproject:firstproject,page:entity.page.id}) %}
|
||||||
|
{% set urlview= path('cadoles_portal_user_project_view',{id:firstproject}) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a onClick="showFrameitem('project','{{ url }}',true)" style="{{ stylewidgetmenu }}" title="Ajouter une Tâche"><i class="fa fa-plus fa-fw"></i></a>
|
<a onClick="showFrameitem('project','{{ urladd }}',true)" style="{{ stylewidgetmenu }}" title="Ajouter une Tâche"><i class="fa fa-plus fa-fw"></i></a>
|
||||||
|
<a onClick="showFrameitem('project','{{ urlview }}',true)" style="{{ stylewidgetmenu }}" title="Gérer mes Tâches"><i class="fa fa-th fa-fw"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if look=="list" %}
|
{% if look=="list" %}
|
||||||
|
|
|
@ -170,7 +170,7 @@
|
||||||
{% if entity.id is defined %}
|
{% if entity.id is defined %}
|
||||||
{% for project in projects %}
|
{% for project in projects %}
|
||||||
{% if project.id==entity.id %}
|
{% if project.id==entity.id %}
|
||||||
showProject({{ project.id }}, {{ project.canupdate }});
|
showProject({{ project.id }}, {{ project.canadd }});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -61,7 +61,7 @@ class ChatController extends Controller
|
||||||
|
|
||||||
|
|
||||||
// Récupération des message parent du groupe
|
// Récupération des message parent du groupe
|
||||||
$messages=$em->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$group,"parent"=>null],["submitdate"=>"DESC"],30);
|
$messages=$em->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$group,"parent"=>null],["submitdate"=>"DESC"]);
|
||||||
foreach($messages as $message) {
|
foreach($messages as $message) {
|
||||||
$haveread = ($message->getReaders()->contains($user));
|
$haveread = ($message->getReaders()->contains($user));
|
||||||
$havesee = ($message->getSees()->contains($user));
|
$havesee = ($message->getSees()->contains($user));
|
||||||
|
@ -109,7 +109,7 @@ class ChatController extends Controller
|
||||||
'colorbody' => $colorbody,
|
'colorbody' => $colorbody,
|
||||||
'colormain' => $colormain,
|
'colormain' => $colormain,
|
||||||
'ingroup' => ($usergroup),
|
'ingroup' => ($usergroup),
|
||||||
'fgmanager' => ($usergroup&&($usergroup->getFgmanager()||$user->getRole()=="ROLE_ADMIN"||$user->getRole()=="ROLE_MODO")),
|
'canmanage' => ($usergroup&&($usergroup->getRolegroup()>=90||$user->getRole()=="ROLE_ADMIN"||$user->getRole()=="ROLE_MODO")),
|
||||||
'form' => $form->createView()
|
'form' => $form->createView()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@
|
||||||
width:100%;
|
width:100%;
|
||||||
margin:20px 0px 5px 0px;
|
margin:20px 0px 5px 0px;
|
||||||
height:150px;
|
height:150px;
|
||||||
|
color:#000000;
|
||||||
}
|
}
|
||||||
.sendreply { width:100%}
|
.sendreply { width:100%}
|
||||||
|
|
||||||
|
@ -127,7 +128,7 @@
|
||||||
<div id='message-{{message.id}}' class='message row {{classread}} {{classsee}}'>
|
<div id='message-{{message.id}}' class='message row {{classread}} {{classsee}}'>
|
||||||
<div class='msgavatar'>
|
<div class='msgavatar'>
|
||||||
<img style='cursor:pointer' onclick='seeUser({{message.user.id}})' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/{{message.user.avatar}}' class='avatar'><br>
|
<img style='cursor:pointer' onclick='seeUser({{message.user.id}})' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/{{message.user.avatar}}' class='avatar'><br>
|
||||||
{% if fgmanager or message.user == app.user %}
|
{% if canmanage or message.user == app.user %}
|
||||||
<i class='delmessage fa fa-trash fa-fw' data-id='{{message.id}}' title='Supprimer' style='cursor: pointer;'></i>
|
<i class='delmessage fa fa-trash fa-fw' data-id='{{message.id}}' title='Supprimer' style='cursor: pointer;'></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not message.havesee %}
|
{% if not message.havesee %}
|
||||||
|
@ -158,7 +159,7 @@
|
||||||
|
|
||||||
<div style='cursor:pointer' onclick='seeUser({{child.user.id}})'><small>{{ child.user.lastname }} {{ child.user.firstname }}</small></div>
|
<div style='cursor:pointer' onclick='seeUser({{child.user.id}})'><small>{{ child.user.lastname }} {{ child.user.firstname }}</small></div>
|
||||||
<small>{{child.submitdate|date('d/m/Y H:i')}}</small>
|
<small>{{child.submitdate|date('d/m/Y H:i')}}</small>
|
||||||
{% if fgmanager or child.user == app.user %}
|
{% if canmanage or child.user == app.user %}
|
||||||
<i class='delmessage fa fa-trash fa-fw' data-id='{{child.id}}' title='Supprimer' style='cursor: pointer;'></i>
|
<i class='delmessage fa fa-trash fa-fw' data-id='{{child.id}}' title='Supprimer' style='cursor: pointer;'></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not child.havesee %}
|
{% if not child.havesee %}
|
||||||
|
@ -390,7 +391,7 @@
|
||||||
html ="<div id='message-"+payload.msg.id+"' class='message row message-toread'>";
|
html ="<div id='message-"+payload.msg.id+"' class='message row message-toread'>";
|
||||||
html+="<div class='msgavatar'>";
|
html+="<div class='msgavatar'>";
|
||||||
html+="<img style='pointer:cursor' onclick='seeUser("+payload.msg.userid+")' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+payload.msg.avatar+"' class='avatar'><br>";
|
html+="<img style='pointer:cursor' onclick='seeUser("+payload.msg.userid+")' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+payload.msg.avatar+"' class='avatar'><br>";
|
||||||
if(payload.msg.userid=={{app.user.id}} || '{{ fgmanager }}'=='1') {
|
if(payload.msg.userid=={{app.user.id}} || '{{ canmanage }}'=='1') {
|
||||||
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+payload.msg.id+"' title='Supprimer' style='cursor: pointer;'></i>";
|
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+payload.msg.id+"' title='Supprimer' style='cursor: pointer;'></i>";
|
||||||
}
|
}
|
||||||
html+="<i id='hidemessage-"+payload.msg.id+"' class='hidemessage fa fa-eye-slash fa-fw' data-id='"+payload.msg.id+"' title='Ne plus afficher' style='cursor: pointer;'></i>";
|
html+="<i id='hidemessage-"+payload.msg.id+"' class='hidemessage fa fa-eye-slash fa-fw' data-id='"+payload.msg.id+"' title='Ne plus afficher' style='cursor: pointer;'></i>";
|
||||||
|
@ -422,7 +423,7 @@
|
||||||
html+=nl2br(payload.msgreply.message);
|
html+=nl2br(payload.msgreply.message);
|
||||||
html+="<div style='cursor:pointer' onclick='seeUser("+payload.msgreply.userid+")'><small>"+payload.msgreply.lastname+"</small></div>";
|
html+="<div style='cursor:pointer' onclick='seeUser("+payload.msgreply.userid+")'><small>"+payload.msgreply.lastname+"</small></div>";
|
||||||
html+="<small>"+new Date(payload.msgreply.submitdate.date).toLocaleDateString("fr-FR", dateoptions)+"</small>";
|
html+="<small>"+new Date(payload.msgreply.submitdate.date).toLocaleDateString("fr-FR", dateoptions)+"</small>";
|
||||||
if(payload.msgreply.userid=={{app.user.id}} || '{{ fgmanager }}'=='1') {
|
if(payload.msgreply.userid=={{app.user.id}} || '{{ canmanage }}'=='1') {
|
||||||
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+payload.msgreply.id+"' title='Supprimer' style='cursor: pointer;'></i>";
|
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+payload.msgreply.id+"' title='Supprimer' style='cursor: pointer;'></i>";
|
||||||
}
|
}
|
||||||
html+="<i id='hidemessage-"+payload.msgreply.id+"' class='hidemessage fa fa-eye-slash fa-fw' data-id='"+payload.msgreply.id+"' title='Ne plus afficher' style='cursor: pointer;'></i>";
|
html+="<i id='hidemessage-"+payload.msgreply.id+"' class='hidemessage fa fa-eye-slash fa-fw' data-id='"+payload.msgreply.id+"' title='Ne plus afficher' style='cursor: pointer;'></i>";
|
||||||
|
@ -791,7 +792,7 @@
|
||||||
html ="<div id='message-"+data.id+"' class='message row message-toread'>";
|
html ="<div id='message-"+data.id+"' class='message row message-toread'>";
|
||||||
html+="<div class='msgavatar'>";
|
html+="<div class='msgavatar'>";
|
||||||
html+="<img style='cursor:pointer' onclick='seeUser("+data.userid+")' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+data.useravatar+"' class='avatar'><br>";
|
html+="<img style='cursor:pointer' onclick='seeUser("+data.userid+")' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+data.useravatar+"' class='avatar'><br>";
|
||||||
if(data.userid=={{app.user.id}} || '{{ fgmanager }}'=='1') {
|
if(data.userid=={{app.user.id}} || '{{ canmanage }}'=='1') {
|
||||||
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+data.id+"' style='cursor: pointer;'></i>";
|
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+data.id+"' style='cursor: pointer;'></i>";
|
||||||
}
|
}
|
||||||
if (!data.havesee) {
|
if (!data.havesee) {
|
||||||
|
@ -821,7 +822,7 @@
|
||||||
html+=nl2br(child.message);
|
html+=nl2br(child.message);
|
||||||
html+="<div style='cursor:pointer' onclick='seeUser("+child.userid+")'><small>"+child.userlastname+"</small></div>";
|
html+="<div style='cursor:pointer' onclick='seeUser("+child.userid+")'><small>"+child.userlastname+"</small></div>";
|
||||||
html+="<small>"+new Date(child.submitdate.date).toLocaleDateString("fr-FR", dateoptions)+"</small>";
|
html+="<small>"+new Date(child.submitdate.date).toLocaleDateString("fr-FR", dateoptions)+"</small>";
|
||||||
if(child.userid=={{app.user.id}} || '{{ fgmanager }}'=='1') {
|
if(child.userid=={{app.user.id}} || '{{ canmanage }}'=='1') {
|
||||||
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+child.id+"' title='Supprimer' style='cursor: pointer;'></i>";
|
html+="<i class='delmessage fa fa-trash fa-fw' data-id='"+child.id+"' title='Supprimer' style='cursor: pointer;'></i>";
|
||||||
}
|
}
|
||||||
html+="<i id='hidemessage-"+child.id+"' class='hidemessage fa fa-eye-slash fa-fw' data-id='"+child.id+"' title='Ne plus afficher' style='cursor: pointer;'></i>";
|
html+="<i id='hidemessage-"+child.id+"' class='hidemessage fa fa-eye-slash fa-fw' data-id='"+child.id+"' title='Ne plus afficher' style='cursor: pointer;'></i>";
|
||||||
|
|
|
@ -210,7 +210,7 @@ class WebsocketTopic implements TopicInterface
|
||||||
|
|
||||||
if($event["type"]=="del") {
|
if($event["type"]=="del") {
|
||||||
$message=$this->em->getRepository("CadolesWebsocketBundle:Message")->find($event["id"]);
|
$message=$this->em->getRepository("CadolesWebsocketBundle:Message")->find($event["id"]);
|
||||||
if($message&&($usergroup->getFgmanager()||$message->getUser()==$user||$user->getRole()=="ROLE_ADMIN"||$user->getRole()=="ROLE_MODO" )) {
|
if($message&&($usergroup->getRolegroup()>=90||$message->getUser()==$user||$user->getRole()=="ROLE_ADMIN"||$user->getRole()=="ROLE_MODO" )) {
|
||||||
$id=$message->getId();
|
$id=$message->getId();
|
||||||
$this->em->remove($message);
|
$this->em->remove($message);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
|
@ -121,6 +121,9 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type
|
||||||
|
|
||||||
('500', 1, 1, 1, 'permgroup', 'permgroup', 'ROLE_ANIM', '', 'Determine quel rôle aura la permission de créer des groupes de travail'),
|
('500', 1, 1, 1, 'permgroup', 'permgroup', 'ROLE_ANIM', '', 'Determine quel rôle aura la permission de créer des groupes de travail'),
|
||||||
('501', 1, 1, 1, 'permgroup', 'permannu', 'ROLE_USER', '', 'Determine quel rôle aura la permission de voir l\'annuaire'),
|
('501', 1, 1, 1, 'permgroup', 'permannu', 'ROLE_USER', '', 'Determine quel rôle aura la permission de voir l\'annuaire'),
|
||||||
('502', 1, 1, 1, 'boolean', 'permunsubscribe', '0', '', 'Permettre aux utilisateurs de se désinscrire par eux-mêmes des groupes de travail');
|
('502', 1, 1, 1, 'boolean', 'permunsubscribe', '0', '', 'Permettre aux utilisateurs de se désinscrire par eux-mêmes des groupes de travail'),
|
||||||
|
|
||||||
|
('600', 1, 1, 1, 'string', 'labelbookmarkuser','Favoris', '', 'Titre sur la section des bookmark ajoutés par l\'utilisateur sur le bureau'),
|
||||||
|
('601', 1, 1, 1, 'string', 'labelbookmarkitem','Mes Ressources', '', 'Titre sur la section des items ajoutés en favoris par l\'utilisateur sur le bureau');
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue