3 require_once(
'class.ilOrgUnitSimpleUserImport.php');
51 $this->parent_gui = $parent_gui;
52 $this->parent_object = $parent_gui->object;
53 $this->tabs_gui = $this->parent_gui->tabs_gui;
54 $this->toolbar = $ilToolbar;
58 $this->lng->loadLanguageModule(
'user');
59 if (!$this->ilAccess->checkaccess(
'write',
'', $this->parent_gui->object->getRefId())) {
69 $cmd = $this->ctrl->getCmd();
72 case 'userImportScreen':
86 $this->tpl->setContent($form->getHTML());
96 $string =
'<Assignment action=\'add\'> 97 <User id_type=\'ilias_login\'>root</User> 98 <OrgUnit id_type=\'external_id\'>imported_001</OrgUnit> 102 $xml =
new SimpleXMLElement($string);
103 $importer->simpleUserImportElement($xml);
110 $input =
new ilFileInputGUI($this->lng->txt(
'import_xml_file'),
'import_file');
112 $form->addItem($input);
113 $form->setFormAction($this->ctrl->getFormAction($this));
114 $form->addCommandButton(
'startImport', $this->lng->txt(
'import'));
122 if (!$form->checkInput()) {
123 $this->tpl->setContent($form->getHTML());
125 $file = $form->getInput(
'import_file');
128 $importer->simpleUserImport(
$file[
'tmp_name']);
130 $this->
ilLog->
write($e->getMessage() .
' - ' . $e->getTraceAsString());
132 $this->ctrl->redirect($this,
'render');
143 if (!$importer->hasErrors() AND !$importer->hasWarnings()) {
144 $stats = $importer->getStats();
145 ilUtil::sendSuccess(sprintf($this->lng->txt(
'user_import_successful'), $stats[
'created'], $stats[
'removed']),
true);
147 if ($importer->hasWarnings()) {
148 $msg = $this->lng->txt(
'import_terminated_with_warnings') .
'<br>';
149 foreach ($importer->getWarnings() as $warning) {
150 $msg .=
'-' . $this->lng->txt($warning[
'lang_var']) .
' (Import ID: ' . $warning[
'import_id'] .
')<br>';
154 if ($importer->hasErrors()) {
155 $msg = $this->lng->txt(
'import_terminated_with_errors') .
'<br>';
156 foreach ($importer->getErrors() as $warning) {
157 $msg .=
'- ' . $this->lng->txt($warning[
'lang_var']) .
' (Import ID: ' . $warning[
'import_id'] .
')<br>';
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
displayImportResults($importer)
Class ilOrgUnitSimpleUserImport.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
write($a_msg, $a_log_level=NULL)
logging
testImport()
FSX Can be deleted; Just for a single Test of a UserImport
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilOrgUnitSimpleUserImportGUI.