security_check(); if ($resultat_session == 'c') { header("Location: ../utilisateurs/mon_compte.php?change_mdp=yes"); die(); } else if ($resultat_session == '0') { header("Location: ../logout.php?auto=1"); die(); } if (!checkAccess()) { header("Location: ../logout.php?auto=1"); die(); } //recherche de l'utilisateur avec propel $utilisateur = UtilisateurProfessionnelPeer::getUtilisateursSessionEnCours(); if ($utilisateur == null) { header("Location: ../logout.php?auto=1"); die(); } //On vérifie si le module est activé if (getSettingValue("active_module_absence")!='2') { die("Le module n'est pas activé."); } if ($utilisateur->getStatut()!="cpe" && $utilisateur->getStatut()!="scolarite") { die("acces interdit"); } //récupération des paramètres de la requète $id_notification = isset($_POST["id_notification"]) ? $_POST["id_notification"] :(isset($_GET["id_notification"]) ? $_GET["id_notification"] :(isset($_SESSION["id_notification"]) ? $_SESSION["id_notification"] : NULL)); if (isset($id_notification) && $id_notification != null) $_SESSION['id_notification'] = $id_notification; $menu = isset($_POST["menu"]) ? $_POST["menu"] :(isset($_GET["menu"]) ? $_GET["menu"] : NULL); //============================================== $style_specifique[] = "mod_abs2/lib/abs_style"; $style_specifique[] = "lib/DHTMLcalendar/calendarstyle"; $javascript_specifique[] = "lib/DHTMLcalendar/calendar"; $javascript_specifique[] = "lib/DHTMLcalendar/lang/calendar-fr"; $javascript_specifique[] = "lib/DHTMLcalendar/calendar-setup"; if(!$menu){ $titre_page = "Les absences"; } //$utilisation_jsdivdrag = "non"; $_SESSION['cacher_header'] = "y"; require_once("../lib/header.inc.php"); //**************** FIN EN-TETE ***************** if(!$menu){ include('menu_abs2.inc.php'); } //=========================== echo "
\n"; if (isset($message_enregistrement)) { echo $message_enregistrement; } $notification = new AbsenceEleveNotification(); $notification = AbsenceEleveNotificationQuery::create()->findPk($id_notification); if ($notification == null) { $criteria = new Criteria(); $criteria->addDescendingOrderByColumn(AbsenceEleveNotificationPeer::UPDATED_AT); $criteria->setLimit(1); $notification = $utilisateur->getAbsenceEleveNotifications($criteria)->getFirst(); if ($notification == null) { echo "Notification non trouvée"; die(); } } //============================= if ($notification->getAbsenceEleveTraitement() == null) { echo "plop"; } else { $tab_resp_legal_1=array(); $tab_resp_legal_2=array(); $tab_resp_legal_1_ou_2=array(); $select_saisie=array(); foreach ($notification->getAbsenceEleveTraitement()->getAbsenceEleveSaisies() as $saisie) { $select_saisie[]=$saisie->getId(); //$sql="SELECT DISTINCT pers_id FROM responsables2 WHERE ele_id='".$saisie->getEleve()->getEleId()."' AND (resp_legal='1' OR resp_legal='2');"; $sql="SELECT DISTINCT pers_id FROM responsables2 WHERE ele_id='".$saisie->getEleve()->getEleId()."' AND resp_legal='1';"; //echo "$sql
"; $res_resp_legal=mysqli_query($GLOBALS["mysqli"], $sql); if(mysqli_num_rows($res_resp_legal)>0) { while($lig_resp_legal=mysqli_fetch_object($res_resp_legal)) { if(!in_array($lig_resp_legal->pers_id, $tab_resp_legal_1_ou_2)) { $tab_resp_legal_1_ou_2[]=$lig_resp_legal->pers_id; } if(!in_array($lig_resp_legal->pers_id, $tab_resp_legal_1)) { $tab_resp_legal_1[]=$lig_resp_legal->pers_id; } } } $sql="SELECT DISTINCT pers_id FROM responsables2 WHERE ele_id='".$saisie->getEleve()->getEleId()."' AND resp_legal='2';"; //echo "$sql
"; $res_resp_legal=mysqli_query($GLOBALS["mysqli"], $sql); if(mysqli_num_rows($res_resp_legal)>0) { while($lig_resp_legal=mysqli_fetch_object($res_resp_legal)) { if(!in_array($lig_resp_legal->pers_id, $tab_resp_legal_1_ou_2)) { $tab_resp_legal_1_ou_2[]=$lig_resp_legal->pers_id; } if(!in_array($lig_resp_legal->pers_id, $tab_resp_legal_2)) { $tab_resp_legal_2[]=$lig_resp_legal->pers_id; } } } } if((count($tab_resp_legal_1_ou_2)>2)||(count($tab_resp_legal_1)>1)||(count($tab_resp_legal_2)>1)) { echo "

