diff --git a/manager/database.php b/manager/database.php index ecc42a2..0438585 100755 --- a/manager/database.php +++ b/manager/database.php @@ -1201,11 +1201,12 @@ class DataBase{ // on ajoute chaque UE de ce semestre s'il est actif foreach($semestre['UEs'] as $UE) if( !in_array($UE['id'], $semestre['inactive']) ){ - if( ($lastUEIndex=array_search($UE['id'], $UEUIDS)) === false ){ + if( array_search($UE['id'], $UEUIDS) === false ){ + // pour le premier UE (capitalisé) on s'assure de lui attribuer la capitalisation + DataBase::getInstance()->capitaliserUE($UE['id'], $semestre['id'], $etudiantUID); array_push( $listeUEs, $UE ); array_push( $UEUIDS, $UE['id'] ); - }else // si UE existe déjà pour formation+rang, on créé la capitalisation du semestre (on le désactive) - DataBase::getInstance()->capitaliserUE($UEUIDS[$lastUEIndex], $semestre['id'], $etudiantUID); + }//else // si UE existe déjà pour formation+rang, on créé la capitalisation du semestre (on le désactive) } } diff --git a/manager/repo/controle.php b/manager/repo/controle.php index b0080b7..e09b1bb 100755 --- a/manager/repo/controle.php +++ b/manager/repo/controle.php @@ -71,7 +71,7 @@ class controleRepo{ $ctrlInfo = $getControleInfo->fetch(); if( !is_bool($ctrlInfo) ) // on retourne le résultat en supprimant les doublons à indices numériques s'il est ok - return DataBase::delNumeric( $ctrlInfo, true ); + return $ctrlInfo; else return array(); } diff --git a/manager/repo/group.php b/manager/repo/group.php index e8068e1..d071c65 100755 --- a/manager/repo/group.php +++ b/manager/repo/group.php @@ -44,7 +44,7 @@ class groupRepo{ $getGroupeInfo = DataBase::getPDO()->prepare("SELECT id_groupe as id, nom FROM groupe WHERE id_groupe = :groupeUID"); $getGroupeInfo->execute(array( ':groupeUID' => $groupeUID )); - return DataBase::delNumeric( $getGroupeInfo->fetch(), true ); + return $getGroupeInfo->fetch(); } diff --git a/manager/repo/module.php b/manager/repo/module.php index 61857ac..50a4564 100755 --- a/manager/repo/module.php +++ b/manager/repo/module.php @@ -41,7 +41,7 @@ class moduleRepo{ $getModuleInfo->execute(array( ':moduleUID' => $moduleUID )); // on retourne le résultat en supprimant les doublons à indices numériques - return DataBase::delNumeric( $getModuleInfo->fetch(), true ); + return $getModuleInfo->fetch(); } diff --git a/manager/repo/note.php b/manager/repo/note.php index f7130f1..4ef48c8 100755 --- a/manager/repo/note.php +++ b/manager/repo/note.php @@ -52,7 +52,7 @@ class noteRepo{ )); // on retourne le résultat en supprimant les doublons à indices numériques - return DataBase::delNumeric( $getUtilisateurInfo->fetch(), true ); + return $getUtilisateurInfo->fetch(); } diff --git a/manager/repo/semestre.php b/manager/repo/semestre.php index 2f26096..0e8fa5a 100755 --- a/manager/repo/semestre.php +++ b/manager/repo/semestre.php @@ -189,7 +189,7 @@ class semestreRepo{ $getSemestreInfo->execute(array( ':semestreUID' => $semestreUID )); // on retourne le résultat en supprimant les doublons à indices numériques - return DataBase::delNumeric( $getSemestreInfo->fetch(), true ); + return $getSemestreInfo->fetch(); } @@ -444,7 +444,7 @@ class semestreRepo{ FROM semestre as s, mcc_ue GROUP BY s.annee"); - return DataBase::delNumeric( $getLastMccYear->fetch(), true ); + return $getLastMccYear->fetch(); } diff --git a/manager/repo/ue.php b/manager/repo/ue.php index 44d0e8d..1a50411 100755 --- a/manager/repo/ue.php +++ b/manager/repo/ue.php @@ -41,7 +41,7 @@ class ueRepo extends DBAccess{ $getUEInfo->execute(array( ':UEUID' => $UEUID )); // on retourne le résultat en supprimant les doublons à indices numériques - return DataBase::delNumeric( $getUEInfo->fetch(), true ); + return $getUEInfo->fetch(); } diff --git a/manager/repo/user.php b/manager/repo/user.php index 36bf8df..f357b95 100755 --- a/manager/repo/user.php +++ b/manager/repo/user.php @@ -85,7 +85,7 @@ class userRepo{ $getUtilisateurInfo->execute(array( ':utilisateurUID' => $utilisateurUID )); // on retourne le résultat en supprimant les doublons à indices numériques - return DataBase::delNumeric( $getUtilisateurInfo->fetch(), true ); + return $getUtilisateurInfo->fetch(); } diff --git a/test.php b/test.php index 5044b01..6c8ec92 100755 --- a/test.php +++ b/test.php @@ -55,8 +55,8 @@ debug(); // on veut que l'ue d'id 35 compte pour le semestre 252 et que les semestres de même rang et formation soient ignorés $request = new stdClass; $answer = new stdClass; $request->level_1 = 'capitaliser'; -$request->ue = 35; -$request->semestre = 252; +$request->ue = 37; +$request->semestre = 276; $request->etudiant = 'Etud100'; careerManager::switch_level_1($request, $answer); diff --git a/xdoc/empty.sql b/xdoc/empty.sql index 60f6908..d1dbb98 100755 --- a/xdoc/empty.sql +++ b/xdoc/empty.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Client: localhost --- Généré le: Ven 08 Janvier 2016 à 10:51 +-- Généré le: Ven 08 Janvier 2016 à 23:38 -- Version du serveur: 5.5.46-0ubuntu0.14.04.2 -- Version de PHP: 5.5.9-1ubuntu4.14 @@ -32,6 +32,7 @@ CREATE TABLE IF NOT EXISTS `appartenance` ( `id_groupe` int(11) NOT NULL, `id_semestre` int(11) NOT NULL, `mention` varchar(3) DEFAULT NULL, + `inactive` varchar(50) NOT NULL DEFAULT '', PRIMARY KEY (`id_appartenance`), KEY `id_etudiant` (`id_etudiant`), KEY `id_groupe` (`id_groupe`), @@ -40,7 +41,7 @@ CREATE TABLE IF NOT EXISTS `appartenance` ( KEY `id_etudiant_2` (`id_etudiant`), KEY `id_groupe_2` (`id_groupe`), KEY `id_semestre_2` (`id_semestre`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5651 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5950 ; -- -- RELATIONS POUR LA TABLE `appartenance`: @@ -68,7 +69,7 @@ CREATE TABLE IF NOT EXISTS `controle` ( `publication` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id_controle`), KEY `id_mcc_module` (`id_mcc_module`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1309 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1399 ; -- -- RELATIONS POUR LA TABLE `controle`: @@ -92,7 +93,7 @@ CREATE TABLE IF NOT EXISTS `enseignement` ( KEY `id_enseignant` (`id_enseignant`), KEY `id_mcc_module` (`id_mcc_module`), KEY `id_groupe` (`id_groupe`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=229 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=243 ; -- -- RELATIONS POUR LA TABLE `enseignement`: @@ -116,7 +117,7 @@ CREATE TABLE IF NOT EXISTS `formation` ( `nom` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `nb_semestres` int(11) NOT NULL DEFAULT '2', PRIMARY KEY (`id_formation`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=106 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=114 ; -- -------------------------------------------------------- @@ -176,7 +177,6 @@ INSERT INTO `groupe` (`id_groupe`, `nom`) VALUES (48, 'S7M'), (49, 'S8M'), (50, 'S9M'), -(51, 'S10M'), (52, 'S1G'), (53, 'S1H'), (54, 'S1I'), @@ -261,18 +261,6 @@ INSERT INTO `groupe` (`id_groupe`, `nom`) VALUES (133, 'S9J'), (134, 'S9K'), (135, 'S9L'), -(136, 'S10A'), -(137, 'S10B'), -(138, 'S10C'), -(139, 'S10D'), -(140, 'S10E'), -(141, 'S10F'), -(142, 'S10G'), -(143, 'S10H'), -(144, 'S10I'), -(145, 'S10J'), -(146, 'S10K'), -(147, 'S10L'), (148, 'INGBD1 S2'), (149, 'INSIQ1 S2'), (150, 'ITINAS S2'), @@ -280,16 +268,7 @@ INSERT INTO `groupe` (`id_groupe`, `nom`) VALUES (152, 'ITINN2 S2'), (153, 'ITINS1 S2'), (154, 'ITINT2 S2'), -(155, 'ITINT3 S2'), -(156, 'ITINN1 S0'), -(157, 'INGBD1 S10'), -(158, 'INSIQ1 S10'), -(159, 'ITINAS S10'), -(160, 'ITINN1 S10'), -(161, 'ITINN2 S10'), -(162, 'ITINS1 S10'), -(163, 'ITINT2 S10'), -(164, 'ITINT3 S10'); +(155, 'ITINT3 S2'); -- -------------------------------------------------------- @@ -305,7 +284,7 @@ CREATE TABLE IF NOT EXISTS `mcc_module` ( PRIMARY KEY (`id_mcc_module`), KEY `id_mcc_ue` (`id_mcc_ue`), KEY `id_module` (`id_module`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=599 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=638 ; -- -- RELATIONS POUR LA TABLE `mcc_module`: @@ -329,7 +308,7 @@ CREATE TABLE IF NOT EXISTS `mcc_ue` ( PRIMARY KEY (`id_mcc_ue`), KEY `id_semestre` (`id_semestre`), KEY `id_ue` (`id_ue`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=93 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=99 ; -- -- RELATIONS POUR LA TABLE `mcc_ue`: @@ -350,7 +329,7 @@ CREATE TABLE IF NOT EXISTS `module` ( `nom` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `libelle` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id_module`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=222 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=235 ; -- -------------------------------------------------------- @@ -366,7 +345,7 @@ CREATE TABLE IF NOT EXISTS `note` ( PRIMARY KEY (`id_note`), KEY `id_appartenance` (`id_appartenance`), KEY `id_controle` (`id_controle`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=493 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=507 ; -- -- RELATIONS POUR LA TABLE `note`: @@ -390,7 +369,7 @@ CREATE TABLE IF NOT EXISTS `semestre` ( `annee` year(4) NOT NULL, PRIMARY KEY (`id_semestre`), KEY `id_formation` (`id_formation`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=249 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=267 ; -- -- RELATIONS POUR LA TABLE `semestre`: @@ -431,7 +410,7 @@ CREATE TABLE IF NOT EXISTS `ue` ( `nom` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `libelle` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id_ue`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=35 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=37 ; -- -------------------------------------------------------- @@ -456,7 +435,7 @@ CREATE TABLE IF NOT EXISTS `utilisateur` ( -- INSERT INTO `utilisateur` (`identifiant`, `prenom`, `nom`, `sexe`, `mail`, `mdp`, `droits`) VALUES -('admin', 'monsieur', 'administrateur', 1, 'admin@iut-tlse3.fr', 'lkjdsqlkjdlqksjdlqksjdqlksdjlqksjdqj', 'teacher,admin'), +('admin', 'monsieur', 'administrateur', 1, 'admin@iut-tlse3.fr', 'lkjdsqlkjdlqksjdlqksjdqlksdjlqksjdqj', 'admin'), ('admin2', 'madame', 'administratrice', 0, 'mme.admin@iut-tlse3.fr', 'lkjdsqlkjdlqksjdlqksjdqlksdjlqksjdqj', 'admin'), ('lbh1609a', 'Hervé', 'LEBLANC', 1, 'herve.leblanc@iut-tlse3.fr', 'lqkjsdlkjsdlkjqsdlkjqsdlkjqsdkjqsldjqsj', 'teacher'), ('ref', 'mlle', 'référente', 0, 'ref@ref.ref', 'sqldkmsqldksqmlkd', 'master');