kamerversies bij swv en scholen
This commit is contained in:
@@ -11,74 +11,39 @@ ls.initStreefcijfersModel = function(){
|
||||
function fAddVersieAmbitie(i, p){
|
||||
|
||||
let dit = this;
|
||||
this.id = p.ambitieID; // ambitie id
|
||||
this.orgID = p.orgID;
|
||||
this.gemscore = ko.observable(p.gemscore);
|
||||
this.zprocent = ko.observable(p.zprocent);
|
||||
this.xijkpunten = ko.observable(p.xijkpunten);
|
||||
this.ambitievan = ko.observable(p.ambitievan);
|
||||
this.organisatie = p.organisatie ? p.organisatie : '';
|
||||
this.soort = p.soort;
|
||||
console.log(p.soort, "soort")
|
||||
this.id = p.ambitieID; // ambitie id
|
||||
this.orgID = p.orgID;
|
||||
this.gemscore = ko.observable(p.gemscore);
|
||||
this.zprocent = ko.observable(p.zprocent);
|
||||
this.xijkpunten = ko.observable(p.xijkpunten);
|
||||
this.ambitievan = ko.observable(p.ambitievan);
|
||||
this.versievan = ko.observable(p.versievan);
|
||||
this.organisatie = p.organisatie ? p.organisatie : '';
|
||||
this.soort = p.soort;
|
||||
this.aantalY = p.xijkpunten;
|
||||
this.periodenummer = p.periodenummer;
|
||||
this.naam = p.naam;
|
||||
this.geldigvanaf = p.geldigvanaf;
|
||||
this.geldigtm = p.geldigtm;
|
||||
this.orgversieID = p.orgversieID;
|
||||
|
||||
|
||||
|
||||
}
|
||||
function fAddOrgversie(o){
|
||||
|
||||
function fAddSWV(p){
|
||||
var dit = this;
|
||||
this.id = p.id;
|
||||
this.soort = p.soort;
|
||||
this.brin = p.brin;
|
||||
this.naam = p.naamkort;
|
||||
this.plaats = p.plaats;
|
||||
this.geopend = ko.observable(false);
|
||||
dit.kamers = ko.observableArray([]);
|
||||
if (p.kamers ){
|
||||
$.each(p.kamers, function(j,k){
|
||||
dit.kamers.push(new fAddKamer(k));
|
||||
})
|
||||
}
|
||||
}
|
||||
this.orgversieid = o.orgversieID;
|
||||
this.geldigvanaf = o.geldigvanaf;
|
||||
this.geldigtm = o.geldigtm;
|
||||
this.periodenummer = o.periodenummer;
|
||||
this.ambitievan = o.ambitievan;
|
||||
this.naam = o.naam;
|
||||
|
||||
function fAddKamer(p){
|
||||
var dit = this;
|
||||
this.id = p.id;
|
||||
this.soort = p.soort;
|
||||
this.brin = p.brin;
|
||||
this.naam = p.naamkort;
|
||||
this.plaats = p.plaats;
|
||||
this.geopend = ko.observable(false);
|
||||
this.bgs = ko.observableArray([]);
|
||||
if (p.bgs){
|
||||
$.each(p.bgs, function(x,z){
|
||||
dit.bgs.push(new fAddBG(z));
|
||||
})
|
||||
}
|
||||
}
|
||||
this.versievan = o.versievan;
|
||||
this.gemscore = ko.observable(100);
|
||||
this.aantalY = ko.observable(o.aantalY);
|
||||
this.zprocent = ko.observable(100);
|
||||
|
||||
function fAddBG(p){
|
||||
var dit = this;
|
||||
this.id = p.id;
|
||||
this.soort = p.soort;
|
||||
this.brin = p.brin;
|
||||
this.naam = p.naamkort;
|
||||
this.plaats = p.plaats;
|
||||
this.geopend = ko.observable(false);
|
||||
this.scholen = ko.observableArray([]);
|
||||
if (p.scholen){
|
||||
$.each(p.scholen, function(a,b){
|
||||
dit.scholen.push(new fAddSchool(b));
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function fAddSchool(p){
|
||||
var dit = this;
|
||||
this.id = p.id;
|
||||
this.soort = p.soort;
|
||||
this.brin = p.brin;
|
||||
this.naam = p.naamkort;
|
||||
this.plaats = p.plaats;
|
||||
}
|
||||
|
||||
if (ls.StreefcijfersModel !== undefined){
|
||||
@@ -94,19 +59,18 @@ ls.initStreefcijfersModel = function(){
|
||||
bezig : ko.observable(false),
|
||||
isSWV : ko.observable(false),
|
||||
insert : ko.observable(false),
|
||||
scoreNieuw : ko.observable(100),
|
||||
ijkNieuw : ko.observable(0),
|
||||
procentNieuw : ko.observable(100),
|
||||
aantalY : ko.observable(0),
|
||||
|
||||
instrument : ko.observable(''),
|
||||
periodenummer : ko.observable(''),
|
||||
naam : ko.observable(''),
|
||||
geldigvanaf : ko.observable(''),
|
||||
geldigtm : ko.observable(''),
|
||||
ambitievan : ko.observable(''),
|
||||
orgversieid : ko.observable(''),
|
||||
soortNaam : ko.observable(''),
|
||||
eigenAmbitie : ko.observable(false),
|
||||
orgversie : ko.observable(),
|
||||
gemscoreNew : ko.observable(100),
|
||||
aantalYNew : ko.observable(0),
|
||||
zprocentNew : ko.observable(100),
|
||||
orgversieID : ko.observable(),
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -164,14 +128,13 @@ ls.initStreefcijfersModel = function(){
|
||||
}
|
||||
self.ambities.push(new fAddVersieAmbitie(i, a))
|
||||
});
|
||||
self.aantalY(data.aantalY);
|
||||
|
||||
self.orgversie(new fAddOrgversie(data.orgversie));
|
||||
self.aantalYNew(data.orgversie.aantalY);
|
||||
self.orgversieID(data.orgversie.orgversieID);
|
||||
|
||||
self.instrument(data.module);
|
||||
self.periodenummer(data.ambities[0].periodenummer);
|
||||
self.naam(data.ambities[0].naam);
|
||||
self.geldigvanaf(data.ambities[0].geldigvanaf);
|
||||
self.geldigtm(data.ambities[0].geldigtm);
|
||||
self.orgversieid(data.ambities[0].orgversie_id);
|
||||
}
|
||||
}
|
||||
},'json');
|
||||
},
|
||||
|
||||
@@ -198,10 +161,11 @@ ls.initStreefcijfersModel = function(){
|
||||
},
|
||||
fNew: function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
console.log(self, "self")
|
||||
self.insert(true);
|
||||
self.scoreNieuw(100);
|
||||
self.ijkNieuw(self.aantalY());
|
||||
self.procentNieuw(100);
|
||||
self.gemscoreNew(100);
|
||||
self.aantalYNew();
|
||||
self.zprocentNew(100);
|
||||
},
|
||||
|
||||
fOpslaan: function (){
|
||||
@@ -215,19 +179,19 @@ ls.initStreefcijfersModel = function(){
|
||||
timeout = setTimeout(function(){
|
||||
self.bezig(true);
|
||||
var submitData={
|
||||
"orgversieid" : self.orgversieid(),
|
||||
"gemscore" : self.scoreNieuw(),
|
||||
"xijkpunten" : self.ijkNieuw(),
|
||||
"zprocent" : self.procentNieuw()
|
||||
"orgversieid" : self.orgversieID(),
|
||||
"gemscore" : self.gemscoreNew(),
|
||||
"xijkpunten" : self.aantalYNew(),
|
||||
"zprocent" : self.zprocentNew(),
|
||||
}
|
||||
console.log(submitData, "sd")
|
||||
|
||||
|
||||
$.post("index.php/monpas/streefcijfers/saveAmbitie", submitData, function(newid){
|
||||
if (newid) {self.fGetAmbities()}
|
||||
self.bezig(false);
|
||||
self.insert(false);
|
||||
self.scoreNieuw(0);
|
||||
self.ijkNieuw(0);
|
||||
self.procentNieuw(0);
|
||||
|
||||
|
||||
},'json');
|
||||
},700);
|
||||
@@ -238,9 +202,9 @@ ls.initStreefcijfersModel = function(){
|
||||
fAnnuleer: function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
self.insert(false);
|
||||
self.scoreNieuw(0);
|
||||
self.ijkNieuw(0);
|
||||
self.procentNieuw(0);
|
||||
this.gemscore(0);
|
||||
this.aantalY(0);
|
||||
this.zprocent(0);
|
||||
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user