Merge branch 'feature/archiefoptie-ondersteuningsvorm' into develop

This commit is contained in:
2026-02-05 18:53:09 +01:00
5 changed files with 114 additions and 97 deletions
+2 -1
View File
@@ -101,7 +101,8 @@ class MY_Controller extends CI_Controller{
// public $version = '1.21.00L'; //2factor -twee
// public $version = '1.21.01M'; //verbeteringen compact sop
// public $version = '1.21.02M '; //monfin, geen rode cijfers
public $version = '1.21.03M '; //mondiv ondersteuningsvorm archiveren per groep
// public $version = '1.21.03M '; //mondiv ondersteuningsvorm archiveren per groep
public $version = '1.21.04M '; //mondiv ondersteuningsvorm archiveren per groep foutem hersteld
@@ -37,13 +37,14 @@ class Aantalxondersteuningsvorm_model extends MY_Model{
return $this->get_query_row('aantal');
}
function getaantallen($vormid, $orgid){
function getaantallen($vormid, $orgid, $schooljaarnr, $groepsids){
$this->sql ="SELECT G.id, G.naam, IF(AOS.id,aantal,0) AS aantal
FROM tb_groepen G
LEFT JOIN tb_aantalxondersteuningsvorm AOS ON ( G.id = AOS.groep_id
AND AOS.ondersteuningsvorm_id = {$vormid})
WHERE G.organisatie_id = {$orgid}
AND G.schooljaarnr = {$schooljaarnr}
AND G.id IN ({$groepsids})
ORDER BY G.niveau, G.naam, G.id";
return $this->get_query_result();
}
+84 -63
View File
@@ -13,23 +13,32 @@ class Groepen_model extends MY_Model{
$this->load->model($models);
}
function getgroep($groepid){
$this->sql = "SELECT GR.id,
GR.naam,
GR.totaantal,
SUM(IF( nivo = 2, AX.aantal, 0)) AS som2,
SUM(IF( nivo = 3, AX.aantal, 0)) AS som3,
SUM(IF( nivo = 4, AX.aantal, 0)) AS som4,
(totaantal - SUM(AX.aantal) ) AS som1
FROM tb_groepen GR
LEFT JOIN tb_aantalxondersteuningsvorm AX
ON GR.id = AX.groep_id
LEFT JOIN tb_ondersteuningsvormen OV
ON OV.id = AX.ondersteuningsvorm_id
WHERE GR.id = {$groepid}
GROUP BY GR.id";
return $this->get_query_row();
}
function getgroep($groepid){
$this->sql = "SELECT GR.id,
GR.naam,
GR.totaantal,
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som2,
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som3,
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som4,
( GR.totaantal - (
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0)
)
) AS som1
FROM tb_groepen GR
LEFT JOIN tb_aantalxondersteuningsvorm AX
ON GR.id = AX.groep_id
LEFT JOIN tb_ondersteuningsvormen OV
ON OV.id = AX.ondersteuningsvorm_id
WHERE GR.id = {$groepid}
GROUP BY GR.id";
return $this->get_query_row();
}
function getgroepenlist($orgid, $schooljaarnr, $module){
$this->sql = "SELECT id, naam, ondersteuning
FROM tb_groepen
@@ -81,55 +90,67 @@ class Groepen_model extends MY_Model{
return $this->get_query_row('aantallln');
}
function getgroepen($orgid, $schooljaarnr, $module){
$this->sql = "SELECT GR.id,
GR.naam,
GR.niveau,
GR.totaantal,
GR.ondersteuning,
SUM(IF( nivo = 2, AX.aantal, 0)) AS som2,
SUM(IF( nivo = 3, AX.aantal, 0)) AS som3,
SUM(IF( nivo = 4, AX.aantal, 0)) AS som4,
(GR.totaantal - IF(SUM(AX.aantal) , SUM(AX.aantal),0) ) AS som1
FROM tb_groepen GR
LEFT JOIN tb_aantalxondersteuningsvorm AX
ON GR.id = AX.groep_id
LEFT JOIN tb_ondersteuningsvormen OV
ON OV.id = AX.ondersteuningsvorm_id
WHERE GR.organisatie_id = {$orgid}
AND GR.schooljaarnr = {$schooljaarnr}
AND GR.schooltype = 'R'
AND GR.module = {$module}
GROUP BY GR.id
ORDER BY niveau, naam, GR.id ";
return $this->get_query_result();
}
function getgekopieerdegroepen($orgid, $schooljaarnr, $module){
$this->sql = "SELECT GR.id,
GR.naam,
GR.niveau,
GR.totaantal,
SUM(IF( nivo = 2, AX.aantal, 0)) AS som2,
SUM(IF( nivo = 3, AX.aantal, 0)) AS som3,
SUM(IF( nivo = 4, AX.aantal, 0)) AS som4,
(GR.totaantal - IF(SUM(AX.aantal) , SUM(AX.aantal),0) ) AS som1
FROM tb_groepen GR
LEFT JOIN tb_aantalxondersteuningsvorm AX
ON GR.id = AX.groep_id
LEFT JOIN tb_ondersteuningsvormen OV
ON OV.id = AX.ondersteuningsvorm_id
WHERE GR.organisatie_id = {$orgid}
AND GR.schooljaarnr = {$schooljaarnr}
AND GR.schooltype = 'R'
AND GR.module = {$module}
GROUP BY GR.id
ORDER BY niveau, naam, GR.id ";
function getgroepen($orgid, $schooljaarnr, $module){
$this->sql = "SELECT GR.id,
GR.naam,
GR.niveau,
GR.totaantal,
GR.ondersteuning,
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som2,
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som3,
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som4,
( GR.totaantal - (
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0)
)
) AS som1
FROM tb_groepen GR
LEFT JOIN tb_aantalxondersteuningsvorm AX
ON GR.id = AX.groep_id
LEFT JOIN tb_ondersteuningsvormen OV
ON OV.id = AX.ondersteuningsvorm_id
WHERE GR.organisatie_id = {$orgid}
AND GR.schooljaarnr = {$schooljaarnr}
AND GR.schooltype = 'R'
AND GR.module = {$module}
GROUP BY GR.id
ORDER BY niveau, naam, GR.id ";
return $this->get_query_result();
}
function getgekopieerdegroepen($orgid, $schooljaarnr, $module){
$this->sql = "SELECT GR.id,
GR.naam,
GR.niveau,
GR.totaantal,
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som2,
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som3,
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) AS som4,
( GR.totaantal - (
COALESCE(SUM(IF(OV.nivo = 2 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
COALESCE(SUM(IF(OV.nivo = 3 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0) +
COALESCE(SUM(IF(OV.nivo = 4 AND (AX.archief IS NULL OR AX.archief <> 'T'), AX.aantal, 0)),0)
)
) AS som1
FROM tb_groepen GR
LEFT JOIN tb_aantalxondersteuningsvorm AX
ON GR.id = AX.groep_id
LEFT JOIN tb_ondersteuningsvormen OV
ON OV.id = AX.ondersteuningsvorm_id
WHERE GR.organisatie_id = {$orgid}
AND GR.schooljaarnr = {$schooljaarnr}
AND GR.schooltype = 'R'
AND GR.module = {$module}
GROUP BY GR.id
ORDER BY niveau, naam, GR.id ";
return $this->get_query_result();
}
function getGroepenSboSo($orgid, $schooljaarnr){
$this->sql = "SELECT GR.id,
@@ -30,10 +30,10 @@
data-bind="click: $parent.fDeleteGroep, visible: $parent.writer()"></button></td>
<td class="vat" data-bind="text: naam"></td>
<td class="vat" style="text-align:right" data-bind="text: totaantal"></td>
<td class="vat" style="text-align:right" data-bind="text: som1() > 0 ? som1 : '' "></td>
<td class="vat" style="text-align:right" data-bind="text: som2() > 0 ? som2 : '' " ></td>
<td class="vat" style="text-align:right" data-bind="text: som3() > 0 ? som3 : ''" ></td>
<td class="vat" style="text-align:right" data-bind="text: som4() > 0 ? som4 : '' " ></td>
<td class="vat" style="text-align:right" data-bind="text: som1() > 0 ? som1() : '' "></td>
<td class="vat" style="text-align:right" data-bind="text: som2() > 0 ? som2() : '' " ></td>
<td class="vat" style="text-align:right" data-bind="text: som3() > 0 ? som3() : ''" ></td>
<td class="vat" style="text-align:right" data-bind="text: som4() > 0 ? som4() : '' " ></td>
<td class="vat" style="padding-left:15px">
<!-- ko foreach: leerkrachten-->
<span data-bind="text:fullname"></span><br />
@@ -83,7 +83,7 @@
<td style="vertical-align:top">
<!-- ko foreach: $parent.leerkrachten -->
<p style="margin:0px" data-bind="text: fullname, visible: selected()"></p>
<p style="margin:0" data-bind="text: fullname, visible: selected()"></p>
<!-- /ko -->
<div data-bind="visible: toonLK"
+20 -26
View File
@@ -6,12 +6,12 @@ $(function(){
this.id = p.id;
this.naam = p.naam
this.niveau = p.niveau;
this.totaantal = ko.observable(p.totaantal);
this.aantal2 = ko.observable(p.totaantal);
this.som1 = ko.observable(p.som1);
this.som2 = ko.observable(p.som2);
this.som3 = ko.observable(p.som3);
this.som4 = ko.observable(p.som4);
this.totaantal = ko.observable(parseInt(p.totaantal, 10)|| 0);
this.aantal2 = ko.observable(parseInt(p.totaantal, 10) || 0);
this.som1 = ko.observable(parseInt(p.som1, 10)|| 0);
this.som2 = ko.observable(parseInt(p.som2, 10)|| 0);
this.som3 = ko.observable(parseInt(p.som3, 10)|| 0);
this.som4 = ko.observable(parseInt(p.som4, 10)|| 0);
this.leerkrachten = ko.observableArray([]);
var dit = this;
if (p.leerkrachten){
@@ -335,14 +335,15 @@ $(function(){
}
});
}) // delete groepxuser
self.selectedGroep().totaantal(self.editGroep().totaantal());
self.selectedGroep().totaantal(parseInt(self.editGroep().totaantal(), 10));
// hier alle regels en/of aantallen opslaan
self.selectedGroep().som1(self.selectedGroep().totaantal());
self.selectedGroep().som2(0);
self.selectedGroep().som3(0);
self.selectedGroep().som4(0);
self.selectedGroep().som1(parseInt(self.editGroep().basis(), 10) || 0);
self.selectedGroep().som2(parseInt(self.editGroep().totplus(), 10) || 0);
self.selectedGroep().som3(parseInt(self.editGroep().totextra(), 10) || 0);
self.selectedGroep().som4(parseInt(self.editGroep().totextraplus(), 10) || 0);
if (self.editGroep().ondersteuningsvormen()){
$.each(self.editGroep().ondersteuningsvormen(), function(i,p){
@@ -360,18 +361,8 @@ $(function(){
if (p.id == null || p.id == 0) p.id = result;
}
},'json');
// HIER NOG OPTELLEN VAN LEERLINGEN PER ONDERSTEUNINGSVORM VOOR SELECTED GROEP
if (p.aantal()) {
self.selectedGroep().som1(self.selectedGroep().som1() - parseInt(p.aantal()));
switch (p.nivo){
case '2': self.selectedGroep().som2( self.selectedGroep().som2() + parseInt(p.aantal()));
break;
case '3': self.selectedGroep().som3( self.selectedGroep().som3() + parseInt(p.aantal()));
break;
case '4': self.selectedGroep().som4(self.selectedGroep().som4() + parseInt(p.aantal()));
break;
}
} ; // if p.aantal
}); // each
}// if
@@ -547,7 +538,7 @@ $(function(){
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" +
if(parseInt(dit.aantal()) > 0) waarschuwing = waarschuwing + "<br/>De leerlingen in deze groep die toegewezen zijn aan deze" +
" ondersteuningsvorm worden ingedeeld in de basisondersteuning."
let sd ={
@@ -591,9 +582,12 @@ $(function(){
var self = ls.GroepenModel;
var dit = this;
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(parseInt(dit.aantal(), 10) > 0)waarschuwing = waarschuwing + "</br/> De leerlingen die toegewezen zijn aan deze ondersteuningsvorm worden ingedeeld in de basisondersteuning.";
console.log(dit, 'dit')
console.log(waarschuwing, 'waarschuwing')
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);