ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjectLP Class Reference
+ Inheritance diagram for ilObjectLP:
+ Collaboration diagram for ilObjectLP:

Public Member Functions

 resetCaches ()
 
 isAnonymized ()
 
 getDefaultMode ()
 
 getValidModes ()
 
 getCurrentMode ()
 
 isActive ()
 
 getModeText ($a_mode)
 
 getModeInfoText ($a_mode)
 
 getSettingsInfo ()
 
 getCollectionInstance ()
 
 getMembers ($a_search=true)
 
 resetLPDataForCompleteObject ($a_recursive=true)
 
 resetLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 
 handleToTrash ()
 
 handleDelete ()
 
 getMailTemplateId ()
 

Static Public Member Functions

static getInstance ($a_obj_id)
 
static isSupportedObjectType ($a_type)
 
static handleMove ($a_source_ref_id)
 
static getLPMemberships ($a_usr_id, array $a_obj_ids, $a_parent_ref_id=null, $a_mapped_ref_ids=false)
 Get all objects where given user is member (from LP POV)
More...
 
static supportsSpentSeconds ($a_obj_type)
 
static supportsMark ($a_obj_type)
 
static supportsMatrixView ($a_obj_type)
 

Protected Member Functions

 __construct ($a_obj_id)
 
 resetCustomLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 
 gatherLPUsers ()
 
 updateParentCollections ()
 

Static Protected Member Functions

static getTypeClass ($a_type)
 
static isLPMember (array &$a_res, $a_usr_id, $a_obj_ids)
 Find (lp-relevant) members for given object ids. More...
 
static findMembershipsByPath (array &$a_res, $a_usr_id, $a_parent_ref_id, array $a_obj_ids, $a_mapped_ref_ids=false)
 Find (lp-relevant) memberships by path. More...
 

Protected Attributes

 $obj_id
 
 $collection_instance
 
 $mode
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilObjectLP::__construct (   $a_obj_id)
protected

Reimplemented in ilPluginLP.

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

21 {
22 $this->obj_id = (int)$a_obj_id;
23 }

Member Function Documentation

◆ findMembershipsByPath()

static ilObjectLP::findMembershipsByPath ( array &  $a_res,
  $a_usr_id,
  $a_parent_ref_id,
array  $a_obj_ids,
  $a_mapped_ref_ids = false 
)
staticprotected

Find (lp-relevant) memberships by path.

Parameters
array$a_res
int$a_usr_id
int$a_parent_ref_id
array$a_obj_ids
bool$a_mapped_ref_ids
Returns
array

Definition at line 462 of file class.ilObjectLP.php.

463 {
464 global $tree;
465
466 $found = array();
467
468 // walk path to find course or group object and check members of that object
469 $path = $tree->getPathId($a_parent_ref_id);
470 foreach(array_reverse($path) as $path_ref_id)
471 {
472 $type = ilObject::_lookupType($path_ref_id, true);
473 if($type == "crs" ||
474 $type == "grp")
475 {
476 $class = self::getTypeClass($type);
477 $path_ob_id = ilObject::_lookupObjId($path_ref_id);
478 $chk = array();
479 $class::isLPMember($chk, $a_usr_id, array($path_ob_id));
480 if(!$a_mapped_ref_ids)
481 {
482 // we found a grp/crs in path of (single) parent - mark all objects
483 foreach($a_obj_ids as $obj_id)
484 {
485 $found[] = $obj_id;
486 if($chk[$path_ob_id])
487 {
488 $a_res[$obj_id] = true;
489 }
490 }
491 }
492 else
493 {
494 // all children from current node are "lp-valid"
495 foreach($a_obj_ids as $obj_id => $ref_ids)
496 {
497 foreach($ref_ids as $ref_id)
498 {
499 if($tree->isGrandChild($path_ref_id, $ref_id))
500 {
501 $found[$obj_id][] = $ref_id;
502 if($chk[$path_ob_id])
503 {
504 $a_res[$obj_id] = true;
505 }
506 break;
507 }
508 }
509 }
510 }
511 break;
512 }
513 }
514
515 return $found;
516 }
static getTypeClass($a_type)
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
$ref_id
Definition: sahs_server.php:39
$path
Definition: index.php:22

