Bugfix
This commit is contained in:
parent
cae51717a9
commit
490a71be3b
2
amd/build/studyplan-editor-components.min.js
vendored
2
amd/build/studyplan-editor-components.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -14,6 +14,8 @@ import {load_stringkeys, load_strings, format_date, datespaninfo} from './string
|
||||||
import {objCopy,transportItem} from './studyplan-processor';
|
import {objCopy,transportItem} from './studyplan-processor';
|
||||||
import Debugger from './debugger';
|
import Debugger from './debugger';
|
||||||
import {download,upload} from './downloader';
|
import {download,upload} from './downloader';
|
||||||
|
import {ProcessStudyplan} from './studyplan-processor';
|
||||||
|
|
||||||
|
|
||||||
const STUDYPLAN_EDITOR_FIELDS =
|
const STUDYPLAN_EDITOR_FIELDS =
|
||||||
['name','shortname','description','idnumber','context_id', 'aggregation','aggregation_config'];
|
['name','shortname','description','idnumber','context_id', 'aggregation','aggregation_config'];
|
||||||
|
@ -650,12 +652,26 @@ export default {
|
||||||
const moved_to = response.context_id;
|
const moved_to = response.context_id;
|
||||||
const moved = (moved_from != moved_to);
|
const moved = (moved_from != moved_to);
|
||||||
|
|
||||||
|
if(response.pages[0].periods != self.value.pages[0].periods){
|
||||||
|
// reload the entire model
|
||||||
|
call([{
|
||||||
|
methodname: 'local_treestudyplan_get_studyplan_map',
|
||||||
|
args: { id: self.value.id}
|
||||||
|
}])[0].done(function(response){
|
||||||
|
self.value = ProcessStudyplan(response,true);
|
||||||
|
debug.info('studyplan processed');
|
||||||
|
self.$emit('input',self.value);
|
||||||
|
}).fail(function(error){
|
||||||
|
notification.exception(error);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
objCopy(self.value,response,STUDYPLAN_EDITOR_FIELDS);
|
objCopy(self.value,response,STUDYPLAN_EDITOR_FIELDS);
|
||||||
self.$emit('input',self.value);
|
self.$emit('input',self.value);
|
||||||
if(moved){
|
if(moved){
|
||||||
self.$emit('moved',self.value,moved_from, moved_to);
|
self.$emit('moved',self.value,moved_from, moved_to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}).fail(notification.exception);
|
}).fail(notification.exception);
|
||||||
},
|
},
|
||||||
numberFilter(value){
|
numberFilter(value){
|
||||||
|
@ -1324,6 +1340,7 @@ export default {
|
||||||
{
|
{
|
||||||
let maxLayer = -1;
|
let maxLayer = -1;
|
||||||
for(let i = 0; i <= this.page.periods; i++){
|
for(let i = 0; i <= this.page.periods; i++){
|
||||||
|
if(line.slots[i]){
|
||||||
const slot = line.slots[i];
|
const slot = line.slots[i];
|
||||||
// Determine the amount of used layers in a studyline slit
|
// Determine the amount of used layers in a studyline slit
|
||||||
for(const ix in line.slots[i].competencies){
|
for(const ix in line.slots[i].competencies){
|
||||||
|
@ -1338,6 +1355,8 @@ export default {
|
||||||
maxLayer = item.layer;
|
maxLayer = item.layer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.cache.linelayers[line.id] = {
|
this.cache.linelayers[line.id] = {
|
||||||
value: (maxLayer + 1),
|
value: (maxLayer + 1),
|
||||||
|
|
|
@ -37,6 +37,10 @@ class studyline {
|
||||||
return $this->studyplan;
|
return $this->studyplan;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function page() : studyplanpage {
|
||||||
|
return $this->page;
|
||||||
|
}
|
||||||
|
|
||||||
public static function findById($id): self {
|
public static function findById($id): self {
|
||||||
if(!array_key_exists($id,self::$STUDYLINE_CACHE)){
|
if(!array_key_exists($id,self::$STUDYLINE_CACHE)){
|
||||||
self::$STUDYLINE_CACHE[$id] = new self($id);
|
self::$STUDYLINE_CACHE[$id] = new self($id);
|
||||||
|
@ -102,6 +106,7 @@ class studyline {
|
||||||
unset($model["sequence"]);
|
unset($model["sequence"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Make this a little nicer
|
||||||
// Get the number of slots
|
// Get the number of slots
|
||||||
// As a safety data integrity measure, if there are any items in a higher slot than currently allowed,
|
// As a safety data integrity measure, if there are any items in a higher slot than currently allowed,
|
||||||
// make sure there are enought slots to account for them
|
// make sure there are enought slots to account for them
|
||||||
|
|
Loading…
Reference in New Issue
Block a user