$where = array("patient_id" => $patient->getDS()->prepareIn($patient_ids)); /** @var CPatient[] $patients */ $patients = $patient->loadList($where); $patient_count = count($patients); } CAppUI::stepAjax("%d patients à exporter", UI_MSG_OK, $patient_total); //$date = CMbDT::format(null, "%Y-%m-%d_%H-%M-%S"); $date = CMbDT::format(null, "%Y-%m-%d"); foreach ($patients as $_patient) { try { $dir = "{$directory}/export-{$date}/{$_patient->_guid}"; if (is_dir($dir)) { continue; } CMbPath::forceDir($dir); $export = new CMbObjectExport($_patient, $backrefs_tree); $callback = function (CStoredObject $object, $node, $depth) use($export, $dir, $ignore_files, $generate_pdfpreviews) { switch ($object->_class) { case "CCompteRendu": /** @var CCompteRendu $object */ if ($generate_pdfpreviews) { $object->makePDFpreview(true); } break; case "CFile": if ($ignore_files) { break; } /** @var CFile $object */ $_dir = "{$dir}/{$object->object_class}/{$object->object_id}"; CMbPath::forceDir($_dir);
<?php /** * $Id: export_ex_class.php 24597 2014-08-28 15:04:09Z phenxdesign $ * * @package Mediboard * @subpackage Forms * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 24597 $ */ $ex_class_id = CValue::get("ex_class_id"); $ex_class = new CExClass(); $ex_class->load($ex_class_id); try { $backrefs_tree = array("CExClass" => array("field_groups"), "CExClassFieldGroup" => array("class_fields", "host_fields", "class_messages", "subgroups"), "CExClassField" => array("field_translations", "list_items", "properties", "predicates"), "CExList" => array("list_items"), "CExClassMessage" => array("properties"), "CExClassFieldPredicate" => array("properties"), "CExClassFieldSubgroup" => array("properties"), "CExClassFieldProperties" => array()); $fwdrefs_tree = array("CExClassFieldGroup" => array("ex_class_id"), "CExClassField" => array("ex_group_id", "concept_id", "predicate_id", "subgroup_id"), "CExClassMessage" => array("ex_group_id", "subgroup_id", "predicate_id"), "CExClassHostField" => array("ex_group_id"), "CExClassFieldTranslation" => array("ex_class_field_id"), "CExConcept" => array("ex_list_id"), "CExListItem" => array("list_id", "concept_id", "field_id"), "CExClassFieldProperty" => array("predicate_id", "object_id"), "CExClassFieldPredicate" => array("ex_class_field_id"), "CExClassFieldSubgroup" => array("predicate_id", "parent_id")); $export = new CMbObjectExport($ex_class, $backrefs_tree); $export->setForwardRefsTree($fwdrefs_tree); } catch (CMbException $e) { $e->stepAjax(UI_MSG_ERROR); } $export->streamXML();
<?php /** * $Id$ * * @package Mediboard * @subpackage System * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ $object_guid = CValue::get("object_guid"); $remove_empty_values = CValue::get("remove_empty_values"); $object = CMbObject::loadFromGuid($object_guid); try { $export = new CMbObjectExport($object); } catch (CMbException $e) { $e->stepAjax(UI_MSG_ERROR); } $export->empty_values = !$remove_empty_values; $export->streamXML();