include_once '../orm/helpers/AbsencesNotificationHelper.php'; // pour la fonction tbs_str et MergeInfosEtab if($odt=='exclusion') { $fichier_modele_discipline='discipline_exclusion.odt'; $prefixe_fichier_odt="exclusion"; } elseif($odt=='travail') { $fichier_modele_discipline='discipline_travail.odt'; $prefixe_fichier_odt="travail"; } elseif($odt=='autre') { $fichier_modele_discipline='discipline_autre.odt'; $prefixe_fichier_odt="autre_sanction"; } $extraction_bilans = repertoire_modeles($fichier_modele_discipline); //Coordonnées etab $TBS = AbsencesNotificationHelper::MergeInfosEtab($extraction_bilans); $TBS->MergeBlock('export', $export); $nom_fichier = $prefixe_fichier_odt.'_'. $nom_ele.'_'.$prenom_ele.'_'.$id_sanction. '.odt'; $TBS->Show(OPENTBS_DOWNLOAD + TBS_EXIT, $nom_fichier); } //fin Ooo $utilisation_prototype="ok"; $themessage = 'Des informations ont été modifiées. Voulez-vous vraiment quitter sans enregistrer ?'; //**************** EN-TETE ***************** $titre_page = "Discipline: Traitement/".$mod_disc_terme_sanction; require_once("../lib/header.inc.php"); //**************** FIN EN-TETE ***************** //debug_var();
echo '<a href="liste_notifications.php">liste des notifications</a>'; die; } // //on envoi les emails // $nb_mail_envoyés = 0; if (isset($_GET['envoyer_email']) && $_GET['envoyer_email'] == 'true') { // Load the template include_once 'lib/function.php'; $email_modele=repertoire_modeles('absence_email.txt'); include_once '../orm/helpers/AbsencesNotificationHelper.php'; foreach($notifications_col as $notif) { $TBS = AbsencesNotificationHelper::MergeNotification($notif, $email_modele); $retour_envoi = AbsencesNotificationHelper::EnvoiNotification($notif, $TBS->Source); if ($retour_envoi == '') { $nb_mail_envoyés = $nb_mail_envoyés + 1; } } echo 'Mail envoyés : '.$nb_mail_envoyés.'<br/>'; } // //on affiche les notifications de type email // $notif_mail_a_envoyer_col = new PropelCollection(); $notif_mail_fini_col = new PropelCollection(); foreach($notifications_col as $notif) { if ($notif->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_EMAIL) { if ($notif->getStatutEnvoi() == AbsenceEleveNotificationPeer::STATUT_ENVOI_ETAT_INITIAL || $notif->getStatutEnvoi() == AbsenceEleveNotificationPeer::STATUT_ENVOI_PRET_A_ENVOYER) { $notif_mail_a_envoyer_col->add($notif);
// Output as a download file (some automatic fields are merged here) $TBS->Show(OPENTBS_DOWNLOAD+TBS_EXIT, 'abs_notif_'.$notification->getId().'.odt'); die(); } else if ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_EMAIL) { // Load the template $email=repertoire_modeles('absence_email.txt'); include_once '../orm/helpers/AbsencesNotificationHelper.php'; $TBS = AbsencesNotificationHelper::MergeNotification($notification, $email); $message = $TBS->Source; $retour_envoi = AbsencesNotificationHelper::EnvoiNotification($notification, $message); } else if ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_SMS) { // Load the template $sms=repertoire_modeles('absence_sms.txt'); include_once '../orm/helpers/AbsencesNotificationHelper.php'; $TBS = AbsencesNotificationHelper::MergeNotification($notification, $sms); $message = $TBS->Source; $retour_envoi = AbsencesNotificationHelper::EnvoiNotification($notification, $message); } if ($notification->getStatutEnvoi() == AbsenceEleveNotificationPeer::STATUT_ENVOI_SUCCES) { $message_enregistrement = 'Envoi réussi. '.$retour_envoi; } else { $message_enregistrement = 'Échec de l\'envoi. '.$retour_envoi; } include('visu_notification.php'); ?>
$minute_demi_journee = 50; if (getSettingValue("abs2_heure_demi_journee") != null) { try { $dt_demi_journee = new DateTime(getSettingValue("abs2_heure_demi_journee")); $heure_demi_journee = $dt_demi_journee->format('H'); $minute_demi_journee = $dt_demi_journee->format('i'); } catch (Exception $x) { } } $temps_demi_journee = $heure_demi_journee.$minute_demi_journee; $indice=0; //on charge le modele et on merge les données de l'établissement $TBS=AbsencesNotificationHelper::MergeInfosEtab($courrier_lot_modele); $courrier_nouvellement_envoyes_col = new PropelCollection(); foreach ($tableNotifications as &$notification) { $idNotifications = ''; foreach ($notification['notif_col'] as &$notif) { //on met un code d'erreur au cas ou la generation se fait mal $notif->setStatutEnvoi(AbsenceEleveNotificationPeer::STATUT_ENVOI_ECHEC); $notif->setUpdatedAt('now'); $notif->save(); $courrier_nouvellement_envoyes_col->append($notif);