Il semble que les saisies sélectionnées concernent plus de deux responsables légaux.
Vous devriez peut-être plutôt créer un lot de traitements avec des notifications individuelles plutôt qu'un seul traitement avec une notification commune.

".add_token_field(); for($loop=0;$loop"; } echo "

"; } } //============================= echo ''; echo ''; echo ''; echo ''; echo ''; if ($notification->getErreurMessageEnvoi() != null && $notification->getErreurMessageEnvoi() != '') { echo ''; } echo ''; if ($notification->getAbsenceEleveTraitement() != null) { if ($notification->getResponsableEleves()->count() != $nombreResponsablesEligible) { echo ''; } } if ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_EMAIL) { echo ''; } if ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_SMS || $notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COMMUNICATION_TELEPHONIQUE) { echo ''; } // Affichage des adresses pour l'envoi du SMS (permettre de savoir à quel responsable l'envoyer selon l'adresse) if (($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COURRIER) || ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_SMS)) { echo ''; } echo ''; echo ''; if ($notification->getdateEnvoi() != null) { echo ''; } else { echo ''; if ($notification->getCreatedAt() != $notification->getUpdatedAt()) { echo ''; } } if ($notification->getTypeNotification() != AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COMMUNICATION_TELEPHONIQUE && ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COURRIER || $notification->getStatutEnvoi() == AbsenceEleveNotificationPeer::STATUT_ENVOI_ETAT_INITIAL || $notification->getStatutEnvoi() == AbsenceEleveNotificationPeer::STATUT_ENVOI_PRET_A_ENVOYER)) { echo ''; } $idTraitement = $notification->getATraitementId(); $autresNotifications = AbsenceEleveNotificationQuery::create()->filterByATraitementId($idTraitement) ->filterById($notification->getId(), ModelCriteria::NOT_EQUAL)->find(); if (!$autresNotifications->isEmpty()) { $idNotifications = Null; foreach ($autresNotifications as $autreNotification) { if ($autreNotification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COURRIER || ($autreNotification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_EMAIL && ($autreNotification->getEmail() != null || $autreNotification->getEmail() != ''))) { $idNotifications[].=$autreNotification->getId(); } } if (!is_null($idNotifications)) { $idNotifications[].=$notification->getId(); echo ''; } } if ($notification->getStatutEnvoi() != AbsenceEleveNotificationPeer::STATUT_ENVOI_ETAT_INITIAL) { echo ''; } if ($notification->getModifiable()) { if ($notification->getAbsenceEleveTraitement() != null) { echo ''; } } echo ''; echo '
'; echo 'N° de notification'; echo ''; echo $notification->getPrimaryKey(); if ($notification->getAbsenceEleveTraitement() == null) { echo ' (notification orpheline)'; } else { echo " "; echo '(voir traitement)'; echo ""; } echo '
'; echo 'Saisies : '; echo ''; echo ''; $eleve_prec_id = null; $tab_ele=array(); if ($notification->getAbsenceEleveTraitement() != null) { foreach ($notification->getAbsenceEleveTraitement()->getAbsenceEleveSaisies() as $saisie) { //$saisie = new AbsenceEleveSaisie(); if ($saisie->getEleve() == null) { if (!$notification->getAbsenceEleveTraitement()->getAbsenceEleveSaisies()->isFirst()) { echo ''; } echo ''; } echo ''; echo '
'; echo 'Aucune absence'; if ($saisie->getGroupe() != null) { echo ' pour le groupe '; echo $saisie->getGroupe()->getdescription(); } if ($saisie->getClasse() != null) { echo ' pour la classe '; echo $saisie->getClasse()->getNom(); } if ($saisie->getAidDetails() != null) { echo ' pour l\'aid '; echo $saisie->getAidDetails()->getNom(); } echo '
'; } elseif ($eleve_prec_id != $saisie->getEleve()->getPrimaryKey()) { if (!$notification->getAbsenceEleveTraitement()->getAbsenceEleveSaisies()->isFirst()) { echo '
'; echo '
'; echo $saisie->getEleve()->getCivilite().' '.$saisie->getEleve()->getNom().' '.$saisie->getEleve()->getPrenom(); if(!in_array($saisie->getEleve()->getLogin(), $tab_ele)) { $tab_ele[]=$saisie->getEleve()->getLogin(); } if ((getSettingValue("active_module_trombinoscopes")=='y') && $saisie->getEleve() != null) { $nom_photo = $saisie->getEleve()->getNomPhoto(1); $photos = $nom_photo; //if (($nom_photo == "") or (!(file_exists($photos)))) { if (($nom_photo == NULL) or (!(file_exists($photos)))) { $photos = "../mod_trombinoscopes/images/trombivide.jpg"; } $valeur = redimensionne_image_petit($photos); echo ' '; } if ($utilisateur->getAccesFicheEleve($saisie->getEleve())) { //echo ""; echo ""; echo ' (voir fiche)'; echo ""; } echo '
'; echo '
'; $eleve_prec_id = $saisie->getEleve()->getPrimaryKey(); } echo ''; if (!$notification->getAbsenceEleveTraitement()->getAbsenceEleveSaisies()->isLast()) { echo '
'; } } } echo '
'; echo '
'; echo 'Type de notification : '; echo ''; if ($notification->getModifiable()) { echo '
'; echo ''; echo '

