/** * 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->aCahierTexteCompteRendu !== null) { if ($this->aCahierTexteCompteRendu->isModified() || $this->aCahierTexteCompteRendu->isNew()) { $affectedRows += $this->aCahierTexteCompteRendu->save($con); } $this->setCahierTexteCompteRendu($this->aCahierTexteCompteRendu); } 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()
$volume_cdt_groupe_h = volume_human($volume_cdt_groupe); $info_volume = $volume_cdt_groupe_cr_h . "/" . $volume_cdt_groupe_h; //mb_strlen($info_volume) echo "<div style='float:right; width:10em; text-align:center; background: " . $color_fond_notices[$type_couleur] . ";' title=\"Les documents joints aux compte-rendus occupent {$volume_cdt_groupe_cr_h} sur un total de {$volume_cdt_groupe_h} pour l'enseignement de " . $groupe->getName() . " " . $groupe->getDescriptionAvecClasses() . ".\">" . $info_volume . "</div>"; } } echo "<br /><br />\n"; // Nombre de notices pour ce jour : $num_notice = NULL; 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"; if (isset($info)) { echo "<legend style=\"border: 1px solid grey; background: " . $color_fond_notices[$type_couleur] . "; font-variant: small-caps;\"> Informations générales - " . $groupe->getNameAvecClasses(); } else { echo "<legend style=\"border: 1px solid grey; background: " . $color_fond_notices[$type_couleur] . "; font-variant: small-caps;\"> Compte rendu - " . $groupe->getNameAvecClasses(); } if (!$ctCompteRendu->isNew() || isset($info)) { echo " - <b><font color=\"red\">Modification de la notice</font></b> - \n\t\t\t<a href=\"#\" onclick=\"javascript:\n\t\t\t\tgetWinEditionNotice().setAjaxContent('ajax_edition_compte_rendu.php?id_groupe=" . $groupe->getId() . "&today=" . $ctCompteRendu->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\tcompte_rendu_en_cours_de_modification('aucun');\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\tnew Ajax.Updater(\$('dupplication_notice'), 'ajax_affichage_duplication_notice.php?id_groupe=" . $groupe->getId() . "&type=CahierTexteCompteRendu&id_ct=" . $ctCompteRendu->getIdCt() . "',\n\t\t\t\t\t{ onComplete:\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\$('dupplication_notice').show();\n\t\t\t\t\t\t\tcalendarDuplicationInstanciation = null;"; if (!isset($info)) { //on affiche le calendrier de duplication uniquement si ce n'est pas une notice d'information generale echo "calendarDuplicationInstanciation = Calendar.setup({\n\t\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\t\tdaFormat : '%s' , \t\t\t //date format\n\t\t\t\t\t\t\t\t\t\tweekNumbers : false\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tcalendarDuplicationInstanciation.setDate(calendarInstanciation.date);"; } echo "\t\t\t\t\t\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=CahierTexteCompteRendu&id_ct=" . $ctCompteRendu->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);"; }