ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjDataCollection Class Reference

Class ilObjDataCollection. More...

+ Inheritance diagram for ilObjDataCollection:
+ Collaboration diagram for ilObjDataCollection:

Public Member Functions

 initType ()
 
 doRead ()
 
 doClone ()
 
 doUpdate ()
 
 setMainTableId ($a_val)
 
 getMainTableId ()
 
 doCloneObject (ilObjDataCollection $new_obj, $a_target_id, $a_copy_id=0)
 Clone DCL. More...
 
 cloneStructure ($original_id)
 Attention only use this for objects who have not yet been created (use like: $x = new ilObjDataCollection; $x->cloneStructure($id)) More...
 
 setOnline ($a_val)
 setOnline More...
 
 getOnline ()
 getOnline More...
 
 setRating ($a_val)
 setRating More...
 
 getRating ()
 getRating More...
 
 setPublicNotes ($a_val)
 setPublicNotes More...
 
 getPublicNotes ()
 getPublicNotes More...
 
 setApproval ($a_val)
 setApproval More...
 
 getApproval ()
 getApproval More...
 
 setNotification ($a_val)
 setNotification More...
 
 getNotification ()
 getNotification More...
 
 getTables ()
 
 getVisibleTables ()
 
 getStyleSheetId ()
 
- Public Member Functions inherited from ilObject2
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 Read data from db. More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access 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 @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ($a_clone_mode=false)
 
 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) @access public 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 ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 cloneObject ($a_target_id, $a_copy_id=null, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor @access 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 @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access 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 @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 
 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...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. 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) @access public 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...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static sendNotification ($a_action, $a_table_id, $a_record_id=NULL)
 
static _hasWriteAccess ($ref)
 
static _hasReadAccess ($ref)
 
static _hasTableByTitle ($title, $obj_id)
 Checks if a DataCollection has a table with a given title. More...
 
- Static Public Member Functions inherited from ilObject2
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 _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)
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type)
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_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 @global 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@access public 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 fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Protected Member Functions

 doCreate ()
 
 doDelete ()
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate ()
 
 beforeCreate ()
 
 doUpdate ()
 
 beforeUpdate ()
 
 doMDUpdateListener ($a_element)
 
 beforeMDUpdateListener ($a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject ($new_obj, $a_target_id, $a_copy_id=null)
 
 beforeCloneObject ()
 

Protected Attributes

 $main_table_id
 

Additional Inherited Members

- 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...
 

Detailed Description

Class ilObjDataCollection.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
Id
class.ilObjFolder.php 25528 2010-09-03 10:37:11Z smeyer

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

Member Function Documentation

◆ _hasReadAccess()

static ilObjDataCollection::_hasReadAccess (   $ref)
static
Parameters
$refint the reference id of the datacollection object to check.
Deprecated:
Returns
bool whether or not the current user has add/edit_entry access to the referenced datacollection

Definition at line 431 of file class.ilObjDataCollection.php.

References ilObjDataCollectionAccess\hasReadAccess().

+ Here is the call graph for this function:

◆ _hasTableByTitle()

static ilObjDataCollection::_hasTableByTitle (   $title,
  $obj_id 
)
static

Checks if a DataCollection has a table with a given title.

Parameters
$titleTitle of table
$obj_idObj-ID of the table
Returns
bool

Definition at line 477 of file class.ilObjDataCollection.php.

477 {
478 global $ilDB;
479 $result = $ilDB->query('SELECT * FROM il_dcl_table WHERE obj_id = ' . $ilDB->quote($obj_id, 'integer') . ' AND title = '
480 . $ilDB->quote($title, 'text'));
481
482 return ($ilDB->numRows($result)) ? true : false;
483 }
$result
global $ilDB

References $ilDB, $result, and ilObject\$title.

Referenced by ilDataCollectionTableEditGUI\checkInput().

+ Here is the caller graph for this function:

◆ _hasWriteAccess()

static ilObjDataCollection::_hasWriteAccess (   $ref)
static
Parameters
$refint the reference id of the datacollection object to check.
Deprecated:
Returns
bool whether or not the current user has admin/write access to the referenced datacollection

Definition at line 420 of file class.ilObjDataCollection.php.

References ilObjDataCollectionAccess\hasWriteAccess().

Referenced by ilDataCollectionFieldListGUI\checkAccess(), ilDataCollectionTableEditGUI\checkPermission(), and ilDataCollectionRecordEditGUI\initForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneStructure()

ilObjDataCollection::cloneStructure (   $original_id)

Attention only use this for objects who have not yet been created (use like: $x = new ilObjDataCollection; $x->cloneStructure($id))

Parameters
$original_idThe original ID of the dataselection you want to clone it's structure

Definition at line 283 of file class.ilObjDataCollection.php.

283 {
284 $original = new ilObjDataCollection($original_id);
285
286 $this->setApproval($original->getApproval());
287 $this->setNotification($original->getNotification());
288 $this->setPublicNotes($original->getPublicNotes());
289 $this->setRating($original->getRating());
290
291 // delete old tables.
292 foreach ($this->getTables() as $table) {
293 $table->doDelete(true);
294 }
295
296 // add new tables.
297 foreach ($original->getTables() as $table) {
298 $new_table = new ilDataCollectionTable();
299 $new_table->setObjId($this->getId());
300 $new_table->cloneStructure($table);
301
302 if ($table->getId() == $original->getMainTableId()) {
303 $this->setMainTableId($new_table->getId());
304 }
305 }
306
307 // update because maintable id is now set.
308 $this->doUpdate();
309
310 // Set new field-ID of referenced fields
311 foreach ($original->getTables() as $origTable) {
312 foreach ($origTable->getRecordFields() as $origField) {
313 if ($origField->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_REFERENCE) {
314 $newRefId = NULL;
315 $origFieldRefObj = ilDataCollectionCache::getFieldCache($origField->getFieldRef());
316 $origRefTable = ilDataCollectionCache::getTableCache($origFieldRefObj->getTableId());
317 // Lookup the new ID of the referenced field in the actual DC
318 $tableId = ilDataCollectionTable::_getTableIdByTitle($origRefTable->getTitle(), $this->getId());
319 $fieldId = ilDataCollectionField::_getFieldIdByTitle($origFieldRefObj->getTitle(), $tableId);
320 $field = ilDataCollectionCache::getFieldCache($fieldId);
321 $newRefId = $field->getId();
322 // Set the new refID in the actual DC
323 $tableId = ilDataCollectionTable::_getTableIdByTitle($origTable->getTitle(), $this->getId());
324 $fieldId = ilDataCollectionField::_getFieldIdByTitle($origField->getTitle(), $tableId);
325 $field = ilDataCollectionCache::getFieldCache($fieldId);
326 $field->setPropertyvalue($newRefId, ilDataCollectionField::PROPERTYID_REFERENCE);
327 $field->doUpdate();
328 }
329 }
330 }
331 }
static _getFieldIdByTitle($title, $table_id)
Class ilDataCollectionField.
static _getTableIdByTitle($title, $obj_id)
Class ilObjDataCollection.
setPublicNotes($a_val)
setPublicNotes
setNotification($a_val)
setNotification
getId()
get object id @access public

References ilDataCollectionField\_getFieldIdByTitle(), ilDataCollectionTable\_getTableIdByTitle(), doUpdate(), ilDataCollectionCache\getFieldCache(), ilObject2\getId(), ilDataCollectionCache\getTableCache(), getTables(), ilDataCollectionDatatype\INPUTFORMAT_REFERENCE, ilDataCollectionField\PROPERTYID_REFERENCE, setApproval(), setMainTableId(), setNotification(), setPublicNotes(), and setRating().

Referenced by doCloneObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doClone()

ilObjDataCollection::doClone ( )
Returns
bool

Definition at line 80 of file class.ilObjDataCollection.php.

80 {
81 return false;
82 }

◆ doCloneObject()

ilObjDataCollection::doCloneObject ( ilObjDataCollection  $new_obj,
  $a_target_id,
  $a_copy_id = 0 
)

Clone DCL.

Parameters
ilObjDataCollectionnew object
inttarget ref_id
intcopy id
Returns
ilObjPoll

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

232 {
233
234 //copy online status if object is not the root copy object
235 $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
236
237 if(!$cp_options->isRootNode($this->getRefId()))
238 {
239 $new_obj->setOnline($this->getOnline());
240 }
241
242 $new_obj->cloneStructure($this->getRefId());
243
244 return $new_obj;
245 }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
cloneStructure($original_id)
Attention only use this for objects who have not yet been created (use like: $x = new ilObjDataCollec...
getRefId()
get reference id @access public

References ilCopyWizardOptions\_getInstance(), cloneStructure(), getOnline(), ilObject2\getRefId(), and setOnline().

+ Here is the call graph for this function:

◆ doCreate()

ilObjDataCollection::doCreate ( )
protected

Reimplemented from ilObject2.

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

47 {
48 global $ilDB, $ilLog;
49
50 $ilLog->write('doCreate');
51
52 //Create Main Table - The title of the table is per default the title of the data collection object
53 require_once('./Modules/DataCollection/classes/class.ilDataCollectionTable.php');
55 $main_table->setObjId($this->getId());
56 $main_table->setTitle($this->getTitle());
57 $main_table->setAddPerm(1);
58 $main_table->setEditPerm(1);
59 $main_table->setDeletePerm(1);
60 $main_table->setEditByOwner(1);
61 $main_table->setLimited(0);
62 $main_table->doCreate();
63
64 $ilDB->insert("il_dcl_data", array(
65 "id" => array( "integer", $this->getId() ),
66 "main_table_id" => array( "integer", (int)$main_table->getId() ),
67 "is_online" => array( "integer", (int)$this->getOnline() ),
68 "rating" => array( "integer", (int)$this->getRating() ),
69 "public_notes" => array( "integer", (int)$this->getPublicNotes() ),
70 "approval" => array( "integer", (int)$this->getApproval() ),
71 "notification" => array( "integer", (int)$this->getNotification() ),
72 ));
73 $this->setMainTableId($main_table->getId());
74 }
getTitle()
get object title @access public

References $ilDB, $ilLog, getApproval(), ilObject2\getId(), getNotification(), getOnline(), getPublicNotes(), getRating(), ilDataCollectionCache\getTableCache(), ilObject2\getTitle(), and setMainTableId().

+ Here is the call graph for this function:

◆ doDelete()

ilObjDataCollection::doDelete ( )
protected

Reimplemented from ilObject2.

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

85 {
86 global $ilDB;
87
88 foreach ($this->getTables() as $table) {
89 $table->doDelete(true);
90 }
91
92 $query = "DELETE FROM il_dcl_data WHERE id = " . $ilDB->quote($this->getId(), "integer");
93 $ilDB->manipulate($query);
94 }

References $ilDB, $query, ilObject2\getId(), and getTables().

+ Here is the call graph for this function:

◆ doRead()

ilObjDataCollection::doRead ( )

Reimplemented from ilObject2.

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

32 {
33 global $ilDB;
34
35 $result = $ilDB->query("SELECT * FROM il_dcl_data WHERE id = " . $ilDB->quote($this->getId(), "integer"));
36
37 $data = $ilDB->fetchObject($result);
38 $this->setMainTableId($data->main_table_id);
39 $this->setOnline($data->is_online);
40 $this->setRating($data->rating);
41 $this->setApproval($data->approval);
42 $this->setPublicNotes($data->public_notes);
43 $this->setNotification($data->notification);
44 }
$data

References $data, $ilDB, $result, setApproval(), setMainTableId(), setNotification(), setOnline(), setPublicNotes(), and setRating().

+ Here is the call graph for this function:

◆ doUpdate()

ilObjDataCollection::doUpdate ( )

Reimplemented from ilObject2.

Definition at line 97 of file class.ilObjDataCollection.php.

97 {
98 global $ilDB;
99
100 $ilDB->update("il_dcl_data", array(
101 "id" => array( "integer", $this->getId() ),
102 "main_table_id" => array( "integer", (int)$this->getMainTableId() ),
103 "is_online" => array( "integer", (int)$this->getOnline() ),
104 "rating" => array( "integer", (int)$this->getRating() ),
105 "public_notes" => array( "integer", (int)$this->getPublicNotes() ),
106 "approval" => array( "integer", (int)$this->getApproval() ),
107 "notification" => array( "integer", (int)$this->getNotification() ),
108 ), array(
109 "id" => array( "integer", $this->getId() )
110 ));
111 }

References $ilDB, getApproval(), ilObject2\getId(), getMainTableId(), getNotification(), getOnline(), getPublicNotes(), and getRating().

Referenced by cloneStructure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getApproval()

ilObjDataCollection::getApproval ( )

getApproval

Definition at line 393 of file class.ilObjDataCollection.php.

393 {
394 return $this->approval;
395 }

Referenced by doCreate(), and doUpdate().

+ Here is the caller graph for this function:

◆ getMainTableId()

ilObjDataCollection::getMainTableId ( )
Returns
mixed

Definition at line 218 of file class.ilObjDataCollection.php.

References $main_table_id.

Referenced by doUpdate().

+ Here is the caller graph for this function:

◆ getNotification()

ilObjDataCollection::getNotification ( )

getNotification

Definition at line 409 of file class.ilObjDataCollection.php.

409 {
410 return $this->notification;
411 }

Referenced by doCreate(), and doUpdate().

+ Here is the caller graph for this function:

◆ getOnline()

ilObjDataCollection::getOnline ( )

getOnline

Definition at line 345 of file class.ilObjDataCollection.php.

345 {
346 return $this->is_online;
347 }

Referenced by doCloneObject(), doCreate(), and doUpdate().

+ Here is the caller graph for this function:

◆ getPublicNotes()

ilObjDataCollection::getPublicNotes ( )

getPublicNotes

Definition at line 377 of file class.ilObjDataCollection.php.

377 {
378 return $this->public_notes;
379 }

Referenced by doCreate(), and doUpdate().

+ Here is the caller graph for this function:

◆ getRating()

ilObjDataCollection::getRating ( )

getRating

Definition at line 361 of file class.ilObjDataCollection.php.

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

Referenced by doCreate(), and doUpdate().

+ Here is the caller graph for this function:

◆ getStyleSheetId()

ilObjDataCollection::getStyleSheetId ( )

Definition at line 486 of file class.ilObjDataCollection.php.

486{ }

◆ getTables()

ilObjDataCollection::getTables ( )
Returns
ilDataCollectionTable[] Returns an array of tables of this collection with ids of the tables as keys.

Definition at line 439 of file class.ilObjDataCollection.php.

439 {
440 global $ilDB;
441
442 $query = "SELECT id FROM il_dcl_table WHERE obj_id = " . $ilDB->quote($this->getId(), "integer");
443 $set = $ilDB->query($query);
444 $tables = array();
445
446 while ($rec = $ilDB->fetchAssoc($set)) {
447 $tables[$rec['id']] = ilDataCollectionCache::getTableCache($rec['id']);
448 }
449
450 return $tables;
451 }

References $ilDB, $query, ilObject2\getId(), and ilDataCollectionCache\getTableCache().

Referenced by cloneStructure(), doDelete(), and getVisibleTables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getVisibleTables()

ilObjDataCollection::getVisibleTables ( )
Returns
array

Definition at line 457 of file class.ilObjDataCollection.php.

457 {
458 $tables = array();
459 foreach ($this->getTables() as $table) {
460 if ($table->getIsVisible()) {
461 $tables[$table->getId()] = $table;
462 }
463 }
464
465 return $tables;
466 }

References getTables().

+ Here is the call graph for this function:

◆ initType()

ilObjDataCollection::initType ( )

Reimplemented from ilObject2.

Definition at line 27 of file class.ilObjDataCollection.php.

27 {
28 $this->type = "dcl";
29 }

◆ sendNotification()

static ilObjDataCollection::sendNotification (   $a_action,
  $a_table_id,
  $a_record_id = NULL 
)
static
Parameters
$a_action
$a_table_id
null$a_record_id

Definition at line 119 of file class.ilObjDataCollection.php.

119 {
120 global $ilUser, $ilAccess;
121
122 // If coming from trash, never send notifications and don't load dcl Object
123 if ($_GET['ref_id'] == SYSTEM_FOLDER_ID) {
124 return;
125 }
126
127 $dclObj = new ilObjDataCollection($_GET['ref_id']);
128
129 if ($dclObj->getNotification() != 1) {
130 return;
131 }
132 $obj_table = ilDataCollectionCache::getTableCache($a_table_id);
133 $obj_dcl = $obj_table->getCollectionObject();
134
135 // recipients
136 require_once('./Services/Notification/classes/class.ilNotification.php');
138 if (! sizeof($users)) {
139 return;
140 }
141
143
144 //FIXME $_GET['ref_id]
145 require_once('./Services/Link/classes/class.ilLink.php');
146 $link = ilLink::_getLink($_GET['ref_id']);
147
148 // prepare mail content
149 // use language of recipient to compose message
150 require_once('./Services/Language/classes/class.ilLanguageFactory.php');
151
152 // send mails
153 require_once('./Services/Mail/classes/class.ilMail.php');
154 require_once('./Services/User/classes/class.ilObjUser.php');
155 require_once('./Services/Language/classes/class.ilLanguageFactory.php');
156 require_once('./Services/User/classes/class.ilUserUtil.php');
157 require_once('./Services/User/classes/class.ilUserUtil.php');
158 require_once('./Modules/DataCollection/classes/class.ilDataCollectionTable.php');
159
160 foreach (array_unique($users) as $idx => $user_id) {
161 // the user responsible for the action should not be notified
162 // FIXME $_GET['ref_id]
163 if ($user_id != $ilUser->getId() && $ilAccess->checkAccessOfUser($user_id, 'read', '', $_GET['ref_id'])) {
164 // use language of recipient to compose message
166 $ulng->loadLanguageModule('dcl');
167
168 $subject = sprintf($ulng->txt('dcl_change_notification_subject'), $obj_dcl->getTitle());
169 // update/delete
170 $message = $ulng->txt("dcl_hello") . " " . ilObjUser::_lookupFullname($user_id) . ",\n\n";
171 $message .= $ulng->txt('dcl_change_notification_dcl_' . $a_action) . ":\n\n";
172 $message .= $ulng->txt('obj_dcl') . ": " . $obj_dcl->getTitle() . "\n\n";
173 $message .= $ulng->txt('dcl_table') . ": " . $obj_table->getTitle() . "\n\n";
174 $message .= $ulng->txt('dcl_record') . ":\n";
175 $message .= "------------------------------------\n";
176 if ($a_record_id) {
177 $record = ilDataCollectionCache::getRecordCache($a_record_id);
178 if (! $record->getTableId()) {
179 $record->setTableId($a_table_id);
180 }
181 // $message .= $ulng->txt('dcl_record_id').": ".$a_record_id.":\n";
182 $t = "";
183 foreach ($record->getTable()->getVisibleFields() as $field) {
184 if ($record->getRecordField($field->getId())) {
185 $t .= $field->getTitle() . ": " . $record->getRecordField($field->getId())->getPlainText() . "\n";
186 }
187 }
188 $message .= $t . "\n";
189 }
190 $message .= "------------------------------------\n";
191 $message .= $ulng->txt('dcl_changed_by') . ": " . $ilUser->getFullname() . " " . ilUserUtil::getNamePresentation($ilUser->getId())
192 . "\n\n";
193 $message .= $ulng->txt('dcl_change_notification_link') . ": " . $link . "\n\n";
194
195 $message .= $ulng->txt('dcl_change_why_you_receive_this_email');
196
197 $mail_obj = new ilMail(ANONYMOUS_USER_ID);
198 $mail_obj->appendInstallationSignature(true);
199 $mail_obj->sendMail(ilObjUser::_lookupLogin($user_id), "", "", $subject, $message, array(), array( "system" ));
200 } else {
201 unset($users[$idx]);
202 }
203 }
204 }
$_GET["client_id"]
static getRecordCache($record_id=0)
static _getLanguageOfUser($a_usr_id)
Get language object of user.
Class Mail this class handles base functions for mail handling.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
static updateNotificationTime($type, $id, array $user_ids, $page_id=false)
Update the last mail timestamp for given object and users.
static _lookupLogin($a_user_id)
lookup login
_lookupFullname($a_user_id)
Lookup Full Name.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
global $ilUser
Definition: imgupload.php:15

References $_GET, $ilUser, $t, ilLanguageFactory\_getLanguageOfUser(), ilLink\_getLink(), ilObjUser\_lookupFullname(), ilObjUser\_lookupLogin(), ilUserUtil\getNamePresentation(), ilNotification\getNotificationsForObject(), ilDataCollectionCache\getRecordCache(), ilDataCollectionCache\getTableCache(), ilNotification\TYPE_DATA_COLLECTION, and ilNotification\updateNotificationTime().

Referenced by ilDataCollectionRecord\doDelete(), ilDataCollectionRecord\doUpdate(), and ilDataCollectionRecordEditGUI\save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setApproval()

ilObjDataCollection::setApproval (   $a_val)

setApproval

Definition at line 385 of file class.ilObjDataCollection.php.

385 {
386 $this->approval = $a_val;
387 }

Referenced by cloneStructure(), and doRead().

+ Here is the caller graph for this function:

◆ setMainTableId()

ilObjDataCollection::setMainTableId (   $a_val)
Parameters
$a_val

Definition at line 210 of file class.ilObjDataCollection.php.

210 {
211 $this->main_table_id = $a_val;
212 }

Referenced by cloneStructure(), doCreate(), and doRead().

+ Here is the caller graph for this function:

◆ setNotification()

ilObjDataCollection::setNotification (   $a_val)

setNotification

Definition at line 401 of file class.ilObjDataCollection.php.

401 {
402 $this->notification = $a_val;
403 }

Referenced by cloneStructure(), and doRead().

+ Here is the caller graph for this function:

◆ setOnline()

ilObjDataCollection::setOnline (   $a_val)

setOnline

Definition at line 337 of file class.ilObjDataCollection.php.

337 {
338 $this->is_online = $a_val;
339 }

Referenced by doCloneObject(), and doRead().

+ Here is the caller graph for this function:

◆ setPublicNotes()

ilObjDataCollection::setPublicNotes (   $a_val)

setPublicNotes

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

369 {
370 $this->public_notes = $a_val;
371 }

Referenced by cloneStructure(), and doRead().

+ Here is the caller graph for this function:

◆ setRating()

ilObjDataCollection::setRating (   $a_val)

setRating

Definition at line 353 of file class.ilObjDataCollection.php.

353 {
354 $this->rating = $a_val;
355 }

Referenced by cloneStructure(), and doRead().

+ Here is the caller graph for this function:

Field Documentation

◆ $main_table_id

ilObjDataCollection::$main_table_id
protected

Definition at line 24 of file class.ilObjDataCollection.php.

Referenced by getMainTableId().


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