list($inutile, $i_ENT) = each($tab_id_commun); } } if ($i_ENT) { $id_ent_ENT = $tab_users_ENT['id_ent'][$i_ENT]; if ($id_ent_SACoche == $id_ent_ENT) { // Contenu de SACoche à ignorer : id_ent identique $lignes_ras .= '<tr><td>' . html($tab_profils[$tab_users_base['profil'][$i_base]] . ' | ' . $tab_users_base['nom'][$i_base] . ' ' . $tab_users_base['prenom'][$i_base] . ' [' . $id_ent_SACoche . ']') . '</td><td>identifiant d\'ENT identique</td></tr>' . NL; } else { // id_ent différents... if (in_array($id_ent_ENT, $tab_users_base['id_ent'])) { // Contenu de SACoche à problème : id_ent déjà pris $lignes_pb .= '<tr><td>' . html($tab_profils[$tab_users_base['profil'][$i_base]] . ' | ' . $tab_users_base['nom'][$i_base] . ' ' . $tab_users_base['prenom'][$i_base] . ' [' . $id_ent_SACoche . ']') . '</td><td>identifiant d\'ENT [' . html($id_ent_ENT) . '] déjà affecté à un autre utilisateur</td></tr>' . NL; } else { // Contenu de SACoche à modifier : id_ent nouveau DB_STRUCTURE_ADMINISTRATEUR::DB_modifier_user($tab_users_base['id'][$i_base], array(':id_ent' => $id_ent_ENT)); $lignes_modif .= '<tr class="new"><td>' . html($tab_profils[$tab_users_base['profil'][$i_base]] . ' | ' . $tab_users_base['nom'][$i_base] . ' ' . $tab_users_base['prenom'][$i_base]) . '</td><td class="b">Id ENT : ' . html($id_ent_ENT) . '</td></tr>' . NL; } } unset($tab_users_ENT['profil'][$i_ENT], $tab_users_ENT['id_ent'][$i_ENT], $tab_users_ENT['nom'][$i_ENT], $tab_users_ENT['prenom'][$i_ENT], $tab_users_ENT['id_sconet'][$i_ENT]); } } if (count($tab_users_ENT['id_ent'])) { foreach ($tab_users_ENT['id_ent'] as $i_ENT => $id_ent_ENT) { $lignes_reste .= '<tr><td>' . html($tab_profils[$tab_users_ENT['profil'][$i_ENT]] . ' | ' . $tab_users_ENT['nom'][$i_ENT] . ' ' . $tab_users_ENT['prenom'][$i_ENT] . ' [' . $id_ent_ENT . ']') . '</td><td>nom et prénom non trouvés dans SACoche</td></tr>' . NL; } } // On affiche le bilan echo '<ul class="puce"><li><b>Résultat de l\'analyse et des opérations effectuées :</b></li></ul>' . NL; echo '<table>' . NL; echo '<tbody>' . NL;
$tab_donnees[':email_origine'] = ''; } // Cas du mot de passe if (!$box_password) { $tab_donnees[':password'] = crypter_mdp($password); } // Cas de la date de sortie if ($box_date) { $sortie_date = '-'; $sortie_date_mysql = SORTIE_DEFAUT_MYSQL; } else { $sortie_date_mysql = convert_date_french_to_mysql($sortie_date); } // Mettre à jour l'enregistrement $tab_donnees += array(':sconet_id' => $sconet_id, ':reference' => $reference, ':profil_sigle' => $profil, ':genre' => $genre, ':nom' => $nom, ':prenom' => $prenom, ':courriel' => $courriel, ':id_ent' => $id_ent, ':id_gepi' => $id_gepi, ':sortie_date' => $sortie_date_mysql); DB_STRUCTURE_ADMINISTRATEUR::DB_modifier_user($id, $tab_donnees); // Afficher le retour $checked = $check ? ' checked' : ''; echo '<td class="nu"><input type="checkbox" name="f_ids" value="' . $id . '"' . $checked . ' /></td>'; echo '<td class="label">' . html($id_ent) . '</td>'; echo '<td class="label">' . html($id_gepi) . '</td>'; echo '<td class="label">' . html($sconet_id) . '</td>'; echo '<td class="label">' . html($reference) . '</td>'; echo '<td class="label">' . html($profil) . ' <img alt="" src="./_img/bulle_aide.png" width="16" height="16" title="' . html(html($_SESSION['tmp'][$profil])) . '" /></td>'; echo '<td class="label">' . Html::$tab_genre['adulte'][$genre] . '</td>'; echo '<td class="label">' . html($nom) . '</td>'; echo '<td class="label">' . html($prenom) . '</td>'; echo '<td class="label">' . html($login) . '</td>'; echo $box_password ? '<td class="label i">champ crypté</td>' : '<td class="label new">' . $password . ' <img alt="" src="./_img/bulle_aide.png" width="16" height="16" title="Pensez à noter le mot de passe !" /></td>'; echo '<td class="label">' . html($courriel) . '</td>'; echo '<td class="label">' . $sortie_date . '</td>';
if (count($tab_mod)) { foreach ($tab_mod as $id_base) { // Il peut théoriquement subsister un conflit de sconet_id pour des users ayant même reference, et réciproquement... idem pour l'adresse mail... $tab_champs = $import_profil == 'eleve' ? array('sconet_id', 'sconet_num', 'reference', 'classe', 'genre', 'nom', 'prenom', 'birth_date', 'courriel', 'email_origine') : array('sconet_id', 'reference', 'profil_sigle', 'genre', 'nom', 'prenom', 'courriel', 'email_origine'); $DB_VAR = array(); foreach ($tab_champs as $champ_ref) { if ($tab_memo_analyse['modifier'][$id_base][$champ_ref] !== FALSE) { $DB_VAR[':' . $champ_ref] = $champ_ref != 'birth_date' ? $tab_memo_analyse['modifier'][$id_base][$champ_ref] : convert_date_french_to_mysql($tab_memo_analyse['modifier'][$id_base][$champ_ref]); } } if ($tab_memo_analyse['modifier'][$id_base]['entree'] !== FALSE) { $DB_VAR[':sortie_date'] = $tab_memo_analyse['modifier'][$id_base]['entree']; } // bilan if (count($DB_VAR)) { DB_STRUCTURE_ADMINISTRATEUR::DB_modifier_user($id_base, $DB_VAR); } $nb_mod++; } } // On enregistre (tableau mis à jour) $tab_liens_id_base = array('classes' => $tab_i_classe_TO_id_base, 'groupes' => $tab_i_groupe_TO_id_base, 'users' => $tab_i_fichier_TO_id_base); FileSystem::ecrire_fichier(CHEMIN_DOSSIER_IMPORT . 'import_' . $import_origine . '_' . $import_profil . '_' . $_SESSION['BASE'] . '_' . session_id() . '_liens_id_base.txt', serialize($tab_liens_id_base)); // Afficher le bilan $lignes = ''; $nb_fin_actuel = 0; $nb_fin_ancien = 0; $profil_type = $import_profil != 'professeur' ? $import_profil : array('professeur', 'directeur'); $with_classe = $import_profil == 'eleve' ? TRUE : FALSE; $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_users($profil_type, 2, 'user_id,user_sconet_id,user_sconet_elenoet,user_reference,user_profil_nom_court_singulier,user_nom,user_prenom,user_prenom,user_login,user_sortie_date', $with_classe, TRUE); foreach ($DB_TAB as $DB_ROW) {