Ejemplo n.º 1
0
echo 'border-width:1px;" alt="" name="order" value="des_notification" onclick="this.form.order.value = this.value"/>';
echo '</span>';
echo '<br/>';
echo 'Notification';
echo '<br />';
echo "<select name=\"filter_statut_notification\" onchange='submit()'>";
echo "<option value=''></option>\n";
echo "<option value='SANS'";
if (getFiltreRechercheParam('filter_statut_notification') == 'SANS') {
    echo " selected='selected' ";
}
echo ">";
echo 'SANS NOTIFICATION';
echo "</option>\n";
$i = 0;
foreach (AbsenceEleveNotificationPeer::getValueSet(AbsenceEleveNotificationPeer::STATUT_ENVOI) as $status) {
    echo "<option value='{$status}'";
    if (getFiltreRechercheParam('filter_statut_notification') === $status) {
        echo 'selected';
    }
    echo ">" . $status . "</option>\n";
}
echo "</select>";
echo '</th>';
//en tete filtre date creation
echo '<th>';
echo '<span style="white-space: nowrap;"> ';
//echo '<nobr>';
echo 'Date création';
echo '<input type="image" src="../images/up.png" title="monter" style="vertical-align: middle;width:15px; height:15px; ';
if ($order == "asc_date_creation") {
	/**
	 * This is a method for emulating ON DELETE CASCADE for DBs that don't support this
	 * feature (like MySQL or SQLite).
	 *
	 * This method is not very speedy because it must perform a query first to get
	 * the implicated records and then perform the deletes by calling those Peer classes.
	 *
	 * This method should be used within a transaction if possible.
	 *
	 * @param      Criteria $criteria
	 * @param      PropelPDO $con
	 * @return     int The number of affected rows (if supported by underlying database driver).
	 */
	protected static function doOnDeleteCascade(Criteria $criteria, PropelPDO $con)
	{
		// initialize var to track total num of affected rows
		$affectedRows = 0;

		// first find the objects that are implicated by the $criteria
		$objects = AbsenceEleveTraitementPeer::doSelect($criteria, $con);
		foreach ($objects as $obj) {


			// delete related JTraitementSaisieEleve objects
			$criteria = new Criteria(JTraitementSaisieElevePeer::DATABASE_NAME);
			
			$criteria->add(JTraitementSaisieElevePeer::A_TRAITEMENT_ID, $obj->getId());
			$affectedRows += JTraitementSaisieElevePeer::doDelete($criteria, $con);

			// delete related AbsenceEleveNotification objects
			$criteria = new Criteria(AbsenceEleveNotificationPeer::DATABASE_NAME);
			
			$criteria->add(AbsenceEleveNotificationPeer::A_TRAITEMENT_ID, $obj->getId());
			$affectedRows += AbsenceEleveNotificationPeer::doDelete($criteria, $con);
		}
		return $affectedRows;
	}
	/**
	 * Filter the query on the statut_envoi column
	 *
	 * @param     mixed $statutEnvoi The value to use as filter
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    AbsenceEleveNotificationQuery The current query, for fluid interface
	 */
	public function filterByStatutEnvoi($statutEnvoi = null, $comparison = null)
	{
		$valueSet = AbsenceEleveNotificationPeer::getValueSet(AbsenceEleveNotificationPeer::STATUT_ENVOI);
		if (is_scalar($statutEnvoi)) {
			if (!in_array($statutEnvoi, $valueSet)) {
				throw new PropelException(sprintf('Value "%s" is not accepted in this enumerated column', $statutEnvoi));
			}
			$statutEnvoi = array_search($statutEnvoi, $valueSet);
		} elseif (is_array($statutEnvoi)) {
			$convertedValues = array();
			foreach ($statutEnvoi as $value) {
				if (!in_array($value, $valueSet)) {
					throw new PropelException(sprintf('Value "%s" is not accepted in this enumerated column', $value));
				}
				$convertedValues []= array_search($value, $valueSet);
			}
			$statutEnvoi = $convertedValues;
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
		}
		return $this->addUsingAlias(AbsenceEleveNotificationPeer::STATUT_ENVOI, $statutEnvoi, $comparison);
	}
Ejemplo n.º 4
0
	<tr>
		<td>
			Notification : 
		</td>
		<td>
			<table style='background-color:#c7e3ec;'>
				<tr>
					<td>
						Type de notification : 
					</td>
					<td>
						<p>
							<select name=\"type_notification\" onchange='changement()'>
								<option value=''>Aucune</option>";

foreach (AbsenceEleveNotificationPeer::getValueSet(AbsenceEleveNotificationPeer::TYPE_NOTIFICATION) as $type) {
	if ($type === AbsenceEleveNotificationPeer::TYPE_NOTIFICATION_SMS && (getSettingValue("abs2_sms") != 'y')) {
		//pas d'option sms
	}
	else {
		echo "
								<option value='$type' id='type_notification_".preg_replace("/[^A-zA-z0-9]/", "_", $type)."'>".$type."</option>";
	}
}
echo "
							</select>
						</p>
					</td>
				</tr>
				<tr>
					<td colspan='2'>
	/**
	 * Selects a collection of JNotificationResponsableEleve objects pre-filled with all related objects except ResponsableEleve.
	 *
	 * @param      Criteria  $criteria
	 * @param      PropelPDO $con
	 * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
	 * @return     array Array of JNotificationResponsableEleve objects.
	 * @throws     PropelException Any exceptions caught during processing will be
	 *		 rethrown wrapped into a PropelException.
	 */
	public static function doSelectJoinAllExceptResponsableEleve(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
	{
		$criteria = clone $criteria;

		// Set the correct dbName if it has not been overridden
		// $criteria->getDbName() will return the same object if not set to another value
		// so == check is okay and faster
		if ($criteria->getDbName() == Propel::getDefaultDB()) {
			$criteria->setDbName(self::DATABASE_NAME);
		}

		JNotificationResponsableElevePeer::addSelectColumns($criteria);
		$startcol2 = JNotificationResponsableElevePeer::NUM_HYDRATE_COLUMNS;

		AbsenceEleveNotificationPeer::addSelectColumns($criteria);
		$startcol3 = $startcol2 + AbsenceEleveNotificationPeer::NUM_HYDRATE_COLUMNS;

		$criteria->addJoin(JNotificationResponsableElevePeer::A_NOTIFICATION_ID, AbsenceEleveNotificationPeer::ID, $join_behavior);


		$stmt = BasePeer::doSelect($criteria, $con);
		$results = array();

		while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
			$key1 = JNotificationResponsableElevePeer::getPrimaryKeyHashFromRow($row, 0);
			if (null !== ($obj1 = JNotificationResponsableElevePeer::getInstanceFromPool($key1))) {
				// We no longer rehydrate the object, since this can cause data loss.
				// See http://www.propelorm.org/ticket/509
				// $obj1->hydrate($row, 0, true); // rehydrate
			} else {
				$cls = JNotificationResponsableElevePeer::getOMClass(false);

				$obj1 = new $cls();
				$obj1->hydrate($row);
				JNotificationResponsableElevePeer::addInstanceToPool($obj1, $key1);
			} // if obj1 already loaded

				// Add objects for joined AbsenceEleveNotification rows

				$key2 = AbsenceEleveNotificationPeer::getPrimaryKeyHashFromRow($row, $startcol2);
				if ($key2 !== null) {
					$obj2 = AbsenceEleveNotificationPeer::getInstanceFromPool($key2);
					if (!$obj2) {
	
						$cls = AbsenceEleveNotificationPeer::getOMClass(false);

					$obj2 = new $cls();
					$obj2->hydrate($row, $startcol2);
					AbsenceEleveNotificationPeer::addInstanceToPool($obj2, $key2);
				} // if $obj2 already loaded

				// Add the $obj1 (JNotificationResponsableEleve) to the collection in $obj2 (AbsenceEleveNotification)
				$obj2->addJNotificationResponsableEleve($obj1);

			} // if joined row is not null

			$results[] = $obj1;
		}
		$stmt->closeCursor();
		return $results;
	}
Ejemplo n.º 6
0
	/**
	 * Method to invalidate the instance pool of all tables related to resp_adr
	 * by a foreign key with ON DELETE CASCADE
	 */
	public static function clearRelatedInstancePool()
	{
		// Invalidate objects in ResponsableElevePeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		ResponsableElevePeer::clearInstancePool();
		// Invalidate objects in AbsenceEleveNotificationPeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		AbsenceEleveNotificationPeer::clearInstancePool();
	}
	/**
	 * Method to invalidate the instance pool of all tables related to utilisateurs
	 * by a foreign key with ON DELETE CASCADE
	 */
	public static function clearRelatedInstancePool()
	{
		// Invalidate objects in JGroupesProfesseursPeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		JGroupesProfesseursPeer::clearInstancePool();
		// Invalidate objects in JScolClassesPeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		JScolClassesPeer::clearInstancePool();
		// Invalidate objects in CahierTexteCompteRenduPeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		CahierTexteCompteRenduPeer::clearInstancePool();
		// Invalidate objects in CahierTexteTravailAFairePeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		CahierTexteTravailAFairePeer::clearInstancePool();
		// Invalidate objects in CahierTexteNoticePriveePeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		CahierTexteNoticePriveePeer::clearInstancePool();
		// Invalidate objects in JEleveCpePeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		JEleveCpePeer::clearInstancePool();
		// Invalidate objects in JEleveProfesseurPrincipalPeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		JEleveProfesseurPrincipalPeer::clearInstancePool();
		// Invalidate objects in JAidUtilisateursProfessionnelsPeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		JAidUtilisateursProfessionnelsPeer::clearInstancePool();
		// Invalidate objects in AbsenceEleveNotificationPeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		AbsenceEleveNotificationPeer::clearInstancePool();
		// Invalidate objects in PreferenceUtilisateurProfessionnelPeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		PreferenceUtilisateurProfessionnelPeer::clearInstancePool();
		// Invalidate objects in EdtEmplacementCoursPeer instance pool,
		// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
		EdtEmplacementCoursPeer::clearInstancePool();
	}
Ejemplo n.º 8
0
	/**
	 * Populates the object using an array.
	 *
	 * This is particularly useful when populating an object from one of the
	 * request arrays (e.g. $_POST).  This method goes through the column
	 * names, checking to see whether a matching key exists in populated
	 * array. If so the setByName() method is called for that column.
	 *
	 * You can specify the key type of the array by additionally passing one
	 * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
	 * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
	 * The default key type is the column's phpname (e.g. 'AuthorId')
	 *
	 * @param      array  $arr     An array to populate the object from.
	 * @param      string $keyType The type of keys the array uses.
	 * @return     void
	 */
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = AbsenceEleveNotificationPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setUtilisateurId($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setATraitementId($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setTypeNotification($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setEmail($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setTelephone($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setAdresseId($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setCommentaire($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setStatutEnvoi($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setDateEnvoi($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setErreurMessageEnvoi($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setCreatedAt($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setUpdatedAt($arr[$keys[12]]);
	}
	/**
	 * Retrieve multiple objects by pkey.
	 *
	 * @param      array $pks List of primary keys
	 * @param      PropelPDO $con the connection to use
	 * @throws     PropelException Any exceptions caught during processing will be
	 *		 rethrown wrapped into a PropelException.
	 */
	public static function retrieveByPKs($pks, PropelPDO $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(AbsenceEleveNotificationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

		$objs = null;
		if (empty($pks)) {
			$objs = array();
		} else {
			$criteria = new Criteria(AbsenceEleveNotificationPeer::DATABASE_NAME);
			$criteria->add(AbsenceEleveNotificationPeer::ID, $pks, Criteria::IN);
			$objs = AbsenceEleveNotificationPeer::doSelect($criteria, $con);
		}
		return $objs;
	}