tussenopslag
This commit is contained in:
@@ -895,7 +895,7 @@ tr.selected, td.selected{
|
||||
.integer{
|
||||
text-align: right;
|
||||
padding-right: 3px;
|
||||
max-width: 40px;
|
||||
max-width: 50px;
|
||||
}
|
||||
.datum{
|
||||
width: 80px;
|
||||
|
||||
@@ -8,8 +8,10 @@ $(function(){
|
||||
ls.initStreefcijfersModel = function(){
|
||||
var timeout;
|
||||
|
||||
function fAddVersieAmbitie(p){
|
||||
this.id = p.id; // ambitie id
|
||||
function fAddVersieAmbitie(i, p, toporgsoort){
|
||||
let dit = this;
|
||||
this.id = p.ambitieID; // ambitie id
|
||||
this.orgID = p.orgID;
|
||||
this.periodenummer = p.periodenummer;
|
||||
this.naam = p.naam ; // versienaam
|
||||
this.orgversieid = p.orgversie_id;
|
||||
@@ -21,9 +23,22 @@ ls.initStreefcijfersModel = function(){
|
||||
},this);
|
||||
|
||||
this.gemscore = ko.observable(p.gemscore);
|
||||
this.xijkpunten = ko.observable(p.xijkpunten);
|
||||
this.zprocent = ko.observable(p.zprocent);
|
||||
this.wijzigok = ko.observable(true);
|
||||
this.aantalY = p.aantalY;
|
||||
this.xijkpunten = ko.observable(p.xijkpunten);
|
||||
this.ambitievan = ko.observable(p.ambitievan);
|
||||
this.soort = p.soort;
|
||||
this.nieuw = ko.observable('');
|
||||
switch(Number(toporgsoort)){
|
||||
case 1: dit.nieuw = 'swv';
|
||||
break;
|
||||
case 2: dit.nieuw = 'regio';
|
||||
break;
|
||||
case 3: dit.nieuw = 'bestuur';
|
||||
break;
|
||||
case 4: dit.nieuw = 'school';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -89,16 +104,20 @@ ls.initStreefcijfersModel = function(){
|
||||
}
|
||||
else {
|
||||
ls.StreefcijfersModel = {
|
||||
versieambities : ko.observableArray([]),
|
||||
versieambities : ko.observable(),
|
||||
toporg : ko.observableArray([]),
|
||||
orgsoort : ko.observable(1),
|
||||
orgversions : ko.observableArray([]),
|
||||
selectedOrgversion : ko.observable(''),
|
||||
selectedOrg : ko.observable(''),
|
||||
userniveau : ko.observable(4),
|
||||
inzage : ko.observable(),
|
||||
manage : ko.observable('F'),
|
||||
bezig : ko.observable(false),
|
||||
isSWV : ko.observable(false),
|
||||
insert : ko.observable(false),
|
||||
scoreNieuw : ko.observable(100),
|
||||
ijkNieuw : ko.observable(0),
|
||||
procentNieuw : ko.observable(100),
|
||||
|
||||
|
||||
initBindings :function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
@@ -112,37 +131,42 @@ ls.initStreefcijfersModel = function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
self.toporg('');
|
||||
|
||||
$.post("index.php/monpas/rapijkpunten/getorgs", function(data){
|
||||
self.bezig(true);
|
||||
if (data.organisatie){
|
||||
$.post("index.php/monpas/streefcijfers/checkrecht", function(data){
|
||||
if(data) {self.manage(data);}
|
||||
|
||||
$.post("index.php/monpas/rapijkpunten/getorgs", function(data){
|
||||
self.bezig(true);
|
||||
if (data.organisatie) {
|
||||
|
||||
self.orgsoort(data.soort);
|
||||
switch (self.orgsoort()) {
|
||||
case 1:
|
||||
self.toporg(new fAddSWV(data.organisatie));
|
||||
self.isSWV(true);
|
||||
break;
|
||||
case 2:
|
||||
self.toporg(new fAddKamer(data.organisatie));
|
||||
break;
|
||||
case 3:
|
||||
self.toporg(new fAddBG(data.organisatie));
|
||||
break;
|
||||
case 4:
|
||||
self.toporg(new fAddSchool(data.organisatie));
|
||||
break;
|
||||
} // switch
|
||||
|
||||
self.orgsoort(data.soort);
|
||||
switch (self.orgsoort()){
|
||||
case 1: self.toporg(new fAddSWV(data.organisatie));
|
||||
self.isSWV(true);
|
||||
break;
|
||||
case 2: self.toporg(new fAddKamer(data.organisatie));
|
||||
break;
|
||||
case 3: self.toporg(new fAddBG(data.organisatie));
|
||||
break;
|
||||
case 4: self.toporg(new fAddSchool(data.organisatie));
|
||||
break;
|
||||
} // switch
|
||||
$.post('index.php/monpas/rapijkpunten/getusernivo', function(result){
|
||||
self.userniveau(result);
|
||||
self.selectedOrg(self.toporg());
|
||||
$.post('index.php/monpas/rapmatrix/checkinzage', function(result){
|
||||
self.inzage(result);
|
||||
},'json');
|
||||
}
|
||||
|
||||
self.fGetAmbities();
|
||||
},'json');
|
||||
}
|
||||
|
||||
self.bezig(false);
|
||||
self.bezig(false);
|
||||
self.fGetAmbitie();
|
||||
},'json');
|
||||
|
||||
},'json');
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
fToggleGeopend: function(){
|
||||
@@ -159,16 +183,18 @@ ls.initStreefcijfersModel = function(){
|
||||
self.isSWV(true);
|
||||
}
|
||||
|
||||
self.fGetAmbities();
|
||||
self.fGetAmbitie();
|
||||
},
|
||||
|
||||
fGetAmbities : function() {
|
||||
fGetAmbitie : function() {
|
||||
var self = ls.StreefcijfersModel;
|
||||
self.versieambities.removeAll();
|
||||
$.post("index.php/monpas/streefcijfers/mh_getorgversies_ambities/" + self.selectedOrg().id, function(data){
|
||||
self.versieambities('');
|
||||
|
||||
$.post("index.php/monpas/streefcijfers/getambitie/" + self.selectedOrg().id, function(data){
|
||||
if (data){
|
||||
let soort = self.toporg().soort;
|
||||
$.each(data, function(i,p){
|
||||
self.versieambities.push(new fAddVersieAmbitie(p));
|
||||
self.versieambities(new fAddVersieAmbitie(i,p, soort ));
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
@@ -190,12 +216,68 @@ ls.initStreefcijfersModel = function(){
|
||||
"gemscore" : dit.gemscore(),
|
||||
"xijkpunten" : dit.xijkpunten(),
|
||||
"zprocent" : dit.zprocent()}
|
||||
// $.post("index.php/monpas/streefcijfers/updateambitie", submitData, function(newid){
|
||||
// if (newid) {self.fGetAmbities();};
|
||||
// self.bezig(false);
|
||||
// },'json');
|
||||
$.post("index.php/monpas/streefcijfers/updateambitie", submitData, function(newid){
|
||||
if (newid) {self.fGetAmbitie()}
|
||||
self.bezig(false);
|
||||
},'json');
|
||||
},700);
|
||||
},
|
||||
fNew: function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
self.insert(true);
|
||||
self.scoreNieuw(this.gemscore());
|
||||
self.ijkNieuw(this.xijkpunten());
|
||||
self.procentNieuw(this.zprocent());
|
||||
},
|
||||
|
||||
fOpslaan: function (){
|
||||
var self = ls.StreefcijfersModel;
|
||||
let dit = this;
|
||||
|
||||
if(!self.selectedOrg().id) return
|
||||
if(self.toporg().id !== self.selectedOrg().id) return;
|
||||
|
||||
if (timeout){
|
||||
clearTimeout(timeout);
|
||||
timeout = null;
|
||||
}
|
||||
timeout = setTimeout(function(){
|
||||
self.bezig(true);
|
||||
var submitData={
|
||||
"orgversieid" : dit.orgversieid,
|
||||
"orgid" : self.selectedOrg().id,
|
||||
"gemscore" : self.scoreNieuw(),
|
||||
"xijkpunten" : self.ijkNieuw(),
|
||||
"zprocent" : self.procentNieuw()
|
||||
}
|
||||
|
||||
console.log(submitData, "data")
|
||||
$.post("index.php/monpas/streefcijfers/saveAmbitie", submitData, function(newid){
|
||||
if (newid) {self.fGetAmbitie()}
|
||||
self.bezig(false);
|
||||
self.insert(false);
|
||||
self.scoreNieuw(0);
|
||||
self.ijkNieuw(0);
|
||||
self.procentNieuw(0);
|
||||
|
||||
},'json');
|
||||
},700);
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
fAnnuleer: function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
self.insert(false);
|
||||
self.scoreNieuw(0);
|
||||
self.ijkNieuw(0);
|
||||
self.procentNieuw(0);
|
||||
|
||||
},
|
||||
|
||||
|
||||
fDelete:function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
if (self.bezig()) return;
|
||||
|
||||
Reference in New Issue
Block a user