'; echo ''; echo ''; echo (""; echo ''; echo '

'; echo '
'; } else { echo $notification->getTypeNotification(); } echo '
'; echo 'Message d\'erreur : '; echo ''; echo $notification->getErreurMessageEnvoi(); echo '
'; echo 'Responsables : '; echo ''; $nb_resp_sans_email=0; $nb_resp=0; foreach ($notification->getResponsableEleves() as $responsable) { echo '
'; //$responsable = new ResponsableEleve(); echo $responsable->getCivilite().' '.strtoupper($responsable->getNom()).' '.$responsable->getPrenom(); echo ' - Courriel :'; //echo $notification->getEmail(); echo $responsable->getMel(); /* echo "Responsable:
";
print_r($responsable);
echo "
"; echo "Notification:
";
print_r($notification);
echo "
"; */ if($notification->getEmail()=="") {$nb_resp_sans_email++;} if ($notification->getModifiable()) { echo '
'; echo '
'; echo ''; echo '

'; echo ''; echo ''; echo ''; echo ''; echo '

'; echo '
'; echo '
'; } echo '
'; if (!$notification->getResponsableEleves()->isLast()) { echo '
'; } $nb_resp++; } if($nb_resp_sans_email==$nb_resp) { echo ""; } elseif($nb_resp_sans_email>0) { echo ""; } $autresResponsablesInfos=$notification->getAbsenceEleveTraitement()->getResponsablesInformationsSaisies(); $nombreResponsablesEligible=0; foreach ($autresResponsablesInfos as $responsableInfos) { if ($responsableInfos->getNiveauResponsabilite() == '0') { continue; } $nombreResponsablesEligible++; } if ($notification->getModifiable()) { if ($notification->getAbsenceEleveTraitement() != null) { if ($notification->getResponsableEleves()->count() != $nombreResponsablesEligible) { echo '
'; echo '
'; echo ''; echo '

'; echo ''; echo ''; echo (""; echo ''; echo '

'; echo '
'; echo '
'; } } } echo '
'; echo 'Notifications multiples : '; echo ''; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
'; echo '
'; echo 'Email : '; echo ''; if (!$notification->getModifiable()) { echo $notification->getEmail(); } else { echo '
'; echo '
'; echo ''; echo '

'; echo ''; echo ''; echo (""; echo ''; echo '

'; echo '
'; echo '
'; echo ' ou '; echo '
'; echo '
'; echo ''; echo '

'; echo ''; echo ''; echo ''; echo ''; if(count($tab_ele)>0) { $chaine_ele=""; for($loop=0;$loop"; $res_ele=mysqli_query($GLOBALS['mysqli'], $sql); if(mysqli_num_rows($res_ele)>0) { $lig_ele=mysqli_fetch_object($res_ele); $chaine_ele.="

".$lig_ele->nom." ".$lig_ele->prenom." (".formate_date($lig_ele->naissance); if(time()-mysql_date_to_unix_timestamp($lig_ele->naissance." 00:00:00")>18*3600*24*365.25) { $chaine_ele.=" (majeur)"; } $chaine_ele.=")

