} else {
    if ($modif == 'statut') {
        $notification->setStatutEnvoi($_POST["statut"]);
    } else {
        if ($modif == 'commentaire') {
            $notification->setCommentaire($_POST["commentaire"]);
        } elseif ($modif == 'enlever_responsable') {
            if (0 != JNotificationResponsableEleveQuery::create()->filterByAbsenceEleveNotification($notification)->filterByResponsableEleveId($_POST["pers_id"])->limit(1)->delete()) {
                $message_enregistrement .= '<span style="color:green">Responsable supprimé</span>';
            } else {
                $message_enregistrement .= '<span style="color:red">Suppression impossible</span>';
            }
            include "visu_notification.php";
            die;
        } elseif ($modif == 'ajout_responsable') {
            $responsable = ResponsableEleveQuery::create()->findOneByResponsableEleveId($_POST["pers_id"]);
            if ($responsable != null && !$notification->getResponsableEleves()->contains($responsable)) {
                $notification->addResponsableEleve($responsable);
                $notification->save();
                $message_enregistrement .= '<span style="color:green">Responsable ajouté</span>';
                include "visu_notification.php";
                die;
            }
        } elseif ($modif == 'email') {
            $notification->setEmail($_POST["email"]);
        } elseif ($modif == 'tel') {
            $notification->setTelephone($_POST["tel"]);
        } elseif ($modif == 'adresse') {
            $notification->setAdresseId($_POST["adr_id"]);
        } elseif ($modif == 'duplication') {
            $clone = $notification->copy();
Пример #2
0
	/**
	 * Returns the number of related ResponsableEleve objects.
	 *
	 * @param      Criteria $criteria
	 * @param      boolean $distinct
	 * @param      PropelPDO $con
	 * @return     int Count of related ResponsableEleve objects.
	 * @throws     PropelException
	 */
	public function countResponsableEleves(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
	{
		if(null === $this->collResponsableEleves || null !== $criteria) {
			if ($this->isNew() && null === $this->collResponsableEleves) {
				return 0;
			} else {
				$query = ResponsableEleveQuery::create(null, $criteria);
				if($distinct) {
					$query->distinct();
				}
				return $query
					->filterByAdresse($this)
					->count($con);
			}
		} else {
			return count($this->collResponsableEleves);
		}
	}
Пример #3
0
	/**
	 * Get the associated ResponsableEleve object
	 *
	 * @param      PropelPDO Optional Connection object.
	 * @return     ResponsableEleve The associated ResponsableEleve object.
	 * @throws     PropelException
	 */
	public function getResponsableEleve(PropelPDO $con = null)
	{
		if ($this->aResponsableEleve === null && (($this->pers_id !== "" && $this->pers_id !== null))) {
			$this->aResponsableEleve = ResponsableEleveQuery::create()->findPk($this->pers_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->aResponsableEleve->addResponsableInformations($this);
			 */
		}
		return $this->aResponsableEleve;
	}
Пример #4
0
	/**
	 * 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(ResponsableElevePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}

		$con->beginTransaction();
		try {
			$deleteQuery = ResponsableEleveQuery::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;
		}
	}
Пример #5
0
	/**
	 * Returns a new ResponsableEleveQuery object.
	 *
	 * @param     string $modelAlias The alias of a model in the query
	 * @param     Criteria $criteria Optional Criteria to build the query from
	 *
	 * @return    ResponsableEleveQuery
	 */
	public static function create($modelAlias = null, $criteria = null)
	{
		if ($criteria instanceof ResponsableEleveQuery) {
			return $criteria;
		}
		$query = new ResponsableEleveQuery();
		if (null !== $modelAlias) {
			$query->setModelAlias($modelAlias);
		}
		if ($criteria instanceof Criteria) {
			$query->mergeWith($criteria);
		}
		return $query;
	}