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();
35 parent::__construct($a_parent_obj, $a_parent_cmd);
39 $this->
addColumn($this->lng->txt(
"login"),
"login");
43 $this->
addColumn($this->lng->txt($c), $c);
46 if($this->
getMode() == self::MODE_LOCAL_USER)
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"),
134 if($this->
getMode() == self::MODE_USER_FOLDER)
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 $caption = $fd[
"lang_var"]
176 "txt" => $lng->txt($caption),
182 unset($cols[
"username"]);
197 if($this->
getMode() == self::MODE_USER_FOLDER)
200 include_once
'./Services/User/classes/class.ilLocalUser.php';
205 if($this->filter[
'time_limit_owner'])
207 $user_filter =
array($this->filter[
'time_limit_owner']);
212 include_once
'./Services/User/classes/class.ilLocalUser.php';
218 if(!count($user_filter))
225 include_once(
"./Services/User/classes/class.ilUserQuery.php");
228 unset($additional_fields[
"firstname"]);
229 unset($additional_fields[
"lastname"]);
230 unset($additional_fields[
"email"]);
231 unset($additional_fields[
"last_login"]);
232 unset($additional_fields[
"access_until"]);
233 unset($additional_fields[
'org_units']);
240 $query->setTextFilter($this->filter[
'query']);
241 $query->setActionFilter($this->filter[
'activation']);
242 $query->setLastLogin($this->filter[
'last_login']);
243 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
244 $query->setNoCourseFilter($this->filter[
'no_courses']);
245 $query->setNoGroupFilter($this->filter[
'no_groups']);
246 $query->setCourseGroupFilter($this->filter[
'course_group']);
247 $query->setRoleFilter($this->filter[
'global_role']);
248 $query->setAdditionalFields($additional_fields);
249 $query->setUserFolder($user_filter);
252 $usr_data =
$query->query();
255 if (count($usr_data[
"set"]) == 0 && $this->
getOffset() > 0)
259 $usr_data =
$query->query();
262 foreach ($usr_data[
"set"] as $k => $user)
270 $current_time =
time();
273 if ($user[
"time_limit_unlimited"])
275 $txt_access = $lng->txt(
"access_unlimited");
276 $usr_data[
"set"][$k][
"access_class"] =
"smallgreen";
278 elseif ($user[
"time_limit_until"] < $current_time)
280 $txt_access = $lng->txt(
"access_expired");
281 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
286 $usr_data[
"set"][$k][
"access_class"] =
"small";
291 $txt_access = $lng->txt(
"inactive");
292 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
294 $usr_data[
"set"][$k][
"access_until"] = $txt_access;
298 $this->
setData($usr_data[
"set"]);
303 if($this->
getMode() == self::MODE_USER_FOLDER)
306 include_once
'./Services/User/classes/class.ilLocalUser.php';
311 if($this->filter[
'time_limit_owner'])
313 $user_filter =
array($this->filter[
'time_limit_owner']);
318 include_once
'./Services/User/classes/class.ilLocalUser.php';
323 include_once(
"./Services/User/classes/class.ilUserQuery.php");
326 $query->setLimit(self::getAllCommandLimit());
327 $query->setTextFilter($this->filter[
'query']);
328 $query->setActionFilter($this->filter[
'activation']);
329 $query->setLastLogin($this->filter[
'last_login']);
330 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
331 $query->setNoCourseFilter($this->filter[
'no_courses']);
332 $query->setNoGroupFilter($this->filter[
'no_groups']);
333 $query->setCourseGroupFilter($this->filter[
'course_group']);
334 $query->setRoleFilter($this->filter[
'global_role']);
335 $query->setUserFolder($user_filter);
344 $usr_data =
$query->query();
347 foreach($usr_data[
"set"] as $item)
350 if($item[
"usr_id"] != SYSTEM_USER_ID)
352 $user_ids[] = $item[
"usr_id"];
368 if($this->
getMode() == self::MODE_LOCAL_USER)
370 include_once
'./Services/User/classes/class.ilLocalUser.php';
373 if(count($parent_ids) > 1)
375 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
380 $opt[0] = $this->lng->txt(
'all_users');
383 foreach($parent_ids as $parent_id)
400 $co->setOptions($opt);
402 $co->readFromSession();
403 $this->filter[
'time_limit_owner'] = $co->getValue();
408 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
409 $ul =
new ilTextInputGUI($lng->txt(
"login").
"/".$lng->txt(
"email").
"/".
410 $lng->txt(
"name"),
"query");
411 $ul->
setDataSource($ilCtrl->getLinkTarget($this->getParentObject(),
412 "addUserAutoComplete",
"",
true));
414 $ul->setSubmitFormOnEnter(
true);
416 $ul->readFromSession();
417 $this->filter[
"query"] = $ul->getValue();
431 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
433 "" => $lng->txt(
"user_all"),
434 "active" => $lng->txt(
"active"),
435 "inactive" => $lng->txt(
"inactive"),
440 $si->readFromSession();
441 $this->filter[
"activation"] = $si->getValue();
444 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
445 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_limited_access"),
"limited_access");
447 $cb->readFromSession();
448 $this->filter[
"limited_access"] = $cb->getChecked();
451 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
452 $di =
new ilDateTimeInputGUI($this->lng->txt(
"user_last_login_before"),
"last_login");
457 $di->readFromSession();
458 $this->filter[
"last_login"] = $di->getDate();
460 if($this->
getMode() == self::MODE_USER_FOLDER)
463 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
466 $cb->readFromSession();
467 $this->filter[
"no_courses"] = $cb->getChecked();
470 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
473 $ng->readFromSession();
474 $this->filter[
'no_groups'] = $ng->getChecked();
477 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
480 $rs->setHeaderMessage($lng->txt(
"user_please_select_course_group"));
481 $rs->setClickableTypes(
array(
"crs",
"grp"));
483 $rs->readFromSession();
484 $this->filter[
"course_group"] = $rs->getValue();
489 "" => $lng->txt(
"user_any"),
491 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
492 foreach ($roles as $role)
494 $options[$role[
"rol_id"]] = $role[
"title"];
496 $si =
new ilSelectInputGUI($this->lng->txt(
"user_global_role"),
"global_role");
499 $si->readFromSession();
500 $this->filter[
"global_role"] = $si->getValue();
510 $ilCtrl->setParameterByClass(
"ilobjusergui",
"letter",
$_GET[
"letter"]);
514 if ($c ==
"access_until")
516 $this->tpl->setCurrentBlock(
"access_until");
517 $this->tpl->setVariable(
"VAL_ACCESS_UNTIL", $user[
"access_until"]);
518 $this->tpl->setVariable(
"CLASS_ACCESS_UNTIL", $user[
"access_class"]);
520 else if ($c ==
"last_login")
522 $this->tpl->setCurrentBlock(
"last_login");
523 $this->tpl->setVariable(
"VAL_LAST_LOGIN",
526 else if (in_array($c,
array(
"firstname",
"lastname")))
528 $this->tpl->setCurrentBlock($c);
529 $this->tpl->setVariable(
"VAL_".strtoupper($c), (
string) $user[$c]);
533 $this->tpl->setCurrentBlock(
"user_field");
534 $val = (trim($user[$c]) ==
"")
546 $val = $lng->txt(
"gender_".$user[$c]);
557 $this->tpl->setVariable(
"VAL_UF", $val);
560 $this->tpl->parseCurrentBlock();
563 if ($user[
"usr_id"] != 6)
567 $this->tpl->setCurrentBlock(
"checkb");
568 $this->tpl->setVariable(
"ID", $user[
"usr_id"]);
569 $this->tpl->parseCurrentBlock();
575 $this->tpl->setVariable(
"VAL_LOGIN", $user[
"login"]);
576 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", $user[
"usr_id"]);
577 $this->tpl->setVariable(
"HREF_LOGIN",
578 $ilCtrl->getLinkTargetByClass(
"ilobjusergui",
"view"));
579 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
"");
583 $this->tpl->setVariable(
'VAL_LOGIN_PLAIN',$user[
'login']);
586 if($this->
getMode() == self::MODE_LOCAL_USER)
588 $this->tpl->setCurrentBlock(
'context');
590 $this->tpl->parseCurrentBlock();
592 $this->tpl->setCurrentBlock(
'roles');
593 $ilCtrl->setParameter($this->
getParentObject(),
'obj_id',$user[
'usr_id']);
594 $this->tpl->setVariable(
'ROLE_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),
'assignRoles'));
595 $this->tpl->setVariable(
'TXT_ROLES',$this->lng->txt(
'edit'));
597 $this->tpl->parseCurrentBlock();
setExternalSorting($a_val)
Set external sorting.
setDataSource($href, $a_delimiter=null)
set datasource link for js autocomplete
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExternalSegmentation($a_val)
Set external segmentation.
resetOffset($a_in_determination=false)
Reset offset.
getSelectableColumns()
Get selectable columns.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static _lookupTitle($a_id)
lookup object title
getOrderDirection()
Get order direction.
getParentObject()
Get parent object.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static lookupOrgUnitsRepresentation($a_usr_id)
lokup org unit representation
TableGUI class for user administration.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
if(!is_array($argv)) $options
static _lookupObjId($a_id)
addMultiCommand($a_cmd, $a_text)
Add Command button.
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
getSelectedColumns()
Get selected columns.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setEnableAllCommand($a_value)
Enable actions for all entries in current result.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct($a_parent_obj, $a_parent_cmd, $a_mode=self::MODE_USER_FOLDER, $a_load_items=true)
Constructor.
fillRow($user)
Fill table row.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
const USER_FOLDER_ID
Class ilObjUserFolder.
setEnableHeader($a_enableheader)
Set Enable Header.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setMaxCount($a_max_count)
set max.
setEnableTitle($a_enabletitle)
Set Enable Title.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
getItems()
Get user items.
setFilterCommand($a_val, $a_caption=null)
Set filter command.