diff --git a/application/controllers/monpas/Rapontwikkel.php b/application/controllers/monpas/Rapontwikkel.php index caf9394..4735447 100644 --- a/application/controllers/monpas/Rapontwikkel.php +++ b/application/controllers/monpas/Rapontwikkel.php @@ -100,15 +100,16 @@ class Rapontwikkel extends MY_Controller { if ( $schoolids ) { $lijst = implode( ',', $schoolids ); - $scores = $this->Scores_model->calculateOverScholenNieuw( $orgversieid, $lijst ); + } } if ( $organisatie->soort == 4 ) { -// $scores = $this->Scores_model->calculateschool( $orgversieid, $orgid ); - $scores = $this->Scores_model->getgemscores( $orgversieid, $orgid ); + $lijst = $organisatie->id; // } + + $scores = $this->Scores_model->getgemscores( $orgversieid, $lijst); if ( $scores ) { $gewenst = $this->Wenssituaties_model->getgewenst( $orgversieid, $orgid ); diff --git a/application/libraries/monpas/Gemiddeldenafbeeldingen.php b/application/libraries/monpas/Gemiddeldenafbeeldingen.php index a17603d..0df8f5d 100644 --- a/application/libraries/monpas/Gemiddeldenafbeeldingen.php +++ b/application/libraries/monpas/Gemiddeldenafbeeldingen.php @@ -229,8 +229,9 @@ class Gemiddeldenafbeeldingen { if($deler > 0) $this->gemiddelde->score = round($this->somscore / $deler); - $this->gemiddelde->nummer = 'gem'; - $this->gemiddelde->disabled = 'F'; + $this->gemiddelde->nummer = 'gem'; + $this->gemiddelde->disabled = 'F'; + $this->gemiddelde->disablenvt = 'F'; $this->gemiddelde->kleur =$this->getKleur ($this->gemiddelde->score); $this->ijkpunt = $this->gemiddelde; } diff --git a/application/libraries/monpas/ijkpunten/Bestuurscores.php b/application/libraries/monpas/ijkpunten/Bestuurscores.php index d0630e1..a0c1b2e 100644 --- a/application/libraries/monpas/ijkpunten/Bestuurscores.php +++ b/application/libraries/monpas/ijkpunten/Bestuurscores.php @@ -3,7 +3,6 @@ class Bestuurscores { private $CI; - private $organisatie; private $scores; private $orgstring; private $metingen; @@ -29,15 +28,12 @@ class Bestuurscores private function handle(){ - $this->setOrg(); + $this->setOrglist(); $this->setScores(); $this->setMetingen(); } - private function setOrg(){ - $this->organisatie = $this->CI->Organisaties_model->get_record_by_id($this->orgid); - } private function setOrglist(){ $orglist = $this->CI->Organisaties_model->getlistrecursief($this->orgid, []); diff --git a/application/libraries/monpas/ijkpunten/Individuelescores.php b/application/libraries/monpas/ijkpunten/Individuelescores.php index e61573e..10f10ab 100644 --- a/application/libraries/monpas/ijkpunten/Individuelescores.php +++ b/application/libraries/monpas/ijkpunten/Individuelescores.php @@ -24,7 +24,8 @@ class Individuelescores private function handle(){ $this->setUserid(); $this->setScores(); -// $this->telScores(); + $this->loopScores(); + } private function setUserid(){ @@ -35,6 +36,27 @@ class Individuelescores $this->scores = $this->CI->Scores_model->calculateindividualscores($this->orgversieid, $this->orgid, $this->userid); } + private function loopScores(){ + if(! isset($this->scores) || $this->scores == false ) return; + foreach($this->scores as $this->score) { + $this->setNietVanToepassing(); + $this->setGem(); + } + } + + private function setNietVanToepassing(){ + $this->score->disablenvt = 'F'; + if($this->score->aantalvier> 0 && $this->score->aantalvier == $this->score->aantalnvt) + $this->score->disablenvt = 'T'; + + } + + private function setGem(){ + $this->score->gem = 0; + if(isset($this->score->somscore) && $this->score->num > 0) { + $this->score->gem = $this->score->somscore/$this->score->num; + } + } } \ No newline at end of file diff --git a/application/libraries/monpas/ijkpunten/Lijsten.php b/application/libraries/monpas/ijkpunten/Lijsten.php index 1e02b50..a7e9ac6 100644 --- a/application/libraries/monpas/ijkpunten/Lijsten.php +++ b/application/libraries/monpas/ijkpunten/Lijsten.php @@ -232,9 +232,6 @@ class Lijsten if ($this->soort != 3) return; $this->bestuurScores = new Bestuurscores($this->lijst->orgversieid, $this->orgid, $this->lijst->vorm); if ($this->bestuurScores) { - $metingen = $this->bestuurScores->getMetingen(); - $this->metingen = $metingen->aantal; - $this->aantalorgs = $metingen->aantalorgs; $this->bestuurAfbeeldingen = new Afbeeldingen($this->bestuurScores, $this->modulenr, $this->lijst->orgversieid, $this->clusterid, $this->orgid, $this->zprocent); } @@ -244,10 +241,6 @@ class Lijsten if($this->soort == 1) return; $this->kamerScores = new Kamerscores($this->lijst->orgversieid, $this->orgid, $this->lijst->vorm); if($this->kamerScores) { - $metingen = $this->kamerScores->getMetingen(); - $this->metingen = $metingen->aantal; - $this->aantalorgs = $metingen->aantalorgs; - $this->kamerAfbeeldingen = new Afbeeldingen($this->kamerScores, $this->modulenr, $this->lijst->orgversieid, $this->clusterid, $this->orgid, $this->zprocent); } @@ -257,10 +250,6 @@ class Lijsten if ($this->soort == 3 || $this->soort == 4 ) return; $this->swvScores = new Swvscores($this->lijst->orgversieid, $this->orgid, $this->lijst->vorm); if($this->swvScores) { - $metingen = $this->swvScores->getMetingen(); - $this->metingen = $metingen->aantal; - $this->aantalorgs = $metingen->aantalorgs; - $this->swvAfbeeldingen = new Afbeeldingen($this->swvScores, $this->modulenr, $this->lijst->orgversieid, $this->clusterid, $this->orgid, $this->zprocent); } @@ -343,7 +332,7 @@ class Lijsten if(count((array)$this->gemiddeldenAfbeeldingen) == 0) return; foreach($this->lijst->scores as $index => $this->score){ $this->score->gem = 0; - if($this->score->score) { + if(isset($this->score->score) && $this->score->score > 0) { $this->score->gem = $this->score->score; } } diff --git a/application/libraries/monpas/ijkpunten/Userlijsten.php b/application/libraries/monpas/ijkpunten/Userlijsten.php index 71441bb..c52dfd7 100644 --- a/application/libraries/monpas/ijkpunten/Userlijsten.php +++ b/application/libraries/monpas/ijkpunten/Userlijsten.php @@ -83,7 +83,10 @@ class Userlijsten } private function setLabels(){ - $this->lijst->labels = $this->CI->Labels_model->getalllabels($this->modulenr); +// $this->lijst->labels = $this->CI->Labels_model->getalllabels($this->modulenr); + $this->lijst->label = $this->CI->Labels_model->gettabellabel($this->modulenr); + $this->lijst->label2 = $this->CI->Labels_model->getresultaatlabel($this->modulenr); + } private function setAmbities(){ @@ -134,39 +137,44 @@ class Userlijsten private function loopVergelijkingScores(){ - if( (!isset($this->lijst->vergelijkingen))) return; - for($i = 0; $i < count($this->lijst->vergelijkingen); $i++){ + if( (!isset($this->lijst->vergelijkingen) ||$this->lijst->vergelijkingen== false )) return; + for($i = 0; $i < count($this->lijst->scores); $i++){ $this->setVergelijkingScores($i); } } private function setVergelijkingScores($i){ - if($this->lijst->scores[$i]) { - $this->lijst->scores[$i]->gemV = $this->lijst->vergelijkingen[$i]->gem; - $this->lijst->scores[$i]->kleurV = $this->lijst->vergelijkingen[$i]->kleur; + if($this->lijst->vergelijkingen[$i]) { + $this->lijst->scores[$i]->gemV = $this->lijst->vergelijkingen[$i]->gem; + $this->lijst->scores[$i]->kleurV = $this->lijst->vergelijkingen[$i]->kleur; + $this->lijst->scores[$i]->disabledV = $this->lijst->vergelijkingen[$i]->disabled; + $this->lijst->scores[$i]->disablenvtV = $this->lijst->vergelijkingen[$i]->disablenvt; + } } private function setIndividueleMetingen(){ - if(!isset($this->lijst->scores)) return; - $metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgid); - if($metingen){ - $this->lijst->metingen = $metingen->aantal; - $this->lijst->aantalorgs = $metingen->aantalorgs;} + if(!isset($this->lijst->scores)||$this->lijst->scores == false ) return; + $this->lijst->metingen = 1; + $this->lijst->aantalorgs = 1; } + + private function setMetingenVergelijkingIndividueel(){ - if(! isset($this->lijst->vergelijkingen)) return; + if(! isset($this->lijst->vergelijkingen)||$this->lijst->vergelijkingen == false ) return; foreach($this->lijst->vergelijkingen as $index => $this->lijst->vergelijking) { - $metingenV = $this->kamerAfbeeldingen->getMetingen(); + $metingenV = $this->kamerScores->getMetingen(); if($metingenV) { - $this->lijst->metingen = $metingenV->aantal; - $this->lijst->aantalorgs = $metingenV->aantalorgs; + $this->lijst->metingenV = $metingenV->aantal; + $this->lijst->aantalorgsV = $metingenV->aantalorgs; } } } + + private function setVNaam(){ $this->lijst->vNaam = $this->kamerScores->getOrgnaam(); } diff --git a/application/models/monpas/Scores_model.php b/application/models/monpas/Scores_model.php index 652537c..784a955 100644 --- a/application/models/monpas/Scores_model.php +++ b/application/models/monpas/Scores_model.php @@ -26,7 +26,7 @@ class Scores_model extends MY_Model{ return $this->get_query_result(); } function calculateindividualscores($orgversieid, $orgid, $userid){ - $this->sql="SELECT SC.id, filledversion_id, SC.ijkpunt_id, scoretype, score, + $this->sql="SELECT SC.id, filledversion_id, SC.ijkpunt_id, scoretype, score, Y.disabled, SUM(CASE WHEN Y.disabled = 'T' THEN 0 WHEN Y.disabled = 'F' THEN CASE diff --git a/application/models/monpas/Wenssituaties_model.php b/application/models/monpas/Wenssituaties_model.php index 59c325d..80a8c4f 100644 --- a/application/models/monpas/Wenssituaties_model.php +++ b/application/models/monpas/Wenssituaties_model.php @@ -15,9 +15,9 @@ class Wenssituaties_model extends MY_Model{ $this->sql = "SELECT W.id, W.ijkpunt_id, W.wens, Y.disabled FROM tb_wenssituaties W JOIN tb_ijkpunten Y ON W.ijkpunt_id = Y.id - WHERE organisatie_id = {$orgid} - AND Y.disabled = 'F' - AND orgversie_id = {$orgversieid}"; + WHERE organisatie_id = {$orgid} + AND orgversie_id = {$orgversieid} + ORDER BY Y.nummer "; return $this->get_query_result(); } function getgewenstvoorpartituur($orgversieid, $orgid){ diff --git a/application/views/monpas/pages/ijkpunten.php b/application/views/monpas/pages/ijkpunten.php index 0b093f2..32c060d 100644 --- a/application/views/monpas/pages/ijkpunten.php +++ b/application/views/monpas/pages/ijkpunten.php @@ -280,7 +280,7 @@
diff --git a/application/views/monpas/pages/ontwikkel.php b/application/views/monpas/pages/ontwikkel.php index 4f4f955..0427db7 100644 --- a/application/views/monpas/pages/ontwikkel.php +++ b/application/views/monpas/pages/ontwikkel.php @@ -190,12 +190,12 @@