diff --git a/application/controllers/monpas/Beheer.php b/application/controllers/monpas/Beheer.php index e0d3eff..ca66637 100644 --- a/application/controllers/monpas/Beheer.php +++ b/application/controllers/monpas/Beheer.php @@ -138,4 +138,13 @@ class Beheer extends MY_Controller{ "gewicht" => $this->clean_input("gewicht")); $this->Indicatoren_model->update_record($data, $indicatorid); } + + function disableijkpunt(){ + if (!$this->userid ) die; + $ijkpuntid = $this->clean_input("id"); + $disabled = $this->clean_input("disabled"); + $this->Ijkpunten_model->update_record(['disabled' => $disabled ], $ijkpuntid); + + } + } diff --git a/application/controllers/monpas/Rapijkpunten.php b/application/controllers/monpas/Rapijkpunten.php index 8bff2e1..a9b2a4a 100644 --- a/application/controllers/monpas/Rapijkpunten.php +++ b/application/controllers/monpas/Rapijkpunten.php @@ -301,7 +301,8 @@ class Rapijkpunten extends MY_Controller{ $userLijsten = new Userlijsten($orguserid, $orgid, $orgversies); $lijsten = $userLijsten->getLijsten(); $nieuwsteversie = $userLijsten->getNieuwsteVersie(); - +//LS matrixmodel.js verwacht een variable vorm die aangeeft of het een individuele versie is +$lijsten[0]->vorm=2; $data =[ 'lijsten' => $lijsten, 'aantal' => $aantal, diff --git a/application/controllers/monpas/Rapmatrix.php b/application/controllers/monpas/Rapmatrix.php index 7b68362..70bb60d 100644 --- a/application/controllers/monpas/Rapmatrix.php +++ b/application/controllers/monpas/Rapmatrix.php @@ -387,16 +387,19 @@ private function getGemiddeldenSchool($labels, $aantalY, $orgversieID, $kleuren) $aantalrijen = $aantalrijen + 1; for ($i = 0; $i < $aantalY; $i++) { if(isset($user->scores[$i])) { + if($user->scores[$i]->disabled == 'F' && $user->scores[$i]->disablenvt == 'F') { // if ($user->scores[$i]->gem == '' || $user->scores[$i]->gem == null) { // // doe niks // } else { $aantalscores++; $sumscore[$i] = $sumscore[$i] + $user->scores[$i]->gem; $aantalresults[$i] = $aantalresults[$i] + 1; + $sumscorerij = $sumscorerij + $user->scores[$i]->gem; if ($sumscorerij > 0) { $waarden++; } + } // } $user->scores[$i]->kleur = $this->getkleur($user->scores[$i]->gem, $kleuren); @@ -624,6 +627,10 @@ private function getGemiddeldeScores($labels, $aantalY, $kleuren){ $aantalrijen = $aantalrijen + 1; for ($i = 0; $i < $aantalY; $i++) { if(isset($user->scores[$i])) { + if($user->scores[$i]->disabled == 'F' && + ($user->scores[$i]->aantalvier == 0 || + ($user->scores[$i]->aantalvier > 0 && + $user->scores[$i]->aantalnvt != $user->scores[$i]->aantalvier ))){ // if ($user->scores[$i]->gem == '' || $user->scores[$i]->gem == null) { // // doe niks // } else { @@ -634,6 +641,7 @@ private function getGemiddeldeScores($labels, $aantalY, $kleuren){ if ($sumscorerij > 0) { $waarden++; // } + } } $user->scores[$i]->kleur = $this->getkleur($user->scores[$i]->gem, $kleuren); } 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/controllers/monpas/Sop.php b/application/controllers/monpas/Sop.php index 786a9da..9ddc4e7 100644 --- a/application/controllers/monpas/Sop.php +++ b/application/controllers/monpas/Sop.php @@ -117,7 +117,7 @@ class Sop extends MY_Controller{ $nieuweInhoud = $this->Sopinhouden_model->get(['id' => $newID], false, true); // om de vergelijkende versies bij te houden dient // per versie een record in de tabel tb_flexsop_gebruikteversies - // te worden gemaakt. + // te worden gemaakt. // de originele versie staat in de tabel tb_sopinhouden $index = 1; foreach ($vergelijkingen ? $vergelijkingen : [] as $vergelijking){ diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index 1c88118..d911d05 100644 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -55,7 +55,8 @@ class MY_Controller extends CI_Controller{ // public $version = '1.17.70'; // bopropswop // public $version = '1.17.72'; // data2mysql fout // public $version = '1.17.73'; // 0-waarden aantal tlvs in omvang extra ondersteuning - public $version = '1.17.74'; // mogelijkheid tot uitzetten extra ondersteuning in divmeters +// public $version = '1.17.74'; // mogelijkheid tot uitzetten extra ondersteuning in divmeters + public $version = '1.17.75'; // uitzetten ijpunten en in lijst nvt niet meetellen public $partituurid; public $globProfielVersieID = 1; diff --git a/application/libraries/monpas/Gemiddeldenafbeeldingen.php b/application/libraries/monpas/Gemiddeldenafbeeldingen.php index 5af7ea6..77ad29f 100644 --- a/application/libraries/monpas/Gemiddeldenafbeeldingen.php +++ b/application/libraries/monpas/Gemiddeldenafbeeldingen.php @@ -34,6 +34,7 @@ class Gemiddeldenafbeeldingen { private $resultaten; private $kolombreedte; private $orgbreedte; + private $disablenvt = 0; private $gemiddeldenafbeeldingen; @@ -180,13 +181,14 @@ class Gemiddeldenafbeeldingen { private function loopIJkpunten(){ foreach($this->ijkpunten as $index =>$this->ijkpunt){ - if(! isset($this->ijkpunt->score) || ! $this->ijkpunt->score) {continue;}; + if(! isset($this->ijkpunt->score) || ! $this->ijkpunt->score || $this->ijkpunt->disabled =='T') {continue;}; $this->telScoresOp(); $this->setAantalScores(); } $this->setGemiddeldeScore(); // gemiddelde ga je niet in de loop berekenen } + private function telScoresOp(){ $this->somscore = $this->somscore + $this->ijkpunt->score; } @@ -223,11 +225,13 @@ class Gemiddeldenafbeeldingen { private function setGemiddeldeScore(){ $this->gemiddelde = new stdClass(); $this->gemiddelde->score = 0; - if ($this->aantalscores > 0) { - $this->gemiddelde->score = round($this->somscore / $this->aantalY); - } + $deler = $this->aantalY - $this->disablenvt; + if($deler > 0) $this->gemiddelde->score = round($this->somscore / $deler); + - $this->gemiddelde->nummer = 'gem'; + $this->gemiddelde->nummer = 'gem'; + $this->gemiddelde->disabled = 'F'; + $this->gemiddelde->disablenvt = 'F'; $this->gemiddelde->kleur =$this->getKleur ($this->gemiddelde->score); $this->ijkpunt = $this->gemiddelde; } @@ -322,8 +326,13 @@ class Gemiddeldenafbeeldingen { } private function setAdvies(){ - if(isset($this->ijkpunt->wens) && $this->ijkpunt->huidig < $this->ijkpunt->wens && - $this->ijkpunt->huidig != 0 && $this->ijkpunt->wens!= 0 && isset($this->ijkpunt->omschrijving)){ + if(isset($this->ijkpunt->wens) && + $this->ijkpunt->huidig < $this->ijkpunt->wens && + + $this->ijkpunt->wens!= 0 && + isset($this->ijkpunt->omschrijving ) && + $this->ijkpunt->disabled == 'F' && + $this->ijkpunt->disablenvt == 'F'){ array_push($this->adviezen, [ "nummer"=> $this->ijkpunt->nummer, "omschrijving" =>$this->ijkpunt->omschrijving diff --git a/application/libraries/monpas/Gemiddeldescores.php b/application/libraries/monpas/Gemiddeldescores.php index d53475b..610a508 100644 --- a/application/libraries/monpas/Gemiddeldescores.php +++ b/application/libraries/monpas/Gemiddeldescores.php @@ -15,6 +15,7 @@ class Gemiddeldescores private $slaover = false; private $ambities; private $gemiddeldescores; + private $aantalnvt = 0; public function __construct($orgversieid, $orgid) { @@ -67,10 +68,8 @@ class Gemiddeldescores $this->setGemiddeldeScores(); } - private function setIJkpunten() - { - $this->ijkpunten = $this->CI->Orgversies_model->getijkpunten($this->orgversieid); - + private function setIJkpunten(){ + $this->ijkpunten = $this->CI->Ijkpunten_model->getijkpuntenMetIndicatoren($this->orgversieid); } private function setLeerkrachten() @@ -88,20 +87,28 @@ class Gemiddeldescores } } - private function telIJkpunten() - { - if ($this->ijkpunten) { - $this->aantalY = count($this->ijkpunten); + private function telIJkpunten(){ + if($this->ijkpunten){ + foreach($this->ijkpunten as $ijkpunt){ + if($ijkpunt->disabled == 'F'){ + $this->aantalY++; + } + } } } + private function loopIJkpunten() { foreach ($this->ijkpunten as $index => $this->ijkpunt) { + $this->ijkpunt->disablenvt = 'F'; $this->ijkpunt->totaal = 0; $this->ijkpunt->aantallkrtn = 0; - $this->loopLeerkrachten(); - $this->setIJkpuntGemiddeldeScores(); + if($this->ijkpunt->disabled == 'F') { + $this->loopLeerkrachten(); + $this->setNietvanToepassing(); + $this->setIJkpuntGemiddeldeScores(); + } } } @@ -128,6 +135,7 @@ class Gemiddeldescores $this->setAantalScores(); if ($this->slaover == false) { $this->setIJkpuntTotaal(); + $this->telNietVanToepassing(); } } } @@ -152,6 +160,15 @@ class Gemiddeldescores } } + private function telNietvanToepassing(){ + if($this->score->scoretype != 4) return; + if ($this->score->nummer == $this->ijkpunt->nummer) { + if($this->score->aantalnvt == $this->score->aantalvier ) + $this->aantalnvt++; + + } + } + private function setVoldoendeAantal(){ if (!isset($this->leerkracht->scores) || $this->leerkracht->scores == false) return; if ($this->scoreteller < 5){ @@ -159,6 +176,12 @@ class Gemiddeldescores } } + private function setNietVanToepassing(){ + if($this->ijkpunt->aantallkrtn == $this->aantalnvt){ + $this->ijkpunt->disablenvt = 'T'; + } + } + private function setIJkpuntGemiddeldeScores() { if ($this->ijkpunt->aantallkrtn > 0) { diff --git a/application/libraries/monpas/Schoolafbeeldingen.php b/application/libraries/monpas/Schoolafbeeldingen.php index eb96e28..a58f81b 100644 --- a/application/libraries/monpas/Schoolafbeeldingen.php +++ b/application/libraries/monpas/Schoolafbeeldingen.php @@ -3,23 +3,19 @@ class Schoolafbeeldingen { private $CI; - private $swvid; + private $scores; private $score; private $somscore; private $ambities; private $wensen; - private $wens; private $ijkpunten; private $aantalY = 0; private $labels; private $kleuren; - private $kleurcodes; private $orgversie; private $vantm; private $gemiddelde; - private $nummer; - private $gem; private $adviezen= []; private $rij = 708; private $standaardorg = 250; @@ -35,6 +31,7 @@ class Schoolafbeeldingen { private $laagstescore = 101; private $schoolafbeeldingen; private $resultaten; + private $disablenvt; public function __construct(Schoolscores $schoolscores, $modulenr, $orgversieid, $clusterid, $orgid){ $this->CI = & get_instance(); @@ -121,7 +118,6 @@ class Schoolafbeeldingen { $this->setLabels(); $this->telIJkpunten(); $this->setPeriode(); - $this->setKleurcodes(); $this->setKleuren(); $this->loopScores1(); $this->setGemiddeldeScore(); @@ -145,7 +141,11 @@ class Schoolafbeeldingen { private function telIJkpunten(){ if($this->ijkpunten){ - $this->aantalY = count($this->ijkpunten); + foreach($this->ijkpunten as $ijkpunt){ + if($ijkpunt->disabled == 'F'){ + $this->aantalY++; + } + } } } @@ -155,9 +155,6 @@ class Schoolafbeeldingen { } - private function setKleurcodes(){ - $this->kleurcodes = new Kleurcodes(); - } private function setKleuren(){ @@ -191,26 +188,30 @@ class Schoolafbeeldingen { private function loopScores1(){ - if(!$this->scores) return; foreach ($this->scores as $index => $this->score) { - $this->setScoreSom(); - $this->setAantalScores($index); + if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') { + + $this->somscore = $this->somscore + $this->score->gem; + + $this->aantalscores++; + } + if($this->score->disabled == 'F' && $this->score->disablenvt == 'T'){ + $this->disablenvt++; + } + } } - private function setScoreSom(){ - $this->somscore = $this->somscore + $this->score->gem; - } - - private function setAantalScores($index){ - $this->aantalscores = $index + 1; - } - private function setGemiddeldeScore(){ if(!$this->scores || $this->aantalscores == 0) return; $this->gemiddelde = new stdClass(); - $this->gemiddelde->gem = $this->somscore / $this->aantalY; + $this->gemiddelde->gem = 0; + $deler = $this->aantalY - $this->disablenvt; + if($deler > 0) $this->gemiddelde->gem = round($this->somscore / $deler); + + $this->gemiddelde->disabled = 'F'; + $this->gemiddelde->disablenvt = 'F'; $this->gemiddelde->nummer = 'gem'; $this->score = $this->gemiddelde; } @@ -286,6 +287,9 @@ class Schoolafbeeldingen { private function setWensKleuren(){ if(! isset($this->wensen)) return; if(!isset($this->score->wens)) return; + if($this->score->disabled == 'T') + {$this->score->wenskleur = '#ffffff'; + return;} switch ($this->score->wens) { case 1: $this->score->wenskleur = $this->kleuren->kleur1; @@ -306,7 +310,11 @@ class Schoolafbeeldingen { private function setAdvies(){ - if(isset($this->score->wens) && $this->score->huidig < $this->score->wens && $this->score->huidig != 0 && $this->score->wens!= 0){ + if(isset($this->score->wens) && + $this->score->huidig < $this->score->wens && + $this->score->wens!= 0 && + $this->score->disabled == 'F' && + $this->score->disablenvt == 'F'){ $omschrijving = ""; if(isset($this->score->omschrijving)){ $omschrijving = $this->score->omschrijving; @@ -317,20 +325,24 @@ class Schoolafbeeldingen { private function setResultatenOverzicht() { - if ($this->score->gem > $this->hoogstescore) { - $this->hoogstescore = $this->score->gem; - $this->welkehoogste = $this->score->nummer; - } - if ($this->score->gem <= $this->laagstescore) { - $this->laagstescore = $this->score->gem; - $this->welkelaagste = $this->score->nummer; + if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') { + if ($this->score->gem > $this->hoogstescore) { + $this->hoogstescore = $this->score->gem; + $this->welkehoogste = $this->score->nummer; + } + if ($this->score->gem <= $this->laagstescore) { + $this->laagstescore = $this->score->gem; + $this->welkelaagste = $this->score->nummer; + } } } private function telIJkpuntenok() { - if ($this->ambities && $this->score->gem >= $this->ambities->zprocent) { - $this->ijkpuntenok++; + if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') { + if ($this->ambities && $this->score->gem >= $this->ambities->zprocent && $this->score->disabled == 'F') { + $this->ijkpuntenok++; + } } } diff --git a/application/libraries/monpas/Schoolscores.php b/application/libraries/monpas/Schoolscores.php index 7a66686..b392e22 100644 --- a/application/libraries/monpas/Schoolscores.php +++ b/application/libraries/monpas/Schoolscores.php @@ -50,7 +50,7 @@ class Schoolscores private function setIJkpunten(){ - $this->ijkpunten = $this->CI->Orgversies_model->getijkpunten($this->orgversieid); + $this->ijkpunten = $this->CI->Ijkpunten_model->getijkpuntenMetIndicatoren($this->orgversieid); } private function setScores(){ diff --git a/application/libraries/monpas/ijkpunten/Afbeeldingen.php b/application/libraries/monpas/ijkpunten/Afbeeldingen.php index aba84df..94759c5 100644 --- a/application/libraries/monpas/ijkpunten/Afbeeldingen.php +++ b/application/libraries/monpas/ijkpunten/Afbeeldingen.php @@ -20,6 +20,9 @@ class Afbeeldingen { private $welkelaagste = 0; private $laagstescore = 101; private $resultaten; + private $disablenvt = 0; + private $ijkpunten; + private $aantalY = 0; public function __construct($scoresObject, $modulenr, $orgversieid, $clusterid, $orgid, $zprocent){ $this->CI = & get_instance(); @@ -59,6 +62,8 @@ class Afbeeldingen { } private function handle(){ + $this->setIJkpunten(); + $this->telIJkpunten(); $this->setScores(); $this->setSWVid(); $this->setOrgversie(); @@ -70,6 +75,20 @@ class Afbeeldingen { $this->loopScores2(); } + private function setIJkpunten(){ + $this->ijkpunten = $this->CI->Ijkpunten_model->getijkpuntenMetIndicatoren($this->orgversieid); + } + + private function telIJkpunten(){ + if($this->ijkpunten){ + foreach($this->ijkpunten as $ijkpunt){ + if($ijkpunt->disabled == 'F'){ + $this->aantalY++; + } + } + } + } + private function setScores(){ $this->scores = $this->scoresobject->getScores(); } @@ -115,20 +134,26 @@ class Afbeeldingen { private function loopScores1(){ if(!$this->scores) return; foreach ($this->scores as $index => $this->score) { - $this->berekenGemiddelden(); - $this->setScoreSom(); - $this->setAantalScores($index); + if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') { +// $this->berekenGemiddelden(); + $this->setScoreSom(); + $this->setAantalScores($index); + } + if($this->score->disabled == 'F' && $this->score->disablenvt == 'T'){ + $this->disablenvt++; + } + } } - private function berekenGemiddelden(){ - if(!$this->scores) return; - $this->score->gem = 0; - if($this->score->num > 0 ){ -// $this->score->gem = round((($this->score->somscore/ $this->score->num)* 10)/10); - $this->score->gem = $this->score->somscore/ $this->score->num; - } - } +// private function berekenGemiddelden(){ +// if(!$this->scores) return; +// $this->score->gem = 0; +// if($this->score->num > 0 ){ +//// $this->score->gem = round((($this->score->somscore/ $this->score->num)* 10)/10); +// $this->score->gem = $this->score->somscore/ $this->score->num; +// } +// } private function setScoreSom(){ @@ -137,13 +162,18 @@ class Afbeeldingen { } private function setAantalScores($index){ - $this->aantalscores = $index + 1; + $this->aantalscores++; } private function setGemiddeldeScore(){ if(!$this->scores || $this->aantalscores == 0) return; $this->gemiddelde = new stdClass(); - $this->gemiddelde->gem = $this->somscore / $this->aantalscores; + $this->gemiddelde->gem = 0; + $deler = $this->aantalY - $this->disablenvt; + if($deler > 0) $this->gemiddelde->gem = round($this->somscore / $deler); + + $this->gemiddelde->disabled = 'F'; + $this->gemiddelde->disablenvt = 'F'; $this->gemiddelde->nummer = 'gem'; $this->score = $this->gemiddelde; } @@ -196,20 +226,24 @@ class Afbeeldingen { } private function setResultatenOverzicht(){ + if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') { - if ($this->score->gem > $this->hoogstescore) { - $this->hoogstescore = $this->score->gem; - $this->welkehoogste = $this->score->nummer; - } - if ($this->score->gem <= $this->laagstescore) { - $this->laagstescore = $this->score->gem; - $this->welkelaagste = $this->score->nummer; + if ($this->score->gem > $this->hoogstescore) { + $this->hoogstescore = $this->score->gem; + $this->welkehoogste = $this->score->nummer; + } + if ($this->score->gem <= $this->laagstescore) { + $this->laagstescore = $this->score->gem; + $this->welkelaagste = $this->score->nummer; + } } } private function telIJkpuntenok(){ - if ($this->score->gem >= $this->zprocent) { - $this->ijkpuntenok++; + if($this->score->disabled == 'F' && $this->score->disablenvt == 'F') { + if ($this->score->gem >= $this->zprocent) { + $this->ijkpuntenok++; + } } } } \ No newline at end of file diff --git a/application/libraries/monpas/ijkpunten/Bestuurscores.php b/application/libraries/monpas/ijkpunten/Bestuurscores.php index 3aea4ac..a0c1b2e 100644 --- a/application/libraries/monpas/ijkpunten/Bestuurscores.php +++ b/application/libraries/monpas/ijkpunten/Bestuurscores.php @@ -3,8 +3,9 @@ class Bestuurscores { private $CI; - private $organisatie; private $scores; + private $orgstring; + private $metingen; public function __construct( $orgversieid, $orgid, $vorm) @@ -20,20 +21,33 @@ class Bestuurscores return $this->scores; } + public function getMetingen(){ + return $this->metingen; + } + 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, []); + if($orglist) { + $this->orgstring = implode(',', $orglist); + } + } private function setScores(){ - $this->scores = $this->CI->Scores_model->calculateBG($this->orgversieid, $this->orgid); + $this->scores = $this->CI->Scores_model->getgemscores($this->orgversieid, $this->orgstring); + } + + private function setMetingen(){ + $this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgstring); } } \ No newline at end of file diff --git a/application/libraries/monpas/ijkpunten/Individuelescores.php b/application/libraries/monpas/ijkpunten/Individuelescores.php index 6826d10..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(){ @@ -34,11 +35,28 @@ class Individuelescores private function setScores(){ $this->scores = $this->CI->Scores_model->calculateindividualscores($this->orgversieid, $this->orgid, $this->userid); } - private function telScores(){ - - foreach($this->scores as $index => $this->score){ + 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/Kamerscores.php b/application/libraries/monpas/ijkpunten/Kamerscores.php index 03556a3..926faf4 100644 --- a/application/libraries/monpas/ijkpunten/Kamerscores.php +++ b/application/libraries/monpas/ijkpunten/Kamerscores.php @@ -8,6 +8,7 @@ class Kamerscores private $kamernaam; private $orgids; private $scores; + private $metingen; public function __construct( $orgversieid, $orgid, $vorm) { @@ -21,6 +22,9 @@ class Kamerscores public function getScores(){ return $this->scores; } + public function getMetingen(){ + return $this->metingen; + } public function getOrgnaam(){ return $this->kamernaam; @@ -33,6 +37,7 @@ class Kamerscores $this->setKamernaam(); $this->setScholenString(); $this->setScores(); + $this->setMetingen(); } @@ -63,8 +68,12 @@ class Kamerscores private function setScores(){ if(!$this->orgids) return; - $this->scores = $this->CI->Scores_model->calculateOverScholen($this->orgversieid, $this->orgids); + $this->scores = $this->CI->Scores_model->getgemscores($this->orgversieid, $this->orgids); } + private function setMetingen(){ + $this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgids); + } + } \ No newline at end of file diff --git a/application/libraries/monpas/ijkpunten/Lijsten.php b/application/libraries/monpas/ijkpunten/Lijsten.php index 8ba094d..a7e9ac6 100644 --- a/application/libraries/monpas/ijkpunten/Lijsten.php +++ b/application/libraries/monpas/ijkpunten/Lijsten.php @@ -118,15 +118,16 @@ class Lijsten $this->setKamerScores(); $this->setSWVScores(); $this->setLijstScores(); + $this->setMetingen(); $this->setGemiddeldeScores(); $this->setAdviezen(); $this->setGemiddeldenAdviezen(); $this->setVNaam(); $this->loopVergelijkingScores(); - $this->setSchoolMetingen(); - $this->setIndividueleMetingen(); - $this->setMetingenVergelijking(); - $this->setMetingenVergelijkingIndividueel(); +// $this->setSchoolMetingen(); +// $this->setIndividueleMetingen(); +// $this->setMetingenVergelijking(); +// $this->setMetingenVergelijkingIndividueel(); $this->setResultaten(); $this->setrapportInfo(); $this->setLijsten(); @@ -196,10 +197,17 @@ class Lijsten } } + + + + private function setSchoolScores(){ if ($this->soort != 4 || $this->lijst->vorm != 1) return; $this->schoolScores = new Schoolscores($this->lijst->orgversieid, $this->orgid); + if($this->schoolScores) { + $this->metingen = 1; + $this->aantalorgs = 1; $this->schoolAfbeeldingen = new Schoolafbeeldingen($this->schoolScores, $this->modulenr, $this->lijst->orgversieid, $this->clusterid, $this->orgid); } @@ -207,12 +215,16 @@ class Lijsten private function setIndividueleScores(){ if($this->soort !=4 || $this->lijst->vorm != 2) return; - $this->gemiddeldeScores = new Gemiddeldescores($this->lijst->orgversieid, $this->orgid); + $this->gemiddeldeScores = new Gemiddeldescores($this->lijst->orgversieid, $this->orgid); if($this->gemiddeldeScores){ $this->gemiddeldenAfbeeldingen = new Gemiddeldenafbeeldingen($this->gemiddeldeScores, $this->modulenr, $this->lijst->orgversieid, $this->clusterid, $this->orgid); } + +// $this->gemiddeldeScores = new Individuelescores($this->lijst->orgversieid, $this->lijst->orguserid, $this->orgid); +// $this->gemiddeldenAfbeeldingen = new Afbeeldingen($this->gemiddeldeScores, $this->modulenr, $this->lijst->orgversieid, $this->clusterid, $this->orgid, $this->zprocent); + } private function setBestuurScores() @@ -248,6 +260,7 @@ class Lijsten case 1: if(empty($this->swvAfbeeldingen)) return; $this->lijst->scores = $this->swvAfbeeldingen->getScores(); + break; case 2: if(empty($this->kamerAfbeeldingen)) return; $this->lijst->scores = $this->kamerAfbeeldingen->getScores(); @@ -270,12 +283,56 @@ class Lijsten } } + private function setMetingen(){ + $this->lijst->metingen = 0; + $this->lijst->aantalorgs = 0; + $this->lijst->metingenV = 0; + $this->lijst->aantalorgsV = 0; + + + switch($this->soort){ + case 1: + if(empty($this->swvScores)) return; + $metingen = $this->swvScores->getMetingen(); + break; + case 2: if(empty($this->kamerScores)) return; + $metingen = $this->kamerScores->getMetingen(); + $metingenV = $this->swvScores->getMetingen(); + break; + case 3: if(empty($this->bestuurScores)) return; + $metingen = $this->bestuurScores->getMetingen(); + $metingenV = $this->kamerScores->getMetingen(); + break; + case 4: if(empty($this->schoolScores) ||empty($this->gemiddeldeScores) ) return; + if(count((array) $this->schoolScores) > 0) { + $this->lijst->metingen = 1; + $this->lijst->aantalorgs = 1; + } + if(count((array)$this->gemiddeldeScores)> 0){ + $this->lijst->metingen = $this->gemiddeldeScores->getAantalLeerkrachten(); + $this->lijst->aantalorgs = 1; + + } + $metingenV = $this->kamerScores->getMetingen(); + break; + } + + if(isset($metingen)) { + $this->lijst->metingen = $metingen->aantal; + $this->lijst->aantalorgs = $metingen->aantalorgs; + } + if(isset($metingenV)) { + $this->lijst->metingenV = $metingenV->aantal; + $this->lijst->aantalorgsV = $metingenV->aantalorgs; + } + } + private function setGemiddeldeScores(){ 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; } } @@ -318,100 +375,104 @@ class Lijsten 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; + $this->lijst->scores[$i]->disabledV = $this->lijst->vergelijkingen[$i]->disabled; + $this->lijst->scores[$i]->disablenvtV = $this->lijst->vergelijkingen[$i]->disablenvt; } - } - - private function setSchoolMetingen(){ - - if($this->lijst->vorm != 1) return; - if(!$this->lijst->scores) $this->lijst->aantalorgs = 0; - else if ($this->soort == 4) $this->lijst->aantalorgs = 1; - else { - if(! isset($this->lijst->scores[0]->aantalscholen)) $this->lijst->aantalorgs = 0; - - else { - $this->lijst->aantalorgs = $this->lijst->scores[0]->aantalscholen; - } - - } - } - - private function setIndividueleMetingen(){ - if (!isset($this->lijst->scores)) return; - if ($this->lijst->vorm != 2) return; - $this->lijst->metingen = 0; - $this->lijst->aantalorgs = 0; - - if ($this->soort == 4) { - $gevuld = $this->CI->Scores_model->fCountGevuldeVersies($this->lijst->orgversieid, $this->orgid); - if($gevuld ){ - $this->lijst->metingen = $gevuld->aantal;} - }; - - if ($this->soort == 3) { - $gevuld = $this->CI->Scores_model->fCountGevuldeBestuurVersies($this->lijst->orgversieid, $this->orgid); - if($gevuld){ - $this->lijst->metingen = $gevuld->aantal; - $this->lijst->aantalorgs = $gevuld->aantalorgs;} - }; - - if ($this->soort == 2) { - - $this->onderorgs = $this->CI->Organisaties_model->getscholenonderkamer($this->orgid); - $this->setGevuldeVersies12(); - $metingen = $this->CI->Scores_model->fCountGevuldeKamerEnSWVVersies($this->lijst->orgversieid, $this->orgstring); - if($metingen){ - $this->lijst->metingen = $metingen->aantal; - $this->lijst->aantalorgs = $metingen->aantalorgs; - } - }; - - if ($this->soort == 1) { - $this->onderorgs = $this->CI->Organisaties_model->getscholenonderswv($this->orgid); - $this->setGevuldeVersies12(); - $metingen = $this->CI->Scores_model->fCountGevuldeKamerEnSwvVersies($this->lijst->orgversieid, $this->orgstring); - if($metingen){ - $this->lijst->metingen = $metingen->aantal; - $this->lijst->aantalorgs = $metingen->aantalorgs; - } - }; - } - - private function setGevuldeVersies12(){ - $orgids = []; - if (count($this->onderorgs) > 0) { - foreach ($this->onderorgs as $index => $this->org) { - $orgids[] = $this->org->id; - } - $this->orgstring = implode(',', $orgids); - } else $this->orgstring = false; - } - private function setMetingenVergelijking(){ - if(!isset($this->lijst->vergelijkingen) || !($this->lijst->vergelijkingen)) return; - if($this->lijst->vorm != 1) return; - foreach($this->lijst->vergelijkingen as $index => $this->lijst->vergelijking) { - $this->lijst->metingenV= 0; - if(! isset($this->lijst->vergelijking->aantalscholen)){continue;} - $this->lijst->metingenV = $this->lijst->vergelijking->aantalscholen; - break; - } - } +// private function setSchoolMetingen(){ +// +// if($this->lijst->vorm != 1) return; +// if(!$this->lijst->scores) $this->lijst->aantalorgs = 0; +// else if ($this->soort == 4) $this->lijst->aantalorgs = 1; +// else { +// if(! isset($this->lijst->scores[0]->aantalscholen)) $this->lijst->aantalorgs = 0; +// +// else { +// $this->lijst->aantalorgs = $this->lijst->scores[0]->aantalscholen; +// } +// +// } +// } - private function setMetingenVergelijkingIndividueel(){ - if(! isset($this->lijst->vergelijkingen )|| ! ($this->lijst->vergelijkingen)) return; - if($this->lijst->vorm != 2) return; - $this->lijst->metingenV = new stdClass(); - $this->lijst->metingenV = 0; - foreach($this->lijst->vergelijkingen as $index => $this->lijst->vergelijking) { - if(! isset($this->lijst->vergelijking->aantallijsten)){continue;} - $this->lijst->metingenV = $this->lijst->vergelijking->aantallijsten; - break; - } - } +// private function setIndividueleMetingen(){ +// if (!isset($this->lijst->scores)) return; +// if ($this->lijst->vorm != 2) return; +// $this->lijst->metingen = 0; +// $this->lijst->aantalorgs = 0; +// +// if ($this->soort == 4) { +// $gevuld = $this->CI->Scores_model->fCountGevuldeVersies($this->lijst->orgversieid, $this->orgid); +// if($gevuld ){ +// $this->lijst->metingen = $gevuld->aantal;} +// }; +// +// if ($this->soort == 3) { +// $gevuld = $this->CI->Scores_model->fCountGevuldeBestuurVersies($this->lijst->orgversieid, $this->orgid); +// if($gevuld){ +// $this->lijst->metingen = $gevuld->aantal; +// $this->lijst->aantalorgs = $gevuld->aantalorgs;} +// }; +// +// if ($this->soort == 2) { +// +// $this->onderorgs = $this->CI->Organisaties_model->getscholenonderkamer($this->orgid); +// $this->setGevuldeVersies12(); +// $metingen = $this->CI->Scores_model->fCountGevuldeKamerEnSWVVersies($this->lijst->orgversieid, $this->orgstring); +// if($metingen){ +// $this->lijst->metingen = $metingen->aantal; +// $this->lijst->aantalorgs = $metingen->aantalorgs; +// } +// }; +// +// if ($this->soort == 1) { +// $this->onderorgs = $this->CI->Organisaties_model->getscholenonderswv($this->orgid); +// $this->setGevuldeVersies12(); +// $metingen = $this->CI->Scores_model->fCountGevuldeKamerEnSwvVersies($this->lijst->orgversieid, $this->orgstring); +// if($metingen){ +// $this->lijst->metingen = $metingen->aantal; +// $this->lijst->aantalorgs = $metingen->aantalorgs; +// } +// }; +// } + +// private function setGevuldeVersies12(){ +// $orgids = []; +// if (count($this->onderorgs) > 0) { +// foreach ($this->onderorgs as $index => $this->org) { +// $orgids[] = $this->org->id; +// } +// $this->orgstring = implode(',', $orgids); +// } else $this->orgstring = false; +// +// +// } + +// private function setMetingenVergelijking(){ +// if(!isset($this->lijst->vergelijkingen) || !($this->lijst->vergelijkingen)) return; +// if($this->lijst->vorm != 1) return; +// foreach($this->lijst->vergelijkingen as $index => $this->lijst->vergelijking) { +// $this->lijst->metingenV= 0; +// if(! isset($this->lijst->vergelijking->aantalscholen)){continue;} +// $this->lijst->metingenV = $this->lijst->vergelijking->aantalscholen; +// break; +// } +// +// } + +// private function setMetingenVergelijkingIndividueel(){ +// if(! isset($this->lijst->vergelijkingen )|| ! ($this->lijst->vergelijkingen)) return; +// if($this->lijst->vorm != 2) return; +// $this->lijst->metingenV = new stdClass(); +// $this->lijst->metingenV = 0; +// foreach($this->lijst->vergelijkingen as $index => $this->lijst->vergelijking) { +// if(! isset($this->lijst->vergelijking->aantallijsten)){continue;} +// $this->lijst->metingenV = $this->lijst->vergelijking->aantallijsten; +// break; +// } +// } private function setResultaten(){ switch($this->soort) { diff --git a/application/libraries/monpas/ijkpunten/Swvscores.php b/application/libraries/monpas/ijkpunten/Swvscores.php index 14f749b..2adb144 100644 --- a/application/libraries/monpas/ijkpunten/Swvscores.php +++ b/application/libraries/monpas/ijkpunten/Swvscores.php @@ -8,6 +8,7 @@ class Swvscores private $swvnaam; private $orgids; private $scores; + private $metingen; public function __construct( $orgversieid, $orgid, $vorm) @@ -23,6 +24,10 @@ class Swvscores return $this->scores; } + public function getMetingen(){ + return $this->metingen; + } + public function getOrgnaam(){ return $this->swvnaam; } @@ -34,6 +39,7 @@ class Swvscores $this->setSWVnaam(); $this->setScholenString(); $this->setScores(); + $this->setMetingen(); } private function setOrg(){ @@ -64,7 +70,11 @@ class Swvscores } private function setScores(){ - $this->scores = $this->CI->Scores_model->calculateOverScholen($this->orgversieid, $this->orgids); + $this->scores = $this->CI->Scores_model->getgemscores($this->orgversieid, $this->orgids); + } + + private function setMetingen(){ + $this->metingen = $this->CI->Scores_model->fCountGevuldeVersiesNieuw($this->orgversieid, $this->orgids); } } \ No newline at end of file diff --git a/application/libraries/monpas/ijkpunten/Userlijsten.php b/application/libraries/monpas/ijkpunten/Userlijsten.php index 95218c6..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,33 +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; - $this->lijst->metingen = $this->gemiddeldeScores->getAantalLeerkrachten(); + 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) { - $this->lijst->metingenV = $this->lijst->vergelijking->aantallijsten; - return; + $metingenV = $this->kamerScores->getMetingen(); + if($metingenV) { + $this->lijst->metingenV = $metingenV->aantal; + $this->lijst->aantalorgsV = $metingenV->aantalorgs; + } } } + + private function setVNaam(){ $this->lijst->vNaam = $this->kamerScores->getOrgnaam(); } diff --git a/application/models/Phantom_model.php b/application/models/Phantom_model.php index ac25f05..f4233aa 100644 --- a/application/models/Phantom_model.php +++ b/application/models/Phantom_model.php @@ -55,6 +55,7 @@ class Phantom_model extends CI_Model{ if( $margins ) $data['margins'] = serialize($margins); curl_setopt_array($curl, array( + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0), CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'https://print.pensare-services.nl/test/1', CURLOPT_POST => 1, diff --git a/application/models/monpas/Ambities_model.php b/application/models/monpas/Ambities_model.php index 2949bd3..4b770dc 100644 --- a/application/models/monpas/Ambities_model.php +++ b/application/models/monpas/Ambities_model.php @@ -34,10 +34,15 @@ class Ambities_model extends MY_Model{ return $this->get_query_row(); } function getambitie($orgversieid, $orgid){ - $this->sql="SELECT A.id, gem_score AS gemscore, x_ijkpunten AS xijkpunten , z_procent AS zprocent + $this->sql="SELECT A.id, gem_score AS gemscore, x_ijkpunten AS xijkpuntenoud, COUNT(Y.id) AS xijkpunten, z_procent AS zprocent FROM tb_ambities A + JOIN tb_orgversies OV ON A.orgversie_id = OV.id + JOIN tb_versies V ON OV.versie_id = V.id + JOIN tb_ijkpunten Y ON Y.versie_id = V.id WHERE A.organisatie_id = {$orgid} - AND A.orgversie_id = {$orgversieid}"; + AND A.orgversie_id = {$orgversieid} + AND Y.disabled = 'F' + GROUP BY A.id "; return $this->get_query_row(); } function getdefault($aantalY){ diff --git a/application/models/monpas/Ijkpunten_model.php b/application/models/monpas/Ijkpunten_model.php index 6d6c191..9c1b190 100644 --- a/application/models/monpas/Ijkpunten_model.php +++ b/application/models/monpas/Ijkpunten_model.php @@ -20,6 +20,16 @@ class Ijkpunten_model extends MY_Model{ ORDER BY Y.nummer "; return $this->get_query_result(); } + function getijkpuntenMetIndicatoren($orgversieid){ + $this->sql="SELECT Y.id, Y.nummer,Y.omschrijving,Y.toelichting, disabled + FROM tb_orgversies OV + JOIN tb_ijkpunten Y ON Y.versie_id = OV.versie_id + JOIN tb_indicatoren I ON Y.id = I.ijkpunt_id + WHERE OV.id ={$orgversieid} + GROUP BY Y.nummer + ORDER BY Y.nummer "; + return $this->get_query_result(); + } @@ -27,12 +37,13 @@ class Ijkpunten_model extends MY_Model{ $this->sql="SELECT COUNT(Y.id) AS aantalY FROM tb_orgversies OV JOIN tb_ijkpunten Y ON Y.versie_id = OV.versie_id - WHERE OV.id ={$orgversieid} "; + WHERE OV.id ={$orgversieid} + AND Y.disabled = 'F' "; return $this->get_query_row('aantalY'); } function getijkpunten1($versieid){ - $this->sql="SELECT Y.id, Y.nummer,Y.omschrijving,Y.toelichting + $this->sql="SELECT Y.id, Y.nummer,Y.omschrijving,Y.toelichting, Y.disabled FROM tb_ijkpunten Y WHERE Y.versie_id ={$versieid} ORDER BY Y.nummer "; diff --git a/application/models/monpas/Scorekleuren_model.php b/application/models/monpas/Scorekleuren_model.php new file mode 100644 index 0000000..f1c60ef --- /dev/null +++ b/application/models/monpas/Scorekleuren_model.php @@ -0,0 +1,29 @@ +load->model($models); + } + + function getGemiddeldeKleur($scoretype, $gemiddelde){ + $this->sql="SELECT kleurcode, nummer, ondergrens, bovengrens + FROM tb_scorekleuren + WHERE scoretype = {$scoretype} + AND bovengrens > {$gemiddelde} + AND ondergrens <= {$gemiddelde} + AND disabled = 'F' "; + + return $this->get_query_row(); + } + + + + +} diff --git a/application/models/monpas/Scores_model.php b/application/models/monpas/Scores_model.php index a03a8ae..784a955 100644 --- a/application/models/monpas/Scores_model.php +++ b/application/models/monpas/Scores_model.php @@ -25,9 +25,65 @@ 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, Y.disabled, + SUM(CASE WHEN Y.disabled = 'T' THEN 0 + WHEN Y.disabled = 'F' THEN + CASE + WHEN SC.scoretype = 1 THEN SC.score * 10 * Indi.gewicht + WHEN SC.scoretype = 2 THEN SC.score * Indi.gewicht + WHEN (SC.scoretype = 3 OR SC.scoretype = 5) THEN + CASE + WHEN SC.score = 1 THEN 100 * Indi.gewicht + WHEN (SC.score = 2 OR SC.score = 0) THEN 0 + ELSE 50 * Indi.gewicht + END + WHEN SC.scoretype = 4 THEN + CASE + WHEN SC.score = 1 THEN 100 * Indi.gewicht + ELSE 0 + END + WHEN SC.scoretype = 6 THEN + CASE + WHEN SC.score = 2 THEN 60 * Indi.gewicht + WHEN SC.score = 3 THEN 100 * Indi.gewicht + ELSE 0 + END + WHEN SC.scoretype = 7 THEN + CASE + WHEN SC.score = 1 THEN 100 * Indi.gewicht + WHEN SC.score = 2 THEN 66.6 * Indi.gewicht + WHEN SC.score = 3 THEN 33.3 * Indi.gewicht + ELSE 0 + END + ELSE 0 + END + ELSE 0 + END) AS somscore, + + SUM( Indi.gewicht ) AS num, + SUM(CASE WHEN SC.scoretype = 4 AND SC.score = 3 THEN 1 + ELSE 0 + END) AS aantalnvt, + SUM(CASE WHEN SC.scoretype = 4 THEN 1 + ELSE 0 + END) AS aantalvier, + Y.nummer, Y.omschrijving, 0 AS aantalscholen, Y.toelichting + FROM tb_filledversions FV + JOIN tb_scores SC ON SC.filledversion_id = FV.id + JOIN tb_indicatoren Indi ON Indi.id = SC.indicator_id + JOIN tb_ijkpunten Y ON Y.id = SC.ijkpunt_id + WHERE FV.orgversie_id = {$orgversieid} + AND FV.organisatie_id = {$orgid} + AND FV.user_id ={$userid} + AND FV.meetellen = 1 + GROUP BY SC.ijkpunt_id + ORDER BY Y.nummer "; + return $this->get_query_result(); + } + + + function calculateindividualscoresoud($orgversieid, $orgid, $userid){ $this->sql="SELECT SC.id, filledversion_id, SC.ijkpunt_id, scoretype, score, SUM(CASE WHEN SC.scoretype = 1 THEN SC.score * 10 * Indi.gewicht @@ -419,7 +475,7 @@ class Scores_model extends MY_Model{ FROM tb_scores S JOIN tb_filledversions FV ON FV.id = S.filledversion_id WHERE FV.orgversie_id = {$orgversieid} - AND FV.organisatie_id = {$orgid} + AND FV.organisatie_id IN ({$orgid}) AND FV.meetellen = 1 AND S.score > 0 GROUP BY S.filledversion_id @@ -460,6 +516,25 @@ class Scores_model extends MY_Model{ return $this->get_query_row(); } + function fCountGevuldeVersiesNieuw($orgversieid, $orgids){ + $this->sql =" SELECT SUM(CASE WHEN Q.aantal> 0 THEN Q.aantal + ELSE 0 + END ) as aantal, + SUM(CASE WHEN Q.aantalorgs > 0 THEN Q.aantalorgs + ELSE 0 + END ) as aantalorgs + FROM( SELECT COUNT(DISTINCT filledversion_id) as aantal, COUNT(DISTINCT(FV.organisatie_id)) AS aantalorgs + FROM tb_scores S + JOIN tb_filledversions FV ON FV.id = S.filledversion_id + WHERE FV.orgversie_id = {$orgversieid} + AND FV.organisatie_id IN ({$orgids}) + AND FV.meetellen = 1 + AND S.score > 0 + GROUP BY FV.organisatie_id + HAVING COUNT(S.id) >= 5 ) AS Q "; + return $this->get_query_row(); + } + function fGetGevuldeBestuurVersie($orgversieid, $bgid){ @@ -558,8 +633,104 @@ class Scores_model extends MY_Model{ return $lijst; } + function getgemscores($orgversieid, $orgids){ + $gevuldeversies = $this->fGetGevuldeVersies($orgversieid, $orgids); + if ($gevuldeversies) { + $this->sql = " SELECT Q.omschrijving, Q.toelichting, Q.ijkpunt_id, Q.kleurnummer, Q.disabled, Q.scoretype, + CASE WHEN Q.aantalvier > 0 THEN + CASE WHEN Q.aantalvier = Q.aantalnvt THEN + 'T' + ELSE 'F' + END + ELSE 'F' + END AS disablenvt, + Q.sumscores/Q.sumgewicht AS gem, Q.kleurcode, Q.nummer, Q.ondergrens, Q.bovengrens + FROM ( + SELECT Y.omschrijving, Y.toelichting,Y.id as ijkpunt_id, + Y.nummer, Y.disabled, SC.scoretype, SK.nummer AS kleurnummer, + SK.kleurcode, SK.ondergrens, SK.bovengrens, + SUM(CASE WHEN Y.disabled = 'T' THEN 0 + WHEN Y.disabled = 'F' THEN + CASE WHEN SC.scoretype = 1 + THEN (SC.score * I.gewicht * 10) + WHEN SC.scoretype = 2 + THEN (SC.score * I.gewicht) + WHEN SC.scoretype = 3 + THEN + CASE WHEN SC.score = 0 + THEN 0 + WHEN SC.score = 1 + THEN (100 * I.gewicht) + WHEN SC.score = 2 + THEN 0 + WHEN SC.score = 3 + THEN (50 * I.gewicht) + END + WHEN SC.scoretype = 4 + THEN + CASE WHEN SC.score = 1 + THEN (100 * I.gewicht) + ELSE 0 + END + WHEN SC.scoretype = 5 + THEN + CASE WHEN SC.score = 0 + THEN 0 + WHEN SC.score = 1 + THEN (100 * I.gewicht) + WHEN SC.score = 2 + THEN 0 + WHEN SC.score = 3 + THEN (50 * I.gewicht) + END + WHEN SC.scoretype = 6 + THEN + CASE WHEN SC.score = 2 + THEN (50 * I.gewicht) + WHEN SC.score = 3 + THEN (100 * I.gewicht) + ELSE 0 + END + WHEN SC.scoretype = 7 + THEN + CASE WHEN SC.score = 1 + THEN (100 * I.gewicht) + WHEN SC.score = 2 + THEN (66.6 * I.gewicht) + WHEN SC.score = 3 + THEN (33.3 * I.gewicht) + ELSE 0 + END + ELSE 0 + END + ELSE 0 + END)AS sumscores, + SUM(CASE WHEN SC.scoretype = 4 AND SC.score = 3 THEN 1 + ELSE 0 + END) AS aantalnvt, + SUM(CASE WHEN SC.scoretype = 4 THEN 1 + ELSE 0 + END) AS aantalvier, + SUM(I.gewicht) AS sumgewicht + FROM tb_scores SC + JOIN tb_indicatoren I ON I.id = SC.indicator_id + JOIN tb_ijkpunten Y ON Y.id = SC.ijkpunt_id + JOIN tb_scorekleuren SK ON SK.scoretype = SC.scoretype + WHERE SC.filledversion_id IN ({$gevuldeversies}) + AND SK.disabled = Y.disabled + GROUP BY SC.ijkpunt_id, SK.id + ORDER BY Y.nummer ) AS Q + HAVING Q.ondergrens <= gem AND Q.bovengrens > gem "; + } + else return false; + return $this->get_query_result(); + } - function getgemscores($orgversieid, $orgid){ + + + + + function getgemscoresoud($orgversieid, $orgid){ $gevuldeversies = $this->fGetGevuldeVersies($orgversieid, $orgid); $p = "SC.scoretype = 7"; diff --git a/application/models/monpas/Sopinhouden_model.php b/application/models/monpas/Sopinhouden_model.php index a78f416..6557719 100644 --- a/application/models/monpas/Sopinhouden_model.php +++ b/application/models/monpas/Sopinhouden_model.php @@ -79,6 +79,8 @@ class Sopinhouden_model extends MY_Model{ $versie = $result['targetversie']; $mbgrafiek = $result['grafiek1']; +// print_r($mbgrafiek); +// exit; $imagemb =$this->Phantom_model->create_img($mbgrafiek, 'test', FALSE, FALSE, array(650, 300)); $imagedata = ""; $pos = strpos($content,'mbgrafiek1'); @@ -552,7 +554,7 @@ class Sopinhouden_model extends MY_Model{ $targetversieid = $this->gettargetversie($profielid, $orgid,$chapterid); } if ($targetversieid) { - $scores = $this->Scores_model->calculateschool($targetversieid, $orgid); + $scores = $this->Scores_model->getgemscores($targetversieid, $orgid); $ambitie = $this->Ambities_model->getOrgAmbities($targetversieid, $orgid); } @@ -569,34 +571,42 @@ class Sopinhouden_model extends MY_Model{ $hoogstescore = -1; $welkelaagste = 0; $laagstescore = 101; - if ($scores){ - foreach($scores as $score){ - $gem = 0; + if ($scores) { + foreach ($scores as $score) { + $score->gem = round($score->gem); +// +// if ($score->num > 0) { +// $gem=$score->somscore / $score->num; +// }; +//LS ACTIEF GEMAAKT + $score->kleurcode = $this->kleurcodes->getkleur($score->gem); - if ($score->num > 0) { - $gem=$score->somscore / $score->num; - }; - $totgem= $totgem + $gem; - $totaantal=$totaantal + 1; + if ($score->disabled == 'F' && $score->disablenvt == 'F') { + $totgem = $totgem + $score->gem; + $totaantal = $totaantal + 1; - $score->kleurcode=$this->kleurcodes->getkleur($gem); + if ($score->gem > $hoogstescore) { + $hoogstescore = $score->gem; + $welkehoogste = $score->nummer; + } + if ($score->gem <= $laagstescore) { + $laagstescore = $score->gem; + $welkelaagste = $score->nummer; + } + if ($ambitie && $score->gem >= $ambitie->zprocent) { + $ijkpuntenok = $ijkpuntenok + 1; + }; + + } + } + if ($totaantal > 0) { + $totgem = round($totgem / $totaantal, 0); + } + $totgemkleur = $this->kleurcodes->getkleur($totgem); + // foreach scores bereken som en dus totgem en ijkpuntenok + } - if ($gem > $hoogstescore){ - $hoogstescore = $gem; - $welkehoogste = $score->nummer; - } - if ($gem <= $laagstescore){ - $laagstescore = $gem; - $welkelaagste = $score->nummer; - } - if ($ambitie && $gem >= $ambitie->zprocent) {$ijkpuntenok = $ijkpuntenok + 1;}; - - } - if ($totaantal >0){ $totgem= round($totgem/ $totaantal, 2);} - } - $totgemkleur= $this->kleurcodes->getkleur($totgem); - // foreach scores bereken som en dus totgem en ijkpuntenok - $tabelid=''; + $tabelid=''; switch ($module){ case 1: $tabelid = "tabelmb1"; break; case 3: $tabelid = "tabeltv1"; break; @@ -616,7 +626,7 @@ class Sopinhouden_model extends MY_Model{ "labels" => $labels, "scores" => $scores, 'totgem' => $totgem, - 'totgemkleur' =>$totgem, + 'totgemkleur' =>$totgemkleur, 'ijkpuntenok' => $ijkpuntenok, 'welkehoogste' => $welkehoogste, 'hoogstescore' => round($hoogstescore,1), @@ -668,16 +678,33 @@ class Sopinhouden_model extends MY_Model{ $lks = $this->Filledversions_model->getlks($orgid, $orgversieid); if ($lks){ foreach($lks as $lk){ - $lk->scores = $this->Scores_model->getlkscores($lk->filledversionid); + $lk->scores = $this->Scores_model->calculateindividualscores($orgversieid, $orgid, $lk->user_id); $som = 0; + if ($lk->scores){ - foreach($lk->scores as $score){ + foreach($lk->scores as $index => $score){ + $aftrek = 0; $score->gem = new stdClass(); - $score->gem = $score->somcore / $score->num; - $score->colorcode = $this->kleurcodes->getkleur($score->gem); - $som = $som + $score->gem; + $score->gem = 0; + $score->colorcode = '#808080'; + $score->disablenvt = 'F'; + if($score->aantalvier > 0 && $score->aantalvier == $score->aantalnvt) $score->disablenvt = 'T'; + if($score->disabled == 'F' && $score->disablenvt == 'F') { + $score->gem = $score->somscore / $score->num; + $score->colorcode = $this->kleurcodes->getkleur($score->gem); + $som = $som + $score->gem; + } + + if($score->disabled == 'T') $aftrek++; + if($score->disablenvt == 'T') $aftrek++; + + + } - $lk->lkgem = round($som / $aantalijkpunten, 0); + + $deler = $aantalijkpunten - $aftrek; + if ($deler > 0) $lk->lkgem = round($som / $aantalijkpunten, 0); + else $lk->gem = 0; $lk->colorcode = $this->kleurcodes->getkleur($lk->lkgem); } } @@ -696,11 +723,21 @@ class Sopinhouden_model extends MY_Model{ if ($lks[0]->scores){ $som = 0; + $aftrek = 0; foreach($lks[0]->scores as $score){ - $score->colorcode = $this->kleurcodes->getkleur($score->gem); - $som = $som + $score->gem; + $score->colorcode = '#808080'; + if($score->disabled == 'F' && $score->disablenvt == 'F') { + $score->colorcode = $this->kleurcodes->getkleur($score->gem); + $som = $som + $score->gem; + } + if($score->disabled =='T' || $score->disablenvt =='T' ) $aftrek++; } - $lks[0]->lkgem = round($som / $aantalijkpunten, 0); + if($aantalijkpunten - $aftrek > 0) { + $lks[0]->lkgem = round($som / ($aantalijkpunten - $aftrek), 0); + } + else{ + $lks[0]->lkgem = 0; + } $lks[0]->colorcode = $this->kleurcodes->getkleur($lks[0]->lkgem); } return $lks; @@ -719,7 +756,7 @@ class Sopinhouden_model extends MY_Model{ } if ($targetversieid){ $targetversie = $this->Orgversies_model->get_record_by_id($targetversieid); - $scores = $this->Scores_model->calculateschool($targetversieid, $orgid); + $scores = $this->Scores_model->getgemscores($targetversieid, $orgid); $ambitie = $this->Ambities_model->getOrgAmbities($targetversieid, $orgid); if($targetversie->scoretype == 7){ @@ -743,10 +780,12 @@ class Sopinhouden_model extends MY_Model{ foreach($scores as $score){ $score->gem = 0; - if ($score->num > 0) { - $score->gem= round($score->somscore / $score->num,1); + if (isset($score->gem)) { + $score->gem= round($score->gem); } - $score->huidig = $this->kleurcodes->getnummer($score->gem); + $score->kleur = '#808080'; + if(isset($score->kleurcode)) $score->kleur = $score->kleurcode; + $score->huidig = $score->kleurnummer; if($targetversie->scoretype == 7){ if($score->gem == $grens3) $score->huidig = 4; if($score->gem < $grens3) $score->huidig = 3; @@ -754,10 +793,15 @@ class Sopinhouden_model extends MY_Model{ if($score->gem < $grens1) $score->huidig = 1; } - if ($gewenst){ + if ($gewenst){ + $score->wens = $gewenst[$i]->wens; $i = $i + 1; - }; + } + else{ + $score->wens = 3; + $score->wenskleur = '#9fdf9f'; + } }; //foreach $labels = $this->Labels_model->getalllabels($module); diff --git a/application/models/monpas/Wenssituaties_model.php b/application/models/monpas/Wenssituaties_model.php index a43c1ed..80a8c4f 100644 --- a/application/models/monpas/Wenssituaties_model.php +++ b/application/models/monpas/Wenssituaties_model.php @@ -12,10 +12,12 @@ class Wenssituaties_model extends MY_Model{ $this->load->model($models); } function getgewenst($orgversieid, $orgid){ - $this->sql = "SELECT id, ijkpunt_id, wens - FROM tb_wenssituaties - WHERE organisatie_id = {$orgid} - AND orgversie_id = {$orgversieid}"; + $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 orgversie_id = {$orgversieid} + ORDER BY Y.nummer "; return $this->get_query_result(); } function getgewenstvoorpartituur($orgversieid, $orgid){ diff --git a/application/models/testPrint.http b/application/models/testPrint.http new file mode 100644 index 0000000..9e226a2 --- /dev/null +++ b/application/models/testPrint.http @@ -0,0 +1,10 @@ +### Send POST request with json body +POST https://print.pensare-services.nl/test/1 +Content-Type: application/json + +{ + "html":"

test

", + "file":"test.png", + "app": "MONPAS" +} + diff --git a/application/views/monpas/compactsop/expertisecompact.php b/application/views/monpas/compactsop/expertisecompact.php index e8eef99..cd6d0b4 100644 --- a/application/views/monpas/compactsop/expertisecompact.php +++ b/application/views/monpas/compactsop/expertisecompact.php @@ -45,12 +45,15 @@ if(isset($score->omschrijving)){ $omschrijving = $score->omschrijving; }; + $kleur = '#808080'; + if(isset($score->kleur) && $score->disabled == 'F' && $score->disablenvt =='F') $kleur = $score->kleur; + ?> labels.push(nummer ?>); scores.push({ y: gem ?>, - color: 'kleur ?>', + color: '', name: 'nummer ?>', soort: 'score', versie: periodenummer ?>, @@ -235,9 +238,9 @@ omschrijving) ? $score->omschrijving: 'Gemiddelde'?> scores[$i]->kleur) ? $lijst->scores[$i]->kleur : ''; - $gem = isset($lijst->scores[$i]->gem) ? $lijst->scores[$i]->gem : ''; ?> - !important; padding-right: 3px; text-align: right" > diff --git a/application/views/monpas/compactsop/expertisecompactsosbo.php b/application/views/monpas/compactsop/expertisecompactsosbo.php index 3c72467..14fb234 100644 --- a/application/views/monpas/compactsop/expertisecompactsosbo.php +++ b/application/views/monpas/compactsop/expertisecompactsosbo.php @@ -235,9 +235,9 @@ omschrijving) ? $score->omschrijving: 'Gemiddelde'?> scores[$i]->kleur) ? $lijst->scores[$i]->kleur : ''; - $gem = isset($lijst->scores[$i]->gem) ? $lijst->scores[$i]->gem : ''; ?> - !important; padding-right: 3px; text-align: right" > diff --git a/application/views/monpas/compactsop/extracompact.php b/application/views/monpas/compactsop/extracompact.php index a1f10c3..aa47859 100644 --- a/application/views/monpas/compactsop/extracompact.php +++ b/application/views/monpas/compactsop/extracompact.php @@ -233,9 +233,9 @@ white-space: nowrap;" >omschrijving) ? $score->omschrijving: 'Gemiddelde'?> scores[$i]->kleur) ? $lijst->scores[$i]->kleur : ''; - $gem = isset($lijst->scores[$i]->gem) ? $lijst->scores[$i]->gem : ''; ?> - !important; padding-right: 3px; text-align: right" > diff --git a/application/views/monpas/compactsop/ijktabelcompact.php b/application/views/monpas/compactsop/ijktabelcompact.php index 12181e6..287d805 100644 --- a/application/views/monpas/compactsop/ijktabelcompact.php +++ b/application/views/monpas/compactsop/ijktabelcompact.php @@ -45,13 +45,15 @@ $omschrijving = "gemiddelde"; if(isset($score->omschrijving)){ $omschrijving = $score->omschrijving; + $kleur = '#808080'; + if(isset($score->kleur) && $score->disabled == 'F' && $score->disablenvt =='F') $kleur = $score->kleur; }; ?> labels.push(nummer ?>); scores.push({ y: gem ?>, - color: 'kleur ?>', + color: '', name: 'nummer ?>', soort: 'score', versie: periodenummer ?>, @@ -234,8 +236,8 @@ omschrijving) ? $score->omschrijving: 'Gemiddelde'?> scores[$i]->kleur) ? $lijst->scores[$i]->kleur : ''; - $gem = isset($lijst->scores[$i]->gem) ? $lijst->scores[$i]->gem : ''; ?> + $kleur = $lijst->scores[$i]->disabled == 'T' || $lijst->scores[$i]->disablenvt == 'T' ? '' : (isset($lijst->scores[$i]->kleur) ? $lijst->scores[$i]->kleur : ''); + $gem = $lijst->scores[$i]->disabled == 'T' ? 'uit' : ($lijst->scores[$i]->disablenvt == 'T' ? 'nvt' : (isset($lijst->scores[$i]->gem) ? $lijst->scores[$i]->gem : '')); ?> diff --git a/application/views/monpas/compactsop/inspectiecompact.php b/application/views/monpas/compactsop/inspectiecompact.php index cdf0f74..1378e96 100644 --- a/application/views/monpas/compactsop/inspectiecompact.php +++ b/application/views/monpas/compactsop/inspectiecompact.php @@ -227,8 +227,8 @@ omschrijving) ? $score->omschrijving: 'Gemiddelde'?> scores[$i]->kleur) ? $lijst->scores[$i]->kleur : ''; - $gem = isset($lijst->scores[$i]->gem) ? $lijst->scores[$i]->gem : ''; ?> + $kleur = $lijst->scores[$i]->disabled == 'T' || $lijst->scores[$i]->disablenvt == 'T' ? '' : (isset($lijst->scores[$i]->kleur) ? $lijst->scores[$i]->kleur : ''); + $gem = $lijst->scores[$i]->disabled == 'T' ? 'uit' : ($lijst->scores[$i]->disablenvt == 'T' ? 'nvt' : (isset($lijst->scores[$i]->gem) ? $lijst->scores[$i]->gem : '')); ?> diff --git a/application/views/monpas/compactsop/tevredencompact.php b/application/views/monpas/compactsop/tevredencompact.php index 3e83613..0f74a49 100644 --- a/application/views/monpas/compactsop/tevredencompact.php +++ b/application/views/monpas/compactsop/tevredencompact.php @@ -227,8 +227,9 @@ omschrijving) ? $score->omschrijving: 'Gemiddelde'?> scores[$i]->kleur) ? $lijst->scores[$i]->kleur : ''; - $gem = isset($lijst->scores[$i]->gem) ? $lijst->scores[$i]->gem : ''; ?> + $kleur = $lijst->scores[$i]->disabled == 'T' || $lijst->scores[$i]->disablenvt == 'T' ? '' : (isset($lijst->scores[$i]->kleur) ? $lijst->scores[$i]->kleur : ''); + $gem = $lijst->scores[$i]->disabled == 'T' ? 'uit' : ($lijst->scores[$i]->disablenvt == 'T' ? 'nvt' : (isset($lijst->scores[$i]->gem) ? $lijst->scores[$i]->gem : '')); ?> + diff --git a/application/views/monpas/pages/ijkpunten.php b/application/views/monpas/pages/ijkpunten.php index e06143c..32c060d 100644 --- a/application/views/monpas/pages/ijkpunten.php +++ b/application/views/monpas/pages/ijkpunten.php @@ -280,7 +280,7 @@ @@ -299,8 +299,9 @@ style: {backgroundColor: kleur}"> + data-bind="text: gemV, + style: {backgroundColor: kleurV}"> + diff --git a/application/views/monpas/pages/matrix.php b/application/views/monpas/pages/matrix.php index 26f72ab..e7e6e3a 100644 --- a/application/views/monpas/pages/matrix.php +++ b/application/views/monpas/pages/matrix.php @@ -190,8 +190,9 @@ - + diff --git a/application/views/monpas/pages/monitor.php b/application/views/monpas/pages/monitor.php index 8ead46a..1651793 100644 --- a/application/views/monpas/pages/monitor.php +++ b/application/views/monpas/pages/monitor.php @@ -1,148 +1,199 @@
-
- Invullen kan alleen op schoolniveau -
-
- Er zijn geen periodes voor uw organisatie. Neem contact op met de helpdesk. -
- -
-

