From e0b2b12483c1fa4651a72da0c4b26646456b3dc3 Mon Sep 17 00:00:00 2001 From: Monique Hansma Date: Mon, 26 Jun 2023 12:36:02 +0200 Subject: [PATCH 1/7] werkt dit beter --- application/controllers/monfin2/Bestemmingen.php | 9 +++++---- public/js/monpas/models/monfin2/bestemmingen.js | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/application/controllers/monfin2/Bestemmingen.php b/application/controllers/monfin2/Bestemmingen.php index 3b18084..6478fe2 100644 --- a/application/controllers/monfin2/Bestemmingen.php +++ b/application/controllers/monfin2/Bestemmingen.php @@ -87,9 +87,10 @@ class Bestemmingen extends MY_Controller{ $bestemmingID = $this->clean_input("id"); $targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid); $bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true); - if ($targetjaar >= $bestemmingjaar){ +// if ($targetjaar >= $bestemmingjaar){ $this->Finbestemmingen_model->update_record(['bedrag'=>$this->clean_input('bedrag')], $bestemmingID); - } + +// } $record = $this->Finbestemmingen_model->get_record_by_id($bestemmingID); json_encode(['record'=>$record]); } @@ -99,9 +100,9 @@ class Bestemmingen extends MY_Controller{ $bestemmingID = $this->clean_input("id"); $targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid); $bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true); - if ($targetjaar >= $bestemmingjaar) { +// if ($targetjaar >= $bestemmingjaar) { $this->Finbestemmingen_model->update_record(['budget' => $this->clean_input('budget')], $bestemmingID); - } +// } } diff --git a/public/js/monpas/models/monfin2/bestemmingen.js b/public/js/monpas/models/monfin2/bestemmingen.js index ab8b1af..d675500 100644 --- a/public/js/monpas/models/monfin2/bestemmingen.js +++ b/public/js/monpas/models/monfin2/bestemmingen.js @@ -198,6 +198,7 @@ ls.initBestemmingenModel = function(){ 'bedrag': subtotaal, } + $.post("index.php/monfin2/bestemmingen/updatebedrag", sd, function(data){ }, 'json'); @@ -444,6 +445,7 @@ ls.initBestemmingenModel = function(){ 'bedrag': invoer } + console.log(sd, 'bedrag') $.post("index.php/monfin2/bestemmingen/updatebedrag", sd); var sd2 = { @@ -452,6 +454,7 @@ ls.initBestemmingenModel = function(){ } $.post("index.php/monfin2/bestemmingen/updatebedrag", sd2); + console.log(sd, 'regeltotaal') }, @@ -623,6 +626,7 @@ ls.initBestemmingenModel = function(){ 'budget': invoer } + console.log(invoer, 'budget') $.post("index.php/monfin2/bestemmingen/updatebudget", sd); }, From e47f0a9a6c60d3882774a2f6f3ee4996ced74e16 Mon Sep 17 00:00:00 2001 From: Monique Hansma Date: Mon, 26 Jun 2023 12:42:44 +0200 Subject: [PATCH 2/7] last result --- application/controllers/monfin2/Bestemmingen.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/controllers/monfin2/Bestemmingen.php b/application/controllers/monfin2/Bestemmingen.php index 6478fe2..2e297c4 100644 --- a/application/controllers/monfin2/Bestemmingen.php +++ b/application/controllers/monfin2/Bestemmingen.php @@ -87,10 +87,10 @@ class Bestemmingen extends MY_Controller{ $bestemmingID = $this->clean_input("id"); $targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid); $bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true); -// if ($targetjaar >= $bestemmingjaar){ + if ($targetjaar >= $bestemmingjaar){ $this->Finbestemmingen_model->update_record(['bedrag'=>$this->clean_input('bedrag')], $bestemmingID); -// } + } $record = $this->Finbestemmingen_model->get_record_by_id($bestemmingID); json_encode(['record'=>$record]); } @@ -100,9 +100,10 @@ class Bestemmingen extends MY_Controller{ $bestemmingID = $this->clean_input("id"); $targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid); $bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true); -// if ($targetjaar >= $bestemmingjaar) { + if ($targetjaar >= $bestemmingjaar) { $this->Finbestemmingen_model->update_record(['budget' => $this->clean_input('budget')], $bestemmingID); -// } + echo $this->db->last_query(); + } } From a3564ff04834ce68c1390063aa2762efc54c01f3 Mon Sep 17 00:00:00 2001 From: Monique Hansma Date: Mon, 26 Jun 2023 12:47:41 +0200 Subject: [PATCH 3/7] if uitgezet --- application/controllers/monfin2/Bestemmingen.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/monfin2/Bestemmingen.php b/application/controllers/monfin2/Bestemmingen.php index 2e297c4..466eabb 100644 --- a/application/controllers/monfin2/Bestemmingen.php +++ b/application/controllers/monfin2/Bestemmingen.php @@ -100,10 +100,10 @@ class Bestemmingen extends MY_Controller{ $bestemmingID = $this->clean_input("id"); $targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid); $bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true); - if ($targetjaar >= $bestemmingjaar) { +// if ($targetjaar >= $bestemmingjaar) { $this->Finbestemmingen_model->update_record(['budget' => $this->clean_input('budget')], $bestemmingID); echo $this->db->last_query(); - } +// } } From c26d3b25074fbbcee2c91ae2c4d0b385076108df Mon Sep 17 00:00:00 2001 From: Monique Hansma Date: Mon, 26 Jun 2023 12:51:51 +0200 Subject: [PATCH 4/7] nog een test --- application/controllers/monfin2/Bestemmingen.php | 5 ++--- public/js/monpas/models/monfin2/bestemmingen.js | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/application/controllers/monfin2/Bestemmingen.php b/application/controllers/monfin2/Bestemmingen.php index 466eabb..566f845 100644 --- a/application/controllers/monfin2/Bestemmingen.php +++ b/application/controllers/monfin2/Bestemmingen.php @@ -87,10 +87,10 @@ class Bestemmingen extends MY_Controller{ $bestemmingID = $this->clean_input("id"); $targetjaar = $this->Toewijzingen_model->getNextJaar($this->globorgid); $bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true); - if ($targetjaar >= $bestemmingjaar){ +// if ($targetjaar >= $bestemmingjaar){ $this->Finbestemmingen_model->update_record(['bedrag'=>$this->clean_input('bedrag')], $bestemmingID); - } +// } $record = $this->Finbestemmingen_model->get_record_by_id($bestemmingID); json_encode(['record'=>$record]); } @@ -102,7 +102,6 @@ class Bestemmingen extends MY_Controller{ $bestemmingjaar = $this->Finbestemmingen_model->get(['id'=>$bestemmingID], 'kalenderjaar', true); // if ($targetjaar >= $bestemmingjaar) { $this->Finbestemmingen_model->update_record(['budget' => $this->clean_input('budget')], $bestemmingID); - echo $this->db->last_query(); // } } diff --git a/public/js/monpas/models/monfin2/bestemmingen.js b/public/js/monpas/models/monfin2/bestemmingen.js index d675500..c52a460 100644 --- a/public/js/monpas/models/monfin2/bestemmingen.js +++ b/public/js/monpas/models/monfin2/bestemmingen.js @@ -626,7 +626,6 @@ ls.initBestemmingenModel = function(){ 'budget': invoer } - console.log(invoer, 'budget') $.post("index.php/monfin2/bestemmingen/updatebudget", sd); }, From 1480cd5a2f82d86e1ea4211fd371ba5c66f42e5f Mon Sep 17 00:00:00 2001 From: Monique Hansma Date: Mon, 26 Jun 2023 13:32:47 +0200 Subject: [PATCH 5/7] als restant 0 is leeg veld --- application/core/MY_Controller.php | 2 +- public/js/monpas/models/monfin2/bestemmingen.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index 1fd7213..d16812e 100644 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -84,7 +84,7 @@ class MY_Controller extends CI_Controller{ // public $version = '1.19.06';// monfin met budgetten // public $version = '1.20.03';// monfin met budgetten // public $version = '1.20.04';// monfin met budgetten update - public $version = '1.20.05';// monfin met budgetten update + public $version = '1.20.06';// monfin met budgetten update public $partituurid; public $globProfielVersieID = 1; public $userid; //id of the user that is logged in diff --git a/public/js/monpas/models/monfin2/bestemmingen.js b/public/js/monpas/models/monfin2/bestemmingen.js index c52a460..8267f8d 100644 --- a/public/js/monpas/models/monfin2/bestemmingen.js +++ b/public/js/monpas/models/monfin2/bestemmingen.js @@ -518,6 +518,8 @@ ls.initBestemmingenModel = function(){ dit.budget(invoer); stuurMelding = false; totaalgebudget = Number(totaalgebudget) + Number(s.uitgavetypes()[0].budget()) + + console.log(subbudget , 'subbudget bij wijzigen scholing') } break; @@ -536,7 +538,7 @@ ls.initBestemmingenModel = function(){ else dit.budgetFormat(''); var restant = Number(s.uitgavetypes()[0].budget()) - subbudget; s.uitgavetypes()[4].budget(restant); - if(restant > 0 ) s.uitgavetypes()[4].budgetFormat(parseFloat(restant).format(2, 3, '.', ',')); + Number(restant) === 0 ? s.uitgavetypes()[4].budgetFormat(''): s.uitgavetypes()[4].budgetFormat(parseFloat(restant).format(2, 3, '.', ',')); } } @@ -550,6 +552,8 @@ ls.initBestemmingenModel = function(){ }) }) + + if(stuurMelding) return; if (parseFloat(totaalgebudget) > 0) { totaalgebudgetForm = parseFloat(totaalgebudget).format(2, 3, '.', ','); From 89843a9f6ce9b5086f60c002827e56bf8f682da6 Mon Sep 17 00:00:00 2001 From: Monique Hansma Date: Fri, 30 Jun 2023 13:43:06 +0200 Subject: [PATCH 6/7] hoger kalenderjaar ivm budgettering --- application/core/MY_Controller.php | 2 +- public/js/monpas/models/monfin2/monfinoverzicht2.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index d16812e..9f42a52 100644 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -84,7 +84,7 @@ class MY_Controller extends CI_Controller{ // public $version = '1.19.06';// monfin met budgetten // public $version = '1.20.03';// monfin met budgetten // public $version = '1.20.04';// monfin met budgetten update - public $version = '1.20.06';// monfin met budgetten update + public $version = '1.20.07';// monfin met budgetten update hogere kalenderjaren public $partituurid; public $globProfielVersieID = 1; public $userid; //id of the user that is logged in diff --git a/public/js/monpas/models/monfin2/monfinoverzicht2.js b/public/js/monpas/models/monfin2/monfinoverzicht2.js index ed06400..a32d325 100644 --- a/public/js/monpas/models/monfin2/monfinoverzicht2.js +++ b/public/js/monpas/models/monfin2/monfinoverzicht2.js @@ -79,7 +79,7 @@ ls.initMonfinOverzicht2Model = function(){ if (!ko.dataFor(document.getElementById('pagmonfinoverzicht2')) ) { ko.applyBindings(ls.MonfinOverzicht2Model, document.getElementById("pagmonfinoverzicht2")); } - $.post("index.php/monpas/monfinoverzicht/getkalenderjarenMetMax", function(data){ + $.post("index.php/monpas/monfinoverzicht/getkalenderjaren", function(data){ self.kalenderjaren.removeAll(); if (data){ $.each(data, function(j,k){ From 4c1536e8b375ebea22e9947b26dfa1fd2498ef54 Mon Sep 17 00:00:00 2001 From: Monique Hansma Date: Mon, 3 Jul 2023 12:08:17 +0200 Subject: [PATCH 7/7] stappenplanBAO --- .../controllers/monpas/Rapijkpunten.php | 5 +- .../controllers/monpas/Rapontwikkel.php | 2 +- application/models/monpas/Labels_model.php | 77 +++++++++++-------- application/views/monpas/pages/matrix.php | 2 +- public/js/monpas/models/matrixmodel.js | 5 +- public/js/monpas/models/ontwikkelmodel.js | 3 +- 6 files changed, 59 insertions(+), 35 deletions(-) diff --git a/application/controllers/monpas/Rapijkpunten.php b/application/controllers/monpas/Rapijkpunten.php index 7fe639d..a5c3719 100644 --- a/application/controllers/monpas/Rapijkpunten.php +++ b/application/controllers/monpas/Rapijkpunten.php @@ -154,6 +154,8 @@ class Rapijkpunten extends MY_Controller{ if (!$this->userid) die; $targetid = $this->uri->segment(4);// orgid $module = $this->session->userdata('module'); + $label = $this->Labels_model->get_label_by_id($module, '1'); + // get de lijst van scholen onder de target $idlijst = $this->Organisaties_model->getscholenondertarget2($targetid); if($idlijst) { @@ -166,7 +168,8 @@ class Rapijkpunten extends MY_Controller{ foreach ($versies as $versie) { $versie->scoreomschrijving = $this->Antwoordtypes_model->gettype($versie->scoretype); } - echo json_encode($versies); + echo json_encode(['versies' =>$versies, + 'label' =>$label]); } else{ echo json_encode(false); diff --git a/application/controllers/monpas/Rapontwikkel.php b/application/controllers/monpas/Rapontwikkel.php index 4735447..6c1fbb6 100644 --- a/application/controllers/monpas/Rapontwikkel.php +++ b/application/controllers/monpas/Rapontwikkel.php @@ -77,7 +77,7 @@ class Rapontwikkel extends MY_Controller { $scores = NULL; $gewenst = NULL; $orgversie = $this->Orgversies_model->get_record_by_id($orgversieid); - if($orgversie->scoretype == 7){ + if($orgversie && $orgversie->scoretype == 7){ $grens1 = 33; $grens2 = 66; $grens3 = 100; diff --git a/application/models/monpas/Labels_model.php b/application/models/monpas/Labels_model.php index 84163c0..e7032de 100644 --- a/application/models/monpas/Labels_model.php +++ b/application/models/monpas/Labels_model.php @@ -2,60 +2,68 @@ /** Labels_model januari 2015 */ -class Labels_model extends MY_Model{ +class Labels_model extends MY_Model +{ - protected $tablename = 'tb_labels'; - - function __construct(){ - parent::__construct(); - $models = array(); - $this->load->model($models); - } + protected $tablename = 'tb_labels'; - function getLabel($sysnr){ - $this->sql="SELECT waarde + function __construct() + { + parent::__construct(); + $models = array(); + $this->load->model($models); + } + + function getLabel($sysnr) + { + $this->sql = "SELECT waarde FROM tb_translate WHERE modulenr = {$sysnr} "; return $this->get_query_row("waarde"); } - function getLabels($module){ - $this->sql="SELECT * + function getLabels($module) + { + $this->sql = "SELECT * FROM tb_translate WHERE modulenr = {$module} "; - return $this->get_query_result(); + return $this->get_query_result(); } - function getalllabels($module = false){ - if (! $module) $module = $this->session->userdata('module'); - $this->sql="SELECT L.omschrijving, T.waarde + function getalllabels($module = false) + { + if (!$module) $module = $this->session->userdata('module'); + $this->sql = "SELECT L.omschrijving, T.waarde FROM tb_translate T JOIN tb_labels L on L.id = T.labelid - WHERE modulenr = {$module}"; - $labels = $this->get_query_result(); - $lbl = array(); - if ($labels){ - foreach($labels as $label){ - $lbl[$label->omschrijving]=$label->waarde; - };// foreach - } - return $lbl; - } + WHERE modulenr = {$module}"; + $labels = $this->get_query_result(); + $lbl = array(); + if ($labels) { + foreach ($labels as $label) { + $lbl[$label->omschrijving] = $label->waarde; + };// foreach + } + return $lbl; + } - function gettabellabel($modulenr){ - $this->sql="SELECT waarde + function gettabellabel($modulenr) + { + $this->sql = "SELECT waarde FROM tb_translate T WHERE modulenr = {$modulenr} AND labelid = 2 "; return $this->get_query_row("waarde"); } - function getresultaatlabel($modulenr){ - $this->sql="SELECT waarde + + function getresultaatlabel($modulenr) + { + $this->sql = "SELECT waarde FROM tb_translate T WHERE modulenr = {$modulenr} AND labelid = 1 "; @@ -63,4 +71,13 @@ class Labels_model extends MY_Model{ } + function get_label_by_id($module, $id) + { + $this->sql = "SELECT waarde + FROM tb_translate T + WHERE modulenr = {$module} + AND labelid = {$id} "; + return $this->get_query_row("waarde"); + } } + diff --git a/application/views/monpas/pages/matrix.php b/application/views/monpas/pages/matrix.php index c2fb544..54062f5 100644 --- a/application/views/monpas/pages/matrix.php +++ b/application/views/monpas/pages/matrix.php @@ -180,7 +180,7 @@
- Klik op een ijkpuntnummer voor toelichting. + Klik op een nummer voor toelichting. diff --git a/public/js/monpas/models/matrixmodel.js b/public/js/monpas/models/matrixmodel.js index 124cb57..f29122e 100644 --- a/public/js/monpas/models/matrixmodel.js +++ b/public/js/monpas/models/matrixmodel.js @@ -169,6 +169,7 @@ $(function () { bezig : ko.observable(false), druk : ko.observable(false), data : ko.observable(false), + ijknummer :ko.observable('ijkpuntnummer'), kolombreedte : ko.pureComputed(function(){ var row = 708; var orgbreedte = 250 @@ -268,7 +269,9 @@ $(function () { self.orgversions.removeAll(); if (data) { - $.each(data, function (i, p) { + self.ijknummer(data.label); + $.each(data.versies, function (i, p) { + self.orgversions.push(new fAddOrgversion(p)); }) if(versieid != null ){ diff --git a/public/js/monpas/models/ontwikkelmodel.js b/public/js/monpas/models/ontwikkelmodel.js index 2ecf3f5..ed6f4ad 100644 --- a/public/js/monpas/models/ontwikkelmodel.js +++ b/public/js/monpas/models/ontwikkelmodel.js @@ -147,6 +147,7 @@ ls.initOntwikkelModel = function(){ }, initModel: function() { var self = ls.OntwikkelModel; + console.log('nu hier') $.post("index.php/monpas/rapijkpunten/checkLevel", function(data){ if(data){ @@ -242,7 +243,7 @@ ls.initOntwikkelModel = function(){ self.wijzigRecht(false); self.bezig(true); if (data){ - $.each(data,function(i,p){ + $.each(data.versies,function(i,p){ self.orgversions.push(new fAddOrgversion(p)); }) }