"; $chaine_ele.=""; $sql="SELECT * FROM utilisateurs WHERE login='".$tab_ele[$loop]."' AND statut='eleve' AND email!='';"; echo "$sql
"; $res_ele=mysqli_query($GLOBALS['mysqli'], $sql); if(mysqli_num_rows($res_ele)>0) { $lig_ele=mysqli_fetch_object($res_ele); $chaine_ele.=""; } $chaine_ele.="
Email élèveemail';return false;\" title=\"Choisir ce mail\">".$lig_ele->email."
Email du compte utilisateur élèveemail';return false;\" title=\"Choisir ce mail\">".$lig_ele->email."
"; } else { $sql="SELECT * FROM utilisateurs WHERE login='".$tab_ele[$loop]."' AND statut='eleve' AND email!='';"; //echo "$sql
"; $res_ele=mysqli_query($GLOBALS['mysqli'], $sql); if(mysqli_num_rows($res_ele)>0) { $sql="SELECT * FROM eleves WHERE login='".$tab_ele[$loop]."';"; $res_ele2=mysqli_query($GLOBALS['mysqli'], $sql); if(mysqli_num_rows($res_ele2)>0) { $lig_ele2=mysqli_fetch_object($res_ele2); $chaine_ele.="

".$lig_ele2->nom." ".$lig_ele2->prenom." (".formate_date($lig_ele2->naissance); if(time()-mysql_date_to_unix_timestamp($lig_ele2->naissance." 00:00:00")>18*3600*24*365.25) { $chaine_ele.=" (majeur)"; } $chaine_ele.=")

"; $lig_ele=mysqli_fetch_object($res_ele); $chaine_ele.=""; $chaine_ele.="
Email du compte utilisateur élèveemail';return false;\" title=\"Choisir ce mail\">".$lig_ele->email."
"; } } } } if($chaine_ele!="") { echo " Email"; $titre_infobulle="Choix d'un mail"; $texte_infobulle=$chaine_ele; $tabdiv_infobulle[]=creer_div_infobulle('div_infobulle_autre_mail',$titre_infobulle,"",$texte_infobulle,"",25,0,'y','y','n','n'); } } echo '

'; echo '
'; echo '
'; } echo '
'; echo 'Tel : '; echo ''; if (!$notification->getModifiable()) { echo $notification->getTelephone(); } else { echo '
'; echo '
'; echo ''; echo '