References $obj_id, $path, $ref_id, ilObject\_lookupObjId(), ilObject\_lookupType(), and getTypeClass().

Referenced by getLPMemberships().

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

◆ gatherLPUsers()

ilObjectLP::gatherLPUsers ( )
protected

Definition at line 312 of file class.ilObjectLP.php.

313 {
314 include_once "Services/Tracking/classes/class.ilLPMarks.php";
315 $user_ids = ilLPMarks::_getAllUserIds($this->obj_id);
316
317 include_once "Services/Tracking/classes/class.ilChangeEvent.php";
318 $user_ids = array_merge($user_ids, ilChangeEvent::_getAllUserIds($this->obj_id));
319
320 return $user_ids;
321 }
static _getAllUserIds($a_obj_id)
static _getAllUserIds($a_obj_id)

References ilChangeEvent\_getAllUserIds(), and ilLPMarks\_getAllUserIds().

Referenced by resetLPDataForCompleteObject().

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

◆ getCollectionInstance()

ilObjectLP::getCollectionInstance ( )

Definition at line 219 of file class.ilObjectLP.php.

220 {
221 if($this->collection_instance === null)
222 {
223 include_once "Services/Tracking/classes/collection/class.ilLPCollection.php";
224 $this->collection_instance = ilLPCollection::getInstanceByMode($this->obj_id, $this->getCurrentMode());
225 }
226
228 }
static getInstanceByMode($a_obj_id, $a_mode)

References $collection_instance, getCurrentMode(), and ilLPCollection\getInstanceByMode().

Referenced by handleDelete().

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

◆ getCurrentMode()

ilObjectLP::getCurrentMode ( )

Reimplemented in ilCourseLP, ilScormLP, and ilPluginLP.

Definition at line 171 of file class.ilObjectLP.php.

172 {
173 if($this->mode === null)
174 {
175 $mode = ilLPObjSettings::_lookupDBMode($this->obj_id);
176 if($mode === null)
177 {
178 $mode = $this->getDefaultMode();
179 }
180 $this->mode = (int)$mode;
181 }
182
183 return $this->mode;
184 }
static _lookupDBMode($a_obj_id)

References $mode, ilLPObjSettings\_lookupDBMode(), and getDefaultMode().

Referenced by getCollectionInstance(), and isActive().

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

◆ getDefaultMode()

ilObjectLP::getDefaultMode ( )

◆ getInstance()

static ilObjectLP::getInstance (   $a_obj_id)
static

Definition at line 25 of file class.ilObjectLP.php.

26 {
27 static $instances = array();
28
29 if(!isset($instances[$a_obj_id]))
30 {
31 $type = ilObject::_lookupType($a_obj_id);
32 $class = self::getTypeClass($type);
33 if($class)
34 {
35 $instance = new $class($a_obj_id);
36 }
37 else
38 {
39 // :TODO: should we return anything?
40 $instance = new self($a_obj_id);
41 }
42 $instances[$a_obj_id] = $instance;
43 }
44
45 return $instances[$a_obj_id];
46 }

References ilObject\_lookupType(), and getTypeClass().

Referenced by ilLearningProgressBaseGUI\__appendLPDetails(), ilLPListOfSettingsGUI\__construct(), ilTrSummaryTableGUI\__construct(), ilLPProgressTableGUI\__construct(), ilLPTableBaseGUI\__construct(), ilLearningProgressGUI\__getNextClass(), ilLPListOfObjectsGUI\__initDetails(), ilLPListOfProgressGUI\__initDetails(), ilLearningProgressBaseGUI\__readItemStatusInfo(), ilLearningProgressBaseGUI\__setSubTabs(), ilLearningProgressBaseGUI\__showObjectDetails(), ilLPStatusFactory\_getClassById(), ilLPStatusCollection\_getCompleted(), ilLPStatusCollection\_getFailed(), ilLPStatusCollection\_getInProgress(), ilLPStatusFactory\_getInstance(), ilLPStatusCollection\_getStatusInfo(), ilLPStatusCollectionManual\_getStatusInfo(), ilLPStatusSCORM\_getStatusInfo(), ilLPStatusCollectionTLT\_getStatusInfo(), ilLPStatusCollectionManual\_setObjectStatus(), ilTimingCache\_showWarning(), ilConditionHandlerGUI\assign(), ilLearningProgressAccess\checkAccess(), ilLMExplorerGUI\checkLPIcon(), ilLPStatus\checkLPModesForObjects(), ilContainer\cloneDependencies(), ilObjSurvey\deleteAllUserData(), ilLPStatusSCORM\determinePercentage(), ilLPStatusCollection\determineStatus(), ilLPStatusSCORM\determineStatus(), ilLearningProgressGUI\editManual(), ilLPProgressTableGUI\fillRow(), ilLPCronObjectStatistics\gatherCourseLPData(), ilSCORMCertificateAdapter\getCertificateVariablesDescription(), ilSCORMCertificateAdapter\getCertificateVariablesForPresentation(), ilSCORMCertificateAdapter\getCertificateVariablesForPreview(), ilLPStatusCollectionMobs\getCollectionItems(), ilTrSummaryTableGUI\getItems(), ilLPListOfSettingsGUI\getLPPathInfo(), getMembers(), ilTrQuery\getObjectIds(), ilTrQuery\getObjectsStatusForUser(), ilLPTableBaseGUI\getSelectableUserColumns(), ilObjSCORMInitData\getStatus(), ilTrQuery\getSubItemsStatusForUser(), ilTrQuery\getSubTree(), ilCourseAppEventListener\handleEvent(), ilTrackingAppEventListener\handleEvent(), ilSCORMOfflineMode\il2sop(), ilLearningProgressBaseGUI\ilLearningProgressBaseGUI(), ilLPObjSettings\ilLPObjSettings(), ilObjSCORM2004LearningModule\importSuccess(), ilObjSCORMLearningModule\importSuccess(), ilObjCourseGUI\initAttendanceList(), ilObjGroupGUI\initAttendanceList(), ilLearningProgressGUI\initCollectionManualForm(), ilObjCourseGUI\initEditForm(), ilLearningProgressBaseGUI\initEditUserForm(), ilTrUserObjectsPropsTableGUI\initFilter(), ilConditionHandlerGUI\initFormCondition(), ilLPStatusPlugin\initPluginObj(), ilLPTableBaseGUI\isPercentageAvailable(), ilSCORMTrackingItems\markedLearningStatusForExportSelected(), ilLMObject\MDUpdateListener(), ilObjContentObject\MDUpdateListener(), ilObjCourseGUI\membersObject(), ilObjGroupGUI\membersObject(), ilLPCollectionOfRepositoryObjects\parseTableGUIItem(), ilLPTableBaseGUI\parseTitle(), ilObjSurvey\removeSelectedSurveyResults(), ilObjTest\removeTestResults(), resetLPDataForUserIds(), ilCourseObjectiveResult\resetTestForUser(), ilInfoScreenGUI\saveProgress(), ilLPTableBaseGUI\searchFilterListener(), ilLPTableBaseGUI\sendMail(), ilObjContentObjectGUI\setilLMMenu(), ilInfoScreenGUI\showLearningProgress(), ilLearningProgressGUI\showtlt(), ilConditionHandlerGUI\updateCondition(), ilObjCourseGUI\updateLPFromStatus(), ilLearningProgressGUI\updateManual(), and ilLPCollectionOfRepositoryObjects\validateEntry().

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

◆ getLPMemberships()

static ilObjectLP::getLPMemberships (   $a_usr_id,
array  $a_obj_ids,
  $a_parent_ref_id = null,
  $a_mapped_ref_ids = false 
)
static

Get all objects where given user is member (from LP POV)

Parameters
int$a_usr_id
array$a_obj_ids
int$a_parent_ref_id
bool$a_mapped_ref_ids
Returns
array

Definition at line 527 of file class.ilObjectLP.php.

