Compare commits
No commits in common. "master" and "release-1.0.0" have entirely different histories.
master
...
release-1.
|
@ -1,8 +1,8 @@
|
||||||
/* eslint no-var: "error" */
|
/*eslint no-var: "error" */
|
||||||
/* eslint no-unused-vars: "off" */
|
/*eslint no-unused-vars: "off" */
|
||||||
/* eslint linebreak-style: "off" */
|
/*eslint linebreak-style: "off" */
|
||||||
/* eslint no-trailing-spaces: "off" */
|
/*eslint no-trailing-spaces: "off" */
|
||||||
/* eslint-env es6*/
|
/*eslint-env es6*/
|
||||||
// Put this file in path/to/plugin/amd/src
|
// Put this file in path/to/plugin/amd/src
|
||||||
// You can call it anything you like
|
// You can call it anything you like
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import RVComponents from 'local_treestudyplan/report-viewer-components';
|
||||||
import TSComponents from 'local_treestudyplan/treestudyplan-components';
|
import TSComponents from 'local_treestudyplan/treestudyplan-components';
|
||||||
import Debugger from 'local_treestudyplan/util/debugger';
|
import Debugger from 'local_treestudyplan/util/debugger';
|
||||||
|
|
||||||
import {loadStrings} from 'local_treestudyplan/util/string-helper';
|
import {load_strings} from 'local_treestudyplan/util/string-helper';
|
||||||
import {ProcessStudyplans} from 'local_treestudyplan/studyplan-processor';
|
import {ProcessStudyplans} from 'local_treestudyplan/studyplan-processor';
|
||||||
|
|
||||||
import PortalVue from 'local_treestudyplan/portal-vue/portal-vue.esm';
|
import PortalVue from 'local_treestudyplan/portal-vue/portal-vue.esm';
|
||||||
|
@ -28,7 +28,7 @@ Vue.use(BootstrapVue);
|
||||||
let debug = new Debugger("mytreestudyplan");
|
let debug = new Debugger("mytreestudyplan");
|
||||||
debug.enable();
|
debug.enable();
|
||||||
|
|
||||||
let strings = loadStrings({
|
let strings = load_strings({
|
||||||
studyplan: {
|
studyplan: {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -42,15 +42,60 @@ let strings = loadStrings({
|
||||||
* @param {string} type Type of page to show
|
* @param {string} type Type of page to show
|
||||||
* @param {Object} arg Arguments passed
|
* @param {Object} arg Arguments passed
|
||||||
*/
|
*/
|
||||||
export function init(type = "own", arg) {
|
export function init(type="myreport",arg) {
|
||||||
// Save time by only starting up the Vue app if the required block element is present
|
// Save time by only starting up the Vue app if the required block element is present
|
||||||
const blockelement = document.getElementById('block_mytreestudyplan');
|
const blockelement = document.getElementById('block_mytreestudyplan');
|
||||||
if (blockelement) {
|
if(blockelement){
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
el: '#block_mytreestudyplan',
|
el: '#block_mytreestudyplan',
|
||||||
data: {
|
data: {
|
||||||
"studyplans": [],
|
"studyplans": [],
|
||||||
"type": type,
|
},
|
||||||
|
mounted() {
|
||||||
|
let call_method;
|
||||||
|
let call_args;
|
||||||
|
if(type == "teacher"){
|
||||||
|
call_method = 'local_treestudyplan_get_teacher_studyplan';
|
||||||
|
call_args = {};
|
||||||
|
}
|
||||||
|
else if(type == "teaching"){
|
||||||
|
call_method = 'local_treestudyplan_get_teaching_studyplans';
|
||||||
|
call_args = {};
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
call_method = 'local_treestudyplan_get_own_studyplan';
|
||||||
|
call_args = {};
|
||||||
|
}
|
||||||
|
call([{
|
||||||
|
methodname: call_method,
|
||||||
|
args: call_args
|
||||||
|
}])[0].done(function(response){
|
||||||
|
debug.info("Studyplans:",response);
|
||||||
|
const timingval = { future: 0, present: 1, past: 2, };
|
||||||
|
response.sort((a,b) => {
|
||||||
|
const timinga = TSComponents.studyplanTiming(a);
|
||||||
|
const timingb = TSComponents.studyplanTiming(b);
|
||||||
|
|
||||||
|
let t = timingval[timinga] - timingval[timingb];
|
||||||
|
if(t == 0){
|
||||||
|
// sort by start date if timing is equal
|
||||||
|
t = new Date(b.startdate).getTime() - new Date(a.startdate).getTime();
|
||||||
|
|
||||||
|
if (t == 0) {
|
||||||
|
// sort by name if timing is equal
|
||||||
|
t = a.name.localeCompare(b.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
});
|
||||||
|
app.studyplans = ProcessStudyplans(response);
|
||||||
|
}).fail(notification.exception);
|
||||||
|
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
updated() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
@ -58,3 +103,5 @@ let strings = loadStrings({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$string['pluginname'] = 'My studyplan';
|
$string['pluginname'] = 'My Treestudyplan';
|
||||||
$string['mytreestudyplan'] = 'My studyplan';
|
$string['mytreestudyplan'] = 'MyTreestudyplan';
|
||||||
$string['title'] = 'My Studyplan';
|
$string['title'] = 'My Studyplan';
|
||||||
$string['mytreestudyplan:addinstance'] = 'Add my studyplan block';
|
$string['mytreestudyplan:addinstance'] = 'Add my studyplan block';
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$string['pluginname'] = 'Mijn studieplan';
|
$string['pluginname'] = 'Mijn Treestudyplan';
|
||||||
$string['mytreestudyplan'] = 'My studieplan';
|
$string['mytreestudyplan'] = 'MyTreestudyplan';
|
||||||
$string['title'] = 'Mijn studieplan';
|
$string['title'] = 'Mijn Studieplan';
|
||||||
$string['mytreestudyplan:addinstance'] = 'Voeg mijn studieplan block toe';
|
$string['mytreestudyplan:addinstance'] = 'Voeg mijn studieplan block toe';
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div v-cloak>
|
<div v-cloak>
|
||||||
{{^teachermode}}
|
{{^teachermode}}
|
||||||
<r-report type="own"></r-report>
|
<r-report v-model='studyplans'></r-report>
|
||||||
{{/teachermode}}
|
{{/teachermode}}
|
||||||
{{#teachermode}}
|
{{#teachermode}}
|
||||||
<r-report type='teaching' teachermode></r-report>
|
<r-report v-model='studyplans' teachermode></r-report>
|
||||||
{{/teachermode}}
|
{{/teachermode}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
$plugin->component = 'block_mytreestudyplan'; // Recommended since 2.0.2 (MDL-26035). Required since 3.0 (MDL-48494).
|
$plugin->component = 'block_mytreestudyplan'; // Recommended since 2.0.2 (MDL-26035). Required since 3.0 (MDL-48494).
|
||||||
$plugin->version = 2024062800; // YYYYMMDDHH (year, month, day, iteration).
|
$plugin->version = 2023090800; // YYYYMMDDHH (year, month, day, iteration).
|
||||||
$plugin->requires = 2021051700; // YYYYMMDDHH (This is the release version for Moodle 3.11).
|
$plugin->requires = 2021051700; // YYYYMMDDHH (This is the release version for Moodle 3.11).
|
||||||
|
|
||||||
$plugin->release = "1.0.0";
|
$plugin->release = "1.0.0";
|
||||||
|
@ -31,5 +31,5 @@ $plugin->maturity = MATURITY_RC;
|
||||||
$plugin->supported = [ 311, 401 ];
|
$plugin->supported = [ 311, 401 ];
|
||||||
|
|
||||||
$plugin->dependencies = [
|
$plugin->dependencies = [
|
||||||
'local_treestudyplan' => 2024062800,
|
'local_treestudyplan' => 2023090700,
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user