} } else { $_POST["_source"] = $modele->generateDocFromModel($_POST["_source"], $header_id, $footer_id); } } else { // Document existant $cr = new CCompteRendu(); $cr->load($_POST["compte_rendu_id"]); if (!$cr->header_id && !$cr->footer_id && !$header_id && !$footer_id) { $_POST["_source"] = $cr->generateDocFromModel($_POST["_source"], $header_id, $footer_id); } else { if ($header_id != $cr->header_id) { $_POST["_source"] = CCompteRendu::replaceComponent($_POST["_source"], $header_id); } if ($footer_id != $cr->footer_id) { $_POST["_source"] = CCompteRendu::replaceComponent($_POST["_source"], $footer_id, "footer"); } } } } // Application des listes de choix $fields = array(); $values = array(); if (isset($_POST["_CListeChoix"])) { $listes = $_POST["_CListeChoix"]; foreach ($listes as $list_id => $options) { $options = array_map(array('CMbString', 'htmlEntities'), $options); $list = new CListeChoix(); $list->load($list_id); $is_empty = false; if ($check_to_empty_field && isset($_POST["_empty_list"][$list_id]) || !$check_to_empty_field && !isset($_POST["_empty_list"][$list_id])) {