This commit is contained in:
root 2019-06-11 16:09:02 +02:00
parent 3988986d60
commit ada20f01f6
3 changed files with 22 additions and 18 deletions

View File

@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES
(-100, 'DRAAF', '130007107'); (-100, 'DRAAF', '130007107');
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES 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'); ', 'admin@transnum.cadol.es', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');

View File

@ -17,17 +17,19 @@ class FeedController extends Controller
$feeds=[]; $feeds=[];
$fs = new Filesystem(); $fs = new Filesystem();
$file=file_get_contents($directory."/invitation.json"); if($fs->exists($directory."/invitation.json")) {
$json = substr($file, 0, -2); // sup dernier , $file=file_get_contents($directory."/invitation.json");
$surveys = json_decode("{".$json."}", true); $json = substr($file, 0, -2); // sup dernier ,
foreach($surveys as $id => $survey) { $surveys = json_decode("{".$json."}", true);
array_push($feeds,[ foreach($surveys as $id => $survey) {
"id"=>$id, array_push($feeds,[
"title"=>$survey["title"], "id"=>$id,
"url"=>$survey["url"], "title"=>$survey["title"],
"date"=>$survey["date"], "url"=>$survey["url"],
"description"=>$survey["description"], "date"=>$survey["date"],
"category"=>"limesurvey"]); "description"=>$survey["description"],
"category"=>"limesurvey"]);
}
} }
$response = new Response($this->renderView('CadolesPortalBundle:Feed:index.xml.twig',array( $response = new Response($this->renderView('CadolesPortalBundle:Feed:index.xml.twig',array(

View File

@ -1530,12 +1530,14 @@ class PagewidgetController extends Controller
$files=[]; $files=[];
$fs = new Filesystem(); $fs = new Filesystem();
$file=file_get_contents($directory."/survey.json"); if($fs->exists($directory."/survey.json")) {
$json = substr($file, 0, -2); // sup dernier , $file=file_get_contents($directory."/survey.json");
$surveys = json_decode("{".$json."}", true); $json = substr($file, 0, -2); // sup dernier ,
if(is_array($surveys)) { $surveys = json_decode("{".$json."}", true);
foreach($surveys as $id => $survey) { if(is_array($surveys)) {
array_push($items,["id"=>$id,"title"=>$survey["title"],"subtitle"=>"Sondage","url"=>$survey["url"],"itemcategory"=>$category,"color"=>"328637","icon"=>"icon_limesurvey.png"]); 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"]);
}
} }
} }