/** * Returns a new AbsenceEleveMotifQuery object. * * @param string $modelAlias The alias of a model in the query * @param Criteria $criteria Optional Criteria to build the query from * * @return AbsenceEleveMotifQuery */ public static function create($modelAlias = null, $criteria = null) { if ($criteria instanceof AbsenceEleveMotifQuery) { return $criteria; } $query = new AbsenceEleveMotifQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); } if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }
function ajoutMotifsParDefaut() { $motif = new AbsenceEleveMotif(); $motif->setNom("Médical"); $motif->setCommentaire("L'élève est absent pour raison médicale"); if (AbsenceEleveMotifQuery::create()->filterByNom($motif->getNom())->find()->isEmpty()) { $motif->save(); } $motif = new AbsenceEleveMotif(); $motif->setNom("Familial"); $motif->setCommentaire("L'élève est absent pour raison familiale"); if (AbsenceEleveMotifQuery::create()->filterByNom($motif->getNom())->find()->isEmpty()) { $motif->save(); } $motif = new AbsenceEleveMotif(); $motif->setNom("Sportive"); $motif->setCommentaire("L'élève est absent pour cause de compétition sportive"); if (AbsenceEleveMotifQuery::create()->filterByNom($motif->getNom())->find()->isEmpty()) { $motif->save(); } }
} echo 'border-width:1px;" alt="" name="order" value="des_motif" onclick="this.form.order.value = this.value"/>'; echo '</span>'; echo '<br />'; echo 'Motif'; echo '<br />'; echo "<select name=\"filter_motif\" onchange='submit()'>"; echo "<option value=''></option>\n"; echo "<option value='SANS'"; if (getFiltreRechercheParam('filter_motif') == 'SANS') { echo " selected='selected' "; } echo ">"; echo 'SANS MOTIF'; echo "</option>\n"; foreach (AbsenceEleveMotifQuery::create()->orderByRank()->find() as $motif) { echo "<option value='" . $motif->getId() . "'"; if (getFiltreRechercheParam('filter_motif') === (string) $motif->getId()) { echo " selected='selected' "; } echo ">"; echo $motif->getNom(); echo "</option>\n"; } echo "</select>"; echo '</th>'; //en tete justification d'absence echo '<th>'; echo '<span style="white-space: nowrap;"> '; //echo '<nobr>'; echo '<input type="image" src="../images/up.png" title="monter" style="vertical-align: middle;width:15px; height:15px; ';
$message_enregistrement = ''; $traitement = AbsenceEleveTraitementQuery::create()->findPk($id_traitement); if ($traitement == null) { $message_enregistrement .= '<span style="color:red">Modification impossible : traitement non trouvée.</span>'; include "visu_traitement.php"; die; } //debug_var(); if ($modif == 'type') { $traitement->setAbsenceEleveType(AbsenceEleveTypeQuery::create()->findPk($_POST["id_type"])); } elseif ($modif == 'commentaire') { $traitement->setCommentaire($_POST["commentaire"]); } elseif ($modif == 'justification') { $traitement->setAbsenceEleveJustification(AbsenceEleveJustificationQuery::create()->findPk($_POST["id_justification"])); } elseif ($modif == 'motif') { $traitement->setAbsenceEleveMotif(AbsenceEleveMotifQuery::create()->findPk($_POST["id_motif"])); } elseif ($modif == 'enlever_saisie') { $j_saisie_traitement_col = JTraitementSaisieEleveQuery::create()->filterByAbsenceEleveTraitement($traitement)->filterByASaisieId($_POST["id_saisie"])->find(); $count_delete = $j_saisie_traitement_col->count(); foreach ($j_saisie_traitement_col as $j_saisie_traitement) { $j_saisie_traitement->delete(); } } elseif ($modif == 'supprimer') { $traitement->delete(); if ($menu) { include "visu_saisie.php"; } else { include "liste_traitements.php"; } die; } elseif ($modif == 'modifier_heures_saisies') {
echo " <form method='post' action='traitements_par_lots.php'> <fieldset style='border: 1px solid grey; background-image: url(\"../images/background/opacite50.png\");'> <input type='hidden' name='menu' value='".$menu."'/> <input type='hidden' name='creation_lot_traitements' value='yes'/> <input type='hidden' name='validation_creation_lot_traitements' value='yes'/> ".add_token_field(); for($loop=0;$loop<count($select_saisie);$loop++) { echo " <input type='hidden' name='select_saisie[]' value='".$select_saisie[$loop]."'/>"; } $motifs = AbsenceEleveMotifQuery::create()->orderByRank()->find(); $justifications = AbsenceEleveJustificationQuery::create()->orderByRank()->find(); $type_autorises = AbsenceEleveTypeStatutAutoriseQuery::create()->filterByStatut($utilisateur->getStatut())->useAbsenceEleveTypeQuery()->orderBySortableRank()->endUse()->find(); echo " <table class='normal'> <tr> <td>Type : </td> <td>"; if ($type_autorises->count() != 0) { echo " <p> <select name=\"id_type\" onchange='changement()'> <option value='-1'></option>"; $type_in_list = false; foreach ($type_autorises as $type) { echo "
$eleve_query->filterByNom('%' . $nom_eleve . '%'); } if ($id_eleve !== null && $id_eleve != '') { $eleve_query->filterById($id_eleve); } $eleve_query->where('Eleve.DateSortie<?','0') ->orWhere('Eleve.DateSortie is NULL') ->orWhere('Eleve.DateSortie>?', $dt_date_absence_eleve_debut->format('U')); $eleve_col = $eleve_query->orderByNom()->orderByPrenom()->distinct()->find(); if ($eleve_col->isEmpty()) { echo"<h2 class='no'>Aucun élève avec les paramètres sélectionnés n'a été trouvé.</h2>"; die(); } //recuperation des demi journéees d'absence if ($affichage_motifs) { $motifs_col = AbsenceEleveMotifQuery::create()->find(); $nbre_motifs = $motifs_col->count(); } if ($affichage != null && $affichage != '') { if ($affichage == 'html') { ?> <div style="width:300px" id="chargement" > </div> <?php } $compteur = 0; $k = 0; $nombre_eleve_requete = $eleve_col->count(); $table_synchro_ok = AbsenceAgregationDecomptePeer::checkSynchroAbsenceAgregationTable($dt_date_absence_eleve_debut,$dt_date_absence_eleve_fin); if (!$table_synchro_ok) {//la table n'est pas synchronisée. On va vérifier individuellement les élèves qui se sont pas synchronisés
/** * Get the associated AbsenceEleveMotif object * * @param PropelPDO Optional Connection object. * @return AbsenceEleveMotif The associated AbsenceEleveMotif object. * @throws PropelException */ public function getAbsenceEleveMotif(PropelPDO $con = null) { if ($this->aAbsenceEleveMotif === null && ($this->a_motif_id !== null)) { $this->aAbsenceEleveMotif = AbsenceEleveMotifQuery::create()->findPk($this->a_motif_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->aAbsenceEleveMotif->addAbsenceEleveTraitements($this); */ } return $this->aAbsenceEleveMotif; }
<?php } ?> <a href="admin_motifs_absences.php?action=ajouter"><img src='../../images/icons/add.png' alt='' class='back_link' /> Ajouter un motif</a> <br/><br/> <a href="admin_motifs_absences.php?action=ajouterdefaut<?php echo add_token_in_url();?>"><img src='../../images/icons/add.png' alt='' class='back_link' /> Ajouter les motifs par défaut</a> <br/><br/> <table cellpadding="0" cellspacing="1" class="menu"> <tr> <td>Nom</td> <td>Commentaire</td> <td style="width: 25px;"></td> <td style="width: 25px;"></td> </tr> <?php $motif_collection = new PropelCollection(); $motif_collection = AbsenceEleveMotifQuery::create()->findList(); $motif = new AbsenceEleveMotif(); $i = '1'; foreach ($motif_collection as $motif) { ?> <tr> <td><?php echo $motif->getNom(); ?></td> <td><?php echo $motif->getCommentaire(); ?></td> <td><a href="admin_motifs_absences.php?action=modifier&id_motif=<?php echo $motif->getId(); echo add_token_in_url();?>"><img src="../../images/icons/configure.png" title="Modifier" border="0" alt="" /></a></td> <td><a href="admin_motifs_absences.php?action=supprimer&id_motif=<?php echo $motif->getId(); echo add_token_in_url();?>" onClick="return confirm('Etes-vous sûr de vouloir supprimer ce motif ?')"><img src="../../images/icons/delete.png" width="22" height="22" title="Supprimer" border="0" alt="" /></a></td> <td><a href="admin_motifs_absences.php?action=monter&id_motif=<?php echo $motif->getId(); echo add_token_in_url();?>"><img src="../../images/up.png" width="22" height="22" title="monter" border="0" alt="" /></a></td> <td><a href="admin_motifs_absences.php?action=descendre&id_motif=<?php echo $motif->getId(); echo add_token_in_url();?>"><img src="../../images/down.png" width="22" height="22" title="descendre" border="0" alt="" /></a></td> </tr> <?php } ?> </table> <br/><br/> </div>
/** * Move the object to the bottom of the list * * @param PropelPDO $con optional connection * * @return integer the old object's rank */ public function moveToBottom(PropelPDO $con = null) { if ($this->isLast($con)) { return false; } if ($con === null) { $con = Propel::getConnection(AbsenceEleveMotifPeer::DATABASE_NAME); } $con->beginTransaction(); try { $bottom = AbsenceEleveMotifQuery::create()->getMaxRank($con); $res = $this->moveToRank($bottom, $con); $con->commit(); return $res; } catch (Exception $e) { $con->rollback(); throw $e; } }
// on ajoute le motif au besoin if (isset ($_POST["type_motif_eleve"])) { $traitement->setAbsenceEleveMotif(AbsenceEleveMotifQuery::create()->findPk($_POST["type_motif_eleve"])); } $traitement->save(); $notification->save(); } /* */ } else { $traitement->addAbsenceEleveSaisie($saisie); // on ajoute le motif au besoin if (isset ($_POST["type_motif_eleve"])) { $traitement->setAbsenceEleveMotif(AbsenceEleveMotifQuery::create()->findPk($_POST["type_motif_eleve"])); $traitement->save(); } } } } // On récupère les valeurs