diff --git a/src/nineskeletor-1.0/src/Command/CronInitCommand.php b/src/nineskeletor-1.0/src/Command/CronInitCommand.php index 6c55ab4..fb75a33 100644 --- a/src/nineskeletor-1.0/src/Command/CronInitCommand.php +++ b/src/nineskeletor-1.0/src/Command/CronInitCommand.php @@ -59,17 +59,14 @@ class CronInitCommand extends Command protected function insertCron() { $metadata = $this->em->getClassMetaData('App:Cron'); - $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); - $metadata->setIdGenerator(new AssignedGenerator()); // Job Mail // Toute les minutes - $entity = $this->em->getRepository('App:Cron')->find(1); + $entity = $this->em->getRepository('App:Cron')->findOneBy(["command"=>"app:sendMail"]); if(!$entity) { $entity = new Cron; $entity->setCommand("app:sendMail"); $entity->setDescription("Execution du spool de mail en attente"); - $entity->setId(1); $entity->setStatut(2); $entity->setRepeatcall(0); $entity->setRepeatexec(0); @@ -81,14 +78,13 @@ class CronInitCommand extends Command // Job de purge des fichiers obsolète // Toute les 24h à 3h00 - $entity = $this->em->getRepository('App:Cron')->find(200); + $entity = $this->em->getRepository('App:Cron')->findOneBy(["command"=>"app:purgeFile"]); if(!$entity) { $entity = new Cron; $nextdate=$entity->getSubmitdate(); $nextdate->setTime(3,0); $entity->setCommand("app:purgeFile"); $entity->setDescription("Suppression des fichiers obsolètes"); - $entity->setId(200); $entity->setStatut(2); $entity->setRepeatcall(0); $entity->setRepeatexec(0); @@ -99,14 +95,13 @@ class CronInitCommand extends Command // Job synchronisation des comptes utilisateur // Toute les 24h à 3h00 - $entity = $this->em->getRepository('App:Cron')->find(100); + $entity = $this->em->getRepository('App:Cron')->findOneBy(["command"=>"app:synchroUsers"]); if(!$entity) { $entity = new Cron; $nextdate=$entity->getSubmitdate(); $nextdate->setTime(3,0); $entity->setCommand("app:synchroUsers"); $entity->setDescription("Synchronisation des comptes utilisateurs"); - $entity->setId(100); $entity->setStatut(2); $entity->setRepeatcall(0); $entity->setRepeatexec(0); @@ -118,14 +113,13 @@ class CronInitCommand extends Command // Job Dump // Toute les 24h à 2h00 - $entity = $this->em->getRepository('App:Cron')->find(220); + $entity = $this->em->getRepository('App:Cron')->findOneBy(["command"=>"app:dumpBdd"]); if(!$entity) { $entity = new Cron; $nextdate=$entity->getSubmitdate(); $nextdate->setTime(2,0); $entity->setCommand("app:dumpBdd"); $entity->setDescription("Sauvegarde de la BDD"); - $entity->setId(220); $entity->setStatut(2); $entity->setRepeatcall(0); $entity->setRepeatexec(0); diff --git a/src/nineskeletor-1.0/src/Command/SynchroUsersCommand.php b/src/nineskeletor-1.0/src/Command/SynchroUsersCommand.php index 2e72c94..42ec8b2 100644 --- a/src/nineskeletor-1.0/src/Command/SynchroUsersCommand.php +++ b/src/nineskeletor-1.0/src/Command/SynchroUsersCommand.php @@ -228,17 +228,12 @@ class SynchroUsersCommand extends Command } } - if(!$simulate) { - $this->em->clear(); - } - if($nbusers%1000==0) $this->writeln(" == Nombre d'utilisateurs traités = $nbusers sur $nbuserstotal =="); } if(!$simulate) { $this->writeln(" == Nombre d'utilisateurs traités = $nbusers sur $nbuserstotal =="); $this->em->flush(); - $this->em->clear(); } foreach($tberrors as $error) { @@ -348,7 +343,6 @@ class SynchroUsersCommand extends Command unset($flipped[$data["username"]]); } - $this->em->clear(); if($nbusers%1000==0) $this->writelnred(" == Nombre d'utilisateurs traités = $nbusers=="); } diff --git a/src/nineskeletor-1.0/src/Form/ActivityType.php b/src/nineskeletor-1.0/src/Form/ActivityType.php deleted file mode 100644 index 462b1f0..0000000 --- a/src/nineskeletor-1.0/src/Form/ActivityType.php +++ /dev/null @@ -1,143 +0,0 @@ -add('submit', - SubmitType::class, [ - "label" => "Valider", - "attr" => ["class" => "btn btn-success"], - ] - ); - - if($options["status"]==0) { - $builder->add('distribution', - SubmitType::class, [ - "label" => "Distribuer", - "attr" => [ - "class" => "btn btn-success", - "data-method" => "submit", - "data-confirm" => "Confirmez vous la distribution de l'activité ? Une foi validée, vous ne pourrez plus modifier son entête et son énoncé." ], - ] - ); - } - - if($options["status"]==1) { - $builder->add('archiving', - SubmitType::class, [ - "label" => "Archiver", - "attr" => [ - "class" => "btn btn-danger float-right", - "data-method" => "submit", - "data-confirm" => "Confirmez vous l'archivage' de l'activité ?" ], - ] - ); - } - - if($options["status"]==10) { - $builder->add('distribution', - SubmitType::class, [ - "label" => "Réouvrir", - "attr" => [ - "class" => "btn btn-success", - "data-method" => "submit", - "data-confirm" => "Confirmez vous la réouverture de l'activité ?" ], - ] - ); - } - - $builder->add('name', - TextType::class, [ - "disabled" => ($options["status"]>0), - "label" =>"Nom", - ] - ); - - $builder->add('subject', - TextType::class, [ - "disabled" => ($options["status"]>0), - "required" => false, - "label" =>"Matière", - ] - ); - - $builder->add('group', - Select2EntityType::class, [ - "label" => "Groupe", - "disabled" => ($options["status"]>0), - "required" => true, - "multiple" => false, - "remote_route" => "app_group_select", - "class" => "App:Group", - "primary_key" => "id", - "text_property" => "name", - "minimum_input_length" => 0, - "page_limit" => 100, - "allow_clear" => true, - "delay" => 250, - "cache" => false, - "cache_timeout" => 60000, - "language" => "fr", - "placeholder" => "Selectionner un Groupe", - ] - ); - - $builder->add('activity', - CKEditorType::class, [ - "disabled" => ($options["status"]>0), - "required" => false, - "config" => [ - 'uiColor' => '#ffffff', - 'height' => 600, - 'filebrowserUploadRoute' => 'app_ckeditor_upload', - 'language' => 'fr', - ], - ] - ); - - $builder->add('corrected', - CKEditorType::class, [ - "disabled" => ($options["status"]==10), - "required" => false, - "config" => [ - 'uiColor' => '#ffffff', - 'height' => 600, - 'filebrowserUploadRoute' => 'app_ckeditor_upload', - 'language' => 'fr', - ], - ] - ); - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults(array( - 'data_class' => 'App\Entity\Activity', - 'mode' => 'string', - 'status' => 'integer', - )); - } -} diff --git a/src/nineskeletor-1.0/src/Form/ActivitymessageType.php b/src/nineskeletor-1.0/src/Form/ActivitymessageType.php deleted file mode 100644 index 6f34989..0000000 --- a/src/nineskeletor-1.0/src/Form/ActivitymessageType.php +++ /dev/null @@ -1,81 +0,0 @@ -add('submit', - SubmitType::class, [ - "label" => "Envoyer", - "attr" => ["class" => "btn btn-success"], - ] - ); - - $builder->add('message', - CKEditorType::class, [ - "mapped" => false, - "required" => true, - "config_name" => 'small_config', - "config" => [ - 'uiColor' => '#ffffff', - 'height' => 150, - 'filebrowserUploadRoute' => 'app_ckeditor_upload', - 'language' => 'fr', - ], - ] - ); - - $builder->add('answers', - Select2EntityType::class, [ - "label" => "Elèves", - "mapped" => false, - "required" => true, - "multiple" => true, - "remote_route" => "app_answer_select", - "remote_params" => ["activity"=>$options["id"]], - "class" => "App:Answer", - "primary_key" => "id", - "text_property" => "displayname", - "minimum_input_length" => 0, - "page_limit" => 100, - "allow_clear" => true, - "delay" => 250, - "cache" => false, - "cache_timeout" => 60000, - "language" => "fr", - "placeholder" => "Selectionner des élèves", - ] - ); - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults(array( - 'data_class' => 'App\Entity\Activity', - 'mode' => 'string', - 'id' => 'integer', - )); - } -} diff --git a/src/nineskeletor-1.0/src/Form/AnswerType.php b/src/nineskeletor-1.0/src/Form/AnswerType.php deleted file mode 100644 index 487c234..0000000 --- a/src/nineskeletor-1.0/src/Form/AnswerType.php +++ /dev/null @@ -1,71 +0,0 @@ -add('submit', - SubmitType::class, [ - "label" => "Valider", - "attr" => ["class" => "btn btn-success"], - ] - ); - - if($options["status"]<10 && $options["activitystatus"] == 1) { - $builder->add('returned', - SubmitType::class, [ - "label" => "Rendre l'activité", - "attr" => [ - "class" => "btn btn-success", - "data-method" => "submit", - "data-confirm" => "Confirmez vous ? Une foi rendues, vous ne pourrez plus modifier l'activité."], - ] - ); - } - - $builder->add('answer', - CKEditorType::class, [ - "disabled" => ($options["status"]>=10||$options["activitystatus"]!=1), - "required" => false, - "config" => [ - 'uiColor' => '#ffffff', - 'height' => 400, - 'filebrowserUploadRoute' => 'app_ckeditor_upload', - 'language' => 'fr', - ], - ] - ); - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults(array( - 'data_class' => 'App\Entity\Answer', - 'mode' => 'string', - 'status' => 'integer', - 'activitystatus' => 'integer' - )); - } -} diff --git a/src/nineskeletor-1.0/src/Form/CorrectedType.php b/src/nineskeletor-1.0/src/Form/CorrectedType.php deleted file mode 100644 index 4a000ad..0000000 --- a/src/nineskeletor-1.0/src/Form/CorrectedType.php +++ /dev/null @@ -1,83 +0,0 @@ -add('submit', - SubmitType::class, [ - "label" => "Valider", - "attr" => ["class" => "btn btn-success"], - ] - ); - - if($options["status"]>=10 && $options["status"]<15 && $options["activitystatus"]==1) { - $builder->add('corrected', - SubmitType::class, [ - "label" => "Rendre le corrigé", - "attr" => [ - "class" => "btn btn-success", - "data-method" => "submit", - "data-confirm" => "Confirmez vous ? Une foi corrigé, vous ne pourrez plus modifier l'activité."], - ] - ); - - $builder->add('canceled', - SubmitType::class, [ - "label" => "Permettre à l'élève de revoir sa copie", - "attr" => [ - "class" => "btn btn-danger", - "data-method" => "submit", - "data-confirm" => "Confirmez vous ? L'élève pourra modifier de nouveau son activité."], - ] - ); - } - - if($options["status"]>=10) { - $builder->add('answercorrected', - CKEditorType::class, [ - "disabled" => ($options["status"]>=15 || $options["activitystatus"]!=1), - "required" => false, - "config" => [ - 'uiColor' => '#ffffff', - 'height' => 400, - 'filebrowserUploadRoute' => 'app_ckeditor_upload', - 'language' => 'fr', - ], - ] - ); - } - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults(array( - 'data_class' => 'App\Entity\Answer', - 'mode' => 'string', - 'status' => 'integer', - 'activitystatus' => 'integer' - )); - } -} diff --git a/src/nineskeletor-1.0/src/Form/DocumentType.php b/src/nineskeletor-1.0/src/Form/DocumentType.php deleted file mode 100644 index 861fe55..0000000 --- a/src/nineskeletor-1.0/src/Form/DocumentType.php +++ /dev/null @@ -1,62 +0,0 @@ -add('submit', - SubmitType::class, [ - "label" => "Valider", - "attr" => ["class" => "btn btn-success no-print"], - ] - ); - - $builder->add('name', - TextType::class, [ - "label" =>"Nom", - ] - ); - - $builder->add('description', - CKEditorType::class, [ - "required" => false, - "config" => [ - 'uiColor' => '#ffffff', - 'height' => 300, - 'filebrowserUploadRoute' => 'app_ckeditor_upload', - 'language' => 'fr', - ], - ] - ); - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults(array( - 'data_class' => 'App\Entity\Document', - 'mode' => 'string', - )); - } -} diff --git a/src/nineskeletor-1.0/src/Form/MessageType.php b/src/nineskeletor-1.0/src/Form/MessageType.php deleted file mode 100644 index a71d908..0000000 --- a/src/nineskeletor-1.0/src/Form/MessageType.php +++ /dev/null @@ -1,52 +0,0 @@ -add('message', - CKEditorType::class, [ - "disabled" => ($options["status"]>=10), - "required" => false, - "config_name" => 'small_config', - "config" => [ - 'uiColor' => '#ffffff', - 'height' => 150, - 'filebrowserUploadRoute' => 'app_ckeditor_upload', - 'language' => 'fr', - ], - ] - ); - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults(array( - 'data_class' => 'App\Entity\Message', - 'mode' => 'string', - 'status' => 'integer', - )); - } -} diff --git a/src/nineskeletor-1.0/templates/Cron/edit.html.twig b/src/nineskeletor-1.0/templates/Cron/edit.html.twig new file mode 100644 index 0000000..91b6c8f --- /dev/null +++ b/src/nineskeletor-1.0/templates/Cron/edit.html.twig @@ -0,0 +1,59 @@ + +{% extends 'base.html.twig' %} + +{% block body %} +{{ form_start(form) }} +