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);
125 $input->setRequired(
true);
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());
140 $file =
$form->getInput(
'import_file');
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();
161 ilUtil::sendSuccess(sprintf($this->lng->txt(
'user_import_successful'),
$stats[
'created'],
$stats[
'removed']),
true);
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>';
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.