Skip to content
Snippets Groups Projects
Commit 5ddc4dc2 authored by Robin Mounié's avatar Robin Mounié
Browse files

Email in logs and keep the database : step-1-Install the new version without...

Email in logs and keep the database : step-1-Install the new version without uninstall the oldest; step-2-Unistal the oldest
parent ffc0f75c
Branches
Tags
No related merge requests found
define([
"local_notemyprogress/axios",
"local_notemyprogress/alertify",
], function (Axios, Alertify) {
const emailform = {
template: `
<v-main mt-10>
<v-row>
<v-col sm="12">
<v-dialog
v-model="dialog"
width="800"
@click:outside="closeDialog()"
@keydown.esc="closeDialog()"
>
<v-card>
<v-toolbar color="#118AB2" dark>
<span v-text="emailform_title"></span>
<v-spacer></v-spacer>
<v-btn icon @click="reset">
<v-icon v-text="close_icon"></v-icon>
</v-btn>
</v-toolbar>
<v-container>
<v-row>
<v-col cols="12" sm="12">
<v-chip class="ma-2" color="#118AB2" label dark>
<span v-text="recipients"></span>
</v-chip>
<template v-for="(user, index, key) in selected_users">
<v-chip class="ma-2">
<v-avatar left>
<img :src="get_picture_url(user.id)">
</v-avatar>
<span>{{user.firstname}} {{user.lastname}}</span>
</v-chip>
</template>
</v-col>
</v-row>
<v-row>
<v-col cols="12" sm="12">
<v-form ref="form" v-model="valid_form">
<v-text-field
v-model="strings.subject"
:label="subject_label"
:rules="subject_rules"
required
solo
></v-text-field>
<v-textarea
v-model="message"
:label="message_label"
:rules="message_rules"
required
solo
></v-textarea>
<v-btn @click="submit" :disabled="!valid_form">
<span v-text="submit_button"></span>
</v-btn>
<v-btn @click="reset">
<span v-text="cancel_button"></span>
</v-btn>
<v-spacer></v-spacer>
</v-form>
</v-col>
</v-row>
</v-container>
</v-card>
</v-dialog>
</v-col>
</v-row>
<v-row>
<v-col sm="12">
<div class="text-center">
<v-dialog
v-model="loader_dialog"
persistent
width="300"
>
<v-card color="#118AB2" dark>
<v-card-text>
<span v-text="sending_text"></span>
<v-progress-linear
indeterminate
color="white"
class="mb-0"
></v-progress-linear>
</v-card-text>
</v-card>
</v-dialog>
</div>
</v-col>
</v-row>
</v-main>
`,
props: [
"dialog",
"selected_users",
"strings",
"moduleid",
"modulename",
"courseid",
"userid",
],
data() {
return {
close_icon: "mdi-minus",
valid_form: true,
subject_label: this.strings.subject_label,
subject_rules: [(v) => !!v || this.strings.validation_subject_text],
message: "",
message_label: this.strings.message_label,
message_rules: [(v) => !!v || this.strings.validation_message_text],
submit_button: this.strings.submit_button,
cancel_button: this.strings.cancel_button,
emailform_title: this.strings.emailform_title,
sending_text: this.strings.sending_text,
recipients: this.strings.recipients_label,
loader_dialog: false,
mailsended_text: this.strings.mailsended_text,
};
},
methods: {
get_picture_url(userid) {
let url = `${M.cfg.wwwroot}/user/pix.php?file=/${userid}/f1.jpg`;
return url;
},
submit() {
let recipients = "";
this.selected_users.forEach((item) => {
recipients = recipients.concat(item.id, ",");
});
this.loader_dialog = true;
this.errors = [];
let data = {
action: "sendmail",
subject: this.strings.subject,
recipients: recipients,
text: this.message,
userid: this.userid,
courseid: this.courseid,
moduleid: this.moduleid,
modulename: this.modulename,
};
Axios({
method: "get",
url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php",
params: data,
})
.then((response) => {
if (response.status == 200 && response.data.ok) {
this.$emit("update_dialog", false);
this.$refs.form.reset();
Alertify.success(this.mailsended_text);
if (typeof this.$parent.$root.addLogsIntoDB === "function") {
this.$parent.$root.addLogsIntoDB(
"SendedTo : " + this.selected_users[0].email,
this.$parent.$root.email_object_name,
"email",
"Sent an email"
);
}
} else {
Alertify.error(this.strings.api_error_network);
this.loader_dialog = false;
}
})
.catch((e) => {
Alertify.error(this.strings.api_error_network);
})
.finally(() => {
this.loader_dialog = false;
});
},
reset() {
this.$emit("update_dialog", false);
this.$refs.form.resetValidation();
},
closeDialog() {
this.$emit("update_dialog", false);
},
},
};
return emailform;
});
define([
"local_notemyprogress/axios",
"local_notemyprogress/alertify",
], function (e, n) {
return {
template:
'\n <v-main mt-10>\n <v-row>\n <v-col sm="12">\n <v-dialog\n v-model="dialog"\n width="800"\n @click:outside="closeDialog()"\n @keydown.esc="closeDialog()"\n >\n <v-card>\n <v-toolbar color="#118AB2" dark>\n <span v-text="emailform_title"></span>\n <v-spacer></v-spacer>\n <v-btn icon @click="reset">\n <v-icon v-text="close_icon"></v-icon>\n </v-btn>\n </v-toolbar>\n \n <v-container>\n <v-row>\n <v-col cols="12" sm="12">\n \n <v-chip class="ma-2" color="#118AB2" label dark>\n <span v-text="recipients"></span>\n </v-chip>\n \n <template v-for="(user, index, key) in selected_users">\n <v-chip class="ma-2">\n <v-avatar left>\n <img :src="get_picture_url(user.id)">\n </v-avatar>\n <span>{{user.firstname}} {{user.lastname}}</span>\n </v-chip>\n </template>\n \n </v-col>\n </v-row>\n \n <v-row>\n <v-col cols="12" sm="12">\n <v-form ref="form" v-model="valid_form">\n <v-text-field\n v-model="strings.subject"\n :label="subject_label"\n :rules="subject_rules"\n required\n solo\n ></v-text-field>\n \n <v-textarea\n v-model="message"\n :label="message_label"\n :rules="message_rules"\n required\n solo\n ></v-textarea>\n \n <v-btn @click="submit" :disabled="!valid_form">\n <span v-text="submit_button"></span>\n </v-btn>\n \n <v-btn @click="reset">\n <span v-text="cancel_button"></span>\n </v-btn>\n \n <v-spacer></v-spacer>\n \n </v-form>\n </v-col>\n </v-row>\n </v-container>\n \n </v-card>\n </v-dialog>\n </v-col>\n </v-row>\n \n <v-row>\n <v-col sm="12">\n <div class="text-center">\n <v-dialog\n v-model="loader_dialog"\n persistent\n width="300"\n >\n <v-card color="#118AB2" dark>\n <v-card-text>\n <span v-text="sending_text"></span>\n <v-progress-linear\n indeterminate\n color="white"\n class="mb-0"\n ></v-progress-linear>\n </v-card-text>\n </v-card>\n </v-dialog>\n </div>\n </v-col>\n </v-row>\n </v-main>\n ',
props: [
"dialog",
"selected_users",
"strings",
"moduleid",
"modulename",
"courseid",
"userid",
],
data() {
return {
close_icon: "mdi-minus",
valid_form: !0,
subject_label: this.strings.subject_label,
subject_rules: [(e) => !!e || this.strings.validation_subject_text],
message: "",
message_label: this.strings.message_label,
message_rules: [(e) => !!e || this.strings.validation_message_text],
submit_button: this.strings.submit_button,
cancel_button: this.strings.cancel_button,
emailform_title: this.strings.emailform_title,
sending_text: this.strings.sending_text,
recipients: this.strings.recipients_label,
loader_dialog: !1,
mailsended_text: this.strings.mailsended_text,
};
},
methods: {
get_picture_url: (e) => `${M.cfg.wwwroot}/user/pix.php?file=/${e}/f1.jpg`,
submit() {
let t = "";
this.selected_users.forEach((e) => {
t = t.concat(e.id, ",");
}),
(this.loader_dialog = !0),
(this.errors = []);
let s = {
action: "sendmail",
subject: this.strings.subject,
recipients: t,
text: this.message,
userid: this.userid,
courseid: this.courseid,
moduleid: this.moduleid,
modulename: this.modulename,
};
e({
method: "get",
url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php",
params: s,
})
.then((e) => {
200 == e.status && e.data.ok
? (this.$emit("update_dialog", !1),
this.$refs.form.reset(),
n.success(this.mailsended_text),
"function" == typeof this.$parent.$root.addLogsIntoDB &&
this.$parent.$root.addLogsIntoDB(
"sended",
this.$parent.$root.email_object_name,
"email",
"Sended an email"
))
: (n.error(this.strings.api_error_network),
(this.loader_dialog = !1));
})
.catch((e) => {
n.error(this.strings.api_error_network);
})
.finally(() => {
this.loader_dialog = !1;
});
},
reset() {
this.$emit("update_dialog", !1), this.$refs.form.resetValidation();
},
closeDialog() {
this.$emit("update_dialog", !1);
},
},
};
});
//# sourceMappingURL=emailform.min.js.map
{
"version": 3,
"sources": [
"../src/emailform.js"
],
"names": [
"define",
"Axios",
"Alertify",
"template",
"props",
"data",
"close_icon",
"valid_form",
"subject_label",
"strings",
"subject_rules",
"v",
"validation_subject_text",
"message",
"message_label",
"message_rules",
"validation_message_text",
"submit_button",
"cancel_button",
"emailform_title",
"sending_text",
"recipients",
"recipients_label",
"loader_dialog",
"mailsended_text",
"methods",
"get_picture_url",
"userid",
"url",
"M",
"cfg",
"wwwroot",
"submit",
"selected_users",
"forEach",
"item",
"concat",
"id",
"errors",
"action",
"subject",
"text",
"courseid",
"moduleid",
"modulename",
"method",
"params",
"then",
"response",
"status",
"ok",
"$emit",
"$refs",
"form",
"reset",
"success",
"error",
"api_error_network",
"catch",
"finally",
"resetValidation",
"closeDialog"
],
"mappings": "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",
"sourcesContent": [
"define([\r\n \"local_notemyprogress/axios\",\r\n \"local_notemyprogress/alertify\",\r\n ],\r\n function (Axios, Alertify){\r\n const emailform = {\r\n template:`\r\n <v-main mt-10>\r\n <v-row>\r\n <v-col sm=\"12\">\r\n <v-dialog\r\n v-model=\"dialog\"\r\n width=\"800\"\r\n @click:outside=\"closeDialog()\"\r\n @keydown.esc=\"closeDialog()\"\r\n >\r\n <v-card>\r\n <v-toolbar color=\"#118AB2\" dark>\r\n <span v-text=\"emailform_title\"></span>\r\n <v-spacer></v-spacer>\r\n <v-btn icon @click=\"reset\">\r\n <v-icon v-text=\"close_icon\"></v-icon>\r\n </v-btn>\r\n </v-toolbar>\r\n \r\n <v-container>\r\n <v-row>\r\n <v-col cols=\"12\" sm=\"12\">\r\n \r\n <v-chip class=\"ma-2\" color=\"#118AB2\" label dark>\r\n <span v-text=\"recipients\"></span>\r\n </v-chip>\r\n \r\n <template v-for=\"(user, index, key) in selected_users\">\r\n <v-chip class=\"ma-2\">\r\n <v-avatar left>\r\n <img :src=\"get_picture_url(user.id)\">\r\n </v-avatar>\r\n <span>{{user.firstname}} {{user.lastname}}</span>\r\n </v-chip>\r\n </template>\r\n \r\n </v-col>\r\n </v-row>\r\n \r\n <v-row>\r\n <v-col cols=\"12\" sm=\"12\">\r\n <v-form ref=\"form\" v-model=\"valid_form\">\r\n <v-text-field\r\n v-model=\"strings.subject\"\r\n :label=\"subject_label\"\r\n :rules=\"subject_rules\"\r\n required\r\n solo\r\n ></v-text-field>\r\n \r\n <v-textarea\r\n v-model=\"message\"\r\n :label=\"message_label\"\r\n :rules=\"message_rules\"\r\n required\r\n solo\r\n ></v-textarea>\r\n \r\n <v-btn @click=\"submit\" :disabled=\"!valid_form\">\r\n <span v-text=\"submit_button\"></span>\r\n </v-btn>\r\n \r\n <v-btn @click=\"reset\">\r\n <span v-text=\"cancel_button\"></span>\r\n </v-btn>\r\n \r\n <v-spacer></v-spacer>\r\n \r\n </v-form>\r\n </v-col>\r\n </v-row>\r\n </v-container>\r\n \r\n </v-card>\r\n </v-dialog>\r\n </v-col>\r\n </v-row>\r\n \r\n <v-row>\r\n <v-col sm=\"12\">\r\n <div class=\"text-center\">\r\n <v-dialog\r\n v-model=\"loader_dialog\"\r\n persistent\r\n width=\"300\"\r\n >\r\n <v-card color=\"#118AB2\" dark>\r\n <v-card-text>\r\n <span v-text=\"sending_text\"></span>\r\n <v-progress-linear\r\n indeterminate\r\n color=\"white\"\r\n class=\"mb-0\"\r\n ></v-progress-linear>\r\n </v-card-text>\r\n </v-card>\r\n </v-dialog>\r\n </div>\r\n </v-col>\r\n </v-row>\r\n </v-main>\r\n `,\r\n props:['dialog', 'selected_users', 'strings', 'moduleid', 'modulename', 'courseid', 'userid'],\r\n data(){\r\n return {\r\n close_icon: 'mdi-minus',\r\n valid_form: true,\r\n subject_label: this.strings.subject_label,\r\n subject_rules: [\r\n v => !!v || this.strings.validation_subject_text,\r\n ],\r\n message: '',\r\n message_label: this.strings.message_label,\r\n message_rules: [\r\n v => !!v || this.strings.validation_message_text,\r\n ],\r\n submit_button: this.strings.submit_button,\r\n cancel_button: this.strings.cancel_button,\r\n emailform_title: this.strings.emailform_title,\r\n sending_text: this.strings.sending_text,\r\n recipients: this.strings.recipients_label,\r\n\r\n loader_dialog: false,\r\n mailsended_text: this.strings.mailsended_text,\r\n }\r\n },\r\n methods : {\r\n get_picture_url(userid){\r\n let url = `${M.cfg.wwwroot}/user/pix.php?file=/${userid}/f1.jpg`;\r\n return url;\r\n },\r\n\r\n submit () {\r\n let recipients = \"\";\r\n this.selected_users.forEach(item => {\r\n recipients=recipients.concat(item.id,\",\");\r\n });\r\n this.loader_dialog = true;\r\n this.errors = [];\r\n let data = {\r\n action : \"sendmail\",\r\n subject : this.strings.subject,\r\n recipients : recipients,\r\n text : this.message,\r\n userid : this.userid,\r\n courseid : this.courseid,\r\n moduleid : this.moduleid,\r\n modulename : this.modulename,\r\n };\r\n Axios({\r\n method:'get',\r\n url: M.cfg.wwwroot + \"/local/notemyprogress/ajax.php\",\r\n params : data,\r\n }).then((response) => {\r\n if (response.status == 200 && response.data.ok) {\r\n this.$emit('update_dialog', false);\r\n this.$refs.form.reset();\r\n Alertify.success(this.mailsended_text);\r\n } else {\r\n Alertify.error(this.strings.api_error_network);\r\n this.loader_dialog = false;\r\n }\r\n }).catch((e) => {\r\n Alertify.error(this.strings.api_error_network);\r\n }).finally(() => {\r\n this.loader_dialog = false;\r\n });\r\n },\r\n\r\n reset () {\r\n this.$emit('update_dialog', false);\r\n this.$refs.form.resetValidation();\r\n },\r\n\r\n closeDialog() {\r\n this.$emit('update_dialog', false);\r\n }\r\n },\r\n }\r\n return emailform;\r\n})"
],
"file": "emailform.min.js"
}
define([ define([
"local_notemyprogress/axios", "local_notemyprogress/axios",
"local_notemyprogress/alertify", "local_notemyprogress/alertify",
], ], function (Axios, Alertify) {
function (Axios, Alertify){ const emailform = {
const emailform = { template: `
template:`
<v-main mt-10> <v-main mt-10>
<v-row> <v-row>
<v-col sm="12"> <v-col sm="12">
...@@ -106,85 +105,101 @@ define([ ...@@ -106,85 +105,101 @@ define([
</v-row> </v-row>
</v-main> </v-main>
`, `,
props:['dialog', 'selected_users', 'strings', 'moduleid', 'modulename', 'courseid', 'userid'], props: [
data(){ "dialog",
return { "selected_users",
close_icon: 'mdi-minus', "strings",
valid_form: true, "moduleid",
subject_label: this.strings.subject_label, "modulename",
subject_rules: [ "courseid",
v => !!v || this.strings.validation_subject_text, "userid",
], ],
message: '', data() {
message_label: this.strings.message_label, return {
message_rules: [ close_icon: "mdi-minus",
v => !!v || this.strings.validation_message_text, valid_form: true,
], subject_label: this.strings.subject_label,
submit_button: this.strings.submit_button, subject_rules: [(v) => !!v || this.strings.validation_subject_text],
cancel_button: this.strings.cancel_button, message: "",
emailform_title: this.strings.emailform_title, message_label: this.strings.message_label,
sending_text: this.strings.sending_text, message_rules: [(v) => !!v || this.strings.validation_message_text],
recipients: this.strings.recipients_label, submit_button: this.strings.submit_button,
cancel_button: this.strings.cancel_button,
emailform_title: this.strings.emailform_title,
sending_text: this.strings.sending_text,
recipients: this.strings.recipients_label,
loader_dialog: false, loader_dialog: false,
mailsended_text: this.strings.mailsended_text, mailsended_text: this.strings.mailsended_text,
} };
}, },
methods : { methods: {
get_picture_url(userid){ get_picture_url(userid) {
let url = `${M.cfg.wwwroot}/user/pix.php?file=/${userid}/f1.jpg`; let url = `${M.cfg.wwwroot}/user/pix.php?file=/${userid}/f1.jpg`;
return url; return url;
}, },
submit () { submit() {
let recipients = ""; let recipients = "";
this.selected_users.forEach(item => { this.selected_users.forEach((item) => {
recipients=recipients.concat(item.id,","); recipients = recipients.concat(item.id, ",");
}); });
this.loader_dialog = true; this.loader_dialog = true;
this.errors = []; this.errors = [];
let data = { let data = {
action : "sendmail", action: "sendmail",
subject : this.strings.subject, subject: this.strings.subject,
recipients : recipients, recipients: recipients,
text : this.message, text: this.message,
userid : this.userid, userid: this.userid,
courseid : this.courseid, courseid: this.courseid,
moduleid : this.moduleid, moduleid: this.moduleid,
modulename : this.modulename, modulename: this.modulename,
}; };
Axios({ Axios({
method:'get', method: "get",
url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php",
params : data, params: data,
}).then((response) => { })
if (response.status == 200 && response.data.ok) { .then((response) => {
this.$emit('update_dialog', false); if (response.status == 200 && response.data.ok) {
this.$refs.form.reset(); this.$emit("update_dialog", false);
Alertify.success(this.mailsended_text); this.$refs.form.reset();
if(typeof this.$parent.$root.addLogsIntoDB === "function") { Alertify.success(this.mailsended_text);
this.$parent.$root.addLogsIntoDB("sent", this.$parent.$root.email_object_name, "email", "Sent an email"); if (typeof this.$parent.$root.addLogsIntoDB === "function") {
} this.$parent.$root.addLogsIntoDB(
} else { "SendedTo(" +
Alertify.error(this.strings.api_error_network); this.email_object_name +
this.loader_dialog = false; "," +
} this.email_users +
}).catch((e) => { ")",
Alertify.error(this.strings.api_error_network); this.$parent.$root.email_object_name,
}).finally(() => { "email",
this.loader_dialog = false; "Sent an email"
}); );
}, }
} else {
Alertify.error(this.strings.api_error_network);
this.loader_dialog = false;
}
})
.catch((e) => {
Alertify.error(this.strings.api_error_network);
})
.finally(() => {
this.loader_dialog = false;
});
},
reset () { reset() {
this.$emit('update_dialog', false); this.$emit("update_dialog", false);
this.$refs.form.resetValidation(); this.$refs.form.resetValidation();
}, },
closeDialog() { closeDialog() {
this.$emit('update_dialog', false); this.$emit("update_dialog", false);
} },
}, },
} };
return emailform; return emailform;
}) });
\ No newline at end of file
...@@ -211,7 +211,7 @@ class student extends report ...@@ -211,7 +211,7 @@ class student extends report
if (!empty($weekcode)) { if (!empty($weekcode)) {
$week = self::find_week($weekcode); $week = self::find_week($weekcode);
} }
//Framboise
$work_sessions = self::get_work_sessions($week->weekstart, $week->weekend); $work_sessions = self::get_work_sessions($week->weekstart, $week->weekend);
$sessions = array_map(function ($user_sessions) { $sessions = array_map(function ($user_sessions) {
return $user_sessions->sessions; return $user_sessions->sessions;
......
...@@ -140,5 +140,52 @@ function xmldb_local_notemyprogress_install() ...@@ -140,5 +140,52 @@ function xmldb_local_notemyprogress_install()
$answer->questionid = $questionid; $answer->questionid = $questionid;
$answer->enunciated = 'answers_number_four_option_four'; $answer->enunciated = 'answers_number_four_option_four';
$DB->insert_record("notemyprogress_answers", $answer, true); $DB->insert_record("notemyprogress_answers", $answer, true);
// TODO : rename the table FlipLearning to NoteMyProgress to keep the data from the versions older than 4.0
//* fliplearning_clustering -> notemyprogress_clustering
//* fliplearning_instances -> notemyprogress_instances
//* fliplearning_logs -> notemyprogress_logs
//* fliplearning_sections -> notemyprogress_sections
//* fliplearning_weeks -> notemyprogress_weeks
//? Algorithm idea :
//? Initial state : table generated normally and old tables potentially present
//? 1 : vefrifier if exist the old tables (Fliplearning)
//? 2 : If they exist drop the new similar tables
//? 3 : rename the old tables like the news that we have just deleted
try{
$table1 = $DB->get_record_sql("SELECT count(*) from {fliplearning_clustering}");
$DB->execute("DROP TABLE {notemyprogress_clustering}");
$DB->execute("RENAME TABLE {fliplearning_clustering} TO {notemyprogress_clustering}");
}catch(Exception $e){
//this table do not exist
}
try{
$table1 = $DB->get_record_sql("SELECT count(*) from {fliplearning_instances}");
$DB->execute("DROP TABLE {notemyprogress_instances}");
$DB->execute("RENAME TABLE {fliplearning_instances} TO {notemyprogress_instances}");
}catch(Exception $e){
//this table do not exist
}
try{
$table1 = $DB->get_record_sql("SELECT count(*) from {fliplearning_logs}");
$DB->execute("DROP TABLE {notemyprogress_logs}");
$DB->execute("RENAME TABLE {fliplearning_logs} TO {notemyprogress_logs}");
}catch(Exception $e){
//this table do not exist
}
try{
$table1 = $DB->get_record_sql("SELECT count(*) from {fliplearning_sections}");
$DB->execute("DROP TABLE {notemyprogress_sections}");
$DB->execute("RENAME TABLE {fliplearning_sections} TO {notemyprogress_sections}");
}catch(Exception $e){
//this table do not exist
}
try{
$table1 = $DB->get_record_sql("SELECT count(*) from {fliplearning_weeks}");
$DB->execute("DROP TABLE {notemyprogress_weeks}");
$DB->execute("RENAME TABLE {fliplearning_weeks} TO {notemyprogress_weeks}");
}catch(Exception $e){
//this table do not exist
}
} }
\ No newline at end of file
...@@ -76,7 +76,6 @@ $content = [ ...@@ -76,7 +76,6 @@ $content = [
"user_grades_help_description_p1" => get_string("sg_user_grades_help_description_p1", "local_notemyprogress"), "user_grades_help_description_p1" => get_string("sg_user_grades_help_description_p1", "local_notemyprogress"),
"user_grades_help_description_p2" => get_string("sg_user_grades_help_description_p2", "local_notemyprogress"), "user_grades_help_description_p2" => get_string("sg_user_grades_help_description_p2", "local_notemyprogress"),
"user_grades_help_description_p3" => get_string("sg_user_grades_help_description_p3", "local_notemyprogress"), "user_grades_help_description_p3" => get_string("sg_user_grades_help_description_p3", "local_notemyprogress"),
"title" => get_string("menu_general", "local_notemyprogress"), "title" => get_string("menu_general", "local_notemyprogress"),
"chart" => $reports->get_chart_langs(), "chart" => $reports->get_chart_langs(),
"no_data" => get_string("no_data", "local_notemyprogress"), "no_data" => get_string("no_data", "local_notemyprogress"),
...@@ -86,6 +85,7 @@ $content = [ ...@@ -86,6 +85,7 @@ $content = [
"helplabel" => get_string("helplabel", "local_notemyprogress"), "helplabel" => get_string("helplabel", "local_notemyprogress"),
"exitbutton" => get_string("exitbutton", "local_notemyprogress"), "exitbutton" => get_string("exitbutton", "local_notemyprogress"),
"about" => get_string("nmp_about", "local_notemyprogress"), "about" => get_string("nmp_about", "local_notemyprogress"),
"weeks" => array( "weeks" => array(
get_string("nmp_week1", "local_notemyprogress"), get_string("nmp_week1", "local_notemyprogress"),
get_string("nmp_week2", "local_notemyprogress"), get_string("nmp_week2", "local_notemyprogress"),
...@@ -94,6 +94,7 @@ $content = [ ...@@ -94,6 +94,7 @@ $content = [
get_string("nmp_week5", "local_notemyprogress"), get_string("nmp_week5", "local_notemyprogress"),
get_string("nmp_week6", "local_notemyprogress"), get_string("nmp_week6", "local_notemyprogress"),
), ),
"modules_strings" => array( "modules_strings" => array(
"title" => get_string("nmp_modules_access_chart_title","local_notemyprogress"), "title" => get_string("nmp_modules_access_chart_title","local_notemyprogress"),
"modules_no_viewed" => get_string("nmp_modules_no_viewed","local_notemyprogress"), "modules_no_viewed" => get_string("nmp_modules_no_viewed","local_notemyprogress"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment