From ada20f01f6e3934a6feb650e613dfc0b50cb05d6 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 11 Jun 2019 16:09:02 +0200 Subject: [PATCH] svg --- .../CoreBundle/Command/data/core-init-01.sql | 2 +- .../Controller/FeedController.php | 24 ++++++++++--------- .../Controller/PagewidgetController.php | 14 ++++++----- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql index 9867f3f3..fe450887 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql @@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES (-100, 'DRAAF', '130007107'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}NkKjK3fXfmGDKmwfTtA11qPwVFmE3SsW +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}/Ord89DmD7WPXj/gZEt7CEvzfhNztOLv ', 'admin@transnum.cadol.es', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/FeedController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/FeedController.php index 6415736b..c0ffb450 100755 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/FeedController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/FeedController.php @@ -17,17 +17,19 @@ class FeedController extends Controller $feeds=[]; $fs = new Filesystem(); - $file=file_get_contents($directory."/invitation.json"); - $json = substr($file, 0, -2); // sup dernier , - $surveys = json_decode("{".$json."}", true); - foreach($surveys as $id => $survey) { - array_push($feeds,[ - "id"=>$id, - "title"=>$survey["title"], - "url"=>$survey["url"], - "date"=>$survey["date"], - "description"=>$survey["description"], - "category"=>"limesurvey"]); + if($fs->exists($directory."/invitation.json")) { + $file=file_get_contents($directory."/invitation.json"); + $json = substr($file, 0, -2); // sup dernier , + $surveys = json_decode("{".$json."}", true); + foreach($surveys as $id => $survey) { + array_push($feeds,[ + "id"=>$id, + "title"=>$survey["title"], + "url"=>$survey["url"], + "date"=>$survey["date"], + "description"=>$survey["description"], + "category"=>"limesurvey"]); + } } $response = new Response($this->renderView('CadolesPortalBundle:Feed:index.xml.twig',array( diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php index a79f1a3b..65468423 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -1530,12 +1530,14 @@ class PagewidgetController extends Controller $files=[]; $fs = new Filesystem(); - $file=file_get_contents($directory."/survey.json"); - $json = substr($file, 0, -2); // sup dernier , - $surveys = json_decode("{".$json."}", true); - if(is_array($surveys)) { - foreach($surveys as $id => $survey) { - array_push($items,["id"=>$id,"title"=>$survey["title"],"subtitle"=>"Sondage","url"=>$survey["url"],"itemcategory"=>$category,"color"=>"328637","icon"=>"icon_limesurvey.png"]); + if($fs->exists($directory."/survey.json")) { + $file=file_get_contents($directory."/survey.json"); + $json = substr($file, 0, -2); // sup dernier , + $surveys = json_decode("{".$json."}", true); + if(is_array($surveys)) { + foreach($surveys as $id => $survey) { + array_push($items,["id"=>$id,"title"=>$survey["title"],"subtitle"=>"Sondage","url"=>$survey["url"],"itemcategory"=>$category,"color"=>"328637","icon"=>"icon_limesurvey.png"]); + } } }