/**
	 * Performs the work of inserting or updating the row in the database.
	 *
	 * If the object is new, it inserts it; otherwise an update is performed.
	 * All related objects are also updated in this method.
	 *
	 * @param      PropelPDO $con
	 * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
	 * @throws     PropelException
	 * @see        save()
	 */
	protected function doSave(PropelPDO $con)
	{
		$affectedRows = 0; // initialize var to track total num of affected rows
		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;

			// We call the save method on the following object(s) if they
			// were passed to this object by their coresponding set
			// method.  This object relates to these object(s) by a
			// foreign key reference.

			if ($this->aCahierTexteTravailAFaire !== null) {
				if ($this->aCahierTexteTravailAFaire->isModified() || $this->aCahierTexteTravailAFaire->isNew()) {
					$affectedRows += $this->aCahierTexteTravailAFaire->save($con);
				}
				$this->setCahierTexteTravailAFaire($this->aCahierTexteTravailAFaire);
			}

			if ($this->isNew() || $this->isModified()) {
				// persist changes
				if ($this->isNew()) {
					$this->doInsert($con);
				} else {
					$this->doUpdate($con);
				}
				$affectedRows += 1;
				$this->resetModified();
			}

			$this->alreadyInSave = false;

		}
		return $affectedRows;
	} // doSave()
Beispiel #2
0
echo "<a href=\"javascript:insere_texte_dans_ckeditor(document.getElementById('div_tableau_eleves').innerHTML)\" title='Insérer un tableau de la liste des élèves dans le texte de la notice'><img src='../images/icons/tableau.png' width='16' height='16' alt='Insérer un tableau de la liste des élèves dans le texte de la notice' /></a>";
//echo "<br><br>\n";
echo "<br />\n";
// Retour aux notices d'aujourd'hui:
$timestamp_du_jour = mktime(0, 0, 0, date('n'), date('j'), date('Y'));
if ($timestamp_du_jour != $today) {
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button style='background-color:" . $color_fond_notices['c'] . "' onclick=\"javascript:\n\t\t\t\t\t\t\tgetWinEditionNotice().setAjaxContent('./ajax_edition_compte_rendu.php?id_groupe='+ " . $groupe->getId() . " + '&today='+{$timestamp_du_jour},{ onComplete:function(transport) {initWysiwyg();updateCalendarWithUnixDate({$timestamp_du_jour})}});\n\t\t\t\t\t\t\tobject_en_cours_edition = 'compte_rendu';\n\t\t\t\t\t\t\">CR : Retour au " . date('d') . "/" . date('m') . "</button>\n";
}
//echo "\$timestamp_du_jour=$timestamp_du_jour<br />";
//echo "\$today=$today<br />";
echo "<br />\n";
//==============================================
//fin affichage des groupes
echo "<fieldset style=\"border: 1px solid grey; padding-top: 8px; padding-bottom: 8px;  margin-left: auto; margin-right: auto; background: " . $color_fond_notices[$type_couleur] . ";\">\n";
echo "<legend style=\"border: 1px solid grey; background: " . $color_fond_notices[$type_couleur] . "; font-variant: small-caps;\"> Travaux Personnels \n";
if (!$ctTravailAFaire->isNew()) {
    echo " - <b><font color=\"red\">Modification de la notice</font></b>\n";
    echo " - \n\t\t\t<a href=\"#\" onclick=\"javascript:\n\t\t\t\tgetWinEditionNotice().setAjaxContent('ajax_edition_devoir.php?id_groupe=" . $groupe->getId() . "&today=" . $ctTravailAFaire->getDateCt() . "&ajout_nouvelle_notice=oui',\n\t\t\t\t\t{ onComplete:\n\t\t\t\t\t\tfunction(transport) {\n\t\t\t\t\t\t\tgetWinEditionNotice().updateWidth();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn false;\n\t\t\t\">\n\t\t\tAjouter une notice\n\t\t\t</a> - \n";
    echo " - <a href=\"#\" onclick=\"javascript:\n\t\t\t\t\$('dupplication_notice').show();\n\t\t\t\tnew Ajax.Updater(\$('dupplication_notice'), 'ajax_affichage_duplication_notice.php?id_groupe=" . $groupe->getId() . "&type=CahierTexteTravailAFaire&id_ct=" . $ctTravailAFaire->getIdCt() . "',\n\t\t\t\t\t{ onComplete:\n\t\t\t\t\t\tfunction(transport) {\n\t\t\t\t\t\t\tcalendarDuplicationInstanciation = Calendar.setup({\n\t\t\t\t\t\t\t\t\tflat         : 'calendar-duplication-container', // ID of the parent element\n\t\t\t\t\t\t\t\t\tdaFormat     : '%s' ,   \t\t\t   //date format\n\t\t\t\t\t\t\t\t\tweekNumbers  : false\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tcalendarDuplicationInstanciation.setDate(calendarInstanciation.date);\n\t\t\t\t\t\t\t\$('dupplication_notice').show();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn false;\n\t\t\t\t\">\n\t\tDupliquer la notice</a> - \n";
} else {
    echo " - <b><font color=\"red\">Nouvelle notice</font></b> - \n";
}
echo "<a href=\"#\" onclick=\"javascript:\n\t\t\tnew Ajax.Updater(\$('deplacement_notice'), 'ajax_affichage_deplacement_notice.php?id_groupe=" . $groupe->getId() . "&type=CahierTexteTravailAFaire&id_ct=" . $ctTravailAFaire->getIdCt() . "',\n\t\t\t\t{ onComplete:\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\$('deplacement_notice').show();\n\t\t\t\t\t\tcalendarDeplacementInstanciation = null;";
if (!isset($info)) {
    //on affiche le calendrier de duplication uniquement si ce n'est pas une notice d'information generale
    echo "calendarDeplacementInstanciation = Calendar.setup({\n\t\t\t\t\t\t\t\t\tflat         : 'calendar-deplacement-container', // ID of the parent element\n\t\t\t\t\t\t\t\t\tdaFormat     : '%s' ,   \t\t\t   //date format\n\t\t\t\t\t\t\t\t\tweekNumbers  : false\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tcalendarDeplacementInstanciation.setDate(calendarInstanciation.date);";
}
echo "\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn false;\n\t\t\t\">\n\tDeplacer la notice</a>\n";
//il faut échapper les single quote pour le contenu à importer
$contenu_a_copier = isset($_SESSION['ct_a_importer']) ? $_SESSION['ct_a_importer']->getContenu() : '';
echo " <a href=\"#\" onclick=\"javascript: /*contenu_a_copier est globale*/\n    if (window.contenu_a_copier == undefined) {\n        contenu_a_copier = '" . addslashes(htmlspecialchars($contenu_a_copier)) . "';\n    }\n    CKEDITOR.instances['contenu'].insertHtml(contenu_a_copier);";