Selecteer een periode - - - - - - + + + -

-
-
-

De lijst wordt automatisch opgeslagen. + +

+
+

De lijst wordt automatisch opgeslagen.

-

Klik op een donkerrode balk van een ijkpunt voor inhoudelijke toelichting. +

Klik op een donkerrode balk van een ijkpunt voor inhoudelijke toelichting.

-
-
+
+
-
- +
+
- - - - - - - - - +
- - - - - - - - - + + + + + + + + + -
nr indicator score
+ +
+ + + + + + + + + - - - - - + + + + - - +
+ + + + + + + + + + + + + + + + + + + -
nr + indicator + score +
- - +
+ + - + % + enable: $root.editok() && $parent.disabled() == false" /> % -
- - - - - - -
- - - - - - - - +
nr indicator
+ + + + + + + + - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - +
nr indicator
- -
-
+ +
+ + +

+

+
+ +

+

+
- -

-
+ +
- -
+
+
+

Notitie

+ +
+
+
+
+

+ + + Zichtbaar maken bij de tabbladen ijkpunten, resultaatmatrix, ontwikkelagenda & lijsten.* +

- -
-
-

Notitie

- -
-
-
-
-

- - - Zichtbaar maken bij de tabbladen ijkpunten, resultaatmatrix, ontwikkelagenda & lijsten.* -

