4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
22 function __construct($a_parent_obj, $a_parent_cmd, $a_admin_mode =
false)
26 $this->admin_mode = (bool)$a_admin_mode;
28 $this->
setId(
"rep_search_".$ilUser->getId());
36 $this->
addColumn($all_cols[$col][
'txt'], $col);
39 $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj));
40 $this->
setRowTemplate(
"tpl.rep_search_usr_result_row.html",
"Services/Search");
41 $this->
setTitle($this->lng->txt(
'search_results'));
45 $this->
enable(
'select_all');
60 if(!self::$all_selectable_cols)
62 include_once
'./Services/Search/classes/class.ilUserSearchOptions.php';
68 $columns[
'access_until'] = array(
'txt' => $this->lng->txt(
'access_until'));
69 $columns[
'last_login'] = array(
'txt' => $this->lng->txt(
'last_login'));
72 self::$all_selectable_cols =
$columns;
83 if(!count($a_commands))
99 $this->tpl->setVariable(
"VAL_ID", $a_set[
"usr_id"]);
105 $a_set[
'gender'] = $a_set[
'gender'] ? $this->lng->txt(
'gender_' . $a_set[
'gender']) :
'';
106 $this->tpl->setCurrentBlock(
'custom_fields');
107 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
108 $this->tpl->parseCurrentBlock();
113 $this->tpl->setCurrentBlock(
'custom_fields');
114 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
115 $this->tpl->parseCurrentBlock();
119 $this->tpl->setCurrentBlock(
'custom_fields');
120 $this->tpl->setVariable(
'CUST_CLASS',
' '.$a_set[
'access_class']);
121 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
122 $this->tpl->parseCurrentBlock();
126 $a_set[
'last_login'] = $a_set[
'last_login'] ? ilDatePresentation::formatDate(
new ilDateTime($a_set[
'last_login'],
IL_CAL_DATETIME)) : $this->lng->txt(
'no_date');
127 $this->tpl->setCurrentBlock(
'custom_fields');
128 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
129 $this->tpl->parseCurrentBlock();
133 if($this->admin_mode)
135 $ilCtrl->setParameterByClass(
"ilobjusergui",
"ref_id",
"7");
136 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", $a_set[
"usr_id"]);
137 $ilCtrl->setParameterByClass(
"ilobjusergui",
"search",
"1");
138 $link = $ilCtrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjusergui"),
"view");
139 $a_set[$field] =
"<a href=\"".$link.
"\">".$a_set[$field].
"</a>";
144 $this->tpl->setCurrentBlock(
'custom_fields');
145 $this->tpl->setVariable(
'VAL_CUST', (
string) ($a_set[$field] ? $a_set[$field] :
''));
146 $this->tpl->parseCurrentBlock();
168 $parse_access =
false;
169 if(isset($additional_fields[
'access_until']))
171 $parse_access =
true;
172 unset($additional_fields[
'access_until']);
175 $udf_ids = $usr_data_fields = $odf_ids = array();
176 foreach($additional_fields as $field)
178 if(substr($field, 0, 3) ==
'udf')
180 $udf_ids[] = substr($field,4);
183 $usr_data_fields[] = $field;
185 include_once
'./Services/User/classes/class.ilUserQuery.php';
203 if($this->admin_mode && $parse_access)
206 $current_time = time();
207 foreach($usr_data[
'set'] as $k => $user)
211 if ($user[
"time_limit_unlimited"])
213 $txt_access = $this->lng->txt(
"access_unlimited");
214 $usr_data[
"set"][$k][
"access_class"] =
"smallgreen";
216 elseif ($user[
"time_limit_until"] < $current_time)
218 $txt_access = $this->lng->txt(
"access_expired");
219 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
224 $usr_data[
"set"][$k][
"access_class"] =
"small";
229 $txt_access = $this->lng->txt(
"inactive");
230 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
232 $usr_data[
"set"][$k][
"access_until"] = $txt_access;
239 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
244 foreach($usr_data[
'set'] as $set)
246 $users[$counter] = $set;
247 foreach($udf_ids as $udf_field)
249 $users[$counter][
'udf_'.$udf_field] =
$data[$set[
'usr_id']][$udf_field];
256 $users = $usr_data[
'set'];