528 {
529 global $ilDB, $tree;
530
531 // see ilTrQuery::getParticipantsForObject() [single object only]
532 // this is optimized for larger number of objects, e.g. list GUIs
533
534 if((bool)$a_mapped_ref_ids)
535 {
536 $ref_map = $a_obj_ids;
537 $a_obj_ids = array_keys($a_obj_ids);
538 }
539
540 $res = array();
541
542 // get object types
543 $types_map = array();
544 $query = " SELECT obj_id, type".
545 " FROM object_data".
546 " WHERE ".$ilDB->in("obj_id", $a_obj_ids, "", "integer");
547 $set = $ilDB->query($query);
548 while($row = $ilDB->fetchAssoc($set))
549 {
550 $types_map[$row["type"]][] = $row["obj_id"];
551 $res[$row["obj_id"]] = false;
552 }
553
554 $find_by_parent = array();
555 foreach($types_map as $type => $type_obj_ids)
556 {
557 $class = self::getTypeClass($type);
558 if($class)
559 {
560 // lp-supported type?
561 if(!$class::isLPMember($res, $a_usr_id, $type_obj_ids))
562 {
563 $find_by_parent = array_merge($find_by_parent, $type_obj_ids);
564 }
565 }
566 }
567
568 if(sizeof($find_by_parent))
569 {
570 // single parent for all objects (repository/ilObjectListGUI)
571 if($a_parent_ref_id)
572 {
573 if(self::findMembershipsByPath($res, $a_usr_id, $a_parent_ref_id, $find_by_parent))
574 {
575 // we found a crs/grp in path, so no need to check read_events
576 $find_by_parent = null;
577 }
578 }
579 // different parents (PD > LP)
580 else if(sizeof($ref_map))
581 {
582 foreach($find_by_parent as $obj_id)
583 {
584 // maybe already found by path search from other object/reference
585 if($res[$obj_id] === false)
586 {
587 if(isset($ref_map[$obj_id]))
588 {
589 // check all references
590 foreach($ref_map[$obj_id] as $ref_id)
591 {
592 $parent_ref_id = $tree->getParentId($ref_id);
593 if($parent_ref_id == ROOT_FOLDER_ID)
594 {
595 continue;
596 }
597
598 // we are checking the complete ref_map
599 // to find all relevant objects in subtree of current ref_id
600 $found = self::findMembershipsByPath($res, $a_usr_id, $parent_ref_id, $ref_map, true);
601 if(sizeof($found))
602 {
603 // if any references were found in a crs/grp-subtree
604 // remove from "read-event"-last-resort-pool
605 foreach($found as $found_obj_id => $found_ref_ids)
606 {
607 $diff = array_diff($ref_map[$found_obj_id], $found_ref_ids);
608 if($diff)
609 {
610 // 1-n refs are in another subtree
611 // have to be checked separately
612 $ref_map[$found_obj_id] = $diff;
613 }
614 else
615 {
616 // all references found in subtree
617 // no need to check again
618 unset($ref_map[$found_obj_id]);
619 }
620 }
621 break;
622 }
623 }
624 }
625 }
626 }
627
628 $find_by_parent = array_keys($ref_map);
629 }
630
631 // last resort: use read_event?
632 if(sizeof($find_by_parent))
633 {
634 $set = $ilDB->query("SELECT obj_id".
635 " FROM read_event".
636 " WHERE ".$ilDB->in("obj_id", $find_by_parent, "", "integer").
637 " AND usr_id = ".$ilDB->quote($a_usr_id, "integer"));
638 while($row = $ilDB->fetchAssoc($set))
639 {
640 $res[$row["obj_id"]] = true;
641 }
642 }
643 }
644
645 return $res;
646 }
static findMembershipsByPath(array &$a_res, $a_usr_id, $a_parent_ref_id, array $a_obj_ids, $a_mapped_ref_ids=false)
Find (lp-relevant) memberships by path.
global $ilDB

References $ilDB, $obj_id, $query, $ref_id, $res, $row, findMembershipsByPath(), and getTypeClass().

