35 include_once
'Services/Search/classes/class.ilSearchResult.php';
36 include_once
'Services/Search/classes/class.ilSearchSettings.php';
37 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
38 include_once
'Services/Search/classes/class.ilQueryParser.php';
60 $this->lng->loadLanguageModule(
'search');
61 $this->lng->loadLanguageModule(
'crs');
67 $this->result_obj->setMaxHits(1000000);
79 $_SESSION[
'search'][
'string'] = $this->
string = $a_str;
94 $next_class = $this->ctrl->getNextClass($this);
95 $cmd = $this->ctrl->getCmd();
121 $this->ctrl->returnToParent($this);
137 $class =& $this->callback[
'class'];
138 $method = $this->callback[
'method'];
141 $class->$method(
$_POST[
'user']);
147 $this->callback = array(
'class' => $class,
'method' => $method);
148 $this->add_options = $a_add_options ? $a_add_options : array();
154 $this->tpl->setContent($this->form->getHTML());
159 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
162 $this->form->setFormAction($this->ctrl->getFormAction($this,
'search'));
163 $this->form->setTitle($this->lng->txt(
'add_members_header'));
164 $this->form->addCommandButton(
'performSearch', $this->lng->txt(
'search'));
165 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
169 $kind->
setValue($this->search_type);
170 $this->form->addItem($kind);
173 $users =
new ilRadioOption($this->lng->txt(
'search_for_users'),
'usr');
176 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
179 switch($info[
'type'])
184 $sel =
new ilSelectInputGUI($info[
'lang'],
"rep_query[usr][".$info[
'db'].
"]");
185 $sel->setOptions($info[
'values']);
186 $users->addSubItem($sel);
192 $txt =
new ilTextInputGUI($info[
'lang'],
"rep_query[usr][".$info[
'db'].
"]");
194 $txt->setMaxLength(120);
195 $users->addSubItem($txt);
199 $kind->addOption($users);
202 $roles =
new ilRadioOption($this->lng->txt(
'search_for_role_members'),
'role');
203 $role =
new ilTextInputGUI($this->lng->txt(
'search_role_title'),
'rep_query[role][title]');
205 $role->setMaxLength(120);
207 $kind->addOption($roles);
210 $groups =
new ilRadioOption($this->lng->txt(
'search_for_crs_members'),
'crs');
211 $group =
new ilTextInputGUI($this->lng->txt(
'search_crs_title'),
'rep_query[crs][title]');
213 $group->setMaxLength(120);
215 $kind->addOption($groups);
218 $groups =
new ilRadioOption($this->lng->txt(
'search_for_grp_members'),
'grp');
219 $group =
new ilTextInputGUI($this->lng->txt(
'search_grp_title'),
'rep_query[grp][title]');
221 $group->setMaxLength(120);
223 $kind->addOption($groups);
246 $found_query =
false;
247 foreach((array)
$_POST[
'rep_query'][
$_POST[
'search_for']] as $field => $value)
263 if(
$_POST[
'cmd'][
'performSearch'])
268 switch($this->search_type)
289 $this->result_obj->addObserver($this,
'userFilter');
293 if($this->search_type ==
'usr')
295 include_once
'./Services/User/classes/class.ilUserFilter.php';
296 $this->search_results = array_intersect(
297 $this->result_obj->getResultIds(),
303 $this->search_results = array();
304 foreach((array) $this->result_obj->getResults() as
$res)
306 $this->search_results[] =
$res[
'obj_id'];
310 if(!count($this->search_results))
317 if($this->result_obj->isLimitReached())
319 $message = sprintf($this->lng->txt(
'search_limit_reached'),$this->settings->getMaxHits());
330 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
331 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
349 switch($info[
'type'])
357 $udf_search->setFields(array(
$name));
358 $result_obj = $udf_search->performSearch();
370 $user_search->setFields(array(
$name));
371 $result_obj = $user_search->performSearch();
386 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
388 $query_string =
$_SESSION[
'rep_query'][
'grp'][
'title'];
395 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
397 $object_search->setFilter(array(
'grp'));
409 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
411 $query_string =
$_SESSION[
'rep_query'][
'crs'][
'title'];
418 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
420 $object_search->setFilter(array(
'crs'));
432 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
434 $query_string =
$_SESSION[
'rep_query'][
'role'][
'title'];
442 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
444 $object_search->setFilter(array(
'role'));
459 $query_parser->setMinWordLength(1,
true);
460 $query_parser->parse();
462 if(!$query_parser->validate())
464 return $query_parser->getMessage();
466 return $query_parser;
472 if(is_array(
$_POST[
'rep_query']))
493 $this->search_type =
$_SESSION[
'rep_search_type'];
494 #echo $this->search_type;
506 foreach($this->search_results as $result)
510 if(!
$_SESSION[
'rep_search'][$this->search_type])
526 return $_SESSION[
'rep_search'][
'usr'] = $a_usr_ids;
532 return $_SESSION[
'rep_search'][
'usr'] ? array_unique(
$_SESSION[
'rep_search'][
'usr']) : array();
537 if($this->stored ==
false)
539 $this->result_obj->mergeEntries($new_res);
540 $this->stored =
true;
545 $this->result_obj->intersectEntries($new_res);
556 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
559 $this->lng->txt(
'search_new'),
560 $this->ctrl->getLinkTarget($this,
'showSearch')
562 $this->tpl->setVariable(
'ACTION_BUTTONS',$toolbar->getHTML());
570 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.rep_search_result.html',
'Services/Search');
573 switch($this->search_type)
600 include_once
'./Services/Search/classes/class.ilRepositoryUserResultTableGUI.php';
603 $table->initMultiCommands($this->add_options);
604 $table->parseUserIds($a_usr_ids);
606 $this->tpl->setVariable(
'RES_TABLE',$table->getHTML());
616 include_once
'./Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
619 $table->parseObjectIds($a_obj_ids);
621 $this->tpl->setVariable(
'RES_TABLE',$table->getHTML());
631 include_once
'./Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
634 $table->parseObjectIds($a_obj_ids);
636 $this->tpl->setVariable(
'RES_TABLE',$table->getHTML());
646 include_once
'./Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
649 $table->parseObjectIds($a_obj_ids);
651 $this->tpl->setVariable(
'RES_TABLE',$table->getHTML());
662 if (
$_GET[
"list_obj"] !=
"" && !is_array(
$_POST[
'obj']))
677 foreach(
$_POST[
'obj'] as $obj_id)
683 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
685 $members = array_merge($members, $part->getParticipants());
689 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
691 $members = array_merge($members, $part->getParticipants());
697 $members = array_merge($members, $rbacreview->assignedUsers($obj_id));
701 $members = array_unique((array) $members);
704 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.rep_search_result.html',
'Services/Search');
730 if($a_data[
'type'] ==
'usr')
732 if($a_data[
'obj_id'] == ANONYMOUS_USER_ID)