Loading code/test1.php +1 −16 Changes for code/test1.php: 1 added line, 16 removed lines. Original line number Diff line number Diff line Loading @@ -3,20 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $ws = $container->get(\Workflow\Service\WorkflowService::class); $etapes = $ws->getEtapes(); foreach ($etapes as $etape) { echo str_pad($etape->getCode(), 33, ' ').' => '.$etape."\n"; if ($etape->getDependances()){ foreach( $etape->getDependances() as $dep){ echo ' '.$dep->getEtapePrecedante().' '.$dep->getPerimetre().' '.$dep->getAvancement()."\n"; } echo "\n"; } } No newline at end of file code/test2.php +1 −78 Changes for code/test2.php: 1 added line, 78 removed lines. Original line number Diff line number Diff line Loading @@ -3,82 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $c = $container->get(\UnicaenTbl\Service\TableauBordService::class); $bdd = $container->get(\Unicaen\BddAdmin\Bdd::class); $tbls = [ 'chargens_seuils_def', // 'chargens', // 'formule', 'candidature', 'dmep_liquidation', 'piece_jointe_demande', 'piece_jointe_fournie', 'agrement', 'cloture_realise', 'contrat', 'dossier', 'paiement', 'piece_jointe', 'referentiel', 'validation_enseignement', 'validation_referentiel', 'service', 'mission', // 'workflow', 'plafond_structure', 'plafond_intervenant', 'plafond_element', 'plafond_volume_horaire', 'plafond_referentiel', 'plafond_mission', ]; $tbls = ['workflow']; $params = [ //'ETAPE_ID' => 1367 ]; $vider = true; $vider = false; echo '<pre>'; foreach( $tbls as $tblName ){ echo "\n\n"; echo "### $tblName ###\n"; if ($vider){ $bdd->exec("truncate table tbl_".$tblName); } $countTable = $bdd->select('SELECT count(*) CC FROM tbl_'.$tblName)[0]['CC']; echo " Table avant calcul : $countTable lignes\n"; $tbl = $c->getTableauBord($tblName); $debut = microtime(true); $tbl->calculer($params); $fin = microtime(true); $duree = $fin - $debut; echo " Durée : ".round($duree, 4) . ' seconde(s)'."\n"; $countTable = $bdd->select('SELECT count(*) CC FROM tbl_'.$tblName)[0]['CC']; $countView = ''; // $countView = $bdd->select('SELECT count(*) CC FROM v_tbl_'.$tblName)[0]['CC']; echo " View : $countView lignes\n"; echo " Table après calcul : $countTable lignes\n"; } echo "\n\n".'</pre>'; code/test3.php +1 −21 Changes for code/test3.php: 1 added line, 21 removed lines. Original line number Diff line number Diff line Loading @@ -3,25 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $em = $container->get(\Doctrine\ORM\EntityManager::class); $params = [ 'contrat' => 36821, 'volumeHoraireIndex' => 0 ]; $c = $em->getRepository(\Contrat\Entity\Db\TblContrat::class)->findOneBy($params); echo $c->getId(); /** @var \Contrat\Entity\Db\TblContratVolumeHoraire[] $vhs */ $vhs = $c->getVolumesHoraires(); foreach( $vhs as $vh ){ echo "<h1>VH</h1>"; var_dump($vh->getService()->getElementPedagogique()->getLibelle()); } code/test4.php +1 −12 Changes for code/test4.php: 1 added line, 12 removed lines. Original line number Diff line number Diff line Loading @@ -3,16 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $sf = $container->get(\Formule\Service\FormuleService::class); $params = [ 'INTERVENANT_ID' => 781239 ]; $sTbl = $sf->getServiceTableauBord(); $sTbl->calculer('formule', $params); //$bdd = $container->get(\Unicaen\BddAdmin\Bdd::class); //$bdd->majSequences(); No newline at end of file code/test5.php +1 −20 Changes for code/test5.php: 1 added line, 20 removed lines. Original line number Diff line number Diff line Loading @@ -3,24 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $value = 5.179941753252348; $value = 45.179941753252348; $value = 5.001; $value = 5.1; $value = 6.05; //$value = 15.0; $dVal = $value * 100; $strVal = (string)$dVal; $dotPos = strpos($strVal,'.'); if (false !== $dotPos){ $intVal = (int)substr($strVal, 0, $dotPos); $dVal -= $intVal; $diff = (int)(round($dVal, 2)*100); }else{ $diff = 0; } var_dump($diff); No newline at end of file Loading
code/test1.php +1 −16 Changes for code/test1.php: 1 added line, 16 removed lines. Original line number Diff line number Diff line Loading @@ -3,20 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $ws = $container->get(\Workflow\Service\WorkflowService::class); $etapes = $ws->getEtapes(); foreach ($etapes as $etape) { echo str_pad($etape->getCode(), 33, ' ').' => '.$etape."\n"; if ($etape->getDependances()){ foreach( $etape->getDependances() as $dep){ echo ' '.$dep->getEtapePrecedante().' '.$dep->getPerimetre().' '.$dep->getAvancement()."\n"; } echo "\n"; } } No newline at end of file
code/test2.php +1 −78 Changes for code/test2.php: 1 added line, 78 removed lines. Original line number Diff line number Diff line Loading @@ -3,82 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $c = $container->get(\UnicaenTbl\Service\TableauBordService::class); $bdd = $container->get(\Unicaen\BddAdmin\Bdd::class); $tbls = [ 'chargens_seuils_def', // 'chargens', // 'formule', 'candidature', 'dmep_liquidation', 'piece_jointe_demande', 'piece_jointe_fournie', 'agrement', 'cloture_realise', 'contrat', 'dossier', 'paiement', 'piece_jointe', 'referentiel', 'validation_enseignement', 'validation_referentiel', 'service', 'mission', // 'workflow', 'plafond_structure', 'plafond_intervenant', 'plafond_element', 'plafond_volume_horaire', 'plafond_referentiel', 'plafond_mission', ]; $tbls = ['workflow']; $params = [ //'ETAPE_ID' => 1367 ]; $vider = true; $vider = false; echo '<pre>'; foreach( $tbls as $tblName ){ echo "\n\n"; echo "### $tblName ###\n"; if ($vider){ $bdd->exec("truncate table tbl_".$tblName); } $countTable = $bdd->select('SELECT count(*) CC FROM tbl_'.$tblName)[0]['CC']; echo " Table avant calcul : $countTable lignes\n"; $tbl = $c->getTableauBord($tblName); $debut = microtime(true); $tbl->calculer($params); $fin = microtime(true); $duree = $fin - $debut; echo " Durée : ".round($duree, 4) . ' seconde(s)'."\n"; $countTable = $bdd->select('SELECT count(*) CC FROM tbl_'.$tblName)[0]['CC']; $countView = ''; // $countView = $bdd->select('SELECT count(*) CC FROM v_tbl_'.$tblName)[0]['CC']; echo " View : $countView lignes\n"; echo " Table après calcul : $countTable lignes\n"; } echo "\n\n".'</pre>';
code/test3.php +1 −21 Changes for code/test3.php: 1 added line, 21 removed lines. Original line number Diff line number Diff line Loading @@ -3,25 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $em = $container->get(\Doctrine\ORM\EntityManager::class); $params = [ 'contrat' => 36821, 'volumeHoraireIndex' => 0 ]; $c = $em->getRepository(\Contrat\Entity\Db\TblContrat::class)->findOneBy($params); echo $c->getId(); /** @var \Contrat\Entity\Db\TblContratVolumeHoraire[] $vhs */ $vhs = $c->getVolumesHoraires(); foreach( $vhs as $vh ){ echo "<h1>VH</h1>"; var_dump($vh->getService()->getElementPedagogique()->getLibelle()); }
code/test4.php +1 −12 Changes for code/test4.php: 1 added line, 12 removed lines. Original line number Diff line number Diff line Loading @@ -3,16 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $sf = $container->get(\Formule\Service\FormuleService::class); $params = [ 'INTERVENANT_ID' => 781239 ]; $sTbl = $sf->getServiceTableauBord(); $sTbl->calculer('formule', $params); //$bdd = $container->get(\Unicaen\BddAdmin\Bdd::class); //$bdd->majSequences(); No newline at end of file
code/test5.php +1 −20 Changes for code/test5.php: 1 added line, 20 removed lines. Original line number Diff line number Diff line Loading @@ -3,24 +3,5 @@ /** * @var $this \Application\View\Renderer\PhpRenderer * @var $container \Psr\Container\ContainerInterface * @var $io \Symfony\Component\Console\Style\SymfonyStyle */ $value = 5.179941753252348; $value = 45.179941753252348; $value = 5.001; $value = 5.1; $value = 6.05; //$value = 15.0; $dVal = $value * 100; $strVal = (string)$dVal; $dotPos = strpos($strVal,'.'); if (false !== $dotPos){ $intVal = (int)substr($strVal, 0, $dotPos); $dVal -= $intVal; $diff = (int)(round($dVal, 2)*100); }else{ $diff = 0; } var_dump($diff); No newline at end of file