Referenced by ilLPProgressTableGUI\getItems(), and ilLPStatus\validateLPForObjects().

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

◆ getMailTemplateId()

ilObjectLP::getMailTemplateId ( )

Reimplemented in ilCourseLP, and ilScormLP.

Definition at line 648 of file class.ilObjectLP.php.

649 {
650 // type-specific
651 }

◆ getMembers()

ilObjectLP::getMembers (   $a_search = true)

Reimplemented in ilCourseLP, ilGroupLP, and ilStudyProgrammeLP.

Definition at line 235 of file class.ilObjectLP.php.

236 {
237 global $tree;
238
239 if(!$a_search)
240 {
241 return;
242 }
243
244 $ref_ids = ilObject::_getAllReferences($this->obj_id);
245 $ref_id = current($ref_ids);
246
247 // walk path to find parent with specific members
248 $path = $tree->getPathId($ref_id);
249 array_pop($path);
250 foreach(array_reverse($path) as $path_ref_id)
251 {
252 $olp = self::getInstance(ilObject::_lookupObjId($path_ref_id));
253 $all = $olp->getMembers(false);
254 if(is_array($all))
255 {
256 return $all;
257 }
258 }
259 }
static getInstance($a_obj_id)
static _getAllReferences($a_id)
get all reference ids of object

References $path, $ref_id, ilObject\_getAllReferences(), ilObject\_lookupObjId(), and getInstance().

+ Here is the call graph for this function:

◆ getModeInfoText()

ilObjectLP::getModeInfoText (   $a_mode)

Definition at line 204 of file class.ilObjectLP.php.

205 {
206 return ilLPObjSettings::_mode2InfoText($a_mode);
207 }
static _mode2InfoText($a_mode)

References ilLPObjSettings\_mode2InfoText().

+ Here is the call graph for this function:

◆ getModeText()

ilObjectLP::getModeText (   $a_mode)

Definition at line 199 of file class.ilObjectLP.php.

200 {
201 return ilLPObjSettings::_mode2Text($a_mode);
202 }
static _mode2Text($a_mode)

References ilLPObjSettings\_mode2Text().

+ Here is the call graph for this function:

◆ getSettingsInfo()

ilObjectLP::getSettingsInfo ( )

Reimplemented in ilCourseLP.

Definition at line 209 of file class.ilObjectLP.php.

210 {
211 // type-specific
212 }

◆ getTypeClass()

static ilObjectLP::getTypeClass (   $a_type)
staticprotected

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

49 {
50 global $objDefinition;
51
52 if(self::isSupportedObjectType($a_type))
53 {
54 switch($a_type)
55 {
56 // container
57
58 case "crs":
59 include_once "Modules/Course/classes/class.ilCourseLP.php";
60 return "ilCourseLP";
61
62 case "grp":
63 include_once "Modules/Group/classes/class.ilGroupLP.php";
64 return "ilGroupLP";
65
66 case "fold":
67 include_once "Modules/Folder/classes/class.ilFolderLP.php";
68 return "ilFolderLP";
69
70
71 // learning resources
72
73 case "lm":
74 include_once "Modules/LearningModule/classes/class.ilLearningModuleLP.php";
75 return "ilLearningModuleLP";
76
77 case "htlm":
78 include_once "Modules/HTMLLearningModule/classes/class.ilHTMLLearningModuleLP.php";
79 return "ilHTMLLearningModuleLP";
80
81 case "sahs":
82 include_once "Modules/ScormAicc/classes/class.ilScormLP.php";
83 return "ilScormLP";
84
85
86 // misc
87
88 case "tst":
89 include_once "Modules/Test/classes/class.ilTestLP.php";
90 return "ilTestLP";
91
92 case "exc":
93 include_once "Modules/Exercise/classes/class.ilExerciseLP.php";
94 return "ilExerciseLP";
95
96 case 'file':
97 require_once 'Modules/File/classes/class.ilFileLP.php';
98 return 'ilFileLP';
99
100 case "mcst":
101 require_once "Modules/MediaCast/classes/class.ilMediaCastLP.php";
102 return "ilMediaCastLP";
103
104 case "sess":
105 include_once "Modules/Session/classes/class.ilSessionLP.php";
106 return "ilSessionLP";
107
108 case "svy":
109 include_once "Modules/Survey/classes/class.ilSurveyLP.php";
110 return "ilSurveyLP";
111
112 case "prg":
113 include_once "Modules/StudyProgramme/classes/class.ilStudyProgrammeLP.php";
114 return "ilStudyProgrammeLP";
115
116 // plugin
117 case $objDefinition->isPluginTypeName($a_type):
118 include_once "Services/Component/classes/class.ilPluginLP.php";
119 return "ilPluginLP";
120 }
121 }
122 }