- -
-

*Vul de gehele lijst in voordat u deze zichtbaar maakt. Niet ingevulde indicatoren worden ook meegenomen bij de berekening van het gemiddelde.

-
-
+
+

*Vul de gehele lijst in voordat u deze zichtbaar maakt. Niet ingevulde indicatoren worden ook meegenomen bij de berekening van het gemiddelde.

+
+
-
+ 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 @@ - + - huidige situatie
  + huidige situatie
  - gewenste situatie
  + gewenste situatie
  @@ -204,25 +204,34 @@ 2 3 4 + 1 2 3 4 + - + + + data-bind=" click: $parent.fToonToelichting, style: {backgroundColor: disabled == 'T' || disablentv == 'T' ? '#cccccc' : ''}"> + + (Uitgezet.) + (Niet van toepassing.)
+
@@ -230,6 +239,7 @@
+
diff --git a/application/views/monpas/pages/versies.php b/application/views/monpas/pages/versies.php index dedb2e3..78439d8 100644 --- a/application/views/monpas/pages/versies.php +++ b/application/views/monpas/pages/versies.php @@ -1,231 +1,248 @@ - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
i nr omschrijvingtoelichting deladd
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
nr w. schoolvorm ik-vorm del
- - + + + + + + + +
+ + + + + + + + + + + + + + + + + + + - - - - - - - -
nr w. schoolvorm ik-vorm del
+ + - - -

