if ($traitement == null) { $message_erreur_traitement="Le traitement initial n'a pas été trouvé, donc non supprimé.<br />"; } else { $traitement->delete(); } } // Ménage quand on "transforme" une notification pour plusieurs parents de familles différentes (visu_notification.php) en un lot de traitements: if(isset($_POST['suppr_notification'])) { check_token(); $id_suppr_notification=$_POST['suppr_notification']; $notification = new AbsenceEleveNotification(); $notification = AbsenceEleveNotificationQuery::create()->findPk($id_suppr_notification); if ($notification != null) { if ($notification->getAbsenceEleveTraitement() != null) { $id_suppr_traitement=$notification->getATraitementId(); $traitement = AbsenceEleveTraitementQuery::create()->findPk($id_suppr_traitement); if ($traitement == null) { $message_erreur_traitement="Le traitement initial n'a pas été trouvé, donc non supprimé.<br />"; } else { $traitement->delete(); $notification->delete(); } }
/** * Returns a new AbsenceEleveNotificationQuery object. * * @param string $modelAlias The alias of a model in the query * @param Criteria $criteria Optional Criteria to build the query from * * @return AbsenceEleveNotificationQuery */ public static function create($modelAlias = null, $criteria = null) { if ($criteria instanceof AbsenceEleveNotificationQuery) { return $criteria; } $query = new AbsenceEleveNotificationQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); } if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }
echo '<input type="hidden" name="id_notification" value="'.$notification->getPrimaryKey().'"/>'; if ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COURRIER) { echo '<button type="submit" onclick=\'window.open("generer_notification.php?id_notification='.$notification->getPrimaryKey().'"); setTimeout("window.location = \"visu_notification.php\"", 1000); return false;\'>Génerer la notification</button>'; } 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 '<button type="submit">Générer la notification</button>'; } } echo '</p>'; echo '</form>'; echo '</td></tr>'; } $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 '<tr><td colspan="2" style="text-align : center;">'; echo '<form method="post" action="generer_notifications_par_lot.php">'; echo '<input type="hidden" name="menu" value="' . $menu . '"/>'; echo '<p>';
/** * Gets the number of AbsenceEleveNotification objects related by a many-to-many relationship * to the current object by way of the j_notifications_resp_pers cross-reference table. * * @param Criteria $criteria Optional query object to filter the query * @param boolean $distinct Set to true to force count distinct * @param PropelPDO $con Optional connection object * * @return int the number of related AbsenceEleveNotification objects */ public function countAbsenceEleveNotifications($criteria = null, $distinct = false, PropelPDO $con = null) { if(null === $this->collAbsenceEleveNotifications || null !== $criteria) { if ($this->isNew() && null === $this->collAbsenceEleveNotifications) { return 0; } else { $query = AbsenceEleveNotificationQuery::create(null, $criteria); if($distinct) { $query->distinct(); } return $query ->filterByResponsableEleve($this) ->count($con); } } else { return count($this->collAbsenceEleveNotifications); } }
/** * If this collection has already been initialized with * an identical criteria, it returns the collection. * Otherwise if this Adresse is new, it will return * an empty collection; or if this Adresse has previously * been saved, it will retrieve related AbsenceEleveNotifications from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you * actually need in Adresse. * * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return PropelCollection|array AbsenceEleveNotification[] List of AbsenceEleveNotification objects */ public function getAbsenceEleveNotificationsJoinAbsenceEleveTraitement($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $query = AbsenceEleveNotificationQuery::create(null, $criteria); $query->joinWith('AbsenceEleveTraitement', $join_behavior); return $this->getAbsenceEleveNotifications($query, $con); }
for($i=0; $i<$nb; $i++) { if (isset($_POST["select_notification"][$i])) { $id_notif_col->add($_POST["select_notification"][$i]); } } if ($id_notif_col->isEmpty() && isset($_SESSION['id_notif_col'])) { $id_notif_col = $_SESSION['id_notif_col']; } if (isset($_GET['retirer_id_notification'])) { $key = $id_notif_col->search($_GET['retirer_id_notification']); if ($key !== false) { $id_notif_col->remove($key); } } $_SESSION['id_notif_col'] = $id_notif_col; $notifications_col = AbsenceEleveNotificationQuery::create()->filterByPrimaryKeys($id_notif_col)->find(); if (isset ($_POST['valide']) && ('confirmer' == $_POST['valide'])) { $_SESSION['compile'] = isset ($_POST['compile']) ? $_POST['compile'] : FALSE; } $_SESSION['compile'] = isset ($_SESSION['compile']) ? $_SESSION['compile'] : TRUE; // //on imprime les courriers par lot // if (isset($_GET['envoyer_courrier']) && $_GET['envoyer_courrier'] == 'true') { $courrier_recap_col = new PropelCollection(); $courrier_nouvellement_envoyés_col = new PropelCollection(); // load the TinyButStrong libraries
echo '<input type="hidden" name="id_notification" value="' . $notification->getPrimaryKey() . '"/>'; if ($notification->getTypeNotification() == AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_COURRIER) { echo '<button type="submit" onclick=\'window.open("generer_notification.php?id_notification=' . $notification->getPrimaryKey() . '"); setTimeout("window.location = \\"visu_notification.php\\"", 1000); return false;\'>Génerer la notification</button>'; } 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 '<button type="submit">Générer la notification</button>'; } } echo '</p>'; echo '</form>'; echo '</td></tr>'; } $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 '<tr><td colspan="2" style="text-align : center;">'; echo '<form method="post" action="generer_notifications_par_lot.php">'; echo '<input type="hidden" name="menu" value="' . $menu . '"/>'; echo '<p>'; foreach ($idNotifications as $id) { echo '<input type="hidden" name="select_notification[]" value="' . $id . '"/>';
include 'include_pagination.php'; //============================================== $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"; $titre_page = "Les absences"; $utilisation_jsdivdrag = "non"; $_SESSION['cacher_header'] = "y"; $dojo = true; require_once "../lib/header.inc.php"; //**************** FIN EN-TETE ***************** include 'menu_abs2.inc.php'; echo "<div class='css-panes' style='background-color:#c7e3ec;' id='containDiv' style='overflow : none; float : left; margin-top : -1px; border-width : 1px;'>\n"; $query = AbsenceEleveNotificationQuery::create(); if (isFiltreRechercheParam('filter_notification_id')) { $query->filterById(getFiltreRechercheParam('filter_notification_id')); } if (isFiltreRechercheParam('filter_utilisateur')) { $query->useUtilisateurProfessionnelQuery()->filterByNom('%' . getFiltreRechercheParam('filter_utilisateur') . '%', Criteria::LIKE)->endUse(); } if (isFiltreRechercheParam('filter_eleve')) { $query->useAbsenceEleveTraitementQuery()->useJTraitementSaisieEleveQuery()->useAbsenceEleveSaisieQuery()->useEleveQuery()->filterByNomOrPrenomLike(getFiltreRechercheParam('filter_eleve'))->endUse()->endUse()->endUse()->endUse(); } // filtre classe // $classe = ClasseQuery::create()->filterByNom("6 D")->findOne(); //$id_classe = 14; //$classe = ClasseQuery::create()->findPk($id_classe); if (isFiltreRechercheParam('filter_classe')) { if (in_array('SANS', getFiltreRechercheParam('filter_classe'))) {
/** * Get the associated AbsenceEleveNotification object * * @param PropelPDO Optional Connection object. * @return AbsenceEleveNotification The associated AbsenceEleveNotification object. * @throws PropelException */ public function getAbsenceEleveNotification(PropelPDO $con = null) { if ($this->aAbsenceEleveNotification === null && ($this->a_notification_id !== null)) { $this->aAbsenceEleveNotification = AbsenceEleveNotificationQuery::create()->findPk($this->a_notification_id, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. $this->aAbsenceEleveNotification->addJNotificationResponsableEleves($this); */ } return $this->aAbsenceEleveNotification; }
/** * Removes this object from datastore and sets delete attribute. * * @param PropelPDO $con * @return void * @throws PropelException * @see BaseObject::setDeleted() * @see BaseObject::isDeleted() */ public function delete(PropelPDO $con = null) { if ($this->isDeleted()) { throw new PropelException("This object has already been deleted."); } if ($con === null) { $con = Propel::getConnection(AbsenceEleveNotificationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); } $con->beginTransaction(); try { $deleteQuery = AbsenceEleveNotificationQuery::create() ->filterByPrimaryKey($this->getPrimaryKey()); $ret = $this->preDelete($con); if ($ret) { $deleteQuery->delete($con); $this->postDelete($con); $con->commit(); $this->setDeleted(true); } else { $con->commit(); } } catch (Exception $e) { $con->rollBack(); throw $e; } }