Referenced by findMembershipsByPath(), getInstance(), and getLPMemberships().

+ Here is the caller graph for this function:

◆ getValidModes()

ilObjectLP::getValidModes ( )

◆ handleDelete()

ilObjectLP::handleDelete ( )
final

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

392 {
393 include_once "Services/Tracking/classes/class.ilLPMarks.php";
394 ilLPMarks::deleteObject($this->obj_id);
395
396 include_once "Services/Tracking/classes/class.ilChangeEvent.php";
397 ilChangeEvent::_delete($this->obj_id);
398
399 $collection = $this->getCollectionInstance();
400 if($collection)
401 {
402 $collection->delete();
403 }
404
406 }
static _delete($a_obj_id)
Delete object entries.
static deleteObject($a_obj_id)
Delete object.

References ilChangeEvent\_delete(), ilLPMarks\deleteObject(), getCollectionInstance(), and updateParentCollections().

+ Here is the call graph for this function:

◆ handleMove()

static ilObjectLP::handleMove (   $a_source_ref_id)
staticfinal

Definition at line 328 of file class.ilObjectLP.php.

329 {
330 global $tree, $ilDB;
331
332 $ref_ids = $tree->getSubTreeIds($a_source_ref_id);
333 $ref_ids[] = $a_source_ref_id;
334
335 // get "parent" path to source node (not including source node)
336 $new_path = $tree->getPathId($a_source_ref_id);
337 array_pop($new_path);
338 $new_path = implode("/", $new_path);
339
340 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
341
342 // find collections with ref_ids
343 $set = $ilDB->query("SELECT DISTINCT(ut_lp_collections.obj_id) obj_id".
344 " FROM object_reference".
345 " JOIN ut_lp_collections ON".
346 " (".$ilDB->in("object_reference.ref_id", $ref_ids, "", "integer").
347 " AND object_reference.ref_id = ut_lp_collections.item_id)");
348 while ($rec = $ilDB->fetchAssoc($set))
349 {
350 if (in_array(ilObject::_lookupType($rec["obj_id"]), array("crs", "grp", "fold")))
351 {
352 $coll_ref_id = ilObject::_getAllReferences($rec["obj_id"]);
353 $coll_ref_id = array_pop($coll_ref_id);
354
355 // #13402
356 if($coll_ref_id == $a_source_ref_id)
357 {
358 continue;
359 }
360
361 // #17703 - collection has also been moved - nothing todo
362 if($tree->isGrandChild($a_source_ref_id, $coll_ref_id))
363 {
364 continue;
365 }
366
367 // get path to collection (including collection "parent")
368 $coll_path = $tree->getPathId($coll_ref_id);
369 $coll_path = implode("/", $coll_path);
370
371 // collection path is not inside new path
372 if(!stristr($new_path, $coll_path))
373 {
374 // delete all items of moved (sub-)tree
375 $query = "DELETE FROM ut_lp_collections".
376 " WHERE obj_id = ".$ilDB->quote($rec["obj_id"], "integer").
377 " AND ".$ilDB->in("item_id", $ref_ids, "", "integer");
378 $ilDB->manipulate($query);
379
380 ilLPStatusWrapper::_refreshStatus($rec["obj_id"]);
381 }
382 }
383 }
384 }
_refreshStatus($a_obj_id, $a_users=null)
Set dirty.

References $ilDB, $query, ilObject\_getAllReferences(), ilObject\_lookupType(), and ilLPStatusWrapper\_refreshStatus().

Referenced by ilTrackingAppEventListener\handleEvent().

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

◆ handleToTrash()

ilObjectLP::handleToTrash ( )
final

Definition at line 386 of file class.ilObjectLP.php.

387 {
388 $this->updateParentCollections();
389 }

References updateParentCollections().

+ Here is the call graph for this function:

◆ isActive()

ilObjectLP::isActive ( )

Definition at line 186 of file class.ilObjectLP.php.

187 {
188 // :TODO: check LP activation?
189
190 $mode = $this->getCurrentMode();
193 {
194 return false;
195 }
196 return true;
197 }

References $mode, getCurrentMode(), ilLPObjSettings\LP_MODE_DEACTIVATED, and ilLPObjSettings\LP_MODE_UNDEFINED.

+ Here is the call graph for this function:

◆ isAnonymized()

ilObjectLP::isAnonymized ( )

Reimplemented in ilSurveyLP, and ilTestLP.

Definition at line 150 of file class.ilObjectLP.php.

151 {
152 // see ilLPCollectionOfRepositoryObjects::validateEntry()
153 return false;
154 }

◆ isLPMember()

static ilObjectLP::isLPMember ( array &  $a_res,
  $a_usr_id,
  $a_obj_ids 
)
staticprotected

Find (lp-relevant) members for given object ids.

Parameters
array$a_res
int$a_usr_id
array$a_obj_ids

Reimplemented in ilPluginLP.

Definition at line 446 of file class.ilObjectLP.php.

447 {
448 // should be overwritten by object-type-specific class
449 return false;
450 }

◆ isSupportedObjectType()

static ilObjectLP::isSupportedObjectType (   $a_type)
static

Definition at line 124 of file class.ilObjectLP.php.

125 {
126 global $objDefinition;
127
128 $valid = array("crs", "grp", "fold", "lm", "htlm", "sahs", "tst", "exc", "sess", "svy", "file", "mcst", "prg");
129
130 if(in_array($a_type, $valid))
131 {
132 return true;
133 }
134
135 if($objDefinition->isPluginTypeName($a_type))
136 {
137 include_once 'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
139 }
140
141 return false;
142 }
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.
$valid

References $valid, and ilRepositoryObjectPluginSlot\isTypePluginWithLP().

Referenced by ilCtrl\checkLPSettingsForward(), ilLPListOfSettingsGUI\getLPPathInfo(), and ilConditionHandler\getOperatorsByTargetType().

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

◆ resetCaches()

ilObjectLP::resetCaches ( )

Definition at line 144 of file class.ilObjectLP.php.

145 {
146 $this->mode = null;
147 $this->collection_instance = null;
148 }

◆ resetCustomLPDataForUserIds()

ilObjectLP::resetCustomLPDataForUserIds ( array  $a_user_ids,
  $a_recursive = true 
)
protected

Reimplemented in ilTestLP.

Definition at line 307 of file class.ilObjectLP.php.

308 {
309 // this should delete all data that is relevant for the supported LP modes
310 }

Referenced by resetLPDataForUserIds().

+ Here is the caller graph for this function:

◆ resetLPDataForCompleteObject()

ilObjectLP::resetLPDataForCompleteObject (   $a_recursive = true)
final

Definition at line 266 of file class.ilObjectLP.php.

267 {
268 $user_ids = $this->gatherLPUsers();
269 if(sizeof($user_ids))
270 {
271 $this->resetLPDataForUserIds(array_unique($user_ids), $a_recursive);
272 }
273 }
resetLPDataForUserIds(array $a_user_ids, $a_recursive=true)

References gatherLPUsers(), and resetLPDataForUserIds().

+ Here is the call graph for this function:

◆ resetLPDataForUserIds()

ilObjectLP::resetLPDataForUserIds ( array  $a_user_ids,
  $a_recursive = true 
)
final

Definition at line 275 of file class.ilObjectLP.php.