-
+

+
-
- - - - + + + + - - - - - + + + + + + + + + \ No newline at end of file diff --git a/application/views/monpas/sop/indiviudeleagenda.php b/application/views/monpas/sop/indiviudeleagenda.php index c4c21b7..3648a06 100644 --- a/application/views/monpas/sop/indiviudeleagenda.php +++ b/application/views/monpas/sop/indiviudeleagenda.php @@ -1,84 +1,116 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - -
huidige situatie gewenste situatie
1 2 3 4 1 2 3 4
nummer?>omschrijving?> - huidig == 1){ - echo "
"; - };?> -
- huidig == 2){ - echo "
"; - };?> -
- huidig == 3){ - echo "
"; - };?> -
- huidig == 4){ - echo "
"; - };?> -
huidige situatie gewenste situatie
1 2 3 4 1 2 3 4
nummer?>omschrijving?> + omschrijving?> + disabled == 'T'){echo ' (uit)';} ?> + disabled == 'F' && $score->disablenvt == 'T'){echo ' (nvt)';} ?> - + omschrijving)){echo $score->omschrijving;} ?> + disabled == 'T'){echo ' (uit)';} ?> + disabled == 'F' && $score->disablenvt == 'T'){echo ' (nvt)';} ?> + + huidig == 1){ ?> +
+ +
+ huidig == 2){ ?> +
+ +
+ huidig == 3){ ?> +
+ +
+ huidig == 4){ ?> +
+ +
+ disabled == 'T' || $score->disablenvt == 'T'){ ?> +
+ +
- wens) && $score->wens == 1){ - echo "
"; - };?> -
- wens) && $score->wens == 2){ - echo "
"; - };?> -
- wens) && $score->wens == 3){ - echo "
"; - };?> -
- wens) && $score->wens == 4){ - echo "
"; - };?> -
-

- + + + + wens) && $score->wens == 1){ ?> +
+ + + + + wens) && $score->wens == 2){ ?> +
+ + + + wens) && $score->wens == 3){ ?> +
+ + + + wens) && $score->wens == 4){ ?> +
+ + + + disabled == 'T' || $score->disablenvt == 'T'){ ?> +
+ + + + + +

+ diff --git a/application/views/monpas/sop/monbasgrafiek1.php b/application/views/monpas/sop/monbasgrafiek1.php index 3176bd1..33dfc59 100644 --- a/application/views/monpas/sop/monbasgrafiek1.php +++ b/application/views/monpas/sop/monbasgrafiek1.php @@ -16,26 +16,34 @@ var ambitiescore= gemscore; ?>; var lijnAt = (((100 - parseFloat(ambitiescore)) / 10 ) * 25 ) +12; var j=0; - $.each(results, function(i,p){ - // scores[i] = p.gem(); - if (p.num > 0){ - scores[i]=p.somscore / p.num; - } - else {scores[i]= 0;}; - slabels[i] = p.nummer; - tekstlabels[i] = p.omschrijving; - j ++; - }); // each - slabels[j]='gem'; - scores[j]= ; - var ctxSchoolijkpunt2=$("#schoolijkpunt2").get(0).getContext("2d"); + var colors=[] + $score){ ?> + + slabels.push('nummer ?>'); + tekstlabels.push('omschrijving ?>'); + // scores.push({ + // y: gem ?>, + // color: 'kleur)? $score->kleur : "#808080" ?>', + // name: 'nummer ?>', + + // }); + scores.push(gem ?>) + colors.push('kleurcode) ? $score->kleurcode : "#808080" ?>') + + + slabels.push('gem') + scores.push() + colors.push('') + + var ctxSchoolijkpunt2=$("#schoolijkpunt2").get(0).getContext("2d"); var data5 = {labels :slabels, datasets: [{ label: tekstlabels, - fillColor: "rgba(147,15,80,0.9)", - strokeColor: "rgba(111,11,61,1)", - highlightStroke: "rgba(222,22,123,1)", - data: scores}, + fillColor: "rgba(147,15,80,0.9)", + strokeColor: "rgba(111,11,61,1)", + highlightStroke: "rgba(222,22,123,1)", + data: scores + }, ]} Chart.types.Bar.extend({ diff --git a/application/views/monpas/sop/monbastabel1.php b/application/views/monpas/sop/monbastabel1.php index 0dcfda2..aa9a5c8 100644 --- a/application/views/monpas/sop/monbastabel1.php +++ b/application/views/monpas/sop/monbastabel1.php @@ -33,21 +33,24 @@ - somscore / $score->num,1); + disabled == 'T' || $score->disablenvt == 'T' ? '#808080' : $score->kleurcode; ?> + + nummer?> omschrijving?> - - - - + + disabled == 'T' ? 'uit' : ($score->disablenvt == 'T' ? 'nvt' : (isset($score->gem) ? $score->gem : '')) ?> + + + diff --git a/application/views/monpas/sop/monbastabel2.php b/application/views/monpas/sop/monbastabel2.php index e23b7d2..4b1f739 100644 --- a/application/views/monpas/sop/monbastabel2.php +++ b/application/views/monpas/sop/monbastabel2.php @@ -24,8 +24,11 @@ scores) { - foreach($lk->scores as $result){ - echo "".number_format($result->gem,0).""; + foreach($lk->scores as $result){ + $tekst = number_format($result->gem,0); + if($result->disablenvt == 'T') $tekst = 'nvt'; + if($result->disabled == 'T') $tekst = 'uit'; + echo "".$tekst.""; };?> lkgem?> diff --git a/application/views/monpas/sop/ontwikkelagenda.php b/application/views/monpas/sop/ontwikkelagenda.php index 2a65993..1305e7e 100644 --- a/application/views/monpas/sop/ontwikkelagenda.php +++ b/application/views/monpas/sop/ontwikkelagenda.php @@ -3,13 +3,13 @@ - + - huidige situatie + huidige situatie - gewenste situatie + gewenste situatie @@ -18,62 +18,122 @@ 2 3 4 + 1 2 3 4 + + nummer?> - omschrijving?> - - huidig == 1){ - echo "
"; - };?> - - - huidig == 2){ - echo "
"; - };?> - - - huidig == 3){ - echo "
"; - };?> - - - huidig == 4){ - echo "
"; - };?> - + + omschrijving?> + disabled == 'T'){echo ' (uit)';} ?> + disabled == 'F' && $score->disablenvt == 'T'){echo ' (nvt)';} ?> - + + + kleurnummer == 1){ + $kleur = ''; + if($score->disabled == 'F' && $score->disablenvt == 'F') $kleur = '#e08885'; - - wens) && $score->wens == 1){ - echo "
"; - };?> - - - - wens) && $score->wens == 2){ - echo "
"; - };?> - - - wens) && $score->wens == 3){ - echo "
"; - };?> - - - wens) && $score->wens == 4){ - echo "
"; - };?> - + ?> +
+ + + + kleurnummer == 2){ + $kleur = ''; + if($score->disabled == 'F' && $score->disablenvt == 'F') $kleur = '#ffcc80'; + + ?> + +
+ + + + kleurnummer == 3){ + $kleur = ''; + if($score->disabled == 'F' && $score->disablenvt == 'F') $kleur = '#9fdf9f'; + + ?> +
+ + + + kleurnummer == 4){ + $kleur = ''; + if($score->disabled == 'F' && $score->disablenvt == 'F') $kleur = '#99d6ff'; + + ?> +
+ + + + disabled == 'T' || $score->disablenvt == 'T'){ ?> +
+ + + + + + + wens) && $score->wens == 1){ + $kleur = ''; + if($score->disabled == 'F' && $score->disablenvt == 'F') $kleur = '#e08885'; + + + ?> +
+ + + + + wens) && $score->wens == 2){ + $kleur = ''; + if($score->disabled == 'F' && $score->disablenvt == 'F') $kleur = '#ffcc80'; + ?> +
+ + + + wens) && $score->wens == 3){ + $kleur = ''; + if($score->disabled == 'F' && $score->disablenvt == 'F') $kleur = '#99d6ff'; + + ?> +
+ + + + wens) && $score->wens == 4){ + $kleur = ''; + if($score->disabled == 'F' && $score->disablenvt == 'F') $kleur = '#99d6ff'; + ?> +
+ + + + disabled == 'T' || $score->disablenvt == 'T'){ ?> +
+ + diff --git a/application/views/monpas/sop/ontwikkelagenda2.php b/application/views/monpas/sop/ontwikkelagenda2.php index 1edadc2..20e9761 100644 --- a/application/views/monpas/sop/ontwikkelagenda2.php +++ b/application/views/monpas/sop/ontwikkelagenda2.php @@ -1,7 +1,12 @@ wens) && $score->huidig < $score->wens){?> + if (isset($score->wens) && + $score->huidig < $score->wens && + $score->wens!= 0 && + isset($score->omschrijving ) && + $score->disabled == 'F' && + $score->disablenvt == 'F'){?> diff --git a/application/views/monpas/sopkeuze/agendagemiddeld.php b/application/views/monpas/sopkeuze/agendagemiddeld.php index 7d81eca..7c0f18e 100644 --- a/application/views/monpas/sopkeuze/agendagemiddeld.php +++ b/application/views/monpas/sopkeuze/agendagemiddeld.php @@ -16,13 +16,13 @@ - + - + - + @@ -31,63 +31,93 @@ + + - + + scores){ - foreach ($data['lijsten'][0]->scores as $ijkpunt){ - if($ijkpunt->nummer != 'gem'){?> + foreach ($data['lijsten'][0]->scores as $score){ + if($score->nummer != 'gem'){?> - - + + + + + + +
nummer?> omschrijving?>
huidige situatie huidige situatie gewenste situatie gewenste situatie
nr 2 3 4 1 2 3 4 4
nummer;?>omschrijving)){echo $ijkpunt->omschrijving;}?>nummer;?>omschrijving)){echo $score->omschrijving;}?> + omschrijving)){echo $score->omschrijving;}?> + disabled == 'T'){echo ' (uit)';} ?> + disabled == 'F' && $score->disablenvt == 'T'){echo ' (nvt)';} ?> + - huidig == 1){?> -
+ huidig) && $score->huidig == 1){ ?> +
+ +
+ huidig) && $score->huidig == 2){ ?> +
- huidig == 2){?> -
+ huidig) && $score->huidig == 3){ ?> +
- huidig == 3){?> -
- + huidig) && $score->huidig == 4){ ?> +
+
- huidig == 4){?> -
- + disabled == 'T' || $score->disablenvt == 'T'){ ?> +
+
- wens) && $ijkpunt->wens == 1){ ?> -
- + wens) && $score->wens == 1){ ?> +
+
- wens) && $ijkpunt->wens == 2){ ?> -
+ wens) && $score->wens == 2){ ?> +
- wens) && $ijkpunt->wens == 3){ ?> -
- + wens) && $score->wens == 3){ ?> +
+
- wens) && $ijkpunt->wens == 4){ ?> -
- + wens) && $score->wens == 4){ ?> +
+
+ disabled == 'T' || $score->disablenvt == 'T'){ ?> +
+ +
diff --git a/application/views/monpas/sopkeuze/ijkgrafiekgemiddeld.php b/application/views/monpas/sopkeuze/ijkgrafiekgemiddeld.php index b736e68..b5ab8d9 100644 --- a/application/views/monpas/sopkeuze/ijkgrafiekgemiddeld.php +++ b/application/views/monpas/sopkeuze/ijkgrafiekgemiddeld.php @@ -48,12 +48,17 @@ var xastitel = 'label ?>'; - scores as $index2 => $score){ ?> + scores as $index2 => $score){ + $kleur = '#808080'; + if($score->disabled == 'F' && $score->disablenvt == 'F' && isset($score->kleur)) $kleur = $score->kleur; + + + ?> labels.push(nummer ?>); scores.push({ y: gem ?>, - color: 'kleur ?>', + color: '', name: 'nummer ?>', soort: 'score', versie: periodenummer ?> diff --git a/application/views/monpas/sopkeuze/ijkpuntentabel.php b/application/views/monpas/sopkeuze/ijkpuntentabel.php index cdad671..5c83790 100644 --- a/application/views/monpas/sopkeuze/ijkpuntentabel.php +++ b/application/views/monpas/sopkeuze/ijkpuntentabel.php @@ -41,12 +41,11 @@ - scores as $score){?> + scores as $score){ + $kleur = $score->disabled == 'T' || $score->disablenvt == 'T' ? '#808080' : $score->kleur; ?> - - - - gem ?> + + disabled == 'T' ? 'uit' : ($score->disablenvt == 'T' ? 'nvt' : (isset($score->gem) ? $score->gem : '')) ?> @@ -54,7 +53,7 @@ -

Scores in procenten.

+

Scores in procenten.

diff --git a/application/views/monpas/sopkeuze/ijktabelgemiddeld.php b/application/views/monpas/sopkeuze/ijktabelgemiddeld.php index 89dfa34..41a4605 100644 --- a/application/views/monpas/sopkeuze/ijktabelgemiddeld.php +++ b/application/views/monpas/sopkeuze/ijktabelgemiddeld.php @@ -22,11 +22,12 @@ - scores ? $data['lijsten'][0]->scores : [] as $ijkpunt){ + scores ? $data['lijsten'][0]->scores : [] as $score){ ?> - nummer != 'gem'){ echo $ijkpunt->nummer;}?> - omschrijving) ? $ijkpunt->omschrijving: 'Gemiddelde'?> + nummer != 'gem'){ echo $score->nummer;}?> + + omschrijving) ? $score->omschrijving: 'Gemiddelde'?> @@ -42,12 +43,19 @@ scores) - foreach($lijst->scores as $ijkpunt){?> + foreach($lijst->scores as $score){ + $kleur = '#808080'; + if(isset($score->kleur) && $score->disabled == 'F' && $score->disablenvt== 'F') + $kleur = $score->kleur; + $gem = $score->gem; + if($score->disablenvt == 'T') $gem = 'nvt'; + if($score->disabled == 'T') $gem = 'uit'; + ?> - - gem ?> + + diff --git a/application/views/monpas/sopkeuze/matrix.php b/application/views/monpas/sopkeuze/matrix.php index 61cab96..641d5ce 100644 --- a/application/views/monpas/sopkeuze/matrix.php +++ b/application/views/monpas/sopkeuze/matrix.php @@ -42,10 +42,17 @@ scores){ - foreach($data['lijsten'][0]->scores as $score){ ?> - + foreach($data['lijsten'][0]->scores as $score){ + $kleur = '#808080'; + if($score->disabled == 'F' && $score->disablenvt == 'F') $kleur = $score->kleur; + $gem = number_format($score->gem); + if($score->disablenvt == 'T') $gem = 'nvt'; + if($score->disabled == 'T') $gem = 'uit'; + ?> + +
- gem); +
diff --git a/application/views/monpas/sopkeuze/matrixgemiddeld.php b/application/views/monpas/sopkeuze/matrixgemiddeld.php index 41f8816..59fdf7b 100644 --- a/application/views/monpas/sopkeuze/matrixgemiddeld.php +++ b/application/views/monpas/sopkeuze/matrixgemiddeld.php @@ -20,9 +20,9 @@ scores){ - foreach($data['lijsten'][0]->scores as $ijkpunt){ ?> + foreach($data['lijsten'][0]->scores as $score){ ?> - nummer; + nummer; ?> scores){ - foreach($data['lijsten'][0]->scores as $ijkpunt){ ?> - + foreach($data['lijsten'][0]->scores as $score){ + $kleur = '#808080'; + if($score->disabled == 'F' && $score->disablenvt == 'F' && isset($score->kleur)) $kleur = $score->kleur; + $gem = number_format($score->gem); + if($score->disablenvt == 'T') $gem = 'nvt'; + if($score->disabled == 'T') $gem = 'uit';?> +
- score); +
diff --git a/application/views/monpas/sopkeuze/ontwikkelagenda.php b/application/views/monpas/sopkeuze/ontwikkelagenda.php index e4650e6..61c16cb 100644 --- a/application/views/monpas/sopkeuze/ontwikkelagenda.php +++ b/application/views/monpas/sopkeuze/ontwikkelagenda.php @@ -16,13 +16,13 @@ - + - huidige situatie + huidige situatie - gewenste situatie + gewenste situatie nr @@ -31,73 +31,91 @@ 2 3 4 + 1 2 3 4 + scores){ foreach ($data['lijsten'][0]->scores as $score){ - if($score->nummer != 'gem'){?> + if($score->nummer != 'gem'){?> - nummer!= 'gem') echo $score->nummer;?> + nummer!= 'gem') echo $score->nummer;?> + - omschrijving)){echo $score->omschrijving;} ?> + omschrijving)){echo $score->omschrijving;} ?> + disabled == 'T'){echo ' (uit)';} ?> + disabled == 'F' && $score->disablenvt == 'T'){echo ' (nvt)';} ?> + huidig == 1){ ?>
+ background-color:disabled == 'T' || $score->disablenvt == 'T' ? '': $score->kleur;} ?>"> huidig == 2){ ?>
+ background-color:disabled == 'T' || $score->disablenvt == 'T' ? '': $score->kleur;} ?>"> huidig == 3){ ?>
+ background-color:disabled == 'T' || $score->disablenvt == 'T' ? '': $score->kleur;} ?>"> huidig == 4){ ?>
+ background-color:disabled == 'T' || $score->disablenvt == 'T' ? '': $score->kleur;} ?>"> + + disabled == 'T' || $score->disablenvt == 'T'){ ?> +
+ + wens) && $score->wens == 1){ ?>
+ background-color:disabled == 'T' || $score->disablenvt == 'T' ? '': $score->wenskleur;} ?>"> wens) && $score->wens == 2){ ?>
+ background-color:disabled == 'T' || $score->disablenvt == 'T' ? '': $score->wenskleur;} ?>"> wens) && $score->wens == 3){ ?>
+ background-color:disabled == 'T' || $score->disablenvt == 'T' ? '': $score->wenskleur;} ?>"> wens) && $score->wens == 4){ ?>
+ background-color:disabled == 'T' || $score->disablenvt == 'T' ? '': $score->wenskleur;} ?>"> + + disabled == 'T' || $score->disablenvt == 'T'){ ?> +
+ + diff --git a/public/css/monpas/main.css b/public/css/monpas/main.css index e8eb2ae..8b96669 100644 --- a/public/css/monpas/main.css +++ b/public/css/monpas/main.css @@ -920,6 +920,12 @@ tr.selected, td.selected{ .rood{ background-color:#e08885; } + +.grijs{ + background-color:#808080; + +} + .submenupage{ display:none; } diff --git a/public/js/monpas/models/ijkpuntenmodel.js b/public/js/monpas/models/ijkpuntenmodel.js index 5da9569..7b88e6a 100644 --- a/public/js/monpas/models/ijkpuntenmodel.js +++ b/public/js/monpas/models/ijkpuntenmodel.js @@ -149,14 +149,14 @@ ls.initIJkpuntenModel = function(){ this.scores = ko.observableArray([]); this.erzijnscores = ko.observable(true); - if(l.scores){ var meegeven = 'scores'; $.each(l.scores, function (i, s){ dit.scores.push(new fAddScore(i,s, meegeven)) }) } - else if(l.vergelijkingen){ + else if(l.vergelijkingen){ + var meegeven = 'vergelijkingen'; $.each(l.vergelijkingen, function (x, v){ dit.scores.push(new fAddScore(x,v, meegeven)) @@ -188,17 +188,42 @@ ls.initIJkpuntenModel = function(){ this.omschrijving = s.omschrijving; this.toelichting = s.toelichting; if (meegeven == 'vergelijkingen'){ - this.gem = 'nvt'; - this.gemV = s.gem; - this.kleur = 'lightgray' - this.kleurV = s.kleur; + this.gem = ''; + this.gemV = s.gemV; + this.disabled = ko.observable(false); + this.disabledV = ko.observable(false); + if(s.disablenvtV =='T') dit.gemV ='nvt'; + if(s.disabledV =='T') dit.gemV ='uitgezet'; + if(s.disabledV =='T') dit.gem ='uitgezet'; + if(s.disabledV == 'T') dit.disabledV(true) + this.disablenvt = ko.observable(false); + this.disablenvtV = ko.observable(false); + if(s.disablenvtV == 'T') dit.disablenvtV(true); + this.kleur = 'lightgray'; + this.kleurV = ko.observable ='lightgray'; + if(s.disabled == 'F' && s.disablenvt == 'F')this.kleurV =s.kleurV; + } else { - this.gem = s.gem; - this.gemV = s.gemV; + this.gem = s.gem; + if(s.disablenvt =='T') dit.gem ='nvt'; + if(s.disabled =='T') dit.gem ='uitgezet'; + this.gemV = s.gemV; + if(s.disablenvtV =='T') dit.gemV ='nvt'; + if(s.disabledV =='T') dit.gemV ='uitgezet'; + this.disabled = ko.observable(false); + if(s.disabled == 'T') dit.disabled(true); + this.disabledV = ko.observable(false); + if(s.disabledV == 'T') dit.disabledV(true) + this.disablenvt = ko.observable(false); + if(s.disablenvt == 'T') dit.disablenvt(true); + this.disablenvtV = ko.observable(false); + if(s.disablenvtV == 'T') dit.disablenvtV(true); + this.kleur = 'lightgray'; + if(s.disabled == 'F' && s.disablenvt == 'F')this.kleur = s.kleur; + this.kleurV = 'lightgray'; + if(s.disabledV == 'F' && s.disablenvtV == 'F')this.kleurV =s.kleurV; - this.kleur = s.kleur; - this.kleurV = s.kleurV; } } @@ -468,8 +493,6 @@ ls.initIJkpuntenModel = function(){ self.nieuwsteVersie(nieuw); } $.each(result.lijsten, function(j,l){ - console.log(l, "l") - if(j == 0){ self.label(l.label) diff --git a/public/js/monpas/models/matrixmodel.js b/public/js/monpas/models/matrixmodel.js index a699804..9701b20 100644 --- a/public/js/monpas/models/matrixmodel.js +++ b/public/js/monpas/models/matrixmodel.js @@ -119,7 +119,6 @@ $(function () { } function fAddResult(k) { - var dit = this; if (k.gem === '' || isNaN(k.gem) || k.gem === null) { this.gem = 0; } @@ -128,7 +127,11 @@ $(function () { } this.num = k.nummer; this.colorcode = '#e08885'; - if(k.kleur) dit.colorcode = k.kleur; + if(k.kleurcode) this.colorcode = k.kleurcode; + if (k.disabled == "T" || k.disablenvt == "T") { + this.gem=''; + this.colorcode="#cccccc"; + } } function fAddCriteria(c) { diff --git a/public/js/monpas/models/monitormodel.js b/public/js/monpas/models/monitormodel.js index 79b97d2..2e81921 100644 --- a/public/js/monpas/models/monitormodel.js +++ b/public/js/monpas/models/monitormodel.js @@ -1,243 +1,246 @@ $(function(){ -ls.initMonitorModel = function(){ - var timer; + ls.initMonitorModel = function(){ + var timer; - function fAddOrgversion(p){ + function fAddOrgversion(p){ - var dit = this; - this.id = p.id; //orgversion id - this.periodenummer = p.periodenummer; - this.versie_id = p.versie_id; - this.vorm = p.vorm; - this.scoretype = p.scoretype; - this.toonOmschrijving = ko.observable(false); - if(p.score_omschrijving == 'T') this.toonOmschrijving(true); - this.naam = p.naam; - // this.meetellen = ko.observable(false); - // if(p.meetellen == 1){ - // dit.meetellen(true); - // } + var dit = this; + this.id = p.id; //orgversion id + this.periodenummer = p.periodenummer; + this.versie_id = p.versie_id; + this.vorm = p.vorm; + this.scoretype = p.scoretype; + this.toonOmschrijving = ko.observable(false); + if(p.score_omschrijving == 'T') this.toonOmschrijving(true); + this.naam = p.naam; + // this.meetellen = ko.observable(false); + // if(p.meetellen == 1){ + // dit.meetellen(true); + // } - this.geldigvanaf = p.geldigvanaf; - this.geldigtm = p.geldigtm; - this.invullentm = p.invullentm; - this.info = ko.computed(function(){ - var infostr=this.naam + " - periode " + this.periodenummer ; - infostr += " van " + this.geldigvanaf + " t/m " + this.geldigtm; - return infostr; - },this); - } + this.geldigvanaf = p.geldigvanaf; + this.geldigtm = p.geldigtm; + this.invullentm = p.invullentm; + this.info = ko.computed(function(){ + var infostr=this.naam + " - periode " + this.periodenummer ; + infostr += " van " + this.geldigvanaf + " t/m " + this.geldigtm; + return infostr; + },this); + } - function fAddListitem(p){ - - var dit = this; - this.id = p.id - this.nummer = p.nummer - this.omschrijving = p.omschrijving; - this.toelichting = p.toelichting; - this.indicatorscores = ko.observableArray([]); - $.each(p.indicatorscores, function(j,k){ - dit.indicatorscores.push(new fAddIndicatorscore(k)); - }); + function fAddListitem(p){ + + var dit = this; + this.id = p.id + this.nummer = p.nummer + this.omschrijving = p.omschrijving; + this.toelichting = p.toelichting; + this.disabled = ko.observable(false); + if(p.disabled == 'T')dit.disabled(true); + this.indicatorscores = ko.observableArray([]); + $.each(p.indicatorscores, function(j,k){ + dit.indicatorscores.push(new fAddIndicatorscore(k)); + }); - } + } - function fAddIndicatorscore(k){ - var dit = this; - this.id = k.id - this.nummer = k.nummer - this.omschrijving = k.omschrijving - this.inspectie = k.inspectie - this.score = ko.observable(k.score) - this.scoretype = k.scoretype; + function fAddIndicatorscore(k){ + var dit = this; + this.id = k.id + this.nummer = k.nummer + this.omschrijving = k.omschrijving + this.inspectie = k.inspectie + this.score = ko.observable(k.score) + this.scoretype = k.scoretype; - // this.jatext = ko.computed(function(){ - // switch (parseFloat(dit.scoretype)){ - // case 3: - // case 4: - // case 5: return 'ja'; break; - // case 6: return "onvol."; break; - // case 7: return "included"; break; - // default: return 'ja'; - // } - // }) - // this.neetext = ko.computed(function(){ - // switch (parseFloat(dit.scoretype)){ - // case 3: - // case 4: - // case 5: return 'nee'; break; - // case 6: return "vol."; break; - // case 7: return "involved"; break; - // default: return 'nee'; - // } - // }) - // this.thirdoptiontext = ko.computed(function(){ - // switch (parseFloat(dit.scoretype)){ - // case 3: return "bezig"; break; - // case 4: return "nvt"; break; - // case 5: return "i.o."; break; - // case 6: return "goed"; break; - // case 7: return "present"; break; - // default: return ""; - // } - // }); - // this.fourthoptiontext = ko.computed(function(){ - // return 'absent' - // }); - } + // this.jatext = ko.computed(function(){ + // switch (parseFloat(dit.scoretype)){ + // case 3: + // case 4: + // case 5: return 'ja'; break; + // case 6: return "onvol."; break; + // case 7: return "included"; break; + // default: return 'ja'; + // } + // }) + // this.neetext = ko.computed(function(){ + // switch (parseFloat(dit.scoretype)){ + // case 3: + // case 4: + // case 5: return 'nee'; break; + // case 6: return "vol."; break; + // case 7: return "involved"; break; + // default: return 'nee'; + // } + // }) + // this.thirdoptiontext = ko.computed(function(){ + // switch (parseFloat(dit.scoretype)){ + // case 3: return "bezig"; break; + // case 4: return "nvt"; break; + // case 5: return "i.o."; break; + // case 6: return "goed"; break; + // case 7: return "present"; break; + // default: return ""; + // } + // }); + // this.fourthoptiontext = ko.computed(function(){ + // return 'absent' + // }); + } - function fAddScoreoptie(o){ - this.scoreID = o.id; - this.type = o.type_nr; - this.optie = o.optie; - this.value = parseInt(o.score_value); - this.scoretekst = o.omschrijving; + function fAddScoreoptie(o){ + this.scoreID = o.id; + this.type = o.type_nr; + this.optie = o.optie; + this.value = parseInt(o.score_value); + this.scoretekst = o.omschrijving; - } + } - if (ls.MonitorModel !== undefined){ - ls.MonitorModel.initModel(); - } - else { - ls.MonitorModel = { - orgversions : ko.observableArray([]), - selectedOrgversion : ko.observable(''), - listitems : ko.observableArray([]), - scoreopties : ko.observableArray(), - editok : ko.observable(false), - soort : ko.observable(4), - erzijnperiodes : ko.observable(false), - notitie : ko.observable(''), - fvid : ko.observable(null), - bezig : ko.observable(false), - meetellen : ko.observable(false), - optieslengte : ko.observable(0), + if (ls.MonitorModel !== undefined){ + ls.MonitorModel.initModel(); + } + else { + ls.MonitorModel = { + orgversions : ko.observableArray([]), + selectedOrgversion : ko.observable(''), + listitems : ko.observableArray([]), + scoreopties : ko.observableArray(), + editok : ko.observable(false), + soort : ko.observable(4), + erzijnperiodes : ko.observable(false), + notitie : ko.observable(''), + fvid : ko.observable(null), + bezig : ko.observable(false), + meetellen : ko.observable(false), + optieslengte : ko.observable(0), + + initBindings :function(){ + var self = ls.MonitorModel; + if (!ko.dataFor(document.getElementById('pagmonitor')) ) { + ko.applyBindings(ls.MonitorModel, document.getElementById("pagmonitor")); + } + self.initModel(); + }, + initModel: function(){ + var self=ls.MonitorModel; - initBindings :function(){ - var self = ls.MonitorModel; - if (!ko.dataFor(document.getElementById('pagmonitor')) ) { - ko.applyBindings(ls.MonitorModel, document.getElementById("pagmonitor")); - } - self.initModel(); - }, - initModel: function(){ - var self=ls.MonitorModel; - - self.orgversions.removeAll(); - self.listitems.removeAll(); - showAjaxLoader(); - $.post("index.php/monpas/monitor/getperiodesperschool", function(data){ - // get de reeds ingevulde versies of start een nieuwe versie voor de laatste periode self.orgversions.removeAll(); + self.listitems.removeAll(); + showAjaxLoader(); + $.post("index.php/monpas/monitor/getperiodesperschool", function(data){ + // get de reeds ingevulde versies of start een nieuwe versie voor de laatste periode + self.orgversions.removeAll(); - if (data.versies){ - $.each(data.versies, function(i,p){ - self.orgversions.push(new fAddOrgversion(p)); - });//each - self.selectedOrgversion(self.orgversions()[0]); - self.erzijnperiodes(true); + if (data.versies){ + $.each(data.versies, function(i,p){ + self.orgversions.push(new fAddOrgversion(p)); + });//each + self.selectedOrgversion(self.orgversions()[0]); + self.erzijnperiodes(true); - }; // if - self.soort(data.soort); - hideAjaxLoader(); - },'json'); - }, + }; // if + self.soort(data.soort); + hideAjaxLoader(); + },'json'); + }, - fChangeVersion: function(){ - var self = ls.MonitorModel; - self.listitems.removeAll(); - self.scoreopties.removeAll(); - self.editok(false) - if (self.selectedOrgversion() == undefined) return; + fChangeVersion: function(){ + var self = ls.MonitorModel; + self.listitems.removeAll(); + self.scoreopties.removeAll(); + self.editok(false) + if (self.selectedOrgversion() == undefined) return; - var tm = self.selectedOrgversion().invullentm; - var Dtm = new Date(tm.substring(6,10), parseInt(tm.substring(3,5)) -1, tm.substring(0,2),23,59,59,99); - var heden= new Date() - if (heden.getTime() <= Dtm.getTime() ) self.editok(true); - $.post("index.php/monpas/monitor/getlistitems/" + self.selectedOrgversion().id, function(data){ - if (data.ijkpunten){ - $.each(data.ijkpunten,function(i,p){ - self.listitems.push(new fAddListitem(p)); - });// each - }; //if + var tm = self.selectedOrgversion().invullentm; + var Dtm = new Date(tm.substring(6,10), parseInt(tm.substring(3,5)) -1, tm.substring(0,2),23,59,59,99); + var heden= new Date() + if (heden.getTime() <= Dtm.getTime() ) self.editok(true); + $.post("index.php/monpas/monitor/getlistitems/" + self.selectedOrgversion().id, function(data){ + if (data.ijkpunten){ + $.each(data.ijkpunten,function(i,p){ + self.listitems.push(new fAddListitem(p)); + });// each + }; //if - if(data.scoreopties){ - $.each(data.scoreopties,function(x,o){ - self.scoreopties.push(new fAddScoreoptie(o)); - });// each - self.optieslengte(self.scoreopties().length); + if(data.scoreopties){ + $.each(data.scoreopties,function(x,o){ + self.scoreopties.push(new fAddScoreoptie(o)); + });// each + self.optieslengte(self.scoreopties().length); + } + + self.notitie(data.notitie); + if(data.meetellen && data.meetellen == 1) { + self.meetellen(true); + } + else{ + self.meetellen(false); + } + self.fvid(data.fvid); + + // als de versie een schoolversie is, dan mag alleen het management invullen + // maar ook het management mag niet invullen voorbij de invuldatum + if (self.editok() && self.selectedOrgversion().vorm==1) {self.editok(data.writer)} + },'json'); + }, + + fUpdateScoretype12: function(){ + var self= ls.MonitorModel + + + if (this.scoretype == 1 && (parseFloat(this.score().replace(',','.') ) > 10 || + parseFloat(this.score().replace(',','.')) < 0)){ + ls.MsgAutoFade("U moet een rapportcijfer tussen 0 en 10 invullen.",1000); + this.score(0); + }; + if (this.scoretype ==2 && (parseInt(this.score())> 100 || parseInt(this.score()) < 0)){ + ls.MsgAutoFade("U moet hier een percentage tussen 0 en 100 invullen.",1000); + this.score(0); } + var submitData = {indicatorscoreid : this.id, + score : this.score()} + $.post("index.php/monpas/monitor/updatescore", submitData); + return true ; // nodig voor de eventuele radioset + }, - self.notitie(data.notitie); - if(data.meetellen && data.meetellen == 1) { - self.meetellen(true); + fUpdateScoretypeVanaf3: function(data){ + var self= ls.MonitorModel + var indicatorscoreID = data; + console.log(this, "this") + + var submitData = { + indicatorscoreid : indicatorscoreID, + score : this.value } + + $.post("index.php/monpas/monitor/updatescore", submitData); + return true ; // nodig voor de eventuele radioset + }, + + fToonToelichting: function(){ + var self = ls.MonitorModel; + var dit = this; + var toelichting = ''; + if (dit.toelichting != undefined) toelichting = dit.toelichting; + apprise(dit.nummer + '. ' + dit.omschrijving + '
Toelichting: ' + toelichting); + }, + + fUpdateNotitie: function(){ + var self = ls.MonitorModel; + if (timer){ + clearTimeout(timer); + timeout = null; } - else{ - self.meetellen(false); - } - self.fvid(data.fvid); - - // als de versie een schoolversie is, dan mag alleen het management invullen - // maar ook het management mag niet invullen voorbij de invuldatum - if (self.editok() && self.selectedOrgversion().vorm==1) {self.editok(data.writer)} - },'json'); - }, - - fUpdateScoretype12: function(){ - var self= ls.MonitorModel - - - if (this.scoretype == 1 && (parseFloat(this.score().replace(',','.') ) > 10 || - parseFloat(this.score().replace(',','.')) < 0)){ - ls.MsgAutoFade("U moet een rapportcijfer tussen 0 en 10 invullen.",1000); - this.score(0); - }; - if (this.scoretype ==2 && (parseInt(this.score())> 100 || parseInt(this.score()) < 0)){ - ls.MsgAutoFade("U moet hier een percentage tussen 0 en 100 invullen.",1000); - this.score(0); - } - var submitData = {indicatorscoreid : this.id, - score : this.score()} - $.post("index.php/monpas/monitor/updatescore", submitData); - return true ; // nodig voor de eventuele radioset - }, - - fUpdateScoretypeVanaf3: function(data){ - var self= ls.MonitorModel - var indicatorscoreID = data; - - var submitData = { - indicatorscoreid : indicatorscoreID, - score : this.value } - - $.post("index.php/monpas/monitor/updatescore", submitData); - return true ; // nodig voor de eventuele radioset - }, - - fToonToelichting: function(){ - var self = ls.MonitorModel; - var dit = this; - var toelichting = ''; - if (dit.toelichting != undefined) toelichting = dit.toelichting; - apprise(dit.nummer + '. ' + dit.omschrijving + '
Toelichting: ' + toelichting); - }, - - fUpdateNotitie: function(){ - var self = ls.MonitorModel; - if (timer){ - clearTimeout(timer); - timeout = null; - } - timer = setTimeout(function(){ - var submitData= {notitie : self.notitie(), - fvID : self.fvid()} - $.post('index.php/monpas/monitor/savenotitie', submitData); - }, 600); - }, + timer = setTimeout(function(){ + var submitData= {notitie : self.notitie(), + fvID : self.fvid()} + $.post('index.php/monpas/monitor/savenotitie', submitData); + }, 600); + }, fTelMee: function(){ var self = ls.MonitorModel; @@ -248,30 +251,30 @@ ls.initMonitorModel = function(){ meetellen = 0; } - var submitData = { - meetellen: meetellen, - fvID: self.fvid(), - } - $.post("index.php/monpas/monitor/lijstmeetellen", submitData); - }, + var submitData = { + meetellen: meetellen, + fvID: self.fvid(), + } + $.post("index.php/monpas/monitor/lijstmeetellen", submitData); + }, fPrint:function(){ - var self =ls.MonitorModel; - if (self.bezig()) return; - self.bezig(true); - var items = ko.toJSON(self.listitems()); - var data ={ 'orgversie' : self.selectedOrgversion().info(), - 'tabelinfo' : items, - 'notitie' : self.notitie()} - data=JSON.stringify(data); - - var $form = $("
").append($('').val(data) ); - $form.appendTo("body").submit(); - self.bezig(false); - - } - } ; // definition van model - ls.MonitorModel.initBindings(); - }; // else -}// function initMonitorModel + var self =ls.MonitorModel; + if (self.bezig()) return; + self.bezig(true); + var items = ko.toJSON(self.listitems()); + var data ={ 'orgversie' : self.selectedOrgversion().info(), + 'tabelinfo' : items, + 'notitie' : self.notitie()} + data=JSON.stringify(data); + + var $form = $("").append($('').val(data) ); + $form.appendTo("body").submit(); + self.bezig(false); + + } + } ; // definition van model + ls.MonitorModel.initBindings(); + }; // else + }// function initMonitorModel }); \ No newline at end of file diff --git a/public/js/monpas/models/ontwikkelmodel.js b/public/js/monpas/models/ontwikkelmodel.js index d2908a6..2ecf3f5 100644 --- a/public/js/monpas/models/ontwikkelmodel.js +++ b/public/js/monpas/models/ontwikkelmodel.js @@ -88,21 +88,30 @@ ls.initOntwikkelModel = function(){ ,this) } function fAddResult(p){ - + var dit = this; this.ijkpuntid = p.ijkpunt_id; this.wensid = 0; - if (p.gewenstid) { this.wensid = p.gewenstid; } + // if (p.gewenstid) { this.wensid = p.gewenstid; } this.scoretype = p.scoretype; - - this.huidig = ko.observable( p.huidig); // observable is niet nodig maar dit was eerst een computed + this.disabled = p.disabled; + this.disablentv = p.disablenvt; + this.huidig = ko.observable( p.huidig); + if(p.disabled == 'T' || p.disablenvt == 'T') this.huidig(5) + + + + // observable is niet nodig maar dit was eerst een computed this.gewenst = ko.observable(3); if (p.gewenst) {this.gewenst(p.gewenst)}; + if(p.disabled == 'T' || p.disablenvt == 'T') this.gewenst(5) this.nummer = p.nummer; this.omschrijving = p.omschrijving; this.toelichting = p.toelichting; this.aantalscholen = p.aantalscholen; + + } if (ls.OntwikkelModel !== undefined){ @@ -205,8 +214,7 @@ ls.initOntwikkelModel = function(){ }, fUpdateGewenst: function(num){ var self=ls.OntwikkelModel; - - this.gewenst(num); + if(this.huidig() != 5 ) this.gewenst(num); }, fSwitchOrg: function(){ var self = ls.OntwikkelModel; @@ -341,27 +349,12 @@ ls.initOntwikkelModel = function(){ self.ingevuld(false); if (self.selectedOrgversion() == undefined) return; - var submitData = {orgversieid : self.selectedOrgversion().id, - orgid : self.selectedOrg().id - } - $.post("index.php/monpas/rapontwikkel/getscores", submitData, function(data){ - self.results.removeAll(); - if (data){ - $.each(data.scores, function(i,p){ - self.results.push(new fAddResult(p)); - self.ingevuld(true); - }) - self.fGetWriteAutorisatie(); - } - - - - },'json'); var submitData = {orgversieid : self.selectedOrgversion().id, orgid : self.selectedOrg().id } $.post("index.php/monpas/rapontwikkel/getscores", submitData, function(data){ + self.results.removeAll(); if (data){ $.each(data.scores, function(i,p){ @@ -371,8 +364,6 @@ ls.initOntwikkelModel = function(){ self.fGetWriteAutorisatie(); } - - },'json'); diff --git a/public/js/monpas/models/versiesmodel.js b/public/js/monpas/models/versiesmodel.js index ba5f9b8..a26a998 100644 --- a/public/js/monpas/models/versiesmodel.js +++ b/public/js/monpas/models/versiesmodel.js @@ -1,315 +1,340 @@ $(function(){ -ls.initVersiesModel = function(){ - var timeout; + ls.initVersiesModel = function(){ + var timeout; - function fAddModule(p){ - this.sysnr = p.sysnr; - this.naam = p.naam; - } - function fAddVersie(p){ - this.id = p.id; - this.naam = ko.observable(p.naam); - this.ingang = ko.observable(p.ingangsdatum); - this.systemnorm = ko.observable(p.systemnorm); - this.deleteok = ko.observable(p.deleteok); - } - function fAddIJkpunt(p){ - var dit = this; - this.id = p.id; - this.nummer = ko.observable(p.nummer); - this.omschrijving = ko.observable(p.omschrijving); - this.toelichting = ko.observable(p.toelichting); - this.indicatoren = ko.observableArray([]); - if (p.indicatoren){ - $.each(p.indicatoren, function(j,k){ - dit.indicatoren.push(new fAddIndicator(k)); - }); + function fAddModule(p){ + this.sysnr = p.sysnr; + this.naam = p.naam; + } + function fAddVersie(p){ + this.id = p.id; + this.naam = ko.observable(p.naam); + this.ingang = ko.observable(p.ingangsdatum); + this.systemnorm = ko.observable(p.systemnorm); + this.deleteok = ko.observable(p.deleteok); + } + function fAddIJkpunt(p){ + var dit = this; + this.id = p.id; + this.nummer = ko.observable(p.nummer); + this.omschrijving = ko.observable(p.omschrijving); + this.toelichting = ko.observable(p.toelichting); + this.indicatoren = ko.observableArray([]); + if (p.indicatoren){ + $.each(p.indicatoren, function(j,k){ + dit.indicatoren.push(new fAddIndicator(k)); + }); + } + this.toonindics = ko.observable(false); + this.disabled = ko.observable(false) + if(p.disabled == 'T') this.disabled(true); + } + function fAddIndicator(k){ + this.id = k.id; + this.nummer = ko.observable(k.nummer); + this.gewicht = ko.observable(k.gewicht); + this.omschrijving1 = ko.observable(k.omschrijving1); + this.omschrijving2 = ko.observable(k.omschrijving2); + this.inspectie = ko.observable(k.inspectie); + this.deleteok = k.deleteok; } - this.toonindics = ko.observable(false); - } - function fAddIndicator(k){ - this.id = k.id; - this.nummer = ko.observable(k.nummer); - this.gewicht = ko.observable(k.gewicht); - this.omschrijving1 = ko.observable(k.omschrijving1); - this.omschrijving2 = ko.observable(k.omschrijving2); - this.inspectie = ko.observable(k.inspectie); - this.deleteok = k.deleteok; - } - if (ls.VersiesModel !== undefined){ - ls.VersiesModel.initModel(); - } - else { - ls.VersiesModel = { + if (ls.VersiesModel !== undefined){ + ls.VersiesModel.initModel(); + } + else { + ls.VersiesModel = { - autonivo : ko.observable(0), - - versies : ko.observableArray([]), - selectedVersie : ko.observable(''), - newVersieNaam : ko.observable(''), - ijkpunten : ko.observableArray([]), - newIJkpunt : ko.observable({nummer: ko.observable(0), naam:ko.observable(''), toelichting: ko.observable('')}), - selectedIJkpunt : ko.observable(''), - newIndicator : ko.observable({id : null, - ijkpunt_id : null, - nummer : ko.observable(0), - gewicht : ko.observable(1), - omschrijving1 : ko.observable(), - omschrijving2 : ko.observable(), - inspectie : ko.observable(), - deleteok : ko.observable(true) }), - modules : ko.observableArray([]), - selectedModule : ko.observable(''), + autonivo : ko.observable(0), - initBindings :function(){ - var self = ls.VersiesModel; - - if (!ko.dataFor(document.getElementById('pagVersies')) ) { - ko.applyBindings(ls.VersiesModel, document.getElementById("pagVersies")); - } - - $.post("index.php/monpas/beheer/getmodules", function(result){ - self.modules.removeAll(); + versies : ko.observableArray([]), + selectedVersie : ko.observable(''), + newVersieNaam : ko.observable(''), + ijkpunten : ko.observableArray([]), + newIJkpunt : ko.observable({nummer: ko.observable(0), naam:ko.observable(''), toelichting: ko.observable('')}), + selectedIJkpunt : ko.observable(''), + newIndicator : ko.observable({id : null, + ijkpunt_id : null, + nummer : ko.observable(0), + gewicht : ko.observable(1), + omschrijving1 : ko.observable(), + omschrijving2 : ko.observable(), + inspectie : ko.observable(), + deleteok : ko.observable(true) }), + modules : ko.observableArray([]), + selectedModule : ko.observable(''), - if (result){ - $.each(result, function(i,p){ - self.modules.push(new fAddModule(p)); - }); - self.selectedModule(self.modules[0]); - }; // if rsult - self.initModel(); - },'json'); - }, - initModel: function(){ - var self = ls.VersiesModel; - $.post("index.php/shared/autorisatienivos/getautorisatie", function(result){ - self.autonivo(result) - // self.fGetVersies(); - },'json'); - }, + initBindings :function(){ + var self = ls.VersiesModel; - fGetVersies : function(){ - var self =ls.VersiesModel; - $.post("index.php/monpas/beheer/getversies/" + self.selectedModule().sysnr, function(data){ - self.versies.removeAll(); - self.ijkpunten.removeAll(); - if (data) { - $.each(data,function(i,p){ - self.versies.push(new fAddVersie(p)); - }); - self.selectedVersie(self.versies()[0] ); + if (!ko.dataFor(document.getElementById('pagVersies')) ) { + ko.applyBindings(ls.VersiesModel, document.getElementById("pagVersies")); } - },'json'); - }, - fChangeModule: function(){ - var self =ls.VersiesModel; - self.fGetVersies(); - }, - fMaakNieuweVersie: function(){ - var self = ls.VersiesModel; - self.newVersieNaam(''); - $("#modNieuweVersie").modal('show'); - }, - fUpdateVersie: function(){ - var self = ls.VersiesModel; - var dit = this; - if (timeout){ - clearTimeout(timeout) - timeout ==null; - } - timeout=setTimeout(function(){ - var submitData = { id : dit.id, - naam : dit.naam(), - ingangsdatum : dit.ingang(), - systemnorm : dit.systemnorm()} - $.post("index.php/monpas/beheer/updateversie",submitData, function(){}) - },700); - - }, - fSaveVersie: function(){ - var self = ls.VersiesModel; - if (!self.selectedModule()) { - apprise("Er is geen instrument geselecteerd. De lijst kan niet worden aangemaakt."); - return; - } - var submitData= {nieuwnaam : self.newVersieNaam(), - module : self.selectedModule().sysnr} - $.post("index.php/monpas/beheer/insertversie/" ,submitData, function(result){ - if (result) { - self.versies.push(new fAddVersie(result)); - $.each(self.versies(), function(i,p){ - if (p.id == result.id){self.selectedVersie(p); return false;} - }) - } ; // if result + + $.post("index.php/monpas/beheer/getmodules", function(result){ + self.modules.removeAll(); + + if (result){ + $.each(result, function(i,p){ + self.modules.push(new fAddModule(p)); + }); + self.selectedModule(self.modules[0]); + }; // if rsult + self.initModel(); + },'json'); + }, + initModel: function(){ + var self = ls.VersiesModel; + $.post("index.php/shared/autorisatienivos/getautorisatie", function(result){ + self.autonivo(result) + // self.fGetVersies(); + },'json'); + }, + + fGetVersies : function(){ + var self =ls.VersiesModel; + $.post("index.php/monpas/beheer/getversies/" + self.selectedModule().sysnr, function(data){ + self.versies.removeAll(); + self.ijkpunten.removeAll(); + if (data) { + $.each(data,function(i,p){ + self.versies.push(new fAddVersie(p)); + }); + self.selectedVersie(self.versies()[0] ); + } + },'json'); + }, + fChangeModule: function(){ + var self =ls.VersiesModel; + self.fGetVersies(); + }, + fMaakNieuweVersie: function(){ + var self = ls.VersiesModel; + self.newVersieNaam(''); + $("#modNieuweVersie").modal('show'); + }, + fUpdateVersie: function(){ + var self = ls.VersiesModel; + var dit = this; + if (timeout){ + clearTimeout(timeout) + timeout ==null; + } + timeout=setTimeout(function(){ + var submitData = { id : dit.id, + naam : dit.naam(), + ingangsdatum : dit.ingang(), + systemnorm : dit.systemnorm()} + $.post("index.php/monpas/beheer/updateversie",submitData, function(){}) + },700); + + }, + fSaveVersie: function(){ + var self = ls.VersiesModel; + if (!self.selectedModule()) { + apprise("Er is geen instrument geselecteerd. De lijst kan niet worden aangemaakt."); + return; + } + var submitData= {nieuwnaam : self.newVersieNaam(), + module : self.selectedModule().sysnr} + $.post("index.php/monpas/beheer/insertversie/" ,submitData, function(result){ + if (result) { + self.versies.push(new fAddVersie(result)); + $.each(self.versies(), function(i,p){ + if (p.id == result.id){self.selectedVersie(p); return false;} + }) + } ; // if result + self.ijkpunten.removeAll(); + },'json'); + }, + fDeleteVersie: function(){ + var self=ls.VersiesModel; + $.post("index.php/monpas/beheer/deleteversie/" + self.selectedVersie().id, function(result){ + if (result.length > 0){ + apprise(resulterrortekst); + } + else{ + self.versies.remove(self.selectedVersie()); + } + },'json') + }, + fChangeVersie: function(){ + var self=ls.VersiesModel; self.ijkpunten.removeAll(); - },'json'); - }, - fDeleteVersie: function(){ - var self=ls.VersiesModel; - $.post("index.php/monpas/beheer/deleteversie/" + self.selectedVersie().id, function(result){ - if (result.length > 0){ - apprise(resulterrortekst); + if (self.selectedVersie() == undefined) return; + $.post("index.php/monpas/beheer/getijkpunten/"+ self.selectedVersie().id, function(data){ + self.ijkpunten.removeAll(); + if (data){ + $.each(data, function(i,p){ + self.ijkpunten.push(new fAddIJkpunt(p)); + }); + } + },'json'); + }, + fNieuwIJkpunt: function(){ + var self = ls.VersiesModel; + var num = 0; + var i=self.ijkpunten().length; + var i = parseInt(i) - 1; + if (i >= 0) { + num = self.ijkpunten()[i].nummer(); + }; + self.newIJkpunt().nummer(parseInt(num)+ 1); + self.newIJkpunt().naam(''); + self.newIJkpunt().toelichting(''); + $("#modNieuwIJkpunt").modal('show'); + }, + fSaveIJkpunt: function(){ + var self=ls.VersiesModel; + + var submitData={versie_id : self.selectedVersie().id, + nummer : self.newIJkpunt().nummer(), + omschrijving : self.newIJkpunt().naam(), + toelichting : self.newIJkpunt().toelichting()}; + $.post("index.php/monpas/beheer/insertijkpunt", submitData, function(data){ + if (data){ + self.ijkpunten.push(new fAddIJkpunt(data)); + $.each(self.ijkpunten(), function(i,p){ + if (p.id == data.id){ + self.selectedIJkpunt(p); + return false; + } + }); + } + else { apprise("Er is een fout opgetreden bij opslaan."); }; + },'json'); + }, + + fToggleIndicatoren: function(){ + var self= ls.VersiesModel; + self.selectedIJkpunt(null); + self.selectedIJkpunt(this); + this.toonindics(!this.toonindics()); + }, + fUpdateIJkpunt: function(){ + var self= ls.VersiesModel; + var dit = this; + if(dit.disabled()) return; + if (timeout){ + clearTimeout(timeout) + timeout ==null; + } + timeout=setTimeout(function(){ + + var submitData={id : dit.id, + nummer : dit.nummer(), + versie_id : self.selectedVersie().id, + omschrijving : dit.omschrijving(), + toelichting : dit.toelichting()} + + $.post("index.php/monpas/beheer/updateijkpunt",submitData, function(){}) + },800); + }, + + fDisableIJkpunt: function(){ + var self = ls.VersiesModel; + var dit = this; + + dit.disabled(! dit.disabled()) + var disabled = 'F'; + if(dit.disabled()) disabled = 'T'; + var submitData = { + 'id' : dit.id, + 'disabled' : disabled + } + + $.post("index.php/monpas/beheer/disableijkpunt", submitData, function(){ + + }); + + }, + + fDeleteIJkpunt:function(){ + var self =ls.VersiesModel; + var id = this.id; + var dit = this; + if ( self.ijkpunten().indicatoren !== undefined && self.ijkpunten().indicatoren().length > 0) { + apprise('Er zijn nog indicatoren. IJkpunt mag niet verwijderd worden'); + return; } else{ - self.versies.remove(self.selectedVersie()); - } - },'json') - }, - fChangeVersie: function(){ - var self=ls.VersiesModel; - self.ijkpunten.removeAll(); - if (self.selectedVersie() == undefined) return; - $.post("index.php/monpas/beheer/getijkpunten/"+ self.selectedVersie().id, function(data){ - self.ijkpunten.removeAll(); - if (data){ - $.each(data, function(i,p){ - self.ijkpunten.push(new fAddIJkpunt(p)); - }); - } - },'json'); - }, - fNieuwIJkpunt: function(){ - var self = ls.VersiesModel; - var num = 0; - var i=self.ijkpunten().length; - var i = parseInt(i) - 1; - if (i >= 0) { - num = self.ijkpunten()[i].nummer(); - }; - self.newIJkpunt().nummer(parseInt(num)+ 1); - self.newIJkpunt().naam(''); - self.newIJkpunt().toelichting(''); - $("#modNieuwIJkpunt").modal('show'); - }, - fSaveIJkpunt: function(){ - var self=ls.VersiesModel; - - var submitData={versie_id : self.selectedVersie().id, - nummer : self.newIJkpunt().nummer(), - omschrijving : self.newIJkpunt().naam(), - toelichting : self.newIJkpunt().toelichting()}; - $.post("index.php/monpas/beheer/insertijkpunt", submitData, function(data){ - if (data){ - self.ijkpunten.push(new fAddIJkpunt(data)); - $.each(self.ijkpunten(), function(i,p){ - if (p.id == data.id){ - self.selectedIJkpunt(p); - return false; - } - }); - } - else { apprise("Er is een fout opgetreden bij opslaan."); }; - },'json'); - }, - fToggleIndicatoren: function(){ - var self= ls.VersiesModel; - self.selectedIJkpunt(null); - self.selectedIJkpunt(this); - this.toonindics(!this.toonindics()); - }, - fUpdateIJkpunt: function(){ - var self= ls.VersiesModel; - var dit = this; - if (timeout){ - clearTimeout(timeout) - timeout ==null; - } - timeout=setTimeout(function(){ - - var submitData={id : dit.id, - nummer : dit.nummer(), - versie_id : self.selectedVersie().id, - omschrijving : dit.omschrijving(), - toelichting : dit.toelichting()} - - $.post("index.php/monpas/beheer/updateijkpunt",submitData, function(){}) - },800); - }, - fDeleteIJkpunt:function(){ - var self =ls.VersiesModel; - var id = this.id; - var dit = this; - if ( self.ijkpunten().indicatoren !== undefined && self.ijkpunten().indicatoren().length > 0) { - apprise('Er zijn nog indicatoren. IJkpunt mag niet verwijderd worden'); - return; - } - else{ - apprise("Weet u zeker dat u " + this.omschrijving() + " wilt verwijderen? " , + apprise("Weet u zeker dat u " + this.omschrijving() + " wilt verwijderen? " , {verify: true, textYes: 'ja', textNo: 'nee'}, function(ans){ if (ans){ $.post("index.php/monpas/beheer/deleteijkpunt/" + id); self.ijkpunten.remove(dit); } - }); // apprise - } - }, - fNieuweIndicator: function(){ - var self = ls.VersiesModel; - var num =0 - self.selectedIJkpunt(this); - $.each(self.selectedIJkpunt().indicatoren(), function(j,k){ - num=k.nummer(); - }) - self.newIndicator().nummer(parseInt(num) + 1); - self.newIndicator().gewicht(1); - self.newIndicator().ijkpunt_id= self.selectedIJkpunt().id; - self.newIndicator().omschrijving1(''); - self.newIndicator().omschrijving2(''); - self.newIndicator().inspectie(''); - self.newIndicator().deleteok(true); - $("#modNieuwIndicator").modal('show'); - }, - fSaveIndicator: function(){ - var self=ls.VersiesModel; - - var submitData={ ijkpunt_id : self.newIndicator().ijkpunt_id, - nummer : self.newIndicator().nummer(), - omschrijving1 : self.newIndicator().omschrijving1(), - omschrijving2 : self.newIndicator().omschrijving2(), - inspectie : self.newIndicator().inspectie(), - gewicht : self.newIndicator().gewicht}; - $.post("index.php/monpas/beheer/insertindicator", submitData, function(data){ - if (data){ - self.selectedIJkpunt().indicatoren.push(new fAddIndicator(data)); + }); // apprise } - else { apprise("Er is een fout opgetreden bij opslaan."); }; - },'json'); - }, - fUpdateIndicator: function(){ - var self = ls.VersiesModel; - var dit =this; - if (timeout){ - clearTimeout(timeout); - timeout = null; - } - timeout = setTimeout(function(){ - var submitData ={ id : dit.id, - nummer : dit.nummer(), - omschrijving1 : dit.omschrijving1(), - omschrijving2 : dit.omschrijving2(), - inspectie : dit.inspectie(), - gewicht : dit.gewicht()} - $.post("index.php/monpas/beheer/updateindicator", submitData); - },700); - }, - fDeleteIndicator: function($parent, $data){ - var self = ls.VersiesModel; - var dit = $data; - - apprise ("Weet u zeker dat u " + dit.omschrijving1() + " wilt verwijderen?", + }, + fNieuweIndicator: function(){ + var self = ls.VersiesModel; + var num =0 + var dit = this; + if(dit.disabled()) return; + self.selectedIJkpunt(this); + $.each(self.selectedIJkpunt().indicatoren(), function(j,k){ + num=k.nummer(); + }) + self.newIndicator().nummer(parseInt(num) + 1); + self.newIndicator().gewicht(1); + self.newIndicator().ijkpunt_id= self.selectedIJkpunt().id; + self.newIndicator().omschrijving1(''); + self.newIndicator().omschrijving2(''); + self.newIndicator().inspectie(''); + self.newIndicator().deleteok(true); + $("#modNieuwIndicator").modal('show'); + }, + fSaveIndicator: function(){ + var self=ls.VersiesModel; + + var submitData={ ijkpunt_id : self.newIndicator().ijkpunt_id, + nummer : self.newIndicator().nummer(), + omschrijving1 : self.newIndicator().omschrijving1(), + omschrijving2 : self.newIndicator().omschrijving2(), + inspectie : self.newIndicator().inspectie(), + gewicht : self.newIndicator().gewicht}; + $.post("index.php/monpas/beheer/insertindicator", submitData, function(data){ + if (data){ + self.selectedIJkpunt().indicatoren.push(new fAddIndicator(data)); + } + else { apprise("Er is een fout opgetreden bij opslaan."); }; + },'json'); + }, + fUpdateIndicator: function(){ + var self = ls.VersiesModel; + var dit =this; + if (timeout){ + clearTimeout(timeout); + timeout = null; + } + timeout = setTimeout(function(){ + var submitData ={ id : dit.id, + nummer : dit.nummer(), + omschrijving1 : dit.omschrijving1(), + omschrijving2 : dit.omschrijving2(), + inspectie : dit.inspectie(), + gewicht : dit.gewicht()} + $.post("index.php/monpas/beheer/updateindicator", submitData); + },700); + }, + fDeleteIndicator: function($parent, $data){ + var self = ls.VersiesModel; + var dit = $data; + + apprise ("Weet u zeker dat u " + dit.omschrijving1() + " wilt verwijderen?", {verify:true, textYes:'ja',textNo:'nee'}, function(ans){ if (ans){ - $.post('index.php/monpas/beheer/deleteindicator/' + dit.id,function(result){ + $.post('index.php/monpas/beheer/deleteindicator/' + dit.id,function(result){ $parent.indicatoren.remove(dit); },'json'); } - }); // apprise - } + }); // apprise + } - } ; // definition van model - ls.VersiesModel.initBindings(); - }; // else -}// function initVersiesModel + } ; // definition van model + ls.VersiesModel.initBindings(); + }; // else + }// function initVersiesModel }); \ No newline at end of file