svg
This commit is contained in:
parent
866536c457
commit
9f0915789b
|
@ -49,6 +49,9 @@ php bin/console Core:InitData --env=prod
|
||||||
php bin/console Cron:InitData --env=prod
|
php bin/console Cron:InitData --env=prod
|
||||||
php bin/console Portal:InitData --env=prod
|
php bin/console Portal:InitData --env=prod
|
||||||
|
|
||||||
|
# Passage des scripts
|
||||||
|
php bin/console Core:Script --env=prod
|
||||||
|
|
||||||
# Generation des assets
|
# Generation des assets
|
||||||
bin/console assetic:dump --env=prod
|
bin/console assetic:dump --env=prod
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ class PurgeFileCommand extends Command
|
||||||
|
|
||||||
if($fs->exists($directory)) {
|
if($fs->exists($directory)) {
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$finder->in($directory)->directories()->exclude("thumb");
|
$finder->in($directory)->directories()->exclude("thumb")->exclude("thumbmini");
|
||||||
|
|
||||||
foreach (iterator_to_array($finder) as $file) {
|
foreach (iterator_to_array($finder) as $file) {
|
||||||
$name = $file->getRelativePathname();
|
$name = $file->getRelativePathname();
|
||||||
|
@ -78,8 +78,6 @@ class PurgeFileCommand extends Command
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,11 +331,11 @@ class PurgeFileCommand extends Command
|
||||||
if($result) $find=true;
|
if($result) $find=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si pas trouvé on la cherche dans les blogcommentaire
|
// Si pas trouvé on la cherche dans les blogcomment
|
||||||
if(!$find) {
|
if(!$find) {
|
||||||
$result = $this->em
|
$result = $this->em
|
||||||
->getRepository("CadolesPortalBundle:Blogcommentaire")->createQueryBuilder('blogcommentaire')
|
->getRepository("CadolesPortalBundle:Blogcomment")->createQueryBuilder('blogcomment')
|
||||||
->where('blogarticle.description LIKE :tofind')
|
->where('blogcomment.description LIKE :tofind')
|
||||||
->setParameter('tofind', '%'.$tofind.'%')
|
->setParameter('tofind', '%'.$tofind.'%')
|
||||||
->getQuery()->getResult();
|
->getQuery()->getResult();
|
||||||
if($result) $find=true;
|
if($result) $find=true;
|
||||||
|
|
|
@ -11,6 +11,7 @@ use Symfony\Component\HttpKernel\KernelInterface;
|
||||||
use Doctrine\DBAL\Connection as DBALConnection;
|
use Doctrine\DBAL\Connection as DBALConnection;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
|
|
||||||
|
use Cadoles\CoreBundle\Entity\Script;
|
||||||
use Cadoles\CoreBundle\Entity\User;
|
use Cadoles\CoreBundle\Entity\User;
|
||||||
use Cadoles\PortalBundle\Entity\Project;
|
use Cadoles\PortalBundle\Entity\Project;
|
||||||
|
|
||||||
|
@ -30,8 +31,6 @@ class ScriptCommand extends Command
|
||||||
$this
|
$this
|
||||||
->setName('Core:Script')
|
->setName('Core:Script')
|
||||||
->setDescription('Lauch Script')
|
->setDescription('Lauch Script')
|
||||||
->setHelp('Execeute some script : visibletrue / setusersniveau')
|
|
||||||
->addArgument('scriptname', InputArgument::OPTIONAL, 'scriptname')
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,18 +42,64 @@ class ScriptCommand extends Command
|
||||||
$this->filesystem = new Filesystem();
|
$this->filesystem = new Filesystem();
|
||||||
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
|
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
|
||||||
|
|
||||||
$this->writelnred('');
|
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"visibletrue"]);
|
||||||
$this->writelnred('== Core:Script');
|
if(!$script) {
|
||||||
$this->writelnred('==========================================================================================================');
|
$this->writelnred("== SCRIPT = visibletrue");
|
||||||
|
$this->visibletrue();
|
||||||
|
|
||||||
$scriptname = $input->getArgument('scriptname');
|
$script=new Script();
|
||||||
$this->writeln($scriptname);
|
$script->setName("visibletrue");
|
||||||
|
$this->em->persist($script);
|
||||||
|
$this->em->flush();
|
||||||
|
$this->writeln("");
|
||||||
|
}
|
||||||
|
|
||||||
switch($scriptname) {
|
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"setusersniveau"]);
|
||||||
case "visibletrue": $this->visibletrue(); break;
|
if(!$script) {
|
||||||
case "setusersniveau": $this->setusersniveau(); break;
|
$this->writelnred("== SCRIPT = setusersniveau");
|
||||||
case "setfgcancreateproject": $this->setfgcancreateproject(); break;
|
$this->setusersniveau();
|
||||||
case "createproject": $this->createproject(); break;
|
|
||||||
|
$script=new Script();
|
||||||
|
$script->setName("setusersniveau");
|
||||||
|
$this->em->persist($script);
|
||||||
|
$this->em->flush();
|
||||||
|
$this->writeln("");
|
||||||
|
}
|
||||||
|
|
||||||
|
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"setfgcancreateproject"]);
|
||||||
|
if(!$script) {
|
||||||
|
$this->writelnred("== SCRIPT = setfgcancreateproject");
|
||||||
|
$this->setfgcancreateproject();
|
||||||
|
|
||||||
|
$script=new Script();
|
||||||
|
$script->setName("setfgcancreateproject");
|
||||||
|
$this->em->persist($script);
|
||||||
|
$this->em->flush();
|
||||||
|
$this->writeln("");
|
||||||
|
}
|
||||||
|
|
||||||
|
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createproject"]);
|
||||||
|
if(!$script) {
|
||||||
|
$this->writelnred("== SCRIPT = createproject");
|
||||||
|
$this->createproject();
|
||||||
|
|
||||||
|
$script=new Script();
|
||||||
|
$script->setName("createproject");
|
||||||
|
$this->em->persist($script);
|
||||||
|
$this->em->flush();
|
||||||
|
$this->writeln("");
|
||||||
|
}
|
||||||
|
|
||||||
|
$script=$this->em->getRepository("CadolesCoreBundle:Script")->findOneBy(["name"=>"createthumbmini"]);
|
||||||
|
if(!$script) {
|
||||||
|
$this->writelnred("== SCRIPT = createthumbmini");
|
||||||
|
$this->createthumbmini();
|
||||||
|
|
||||||
|
$script=new Script();
|
||||||
|
$script->setName("createthumbmini");
|
||||||
|
$this->em->persist($script);
|
||||||
|
$this->em->flush();
|
||||||
|
$this->writeln("");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->writeln('');
|
$this->writeln('');
|
||||||
|
@ -113,6 +158,51 @@ class ScriptCommand extends Command
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function createthumbmini() {
|
||||||
|
$directory=$this->container->get('kernel')->getRootDir()."/../uploads/file";
|
||||||
|
$files=[];
|
||||||
|
$fs = new Filesystem();
|
||||||
|
|
||||||
|
if($fs->exists($directory)) {
|
||||||
|
$finder = new Finder();
|
||||||
|
$finder->in($directory)->directories()->exclude("thumb")->exclude("thumbmini");
|
||||||
|
|
||||||
|
foreach (iterator_to_array($finder) as $rep) {
|
||||||
|
$finder2 = new Finder();
|
||||||
|
if($fs->exists($rep."/thumb")) {
|
||||||
|
$finder2->sortByName()->in($rep."/thumb");
|
||||||
|
|
||||||
|
foreach ($finder2 as $file) {
|
||||||
|
if(!$fs->exists($rep."/thumbmini/".$file->getRelativePathname())) {
|
||||||
|
$this->writeln($file->getRelativePathname());
|
||||||
|
$fs->mkdir($rep."/thumbmini");
|
||||||
|
$fs->copy($rep."/thumb/".$file->getRelativePathname(),$rep."/thumbmini/".$file->getRelativePathname());
|
||||||
|
$max_width=60;
|
||||||
|
$width = $this->getWidth($rep."/thumbmini/".$file->getRelativePathname());
|
||||||
|
$height = $this->getHeight($rep."/thumbmini/".$file->getRelativePathname());
|
||||||
|
$scale = $max_width/$width;
|
||||||
|
$this->resizeImage($rep."/thumbmini/".$file->getRelativePathname(),$width,$height,$scale);
|
||||||
|
$fs->chown($rep."/thumbmini/".$file->getRelativePathname(), 'www-data');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private function writelnred($string) {
|
private function writelnred($string) {
|
||||||
$this->output->writeln('<fg=red>'.$string.'</>');
|
$this->output->writeln('<fg=red>'.$string.'</>');
|
||||||
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
||||||
|
@ -122,6 +212,63 @@ class ScriptCommand extends Command
|
||||||
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getHeight($image) {
|
||||||
|
$size = getimagesize($image);
|
||||||
|
$height = $size[1];
|
||||||
|
return $height;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cacul de la largeur
|
||||||
|
protected function getWidth($image) {
|
||||||
|
$size = getimagesize($image);
|
||||||
|
$width = $size[0];
|
||||||
|
return $width;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function resizeImage($image,$width,$height,$scale) {
|
||||||
|
list($imagewidth, $imageheight, $imageType) = getimagesize($image);
|
||||||
|
$imageType = image_type_to_mime_type($imageType);
|
||||||
|
$newImageWidth = ceil($width * $scale);
|
||||||
|
$newImageHeight = ceil($height * $scale);
|
||||||
|
$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);
|
||||||
|
switch($imageType) {
|
||||||
|
case "image/gif":
|
||||||
|
$source=imagecreatefromgif($image);
|
||||||
|
break;
|
||||||
|
case "image/pjpeg":
|
||||||
|
case "image/jpeg":
|
||||||
|
case "image/jpg":
|
||||||
|
$source=imagecreatefromjpeg($image);
|
||||||
|
break;
|
||||||
|
case "image/png":
|
||||||
|
case "image/x-png":
|
||||||
|
$source=imagecreatefrompng($image);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$newImage = imagecreatetruecolor( $newImageWidth, $newImageHeight );
|
||||||
|
imagealphablending( $newImage, false );
|
||||||
|
imagesavealpha( $newImage, true );
|
||||||
|
imagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);
|
||||||
|
|
||||||
|
switch($imageType) {
|
||||||
|
case "image/gif":
|
||||||
|
imagegif($newImage,$image);
|
||||||
|
break;
|
||||||
|
case "image/pjpeg":
|
||||||
|
case "image/jpeg":
|
||||||
|
case "image/jpg":
|
||||||
|
imagejpeg($newImage,$image,90);
|
||||||
|
break;
|
||||||
|
case "image/png":
|
||||||
|
case "image/x-png":
|
||||||
|
imagepng($newImage,$image);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
chmod($image, 0640);
|
||||||
|
return $image;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,10 @@ class CoreController extends Controller
|
||||||
|
|
||||||
// Récupération de la page encours
|
// Récupération de la page encours
|
||||||
$id = $request->query->get('id');
|
$id = $request->query->get('id');
|
||||||
|
|
||||||
|
// Récupération redirection potentielle
|
||||||
|
$gotoroute = $request->query->get('gotoroute');
|
||||||
|
$gotoid = $request->query->get('gotoid');
|
||||||
|
|
||||||
// L'utilisateur en cours
|
// L'utilisateur en cours
|
||||||
|
|
||||||
|
@ -116,7 +120,7 @@ class CoreController extends Controller
|
||||||
return $this->render('CadolesPortalBundle:Page:default.html.twig',[
|
return $this->render('CadolesPortalBundle:Page:default.html.twig',[
|
||||||
'useheader' => true,
|
'useheader' => true,
|
||||||
'usemenu' => false,
|
'usemenu' => false,
|
||||||
'usesidebar' => false
|
'usesidebar' => false
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +135,9 @@ class CoreController extends Controller
|
||||||
'groupsshared' => $groupsshared,
|
'groupsshared' => $groupsshared,
|
||||||
'canadd' => $this->get('session')->get('cancreatepage'),
|
'canadd' => $this->get('session')->get('cancreatepage'),
|
||||||
'widgetsuser' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->getWidgetAccess("user"),
|
'widgetsuser' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->getWidgetAccess("user"),
|
||||||
'widgetsgroup' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->getWidgetAccess("group")
|
'widgetsgroup' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->getWidgetAccess("group"),
|
||||||
|
'gotoroute' => $gotoroute,
|
||||||
|
'gotoid' => $gotoid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ class FileController extends Controller
|
||||||
|
|
||||||
if($fs->exists($dir)) {
|
if($fs->exists($dir)) {
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$finder->sortByName()->in($dir)->exclude('thumb');
|
$finder->sortByName()->in($dir)->exclude('thumb')->exclude("thumbmini");
|
||||||
|
|
||||||
$i=-1;
|
$i=-1;
|
||||||
|
|
||||||
|
|
|
@ -192,4 +192,11 @@ class SecurityController extends Controller
|
||||||
|
|
||||||
return new Response();
|
return new Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function redirectAction($route,$id,Request $request) {
|
||||||
|
if($route=="cadoles_core_home")
|
||||||
|
return $this->redirectToRoute($route,["id"=>$id]);
|
||||||
|
else
|
||||||
|
return $this->redirectToRoute("cadoles_core_home",["gotoroute"=>$route,"gotoid"=>$id]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
<?php
|
||||||
|
namespace Cadoles\CoreBundle\Entity;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Entity
|
||||||
|
* @ORM\Table(name="script")
|
||||||
|
*/
|
||||||
|
class Script
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="integer")
|
||||||
|
* @ORM\Id
|
||||||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
|
*/
|
||||||
|
protected $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string")
|
||||||
|
*/
|
||||||
|
protected $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get id
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getId()
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set name
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
*
|
||||||
|
* @return Script
|
||||||
|
*/
|
||||||
|
public function setName($name)
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -108,7 +108,7 @@ class uploadListener
|
||||||
if (in_array(strtolower($file->GetExtension()), array('jpg', 'jpeg', 'jpe', 'png', 'gif', 'bmp'))) {
|
if (in_array(strtolower($file->GetExtension()), array('jpg', 'jpeg', 'jpe', 'png', 'gif', 'bmp'))) {
|
||||||
$fs = new Filesystem();
|
$fs = new Filesystem();
|
||||||
$fs->copy($pathname."/".$directory."/".$filename,$pathname."/".$directory."/thumb/".$filename);
|
$fs->copy($pathname."/".$directory."/".$filename,$pathname."/".$directory."/thumb/".$filename);
|
||||||
$max_width=350;
|
$max_width=300;
|
||||||
$width = $this->getWidth($pathname."/".$directory."/thumb/".$filename);
|
$width = $this->getWidth($pathname."/".$directory."/thumb/".$filename);
|
||||||
$height = $this->getHeight($pathname."/".$directory."/thumb/".$filename);
|
$height = $this->getHeight($pathname."/".$directory."/thumb/".$filename);
|
||||||
$scale = $max_width/$width;
|
$scale = $max_width/$width;
|
||||||
|
@ -118,7 +118,7 @@ class uploadListener
|
||||||
|
|
||||||
if (in_array(strtolower($file->GetExtension()), array('pdf'))) {
|
if (in_array(strtolower($file->GetExtension()), array('pdf'))) {
|
||||||
$im = new \Imagick();
|
$im = new \Imagick();
|
||||||
$im->setResolution(350, 350);
|
$im->setResolution(300, 300);
|
||||||
$im->readImage($pathname."/".$directory."/".$filename."[0]");
|
$im->readImage($pathname."/".$directory."/".$filename."[0]");
|
||||||
$im->setImageBackgroundColor('#ffffff');
|
$im->setImageBackgroundColor('#ffffff');
|
||||||
$im = $im->flattenImages();
|
$im = $im->flattenImages();
|
||||||
|
@ -128,6 +128,17 @@ class uploadListener
|
||||||
$fs->rename($pathname."/".$directory."/thumb/".$filename.".jpg", $pathname."/".$directory."/thumb/".$filename);
|
$fs->rename($pathname."/".$directory."/thumb/".$filename.".jpg", $pathname."/".$directory."/thumb/".$filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$fgexit=$fs->exists($pathname."/".$directory."/thumb/".$filename);
|
||||||
|
if($fgexit) {
|
||||||
|
$fs->mkdir($pathname."/".$directory."/thumbmini");
|
||||||
|
$fs->copy($pathname."/".$directory."/thumb/".$filename,$pathname."/".$directory."/thumbmini/".$filename);
|
||||||
|
$max_width=60;
|
||||||
|
$width = $this->getWidth($pathname."/".$directory."/thumbmini/".$filename);
|
||||||
|
$height = $this->getHeight($pathname."/".$directory."/thumbmini/".$filename);
|
||||||
|
$scale = $max_width/$width;
|
||||||
|
$this->resizeImage($pathname."/".$directory."/thumbmini/".$filename,$width,$height,$scale);
|
||||||
|
}
|
||||||
|
|
||||||
if (strpos($directory, 'widget') === 0) {
|
if (strpos($directory, 'widget') === 0) {
|
||||||
$tmp=explode("-",$directory);
|
$tmp=explode("-",$directory);
|
||||||
$widgetid=$tmp[1];
|
$widgetid=$tmp[1];
|
||||||
|
|
|
@ -41,6 +41,9 @@ cadoles_core_ldap_login:
|
||||||
path: /ldaplogin
|
path: /ldaplogin
|
||||||
defaults: { _controller: CadolesCoreBundle:Security:login }
|
defaults: { _controller: CadolesCoreBundle:Security:login }
|
||||||
|
|
||||||
|
cadoles_core_redirect:
|
||||||
|
path: /user/redirect/{route}/{id}
|
||||||
|
defaults: { _controller: CadolesCoreBundle:Security:redirect }
|
||||||
|
|
||||||
#== Crop Image ===========================================================================================================
|
#== Crop Image ===========================================================================================================
|
||||||
cadoles_core_crop01:
|
cadoles_core_crop01:
|
||||||
|
|
|
@ -559,6 +559,7 @@ class PageController extends Controller
|
||||||
'group' => $groupid
|
'group' => $groupid
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type Widgets
|
// Type Widgets
|
||||||
if($entity->getPageCategory()->getId()==2) {
|
if($entity->getPageCategory()->getId()==2) {
|
||||||
return $this->render($this->labelentity.':viewwidget.html.twig', [
|
return $this->render($this->labelentity.':viewwidget.html.twig', [
|
||||||
|
|
|
@ -1449,7 +1449,7 @@ class PagewidgetController extends Controller
|
||||||
|
|
||||||
if($fs->exists($directory)) {
|
if($fs->exists($directory)) {
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$finder->sortByName()->in($directory)->exclude('thumb');
|
$finder->sortByName()->in($directory)->exclude('thumb')->exclude('thumbmini');
|
||||||
|
|
||||||
foreach ($finder as $file) {
|
foreach ($finder as $file) {
|
||||||
$tmp=[];
|
$tmp=[];
|
||||||
|
@ -1460,7 +1460,25 @@ class PagewidgetController extends Controller
|
||||||
$tmp["minefamily"]=explode("/",$tmp["minetype"])[0];
|
$tmp["minefamily"]=explode("/",$tmp["minetype"])[0];
|
||||||
|
|
||||||
$tmp["thumb"]="";
|
$tmp["thumb"]="";
|
||||||
if($fs->exists($directory."/thumb/".$tmp["name"])) {
|
if($tmp["extension"]=="pdf") {
|
||||||
|
$tmp["thumb"]="/".$this->getParameter('alias')."/bundles/cadolescore/images/files/".$tmp["extension"].".png";
|
||||||
|
|
||||||
|
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"])) {
|
||||||
|
$data = file_get_contents($directory."/thumbmini/".$tmp["name"]);
|
||||||
|
$tmp["thumb"]=$data;
|
||||||
|
}
|
||||||
|
elseif($fs->exists($directory."/thumb/".$tmp["name"])) {
|
||||||
$data = file_get_contents($directory."/thumb/".$tmp["name"]);
|
$data = file_get_contents($directory."/thumb/".$tmp["name"]);
|
||||||
$tmp["thumb"]="data:image/" . $tmp["extension"] . ";base64," . base64_encode($data);
|
$tmp["thumb"]="data:image/" . $tmp["extension"] . ";base64," . base64_encode($data);
|
||||||
}
|
}
|
||||||
|
@ -1504,7 +1522,7 @@ class PagewidgetController extends Controller
|
||||||
|
|
||||||
if($fs->exists($directory)) {
|
if($fs->exists($directory)) {
|
||||||
$finder = new Finder();
|
$finder = new Finder();
|
||||||
$finder->sortByName()->in($directory)->exclude('thumb');
|
$finder->sortByName()->in($directory)->exclude('thumb')->exclude('thumbmini');
|
||||||
|
|
||||||
foreach ($finder as $file) {
|
foreach ($finder as $file) {
|
||||||
$tmp=[];
|
$tmp=[];
|
||||||
|
|
|
@ -244,26 +244,30 @@
|
||||||
{% block localjavascript %}
|
{% block localjavascript %}
|
||||||
var idpage;
|
var idpage;
|
||||||
$('document').ready(function(){
|
$('document').ready(function(){
|
||||||
{% for page in pagesadmin %}
|
{% if gotoroute is empty %}
|
||||||
{% if page.id==entity.id %}
|
{% for page in pagesadmin %}
|
||||||
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','portal');
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% for page in pagesuser %}
|
|
||||||
{% if page.id==entity.id %}
|
|
||||||
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','user');
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% for groupshared in groupsshared %}
|
|
||||||
{% for page in groupshared.pagesshared %}
|
|
||||||
{% if page.id==entity.id %}
|
{% if page.id==entity.id %}
|
||||||
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','group',true,{{groupshared.id}});
|
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','portal');
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
|
||||||
|
{% for page in pagesuser %}
|
||||||
|
{% if page.id==entity.id %}
|
||||||
|
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','user');
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for groupshared in groupsshared %}
|
||||||
|
{% for page in groupshared.pagesshared %}
|
||||||
|
{% if page.id==entity.id %}
|
||||||
|
showPage({{ page.id }}, {{ page.pagecategory.id }},'{{ page.canupdate }}','group',true,{{groupshared.id}});
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
var url="{{ path(gotoroute,{id:gotoid}) }}";
|
||||||
|
showGoto(url);
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
// Rendre les pages user déplacable
|
// Rendre les pages user déplacable
|
||||||
$("#pagesuser").sortable({
|
$("#pagesuser").sortable({
|
||||||
|
@ -391,9 +395,7 @@
|
||||||
// Affichages des pages
|
// Affichages des pages
|
||||||
function showPage(id,catid,canupdate,usage,forcereload,groupid) {
|
function showPage(id,catid,canupdate,usage,forcereload,groupid) {
|
||||||
// Sauvegarder la page en cours
|
// Sauvegarder la page en cours
|
||||||
idpage=id;
|
idpage=id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Cacher toutes les pages
|
// Cacher toutes les pages
|
||||||
$(".pageframereload").remove();
|
$(".pageframereload").remove();
|
||||||
|
@ -455,11 +457,19 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// On resize les frame
|
||||||
|
resizeFrame();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affichages des pages
|
||||||
|
function showGoto(url) {
|
||||||
|
$("#pagecontainer").append("<iframe id='goto' class='pageframe pageframereload' src='"+url+"' style='border:none; width:100%'></iframe>");
|
||||||
|
|
||||||
// On resize les frame
|
// On resize les frame
|
||||||
resizeFrame();
|
resizeFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function submitPage() {
|
function submitPage() {
|
||||||
var url="{{ path('cadoles_portal_'~access~'_page_submit') }}";
|
var url="{{ path('cadoles_portal_'~access~'_page_submit') }}";
|
||||||
$(location).attr('href',url);
|
$(location).attr('href',url);
|
||||||
|
|
|
@ -41,6 +41,7 @@ class onlyService
|
||||||
$folders=[];
|
$folders=[];
|
||||||
$tasks=[];
|
$tasks=[];
|
||||||
|
|
||||||
|
dump($idgroup);
|
||||||
$group=$this->em->getRepository("CadolesCoreBundle:Group")->find($idgroup);
|
$group=$this->em->getRepository("CadolesCoreBundle:Group")->find($idgroup);
|
||||||
if($group&&$group->getIdonlyoffice()) {
|
if($group&&$group->getIdonlyoffice()) {
|
||||||
if($this->only_activate) {
|
if($this->only_activate) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ use Gos\Bundle\WebSocketBundle\Router\WampRequest;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Gos\Bundle\WebSocketBundle\Client\ClientManipulatorInterface;
|
use Gos\Bundle\WebSocketBundle\Client\ClientManipulatorInterface;
|
||||||
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
|
||||||
use Cadoles\WebsocketBundle\Entity\Message;
|
use Cadoles\WebsocketBundle\Entity\Message;
|
||||||
|
|
||||||
|
@ -112,11 +113,15 @@ class WebsocketTopic implements TopicInterface
|
||||||
if(array_key_exists("mail",$event)) {
|
if(array_key_exists("mail",$event)) {
|
||||||
$mail = $this->container->get('cadoles.core.service.mail');
|
$mail = $this->container->get('cadoles.core.service.mail');
|
||||||
if($mail) {
|
if($mail) {
|
||||||
$cplt="<br><br><b>Attention ne répondez pas à ce mail : Pour répondre, rendez-vous dans ce groupe sur le portail et utilisez le fil de conversation (chat)</b><br>";
|
$pages=$group->getPages();
|
||||||
|
$pageid=$pages[0]->getId();
|
||||||
|
$cplt="<br><br><b>Attention pour répondre à ce message : n’utilisez pas votre mail mais rendez vous dans ce groupe sur Transnum et utilisez le fil de conversation (chat)</b><br>";
|
||||||
|
$url=$url = $this->container->get('router')->generate('cadoles_core_hone', ['id'=>$pageid], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||||
|
$cplturl="<br><a href='".$url."'>".$url."</a>";
|
||||||
$mail_params=array(
|
$mail_params=array(
|
||||||
"subject" => $event["subject"],
|
"subject" => $event["subject"],
|
||||||
"body_html"=>$event["message"].$cplt,
|
"body_html"=>$event["message"].$cplt.$cplturl,
|
||||||
"body_text"=>strip_tags($event["message"].$cplt)
|
"body_text"=>strip_tags($event["message"].$cplt.$url)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Transformer la liste des destinataires en tableau : [0] tjr vide on l'unset
|
// Transformer la liste des destinataires en tableau : [0] tjr vide on l'unset
|
||||||
|
|
Loading…
Reference in New Issue