ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjOrgUnitTree Class Reference

Class ilObjOrgUnitTree Implements a singleton pattern for caching. More...

+ Collaboration diagram for ilObjOrgUnitTree:

Public Member Functions

 getEmployees ($ref_id, $recursive=false)
 
 getSuperiors ($ref_id, $recursive=false)
 
 getAllChildren ($ref_id)
 
 getOrgusWhereUserHasPermissionForOperation ($operation)
 If you want to have all orgunits where the current user has the write permission: use this with the parameter "write". More...
 
 getOrgusWhereUserHasPermissionForOperationId ($operation_id)
 If you want to have all orgunits where the current user has the write permission: use this with the parameter 3 (3 is the "write" permission as in rbac_operations). More...
 
 getAllOrgunitsOnLevelX ($level)
 
 getEmployeesUnderUser ($user_id, $recursive=true)
 
 getSuperiorsOfUser ($user_id, $recursive=true)
 
 getLevelXOfUser ($user_id, $level)
 for additional info see the other getLevelX method. More...
 
 getOrgUnitOfUser ($user_id, $ref_id=0)
 getOrgUnitOfUser More...
 
 getTitles ($org_refs)
 
 getEmployeeRoles ()
 
 getSuperiorRoles ()
 
 flushCache ()
 
 getLevelXOfTreenode ($orgu_ref, $level)
 Specify eg. More...
 
 getParent ($orgu_ref)
 

Static Public Member Functions

static _getInstance ()
 singleton access. More...
 

Private Member Functions

 __construct ()
 making the construct private More...
 
 loadStaff ($title, $ref_id)
 
 loadStaffRecursive ($title, $ref_id)
 
 loadArrayOfStaff ($title, $ref_ids)
 
 getChildren ($ref_id)
 
 loadChildren ($ref_id)
 
 loadRoles ($role)
 
 loadRolesQuery ($role)
 
 getRefIdFromRoleTitle ($role_title)
 

Private Attributes

 $roles
 
 $role_to_orgu
 
 $staff
 
 $tree_childs
 
 $ctrl
 
 $parent
 
 $db
 

Static Private Attributes

static $instance
 

Detailed Description

Class ilObjOrgUnitTree Implements a singleton pattern for caching.

Author
: Oskar Truffer ot@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
: Martin Studer ms@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 12 of file class.ilObjOrgUnitTree.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjOrgUnitTree::__construct ( )
private

making the construct private

Definition at line 38 of file class.ilObjOrgUnitTree.php.

References $ilCtrl.

38  {
39  global $ilCtrl, $ilDB, $tree;
40  $this->ctrl = $ilCtrl;
41  $this->db = $ilDB;
42  $this->tree = $tree;
43  $this->roles = array();
44  $this->staff = array();
45  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ _getInstance()

static ilObjOrgUnitTree::_getInstance ( )
static

singleton access.

Definition at line 48 of file class.ilObjOrgUnitTree.php.

Referenced by ilObjOrgUnitAccess\_checkAccessToUserLearningProgress(), ilOrgUnitStaffTableGUI\fillRow(), ilOrgUnitStaffTableGUI\parseData(), and ilOrgUnitStaffTableGUI\setRowForUser().

48  {
49  if(self::$instance == null)
50  self::$instance = new ilObjOrgUnitTree();
51  return self::$instance;
52  }
Class ilObjOrgUnitTree Implements a singleton pattern for caching.
+ Here is the caller graph for this function:

◆ flushCache()

ilObjOrgUnitTree::flushCache ( )

Definition at line 365 of file class.ilObjOrgUnitTree.php.

365  {
366  $this->roles = null;
367  }

◆ getAllChildren()

ilObjOrgUnitTree::getAllChildren (   $ref_id)

Definition at line 116 of file class.ilObjOrgUnitTree.php.

References $ref_id, and getChildren().

Referenced by getOrgUnitOfUser(), and loadStaffRecursive().

116  {
117  $open = array($ref_id);
118  $closed = array();
119  while(count($open)){
120  $ref = array_pop($open);
121  $closed[] = $ref;
122  foreach($this->getChildren($ref) as $child)
123  if(!in_array($child, $open) && ! in_array($child, $closed))
124  $open[] = $child;
125  }
126  return $closed;
127  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllOrgunitsOnLevelX()

ilObjOrgUnitTree::getAllOrgunitsOnLevelX (   $level)

Definition at line 213 of file class.ilObjOrgUnitTree.php.

References getChildren(), and ilObjOrgUnit\getRootOrgRefId().

213  {
214  $levels = array(0 => array(ilObjOrgUnit::getRootOrgRefId()));
215  $current_level = 0;
216  while($current_level < $level){
217  $new_level = array();
218  foreach($levels[$current_level] as $orgu_ref)
219  $new_level = array_merge($this->getChildren($orgu_ref), $new_level);
220  $new_level = array_unique($new_level);
221  $levels[$current_level+1] = $new_level;
222  $current_level++;
223  }
224  return $levels[$level];
225  }
static getRootOrgRefId()
+ Here is the call graph for this function:

◆ getChildren()

ilObjOrgUnitTree::getChildren (   $ref_id)
private
Parameters
$ref_id
Returns
int[]

Definition at line 197 of file class.ilObjOrgUnitTree.php.

References $ref_id, and loadChildren().

Referenced by getAllChildren(), and getAllOrgunitsOnLevelX().

197  {
198  $this->loadChildren($ref_id);
199  return $this->tree_childs[$ref_id];
200  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEmployeeRoles()

ilObjOrgUnitTree::getEmployeeRoles ( )
Returns
int[] returns an array of role_ids. orgu_ref => role_id

Definition at line 349 of file class.ilObjOrgUnitTree.php.

References loadRoles().

349  {
350  $this->loadRoles("employee");
351  return $this->roles["employee"];
352  }
+ Here is the call graph for this function:

◆ getEmployees()

ilObjOrgUnitTree::getEmployees (   $ref_id,
  $recursive = false 
)
Parameters
$ref_idint the reference id of the organisational unit.
$recursivebool if true you get the ids of the subsequent orgunits employees too
Returns
int[] array of user ids.

Definition at line 59 of file class.ilObjOrgUnitTree.php.

References $ref_id, loadStaff(), and loadStaffRecursive().

Referenced by getEmployeesUnderUser().

59  {
60  return array_unique(($recursive?$this->loadStaffRecursive("employee",$ref_id):$this->loadStaff("employee", $ref_id)));
61  }
loadStaffRecursive($title, $ref_id)
loadStaff($title, $ref_id)
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEmployeesUnderUser()

ilObjOrgUnitTree::getEmployeesUnderUser (   $user_id,
  $recursive = true 
)
Parameters
$user_idint
$recursivebool if this is true subsequent orgunits of this users superior role get searched as well.
Returns
int[] returns an array of user_ids of the users which have an employee role in an orgunit of which this user's id has a superior role.

Definition at line 232 of file class.ilObjOrgUnitTree.php.

References $res, and getEmployees().

232  {
233  //querry for all orgu where user_id is superior.
234  $q = "SELECT orgu.obj_id, refr.ref_id FROM object_data orgu
235  INNER JOIN object_reference refr ON refr.obj_id = orgu.obj_id
236  INNER JOIN object_data roles ON roles.title LIKE CONCAT('il_orgu_superior_',refr.ref_id)
237  INNER JOIN rbac_ua rbac ON rbac.usr_id = ".$this->db->quote($user_id, "integer")." AND roles.obj_id = rbac.rol_id
238  WHERE orgu.type = 'orgu'";
239  $set = $this->db->query($q);
240  $orgu_ref_ids = array();
241  while($res = $this->db->fetchAssoc($set)){
242  $orgu_ref_ids[] = $res['ref_id'];
243  }
244  $employees = array();
245  foreach($orgu_ref_ids as $orgu_ref_id){
246  $employees = array_merge($employees, $this->getEmployees($orgu_ref_id, $recursive));
247  }
248  return $employees;
249  }
getEmployees($ref_id, $recursive=false)
+ Here is the call graph for this function:

◆ getLevelXOfTreenode()

ilObjOrgUnitTree::getLevelXOfTreenode (   $orgu_ref,
  $level 
)

Specify eg.

level 1 and it will return on which orgunit on the first level after the root node the specified orgu_ref is a subunit of. eg: 0

  • - 1 2
    3 4 5
  • 6

(6, 1) = 1; (4, 1) = 2; (6, 2) = 3;

Parameters
$orgu_ref
$level
Exceptions
Exceptionin case there's a thread of an infinite loop or if you try to fetch the third level but there are only two (e.g. you want to fetch lvl 1 but give the root node as reference).
Returns
int|bool ref_id of the orgu or false if not found.

Definition at line 402 of file class.ilObjOrgUnitTree.php.

References getParent(), and ilObjOrgUnit\getRootOrgRefId().

Referenced by getLevelXOfUser().

402  {
403  $line = array($orgu_ref);
404  $current_ref = $orgu_ref;
405  while($current_ref != ilObjOrgUnit::getRootOrgRefId()){
406  $current_ref = $this->getParent($current_ref);
407  if($current_ref)
408  $line[] = $current_ref;
409  else
410  break;
411  if(count($line) > 100)
412  throw new Exception("There's either a non valid call of the getLevelXOfTreenode in ilObjOrgUnitTree or your nesting of orgunits is higher than 100 units, which isn't encouraged");
413  }
414  $line = array_reverse($line);
415  if(count($line) > $level)
416  return $line[$level];
417  else
418  throw new Exception("you want to fetch level ".$level." but the line to the length of the line is only ".count($line). ". The line of the given org unit is: ".print_r($line , true));
419  }
static getRootOrgRefId()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLevelXOfUser()

ilObjOrgUnitTree::getLevelXOfUser (   $user_id,
  $level 
)

for additional info see the other getLevelX method.

Parameters
$user_id
$level
Returns
int[]

Definition at line 284 of file class.ilObjOrgUnitTree.php.

References $res, and getLevelXOfTreenode().

284  {
285  $q = "SELECT orgu.obj_id, refr.ref_id FROM object_data orgu
286  INNER JOIN object_reference refr ON refr.obj_id = orgu.obj_id
287  INNER JOIN object_data roles ON roles.title LIKE CONCAT('il_orgu_superior_',refr.ref_id) OR roles.title LIKE CONCAT('il_orgu_employee_',refr.ref_id)
288  INNER JOIN rbac_ua rbac ON rbac.usr_id = " . $this->db->quote($user_id, "integer") . " AND roles.obj_id = rbac.rol_id
289  WHERE orgu.type = 'orgu' AND refr.deleted IS NULL";
290  $set = $this->db->query($q);
291  $orgu_ref_ids = array();
292  while ($res = $this->db->fetchAssoc($set)) {
293  $orgu_ref_ids[] = $res['ref_id'];
294  }
295  $orgus_on_level_x = array();
296  foreach($orgu_ref_ids as $orgu_ref_id){
297  try{
298  $orgus_on_level_x[] = $this->getLevelXOfTreenode($orgu_ref_id, $level);
299  }catch(Exception $e){
300  // this means the user is assigned to a orgu above the given level. just dont add it to the list.
301  }
302  }
303 
304  return array_unique($orgus_on_level_x);
305  }
getLevelXOfTreenode($orgu_ref, $level)
Specify eg.
+ Here is the call graph for this function:

◆ getOrgUnitOfUser()

ilObjOrgUnitTree::getOrgUnitOfUser (   $user_id,
  $ref_id = 0 
)

getOrgUnitOfUser

Parameters
$user_id
int$ref_idif given, only OrgUnits under this ID are returned (including $ref_id)
Returns
int[]

Definition at line 315 of file class.ilObjOrgUnitTree.php.

References $ref_id, $res, and getAllChildren().

315  {
316  $q = "SELECT orgu.obj_id, refr.ref_id FROM object_data orgu
317  INNER JOIN object_reference refr ON refr.obj_id = orgu.obj_id
318  INNER JOIN object_data roles ON roles.title LIKE CONCAT('il_orgu_superior_',refr.ref_id) OR roles.title LIKE CONCAT('il_orgu_employee_',refr.ref_id)
319  INNER JOIN rbac_ua rbac ON rbac.usr_id = ".$this->db->quote($user_id, "integer")." AND roles.obj_id = rbac.rol_id
320  WHERE orgu.type = 'orgu' AND refr.deleted IS NULL";
321  $set = $this->db->query($q);
322  $orgu_ref_ids = array();
323  while($res = $this->db->fetchAssoc($set)){
324  $orgu_ref_ids[] = $res['ref_id'];
325  }
326  $orgu_ref_ids = array_unique($orgu_ref_ids);
327  if ($ref_id) {
328  $childernOrgIds = $this->getAllChildren($ref_id);
329  foreach ($orgu_ref_ids as $k => $refId) {
330  if (!in_array($refId, $childernOrgIds)) {
331  unset($orgu_ref_ids[$k]);
332  }
333  }
334  }
335  return $orgu_ref_ids;
336  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ getOrgusWhereUserHasPermissionForOperation()

ilObjOrgUnitTree::getOrgusWhereUserHasPermissionForOperation (   $operation)

If you want to have all orgunits where the current user has the write permission: use this with the parameter "write".

Parameters
$operationstring
Returns
int[] ids of the org units.

Definition at line 134 of file class.ilObjOrgUnitTree.php.

References $ilUser, and $res.

134  {
135  global $ilUser;
136  /*$q = "SELECT object_data.obj_id, object_reference.ref_id, object_data.title, object_data.type, rbac_pa.ops_id, rbac_operations.ops_id as op_id FROM object_data
137  INNER JOIN rbac_operations ON rbac_operations.operation = ".$this->db->quote($operation, "text")."
138  INNER JOIN rbac_ua ON rbac_ua.usr_id = ".$this->db->quote($ilUser->getId(), "integer")."
139  INNER JOIN rbac_pa ON rbac_pa.rol_id = rbac_ua.rol_id AND rbac_pa.ops_id LIKE CONCAT('%', rbac_operations.ops_id, '%')
140  INNER JOIN rbac_fa ON rbac_fa.rol_id = rbac_ua.rol_id
141  INNER JOIN tree ON tree.child = rbac_fa.parent
142  INNER JOIN object_reference ON object_reference.ref_id = tree.parent
143  WHERE object_data.obj_id = object_reference.obj_id AND object_data.type = 'orgu'";*/
144 
145  $q = "SELECT object_data.obj_id, object_reference.ref_id, object_data.title, object_data.type, rbac_pa.ops_id, rbac_operations.ops_id as op_id FROM object_data
146  INNER JOIN rbac_operations ON rbac_operations.operation = ".$this->db->quote($operation, "text")."
147  INNER JOIN rbac_ua ON rbac_ua.usr_id = ".$this->db->quote($ilUser->getId(), "integer")."
148  INNER JOIN rbac_pa ON rbac_pa.rol_id = rbac_ua.rol_id AND rbac_pa.ops_id LIKE CONCAT('%', rbac_operations.ops_id, '%')
149  INNER JOIN object_reference ON object_reference.ref_id = rbac_pa.ref_id
150  WHERE object_data.obj_id = object_reference.obj_id AND object_data.type = 'orgu'";
151 
152  $set = $this->db->query($q);
153  $orgus = array();
154  while($res = $this->db->fetchAssoc($set)){
155  //this is needed as the table rbac_operations is not in the first normal form, thus this needs some additional checkings.
156  $perm_check = unserialize($res['ops_id']);
157  if(!in_array($res["op_id"], $perm_check))
158  continue;
159 
160  $orgus[] = $res["ref_id"];
161  }
162  return $orgus;
163  }
global $ilUser
Definition: imgupload.php:15

◆ getOrgusWhereUserHasPermissionForOperationId()

ilObjOrgUnitTree::getOrgusWhereUserHasPermissionForOperationId (   $operation_id)

If you want to have all orgunits where the current user has the write permission: use this with the parameter 3 (3 is the "write" permission as in rbac_operations).

Parameters
$operation_id
Returns
int[] ids of the org units.

Definition at line 170 of file class.ilObjOrgUnitTree.php.

References $ilUser, and $res.

170  {
171  global $ilUser;
172  $q = "SELECT object_data.obj_id, object_data.title, object_data.type, rbac_pa.ops_id FROM object_data
173  INNER JOIN rbac_ua ON rbac_ua.usr_id = ".$this->db->quote($ilUser->getId(), "integer")."
174  INNER JOIN rbac_pa ON rbac_pa.rol_id = rbac_ua.rol_id AND rbac_pa.ops_id LIKE CONCAT('%', ".$this->db->quote($operation_id, "integer").", '%')
175  INNER JOIN rbac_fa ON rbac_fa.rol_id = rbac_ua.rol_id
176  INNER JOIN tree ON tree.child = rbac_fa.parent
177  INNER JOIN object_reference ON object_reference.ref_id = tree.parent
178  WHERE object_data.obj_id = object_reference.obj_id AND object_data.type = 'orgu'";
179 
180  $set = $this->db->query($q);
181  $orgus = array();
182  while($res = $this->db->fetchAssoc($set)){
183  //this is needed as the table rbac_operations is not in the first normal form, thus this needs some additional checkings.
184  $perm_check = unserialize($res['ops_id']);
185  if(!in_array($res["ops_id"], $perm_check))
186  continue;
187 
188  $orgus[] = $res["obj_id"];
189  }
190  return $orgus;
191  }
global $ilUser
Definition: imgupload.php:15

◆ getParent()

ilObjOrgUnitTree::getParent (   $orgu_ref)

Definition at line 421 of file class.ilObjOrgUnitTree.php.

Referenced by getLevelXOfTreenode().

421  {
422  if(!$this->parent[$orgu_ref]){
423  $this->parent[$orgu_ref] = $this->tree->getParentId($orgu_ref);
424  }
425  return $this->parent[$orgu_ref];
426  }
+ Here is the caller graph for this function:

◆ getRefIdFromRoleTitle()

ilObjOrgUnitTree::getRefIdFromRoleTitle (   $role_title)
private

Definition at line 380 of file class.ilObjOrgUnitTree.php.

Referenced by loadRolesQuery().

380  {
381  $array = explode("_", $role_title);
382  return $array[count($array) - 1];
383  }
+ Here is the caller graph for this function:

◆ getSuperiorRoles()

ilObjOrgUnitTree::getSuperiorRoles ( )

Definition at line 354 of file class.ilObjOrgUnitTree.php.

References loadRoles().

354  {
355  $this->loadRoles("superior");
356  return $this->roles["superior"];
357  }
+ Here is the call graph for this function:

◆ getSuperiors()

ilObjOrgUnitTree::getSuperiors (   $ref_id,
  $recursive = false 
)

Definition at line 63 of file class.ilObjOrgUnitTree.php.

References $ref_id, loadStaff(), and loadStaffRecursive().

Referenced by getSuperiorsOfUser().

63  {
64  return array_unique(($recursive?$this->loadStaffRecursive("superior",$ref_id):$this->loadStaff("superior", $ref_id)));
65  }
loadStaffRecursive($title, $ref_id)
loadStaff($title, $ref_id)
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSuperiorsOfUser()

ilObjOrgUnitTree::getSuperiorsOfUser (   $user_id,
  $recursive = true 
)
Parameters
$user_idint
$recursivebool if this is true subsequent orgunits of this users superior role get searched as well.
Returns
int[] returns an array of user_ids of the users which have an employee role in an orgunit of which this user's id has a superior role.

Definition at line 256 of file class.ilObjOrgUnitTree.php.

References $res, and getSuperiors().

256  {
257  //querry for all orgu where user_id is superior.
258  $q = "SELECT orgu.obj_id, refr.ref_id FROM object_data orgu
259  INNER JOIN object_reference refr ON refr.obj_id = orgu.obj_id
260  INNER JOIN object_data roles ON roles.title LIKE CONCAT('il_orgu_employee_',refr.ref_id) OR roles.title LIKE CONCAT('il_orgu_superior_',refr.ref_id)
261  INNER JOIN rbac_ua rbac ON rbac.usr_id = ".$this->db->quote($user_id, "integer")." AND roles.obj_id = rbac.rol_id
262  WHERE orgu.type = 'orgu'";
263  $set = $this->db->query($q);
264  $orgu_ref_ids = array();
265  while($res = $this->db->fetchAssoc($set)){
266  $orgu_ref_ids[] = $res['ref_id'];
267  }
268  $superiors = array();
269  foreach($orgu_ref_ids as $orgu_ref_id){
270  $superiors = array_merge($superiors, $this->getSuperiors($orgu_ref_id, $recursive));
271  }
272  return $superiors;
273  }
getSuperiors($ref_id, $recursive=false)
+ Here is the call graph for this function:

◆ getTitles()

ilObjOrgUnitTree::getTitles (   $org_refs)

Definition at line 338 of file class.ilObjOrgUnitTree.php.

References ilObject\_lookupObjId(), and ilObject\_lookupTitle().

338  {
339  $names = array();
340  foreach($org_refs as $org_unit){
341  $names[$org_unit] = ilObject::_lookupTitle(ilObject::_lookupObjId($org_unit));
342  }
343  return $names;
344  }
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ loadArrayOfStaff()

ilObjOrgUnitTree::loadArrayOfStaff (   $title,
  $ref_ids 
)
private
Parameters
$title"employee" or "superior"
$ref_idsint[] array of orgu object ref ids.
Returns
int[] user_ids

Definition at line 85 of file class.ilObjOrgUnitTree.php.

References $ref_id, $res, and loadRoles().

Referenced by loadStaff(), and loadStaffRecursive().

85  {
86  $this->loadRoles($title);
87  $all_refs = $ref_ids;
88  //take away ref_ids that are already loaded.
89  foreach($ref_ids as $id => $ref_id){
90  if(isset($this->staff[$title][$ref_id]))
91  unset($ref_ids[$id]);
92  else{
93  $this->staff[$title][$ref_id] = array();
94  $ref_ids[$id] = $this->roles[$title][$ref_id];
95  }
96  }
97 
98  //if there are still refs that need to be loaded, then do so.
99  if(count($ref_ids)){
100  $q = "SELECT usr_id, rol_id FROM rbac_ua WHERE ".$this->db->in("rol_id", $ref_ids, false, "integer");
101  $set = $this->db->query($q);
102  while($res = $this->db->fetchAssoc($set)){
103  $orgu_ref = $this->role_to_orgu[$title][$res["rol_id"]];
104  $this->staff[$title][$orgu_ref][] = $res["usr_id"];
105  }
106  }
107 
108  //collect * users.
109  $all_users = array();
110  foreach($all_refs as $ref)
111  $all_users = array_merge($all_users, $this->staff[$title][$ref]);
112 
113  return $all_users;
114  }
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadChildren()

ilObjOrgUnitTree::loadChildren (   $ref_id)
private

Definition at line 202 of file class.ilObjOrgUnitTree.php.

References $ref_id.

Referenced by getChildren().

202  {
203  if(!$this->tree_childs[$ref_id]){
204  $children = array();
205  foreach($this->tree->getChilds($ref_id) as $child){
206  if($child["type"] == "orgu")
207  $children[] = $child["child"];
208  }
209  $this->tree_childs[$ref_id] = $children;
210  };
211  }
$ref_id
Definition: sahs_server.php:39
+ Here is the caller graph for this function:

◆ loadRoles()

ilObjOrgUnitTree::loadRoles (   $role)
private

Definition at line 359 of file class.ilObjOrgUnitTree.php.

References loadRolesQuery().

Referenced by getEmployeeRoles(), getSuperiorRoles(), and loadArrayOfStaff().

359  {
360  if($this->roles[$role] == null){
361  $this->loadRolesQuery($role);
362  }
363  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRolesQuery()

ilObjOrgUnitTree::loadRolesQuery (   $role)
private

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

References $res, and getRefIdFromRoleTitle().

Referenced by loadRoles().

369  {
370  $this->roles[$role] = array();
371  $q = "SELECT obj_id, title FROM object_data WHERE type = 'role' AND title LIKE 'il_orgu_".$role."%'";
372  $set = $this->db->query($q);
373  while($res = $this->db->fetchAssoc($set)){
374  $orgu_ref = $this->getRefIdFromRoleTitle($res["title"]);
375  $this->roles[$role][$orgu_ref] = $res["obj_id"];
376  $this->role_to_orgu[$role][$res["obj_id"]] = $orgu_ref;
377  }
378  }
getRefIdFromRoleTitle($role_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadStaff()

ilObjOrgUnitTree::loadStaff (   $title,
  $ref_id 
)
private
Parameters
$titlestring "employee" or "superior"
$ref_idint ref id of org unit.
Returns
int[] array of user_obj ids

Definition at line 72 of file class.ilObjOrgUnitTree.php.

References $ref_id, and loadArrayOfStaff().

Referenced by getEmployees(), and getSuperiors().

72  {
73  return $this->loadArrayOfStaff($title, array($ref_id));
74  }
loadArrayOfStaff($title, $ref_ids)
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadStaffRecursive()

ilObjOrgUnitTree::loadStaffRecursive (   $title,
  $ref_id 
)
private

Definition at line 76 of file class.ilObjOrgUnitTree.php.

References $ref_id, getAllChildren(), and loadArrayOfStaff().

Referenced by getEmployees(), and getSuperiors().

76  {
77  return $this->loadArrayOfStaff($title, $this->getAllChildren($ref_id));
78  }
loadArrayOfStaff($title, $ref_ids)
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilObjOrgUnitTree::$ctrl
private

Definition at line 29 of file class.ilObjOrgUnitTree.php.

◆ $db

ilObjOrgUnitTree::$db
private

Definition at line 35 of file class.ilObjOrgUnitTree.php.

◆ $instance

ilObjOrgUnitTree::$instance
staticprivate

Definition at line 14 of file class.ilObjOrgUnitTree.php.

◆ $parent

ilObjOrgUnitTree::$parent
private

Definition at line 32 of file class.ilObjOrgUnitTree.php.

◆ $role_to_orgu

ilObjOrgUnitTree::$role_to_orgu
private

Definition at line 20 of file class.ilObjOrgUnitTree.php.

◆ $roles

ilObjOrgUnitTree::$roles
private

Definition at line 17 of file class.ilObjOrgUnitTree.php.

◆ $staff

ilObjOrgUnitTree::$staff
private

Definition at line 23 of file class.ilObjOrgUnitTree.php.

◆ $tree_childs

ilObjOrgUnitTree::$tree_childs
private

Definition at line 26 of file class.ilObjOrgUnitTree.php.


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