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");
21 $writer->xmlStartTag(
"OrgUnits");
22 foreach($nodes as $orgu_ref_id){
27 $writer->xmlStartTag(
"OrgUnit", $attributes);
28 $writer->xmlElement(
"external_id", null, $this->
buildExternalId($orgu_ref_id));
29 $writer->xmlElement(
"title", null, $orgu->getTitle());
30 $writer->xmlElement(
"description", null, $orgu->getDescription());
31 $writer->xmlEndTag(
"OrgUnit");
33 $writer->xmlEndTag(
"OrgUnits");
42 return "orgu_".CLIENT_ID.
"_".$orgu_ref_id;
45 public function simpleExportExcel($orgu_ref_id){
47 include_once
"./Services/Excel/classes/class.ilExcelUtils.php";
48 include_once
"./Services/Excel/classes/class.ilExcelWriterAdapter.php";
50 $workbook = $adapter->getWorkbook();
52 $worksheet = $workbook->addWorksheet();
55 $worksheet->write(0, 0,
"ou_id");
56 $worksheet->write(0, 1,
"ou_id_type");
57 $worksheet->write(0, 2,
"ou_parent_id");
58 $worksheet->write(0, 3,
"ou_parent_id_type");
59 $worksheet->write(0, 4,
"reference_id");
60 $worksheet->write(0, 5,
"external_id");
61 $worksheet->write(0, 6,
"title");
62 $worksheet->write(0, 7,
"description");
63 $worksheet->write(0, 8,
"action");
66 foreach($nodes as $node)
73 $worksheet->write(
$row, 0, $attrs[
"ou_id"]);
74 $worksheet->write(
$row, 1, $attrs[
"ou_id_type"]);
75 $worksheet->write(
$row, 2, $attrs[
"ou_parent_id"]);
76 $worksheet->write(
$row, 3, $attrs[
"ou_parent_id_type"]);
77 $worksheet->write(
$row, 4, $orgu->getRefId());
78 $worksheet->write(
$row, 5, $orgu->getImportId());
79 $worksheet->write(
$row, 6, $orgu->getTitle());
80 $worksheet->write(
$row, 7, $orgu->getDescription());
81 $worksheet->write(
$row, 8,
"create");
96 $sub_dir = $ts.
'__'.IL_INST_ID.
'__'.
"orgu".
'_'.$orgu_id.
"";
97 $new_file = $sub_dir.
'.zip';
99 $export_run_dir = $export_dir.
"/".$sub_dir;
103 $writer->xmlDumpFile($export_run_dir.
"/manifest.xml",
false);
106 ilUtil::zip($export_run_dir , $export_dir.
"/".$new_file);
110 include_once
'./Services/Export/classes/class.ilExportFileInfo.php';
114 $exp->setExportType(
'xml');
115 $exp->setFilename($new_file);
124 "directory" => $export_dir
130 $open = array($root_node_ref);
133 $current = array_shift($open);
134 $closed[] = $current;
135 foreach($tree->getChildsByType($current,
"orgu") as $new){
136 if(!in_array($new[
"child"], $closed) && !in_array($new[
"child"], $open))
137 $open[] = $new[
"child"];
149 $parent_ref = $tree->getParentId($orgu->getRefId());
153 $ou_parent_id =
"__ILIAS";
157 $attr = array(
"ou_id" => $this->
buildExternalId(
$ref_id),
"ou_id_type" =>
"external_id",
"ou_parent_id" => $ou_parent_id,
"ou_parent_id_type" =>
"external_id",
"action" =>
"create");
static makeDirParents($a_dir)
Create a new directory and all parent directories.
const ILIAS_VERSION_NUMERIC
buildExternalId($orgu_ref_id)
getAttributesForOrgu($orgu)
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