/** * Export to DOM * * @return CMbXMLDocument */ function toDOM() { $this->doc = new CMbXMLDocument("utf-8"); $this->doc->formatOutput = true; $root = $this->doc->createElement("mediboard-export"); $root->setAttribute("date", CMbDT::dateTime()); $root->setAttribute("root", $this->object->_guid); $this->doc->appendChild($root); $this->_toDOM($this->object, $this->depth); return $this->doc; }
* @version $Revision$ * @link http://www.mediboard.org */ CCanDo::checkRead(); $modeles_ids = CView::post("modeles_ids", "str"); $object_class = CView::post("object_class", "str"); $owner = CView::post("owner", "str"); CView::checkin(); $modeles_ids = explode("-", $modeles_ids); CMbArray::removeValue(array(), $modeles_ids); if (!count($modeles_ids)) { CAppUI::stepMessage("Aucun modèle à exporter"); CApp::rip(); } $doc = new CMbXMLDocument(null); $root = $doc->createElement("modeles"); $doc->appendChild($root); $where = array("compte_rendu_id" => CSQLDataSource::prepareIn($modeles_ids)); // Récupération des header_id, footer_id, preface_id et ending_id $ds = CSQLDataSource::get("std"); $request = new CRequest(); $request->addTable("compte_rendu"); $request->addWhere($where); $components_ids = array(); foreach (array("header_id", "footer_id", "preface_id", "ending_id") as $_component) { $request->select = array(); $request->addSelect($_component); $components_ids = array_merge($components_ids, $ds->loadColumn($request->makeSelect())); } $modeles_ids = array_unique(array_merge($components_ids, $modeles_ids)); CMbArray::removeValue("", $modeles_ids);
* $Id$ * * @category Modèles * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ * @link http://www.mediboard.org */ CCanDo::checkRead(); $modele_id = CValue::get("modele_id"); $modele = new CCompteRendu(); $modele->load($modele_id); $modele->loadContent(true); $doc = new CMbXMLDocument(null); $root = $doc->createElement("CCompteRendu"); $doc->appendChild($root); foreach (CCompteRendu::$fields_import_export as $_field) { ${$_field} = $doc->createElement($_field); $textnode = $doc->createTextNode(utf8_encode($modele->{$_field})); ${$_field}->appendChild($textnode); $root->appendChild(${$_field}); } // Attribut modele_id $key = $doc->createAttribute("modele_id"); $value = $doc->createTextNode($modele->_id); $key->appendChild($value); $root->appendChild($key); // Catégorie $cat = $modele->loadRefCategory(); $key = $doc->createAttribute("cat");