Merge branch 'feature/archiefoptie-ondersteuningsvorm' into develop

This commit is contained in:
2026-02-03 14:33:50 +01:00
7 changed files with 413 additions and 52 deletions
+116 -11
View File
@@ -28,11 +28,14 @@ $(function(){
}
function fAddEditGroep(p){
var dit = this;
this.id = p.id;
var dit= this;
this.id = p.id;
this.naam = ko.observable(p.naam);
this.orgid = p.orgid;
this.schooljaar = p.schooljaar;
this.schooljaar = p.schooljaar;
this.archief2 = ko.observable(false);
this.archief3 = ko.observable(false);
this.archief4 = ko.observable(false);
this.niveau = ko.observableArray([]);
if (p.niveau){
@@ -88,6 +91,44 @@ $(function(){
this.basis = ko.computed(function(){
return parseInt(dit.totaantal()) - (parseInt(dit.totplus()) + dit.totextra()+dit.totextraplus());
})
this.archiefplus = ko.computed(function(){
let toon = false;
if (dit.ondersteuningsvormen()){
$.each(dit.ondersteuningsvormen(), function(x,y){
if (parseInt(y.nivo )=== 2 ){
console.log(y, 'wat is y')
if(y.archief() && y.orgid > 0)
toon = true;
}
});
}
console.log(toon);
return toon;
});
this.archiefextra = ko.computed(function(){
var toon = false
if (dit.ondersteuningsvormen()){
$.each(dit.ondersteuningsvormen(), function(x,y){
if (parseInt(y.nivo) === 3 && y.archief()){
toon = true;
}
});
}
return toon;
});
this.archiefextraplus = ko.computed(function(){
var toon = false;
if (dit.ondersteuningsvormen()){
$.each(dit.ondersteuningsvormen(), function(x,y){
if (parseInt(y.nivo) === 4 && y.archief()){
toon = true;
}
});
}
return toon;
});
this.geopend1 = ko.observable(false);
this.geopend2 = ko.observable(false);
this.geopend3 = ko.observable(false);
@@ -99,11 +140,13 @@ $(function(){
function fAddOndersteuningsvorm(k){
var dit = this;
this.id = k.id;
this.orgid = k.organisatie_id;
this.naam = ko.observable(k.naam);
this.orgid = k.organisatie_id;
this.naam = ko.observable(k.naam);
this.nivo = k.nivo;
this.aantal = ko.observable(k.aantal);
this.gebruikt = k.gebruikt==='T';
this.archief = ko.observable(false);
if (k.archief==='T') dit.archief(true);
}
@@ -309,7 +352,8 @@ $(function(){
groepid : self.editGroep().id,
nivo : p.nivo,
naam : p.naam(),
aantal : p.aantal() };
aantal : p.aantal(),
archief : p.archief() ? 'T': 'F'}
$.post("index.php/monpas/groepen/insertorupdateOS", submitData, function(result){
if (result){
@@ -396,10 +440,24 @@ $(function(){
orgid:self.schoolid(),
naam: ko.observable(''),
nivo: wat,
aantal: ko.observable(0)}
aantal: ko.observable(0),
gebruikt: false,
archief: ko.observable(false)
}
self. editGroep().ondersteuningsvormen.push( newos);
},
fToggleArchief: function(wat){
var self = ls.GroepenModel;
console.log(wat, 'wat');
if (!self.editGroep()) return;
if (wat === 2) self.editGroep().archief2(! self.editGroep().archief2());
if (wat === 3) self.editGroep().archief3(! self.editGroep().archief3());
if (wat === 4) self.editGroep().archief4(! self.editGroep().archief4());
console.log(self.editGroep().archief4(), 'archief4');
},
fCheckinput: function(data,elid){
var self =ls.GroepenModel;
var dit = this;
@@ -484,17 +542,64 @@ $(function(){
}
},'json');
},
fArchiveOS : function(){
var self = ls.GroepenModel;
var dit = this;
let waarschuwing ="Weet u zeker dat u " + dit.naam() + " wilt archiveren?";
if(dit.aantal() > 0) waarschuwing = waarschuwing + "<br/>De leerlingen in deze groep die toegewezen zijn aan deze" +
" ondersteuningsvorm worden ingedeeld in de basisondersteuning."
let sd ={
vormID : dit.id,
groepID: self.editGroep().id,
orgID: self.schoolid()
}
apprise(waarschuwing , {verify: true, textYes: 'ja', textNo:'nee'}, function(ans){
if (ans){
$.post("index.php/monpas/groepen/archiveerOS", sd, function(){
dit.archief(true);
dit.aantal(0);
});
};// if ans
});//apprise
},
fActivateOS : function(){
var self = ls.GroepenModel;
var dit = this;
let waarschuwing ="Weet u zeker dat u " + dit.naam() + " actief wilt maken?";
let sd ={
vormID : dit.id,
groepID: self.editGroep().id,
orgID: self.schoolid()
}
apprise(waarschuwing , {verify: true, textYes: 'ja', textNo:'nee'}, function(ans){
if (ans){
$.post("index.php/monpas/groepen/activeerOS", sd, function(){
dit.archief(false);
});
};// if ans
});//apprise
},
fDeleteOS : function(){
var self = ls.GroepenModel;
var dit = this;
apprise("Weet u zeker dat u " + dit.naam() + " wilt verwijderen? </br/> Alle leerlingen (in alle groepen) die toegewezen zijn aan deze" +
" ondersteuningsvorm worden ingedeeld in de basisondersteuning.", {verify: true, textYes: 'ja', textNo:'nee'}, function(ans){
let waarschuwing ="Weet u zeker dat u " + dit.naam() + " wilt verwijderen?";
if(dit.aantal > 0) "</br/> De leerlingen die toegewezen zijn aan deze ondersteuningsvorm worden ingedeeld in de basisondersteuning.";
apprise(waarschuwing, {verify: true, textYes: 'ja', textNo:'nee'}, function(ans){
if (ans){
$.post("index.php/monpas/groepen/deleteOS/" + dit.id, function(){
self.editGroep().ondersteuningsvormen.remove(dit);
});
};// if ans
}// if ans
});//apprise
},
fWijzigLeerkrachten : function(){