276 {
277 if((bool)$a_recursive &&
278 method_exists($this, "getPossibleCollectionItems")) // #15203
279 {
280 $subitems = $this->getPossibleCollectionItems();
281 if(is_array($subitems))
282 {
283 foreach($subitems as $sub_ref_id)
284 {
285 $olp = self::getInstance(ilObject::_lookupObjId($sub_ref_id));
286 $olp->resetLPDataForUserIds($a_user_ids, false);
287 }
288 }
289 }
290
291 $this->resetCustomLPDataForUserIds($a_user_ids, (bool)$a_recursive);
292
293 include_once "Services/Tracking/classes/class.ilLPMarks.php";
294 ilLPMarks::_deleteForUsers($this->obj_id, $a_user_ids);
295
296 include_once "Services/Tracking/classes/class.ilChangeEvent.php";
297 ilChangeEvent::_deleteReadEventsForUsers($this->obj_id, $a_user_ids);
298
299 // update LP status to get collections up-to-date
300 include_once "Services/Tracking/classes/class.ilLPStatusWrapper.php";
301 foreach($a_user_ids as $user_id)
302 {
303 ilLPStatusWrapper::_updateStatus($this->obj_id, $user_id);
304 }
305 }
static _deleteReadEventsForUsers($a_obj_id, array $a_user_ids)
static _deleteForUsers($a_obj_id, array $a_user_ids)
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
resetCustomLPDataForUserIds(array $a_user_ids, $a_recursive=true)

References ilLPMarks\_deleteForUsers(), ilChangeEvent\_deleteReadEventsForUsers(), ilObject\_lookupObjId(), ilLPStatusWrapper\_updateStatus(), getInstance(), and resetCustomLPDataForUserIds().

Referenced by resetLPDataForCompleteObject().

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

◆ supportsMark()

◆ supportsMatrixView()

static ilObjectLP::supportsMatrixView (   $a_obj_type)
static

Definition at line 668 of file class.ilObjectLP.php.

669 {
670 return !in_array($a_obj_type, array('svy', 'tst', 'htlm', 'exc', 'sess', 'file', 'prg'));
671 }

Referenced by ilLearningProgressBaseGUI\__setSubTabs().

+ Here is the caller graph for this function:

◆ supportsSpentSeconds()

static ilObjectLP::supportsSpentSeconds (   $a_obj_type)
static

◆ updateParentCollections()

ilObjectLP::updateParentCollections ( )
finalprotected

Definition at line 408 of file class.ilObjectLP.php.

409 {
410 global $ilDB;
411
412 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
413
414 // update parent collections?
415 $set = $ilDB->query("SELECT ut_lp_collections.obj_id obj_id FROM ".
416 "object_reference JOIN ut_lp_collections ON ".
417 "(object_reference.obj_id = ".$ilDB->quote($this->obj_id, "integer").
418 " AND object_reference.ref_id = ut_lp_collections.item_id)");
419 while ($rec = $ilDB->fetchAssoc($set))
420 {
421 if (in_array(ilObject::_lookupType($rec["obj_id"]), array("crs", "grp", "fold")))
422 {
423 // remove from parent collection
424 $query = "DELETE FROM ut_lp_collections".
425 " WHERE obj_id = ".$ilDB->quote($rec["obj_id"], "integer").
426 " AND item_id = ".$ilDB->quote($this->obj_id, "integer");
427 $ilDB->manipulate($query);
428
429 ilLPStatusWrapper::_refreshStatus($rec["obj_id"]);
430 }
431 }
432 }

References $ilDB, $query, ilObject\_lookupType(), and ilLPStatusWrapper\_refreshStatus().

Referenced by handleDelete(), and handleToTrash().

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

Field Documentation

◆ $collection_instance

ilObjectLP::$collection_instance
protected

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

Referenced by getCollectionInstance().

◆ $mode

ilObjectLP::$mode
protected

Definition at line 18 of file class.ilObjectLP.php.

Referenced by getCurrentMode(), and isActive().

◆ $obj_id

ilObjectLP::$obj_id
protected

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

Referenced by findMembershipsByPath(), and getLPMemberships().


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