34 $this->tree = $DIC[
'tree'];
42 $writer->xmlStartTag(
"OrgUnits");
43 foreach ($nodes as $node_ref_id) {
49 $writer->xmlStartTag(
"OrgUnit", $attributes);
50 $writer->xmlElement(
"external_id", null, $this->
getExternalId($node_ref_id));
51 $writer->xmlElement(
"title", null, $orgu->getTitle());
52 $writer->xmlElement(
"description", null, $orgu->getDescription());
53 $writer->xmlEndTag(
"OrgUnit");
55 $writer->xmlEndTag(
"OrgUnits");
69 return "orgu_" .
CLIENT_ID .
"_" . $orgu_ref_id;
75 $file_name =
"org_unit_export_" . $orgu_ref_id;
77 $worksheet->addSheet(
'org_units');
81 $worksheet->setCell($row, 0,
"ou_id");
82 $worksheet->setCell($row, 1,
"ou_id_type");
83 $worksheet->setCell($row, 2,
"ou_parent_id");
84 $worksheet->setCell($row, 3,
"ou_parent_id_type");
85 $worksheet->setCell($row, 4,
"reference_id");
86 $worksheet->setCell($row, 5,
"title");
87 $worksheet->setCell($row, 6,
"description");
88 $worksheet->setCell($row, 7,
"action");
93 foreach ($nodes as $node) {
100 $worksheet->setCell($row, 0, $attrs[
"ou_id"]);
101 $worksheet->setCell($row, 1, $attrs[
"ou_id_type"]);
102 $worksheet->setCell($row, 2, $attrs[
"ou_parent_id"]);
103 $worksheet->setCell($row, 3, $attrs[
"ou_parent_id_type"]);
104 $worksheet->setCell($row, 4, $orgu->getRefId());
105 $worksheet->setCell($row, 5, $orgu->getTitle());
106 $worksheet->setCell($row, 6, $orgu->getDescription());
107 $worksheet->setCell($row, 7,
"create");
109 $worksheet->sendToClient($file_name);
122 $sub_dir = $ts .
'__' .
IL_INST_ID .
'__' .
"orgu" .
'_' . $orgu_id .
"";
123 $new_file = $sub_dir .
'.zip';
125 $export_run_dir = $export_dir .
"/" . $sub_dir;
129 $writer->xmlDumpFile($export_run_dir .
"/manifest.xml",
false);
139 $exp->setExportType(
'xml');
140 $exp->setFilename($new_file);
144 $export_dir .
"/" . $new_file,
151 "directory" => $export_dir,
157 $open = array($root_node_ref);
159 while (count($open)) {
160 $current = array_shift($open);
161 $closed[] = $current;
162 foreach ($this->tree->getChildsByType($current,
"orgu") as $new) {
163 if (in_array($new[
"child"], $closed,
true) ===
false && in_array($new[
"child"], $open,
true) ===
false) {
164 $open[] = $new[
"child"];
174 $parent_ref = $this->tree->getParentId($orgu->
getRefId());
178 $ou_parent_id =
"__ILIAS";
183 "ou_id_type" =>
"external_id",
184 "ou_parent_id" => $ou_parent_id,
185 "ou_parent_id_type" =>
"external_id",
getAttributesForOrgu(ilObjOrgUnit $orgu)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
simpleExport(int $orgu_ref_id)
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
getExternalId(int $orgu_ref_id)
const ILIAS_VERSION_NUMERIC
buildExternalId(int $orgu_ref_id)
static _createExportDirectory(int $a_obj_id, string $a_export_type="xml", string $a_obj_type="")
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjectId(int $ref_id)
getStructure(int $root_node_ref)
__construct(Container $dic, ilPlugin $plugin)
sendAndCreateSimpleExportFile()
static zip(string $a_dir, string $a_file, bool $compress_content=false)
simpleExportExcel(int $orgu_ref_id)