3 require_once(
"./Modules/Category/classes/class.ilCategoryExporter.php");
4 require_once(
"./Services/Xml/classes/class.ilXmlWriter.php");
5 require_once(
"./Services/Export/classes/class.ilExport.php");
20 $writer->xmlStartTag(
"OrgUnits");
21 foreach($nodes as $orgu_ref_id){
26 $writer->xmlStartTag(
"OrgUnit", $attrs);
27 $writer->xmlElement(
"reference_id", null, $orgu->getRefId());
28 $writer->xmlElement(
"external_id", null, $orgu->getImportId());
29 $writer->xmlElement(
"title", null, $orgu->getTitle());
30 $writer->xmlElement(
"description", null, $orgu->getDescription());
31 $writer->xmlEndTag(
"OrgUnit");
33 $writer->xmlEndTag(
"OrgUnits");
37 public function simpleExportExcel($orgu_ref_id){
39 include_once
"./Services/Excel/classes/class.ilExcelUtils.php";
40 include_once
"./Services/Excel/classes/class.ilExcelWriterAdapter.php";
42 $workbook = $adapter->getWorkbook();
44 $worksheet = $workbook->addWorksheet();
47 $worksheet->write(0, 0,
"ou_id");
48 $worksheet->write(0, 1,
"ou_id_type");
49 $worksheet->write(0, 2,
"ou_parent_id");
50 $worksheet->write(0, 3,
"ou_parent_id_type");
51 $worksheet->write(0, 4,
"reference_id");
52 $worksheet->write(0, 5,
"external_id");
53 $worksheet->write(0, 6,
"title");
54 $worksheet->write(0, 7,
"description");
55 $worksheet->write(0, 8,
"action");
58 foreach($nodes as $node)
65 $worksheet->write(
$row, 0, $attrs[
"ou_id"]);
66 $worksheet->write(
$row, 1, $attrs[
"ou_id_type"]);
67 $worksheet->write(
$row, 2, $attrs[
"ou_parent_id"]);
68 $worksheet->write(
$row, 3, $attrs[
"ou_parent_id_type"]);
69 $worksheet->write(
$row, 4, $orgu->getRefId());
70 $worksheet->write(
$row, 5, $orgu->getImportId());
71 $worksheet->write(
$row, 6, $orgu->getTitle());
72 $worksheet->write(
$row, 7, $orgu->getDescription());
73 $worksheet->write(
$row, 8,
"create");
88 $sub_dir = $ts.
'__'.IL_INST_ID.
'__'.
"orgu".
'_'.$orgu_id.
"";
89 $new_file = $sub_dir.
'.zip';
91 $export_run_dir = $export_dir.
"/".$sub_dir;
95 $writer->xmlDumpFile($export_run_dir.
"/manifest.xml",
false);
98 ilUtil::zip($export_run_dir , $export_dir.
"/".$new_file);
102 include_once
'./Services/Export/classes/class.ilExportFileInfo.php';
106 $exp->setExportType(
'xml');
107 $exp->setFilename($new_file);
116 "directory" => $export_dir
124 $open = array($root_node_ref);
127 $current = array_shift($open);
128 $closed[] = $current;
129 foreach($tree->getChildsByType($current,
"orgu") as $new){
130 if(!in_array($new[
"child"], $closed) && !in_array($new[
"child"], $open))
131 $open[] = $new[
"child"];
143 $parent_ref = $tree->getParentId($orgu->getRefId());
146 $ou_parent_id = $parent->getRefId();
148 $ou_parent_id =
"__ILIAS";
151 $ou_id = $orgu->getRefId();
152 $attr = array(
"ou_id" => $ou_id,
"ou_id_type" =>
"reference_id",
"ou_parent_id" => $ou_parent_id,
"ou_parent_id_type" =>
"reference_id",
"action" =>
"create");
static makeDirParents($a_dir)
Create a new directory and all parent directories.
const ILIAS_VERSION_NUMERIC
Class for category export.
_createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
Create export directory.
Class ilExcelWriterAdapter.
Stores information of creation date and versions of export files
getStructure($root_node_ref)
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
simpleExport($orgu_ref_id)
sendAndCreateSimpleExportFile()
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively