ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilRepositorySearchGUI Class Reference
+ Inheritance diagram for ilRepositorySearchGUI:
+ Collaboration diagram for ilRepositorySearchGUI:

Public Member Functions

 __construct ()
 Constructor public. More...
 
 setTitle ($a_title)
 Set form title. More...
 
 getTitle ()
 Get search form title. More...
 
 enableSearchableCheck ($a_status)
 En/disable the validation of the searchable flag. More...
 
 isSearchableCheckEnabled ()
 
 setPrivacyMode ($privacy_mode)
 
 getPrivacyMode ()
 
 setString ($a_str)
 Set/get search string public. More...
 
 getString ()
 
 executeCommand ()
 Control public. More...
 
 __clearSession ()
 
 cancel ()
 
 start ()
 
 addUser ()
 
 setCallback (&$class, $method, $a_add_options=array())
 
 showSearch ()
 
 showSearchSelected ()
 submit from autocomplete More...
 
 initFormSearch (ilObjUser $user=NULL)
 
 show ()
 
 appendSearch ()
 
 performSearch ()
 Perform a search. More...
 
 __performUserSearch ()
 
 __performGroupSearch ()
 Search groups. More...
 
 __performRoleSearch ()
 Search roles. More...
 
__parseQueryString ($a_string, $a_combination_or=true, $a_ignore_length=false)
 parse query string, using query parser instance More...
 
 __loadQueries ()
 
 __setSearchType ()
 
 __updateResults ()
 
 __appendToStoredResults ($a_usr_ids)
 
 __storeEntries (&$new_res)
 
 showSearchResults ()
 
 searchResultFilterListener ($a_ref_id, $a_data)
 Listener called from ilSearchResult Id is obj_id for role, usr Id is ref_id for crs grp. More...
 
 allowObjectSelection ($a_value=false)
 Toggle object selection status. More...
 
 setUserLimitations ($a_limitations)
 allow user limitations like inactive and access limitations More...
 
 getUserLimitations ()
 allow user limitations like inactive and access limitations More...
 

Static Public Member Functions

