tussenopslag
This commit is contained in:
@@ -21,6 +21,7 @@ class Streefcijfers extends MY_Controller{
|
||||
$swvid = null;
|
||||
$kamerid = null;
|
||||
$bgid = null;
|
||||
$schoolid = null;
|
||||
switch ($organisatie->soort) {
|
||||
case 1: $swvid = $organisatie->id;
|
||||
break;
|
||||
@@ -32,7 +33,8 @@ class Streefcijfers extends MY_Controller{
|
||||
$org2 = $this->Organisaties_model->get_record_by_id($kamerid);
|
||||
$swvid = $org2->valtonder_id;
|
||||
break;
|
||||
case 4: $bgid = $organisatie->valtonder_id;
|
||||
case 4: $schoolid = $organisatie->id;
|
||||
$bgid = $organisatie->valtonder_id;
|
||||
$org2 = $this->Organisaties_model->get_record_by_id($bgid);
|
||||
$kamerid = $org2->valtonder_id;
|
||||
$org3 = $this->Organisaties_model->get_record_by_id($kamerid);
|
||||
@@ -41,7 +43,8 @@ class Streefcijfers extends MY_Controller{
|
||||
} ; // einde switch
|
||||
return array('swvid'=>$swvid,
|
||||
"kamerid" =>$kamerid,
|
||||
"bgid" =>$bgid);
|
||||
"bgid" =>$bgid,
|
||||
"schoolid" =>$schoolid);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +64,8 @@ class Streefcijfers extends MY_Controller{
|
||||
// let op dit is een array
|
||||
break;
|
||||
case 2:
|
||||
case 3: $orgversies = $this->Orgversies_model->getallorgversies($hierarchie['kamerid'],$module, true);
|
||||
case 3:
|
||||
case 4:$orgversies = $this->Orgversies_model->getallorgversies($hierarchie['kamerid'],$module, true);
|
||||
if (!$orgversies){
|
||||
$orgversies = $this->Orgversies_model->getallorgversies($hierarchie['swvid'],$module, true);
|
||||
}
|
||||
@@ -113,6 +117,65 @@ class Streefcijfers extends MY_Controller{
|
||||
echo json_encode($ambities);
|
||||
}
|
||||
|
||||
function getAmbitieOrgs($orgid, $ambitieorgs){
|
||||
$ambitieorgs .= $orgid . ',';
|
||||
$valtonder = $this->Organisaties_model->get_fieldvalue(['id' => $orgid], 'valtonder_id');
|
||||
if($valtonder != $orgid){
|
||||
return $this->getAmbitieOrgs($valtonder, $ambitieorgs);
|
||||
}
|
||||
|
||||
return $ambitieorgs;
|
||||
|
||||
}
|
||||
|
||||
function mh_getorgversies_ambities(){
|
||||
if (!$this->userid) die;
|
||||
$orgid = $this->uri->segment(4);
|
||||
$module = $this->session->userdata('module');
|
||||
|
||||
$ambitieorgs = '';
|
||||
$ambitieorgs = $this->getAmbitieOrgs($orgid, $ambitieorgs);
|
||||
$ambitieorgs = rtrim($ambitieorgs, ',');
|
||||
|
||||
$toporgsarray = explode(',', $ambitieorgs);
|
||||
$toporgs = '';
|
||||
$index = 0;
|
||||
for($i = count($toporgsarray)-1; $i >= 0 ; $i--) {
|
||||
if($index < 2) {
|
||||
$toporgs .= $toporgsarray[$i] . ',';
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
$toporgs = rtrim($toporgs, ',' );
|
||||
|
||||
$orgversies = $this->Orgversies_model->getorgversies($toporgs, $module);
|
||||
if(!$orgversies) echo json_encode("geen orgversies");
|
||||
|
||||
$ambities = [];
|
||||
foreach($orgversies as $orgversie) {
|
||||
$ambitie = $this->Ambities_model->get_ambities_orgversie($orgversie->id, $ambitieorgs, $toporgs);
|
||||
if ($ambitie) $ambtities [] = $ambitie;
|
||||
else {
|
||||
$aantalY = $this->Ijkpunten_model->telijkpunten($orgversie->id);
|
||||
$ambities[] = ['id' => 0,
|
||||
'gemscore' => 80,
|
||||
'aantalY' => $aantalY,
|
||||
'xijkpunten' => round($aantalY * 0.8),
|
||||
'z_procent' => 60,
|
||||
'orgversieid' => $orgversie->id,
|
||||
'geldigvanaf' => $orgversie->geldigvanaf,
|
||||
'geldigtm' => $orgversie->geldigtm,
|
||||
'periodenummer' => $orgversie->periodenummer,
|
||||
'actief' => $orgversie->actief,
|
||||
'naam' => $orgversie->naam,
|
||||
'soort' => 0];
|
||||
}
|
||||
|
||||
echo json_encode($ambities);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// function getorgversies_ambities_oud(){
|
||||
// $versies = false;
|
||||
// $module = $this->session->userdata('module');
|
||||
|
||||
@@ -102,4 +102,41 @@ class Ambities_model extends MY_Model{
|
||||
};
|
||||
return $ambitie;
|
||||
}
|
||||
|
||||
function get_ambities_orgversie($orgversieid, $ambitieorgs, $toporgs)
|
||||
{
|
||||
$this->sql = "
|
||||
SELECT A.id,
|
||||
A.gem_score AS gemscore,
|
||||
A.z_procent AS zprocent,
|
||||
OV.id AS orgversie_id,
|
||||
DATE_FORMAT( OV.geldigvanaf, '%d-%m-%Y') as geldigvanaf,
|
||||
DATE_FORMAT( OV.geldigtm, '%d-%m-%Y') as geldigtm,
|
||||
OV.periodenummer, OV.actief, V.naam,
|
||||
O.soort
|
||||
FROM tb_orgversies OV
|
||||
JOIN tb_versies V ON OV.versie_id = V.id
|
||||
JOIN tb_ambities A ON A.orgversie_id = OV.id
|
||||
JOIN tb_organisaties O ON A.organisatie_id = O.id
|
||||
WHERE A.organisatie_id IN ({$ambitieorgs})
|
||||
AND OV.organisatie_id IN ({$toporgs})
|
||||
AND OV.id = {$orgversieid}
|
||||
ORDER BY soort DESC
|
||||
LIMIT 1;
|
||||
|
||||
|
||||
|
||||
";
|
||||
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +43,29 @@ class Orgversies_model extends MY_Model{
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
|
||||
function getorgversies($toporgs, $module){
|
||||
$this->sql="SELECT OV.id,
|
||||
periodenummer,
|
||||
OV.actief,
|
||||
DATE_FORMAT(geldigvanaf,'%d-%m-%Y') as geldigvanaf,
|
||||
DATE_FORMAT(geldigtm,'%d-%m-%Y') as geldigtm,
|
||||
V.naam,
|
||||
COUNT(Y.id) AS aantalY
|
||||
|
||||
|
||||
FROM tb_orgversies OV
|
||||
JOIN tb_versies V ON V.id = versie_id
|
||||
JOIN tb_ijkpunten Y ON V.id = Y.versie_id
|
||||
WHERE OV.organisatie_id IN ({$toporgs})
|
||||
AND V.modulenr = {$module}
|
||||
AND Y.disabled = 'F' ";
|
||||
|
||||
$this->sql .=" GROUP BY OV.id
|
||||
ORDER BY periodenummer DESC";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
function getVersieinfo($orgversieid){
|
||||
$this->sql="SELECT OV.id AS orgversieid,
|
||||
OV.organisatie_id,
|
||||
|
||||
@@ -1,55 +1,213 @@
|
||||
<div class="col-sm-12 mainpagina" id ="pagstreefcijfers">
|
||||
<div class="row" >
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<div class="col-sm-12 col-md-4">
|
||||
<h3>Selecteer een organisatieniveau</h3>
|
||||
<table style="width:100%">
|
||||
<tbody data-bind="foreach: swv">
|
||||
<tr class="swv" data-bind=" css: {'selected' : $parent.selectedOrganisatie().id ==id},
|
||||
click:$parent.fSetSelected ">
|
||||
|
||||
<td style="width:100%"
|
||||
data-bind="text: naam"></td>
|
||||
|
||||
</tr>
|
||||
<tr data-bind="visible: kamers() !== undefined">
|
||||
|
||||
<td >
|
||||
<table style="width: 100%">
|
||||
<tbody data-bind="foreach: kamers">
|
||||
<tr class="kamer selectable"
|
||||
data-bind="css: {'selected' : $root.selectedOrganisatie().id ==id},
|
||||
click: $root.fSetSelected">
|
||||
<td style="width:5%"></td>
|
||||
<td style="width: 95%" data-bind="text: naam"></td>
|
||||
|
||||
</tr>
|
||||
<tr data-bind="visible: bgs() !== undefined ">
|
||||
<td></td>
|
||||
<td >
|
||||
<table style="width: 100%">
|
||||
<tbody data-bind="foreach: bgs">
|
||||
<tr class= "selectable"
|
||||
data-bind="css: {'selected' : $root.selectedOrganisatie().id ==id},
|
||||
click: $root.fSetSelected">
|
||||
|
||||
<td style="width: 100%" data-bind="text: naam"></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<!-- <table style="width:100%">-->
|
||||
<!-- <tbody data-bind="foreach: swv">-->
|
||||
<!-- <tr class="swv" data-bind=" css: {'selected' : $parent.selectedOrganisatie().id ==id},-->
|
||||
<!-- click:$parent.fSetSelected ">-->
|
||||
<!-- -->
|
||||
<!-- <td style="width:100%"-->
|
||||
<!-- data-bind="text: naam"></td>-->
|
||||
<!-- -->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr data-bind="visible: kamers() !== undefined">-->
|
||||
<!-- -->
|
||||
<!-- <td >-->
|
||||
<!-- <table style="width: 100%">-->
|
||||
<!-- <tbody data-bind="foreach: kamers">-->
|
||||
<!-- <tr class="kamer selectable" -->
|
||||
<!-- data-bind="css: {'selected' : $root.selectedOrganisatie().id ==id},-->
|
||||
<!-- click: $root.fSetSelected">-->
|
||||
<!-- <td style="width:5%"></td>-->
|
||||
<!-- <td style="width: 95%" data-bind="text: naam"></td>-->
|
||||
<!-- -->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr data-bind="visible: bgs() !== undefined "> -->
|
||||
<!-- <td></td>-->
|
||||
<!-- <td >-->
|
||||
<!-- <table style="width: 100%">-->
|
||||
<!-- <tbody data-bind="foreach: bgs">-->
|
||||
<!-- <tr class= "selectable"-->
|
||||
<!-- data-bind="css: {'selected' : $root.selectedOrganisatie().id ==id},-->
|
||||
<!-- click: $root.fSetSelected">-->
|
||||
<!-- -->
|
||||
<!-- <td style="width: 100%" data-bind="text: naam"></td>-->
|
||||
<!-- -->
|
||||
<!-- </tr>-->
|
||||
<!-- </tbody> -->
|
||||
<!-- </table> -->
|
||||
<!-- </td> -->
|
||||
<!-- </tr> -->
|
||||
<!-- </tbody> -->
|
||||
<!-- </table>-->
|
||||
<!-- <td> -->
|
||||
<!-- </tr>-->
|
||||
<!-- </tbody>-->
|
||||
<!-- </table>-->
|
||||
|
||||
|
||||
<div style = "max-height: 300px; overflow-y:auto">
|
||||
|
||||
<!-- ko if : orgsoort() ==4 -->
|
||||
<div data-bind="visible: orgsoort()== 4, with: toporg">
|
||||
<p data-bind="text: brin + ' - ' + naam"></p>
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
|
||||
<!-- ko if : orgsoort() ==3 -->
|
||||
<div data-bind="visible: orgsoort() == 3">
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="with: toporg">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible: geopend">
|
||||
<td></td>
|
||||
<td colspan = 2>
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: scholen">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
|
||||
<!-- ko if: orgsoort() ==2 -->
|
||||
|
||||
<table style="width: 100%">
|
||||
<tbody data-bind="foreach: toporg">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible: geopend">
|
||||
<td></td>
|
||||
<td colspan = 2 style="padding-left: 20px;">
|
||||
<table style="width: 100%">
|
||||
<tbody data-bind="foreach: bgs">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible: geopend">
|
||||
<td></td>
|
||||
<td colspan = 2 style="padding-left: 20px;">
|
||||
<table>
|
||||
<tbody data-bind="foreach: scholen">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- /ko -->
|
||||
|
||||
<!-- ko if: orgsoort() ==1 -->
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: toporg">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible: geopend()">
|
||||
<td></td>
|
||||
<td colspan = 2>
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: kamers">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
|
||||
<tr data-bind="visible: geopend()">
|
||||
<td></td>
|
||||
<td colspan = 2>
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: bgs">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td data-bind="click: $root.fToggleGeopend" style="width:16px;">
|
||||
<button class="noshowklein openbutton"
|
||||
data-bind="css: {'closebutton': geopend() }">
|
||||
</button>
|
||||
</td>
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
<tr data-bind="visible:geopend()">
|
||||
<td></td>
|
||||
<td colspan = 2>
|
||||
<table style="width: 100%;">
|
||||
<tbody data-bind="foreach: scholen">
|
||||
<tr class="selectable" data-bind="css: {'selected': $root.selectedOrg().id == id}">
|
||||
<td class="orgtd brin" data-bind="text: brin, click: $root.fSwitchOrg"></td>
|
||||
<td class='orgtd' data-bind="text: naam, click: $root.fSwitchOrg"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- /ko -->
|
||||
</div >
|
||||
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-9" data-bind="visible: selectedOrganisatie().id !=0">
|
||||
<div class="col-sm-12 col-md-8" data-bind="visible: selectedOrg().id !=0">
|
||||
<h4> Criteria voor scholen onder organisatie:
|
||||
<span data-bind="text: selectedOrganisatie().naam"></span>
|
||||
<span data-bind="text: selectedOrg().naam"></span>
|
||||
</h4>
|
||||
<table style="width: 100%;">
|
||||
<thead>
|
||||
@@ -74,7 +232,7 @@
|
||||
<td><input class="integer"
|
||||
data-bind="textInput: xijkpunten, event:{input: $root.fUpdateAmbitie},enable:wijzigok" /> ijkpunten
|
||||
op <input class="integer"
|
||||
data-bind="textInput: zprocent, event:{input: $root.fUpdateAmbitie}, enable:wijzigok" />% of hoger
|
||||
data-bind="textInput: zprocent, event:{input: $root.fUpdateAmbitie}, enable:wijzigok" />% of hoger
|
||||
</td>
|
||||
<td class="glyphicon glyphicon-trash" data-bind="click:$root.fDelete"></td>
|
||||
</tr>
|
||||
|
||||
@@ -23,46 +23,65 @@ ls.initStreefcijfersModel = function(){
|
||||
this.gemscore = ko.observable(p.gemscore);
|
||||
this.xijkpunten = ko.observable(p.xijkpunten);
|
||||
this.zprocent = ko.observable(p.zprocent);
|
||||
this.wijzigok = p.wijzigok;
|
||||
this.wijzigok = ko.observable(true);
|
||||
|
||||
}
|
||||
|
||||
function fAddSwv (p){
|
||||
function fAddSWV(p){
|
||||
var dit = this;
|
||||
this.id = p.id;
|
||||
this.brin = p.brin
|
||||
this.naam = p.brin + ' - ' + p.naamkort;
|
||||
this.id = p.id;
|
||||
this.soort = p.soort;
|
||||
this.brin = p.brin;
|
||||
this.naam = p.naamkort;
|
||||
this.plaats = p.plaats;
|
||||
this.kamers = ko.observableArray([]);
|
||||
if (p.kamers){
|
||||
this.geopend = ko.observable(false);
|
||||
dit.kamers = ko.observableArray([]);
|
||||
if (p.kamers ){
|
||||
$.each(p.kamers, function(j,k){
|
||||
dit.kamers.push(new fAddNivo2(k));
|
||||
dit.kamers.push(new fAddKamer(k));
|
||||
})
|
||||
}
|
||||
if (p.bgs){
|
||||
$.each(p.bgs, function(j,k){
|
||||
dit.kamers.push(new fAddBG(k));
|
||||
});
|
||||
}
|
||||
}
|
||||
function fAddNivo2 (p){
|
||||
|
||||
function fAddKamer(p){
|
||||
var dit = this;
|
||||
this.id = p.id;
|
||||
this.naam = p.brin + ' - ' + p.naamkort;
|
||||
this.id = p.id;
|
||||
this.soort = p.soort;
|
||||
this.brin = p.brin;
|
||||
this.naam = p.naamkort;
|
||||
this.plaats = p.plaats;
|
||||
this.bgs = ko.observableArray([]);
|
||||
this.geopend = ko.observable(false);
|
||||
this.bgs = ko.observableArray([]);
|
||||
if (p.bgs){
|
||||
$.each(p.bgs, function(j,k){
|
||||
dit.bgs.push(new fAddBG(k));
|
||||
$.each(p.bgs, function(x,z){
|
||||
dit.bgs.push(new fAddBG(z));
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fAddBG (p){
|
||||
var dit = this;
|
||||
this.id = p.id;
|
||||
this.naam = p.brin + ' - ' + p.naamkort;
|
||||
this.plaats = p.plaats;
|
||||
this.bgs = ko.observableArray([]);
|
||||
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){
|
||||
@@ -71,10 +90,15 @@ ls.initStreefcijfersModel = function(){
|
||||
else {
|
||||
ls.StreefcijfersModel = {
|
||||
versieambities : ko.observableArray([]),
|
||||
swv : ko.observableArray([]),
|
||||
selectedOrganisatie : ko.observable(''),
|
||||
zelfniveau : ko.observable(3),
|
||||
bezig : ko.observable(false),
|
||||
toporg : ko.observableArray([]),
|
||||
orgsoort : ko.observable(1),
|
||||
orgversions : ko.observableArray([]),
|
||||
selectedOrgversion : ko.observable(''),
|
||||
selectedOrg : ko.observable(''),
|
||||
userniveau : ko.observable(4),
|
||||
inzage : ko.observable(),
|
||||
bezig : ko.observable(false),
|
||||
isSWV : ko.observable(false),
|
||||
|
||||
initBindings :function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
@@ -86,32 +110,62 @@ ls.initStreefcijfersModel = function(){
|
||||
|
||||
initModel: function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
self.swv.removeAll();
|
||||
|
||||
$.post("index.php/monpas/streefcijfers/getorganisaties", function(swv){
|
||||
if (swv){
|
||||
self.swv.push(new fAddSwv(swv));
|
||||
self.selectedOrganisatie(self.swv()[0]);
|
||||
}
|
||||
|
||||
$.post("index.php/monpas/streefcijfers/getzelfniveau", function(nivo){
|
||||
self.zelfniveau(nivo);
|
||||
self.fGetAmbities();
|
||||
},'json')
|
||||
},'json');
|
||||
self.toporg('');
|
||||
|
||||
$.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
|
||||
$.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);
|
||||
|
||||
},'json');
|
||||
|
||||
},
|
||||
|
||||
fToggleGeopend: function(){
|
||||
this.geopend(!this.geopend());
|
||||
},
|
||||
|
||||
fSetSelected : function(){
|
||||
fSwitchOrg : function(){
|
||||
var self = ls.StreefcijfersModel;
|
||||
if (this.id == self.selectedOrganisatie().id) return;
|
||||
self.selectedOrganisatie(this);
|
||||
if (self.selectedOrganisatie() == undefined) return;
|
||||
self.isSWV(false);
|
||||
if (this.id == self.selectedOrg().id) return;
|
||||
self.selectedOrg(this);
|
||||
if (self.selectedOrg() == undefined) return;
|
||||
if(self.selectedOrg().soort === '1'){
|
||||
self.isSWV(true);
|
||||
}
|
||||
|
||||
self.fGetAmbities();
|
||||
},
|
||||
|
||||
fGetAmbities : function() {
|
||||
var self = ls.StreefcijfersModel;
|
||||
self.versieambities.removeAll();
|
||||
$.post("index.php/monpas/streefcijfers/getorgversies_ambities/" + self.selectedOrganisatie().id, function(data){
|
||||
$.post("index.php/monpas/streefcijfers/mh_getorgversies_ambities/" + self.selectedOrg().id, function(data){
|
||||
if (data){
|
||||
$.each(data, function(i,p){
|
||||
self.versieambities.push(new fAddVersieAmbitie(p));
|
||||
@@ -132,14 +186,14 @@ ls.initStreefcijfersModel = function(){
|
||||
self.bezig(true);
|
||||
var submitData={ "id" : dit.id,
|
||||
"orgversie_id" : dit.orgversieid,
|
||||
"organisatie_id" : self.selectedOrganisatie().id,
|
||||
"organisatie_id" : self.selectedOrg().id,
|
||||
"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.fGetAmbities();};
|
||||
// self.bezig(false);
|
||||
// },'json');
|
||||
},700);
|
||||
},
|
||||
fDelete:function(){
|
||||
|
||||
Reference in New Issue
Block a user