From 11f4958e5fa710ad34b8e5cd7d254879a8a56c2e Mon Sep 17 00:00:00 2001 From: root Date: Sun, 9 Jun 2019 10:45:24 +0200 Subject: [PATCH] svg transnum --- .../Command/PurgeRegistrationCommand.php | 2 - .../CoreBundle/Command/data/core-init-01.sql | 10 ++--- .../CronBundle/Command/CronCommand.php | 13 +++++++ .../Command/GetLimesurveyCommand.php | 39 ++++++++++--------- .../Controller/PagewidgetController.php | 6 ++- .../Pagewidget/viewappexternal.html.twig | 4 -- src/ninegate-1.0/todo.txt | 3 ++ 7 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeRegistrationCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeRegistrationCommand.php index 211b26fc..8cb4b3c3 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeRegistrationCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeRegistrationCommand.php @@ -47,8 +47,6 @@ class PurgeRegistrationCommand extends Command $now=new \DateTime('now'); - $this->writeln(''); - $this->writeln('== PURGE OBSOLETE REGISTRATION ======================'); $datas = $this->em ->createQueryBuilder() 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 392383a6..9867f3f3 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,8 +8,8 @@ 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}m0Uhk7yyXr8ha3c/7sugfU5RJVTQ1nYp -', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}NkKjK3fXfmGDKmwfTtA11qPwVFmE3SsW +', 'admin@transnum.cadol.es', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); @@ -72,6 +72,6 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type ('060', 1, 1, 1, 'font', 'fontfacetitle', 'Anton-Regular', '', 'Police des titres de votre site'), ('061', 1, 1, 1, 'font', 'fontfacebody', 'Helvetica', '', 'Police des titres de votre site'), -('200', 1, 0, 1, 'boolean', 'PROXYactivate', '1', '', 'Définit un Proxy'), -('201', 1, 0, 1, 'string', 'PROXYserver', '192.168.57.160', 'PROXYactivate','Adresse du Proxy'), -('202', 1, 0, 1, 'string', 'PROXYport', '8080', 'PROXYactivate','Port du Proxy'); +('200', 1, 0, 1, 'boolean', 'PROXYactivate', '0', '', 'Définit un Proxy'), +('201', 1, 0, 1, 'string', 'PROXYserver', '', 'PROXYactivate','Adresse du Proxy'), +('202', 1, 0, 1, 'string', 'PROXYport', '', 'PROXYactivate','Port du Proxy'); diff --git a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php index 4d85d56d..ef0984b2 100644 --- a/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CronBundle/Command/CronCommand.php @@ -40,6 +40,12 @@ class CronCommand extends ContainerAwareCommand return false; } + if($this->filesystem->exists($this->rootlog."cron.lock")) { + return false; + } + + $this->filesystem->appendToFile($this->rootlog.'cron.lock', "lock"); + $crons = $entityManager->getRepository('CadolesCronBundle:Cron')->toexec(); $i=0; @@ -114,6 +120,13 @@ class CronCommand extends ContainerAwareCommand $entityManager->persist($cron); $entityManager->flush(); } + + $this->writelnred("=="); + $this->writelnred("FIN CRON"); + $this->writelnred("=="); + $this->writelnred(""); + + $this->filesystem->remove($this->rootlog."cron.lock"); } private function writelnred($string) { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/GetLimesurveyCommand.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/GetLimesurveyCommand.php index ce71e24d..1818b57b 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/GetLimesurveyCommand.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/GetLimesurveyCommand.php @@ -354,7 +354,8 @@ class GetLimesurveyCommand extends Command $this->em = $this->container->get('doctrine')->getEntityManager(); $this->output = $output; $this->filesystem = new Filesystem(); - $this->rootfile = $this->container->get('kernel')->getRootDir()."/../uploads/limesurvey"; + $this->limefile = $this->container->get('kernel')->getRootDir()."/../uploads/limesurvey"; + $this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/"; $alias = $this->container->getParameter('alias'); $activate_widlimesurvey = $this->container->getParameter('activate_widlimesurvey'); @@ -392,7 +393,7 @@ class GetLimesurveyCommand extends Command $fs = new Filesystem(); // On supprime les potentiels yml.new restant - $fs->remove($this->rootfile.'-new'); + $fs->remove($this->limefile.'-new'); // list de l'ensemble des sondages invité $surveys= $myJSONRPCClient->list_surveys($sessionKey); @@ -409,10 +410,10 @@ class GetLimesurveyCommand extends Command if(isset($user["participant_info"]["email"]) && $user["participant_info"]["email"]!="") { $entity = $this->em->getRepository('CadolesCoreBundle:User')->findOneBy(["email"=>$user["participant_info"]["email"]]); if($entity) { - $surveypropconf = $myJSONRPCClient->get_survey_properties($sessionKey,$survey["sid"],["datecreated"]); - $surveyproplang = $myJSONRPCClient->get_language_properties($sessionKey,$survey["sid"],["surveyls_welcometext"]); - $surveydescription = $surveyproplang["surveyls_welcometext"]; - $surveydescription=str_replace("\r","",str_replace("\n","",$surveydescription)); + $surveypropconf = $myJSONRPCClient->get_survey_properties($sessionKey,$survey["sid"],["datecreated"]); + $surveyproplang = $myJSONRPCClient->get_language_properties($sessionKey,$survey["sid"],["surveyls_welcometext"]); + $surveydescription = $surveyproplang["surveyls_welcometext"]; + $surveydescription = json_encode(str_replace("\r","",str_replace("\n","",$surveydescription))); $token=$user["token"]; $url=$widlimesurvey_url."/".$survey_id; @@ -420,13 +421,13 @@ class GetLimesurveyCommand extends Command $url.="?token=".$token; $string ='"'.$survey["sid"].'": {'; - $string.='"title": "'.$survey["surveyls_title"].'",'; + $string.='"title": '.json_encode($survey["surveyls_title"]).','; $string.='"url": "'.$url.'",'; $string.='"date": "'.$surveypropconf["datecreated"].'",'; - $string.='"description": "'.$surveydescription.'"'; + $string.='"description": '.$surveydescription; $string.='},'; - $this->filesystem->appendToFile($this->rootfile.'-new/'.$entity->getId().'/invitation.json', $string."\n"); + $this->filesystem->appendToFile($this->limefile.'-new/'.$entity->getId().'/invitation.json', $string."\n"); } } } @@ -443,21 +444,21 @@ class GetLimesurveyCommand extends Command if(is_array($survey)) { if($survey["active"]=="Y") { - $surveypropconf = $myJSONRPCClient->get_survey_properties($sessionKey,$survey["sid"],["datecreated"]); - $surveyproplang = $myJSONRPCClient->get_language_properties($sessionKey,$survey["sid"],["surveyls_welcometext"]); - $surveydescription = $surveyproplang["surveyls_welcometext"]; - $surveydescription=str_replace("\r","",str_replace("\n","",$surveydescription)); + $surveypropconf = $myJSONRPCClient->get_survey_properties($sessionKey,$survey["sid"],["datecreated"]); + $surveyproplang = $myJSONRPCClient->get_language_properties($sessionKey,$survey["sid"],["surveyls_welcometext"]); + $surveydescription = $surveyproplang["surveyls_welcometext"]; + $surveydescription = json_encode(str_replace("\r","",str_replace("\n","",$surveydescription))); $url=$widlimesurvey_url."/admin/survey/sa/view/surveyid/".$survey["sid"]; $string ='"'.$survey["sid"].'": {'; - $string.='"title": "'.$survey["surveyls_title"].'",'; + $string.='"title": '.json_encode($survey["surveyls_title"]).','; $string.='"url": "'.$url.'",'; $string.='"date": "'.$surveypropconf["datecreated"].'",'; - $string.='"description": "'.$surveydescription.'"'; + $string.='"description": '.$surveydescription; $string.='},'; - $this->filesystem->appendToFile($this->rootfile.'-new/'.$user->getId().'/survey.json', $string."\n"); + $this->filesystem->appendToFile($this->limefile.'-new/'.$user->getId().'/survey.json', $string."\n"); } } } @@ -465,15 +466,15 @@ class GetLimesurveyCommand extends Command } // On supprime les encours pour le remplacer le new - $fs->remove($this->rootfile); - $fs->rename($this->rootfile.'-new',$this->rootfile); + $fs->remove($this->limefile); + $fs->rename($this->limefile.'-new',$this->limefile); // release the session key $myJSONRPCClient->release_session_key( $sessionKey ); // essai /* - $essai=file_get_contents($this->rootfile.'/-100/survey.json'); + $essai=file_get_contents($this->limefile.'/-100/survey.json'); $json = substr($essai, 0, -2); // sup dernier , $decodedArray = json_decode("{".$json."}", true); dump($decodedArray); 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 503dae12..a79f1a3b 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -1533,8 +1533,10 @@ class PagewidgetController extends Controller $file=file_get_contents($directory."/survey.json"); $json = substr($file, 0, -2); // sup dernier , $surveys = json_decode("{".$json."}", true); - 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(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"]); + } } break; diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewappexternal.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewappexternal.html.twig index d0556461..ea485eaa 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewappexternal.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewappexternal.html.twig @@ -31,10 +31,6 @@ {% endif %} - - {% if canadd %} - - {% endif %} {% endif %} diff --git a/src/ninegate-1.0/todo.txt b/src/ninegate-1.0/todo.txt index 4eb5098c..956e2ad9 100644 --- a/src/ninegate-1.0/todo.txt +++ b/src/ninegate-1.0/todo.txt @@ -21,4 +21,7 @@ > Séparateur milier sur datatable +> Cron faire un système de lock +> Limesurvey s'assurer des quotes doubles quotes dans le titre +