52 $ilToolbar = $DIC[
'ilToolbar'];
58 $this->parent_gui = $parent_gui;
59 $this->parent_object = $parent_gui->object;
60 $this->tabs_gui = $this->parent_gui->tabs_gui;
61 $this->toolbar = $ilToolbar;
65 $this->lng->loadLanguageModule(
'user');
66 if (!$this->
ilAccess->checkaccess(
'write',
'', $this->parent_gui->object->getRefId())) {
77 $cmd = $this->ctrl->getCmd();
79 $this->tabs_gui->clearTargets();
80 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTargetByClass(
'ilOrgUnitSimpleImportGUI',
'chooseImport'));
83 case 'userImportScreen':
98 $this->tpl->setContent(
$form->getHTML());
109 $string =
'<Assignment action=\'add\'> 110 <User id_type=\'ilias_login\'>root</User> 111 <OrgUnit id_type=\'external_id\'>imported_001</OrgUnit> 112 <Role>superior</Role> 116 $importer->simpleUserImportElement(
$xml);
124 $input =
new ilFileInputGUI($this->lng->txt(
'import_xml_file'),
'import_file');
126 $form->addItem($input);
127 $form->setFormAction($this->ctrl->getFormAction($this));
128 $form->addCommandButton(
'startImport', $this->lng->txt(
'import'));
137 if (!
$form->checkInput()) {
138 $this->tpl->setContent(
$form->getHTML());
143 $importer->simpleUserImport(
$file[
'tmp_name']);
145 $this->
ilLog->
write($e->getMessage() .
' - ' . $e->getTraceAsString());
147 $this->ctrl->redirect($this,
'render');
159 if (!$importer->hasErrors() and !$importer->hasWarnings()) {
160 $stats = $importer->getStats();
163 if ($importer->hasWarnings()) {
164 $msg = $this->lng->txt(
'import_terminated_with_warnings') .
'<br>';
165 foreach ($importer->getWarnings() as
$warning) {
166 $msg .=
'-' . $this->lng->txt(
$warning[
'lang_var']) .
' (Import ID: ' .
$warning[
'import_id'] .
')<br>';
170 if ($importer->hasErrors()) {
171 $msg = $this->lng->txt(
'import_terminated_with_errors') .
'<br>';
172 foreach ($importer->getErrors() as
$warning) {
173 $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.
write($a_msg, $a_log_level=null)
logging
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
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.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file