preference user widgetshowhide (#203)
This commit is contained in:
parent
e029ad79a6
commit
0d06263227
|
@ -1206,6 +1206,42 @@ class UserController extends Controller
|
||||||
return new Response();
|
return new Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preferenceAction(Request $request) {
|
||||||
|
// S'assurer que c'est un appel ajax
|
||||||
|
if (!$request->isXmlHttpRequest()) {
|
||||||
|
return new JsonResponse(array('message' => 'Interdit'), 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
$key=$request->request->get('key');
|
||||||
|
$id=$request->request->get('id');
|
||||||
|
$value=$request->request->get('value');
|
||||||
|
|
||||||
|
$preference=$this->getUser()->getPreference();
|
||||||
|
$toupdate=false;
|
||||||
|
if(!array_key_exists($key,$preference)) {
|
||||||
|
$toupdate=true;
|
||||||
|
$preference[$key]=[];
|
||||||
|
}
|
||||||
|
if((!array_key_exists($id,$preference[$key]))) {
|
||||||
|
$toupdate=true;
|
||||||
|
$preference[$key][$id]=$value;
|
||||||
|
}
|
||||||
|
if($value&&$preference[$key][$id]!=$value) {
|
||||||
|
$toupdate=true;
|
||||||
|
$preference[$key][$id]=$value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mise à jour des préferences
|
||||||
|
if($toupdate) {
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$this->getUser()->setPreference($preference);
|
||||||
|
$em->persist($this->getUser());
|
||||||
|
$em->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Response();
|
||||||
|
}
|
||||||
|
|
||||||
protected function getDatas()
|
protected function getDatas()
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
|
@ -318,6 +318,11 @@ cadoles_core_user_viewcalendar:
|
||||||
path: /user/viewcalendar
|
path: /user/viewcalendar
|
||||||
defaults: { _controller: CadolesCoreBundle:User:viewcalendar }
|
defaults: { _controller: CadolesCoreBundle:User:viewcalendar }
|
||||||
|
|
||||||
|
cadoles_core_user_preference:
|
||||||
|
path: /user/preference
|
||||||
|
defaults: { _controller: CadolesCoreBundle:User:preference }
|
||||||
|
|
||||||
|
|
||||||
#== Niveau01 =============================================================================================================
|
#== Niveau01 =============================================================================================================
|
||||||
cadoles_core_config_niveau01:
|
cadoles_core_config_niveau01:
|
||||||
path: /config/niveau01
|
path: /config/niveau01
|
||||||
|
|
|
@ -5,6 +5,15 @@
|
||||||
min-height:0px !important;
|
min-height:0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container-fluid {
|
||||||
|
padding:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#explorer {
|
||||||
|
margin-right: -15px;
|
||||||
|
margin-left: -15px;
|
||||||
|
}
|
||||||
|
|
||||||
.grid .grid-list .grid-item-logo {
|
.grid .grid-list .grid-item-logo {
|
||||||
margin:0px;
|
margin:0px;
|
||||||
}
|
}
|
||||||
|
@ -213,10 +222,11 @@
|
||||||
|
|
||||||
|
|
||||||
function ajust(formodal) {
|
function ajust(formodal) {
|
||||||
|
|
||||||
|
|
||||||
if(inIframe()) {
|
if(inIframe()) {
|
||||||
if(!$("#frame-{{directory}}",window.parent.document).hasClass("notframeajust")) {
|
frame=$("#frame-{{directory}}",window.parent.document);
|
||||||
|
widgetbody=frame.parent();
|
||||||
|
|
||||||
|
if(!frame.hasClass("notframeajust")&&widgetbody.css("display")=="block") {
|
||||||
if($('#mymodal').hasClass('in')) {
|
if($('#mymodal').hasClass('in')) {
|
||||||
$("#frame-{{directory}}",window.parent.document).height($("#mymodal").find(".modal-content").height()+80);
|
$("#frame-{{directory}}",window.parent.document).height($("#mymodal").find(".modal-content").height()+80);
|
||||||
}
|
}
|
||||||
|
|
|
@ -386,6 +386,22 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getPreference(&$entity) {
|
||||||
|
$user=$this->getUser();
|
||||||
|
if($user) {
|
||||||
|
$preference=$user->getPreference();
|
||||||
|
$id=$entity->getId();
|
||||||
|
|
||||||
|
// Preference widgetshowhide
|
||||||
|
if(is_array($preference)) {
|
||||||
|
if(array_key_exists("widgetshowhide",$preference)) {
|
||||||
|
if(array_key_exists($id,$preference["widgetshowhide"]))
|
||||||
|
$entity->setOpened(($preference["widgetshowhide"][$id]=="true"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function viewurlAction($id,$access="config") {
|
public function viewurlAction($id,$access="config") {
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$entity = $em->getRepository($this->labelentity)->find($id);
|
$entity = $em->getRepository($this->labelentity)->find($id);
|
||||||
|
@ -402,12 +418,17 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Récupération des paramétres du widget
|
||||||
$url="";
|
$url="";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||||
if($parameter["id"]=="url")
|
if($parameter["id"]=="url")
|
||||||
$url=$parameter["value"];
|
$url=$parameter["value"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
|
|
||||||
// Gestion des url youtuve
|
// Gestion des url youtuve
|
||||||
$url=str_replace("http://www.youtube.com","https://www.youtube.com",$url);
|
$url=str_replace("http://www.youtube.com","https://www.youtube.com",$url);
|
||||||
$url=str_replace("https://www.youtube.com/watch?v=","https://www.youtube.com/embed/",$url);
|
$url=str_replace("https://www.youtube.com/watch?v=","https://www.youtube.com/embed/",$url);
|
||||||
|
@ -452,6 +473,7 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Récupération des paramétres du widget
|
||||||
$url="";
|
$url="";
|
||||||
$widgettype= $entity->getWidget();
|
$widgettype= $entity->getWidget();
|
||||||
$jsons=$widgettype->getParameter();
|
$jsons=$widgettype->getParameter();
|
||||||
|
@ -462,6 +484,9 @@ class PagewidgetController extends Controller
|
||||||
$url=$field->value;
|
$url=$field->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Gestion des url youtuve
|
// Gestion des url youtuve
|
||||||
$url=str_replace("http://www.youtube.com","https://www.youtube.com",$url);
|
$url=str_replace("http://www.youtube.com","https://www.youtube.com",$url);
|
||||||
$url=str_replace("https://www.youtube.com/watch?v=","https://www.youtube.com/embed/",$url);
|
$url=str_replace("https://www.youtube.com/watch?v=","https://www.youtube.com/embed/",$url);
|
||||||
|
@ -543,6 +568,8 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Profilage
|
// Profilage
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
|
@ -705,6 +732,8 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Profilage
|
// Profilage
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
|
@ -829,6 +858,8 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Profilage
|
// Profilage
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
|
@ -950,6 +981,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Profilage
|
// Profilage
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
|
$roles=($user?$user->getRoles():["ROLE_ANONYME"]);
|
||||||
|
@ -1208,6 +1242,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// On regarde si le flux a été lu il y a peu
|
// On regarde si le flux a été lu il y a peu
|
||||||
$toregen=true;
|
$toregen=true;
|
||||||
$filecache=$filecache='uploads/flux/widget-'.$id.'.txt';
|
$filecache=$filecache='uploads/flux/widget-'.$id.'.txt';
|
||||||
|
@ -1405,6 +1442,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Profilage
|
// Profilage
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
|
|
||||||
|
@ -1452,6 +1492,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewlink.html.twig', [
|
return $this->render($this->labelentity.':viewlink.html.twig', [
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
|
@ -1490,6 +1533,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':vieweditor.html.twig', [
|
return $this->render($this->labelentity.':vieweditor.html.twig', [
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
|
@ -1516,7 +1562,7 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parametres
|
// Récupération des paramétres du widget
|
||||||
$interval="2";
|
$interval="2";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
|
@ -1526,6 +1572,10 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
|
// Récupération des slides
|
||||||
$slides=$em->getRepository("CadolesPortalBundle:Slide")->findBy(["pagewidget"=>$entity],['roworder'=>'ASC','title'=>'ASC']);
|
$slides=$em->getRepository("CadolesPortalBundle:Slide")->findBy(["pagewidget"=>$entity],['roworder'=>'ASC','title'=>'ASC']);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
|
@ -1555,58 +1605,7 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Récupération des paramétres du widget
|
||||||
$directory=$this->get('kernel')->getRootDir()."/../uploads/file/widget-".$id;
|
|
||||||
|
|
||||||
$files=[];
|
|
||||||
$fs = new Filesystem();
|
|
||||||
|
|
||||||
if($fs->exists($directory)) {
|
|
||||||
$finder = new Finder();
|
|
||||||
$finder->depth('== 0')->sortByName()->in($directory)->exclude('thumb')->exclude('thumbmini');
|
|
||||||
|
|
||||||
foreach ($finder as $file) {
|
|
||||||
if(!is_dir($file)) {
|
|
||||||
$tmp=[];
|
|
||||||
$tmp["name"]=$file->getRelativePathname();
|
|
||||||
$tmp["extension"]=strtolower($file->getExtension());
|
|
||||||
$fileinfo = new file($file->getPathname());
|
|
||||||
$tmp["minetype"]=$fileinfo->getMimeType();
|
|
||||||
$tmp["minefamily"]=explode("/",$tmp["minetype"])[0];
|
|
||||||
|
|
||||||
$tmp["thumb"]="";
|
|
||||||
if($tmp["extension"]=="pdf") {
|
|
||||||
$tmp["thumb"]="/".$this->getParameter('alias')."/bundles/cadolescore/images/files/".$tmp["extension"].".png";
|
|
||||||
|
|
||||||
}
|
|
||||||
elseif($fs->exists($directory."/thumbmini/".$tmp["name"])) {
|
|
||||||
$data = file_get_contents($directory."/thumbmini/".$tmp["name"]);
|
|
||||||
$tmp["thumb"]="data:image/" . $tmp["extension"] . ";base64," . base64_encode($data);
|
|
||||||
}
|
|
||||||
elseif($fs->exists($directory."/thumb/".$tmp["name"])) {
|
|
||||||
$data = file_get_contents($directory."/thumb/".$tmp["name"]);
|
|
||||||
$tmp["thumb"]="data:image/" . $tmp["extension"] . ";base64," . base64_encode($data);
|
|
||||||
}
|
|
||||||
elseif($fs->exists($this->get('kernel')->getRootDir()."/../web/bundles/cadolescore/images/files/".$tmp["extension"].".png")) {
|
|
||||||
$tmp["thumb"]="/".$this->getParameter('alias')."/bundles/cadolescore/images/files/".$tmp["extension"].".png";
|
|
||||||
}
|
|
||||||
|
|
||||||
array_push($files,$tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Render
|
|
||||||
return $this->render($this->labelentity.':viewfile.html.twig', [
|
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => $canupdate,
|
|
||||||
'canupdate' => $canupdate,
|
|
||||||
'files' => $files,
|
|
||||||
'access' => $access,
|
|
||||||
]);
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Parametres
|
|
||||||
$view="small";
|
$view="small";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
|
@ -1616,6 +1615,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
return $this->render($this->labelentity.':viewfile.html.twig', [
|
return $this->render($this->labelentity.':viewfile.html.twig', [
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
'canadd' => $canupdate,
|
'canadd' => $canupdate,
|
||||||
|
@ -1645,6 +1647,9 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
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=[];
|
||||||
$fs = new Filesystem();
|
$fs = new Filesystem();
|
||||||
|
@ -1703,7 +1708,7 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parametres
|
// Récupération des paramétres du widget
|
||||||
$nbday="0";
|
$nbday="0";
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
|
@ -1713,6 +1718,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// 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($this->getUser(),$group);
|
$calendars=$em->getRepository("CadolesPortalBundle:Calendar")->getCalendarsGroup($this->getUser(),$group);
|
||||||
|
@ -1822,7 +1830,7 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parametres
|
// Récupération des paramétres du widget
|
||||||
$nbarticle=10;
|
$nbarticle=10;
|
||||||
foreach($entity->getParameter()["fields"] as $parameter) {
|
foreach($entity->getParameter()["fields"] as $parameter) {
|
||||||
switch($parameter["id"]) {
|
switch($parameter["id"]) {
|
||||||
|
@ -1832,6 +1840,9 @@ 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($usage=="group") {
|
||||||
$blogs=$em->getRepository("CadolesPortalBundle:Blog")->getBlogsGroup($this->getUser(),$group);
|
$blogs=$em->getRepository("CadolesPortalBundle:Blog")->getBlogsGroup($this->getUser(),$group);
|
||||||
|
@ -1846,6 +1857,8 @@ class PagewidgetController extends Controller
|
||||||
// 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);
|
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,0,$nbarticle,$count,$blogarticles);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewblog.html.twig', [
|
return $this->render($this->labelentity.':viewblog.html.twig', [
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
|
@ -1888,6 +1901,9 @@ 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($usage=="group") {
|
||||||
|
@ -1960,6 +1976,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewseparator.html.twig', [
|
return $this->render($this->labelentity.':viewseparator.html.twig', [
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
|
@ -1997,6 +2016,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
return $this->render($this->labelentity.':viewurl.html.twig', [
|
return $this->render($this->labelentity.':viewurl.html.twig', [
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
|
@ -2024,6 +2046,8 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
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->render($this->labelentity.':viewframe.html.twig', [
|
||||||
|
@ -2065,6 +2089,9 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
$user=$this->getUser();
|
$user=$this->getUser();
|
||||||
$items=[];
|
$items=[];
|
||||||
$itemcategorys=[];
|
$itemcategorys=[];
|
||||||
|
@ -2154,6 +2181,9 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
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;
|
||||||
|
@ -2218,6 +2248,9 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
|
|
||||||
if($usage!="group"||!$group) {
|
if($usage!="group"||!$group) {
|
||||||
$group=$em->getRepository("CadolesCoreBundle:Group")->findOneBy(["fgall"=>true])->getId();
|
$group=$em->getRepository("CadolesCoreBundle:Group")->findOneBy(["fgall"=>true])->getId();
|
||||||
}
|
}
|
||||||
|
@ -2256,6 +2289,9 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
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)) {
|
||||||
|
@ -2303,6 +2339,9 @@ class PagewidgetController extends Controller
|
||||||
if(!$cansee) throw $this->createNotFoundException('Permission denied');
|
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;
|
||||||
|
@ -2388,17 +2427,6 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
$onlyservice = $this->container->get('cadoles.portal.service.only');
|
|
||||||
$firstfolder=null;
|
|
||||||
$files=$onlyservice->getDocument($group, $firstfolder, $tasks);
|
|
||||||
|
|
||||||
$grp=null;
|
|
||||||
if($group) $grp=$em->getRepository("CadolesCoreBundle:Group")->find($group);
|
|
||||||
if($grp) $idonly= $grp->getIdOnlyoffice();
|
|
||||||
else $idonly=0;
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Récupération des paramétres du widget
|
// Récupération des paramétres du widget
|
||||||
$apponly=0;
|
$apponly=0;
|
||||||
$view="small";
|
$view="small";
|
||||||
|
@ -2413,21 +2441,8 @@ class PagewidgetController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Préference utilisateur
|
||||||
|
$this->getPreference($entity);
|
||||||
// Render
|
|
||||||
return $this->render($this->labelentity.':viewonlydoc.html.twig', [
|
|
||||||
'entity' => $entity,
|
|
||||||
'canadd' => $cansee,
|
|
||||||
'canupdate' => $cansee,
|
|
||||||
'firstfolder' => $firstfolder,
|
|
||||||
'tasks' => $tasks,
|
|
||||||
'urlonly' => $this->getParameter("widonlyoffice_url")."/products/projects/projects.aspx?prjID=".$idonly,
|
|
||||||
'apponly' => $apponly,
|
|
||||||
'files' => $files,
|
|
||||||
'access' => $access,
|
|
||||||
]);
|
|
||||||
*/
|
|
||||||
|
|
||||||
return $this->render($this->labelentity.':viewonlydoc.html.twig', [
|
return $this->render($this->labelentity.':viewonlydoc.html.twig', [
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
|
|
|
@ -5,6 +5,15 @@
|
||||||
min-height:0px !important;
|
min-height:0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container-fluid {
|
||||||
|
padding:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#explorer {
|
||||||
|
margin-right: -15px;
|
||||||
|
margin-left: -15px;
|
||||||
|
}
|
||||||
|
|
||||||
.grid .grid-list .grid-item-logo {
|
.grid .grid-list .grid-item-logo {
|
||||||
margin:0px;
|
margin:0px;
|
||||||
}
|
}
|
||||||
|
@ -193,7 +202,10 @@
|
||||||
|
|
||||||
function ajust(formodal) {
|
function ajust(formodal) {
|
||||||
if(inIframe()) {
|
if(inIframe()) {
|
||||||
if(!$("#frame-{{directory}}",window.parent.document).hasClass("notframeajust")) {
|
frame=$("#frame-{{directory}}",window.parent.document);
|
||||||
|
widgetbody=frame.parent();
|
||||||
|
|
||||||
|
if(!frame.hasClass("notframeajust")&&widgetbody.css("display")=="block") {
|
||||||
$("#frame-{{directory}}",window.parent.document).height($("#page-wrapper").height() + 10);
|
$("#frame-{{directory}}",window.parent.document).height($("#page-wrapper").height() + 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,13 +281,35 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function showhideWidget(elem) {
|
function showhideWidget(elem) {
|
||||||
|
widget=$(elem).parent().parent();
|
||||||
|
idwidget= widget.data("id");
|
||||||
|
if(widget.children(".widgetbody").css("display")=='block')
|
||||||
|
value=false;
|
||||||
|
else
|
||||||
|
value=true;
|
||||||
|
|
||||||
|
{% if app.user %}
|
||||||
|
$.ajax({
|
||||||
|
method: "POST",
|
||||||
|
url: "{{ path('cadoles_core_user_preference') }}",
|
||||||
|
data: {
|
||||||
|
id:idwidget,
|
||||||
|
key:'widgetshowhide',
|
||||||
|
value:value
|
||||||
|
},
|
||||||
|
success: function(idbookmark) {
|
||||||
// on récupère le parent widget conteneur
|
// on récupère le parent widget conteneur
|
||||||
widget=$(elem).parent().parent();
|
widget=$(elem).parent().parent();
|
||||||
|
//console.log(widget.children(".widgetbody").css("display"));
|
||||||
widget.children(".widgetbody" ).toggle();
|
widget.children(".widgetbody" ).toggle();
|
||||||
|
|
||||||
// On recalcule les grilles
|
// On recalcule les grilles
|
||||||
var grid = $('.grid').masonry(optiongrid);
|
var grid = $('.grid').masonry(optiongrid);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Modification de la localisation d'un widget
|
// Modification de la localisation d'un widget
|
||||||
function updateLocalisation() {
|
function updateLocalisation() {
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
<span class="title">{{ entity.name }}</span>
|
<span class="title">{{ entity.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="widgetbody" style="{{ stylewidgetbodyframe }}; overflow-y:auto; {%if entity.border %} padding-left: 10px; {%endif%}">
|
<div class="widgetbody" style="{{ stylewidgetbody }}; overflow-y:auto; {%if entity.border %} padding-left: 10px; {%endif%}">
|
||||||
{% if group is not null %}
|
{% if group is not null %}
|
||||||
{{ render(url('cadoles_websocket_chat',{'id':group,'framed':true,'border':entity.border,'colorbodybacklight':colorbodyback, 'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont,'colorbody':colorbody,'colormain':colormain})) }}
|
{{ render(url('cadoles_websocket_chat',{'id':group,'framed':true,'border':entity.border,'colorbodybacklight':colorbodyback, 'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont,'colorbody':colorbody,'colormain':colormain})) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -49,10 +49,8 @@
|
||||||
<span class="title">{{ entity.name }}</span>
|
<span class="title">{{ entity.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="widgetbody" style="{{ stylewidgetbodyframe }}">
|
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||||
|
|
||||||
<iframe id="frame-{{directory}}" src="{{ path("cadoles_core_"~access~"_file_list",{'directory':directory,'defaultview':view}) }}" data-color="#{{colorbodyfont}}" style="{{ stylewidgetbodyframe }}" class="{% if not entity.autoajust %}notframeajust {% endif %}"></iframe>
|
<iframe id="frame-{{directory}}" src="{{ path("cadoles_core_"~access~"_file_list",{'directory':directory,'defaultview':view}) }}" data-color="#{{colorbodyfont}}" style="{{ stylewidgetbodyframe }}" class="{% if not entity.autoajust %}notframeajust {% endif %}"></iframe>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<span class="title">{{ entity.name }}</span>
|
<span class="title">{{ entity.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="widgetbody" style="{{ stylewidgetbodyframe }}">
|
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
||||||
<iframe src="{{ path(tool) }}" class="{% if entity.autoajust %}frameajust {% endif %}" style="{{ stylewidgetbodyframe }}"></iframe>
|
<iframe src="{{ path(tool) }}" class="{% if entity.autoajust %}frameajust {% endif %}" style="{{ stylewidgetbodyframe }}"></iframe>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue