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

Class ilObjOrgUnit. More...

+ Inheritance diagram for ilObjOrgUnit:
+ Collaboration diagram for ilObjOrgUnit:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 
 assignUsersToEmployeeRole ($user_ids)
 
 assignUsersToSuperiorRole ($user_ids)
 
 deassignUserFromEmployeeRole ($user_id)
 
 deassignUserFromSuperiorRole ($user_id)
 
 setEmployeeRole ($employee_role)
 
 getEmployeeRole ()
 
 setSuperiorRole ($superior_role)
 
 getSuperiorRole ()
 
 initDefaultRoles ()
 
 getTitle ()
 
 getTranslations ()
 
 delete ()
 delete category and all related data More...
 
 removeTranslations ()
 
 deleteTranslation ($a_lang)
 
 addTranslation ($a_title, $a_desc, $a_lang, $a_lang_default)
 
 updateTranslation ($a_title, $a_desc, $a_lang, $a_lang_default)
 
- Public Member Functions inherited from ilContainer
 ilContainer ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 _getContainerDirectory ($a_id)
 Get the container directory. More...
 
 getBigIconPath ()
 Get path for big icon. More...
 
 getSmallIconPath ()
 Get path for small icon. More...
 
 getTinyIconPath ()
 Get path for tiny icon. More...
 
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems). More...
 
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems). More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting. More...
 
 _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
 _lookupIconPath ($a_id, $a_size="big")
 lookup icon path More...
 
 saveIcons ($a_big_icon, $a_small_icon, $a_tiny_icon)
 save container icons More...
 
 removeBigIcon ()
 remove big icon More...
 
 removeSmallIcon ()
 remove small icon More...
 
 removeTinyIcon ()
 remove tiny icon More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone container settings. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false)
 clone all objects according to this container More...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 update ()
 Update. More...
 
 read ()
 read More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Static Public Member Functions

static getRootOrgRefId ()
 
static getRootOrgId ()
 
static _exists ($a_id, $a_reference=false)
 
- Static Public Member Functions inherited from ilContainer
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description) More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Protected Attributes

 $employee_role
 
 $superior_role
 
- Protected Attributes inherited from ilContainer
 $order_type = 0
 
 $hiddenfilesfound = false
 

Static Protected Attributes

static $root_ref_id
 
static $root_id
 

Private Member Functions

 loadRoles ()
 
 doLoadRoles ()
 

Static Private Member Functions

static loadRootOrgRefIdAndId ()
 

Additional Inherited Members

- Data Fields inherited from ilContainer
const VIEW_SESSIONS = 0
 
const VIEW_OBJECTIVE = 1
 
const VIEW_TIMING = 2
 
const VIEW_ARCHIVE = 3
 
const VIEW_SIMPLE = 4
 
const VIEW_BY_TYPE = 5
 
const VIEW_INHERIT = 6
 
const VIEW_ILINC = 7
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 
- Static Public Attributes inherited from ilContainer
static $data_preloaded = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjOrgUnit::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Definition at line 22 of file class.ilObjOrgUnit.php.

References ilContainer\ilContainer().

22  {
23  $this->type = "orgu";
24  $this->ilContainer($a_id,$a_call_by_reference);
25  }
ilContainer($a_id=0, $a_call_by_reference=true)
Constructor public.
+ Here is the call graph for this function:

Member Function Documentation

◆ _exists()

static ilObjOrgUnit::_exists (   $a_id,
  $a_reference = false 
)
static

Definition at line 151 of file class.ilObjOrgUnit.php.

Referenced by ilOrgUnitImporter\buildRef().

151  {
152  return parent::_exists($a_id, $a_reference, "orgu");
153  }
+ Here is the caller graph for this function:

◆ addTranslation()

ilObjOrgUnit::addTranslation (   $a_title,
  $a_desc,
  $a_lang,
  $a_lang_default 
)

Definition at line 322 of file class.ilObjOrgUnit.php.

References $query, $res, and ilObject\getId().

Referenced by getTranslations().

323  {
324  global $ilDB;
325 
326  if (empty($a_title))
327  {
328  $a_title = "NO TITLE";
329  }
330 
331  $query = "INSERT INTO object_translation ".
332  "(obj_id,title,description,lang_code,lang_default) ".
333  "VALUES ".
334  "(".$ilDB->quote($this->getId(),'integer').",".
335  $ilDB->quote($a_title,'text').",".$ilDB->quote($a_desc,'text').",".
336  $ilDB->quote($a_lang,'text').",".$ilDB->quote($a_lang_default,'integer').")";
337  $res = $ilDB->manipulate($query);
338 
339  return true;
340  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignUsersToEmployeeRole()

ilObjOrgUnit::assignUsersToEmployeeRole (   $user_ids)

Definition at line 83 of file class.ilObjOrgUnit.php.

References getEmployeeRole(), ilObject\getId(), and ilObject\getRefId().

83  {
84  global $rbacadmin, $ilAppEventHandler;
85  foreach($user_ids as $user_id)
86  {
87  $rbacadmin->assignUser($this->getEmployeeRole(), $user_id);
88 
89  $ilAppEventHandler->raise('Modules/OrgUnit',
90  'assignUsersToEmployeeRole',
91  array('object' => $this,
92  'obj_id' => $this->getId(),
93  'ref_id' => $this->getRefId(),
94  'role_id' => $this->getEmployeeRole(),
95  'user_id' => $user_id));
96  }
97  }
getId()
get object id public
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ assignUsersToSuperiorRole()

ilObjOrgUnit::assignUsersToSuperiorRole (   $user_ids)

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

References ilObject\getId(), ilObject\getRefId(), and getSuperiorRole().

99  {
100  global $rbacadmin, $ilAppEventHandler;
101  foreach($user_ids as $user_id)
102  {
103  $rbacadmin->assignUser($this->getSuperiorRole(), $user_id);
104 
105  $ilAppEventHandler->raise('Modules/OrgUnit',
106  'assignUsersToSuperiorRole',
107  array('object' => $this,
108  'obj_id' => $this->getId(),
109  'ref_id' => $this->getRefId(),
110  'role_id' => $this->getSuperiorRole(),
111  'user_id' => $user_id));
112  }
113 
114  }
getId()
get object id public
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ deassignUserFromEmployeeRole()

ilObjOrgUnit::deassignUserFromEmployeeRole (   $user_id)

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

References getEmployeeRole(), ilObject\getId(), and ilObject\getRefId().

116  {
117  global $rbacadmin, $ilAppEventHandler;
118  $rbacadmin->deassignUser($this->getEmployeeRole(), $user_id);
119 
120  $ilAppEventHandler->raise('Modules/OrgUnit',
121  'deassignUserFromEmployeeRole',
122  array('object' => $this,
123  'obj_id' => $this->getId(),
124  'ref_id' => $this->getRefId(),
125  'role_id' => $this->getEmployeeRole(),
126  'user_id' => $user_id));
127  }
getId()
get object id public
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ deassignUserFromSuperiorRole()

ilObjOrgUnit::deassignUserFromSuperiorRole (   $user_id)

Definition at line 129 of file class.ilObjOrgUnit.php.

References ilObject\getId(), ilObject\getRefId(), and getSuperiorRole().

129  {
130  global $rbacadmin, $ilAppEventHandler;
131  $rbacadmin->deassignUser($this->getSuperiorRole(), $user_id);
132 
133 
134  $ilAppEventHandler->raise('Modules/OrgUnit',
135  'deassignUserFromSuperiorRole',
136  array('object' => $this,
137  'obj_id' => $this->getId(),
138  'ref_id' => $this->getRefId(),
139  'role_id' => $this->getSuperiorRole(),
140  'user_id' => $user_id));
141  }
getId()
get object id public
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ delete()

ilObjOrgUnit::delete ( )

delete category and all related data

public

Returns
boolean true if all object data were removed; false if only a references were removed

Definition at line 274 of file class.ilObjOrgUnit.php.

References $query, $res, ilObjUserFolder\_updateUserFolderAssignment(), ilObject\getId(), and USER_FOLDER_ID.

275  {
276  global $ilDB,$ilAppEventHandler;
277 
278  // always call parent delete function first!!
279  if (!parent::delete())
280  {
281  return false;
282  }
283 
284  // put here category specific stuff
285  include_once('./Services/User/classes/class.ilObjUserFolder.php');
287 
288  $query = "DELETE FROM object_translation WHERE obj_id = ".$ilDB->quote($this->getId(),'integer');
289  $res = $ilDB->manipulate($query);
290 
291  $ilAppEventHandler->raise('Modules/OrgUnit',
292  'delete',
293  array('object' => $this,
294  'obj_id' => $this->getId()));
295 
296  return true;
297  }
static _updateUserFolderAssignment($a_old_id, $a_new_id)
Update user folder assignment Typically called after deleting a category with local user accounts...
getId()
get object id public
const USER_FOLDER_ID
Class ilObjUserFolder.
+ Here is the call graph for this function:

◆ deleteTranslation()

ilObjOrgUnit::deleteTranslation (   $a_lang)

Definition at line 311 of file class.ilObjOrgUnit.php.

References $query, $res, and ilObject\getId().

312  {
313  global $ilDB;
314 
315  $query = "DELETE FROM object_translation WHERE obj_id= ".
316  $ilDB->quote($this->getId(),'integer')." AND lang_code = ".
317  $ilDB->quote($a_lang, 'text');
318  $res = $ilDB->manipulate($query);
319  }
getId()
get object id public
+ Here is the call graph for this function:

◆ doLoadRoles()

ilObjOrgUnit::doLoadRoles ( )
private

Definition at line 66 of file class.ilObjOrgUnit.php.

References $res, ilObject\getId(), and ilObject\getRefId().

Referenced by loadRoles().

66  {
67  global $ilDB;
68  if(!$this->employee_role || !$this->superior_role){
69  $q = "SELECT obj_id, title FROM object_data WHERE title LIKE 'il_orgu_employee_".$ilDB->quote($this->getRefId(),"integer")."' OR title LIKE 'il_orgu_superior_".$ilDB->quote($this->getRefId(),"integer")."'";
70  $set = $ilDB->query($q);
71  while($res = $ilDB->fetchAssoc($set)){
72  if($res["title"] == "il_orgu_employee_".$this->getRefId())
73  $this->employee_role = $res["obj_id"];
74  elseif($res["title"] == "il_orgu_superior_".$this->getRefId())
75  $this->superior_role = $res["obj_id"];
76  }
77 
78  if(!$this->employee_role || !$this->superior_role)
79  throw new Exception("The standard roles the orgu object with id: ".$this->getId()." aren't initialized or have been deleted!");
80  }
81  }
getId()
get object id public
if(!file_exists(getcwd().'/ilias.ini.php')) if(isset( $_GET["client_id"]))
registration confirmation script for ilias
Definition: confirmReg.php:20
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEmployeeRole()

ilObjOrgUnit::getEmployeeRole ( )
Returns
int

Definition at line 158 of file class.ilObjOrgUnit.php.

References $employee_role, and loadRoles().

Referenced by assignUsersToEmployeeRole(), and deassignUserFromEmployeeRole().

159  {
160  $this->loadRoles();
161  return $this->employee_role;
162  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRootOrgId()

static ilObjOrgUnit::getRootOrgId ( )
static

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

Referenced by ilOrgUnitExporter\sendAndCreateSimpleExportFile().

32  {
33  self::loadRootOrgRefIdAndId();
34  return self::$root_id;
35  }
+ Here is the caller graph for this function:

◆ getRootOrgRefId()

◆ getSuperiorRole()

ilObjOrgUnit::getSuperiorRole ( )
Returns
int

Definition at line 175 of file class.ilObjOrgUnit.php.

References $superior_role, and loadRoles().

Referenced by assignUsersToSuperiorRole(), and deassignUserFromSuperiorRole().

176  {
177  $this->loadRoles();
178  return $this->superior_role;
179  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ilObjOrgUnit::getTitle ( )

Definition at line 226 of file class.ilObjOrgUnit.php.

Referenced by getTranslations().

226  {
227  if(parent::getTitle() != "__OrgUnitAdministration")
228  return parent::getTitle();
229  else
230  return $this->lng->txt("objs_orgu");
231  }
+ Here is the caller graph for this function:

◆ getTranslations()

ilObjOrgUnit::getTranslations ( )
Returns
array This catches if by some means there is no translation.

Definition at line 236 of file class.ilObjOrgUnit.php.

References $data, ilObject\$lng, $r, $row, addTranslation(), DB_FETCHMODE_OBJECT, ilObject\getId(), and getTitle().

236  {
237  global $lng, $ilDB;
238 
239  $translations = array();
240 
241  $q = "SELECT * FROM object_translation WHERE obj_id = ".
242  $ilDB->quote($this->getId(),'integer')." ORDER BY lang_default DESC";
243  $r = $this->ilias->db->query($q);
244 
245  $num = 0;
246 
247  while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
248  {
249  $data["Fobject"][$num]= array("title" => $row->title,
250  "desc" => $row->description,
251  "lang" => $row->lang_code
252  );
253  $num++;
254  }
255 
256  $translations = $data;
257 
258  if(!count($translations["Fobject"])){
259  $this->addTranslation($this->getTitle(), "", $lng->getDefaultLanguage(), true);
260  $translations["Fobject"][] = array("title" => $this->getTitle(),
261  "desc" => "",
262  "lang" => $lng->getDefaultLanguage());
263  }
264  return $translations;
265  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
addTranslation($a_title, $a_desc, $a_lang, $a_lang_default)
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
$r
+ Here is the call graph for this function:

◆ initDefaultRoles()

ilObjOrgUnit::initDefaultRoles ( )

Definition at line 181 of file class.ilObjOrgUnit.php.

References $query, $res, ilObject\createRoleFolder(), DB_FETCHMODE_OBJECT, ilObject\getId(), and ilObject\getRefId().

Referenced by loadRoles().

181  {
182  global $rbacadmin,$rbacreview, $ilAppEventHandler;
183 
184  $rolf_obj = $this->createRoleFolder();
185 
186  // CREATE Employee ROLE
187  $role_obj = $rolf_obj->createRole("il_orgu_employee_".$this->getRefId(),"Emplyee of org unit obj_no.".$this->getId());
188 // = $
189 // EMPLOYEE DOES NOT YET NEED A ROLE TEMPLATE.
190 // // SET PERMISSION TEMPLATE OF NEW LOCAL ADMIN ROLE
191 // $query = "SELECT obj_id FROM object_data ".
192 // " WHERE type='rolt' AND title='il_orgu_employee'";
193 //
194 // $res = $this->ilias->db->getRow($query, DB_FETCHMODE_OBJECT);
195 // $rbacadmin->copyRoleTemplatePermissions($res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
196 //
197 // // SET OBJECT PERMISSIONS OF COURSE OBJECT
198 // $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"orgu",$rolf_obj->getRefId());
199 // $rbacadmin->grantPermission($role_obj->getId(),$ops,$this->getRefId());
200 
201  // CREATE Superior ROLE
202  $role_obj = $rolf_obj->createRole("il_orgu_superior_".$this->getRefId(),"Superior of org unit obj_no.".$this->getId());
203 
204  // SET PERMISSION TEMPLATE OF NEW LOCAL ADMIN ROLE
205  $query = "SELECT obj_id FROM object_data ".
206  " WHERE type='rolt' AND title='il_orgu_superior'";
207 
208  $res = $this->ilias->db->getRow($query, DB_FETCHMODE_OBJECT);
209  $rbacadmin->copyRoleTemplatePermissions($res->obj_id,ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
210 
211  // SET OBJECT PERMISSIONS OF COURSE OBJECT
212  $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),"orgu",$rolf_obj->getRefId());
213  $rbacadmin->grantPermission($role_obj->getId(),$ops,$this->getRefId());
214 
215 
216  $ilAppEventHandler->raise('Modules/OrgUnit',
217  'initDefaultRoles',
218  array('object' => $this,
219  'obj_id' => $this->getId(),
220  'ref_id' => $this->getRefId(),
221  'role_superior_id' => $role_obj->getId(),
222  'role_employee_id' => $role_obj->getId()));
223 
224  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
createRoleFolder()
creates a local role folder
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRoles()

ilObjOrgUnit::loadRoles ( )
private

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

References $ilLog, doLoadRoles(), ilObject\getId(), and initDefaultRoles().

Referenced by getEmployeeRole(), and getSuperiorRole().

50  {
51  global $ilLog;
52  if(!$this->employee_role || !$this->superior_role){
53  $this->doLoadRoles();
54  }
55 
56  if(!$this->employee_role || !$this->superior_role){
57  $this->initDefaultRoles();
58  $this->doLoadRoles();
59  if(!$this->employee_role || !$this->superior_role)
60  throw new Exception("The standard roles the orgu object with id: ".$this->getId()." aren't initialized or have been deleted, newly creating them didn't work!");
61  else
62  $ilLog->write("[".__FILE__.":".__LINE__."] The standard roles for the orgu obj with id: ".$this->getId()." were newly created as they couldnt be found.");
63  }
64  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRootOrgRefIdAndId()

static ilObjOrgUnit::loadRootOrgRefIdAndId ( )
staticprivate

Definition at line 37 of file class.ilObjOrgUnit.php.

References $res.

37  {
38  if(self::$root_ref_id === Null || self::$root_id === null){
39  global $ilDB;
40  $q = "SELECT o.obj_id, r.ref_id FROM object_data o
41  INNER JOIN object_reference r ON r.obj_id = o.obj_id
42  WHERE title = ".$ilDB->quote('__OrgUnitAdministration', 'text')."";
43  $set = $ilDB->query($q);
44  $res = $ilDB->fetchAssoc($set);
45  self::$root_id = $res["obj_id"];
46  self::$root_ref_id= $res["ref_id"];
47  }
48  }

◆ removeTranslations()

ilObjOrgUnit::removeTranslations ( )

Definition at line 301 of file class.ilObjOrgUnit.php.

References $query, $res, and ilObject\getId().

302  {
303  global $ilDB;
304 
305  $query = "DELETE FROM object_translation WHERE obj_id= ".
306  $ilDB->quote($this->getId(),'integer');
307  $res = $ilDB->manipulate($query);
308  }
getId()
get object id public
+ Here is the call graph for this function:

◆ setEmployeeRole()

ilObjOrgUnit::setEmployeeRole (   $employee_role)
Parameters
int$employee_role

Definition at line 146 of file class.ilObjOrgUnit.php.

References $employee_role.

147  {
148  $this->employee_role = $employee_role;
149  }

◆ setSuperiorRole()

ilObjOrgUnit::setSuperiorRole (   $superior_role)
Parameters
int$superior_role

Definition at line 167 of file class.ilObjOrgUnit.php.

References $superior_role.

168  {
169  $this->superior_role = $superior_role;
170  }

◆ updateTranslation()

ilObjOrgUnit::updateTranslation (   $a_title,
  $a_desc,
  $a_lang,
  $a_lang_default 
)

Definition at line 343 of file class.ilObjOrgUnit.php.

References $ilLog, $query, $res, and ilObject\getId().

344  {
345  global $ilDB, $ilLog;
346 
347  if (empty($a_title))
348  {
349  $a_title = "NO TITLE";
350  }
351 
352  $query = "UPDATE object_translation SET ";
353 
354 
355  $query .= " title = ". $ilDB->quote($a_title,'text');
356 
357 
358  if($a_desc != "") {
359  $query .= ", description = ".$ilDB->quote($a_desc,'text')." ";
360  }
361 
362  if($a_lang_default) {
363  $query .= ", lang_default = ".$ilDB->quote($a_lang_default,'integer')." ";
364  }
365 
366  $query .= " WHERE obj_id = ".$ilDB->quote($this->getId(),'integer')." AND lang_code = ".$ilDB->quote($a_lang,'text');
367  $res = $ilDB->manipulate($query);
368 
369  return true;
370  }
getId()
get object id public
+ Here is the call graph for this function:

Field Documentation

◆ $employee_role

ilObjOrgUnit::$employee_role
protected

Definition at line 19 of file class.ilObjOrgUnit.php.

Referenced by getEmployeeRole(), and setEmployeeRole().

◆ $root_id

ilObjOrgUnit::$root_id
staticprotected

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

◆ $root_ref_id

ilObjOrgUnit::$root_ref_id
staticprotected

Definition at line 16 of file class.ilObjOrgUnit.php.

◆ $superior_role

ilObjOrgUnit::$superior_role
protected

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

Referenced by getSuperiorRole(), and setSuperiorRole().


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