4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
26 function __construct($a_parent_obj, $a_parent_cmd, $a_mode = self::MODE_USER_FOLDER, $a_load_items =
true)
30 $this->user_folder_id = $a_parent_obj->object->getRefId();
39 $this->
addColumn($this->lng->txt(
"login"),
"login");
43 $this->
addColumn($this->lng->txt($c), $c);
48 $this->
addColumn($this->lng->txt(
'context'),
'time_limit_owner');
49 $this->
addColumn($this->lng->txt(
'role_assignment'));
56 $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj,
"applyFilter"));
69 if($this->
getMode() == self::MODE_USER_FOLDER)
73 $cmds = $a_parent_obj->getUserMultiCommands();
74 foreach($cmds as
$cmd => $caption)
92 $this->mode = $a_mode;
117 include_once(
"./Services/User/classes/class.ilUserProfile.php");
119 $up->skipGroup(
"preferences");
120 $up->skipGroup(
"interests");
121 $up->skipGroup(
"settings");
127 $cols[
"firstname"] = array(
128 "txt" => $lng->txt(
"firstname"),
130 $cols[
"lastname"] = array(
131 "txt" => $lng->txt(
"lastname"),
136 $ufs = $up->getStandardFields();
138 $cols[
"access_until"] = array(
139 "txt" => $lng->txt(
"access_until"),
141 $cols[
"last_login"] = array(
142 "txt" => $lng->txt(
"last_login"),
146 $cols[
"create_date"] = array(
147 "txt" => $lng->txt(
"create_date"));
148 $cols[
"approve_date"] = array(
149 "txt" => $lng->txt(
"approve_date"));
150 $cols[
"agree_date"] = array(
151 "txt" => $lng->txt(
"agree_date"));
155 $ufs = $up->getLocalUserAdministrationFields();
159 if(isset($ufs[
"email"]))
161 $cols[
"email"] = array(
162 "txt" => $lng->txt(
"email"),
167 foreach ($ufs as $f => $fd)
169 if (!isset($cols[$f]) && !$fd[
"lists_hide"])
172 "txt" => $lng->txt($f),
178 unset($cols[
"username"]);
193 if($this->
getMode() == self::MODE_USER_FOLDER)
196 include_once
'./Services/User/classes/class.ilLocalUser.php';
201 if($this->filter[
'time_limit_owner'])
203 $user_filter = array($this->filter[
'time_limit_owner']);
208 include_once
'./Services/User/classes/class.ilLocalUser.php';
214 if(!count($user_filter))
221 include_once(
"./Services/User/classes/class.ilUserQuery.php");
224 unset($additional_fields[
"firstname"]);
225 unset($additional_fields[
"lastname"]);
226 unset($additional_fields[
"email"]);
227 unset($additional_fields[
"last_login"]);
228 unset($additional_fields[
"access_until"]);
235 $query->setTextFilter($this->filter[
'query']);
236 $query->setActionFilter($this->filter[
'activation']);
237 $query->setLastLogin($this->filter[
'last_login']);
238 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
239 $query->setNoCourseFilter($this->filter[
'no_courses']);
240 $query->setNoGroupFilter($this->filter[
'no_groups']);
241 $query->setCourseGroupFilter($this->filter[
'course_group']);
242 $query->setRoleFilter($this->filter[
'global_role']);
243 $query->setAdditionalFields($additional_fields);
244 $query->setUserFolder($user_filter);
247 $usr_data =
$query->query();
250 if (count($usr_data[
"set"]) == 0 && $this->
getOffset() > 0)
254 $usr_data =
$query->query();
257 foreach ($usr_data[
"set"] as $k => $user)
259 $current_time = time();
262 if ($user[
"time_limit_unlimited"])
264 $txt_access = $lng->txt(
"access_unlimited");
265 $usr_data[
"set"][$k][
"access_class"] =
"smallgreen";
267 elseif ($user[
"time_limit_until"] < $current_time)
269 $txt_access = $lng->txt(
"access_expired");
270 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
275 $usr_data[
"set"][$k][
"access_class"] =
"small";
280 $txt_access = $lng->txt(
"inactive");
281 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
283 $usr_data[
"set"][$k][
"access_until"] = $txt_access;
287 $this->
setData($usr_data[
"set"]);
292 if($this->
getMode() == self::MODE_USER_FOLDER)
295 include_once
'./Services/User/classes/class.ilLocalUser.php';
300 if($this->filter[
'time_limit_owner'])
302 $user_filter = array($this->filter[
'time_limit_owner']);
307 include_once
'./Services/User/classes/class.ilLocalUser.php';
312 include_once(
"./Services/User/classes/class.ilUserQuery.php");
315 $query->setLimit(self::getAllCommandLimit());
316 $query->setTextFilter($this->filter[
'query']);
317 $query->setActionFilter($this->filter[
'activation']);
318 $query->setLastLogin($this->filter[
'last_login']);
319 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
320 $query->setNoCourseFilter($this->filter[
'no_courses']);
321 $query->setNoGroupFilter($this->filter[
'no_groups']);
322 $query->setCourseGroupFilter($this->filter[
'course_group']);
323 $query->setRoleFilter($this->filter[
'global_role']);
324 $query->setUserFolder($user_filter);
333 $usr_data =
$query->query();
336 foreach($usr_data[
"set"] as $item)
339 if($item[
"usr_id"] != SYSTEM_USER_ID)
341 $user_ids[] = $item[
"usr_id"];
357 if($this->
getMode() == self::MODE_LOCAL_USER)
359 include_once
'./Services/User/classes/class.ilLocalUser.php';
362 if(count($parent_ids) > 1)
364 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
369 $opt[0] = $this->lng->txt(
'all_users');
372 foreach($parent_ids as $parent_id)
389 $co->setOptions($opt);
391 $co->readFromSession();
392 $this->filter[
'time_limit_owner'] = $co->getValue();
397 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
398 $ul =
new ilTextInputGUI($lng->txt(
"login").
"/".$lng->txt(
"email").
"/".
399 $lng->txt(
"name"),
"query");
400 $ul->
setDataSource($ilCtrl->getLinkTarget($this->getParentObject(),
401 "addUserAutoComplete",
"",
true));
403 $ul->setSubmitFormOnEnter(
true);
405 $ul->readFromSession();
406 $this->filter[
"query"] = $ul->getValue();
420 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
422 "" => $lng->txt(
"user_all"),
423 "active" => $lng->txt(
"active"),
424 "inactive" => $lng->txt(
"inactive"),
429 $si->readFromSession();
430 $this->filter[
"activation"] = $si->getValue();
433 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
434 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_limited_access"),
"limited_access");
436 $cb->readFromSession();
437 $this->filter[
"limited_access"] = $cb->getChecked();
440 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
441 $di =
new ilDateTimeInputGUI($this->lng->txt(
"user_last_login_before"),
"last_login");
446 $di->readFromSession();
447 $this->filter[
"last_login"] = $di->getDate();
449 if($this->
getMode() == self::MODE_USER_FOLDER)
452 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
455 $cb->readFromSession();
456 $this->filter[
"no_courses"] = $cb->getChecked();
459 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
462 $ng->readFromSession();
463 $this->filter[
'no_groups'] = $ng->getChecked();
466 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
469 $rs->setHeaderMessage($lng->txt(
"user_please_select_course_group"));
470 $rs->setClickableTypes(array(
"crs",
"grp"));
472 $rs->readFromSession();
473 $this->filter[
"course_group"] = $rs->getValue();
478 "" => $lng->txt(
"user_any"),
480 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
481 foreach ($roles as $role)
483 $options[$role[
"rol_id"]] = $role[
"title"];
485 $si =
new ilSelectInputGUI($this->lng->txt(
"user_global_role"),
"global_role");
488 $si->readFromSession();
489 $this->filter[
"global_role"] = $si->getValue();
499 $ilCtrl->setParameterByClass(
"ilobjusergui",
"letter",
$_GET[
"letter"]);
503 if ($c ==
"access_until")
505 $this->tpl->setCurrentBlock(
"access_until");
506 $this->tpl->setVariable(
"VAL_ACCESS_UNTIL", $user[
"access_until"]);
507 $this->tpl->setVariable(
"CLASS_ACCESS_UNTIL", $user[
"access_class"]);
509 else if ($c ==
"last_login")
511 $this->tpl->setCurrentBlock(
"last_login");
512 $this->tpl->setVariable(
"VAL_LAST_LOGIN",
515 else if (in_array($c, array(
"firstname",
"lastname")))
517 $this->tpl->setCurrentBlock($c);
518 $this->tpl->setVariable(
"VAL_".strtoupper($c), (
string) $user[$c]);
522 $this->tpl->setCurrentBlock(
"user_field");
523 $val = (trim($user[$c]) ==
"")
536 $val = $lng->txt(
"gender_".$user[$c]);
547 $this->tpl->setVariable(
"VAL_UF", $val);
550 $this->tpl->parseCurrentBlock();
553 if ($user[
"usr_id"] != 6)
557 $this->tpl->setCurrentBlock(
"checkb");
558 $this->tpl->setVariable(
"ID", $user[
"usr_id"]);
559 $this->tpl->parseCurrentBlock();
565 $this->tpl->setVariable(
"VAL_LOGIN", $user[
"login"]);
566 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", $user[
"usr_id"]);
567 $this->tpl->setVariable(
"HREF_LOGIN",
568 $ilCtrl->getLinkTargetByClass(
"ilobjusergui",
"view"));
569 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
"");
573 $this->tpl->setVariable(
'VAL_LOGIN_PLAIN',$user[
'login']);
576 if($this->
getMode() == self::MODE_LOCAL_USER)
578 $this->tpl->setCurrentBlock(
'context');
580 $this->tpl->parseCurrentBlock();
582 $this->tpl->setCurrentBlock(
'roles');
583 $ilCtrl->setParameter($this->
getParentObject(),
'obj_id',$user[
'usr_id']);
584 $this->tpl->setVariable(
'ROLE_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),
'assignRoles'));
585 $this->tpl->setVariable(
'TXT_ROLES',$this->lng->txt(
'edit'));
587 $this->tpl->parseCurrentBlock();