From 098ed2432c84fc7609122dfa5fbc0cb654e3435f Mon Sep 17 00:00:00 2001
From: Yoshi5123 <alexis.duval2002@gmail.com>
Date: Mon, 30 May 2022 15:23:57 +0200
Subject: [PATCH] Planification update. Goals added.

---
 notemyprogress/db/install.php                   |  6 +++---
 notemyprogress/lang/en/local_notemyprogress.php |  4 ++++
 notemyprogress/lang/es/local_notemyprogress.php |  4 ++++
 notemyprogress/lang/fr/local_notemyprogress.php |  5 +++++
 notemyprogress/lib.php                          | 10 +++++-----
 notemyprogress/metareflexion.php                |  4 +++-
 notemyprogress/templates/metareflexion.mustache |  2 +-
 7 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/notemyprogress/db/install.php b/notemyprogress/db/install.php
index db2fce7..f882841 100644
--- a/notemyprogress/db/install.php
+++ b/notemyprogress/db/install.php
@@ -35,9 +35,9 @@ function xmldb_local_notemyprogress_install()
     $goal1 = new stdClass();
     $goal2 = new stdClass();
     $goal3 = new stdClass();
-    $goal1->description = "objectif 1";
-    $goal2->description = "objectif 2";
-    $goal3->description = "objectif 3";
+    $goal1->description = "goal1";
+    $goal2->description = "goal2";
+    $goal3->description = "goal3";
     $DB->insert_record("notemyprogress_goals_ct", $goal1, true);
     $DB->insert_record("notemyprogress_goals_ct", $goal2, true);
     $DB->insert_record("notemyprogress_goals_ct", $goal3, true);
diff --git a/notemyprogress/lang/en/local_notemyprogress.php b/notemyprogress/lang/en/local_notemyprogress.php
index d13e8d9..7ee9497 100644
--- a/notemyprogress/lang/en/local_notemyprogress.php
+++ b/notemyprogress/lang/en/local_notemyprogress.php
@@ -866,6 +866,10 @@ $string['set_weeks_title'] = "Setting up the course weeks";
 $string['set_weeks'] = "Configuration of the course weeks";
 
 /*Metareflexion*/
+$string['metareflexion_goal1'] = "Learning something new";
+$string['metareflexion_goal2'] = "Reviewing what I’ve learned";
+$string['metareflexion_goal3'] = "Plan my learning";
+
 $string['metareflexion_no_modules_in_section'] = "This week has no modules";
 $string['compare_with_course'] = "Compare my results with those of my colleagues";
 $string['sr_menu_metareflexion'] = "Metareflexion";
diff --git a/notemyprogress/lang/es/local_notemyprogress.php b/notemyprogress/lang/es/local_notemyprogress.php
index b77fd6a..736ea37 100644
--- a/notemyprogress/lang/es/local_notemyprogress.php
+++ b/notemyprogress/lang/es/local_notemyprogress.php
@@ -868,6 +868,10 @@ $string['notes_message_not_updated'] = 'No se ha podido actualizar la nota.';
 
 
 /*Metareflexion*/
+$string['metareflexion_goal1'] = "Aprender cosas nuevas";
+$string['metareflexion_goal2'] = "Repasando lo que he visto";
+$string['metareflexion_goal3'] = "Planificar mi aprendizaje";
+
 $string['metareflexion_no_modules_in_section'] = "Esta semana no hay módulos";
 $string['compare_with_course'] = "Comparar mis resultados con los de mis compañeros";
 $string['sr_menu_metareflexion'] = "Metareflexión";
diff --git a/notemyprogress/lang/fr/local_notemyprogress.php b/notemyprogress/lang/fr/local_notemyprogress.php
index 94e199c..b83d976 100644
--- a/notemyprogress/lang/fr/local_notemyprogress.php
+++ b/notemyprogress/lang/fr/local_notemyprogress.php
@@ -869,6 +869,11 @@ $string['notes_message_updated'] = "La note a été mise à jour";
 $string['notes_message_not_updated'] = "Note n'a pas pu être mise à jour'";
 
 /*Metareflexion*/