static fillAutoCompleteToolbar ($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
 fill toolbar with More...
 

Data Fields

 $search_type = 'usr'
 

Protected Member Functions

 doUserAutoComplete ()
 Do auto completion. More...
 
 addUserFromAutoComplete ()
 Add user from auto complete input. More...
 
 showClipboard ()
 
 addFromClipboard ()
 add users from clipboard More...
 
 removeFromClipboard ()
 Remove from clipboard. More...
 
 emptyClipboard ()
 Remove from clipboard. More...
 
 handleMultiCommand ()
 Handle multi command. More...
 
 __performCourseSearch ()
 Search courses. More...
 
 addNewSearchButton ()
 Add new search button. More...
 
 showSearchUserTable ($a_usr_ids, $a_parent_cmd)
 Show usr table. More...
 
 showSearchRoleTable ($a_obj_ids)
 Show usr table. More...
 
 showSearchGroupTable ($a_obj_ids)
 
 showSearchCourseTable ($a_obj_ids)
 
 listUsers ()
 List users of course/group/roles. More...
 
 storedUserList ()
 Called from table sort. More...
 
 selectObject ()
 Return selection of course/group/roles to calling script. More...
 

Protected Attributes

 $add_options = array()
 
 $object_selection = false
 
 $searchable_check = true
 
 $search_title = ''
 
 $user_limitations = true
 

Private Attributes

 $search_results = array()
 
 $privacy_mode = ilUserAutoComplete::PRIVACY_MODE_IGNORE_USER_SETTING
 

Detailed Description

Definition at line 42 of file class.ilRepositorySearchGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilRepositorySearchGUI::__construct ( )

Constructor public.

Definition at line 65 of file class.ilRepositorySearchGUI.php.

References $ilCtrl, $lng, $tpl, __loadQueries(), __setSearchType(), settings(), and setTitle().

66  {
67  global $ilCtrl,$tpl,$lng;
68 
69  $this->ctrl = $ilCtrl;
70  $this->tpl = $tpl;
71  $this->lng = $lng;
72  $this->lng->loadLanguageModule('search');
73  $this->lng->loadLanguageModule('crs');
74 
75  $this->setTitle($this->lng->txt('add_members_header'));
76 
77  $this->__setSearchType();
78  $this->__loadQueries();
79 
80  $this->result_obj = new ilSearchResult();
81  $this->result_obj->setMaxHits(1000000);
82  $this->settings = new ilSearchSettings();
83 
84  }
setTitle($a_title)
Set form title.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
settings()
Definition: settings.php:2
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

Member Function Documentation

◆ __appendToStoredResults()

ilRepositorySearchGUI::__appendToStoredResults (   $a_usr_ids)

Definition at line 1017 of file class.ilRepositorySearchGUI.php.

References $_SESSION, and array.

Referenced by listUsers().

1018  {
1019  if(!$_SESSION['search_append'])
1020  {
1021  return $_SESSION['rep_search']['usr'] = $a_usr_ids;
1022  }
1023  $_SESSION['rep_search']['usr'] = array();
1024  foreach($a_usr_ids as $usr_id)
1025  {
1026  $_SESSION['rep_search']['usr'][] = $usr_id;
1027  }
1028  return $_SESSION['rep_search']['usr'] ? array_unique($_SESSION['rep_search']['usr']) : array();
1029  }
$_SESSION["AccountId"]
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ __clearSession()

ilRepositorySearchGUI::__clearSession ( )

Definition at line 391 of file class.ilRepositorySearchGUI.php.

References $_SESSION.

Referenced by start().

392  {
393 
394  unset($_SESSION['rep_search']);
395  unset($_SESSION['append_results']);
396  unset($_SESSION['rep_query']);
397  unset($_SESSION['rep_search_type']);
398  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ __loadQueries()

ilRepositorySearchGUI::__loadQueries ( )

Definition at line 965 of file class.ilRepositorySearchGUI.php.

References $_POST, and $_SESSION.

Referenced by __construct().

966  {
967  if(is_array($_POST['rep_query']))
968  {
969  $_SESSION['rep_query'] = $_POST['rep_query'];
970  }
971  }
$_SESSION["AccountId"]
$_POST["username"]
+ Here is the caller graph for this function:

◆ __parseQueryString()

& ilRepositorySearchGUI::__parseQueryString (   $a_string,
  $a_combination_or = true,
  $a_ignore_length = false 
)

parse query string, using query parser instance

Returns
object of query parser or error message if an error occured public

Definition at line 943 of file class.ilRepositorySearchGUI.php.

References QP_COMBINATION_AND, QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by __performCourseSearch(), __performGroupSearch(), __performRoleSearch(), and __performUserSearch().

944  {
945  $query_parser = new ilQueryParser(ilUtil::stripSlashes($a_string));
946  $query_parser->setCombination($a_combination_or ? QP_COMBINATION_OR : QP_COMBINATION_AND);
947  $query_parser->setMinWordLength(1);
948 
949  // #17502
950  if(!(bool)$a_ignore_length)
951  {
952  $query_parser->setGlobalMinLength(3); // #14768
953  }
954 
955  $query_parser->parse();
956 
957  if(!$query_parser->validate())
958  {
959  return $query_parser->getMessage();
960  }
961  return $query_parser;
962  }
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const QP_COMBINATION_AND
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performCourseSearch()

ilRepositorySearchGUI::__performCourseSearch ( )
protected

Search courses.

Returns

Definition at line 895 of file class.ilRepositorySearchGUI.php.

References $_SESSION, __parseQueryString(), __storeEntries(), array, and ilUtil\sendInfo().

Referenced by performSearch().

896  {
897  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
898 
899  $query_string = $_SESSION['rep_query']['crs']['title'];
900  if(!is_object($query_parser = $this->__parseQueryString($query_string)))
901  {
902  ilUtil::sendInfo($query_parser,true);
903  return false;
904  }
905 
906  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
907  $object_search = new ilLikeObjectSearch($query_parser);
908  $object_search->setFilter(array('crs'));
909  $this->__storeEntries($object_search->performSearch());
910 
911  return true;
912  }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
& __parseQueryString($a_string, $a_combination_or=true, $a_ignore_length=false)
parse query string, using query parser instance
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performGroupSearch()

ilRepositorySearchGUI::__performGroupSearch ( )

Search groups.

Returns

Definition at line 872 of file class.ilRepositorySearchGUI.php.

References $_SESSION, __parseQueryString(), __storeEntries(), array, and ilUtil\sendInfo().

Referenced by performSearch().

873  {
874  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
875 
876  $query_string = $_SESSION['rep_query']['grp']['title'];
877  if(!is_object($query_parser = $this->__parseQueryString($query_string)))
878  {
879  ilUtil::sendInfo($query_parser,true);
880  return false;
881  }
882 
883  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
884  $object_search = new ilLikeObjectSearch($query_parser);
885  $object_search->setFilter(array('grp'));
886  $this->__storeEntries($object_search->performSearch());
887 
888  return true;
889  }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
& __parseQueryString($a_string, $a_combination_or=true, $a_ignore_length=false)
parse query string, using query parser instance
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performRoleSearch()

ilRepositorySearchGUI::__performRoleSearch ( )

Search roles.

Returns

Definition at line 918 of file class.ilRepositorySearchGUI.php.

References $_SESSION, __parseQueryString(), __storeEntries(), array, and ilUtil\sendInfo().

Referenced by performSearch().

919  {
920  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
921 
922  $query_string = $_SESSION['rep_query']['role']['title'];
923  if(!is_object($query_parser = $this->__parseQueryString($query_string)))
924  {
925  ilUtil::sendInfo($query_parser,true);
926  return false;
927  }
928 
929  // Perform like search
930  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
931  $object_search = new ilLikeObjectSearch($query_parser);
932  $object_search->setFilter(array('role'));
933  $this->__storeEntries($object_search->performSearch());
934 
935  return true;
936  }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
& __parseQueryString($a_string, $a_combination_or=true, $a_ignore_length=false)
parse query string, using query parser instance
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performUserSearch()

ilRepositorySearchGUI::__performUserSearch ( )

Definition at line 799 of file class.ilRepositorySearchGUI.php.

References $_SESSION, $info, __parseQueryString(), __storeEntries(), ilUserSearchOptions\_getSearchableFieldsInfo(), ilObjectSearchFactory\_getUserDefinedFieldSearchInstance(), ilObjectSearchFactory\_getUserSearchInstance(), array, FIELD_TYPE_MULTI, FIELD_TYPE_SELECT, FIELD_TYPE_TEXT, FIELD_TYPE_UDF_SELECT, FIELD_TYPE_UDF_TEXT, ilObjectSearchFactory\getUserMultiFieldSearchInstance(), ilObjectSearchFactory\getUserOrgUnitAssignmentInstance(), isSearchableCheckEnabled(), and ilUtil\sendInfo().

Referenced by performSearch().

800  {
801  include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
802  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
803 
805  {
806  $name = $info['db'];
807  $query_string = $_SESSION['rep_query']['usr'][$name];
808 
809  // continue if no query string is given
810  if(!$query_string)
811  {
812  continue;
813  }
814 
815  if(!is_object($query_parser = $this->__parseQueryString($query_string, true, ($info['type'] == FIELD_TYPE_SELECT))))
816  {
817  ilUtil::sendInfo($query_parser);
818  return false;
819  }
820  switch($info['type'])
821  {
823  // Do a phrase query for select fields
824  $query_parser = $this->__parseQueryString('"'.$query_string.'"');
825 
826  case FIELD_TYPE_UDF_TEXT:
828  $udf_search->setFields(array($name));
829  $result_obj = $udf_search->performSearch();
830 
831  // Store entries
832  $this->__storeEntries($result_obj);
833  break;
834 
835  case FIELD_TYPE_SELECT:
836 
837  if($info['db'] == 'org_units')
838  {
839  $user_search = ilObjectSearchFactory::getUserOrgUnitAssignmentInstance($query_parser);
840  $result_obj = $user_search->performSearch();
841  $this->__storeEntries($result_obj);
842  break;
843  }
844 
845  // Do a phrase query for select fields
846  $query_parser = $this->__parseQueryString('"'.$query_string.'"', true, true);
847 
848  case FIELD_TYPE_TEXT:
849  $user_search =& ilObjectSearchFactory::_getUserSearchInstance($query_parser);
850  $user_search->setFields(array($name));
851  $result_obj = $user_search->performSearch();
852 
853  // store entries
854  $this->__storeEntries($result_obj);
855  break;
856 
857  case FIELD_TYPE_MULTI:
858  $multi_search = ilObjectSearchFactory::getUserMultiFieldSearchInstance($query_parser);
859  $multi_search->setFields(array($name));
860  $result_obj = $multi_search->performSearch();
861  $this->__storeEntries($result_obj);
862  break;
863 
864  }
865  }
866  }
$_SESSION["AccountId"]
const FIELD_TYPE_MULTI
const FIELD_TYPE_UDF_TEXT
const FIELD_TYPE_SELECT
static getUserMultiFieldSearchInstance($query_parser)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$info
Definition: example_052.php:80
static _getUserSearchInstance($query_parser)
get reference of ilLikeUserSearch
const FIELD_TYPE_UDF_SELECT
Class ilUserSearchOptions.
Create styles array
The data for the language used.
& __parseQueryString($a_string, $a_combination_or=true, $a_ignore_length=false)
parse query string, using query parser instance
const FIELD_TYPE_TEXT
static getUserOrgUnitAssignmentInstance($query_parser)
get orgunit search instance
static _getUserDefinedFieldSearchInstance($query_parser)
get reference of ilLikeUserDefinedFieldSearch
static _getSearchableFieldsInfo($a_admin=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setSearchType()

ilRepositorySearchGUI::__setSearchType ( )

Definition at line 974 of file class.ilRepositorySearchGUI.php.

References $_POST, and $_SESSION.

Referenced by __construct().

975  {
976  // Update search type. Default to user search
977  if($_POST['search_for'])
978  {
979  #echo 1;
980  $_SESSION['rep_search_type'] = $_POST['search_for'];
981  }
982  if(!$_POST['search_for'] and !$_SESSION['rep_search_type'])
983  {
984  #echo 2;
985  $_SESSION['rep_search_type'] = 'usr';
986  }
987 
988  $this->search_type = $_SESSION['rep_search_type'];
989  #echo $this->search_type;
990 
991  return true;
992  }
$_SESSION["AccountId"]
$_POST["username"]
+ Here is the caller graph for this function:

◆ __storeEntries()

ilRepositorySearchGUI::__storeEntries ( $new_res)

Definition at line 1031 of file class.ilRepositorySearchGUI.php.

Referenced by __performCourseSearch(), __performGroupSearch(), __performRoleSearch(), and __performUserSearch().

1032  {
1033  if($this->stored == false)
1034  {
1035  $this->result_obj->mergeEntries($new_res);
1036  $this->stored = true;
1037  return true;
1038  }
1039  else
1040  {
1041  $this->result_obj->intersectEntries($new_res);
1042  return true;
1043  }
1044  }
+ Here is the caller graph for this function:

◆ __updateResults()

ilRepositorySearchGUI::__updateResults ( )

Definition at line 995 of file class.ilRepositorySearchGUI.php.

References $_SESSION, $result, $search_type, and array.

Referenced by performSearch().

996  {
997  if(!$_SESSION['search_append'])
998  {
999  $_SESSION['rep_search'] = array();
1000  }
1001  foreach($this->search_results as $result)
1002  {
1003  $_SESSION['rep_search'][$this->search_type][] = $result;
1004  }
1005  if(!$_SESSION['rep_search'][$this->search_type])
1006  {
1007  $_SESSION['rep_search'][$this->search_type] = array();
1008  }
1009  else
1010  {
1011  // remove duplicate entries
1012  $_SESSION['rep_search'][$this->search_type] = array_unique($_SESSION['rep_search'][$this->search_type]);
1013  }
1014  return true;
1015  }
$_SESSION["AccountId"]
$result
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ addFromClipboard()

ilRepositorySearchGUI::addFromClipboard ( )
protected

add users from clipboard

Definition at line 478 of file class.ilRepositorySearchGUI.php.

References $_POST, $GLOBALS, array, and ilUtil\sendFailure().

479  {
480  $GLOBALS['ilCtrl']->setParameter($this, 'user_type', (int) $_REQUEST['user_type']);
481  $users = (array) $_POST['uids'];
482  if(!count($users))
483  {
484  ilUtil::sendFailure($this->lng->txt('select_one'), true);
485  $GLOBALS['ilCtrl']->redirect($this, 'showClipboard');
486  }
487  $class = $this->callback['class'];
488  $method = $this->callback['method'];
489  $user_type = isset($_REQUEST['user_type']) ? $_REQUEST['user_type'] : 0;
490 
491  if(!$class->$method($users,$user_type))
492  {
493  $GLOBALS['ilCtrl']->returnToParent($this);
494  }
495  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ addNewSearchButton()

ilRepositorySearchGUI::addNewSearchButton ( )
protected

Add new search button.

Returns

Definition at line 1050 of file class.ilRepositorySearchGUI.php.

Referenced by listUsers(), showSearchResults(), and showSearchSelected().

1051  {
1052  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1053  $toolbar = new ilToolbarGUI();
1054  $toolbar->addButton(
1055  $this->lng->txt('search_new'),
1056  $this->ctrl->getLinkTarget($this,'showSearch')
1057  );
1058  $this->tpl->setVariable('ACTION_BUTTONS',$toolbar->getHTML());
1059  }
+ Here is the caller graph for this function:

◆ addUser()

ilRepositorySearchGUI::addUser ( )

Definition at line 415 of file class.ilRepositorySearchGUI.php.

References $_POST, and showSearchResults().

416  {
417  $class = $this->callback['class'];
418  $method = $this->callback['method'];
419 
420  // call callback if that function does give a return value => show error message
421  // listener redirects if everything is ok.
422  $class->$method($_POST['user']);
423 
424  $this->showSearchResults();
425  }
$_POST["username"]
+ Here is the call graph for this function:

◆ addUserFromAutoComplete()

ilRepositorySearchGUI::addUserFromAutoComplete ( )
protected

Add user from auto complete input.

Definition at line 430 of file class.ilRepositorySearchGUI.php.

References $_POST, $GLOBALS, ilObjUser\_lookupId(), and array.

431  {
432  $class = $this->callback['class'];
433  $method = $this->callback['method'];
434 
435  $users = explode(',', $_POST['user_login']);
436  $user_ids = array();
437  foreach($users as $user)
438  {
439  $user_id = ilObjUser::_lookupId($user);
440  if($user_id)
441  {
442  $user_ids[] = $user_id;
443  }
444  }
445 
446  $user_type = isset($_REQUEST['user_type']) ? $_REQUEST['user_type'] : 0;
447 
448  if(!$class->$method($user_ids,$user_type))
449  {
450  $GLOBALS['ilCtrl']->returnToParent($this);
451  }
452  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupId($a_user_str)
Lookup id by login.
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ allowObjectSelection()

ilRepositorySearchGUI::allowObjectSelection (   $a_value = false)

Toggle object selection status.

Parameters
bool$a_value

Definition at line 1262 of file class.ilRepositorySearchGUI.php.

1263  {
1264  $this->object_selection = (bool)$a_value;
1265  }

◆ appendSearch()

ilRepositorySearchGUI::appendSearch ( )

Definition at line 701 of file class.ilRepositorySearchGUI.php.

References $_SESSION, and performSearch().

702  {
703  $_SESSION['search_append'] = true;
704  $this->performSearch();
705  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ cancel()

ilRepositorySearchGUI::cancel ( )

Definition at line 400 of file class.ilRepositorySearchGUI.php.

401  {
402  $this->ctrl->returnToParent($this);
403  }

◆ doUserAutoComplete()

ilRepositorySearchGUI::doUserAutoComplete ( )
protected

Do auto completion.

Returns
void

Definition at line 310 of file class.ilRepositorySearchGUI.php.

References $_GET, $GLOBALS, array, ilJsonUtil\encode(), exit, getPrivacyMode(), getUserLimitations(), ilUserAutoComplete\MAX_ENTRIES, and string.

311  {
312  // hide anonymout request
313  if($GLOBALS['ilUser']->getId() == ANONYMOUS_USER_ID)
314  {
315  include_once './Services/JSON/classes/class.ilJsonUtil.php';
316  return ilJsonUtil::encode(new stdClass());
317  exit;
318  }
319 
320 
321  if(!isset($_GET['autoCompleteField']))
322  {
323  $a_fields = array('login','firstname','lastname','email');
324  $result_field = 'login';
325  }
326  else
327  {
328  $a_fields = array((string) $_GET['autoCompleteField']);
329  $result_field = (string) $_GET['autoCompleteField'];
330  }
331 
332  include_once './Services/User/classes/class.ilUserAutoComplete.php';
333  $auto = new ilUserAutoComplete();
334  $auto->setPrivacyMode($this->getPrivacyMode());
335 
336  if(($_REQUEST['fetchall']))
337  {
338  $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
339  }
340 
341  $auto->setMoreLinkAvailable(true);
342  $auto->setSearchFields($a_fields);
343  $auto->setResultField($result_field);
344  $auto->enableFieldSearchableCheck(true);
345  $auto->setUserLimitations($this->getUserLimitations());
346 
347  echo $auto->getList($_REQUEST['term']);
348  exit();
349  }
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Add rich text string
The name of the decorator.
Auto completion class for user lists.
static encode($mixed, $suppress_native=false)
getUserLimitations()
allow user limitations like inactive and access limitations
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ emptyClipboard()

ilRepositorySearchGUI::emptyClipboard ( )
protected

Remove from clipboard.

Definition at line 522 of file class.ilRepositorySearchGUI.php.

References $GLOBALS, ilUserClipboard\getInstance(), and ilUtil\sendSuccess().

523  {
524  include_once './Services/User/classes/class.ilUserClipboard.php';
525  $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
526  $clip->clear();
527  $clip->save();
528 
529  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
530  $this->ctrl->returnToParent($this);
531  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getInstance($a_usr_id)
Get singelton instance.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the call graph for this function:

◆ enableSearchableCheck()

ilRepositorySearchGUI::enableSearchableCheck (   $a_status)

En/disable the validation of the searchable flag.

Parameters
bool$a_status

Definition at line 108 of file class.ilRepositorySearchGUI.php.

109  {
110  $this->searchable_check = $a_status;
111  }

◆ executeCommand()

ilRepositorySearchGUI::executeCommand ( )

Control public.

Definition at line 369 of file class.ilRepositorySearchGUI.php.

References $cmd.

370  {
371  global $rbacsystem;
372 
373  $next_class = $this->ctrl->getNextClass($this);
374  $cmd = $this->ctrl->getCmd();
375 
376  $this->ctrl->setReturn($this,'');
377 
378  switch($next_class)
379  {
380  default:
381  if(!$cmd)
382  {
383  $cmd = "showSearch";
384  }
385  $this->$cmd();
386  break;
387  }
388  return true;
389  }
$cmd
Definition: sahs_server.php:35

◆ fillAutoCompleteToolbar()

static ilRepositorySearchGUI::fillAutoCompleteToolbar (   $parent_object,
ilToolbarGUI  $toolbar = null,
  $a_options = array(),
  $a_sticky = false 
)
static

fill toolbar with

Parameters
ilToolbarGUI$toolbar
arrayoptions: all are optional e.g. array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCourseParticipants::CRS_MEMBER,ilCourseParticpants::CRS_TUTOR), submit_name = $lng->txt('add') )
Returns
ilToolbarGUI

Definition at line 152 of file class.ilRepositorySearchGUI.php.

References $GLOBALS, $ilCtrl, $lng, $si, ilObject\_lookupObjId(), array, ilSubmitButton\getInstance(), ilLinkButton\getInstance(), ilUserClipboard\getInstance(), and ilSplitButtonGUI\getInstance().

Referenced by ilOrgUnitStaffGUI\addOtherRolesToolbar(), ilOrgUnitStaffGUI\addStaffToolbar(), ilObjBlogGUI\contributors(), ilForumModeratorsGUI\detachModeratorRole(), ilSurveyParticipantsGUI\editRatersObject(), ilSurveyParticipantsGUI\inviteObject(), ilSurveyParticipantsGUI\listAppraiseesObject(), ilExerciseManagementGUI\membersObject(), ilObjTestGUI\participantsObject(), ilMembershipGUI\showParticipantsToolbar(), ilSkillProfileGUI\showUsers(), ilExSubmissionTeamGUI\submissionScreenTeamObject(), ilObjRoleGUI\userassignmentObject(), and ilIndividualAssessmentMembersGUI\view().

153  {
154  global $ilToolbar, $lng, $ilCtrl, $tree;
155 
156  if(!$toolbar instanceof ilToolbarGUI)
157  {
158  $toolbar = $ilToolbar;
159  }
160 
161  // Fill default options
162  if(!isset($a_options['auto_complete_name']))
163  {
164  $a_options['auto_complete_name'] = $lng->txt('obj_user');
165  }
166  if(!isset($a_options['auto_complete_size']))
167  {
168  $a_options['auto_complete_size'] = 15;
169  }
170  if(!isset($a_options['submit_name']))
171  {
172  $a_options['submit_name'] = $lng->txt('btn_add');
173  }
174  if(!isset($a_options['user_type_default']))
175  {
176  $a_options['user_type_default'] = null;
177  }
178 
179  $ajax_url = $ilCtrl->getLinkTargetByClass(array(get_class($parent_object),'ilRepositorySearchGUI'),
180  'doUserAutoComplete', '', true,false);
181 
182  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
183  $ul = new ilTextInputGUI($a_options['auto_complete_name'], 'user_login');
184  $ul->setDataSource($ajax_url);
185  $ul->setSize($a_options['auto_complete_size']);
186  if(!$a_sticky)
187  {
188  $toolbar->addInputItem($ul, true);
189  }
190  else
191  {
192  $toolbar->addStickyItem($ul, true);
193  }
194 
195  if(count((array) $a_options['user_type']))
196  {
197  include_once './Services/Form/classes/class.ilSelectInputGUI.php';
198  $si = new ilSelectInputGUI("", "user_type");
199  $si->setOptions($a_options['user_type']);
200  $si->setValue($a_options['user_type_default']);
201  if(!$a_sticky)
202  {
203  $toolbar->addInputItem($si);
204  }
205  else
206  {
207  $toolbar->addStickyItem($si);
208  }
209  }
210 
211  include_once './Services/User/classes/class.ilUserClipboard.php';
212  $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
213  if($clip->hasContent())
214  {
215  include_once './Services/UIComponent/SplitButton/classes/class.ilSplitButtonGUI.php';
216  $action_button = ilSplitButtonGUI::getInstance();
217 
218  include_once './Services/UIComponent/Button/classes/class.ilLinkButton.php';
219  $add_button = ilSubmitButton::getInstance();
220  $add_button->setCaption($a_options['submit_name'], false);
221  $add_button->setCommand('addUserFromAutoComplete');
222 
223  $action_button->setDefaultButton($add_button);
224 
225  include_once './Services/UIComponent/Button/classes/class.ilLinkButton.php';
226  $clip_button = ilSubmitButton::getInstance();
227  $clip_button->addCSSClass('btn btndefault');
228  $GLOBALS['DIC']->language()->loadLanguageModule('user');
229  $clip_button->setCaption($GLOBALS['DIC']->language()->txt('clipboard_add_from_btn'), false);
230  $clip_button->setCommand('showClipboard');
231 
232  $action_button->addMenuItem(new ilButtonToSplitButtonMenuItemAdapter($clip_button));
233 
234  $toolbar->addButtonInstance($action_button);
235  }
236  else
237  {
238  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
239  $button = ilSubmitButton::getInstance();
240  $button->setCaption($a_options['submit_name'], false);
241  $button->setCommand('addUserFromAutoComplete');
242  if(!$a_sticky)
243  {
244  $toolbar->addButtonInstance($button);
245  }
246  else
247  {
248  $toolbar->addStickyItem($button);
249  }
250  }
251 
252  if((bool)$a_options['add_search'] ||
253  is_numeric($a_options['add_from_container']))
254  {
255  $lng->loadLanguageModule("search");
256 
257  $toolbar->addSeparator();
258 
259  if((bool)$a_options['add_search'])
260  {
261  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
262  $button = ilLinkButton::getInstance();
263  $button->setCaption("search_users");
264  $button->setUrl($ilCtrl->getLinkTargetByClass('ilRepositorySearchGUI',''));
265  $toolbar->addButtonInstance($button);
266  }
267 
268  if(is_numeric($a_options['add_from_container']))
269  {
270  $parent_ref_id = (int)$a_options['add_from_container'];
271  $parent_container_ref_id = $tree->checkForParentType($parent_ref_id, "grp");
272  $parent_container_type = "grp";
273  if(!$parent_container_ref_id)
274  {
275  $parent_container_ref_id = $tree->checkForParentType($parent_ref_id, "crs");
276  $parent_container_type = "crs";
277  }
278  if($parent_container_ref_id)
279  {
280  if((bool)$a_options['add_search'])
281  {
282  $toolbar->addSpacer();
283  }
284 
285  $ilCtrl->setParameterByClass('ilRepositorySearchGUI', "list_obj", ilObject::_lookupObjId($parent_container_ref_id));
286 
287  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
288  $button = ilLinkButton::getInstance();
289  $button->setCaption("search_add_members_from_container_".$parent_container_type);
290  $button->setUrl($ilCtrl->getLinkTargetByClass(array(get_class($parent_object),'ilRepositorySearchGUI'), 'listUsers'));
291  $toolbar->addButtonInstance($button);
292  }
293  }
294  }
295 
296  $toolbar->setFormAction(
297  $ilCtrl->getFormActionByClass(
298  array(
299  get_class($parent_object),
300  'ilRepositorySearchGUI')
301  )
302  );
303  return $toolbar;
304  }
static getInstance($a_usr_id)
Get singelton instance.
This class represents a selection list property in a property form.
addSpacer($a_width=null)
Add spacer.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
addButtonInstance(ilButtonBase $a_button)
Add button instance.
global $ilCtrl
Definition: ilias.php:18
addInputItem(ilToolbarItem $a_item, $a_output_label=false)
Add input item.
setFormAction($a_val, $a_multipart=false, $a_target="")
Set form action (if form action is set, toolbar is wrapped into form tags)
static _lookupObjId($a_id)
This class represents a text property in a property form.
addSeparator()
Add separator.
Create styles array
The data for the language used.
addStickyItem(ilToolbarItem $a_item, $a_output_label=false)
Add a sticky item.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPrivacyMode()

ilRepositorySearchGUI::getPrivacyMode ( )
Returns
int

Definition at line 133 of file class.ilRepositorySearchGUI.php.

References $privacy_mode.

Referenced by doUserAutoComplete().

+ Here is the caller graph for this function:

◆ getString()

ilRepositorySearchGUI::getString ( )

Definition at line 360 of file class.ilRepositorySearchGUI.php.

361  {
362  return $this->string;
363  }

◆ getTitle()

ilRepositorySearchGUI::getTitle ( )

Get search form title.

Returns
string

Definition at line 99 of file class.ilRepositorySearchGUI.php.

References $search_title.

Referenced by initFormSearch().

+ Here is the caller graph for this function:

◆ getUserLimitations()

ilRepositorySearchGUI::getUserLimitations ( )

allow user limitations like inactive and access limitations

Returns
bool

Definition at line 1303 of file class.ilRepositorySearchGUI.php.

References $user_limitations.

Referenced by doUserAutoComplete(), and showSearchUserTable().

1304  {
1305  return $this->user_limitations;
1306  }
+ Here is the caller graph for this function:

◆ handleMultiCommand()

ilRepositorySearchGUI::handleMultiCommand ( )
protected

Handle multi command.

Definition at line 536 of file class.ilRepositorySearchGUI.php.

References $_POST, array, and showSearchResults().

537  {
538  $class = $this->callback['class'];
539  $method = $this->callback['method'];
540 
541  // Redirects if everything is ok
542  if(!$class->$method((array) $_POST['user'],$_POST['selectedCommand']))
543  {
544  $this->showSearchResults();
545  }
546  }
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ initFormSearch()

ilRepositorySearchGUI::initFormSearch ( ilObjUser  $user = NULL)

Definition at line 579 of file class.ilRepositorySearchGUI.php.

References $ilCtrl, $info, $txt, ilUserSearchOptions\_getSearchableFieldsInfo(), ilRadioOption\addSubItem(), FIELD_TYPE_MULTI, FIELD_TYPE_SELECT, FIELD_TYPE_TEXT, FIELD_TYPE_UDF_SELECT, FIELD_TYPE_UDF_TEXT, getTitle(), isSearchableCheckEnabled(), and ilRadioGroupInputGUI\setValue().

Referenced by showSearch().

580  {
581  global $ilCtrl;
582 
583  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
584 
585  $this->form = new ilPropertyFormGUI();
586  $this->form->setFormAction($this->ctrl->getFormAction($this,'search'));
587  $this->form->setTitle($this->getTitle());
588  $this->form->addCommandButton('performSearch', $this->lng->txt('search'));
589  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
590 
591 
592  $kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'),'search_for');
593  $kind->setValue($this->search_type);
594  $this->form->addItem($kind);
595 
596  // Users
597  $users = new ilRadioOption($this->lng->txt('search_for_users'),'usr');
598 
599  // UDF
600  include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
602  {
603  switch($info['type'])
604  {
606  case FIELD_TYPE_SELECT:
607 
608  $sel = new ilSelectInputGUI($info['lang'],"rep_query[usr][".$info['db']."]");
609  $sel->setOptions($info['values']);
610  $users->addSubItem($sel);
611  break;
612 
613  case FIELD_TYPE_MULTI:
614  case FIELD_TYPE_UDF_TEXT:
615  case FIELD_TYPE_TEXT:
616 
617  if(isset($info['autoComplete']) and $info['autoComplete'])
618  {
619  $ilCtrl->setParameterByClass(get_class($this),'autoCompleteField',$info['db']);
620  $ul = new ilTextInputGUI($info['lang'], "rep_query[usr][".$info['db']."]");
621  $ul->setDataSourceSubmitOnSelection(TRUE);
622  $ul->setDataSourceSubmitUrl(
623  $this->ctrl->getLinkTarget(
624  $this,
625  'showSearchSelected',
626  '',
627  FALSE,
628  FALSE
629  )
630  );
631  $ul->setDataSource($ilCtrl->getLinkTarget($this,
632  "doUserAutoComplete", "", true));
633  $ul->setSize(30);
634  $ul->setMaxLength(120);
635 
636  if($user instanceof ilObjUser)
637  {
638  switch($info['db'])
639  {
640  case 'firstname':
641  $ul->setValue($user->getFirstname());
642  break;
643  case 'lastname':
644  $ul->setValue($user->getLastname());
645  break;
646  case 'login':
647  $ul->setValue($user->getLogin());
648  break;
649  }
650  }
651 
652 
653 
654  $users->addSubItem($ul);
655  }
656  else
657  {
658  $txt = new ilTextInputGUI($info['lang'],"rep_query[usr][".$info['db']."]");
659  $txt->setSize(30);
660  $txt->setMaxLength(120);
661  $users->addSubItem($txt);
662  }
663  break;
664  }
665  }
666  $kind->addOption($users);
667 
668 
669 
670  // Role
671  $roles = new ilRadioOption($this->lng->txt('search_for_role_members'),'role');
672  $role = new ilTextInputGUI($this->lng->txt('search_role_title'),'rep_query[role][title]');
673  $role->setSize(30);
674  $role->setMaxLength(120);
675  $roles->addSubItem($role);
676  $kind->addOption($roles);
677 
678  // Course
679  $groups = new ilRadioOption($this->lng->txt('search_for_crs_members'),'crs');
680  $group = new ilTextInputGUI($this->lng->txt('search_crs_title'),'rep_query[crs][title]');
681  $group->setSize(30);
682  $group->setMaxLength(120);
683  $groups->addSubItem($group);
684  $kind->addOption($groups);
685 
686  // Group
687  $groups = new ilRadioOption($this->lng->txt('search_for_grp_members'),'grp');
688  $group = new ilTextInputGUI($this->lng->txt('search_grp_title'),'rep_query[grp][title]');
689  $group->setSize(30);
690  $group->setMaxLength(120);
691  $groups->addSubItem($group);
692  $kind->addOption($groups);
693  }
This class represents an option in a radio group.
getLogin()
get login / username public
This class represents a selection list property in a property form.
This class represents a property form user interface.
getFirstname()
get firstname public
const FIELD_TYPE_MULTI
const FIELD_TYPE_UDF_TEXT
const FIELD_TYPE_SELECT
global $ilCtrl
Definition: ilias.php:18
$info
Definition: example_052.php:80
This class represents a property in a property form.
getLastname()
get lastname public
addSubItem($a_item)
Add Subitem.
This class represents a text property in a property form.
getTitle()
Get search form title.
const FIELD_TYPE_UDF_SELECT
Class ilUserSearchOptions.
$txt
Definition: error.php:12
const FIELD_TYPE_TEXT
static _getSearchableFieldsInfo($a_admin=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSearchableCheckEnabled()

ilRepositorySearchGUI::isSearchableCheckEnabled ( )
Returns
bool

Definition at line 117 of file class.ilRepositorySearchGUI.php.

References $searchable_check.

Referenced by __performUserSearch(), and initFormSearch().

+ Here is the caller graph for this function:

◆ listUsers()

ilRepositorySearchGUI::listUsers ( )
protected

List users of course/group/roles.

Returns

Definition at line 1174 of file class.ilRepositorySearchGUI.php.

References $_GET, $_POST, $_SESSION, __appendToStoredResults(), ilObject\_lookupType(), addNewSearchButton(), array, ilUserFilter\getInstance(), ilParticipants\getInstanceByObjId(), ilParticipants\hasParticipantListAccess(), ilUtil\sendFailure(), showSearchResults(), and showSearchUserTable().

Referenced by storedUserList().

1175  {
1176  // get parameter is used e.g. in exercises to provide
1177  // "add members of course" link
1178  if ($_GET["list_obj"] != "" && !is_array($_POST['obj']))
1179  {
1180  $_POST['obj'][0] = $_GET["list_obj"];
1181  }
1182  if(!is_array($_POST['obj']) or !$_POST['obj'])
1183  {
1184  ilUtil::sendFailure($this->lng->txt('select_one'));
1185  $this->showSearchResults();
1186  return false;
1187  }
1188 
1189  $_SESSION['rep_search']['objs'] = $_POST['obj'];
1190 
1191  // Get all members
1192  $members = array();
1193  foreach($_POST['obj'] as $obj_id)
1194  {
1195  $type = ilObject::_lookupType($obj_id);
1196  switch($type)
1197  {
1198  case 'crs':
1199  case 'grp':
1200 
1201  include_once './Services/Membership/classes/class.ilParticipants.php';
1203  {
1204  $members = array_merge((array) $members, ilParticipants::getInstanceByObjId($obj_id)->getParticipants());
1205  }
1206  break;
1207 
1208  case 'role':
1209  global $rbacreview;
1210 
1211  include_once './Services/User/classes/class.ilUserFilter.php';
1212  $members = array_merge($members, ilUserFilter::getInstance()->filter($rbacreview->assignedUsers($obj_id)));
1213  break;
1214  }
1215  }
1216  $members = array_unique((array) $members);
1217  $this->__appendToStoredResults($members);
1218 
1219  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.rep_search_result.html','Services/Search');
1220 
1221  $this->addNewSearchButton();
1222  $this->showSearchUserTable($_SESSION['rep_search']['usr'],'storedUserList');
1223  return true;
1224  }
$_SESSION["AccountId"]
$_GET["client_id"]
addNewSearchButton()
Add new search button.
static getInstance()
Singelton get instance.
static hasParticipantListAccess($a_obj_id, $a_usr_id=null)
Check if (current) user has access to the participant list.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
showSearchUserTable($a_usr_ids, $a_parent_cmd)
Show usr table.
$_POST["username"]
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilRepositorySearchGUI::performSearch ( )

Perform a search.

Returns

Definition at line 711 of file class.ilRepositorySearchGUI.php.

References $_POST, $_SESSION, $GLOBALS, $res, __performCourseSearch(), __performGroupSearch(), __performRoleSearch(), __performUserSearch(), __updateResults(), array, ilUserFilter\getInstance(), QP_COMBINATION_OR, ilUtil\sendFailure(), ilUtil\sendInfo(), settings(), show(), showSearch(), start(), and ilUtil\stripSlashes().

Referenced by appendSearch().

712  {
713  $found_query = false;
714  foreach((array) $_POST['rep_query'][$_POST['search_for']] as $field => $value)
715  {
716  if(trim(ilUtil::stripSlashes($value)))
717  {
718  $found_query = true;
719  break;
720  }
721  }
722  if(!$found_query)
723  {
724  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'));
725  $this->start();
726  return false;
727  }
728 
729  // unset search_append if called directly
730  if($_POST['cmd']['performSearch'])
731  {
732  unset($_SESSION['search_append']);
733  }
734 
735  switch($this->search_type)
736  {
737  case 'usr':
738  $this->__performUserSearch();
739  break;
740 
741  case 'grp':
742  $this->__performGroupSearch();
743  break;
744 
745  case 'crs':
746  $this->__performCourseSearch();
747  break;
748 
749  case 'role':
750  $this->__performRoleSearch();
751  break;
752 
753  default:
754  echo 'not defined';
755  }
756 
757  $GLOBALS['DIC']->logger()->src()->dump($this->result_obj->getEntries());
758 
759  $this->result_obj->setRequiredPermission('read');
760  $this->result_obj->addObserver($this, 'searchResultFilterListener');
761  $this->result_obj->filter(ROOT_FOLDER_ID,QP_COMBINATION_OR);
762 
763  // User access filter
764  if($this->search_type == 'usr')
765  {
766  include_once './Services/User/classes/class.ilUserFilter.php';
767  $this->search_results = array_intersect(
768  $this->result_obj->getResultIds(),
769  ilUserFilter::getInstance()->filter($this->result_obj->getResultIds())
770  );
771  }
772  else
773  {
774  $this->search_results = array();
775  foreach((array) $this->result_obj->getResults() as $res)
776  {
777  $this->search_results[] = $res['obj_id'];
778  }
779  }
780 
781  if(!count($this->search_results))
782  {
783  ilUtil::sendFailure($this->lng->txt('search_no_match'));
784  $this->showSearch();
785  return true;
786  }
787  $this->__updateResults();
788  if($this->result_obj->isLimitReached())
789  {
790  $message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
791  ilUtil::sendInfo($message);
792  return true;
793  }
794  // show results
795  $this->show();
796  return true;
797  }
$_SESSION["AccountId"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static getInstance()
Singelton get instance.
const QP_COMBINATION_OR
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
settings()
Definition: settings.php:2
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeFromClipboard()

ilRepositorySearchGUI::removeFromClipboard ( )
protected

Remove from clipboard.

Definition at line 500 of file class.ilRepositorySearchGUI.php.

References $_POST, $GLOBALS, array, ilUserClipboard\getInstance(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

501  {
502  $GLOBALS['ilCtrl']->setParameter($this, 'user_type', (int) $_REQUEST['user_type']);
503  $users = (array) $_POST['uids'];
504  if(!count($users))
505  {
506  ilUtil::sendFailure($this->lng->txt('select_one'), true);
507  $GLOBALS['ilCtrl']->redirect($this, 'showClipboard');
508  }
509 
510  include_once './Services/User/classes/class.ilUserClipboard.php';
511  $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
512  $clip->delete($users);
513  $clip->save();
514 
515  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
516  $this->ctrl->redirect($this, 'showClipboard');
517  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getInstance($a_usr_id)
Get singelton instance.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ searchResultFilterListener()

ilRepositorySearchGUI::searchResultFilterListener (   $a_ref_id,
  $a_data 
)

Listener called from ilSearchResult Id is obj_id for role, usr Id is ref_id for crs grp.

Parameters
int$a_id
array$a_data
Returns

Definition at line 1245 of file class.ilRepositorySearchGUI.php.

1246  {
1247  if($a_data['type'] == 'usr')
1248  {
1249  if($a_data['obj_id'] == ANONYMOUS_USER_ID)
1250  {
1251  return false;
1252  }
1253  }
1254  return true;
1255  }

◆ selectObject()

ilRepositorySearchGUI::selectObject ( )
protected

Return selection of course/group/roles to calling script.

Definition at line 1270 of file class.ilRepositorySearchGUI.php.

References $_GET, $_POST, ilUtil\sendFailure(), and showSearchResults().

1271  {
1272  // get parameter is used e.g. in exercises to provide
1273  // "add members of course" link
1274  if ($_GET["list_obj"] != "" && !is_array($_POST['obj']))
1275  {
1276  $_POST['obj'][0] = $_GET["list_obj"];
1277  }
1278  if(!is_array($_POST['obj']) or !$_POST['obj'])
1279  {
1280  ilUtil::sendFailure($this->lng->txt('select_one'));
1281  $this->showSearchResults();
1282  return false;
1283  }
1284 
1285  $this->ctrl->setParameter($this->callback["class"], "obj", implode(";", $_POST["obj"]));
1286  $this->ctrl->redirect($this->callback["class"], $this->callback["method"]);
1287  }
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ setCallback()

ilRepositorySearchGUI::setCallback ( $class,
  $method,
  $a_add_options = array() 
)

Definition at line 548 of file class.ilRepositorySearchGUI.php.

References array.

549  {
550  $this->callback = array('class' => $class,'method' => $method);
551  $this->add_options = $a_add_options ? $a_add_options : array();
552  }
Create styles array
The data for the language used.

◆ setPrivacyMode()

ilRepositorySearchGUI::setPrivacyMode (   $privacy_mode)
Parameters
int$privacy_mode

Definition at line 125 of file class.ilRepositorySearchGUI.php.

References $privacy_mode.

126  {
127  $this->privacy_mode = $privacy_mode;
128  }

◆ setString()

ilRepositorySearchGUI::setString (   $a_str)

Set/get search string public.

Definition at line 356 of file class.ilRepositorySearchGUI.php.

References $_SESSION.

357  {
358  $_SESSION['search']['string'] = $this->string = $a_str;
359  }
$_SESSION["AccountId"]

◆ setTitle()

ilRepositorySearchGUI::setTitle (   $a_title)

Set form title.

Parameters
string$a_title

Definition at line 90 of file class.ilRepositorySearchGUI.php.

Referenced by __construct().

91  {
92  $this->search_title = $a_title;
93  }
+ Here is the caller graph for this function:

◆ setUserLimitations()

ilRepositorySearchGUI::setUserLimitations (   $a_limitations)

allow user limitations like inactive and access limitations

Parameters
bool$a_limitations

Definition at line 1294 of file class.ilRepositorySearchGUI.php.

1295  {
1296  $this->user_limitations = (bool) $a_limitations;
1297  }

◆ show()

ilRepositorySearchGUI::show ( )

Definition at line 696 of file class.ilRepositorySearchGUI.php.

References showSearchResults().

Referenced by performSearch().

697  {
698  $this->showSearchResults();
699  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showClipboard()

ilRepositorySearchGUI::showClipboard ( )
protected

Definition at line 454 of file class.ilRepositorySearchGUI.php.

References $GLOBALS, and ilLoggerFactory\getLogger().

455  {
456  $GLOBALS['ilCtrl']->setParameter($this, 'user_type', (int) $_REQUEST['user_type']);
457 
458  ilLoggerFactory::getLogger('crs')->dump($_REQUEST);
459 
460  $GLOBALS['ilTabs']->clearTargets();
461  $GLOBALS['ilTabs']->setBackTarget(
462  $GLOBALS['lng']->txt('back'),
463  $GLOBALS['ilCtrl']->getParentReturn($this)
464  );
465 
466  include_once './Services/User/classes/class.ilUserClipboardTableGUI.php';
467  $clip = new ilUserClipboardTableGUI($this, 'showClipboard', $GLOBALS['ilUser']->getId());
468  $clip->setFormAction($GLOBALS['ilCtrl']->getFormAction($this));
469  $clip->init();
470  $clip->parse();
471 
472  $GLOBALS['tpl']->setContent($clip->getHTML());
473  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Show administrate clipboard content.
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ showSearch()

ilRepositorySearchGUI::showSearch ( )

Definition at line 554 of file class.ilRepositorySearchGUI.php.

References initFormSearch().

Referenced by performSearch(), and start().

555  {
556  $this->initFormSearch();
557  $this->tpl->setContent($this->form->getHTML());
558  }
initFormSearch(ilObjUser $user=NULL)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSearchCourseTable()

ilRepositorySearchGUI::showSearchCourseTable (   $a_obj_ids)
protected
Returns
Parameters
array$a_obj_ids

Definition at line 1160 of file class.ilRepositorySearchGUI.php.

Referenced by showSearchResults().

1161  {
1162  include_once './Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
1163 
1164  $table = new ilRepositoryObjectResultTableGUI($this,'showSearchResults',$this->object_selection);
1165  $table->parseObjectIds($a_obj_ids);
1166 
1167  $this->tpl->setVariable('RES_TABLE',$table->getHTML());
1168  }
TableGUI class object (course,group and role) search results Used in member search.
+ Here is the caller graph for this function:

◆ showSearchGroupTable()

ilRepositorySearchGUI::showSearchGroupTable (   $a_obj_ids)
protected
Returns
Parameters
array$a_obj_ids

Definition at line 1145 of file class.ilRepositorySearchGUI.php.

Referenced by showSearchResults().

1146  {
1147  include_once './Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
1148 
1149  $table = new ilRepositoryObjectResultTableGUI($this,'showSearchResults',$this->object_selection);
1150  $table->parseObjectIds($a_obj_ids);
1151 
1152  $this->tpl->setVariable('RES_TABLE',$table->getHTML());
1153  }
TableGUI class object (course,group and role) search results Used in member search.
+ Here is the caller graph for this function:

◆ showSearchResults()

ilRepositorySearchGUI::showSearchResults ( )

Definition at line 1061 of file class.ilRepositorySearchGUI.php.

References $_SESSION, $counter, addNewSearchButton(), array, showSearchCourseTable(), showSearchGroupTable(), showSearchRoleTable(), and showSearchUserTable().

Referenced by addUser(), handleMultiCommand(), listUsers(), selectObject(), and show().

1062  {
1063  $counter = 0;
1064  $f_result = array();
1065 
1066  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.rep_search_result.html','Services/Search');
1067  $this->addNewSearchButton();
1068 
1069  switch($this->search_type)
1070  {
1071  case "usr":
1072  $this->showSearchUserTable($_SESSION['rep_search']['usr'],'showSearchResults');
1073  break;
1074 
1075  case 'grp':
1076  $this->showSearchGroupTable($_SESSION['rep_search']['grp']);
1077  break;
1078 
1079  case 'crs':
1080  $this->showSearchCourseTable($_SESSION['rep_search']['crs']);
1081  break;
1082 
1083  case 'role':
1084  $this->showSearchRoleTable($_SESSION['rep_search']['role']);
1085  break;
1086  }
1087  }
$_SESSION["AccountId"]
addNewSearchButton()
Add new search button.
showSearchRoleTable($a_obj_ids)
Show usr table.
$counter
Create styles array
The data for the language used.
showSearchUserTable($a_usr_ids, $a_parent_cmd)
Show usr table.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSearchRoleTable()

ilRepositorySearchGUI::showSearchRoleTable (   $a_obj_ids)
protected

Show usr table.

Returns
Parameters
object$a_usr_ids

Definition at line 1130 of file class.ilRepositorySearchGUI.php.

Referenced by showSearchResults().

1131  {
1132  include_once './Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
1133 
1134  $table = new ilRepositoryObjectResultTableGUI($this,'showSearchResults',$this->object_selection);
1135  $table->parseObjectIds($a_obj_ids);
1136 
1137  $this->tpl->setVariable('RES_TABLE',$table->getHTML());
1138  }
TableGUI class object (course,group and role) search results Used in member search.
+ Here is the caller graph for this function:

◆ showSearchSelected()

ilRepositorySearchGUI::showSearchSelected ( )

submit from autocomplete

Definition at line 563 of file class.ilRepositorySearchGUI.php.

References addNewSearchButton(), array, and showSearchUserTable().

564  {
565  $selected = (int) $_REQUEST['selected_id'];
566 
567  #include_once './Services/Object/classes/class.ilObjectFactory.php';
568  #$factory = new ilObjectFactory();
569  #$user = $factory->getInstanceByObjId($selected);
570 
571  #$this->initFormSearch($user);
572  #$this->tpl->setContent($this->form->getHTML());
573 
574  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.rep_search_result.html','Services/Search');
575  $this->addNewSearchButton();
576  $this->showSearchUserTable(array($selected),'showSearchResults');
577  }
addNewSearchButton()
Add new search button.
Create styles array
The data for the language used.
showSearchUserTable($a_usr_ids, $a_parent_cmd)
Show usr table.
+ Here is the call graph for this function:

◆ showSearchUserTable()

ilRepositorySearchGUI::showSearchUserTable (   $a_usr_ids,
  $a_parent_cmd 
)
protected

Show usr table.

Returns
Parameters
object$a_usr_ids

Definition at line 1094 of file class.ilRepositorySearchGUI.php.

References $_SESSION, and getUserLimitations().

Referenced by listUsers(), showSearchResults(), and showSearchSelected().

1095  {
1096  $is_in_admin = ($_REQUEST['baseClass'] == 'ilAdministrationGUI');
1097  if($is_in_admin)
1098  {
1099  // remember link target to admin search gui (this)
1100  $_SESSION["usr_search_link"] = $this->ctrl->getLinkTarget($this,'show');
1101  }
1102 
1103  include_once './Services/Search/classes/class.ilRepositoryUserResultTableGUI.php';
1104 
1105  $table = new ilRepositoryUserResultTableGUI($this,$a_parent_cmd,$is_in_admin);
1106  if(count($this->add_options))
1107  {
1108  $table->addMultiItemSelectionButton(
1109  'selectedCommand',
1110  $this->add_options,
1111  'handleMultiCommand',
1112  $this->lng->txt('execute')
1113  );
1114  }
1115  else
1116  {
1117  $table->addMultiCommand('addUser', $this->lng->txt('btn_add'));
1118  }
1119  $table->setUserLimitations($this->getUserLimitations());
1120  $table->parseUserIds($a_usr_ids);
1121 
1122  $this->tpl->setVariable('RES_TABLE',$table->getHTML());
1123  }
$_SESSION["AccountId"]
getUserLimitations()
allow user limitations like inactive and access limitations
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

ilRepositorySearchGUI::start ( )

Definition at line 405 of file class.ilRepositorySearchGUI.php.

References __clearSession(), and showSearch().

Referenced by performSearch().

406  {
407  // delete all session info
408  $this->__clearSession();
409  $this->showSearch();
410 
411  return true;
412  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storedUserList()

ilRepositorySearchGUI::storedUserList ( )
protected

Called from table sort.

Returns

Definition at line 1230 of file class.ilRepositorySearchGUI.php.

References $_POST, $_SESSION, and listUsers().

1231  {
1232  $_POST['obj'] = $_SESSION['rep_search']['objs'];
1233  $this->listUsers();
1234  return true;
1235  }
$_SESSION["AccountId"]
listUsers()
List users of course/group/roles.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $add_options

ilRepositorySearchGUI::$add_options = array()
protected

Definition at line 46 of file class.ilRepositorySearchGUI.php.

◆ $object_selection

ilRepositorySearchGUI::$object_selection = false
protected

Definition at line 47 of file class.ilRepositorySearchGUI.php.

◆ $privacy_mode

ilRepositorySearchGUI::$privacy_mode = ilUserAutoComplete::PRIVACY_MODE_IGNORE_USER_SETTING
private

Definition at line 58 of file class.ilRepositorySearchGUI.php.

Referenced by getPrivacyMode(), and setPrivacyMode().

◆ $search_results

ilRepositorySearchGUI::$search_results = array()
private

Definition at line 44 of file class.ilRepositorySearchGUI.php.

◆ $search_title

ilRepositorySearchGUI::$search_title = ''
protected

Definition at line 50 of file class.ilRepositorySearchGUI.php.

Referenced by getTitle().

◆ $search_type

ilRepositorySearchGUI::$search_type = 'usr'

Definition at line 52 of file class.ilRepositorySearchGUI.php.

Referenced by __updateResults().

◆ $searchable_check

ilRepositorySearchGUI::$searchable_check = true
protected

Definition at line 49 of file class.ilRepositorySearchGUI.php.

Referenced by isSearchableCheckEnabled().

◆ $user_limitations

ilRepositorySearchGUI::$user_limitations = true
protected

Definition at line 53 of file class.ilRepositorySearchGUI.php.

Referenced by getUserLimitations().


The documentation for this class was generated from the following file: