Beispiel #1
0
function initLieuEtab(){
    $lieu_etab=AbsenceEleveLieuQuery::create()->filterByNom("Etablissement")->findOne();
    if(is_null($lieu_etab)){
       $lieu_etab= new AbsenceEleveLieu();
       $lieu_etab->setNom("Etablissement");
       $lieu_etab->setCommentaire("L'élève est dans l'enceinte de l'établissement");
       $lieu_etab->save();
    }
    return($lieu_etab->getId());
}
	/**
	 * Filter the query by a related AbsenceEleveLieu object
	 *
	 * @param     AbsenceEleveLieu|PropelCollection $absenceEleveLieu The related object(s) to use as filter
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    AbsenceEleveSaisieQuery The current query, for fluid interface
	 */
	public function filterByAbsenceEleveLieu($absenceEleveLieu, $comparison = null)
	{
		if ($absenceEleveLieu instanceof AbsenceEleveLieu) {
			return $this
				->addUsingAlias(AbsenceEleveSaisiePeer::ID_LIEU, $absenceEleveLieu->getId(), $comparison);
		} elseif ($absenceEleveLieu instanceof PropelCollection) {
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
			return $this
				->addUsingAlias(AbsenceEleveSaisiePeer::ID_LIEU, $absenceEleveLieu->toKeyValue('PrimaryKey', 'Id'), $comparison);
		} else {
			throw new PropelException('filterByAbsenceEleveLieu() only accepts arguments of type AbsenceEleveLieu or PropelCollection');
		}
	}
	/**
	 * Declares an association between this object and a AbsenceEleveLieu object.
	 *
	 * @param      AbsenceEleveLieu $v
	 * @return     AbsenceEleveSaisie The current object (for fluent API support)
	 * @throws     PropelException
	 */
	public function setAbsenceEleveLieu(AbsenceEleveLieu $v = null)
	{
		if ($v === null) {
			$this->setIdLieu(NULL);
		} else {
			$this->setIdLieu($v->getId());
		}

		$this->aAbsenceEleveLieu = $v;

		// Add binding for other direction of this n:n relationship.
		// If this object has already been added to the AbsenceEleveLieu object, it will not be re-added.
		if ($v !== null) {
			$v->addAbsenceEleveSaisie($this);
		}

		return $this;
	}
Beispiel #4
0
	/**
	 * Exchange the rank of the object with the one passed as argument, and saves both objects
	 *
	 * @param     AbsenceEleveLieu $object
	 * @param     PropelPDO $con optional connection
	 *
	 * @return    AbsenceEleveLieu the current object
	 *
	 * @throws Exception if the database cannot execute the two updates
	 */
	public function swapWith($object, PropelPDO $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(AbsenceEleveLieuPeer::DATABASE_NAME);
		}
		$con->beginTransaction();
		try {
			$oldRank = $this->getSortableRank();
			$newRank = $object->getSortableRank();
			$this->setSortableRank($newRank);
			$this->save($con);
			$object->setSortableRank($oldRank);
			$object->save($con);
			$con->commit();
	
			return $this;
		} catch (Exception $e) {
			$con->rollback();
			throw $e;
		}
	}
Beispiel #5
0
	<a href="admin_lieux_absences.php?action=ajouter"><img src='../../images/icons/add.png' alt='' class='back_link' /> Ajouter un lieu</a>
	<br/><br/>
	<a href="admin_lieux_absences.php?action=ajouterdefaut<?php echo add_token_in_url();?>"><img src='../../images/icons/add.png' alt='' class='back_link' /> Ajouter les lieux 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
    $lieu_collection = new PropelCollection();
    $lieu_collection = AbsenceEleveLieuQuery::create()->findList();
    $lieu = new AbsenceEleveLieu();
    $i = '1';
    foreach ($lieu_collection as $lieu) { ?>
        <tr>
	  <td><?php echo $lieu->getNom(); ?></td>
	  <td><?php echo $lieu->getCommentaire(); ?></td>
          <td><a href="admin_lieux_absences.php?action=modifier&amp;id_lieu=<?php echo $lieu->getId(); echo add_token_in_url();?>"><img src="../../images/icons/configure.png" title="Modifier" border="0" alt="" /></a></td>
          <td><a href="admin_lieux_absences.php?action=supprimer&amp;id_lieu=<?php echo $lieu->getId(); echo add_token_in_url();?>" onClick="return confirm('Etes-vous sûr de vouloir supprimer ce lieu ?')"><img src="../../images/icons/delete.png" width="22" height="22" title="Supprimer" border="0" alt="" /></a></td>
          <td><a href="admin_lieux_absences.php?action=monter&amp;id_lieu=<?php echo $lieu->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_lieux_absences.php?action=descendre&amp;id_lieu=<?php echo $lieu->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>
	/**
	 * Exclude object from result
	 *
	 * @param     AbsenceEleveLieu $absenceEleveLieu Object to remove from the list of results
	 *
	 * @return    AbsenceEleveLieuQuery The current query, for fluid interface
	 */
	public function prune($absenceEleveLieu = null)
	{
		if ($absenceEleveLieu) {
			$this->addUsingAlias(AbsenceEleveLieuPeer::ID, $absenceEleveLieu->getId(), Criteria::NOT_EQUAL);
		}

		return $this;
	}