+
+$string['metareflexion_goal1'] = "Apprendre de nouvelles choses";
+$string['metareflexion_goal2'] = "Revoir ce que j'ai vu";
+$string['metareflexion_goal3'] = "Planifier mon apprentissage";
+
 $string['metareflexion_no_modules_in_section'] = "Cette semaine n'as pas de modules";
 $string['compare_with_course'] = "Comparer mes résultats avec ceux de mes collègues";
 $string['sr_menu_metareflexion'] = "Méta-réflexion";
diff --git a/notemyprogress/lib.php b/notemyprogress/lib.php
index 95b9ec7..ef55353 100644
--- a/notemyprogress/lib.php
+++ b/notemyprogress/lib.php
@@ -114,11 +114,11 @@ function local_notemyprogress_render_navbar_output(\renderer_base $renderer)
         array_push($items, local_notemyprogress_new_menu_item(s($text), $url));
     }
 
-    if (has_capability('local/notemyprogress:teacher_planning', $context) && $configuration_is_set) {
-        $text = get_string('menu_planning', 'local_notemyprogress');
-        $url = new moodle_url('/local/notemyprogress/metareflexion.php?courseid=' . $COURSE->id);
-        array_push($items, local_notemyprogress_new_menu_item(s($text), $url));
-    }
+    // if (has_capability('local/notemyprogress:teacher_planning', $context) && $configuration_is_set) {
+    //     $text = get_string('menu_planning', 'local_notemyprogress');
+    //     $url = new moodle_url('/local/notemyprogress/metareflexion.php?courseid=' . $COURSE->id);
+    //     array_push($items, local_notemyprogress_new_menu_item(s($text), $url));
+    // }
 
     if (has_capability('local/notemyprogress:student_planning', $context) && !is_siteadmin() && $configuration_is_set) {
         $text = get_string('menu_planning', 'local_notemyprogress');
diff --git a/notemyprogress/metareflexion.php b/notemyprogress/metareflexion.php
index e7908d4..9fae941 100644
--- a/notemyprogress/metareflexion.php
+++ b/notemyprogress/metareflexion.php
@@ -179,7 +179,9 @@ $content = [
         "goals_reflexion_title" => get_string("metareflexion_goals_reflexion_title", "local_notemyprogress"),
         "title_hours_plan" => get_string("metareflexion_title_hours_plan", "local_notemyprogress"),
         "title_retrospective" => get_string("metareflexion_title_retrospective", "local_notemyprogress"),
-        "no_modules_in_section" => get_string("metareflexion_no_modules_in_section", "local_notemyprogress"),
+        "goal1" => get_string("metareflexion_goal1", "local_notemyprogress"),
+        "goal2" => get_string("metareflexion_goal2", "local_notemyprogress"),
+        "goal3" => get_string("metareflexion_goal3", "local_notemyprogress"),
 
     ),
     //'indicators' => $reports->get_general_indicators(),
diff --git a/notemyprogress/templates/metareflexion.mustache b/notemyprogress/templates/metareflexion.mustache
index 1f8e7b8..9720e6f 100644
--- a/notemyprogress/templates/metareflexion.mustache
+++ b/notemyprogress/templates/metareflexion.mustache
@@ -35,7 +35,7 @@
                   <v-row v-for="(goal,index,key) in current_week[0].goals_categories" :key="key">
                     <v-col sm="8" offset-sm="2" class="pa-0">
                         <v-layout column>
-                            <v-checkbox :input-value="get_goal(goal.id)" :label="goal.description"  @change="update_goal(goal.id,$event)"></v-checkbox>
+                            <v-checkbox :input-value="get_goal(goal.id)" :label="strings[goal.description]"  @change="update_goal(goal.id,$event)"></v-checkbox>
                         </v-layout>
                       </v-col>
                   </v-row>
-- 
GitLab