'; echo ''; echo ''; //echo (""); $selected = false; foreach ($notification->getAbsenceEleveTraitement()->getResponsablesInformationsSaisies() as $responsable_information) { $responsable = $responsable_information->getResponsableEleve(); if ($responsable->getTelPort() != null || $responsable->getTelPort() != '') { echo '\n"; } if ($responsable->getTelPers() != null || $responsable->getTelPers() != '') { echo '\n"; } if ($responsable->getTelProf() != null || $responsable->getTelProf() != '') { echo '\n"; } } if (!$selected) { echo '\n"; } echo ""; echo ''; echo '

'; echo '
'; echo '
'; echo ' ou '; echo '
'; echo '
'; echo ''; echo '

'; echo ''; echo ''; echo ''; echo ''; if(count($tab_ele)>0) { $chaine_tel_ele=""; for($loop=0;$loop0) { $lig_tel_ele=mysqli_fetch_object($res_tel_ele); $chaine_tel_ele.="

".$lig_tel_ele->nom." ".$lig_tel_ele->prenom." (".formate_date($lig_tel_ele->naissance); if(time()-mysql_date_to_unix_timestamp($lig_tel_ele->naissance." 00:00:00")>18*3600*24*365.25) { //$chaine_tel_ele.=time()."-".mysql_date_to_unix_timestamp($lig_tel_ele->naissance." 00:00:00")."=".(time()-mysql_date_to_unix_timestamp($lig_tel_ele->naissance))." et 18*3600*24*365.25=".(18*3600*24*365.25); $chaine_tel_ele.=" (majeur)"; } $chaine_tel_ele.=")

"; if($lig_tel_ele->tel_pers!="") { $chaine_tel_ele.=""; } if($lig_tel_ele->tel_port!="") { $chaine_tel_ele.=""; } if($lig_tel_ele->tel_prof!="") { $chaine_tel_ele.=""; } $chaine_tel_ele.="
Tel.perstel_pers';return false;\" title=\"Choisir ce numéro\">".affiche_numero_tel_sous_forme_classique($lig_tel_ele->tel_pers)."
Tel.porttel_port';return false;\" title=\"Choisir ce numéro\">".affiche_numero_tel_sous_forme_classique($lig_tel_ele->tel_port)."
Tel.proftel_prof';return false;\" title=\"Choisir ce numéro\">".affiche_numero_tel_sous_forme_classique($lig_tel_ele->tel_prof)."
"; } } if($chaine_tel_ele!="") { echo " Tel"; $titre_infobulle="Choix d'un numéro"; $texte_infobulle=$chaine_tel_ele; $tabdiv_infobulle[]=creer_div_infobulle('div_infobulle_autre_tel',$titre_infobulle,"",$texte_infobulle,"",25,0,'y','y','n','n'); } } echo '

'; echo '
'; echo '
'; } echo '
'; echo 'Adresse : '; echo ''; if ($notification->getAdresse() != null) { //pour information : Nom du ou des responsables sélectionnés echo 'De : '; echo $notification->getAdresse()->getDescriptionHabitant(); echo '

'; if ($notification->getAdresse()->getAdr1() != null && $notification->getAdresse()->getAdr1() != '') { echo $notification->getAdresse()->getAdr1(); echo '
'; } if ($notification->getAdresse()->getAdr2() != null && $notification->getAdresse()->getAdr2() != '') { echo $notification->getAdresse()->getAdr2(); echo '
'; } if ($notification->getAdresse()->getAdr3() != null && $notification->getAdresse()->getAdr3() != '') { echo $notification->getAdresse()->getAdr3(); echo '
'; } if ($notification->getAdresse()->getAdr4() != null && $notification->getAdresse()->getAdr4() != '') { echo $notification->getAdresse()->getAdr4(); echo '
'; } echo $notification->getAdresse()->getCp().' '.$notification->getAdresse()->getCommune(); if ($notification->getAdresse()->getPays() != null && $notification->getAdresse()->getPays() != '' && $notification->getAdresse()->getPays() != getsettingvalue('gepiSchoolPays')) { echo '
'; echo $notification->getAdresse()->getPays(); } } if ($notification->getModifiable()) { echo '
'; echo '
'; echo ''; echo '

'; echo ''; echo ''; echo (""; echo ''; echo '

'; echo '
'; echo '
'; } echo '
'; echo 'Statut : '; echo ''; //on ne modifie manuellement le statut si le type est courrier ou communication téléphonique if ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COURRIER || $notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COMMUNICATION_TELEPHONIQUE) { echo '
'; echo ''; echo '

'; echo ''; echo ''; echo (""; echo ''; echo '

'; echo '
'; } else if ($notification->getStatutEnvoi() == AbsenceEleveNotificationPeer::STATUT_ENVOI_ETAT_INITIAL || $notification->getStatutEnvoi() == AbsenceEleveNotificationPeer::STATUT_ENVOI_PRET_A_ENVOYER) { //on autorise un changement de statut entre initial et pret a envoyer echo '
'; echo ''; echo '

'; echo ''; echo ''; echo (""; echo ''; echo '

'; echo '
'; } else { echo $notification->getStatutEnvoi(); } echo '
'; echo 'Créé par : '; echo ''; if ($notification->getUtilisateurProfessionnel() != null) { echo $notification->getUtilisateurProfessionnel()->getCivilite(); echo ' '; echo $notification->getUtilisateurProfessionnel()->getNom(); } echo '
'; echo 'Date d\'envoi : '; echo ''; echo (strftime("%a %d/%m/%Y %H:%M", $notification->getdateEnvoi('U'))); echo '
'; echo 'Créé le : '; echo ''; echo (strftime("%a %d/%m/%Y %H:%M", $notification->getCreatedAt('U'))); echo '
'; echo 'Modifiée le : '; echo ''; echo (strftime("%a %d/%m/%Y %H:%M", $notification->getUpdatedAt('U'))); echo '
'; echo '
'; echo ''; echo '

'; echo ''; if ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COURRIER) { echo ''; } else { if ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_EMAIL && ($notification->getEmail() == null || $notification->getEmail() == '')) { //on affiche pas le bouton de generation car l'adresse n'est pas renseignee } else { echo ''; } } echo '

'; echo '
'; echo '
'; echo '
'; echo ''; echo '

'; foreach ($idNotifications as $id) { echo ''; } echo ''; echo '

'; echo '
'; echo '
'; echo '
'; echo ''; echo '

'; echo ''; echo ''; echo ''; echo '

'; echo '
'; echo '
'; echo '
'; echo ''; echo '

'; echo ''; echo ''; echo ''; echo '

'; echo '
'; echo '
'; if((getSettingAOui('active_mod_ooo'))&& ((($_SESSION['statut']=='cpe')&&(getSettingAOui('OOoUploadCpeAbs2')))|| ($_SESSION['statut']=='administrateur'))) { echo "

NOTE : Le texte des notifications, qu'il soit ODT, ODS ou SMS, est paramétrable dans Modèle openDocument.

"; } else { echo "

NOTE : Le texte des notifications, qu'il soit ODT, ODS ou SMS, est paramétrable dans Modèle openDocument"; if(!getSettingAOui('active_mod_ooo')) { echo " (à condition que le module OOo soit activé)"; } echo ".

"; } echo "
\n"; require_once("../lib/footer.inc.php"); ?>