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(
"settings");
126 $cols[
"firstname"] = array(
127 "txt" => $lng->txt(
"firstname"),
129 $cols[
"lastname"] = array(
130 "txt" => $lng->txt(
"lastname"),
135 $ufs = $up->getStandardFields();
137 $cols[
"access_until"] = array(
138 "txt" => $lng->txt(
"access_until"),
140 $cols[
"last_login"] = array(
141 "txt" => $lng->txt(
"last_login"),
145 $cols[
"create_date"] = array(
146 "txt" => $lng->txt(
"create_date"));
147 $cols[
"approve_date"] = array(
148 "txt" => $lng->txt(
"approve_date"));
149 $cols[
"agree_date"] = array(
150 "txt" => $lng->txt(
"agree_date"));
154 $ufs = $up->getLocalUserAdministrationFields();
158 if(isset($ufs[
"email"]))
160 $cols[
"email"] = array(
161 "txt" => $lng->txt(
"email"),
166 foreach ($ufs as $f => $fd)
168 if (!isset($cols[$f]) && !$fd[
"lists_hide"])
171 "txt" => $lng->txt($f),
177 unset($cols[
"username"]);
192 if($this->
getMode() == self::MODE_USER_FOLDER)
195 include_once
'./Services/User/classes/class.ilLocalUser.php';
200 if($this->filter[
'time_limit_owner'])
202 $user_filter = array($this->filter[
'time_limit_owner']);
207 include_once
'./Services/User/classes/class.ilLocalUser.php';
213 if(!count($user_filter))
220 include_once(
"./Services/User/classes/class.ilUserQuery.php");
223 unset($additional_fields[
"firstname"]);
224 unset($additional_fields[
"lastname"]);
225 unset($additional_fields[
"email"]);
226 unset($additional_fields[
"last_login"]);
227 unset($additional_fields[
"access_until"]);
234 $query->setTextFilter($this->filter[
'query']);
235 $query->setActionFilter($this->filter[
'activation']);
236 $query->setLastLogin($this->filter[
'last_login']);
237 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
238 $query->setNoCourseFilter($this->filter[
'no_courses']);
239 $query->setNoGroupFilter($this->filter[
'no_groups']);
240 $query->setCourseGroupFilter($this->filter[
'course_group']);
241 $query->setRoleFilter($this->filter[
'global_role']);
242 $query->setAdditionalFields($additional_fields);
243 $query->setUserFolder($user_filter);
246 $usr_data =
$query->query();
249 if (count($usr_data[
"set"]) == 0 && $this->
getOffset() > 0)
253 $usr_data =
$query->query();
256 foreach ($usr_data[
"set"] as $k => $user)
258 $current_time = time();
261 if ($user[
"time_limit_unlimited"])
263 $txt_access = $lng->txt(
"access_unlimited");
264 $usr_data[
"set"][$k][
"access_class"] =
"smallgreen";
266 elseif ($user[
"time_limit_until"] < $current_time)
268 $txt_access = $lng->txt(
"access_expired");
269 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
274 $usr_data[
"set"][$k][
"access_class"] =
"small";
279 $txt_access = $lng->txt(
"inactive");
280 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
282 $usr_data[
"set"][$k][
"access_until"] = $txt_access;
286 $this->
setData($usr_data[
"set"]);
291 if($this->
getMode() == self::MODE_USER_FOLDER)
294 include_once
'./Services/User/classes/class.ilLocalUser.php';
299 if($this->filter[
'time_limit_owner'])
301 $user_filter = array($this->filter[
'time_limit_owner']);
306 include_once
'./Services/User/classes/class.ilLocalUser.php';
311 include_once(
"./Services/User/classes/class.ilUserQuery.php");
314 $query->setLimit(self::getAllCommandLimit());
315 $query->setTextFilter($this->filter[
'query']);
316 $query->setActionFilter($this->filter[
'activation']);
317 $query->setLastLogin($this->filter[
'last_login']);
318 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
319 $query->setNoCourseFilter($this->filter[
'no_courses']);
320 $query->setNoGroupFilter($this->filter[
'no_groups']);
321 $query->setCourseGroupFilter($this->filter[
'course_group']);
322 $query->setRoleFilter($this->filter[
'global_role']);
323 $query->setUserFolder($user_filter);
332 $usr_data =
$query->query();
335 foreach($usr_data[
"set"] as $item)
338 if($item[
"usr_id"] != SYSTEM_USER_ID)
340 $user_ids[] = $item[
"usr_id"];
356 if($this->
getMode() == self::MODE_LOCAL_USER)
358 include_once
'./Services/User/classes/class.ilLocalUser.php';
361 if(count($parent_ids) > 1)
363 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
368 $opt[0] = $this->lng->txt(
'all_users');
371 foreach($parent_ids as $parent_id)
388 $co->setOptions($opt);
390 $co->readFromSession();
391 $this->filter[
'time_limit_owner'] = $co->getValue();
396 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
397 $ul =
new ilTextInputGUI($lng->txt(
"login").
"/".$lng->txt(
"email").
"/".
398 $lng->txt(
"name"),
"query");
399 $ul->
setDataSource($ilCtrl->getLinkTarget($this->getParentObject(),
400 "addUserAutoComplete",
"",
true));
402 $ul->setSubmitFormOnEnter(
true);
404 $ul->readFromSession();
405 $this->filter[
"query"] = $ul->getValue();
419 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
421 "" => $lng->txt(
"user_all"),
422 "active" => $lng->txt(
"active"),
423 "inactive" => $lng->txt(
"inactive"),
428 $si->readFromSession();
429 $this->filter[
"activation"] = $si->getValue();
432 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
433 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_limited_access"),
"limited_access");
435 $cb->readFromSession();
436 $this->filter[
"limited_access"] = $cb->getChecked();
439 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
440 $di =
new ilDateTimeInputGUI($this->lng->txt(
"user_last_login_before"),
"last_login");
445 $di->readFromSession();
446 $this->filter[
"last_login"] = $di->getDate();
448 if($this->
getMode() == self::MODE_USER_FOLDER)
451 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
454 $cb->readFromSession();
455 $this->filter[
"no_courses"] = $cb->getChecked();
458 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
461 $ng->readFromSession();
462 $this->filter[
'no_groups'] = $ng->getChecked();
465 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
468 $rs->setHeaderMessage($lng->txt(
"user_please_select_course_group"));
469 $rs->setClickableTypes(array(
"crs",
"grp"));
471 $rs->readFromSession();
472 $this->filter[
"course_group"] = $rs->getValue();
477 "" => $lng->txt(
"user_any"),
479 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
480 foreach ($roles as $role)
482 $options[$role[
"rol_id"]] = $role[
"title"];
484 $si =
new ilSelectInputGUI($this->lng->txt(
"user_global_role"),
"global_role");
487 $si->readFromSession();
488 $this->filter[
"global_role"] = $si->getValue();
498 $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();