19 declare(strict_types=1);
77 $this->type_repository =
$dic[
'model.Type.ilStudyProgrammeTypeRepository'];
78 $this->auto_categories_repository =
$dic[
'model.AutoCategories.ilStudyProgrammeAutoCategoriesRepository'];
79 $this->auto_memberships_repository =
$dic[
'model.AutoMemberships.ilStudyProgrammeAutoMembershipsRepository'];
80 $this->membersourcereader_factory =
$dic[
'model.AutoMemberships.ilStudyProgrammeMembershipSourceReaderFactory'];
82 $this->settings_repository =
$dic[
'model.Settings.ilStudyProgrammeSettingsRepository'];
83 $this->assignment_repository =
$dic[
'repo.assignment'];
84 $this->events =
$dic[
'ilStudyProgrammeEvents'];
94 $ilUser = $DIC[
'ilUser'];
95 $this->webdir = $DIC->filesystem()->web();
98 $this->db = $DIC[
'ilDB'];
99 $this->
lng = $DIC[
'lng'];
104 $this->custom_icon_factory = $DIC[
'object.customicons.factory'];
106 self::initStudyProgrammeCache();
111 if (self::$study_programme_cache === null) {
122 $this->parent =
false;
130 $this->children = null;
138 $this->lp_children = null;
144 if (count($refs) < 1) {
145 throw new ilException(
"Could not find ref_id for programme with obj_id $obj_id");
147 return (
int) array_shift($refs);
162 if (self::$study_programme_cache === null) {
163 self::initStudyProgrammeCache();
165 return self::$study_programme_cache->getInstanceByRefId((
int)
$ref_id);
194 $obj->createReference();
195 self::$study_programme_cache->addInstance($obj);
211 throw new Exception(
"The given settings-object does not belong to this programme", 1);
230 $this->assignment_repository->deleteAllAssignmentsForProgrammeId($this->
getId());
238 $id = (
int) parent::create();
250 $type_settings = $this->
getSettings()->getTypeSettings();
252 if ($type_settings->getTypeId()) {
256 $this->type_repository->getAssignedAMDRecordIdsByType($type_settings->getTypeId())
270 public function delete():
bool 273 if (!parent::delete()) {
280 $this->auto_categories_repository->deleteFor($this->
getId());
288 $this->events->raise(
'delete', [
'object' => $this,
'obj_id' => $this->
getId()]);
294 $sub_type_id = $this->
getSettings()->getTypeSettings()->getTypeId();
297 $type = $this->type_repository->getType($sub_type_id);
300 return !is_null(
$type) && count($this->type_repository->getAssignedAMDRecordIdsByType(
$type->getId(),
true)) > 0;
320 return $this->
getSettings()->getAssessmentSettings()->getPoints();
332 $settings->withAssessmentSettings(
$settings->getAssessmentSettings()->withPoints($points))
359 if ($this->tree->isInTree($this->getRefId())) {
361 $this->settings_repository->update(
365 $this->settings_repository->update(
369 $this->settings_repository->update(
378 return $this->
getSettings()->getAssessmentSettings()->getStatus();
390 $settings->withAssessmentSettings(
$settings->getAssessmentSettings()->withStatus($a_status))
406 $type_settings = $this->
getSettings()->getTypeSettings();
407 if (!in_array($type_settings->getTypeId(), array(
"-",
"0"))) {
408 $subtype_id = $type_settings->getTypeId();
409 return $this->type_repository->getType($subtype_id);
428 public static function getAllChildren(
int $a_ref_id,
bool $include_references =
false): array
431 $root = self::getInstanceByRefId($a_ref_id);
432 $root_id = $root->getId();
435 if ($prg->
getId() === $root_id) {
439 }, $include_references);
464 public function getChildren(
bool $include_references =
false): array
468 if ($this->children === null) {
469 $ref_ids = $this->tree->getChildsByType($this->
getRefId(),
"prg");
473 $ref_ids = $sorting->sortItems(array(
'prg' => $ref_ids));
474 $ref_ids = $ref_ids[
'prg'];
476 $this->children = array_map(
static function ($node_data) {
481 if ($include_references && $this->reference_children === null) {
482 $this->reference_children = [];
483 $ref_child_ref_ids = $this->tree->getChildsByType($this->
getRefId(),
"prgr");
484 foreach ($this->children as $prg) {
487 $this->tree->getChildsByType($prg->getRefId(),
"prgr"),
494 static function (
$data) {
495 return (
int)
$data[
'child'];
497 array_filter($ref_child_ref_ids,
static function (
$data) {
498 return $data[
"deleted"] === null;
503 $this->reference_children[] =
507 return $include_references ?
508 array_merge($this->children, $this->reference_children) :
520 if ($this->parent ===
false) {
522 $parent_data = $this->tree->getParentNodeData($this->
getRefId());
523 if ($parent_data[
"type"] !==
"prg") {
524 $this->parent = null;
526 $this->parent = self::getInstanceByRefId($parent_data[
"ref_id"]);
537 static function (
$id) {
545 static function ($prg_ref) use (
$tree) {
561 public function getParents(
bool $include_references =
false): array
565 $queque = [$current];
566 while ($element = array_shift($queque)) {
567 $parent = $element->getParent();
568 if (
$parent === null || $include_references) {
570 if ($this->tree->isDeleted($reference->getRefId())) {
573 $r_parent = $reference->getParent();
574 if (is_null($r_parent)) {
577 $queque[] = $r_parent;
578 $parents[] = $r_parent;
585 return array_reverse($parents);
593 public function hasChildren(
bool $include_references =
false): bool
606 return count($this->
getChildren($include_references));
619 while ($cur = $cur->getParent()) {
632 if (count($parents) < 1) {
648 if ($this->lp_children === null) {
649 $this->lp_children = array();
651 $ref_ids = $this->tree->getChildsByType($this->
getRefId(),
"crsr");
655 $ref_ids = $sorting->sortItems(array(
'crs_ref' => $ref_ids));
656 $ref_ids = $ref_ids[
'crs_ref'];
658 $lp_children = array_map(
function ($node_data) {
659 $lp_obj = $this->object_factory->getInstanceByRefId((
int) $node_data[
"child"]);
662 return ($lp_obj instanceof $this) ? null : $lp_obj;
665 $this->lp_children = array_filter($lp_children);
678 return array_map(
static function ($child) {
679 return $child->getId();
702 if (!$this->tree->isInTree($this->getRefId())) {
722 if ($fun($this) !==
false) {
723 foreach ($this->
getChildren($include_references) as $child) {
724 $child->applyToSubTreeNodes($fun, $include_references);
736 $node_data = $this->tree->getNodeData($this->
getRefId());
737 $crsrs = $this->tree->getSubTree($node_data,
true, [
"crsr"]);
739 $completed_crss = array();
740 foreach ($crsrs as $ref) {
750 $containing_prg = self::getInstanceByRefId((
int) $ref[
"parent"]);
751 if ($containing_prg->isActive()) {
752 $completed_crss[] = [
754 ,
"prg_ref_id" => (
int) $ref[
"parent"]
755 ,
"prg_obj_id" => $containing_prg->getId()
756 ,
"crsr_ref_id" => (
int) $ref[
"child"]
757 ,
"crsr_id" => (
int) $ref[
"obj_id"]
758 ,
"crs_ref_id" => (
int) $crs_ref_id
759 ,
"crs_id" => (
int) $crs_id
766 return $completed_crss;
791 if ($this->tree->isInTree($a_prg->
getRefId())) {
822 $this->settings_repository->update(
840 parent::putInTree($parent_ref_id);
843 $par = self::getInstanceByRefId($parent_ref_id);
844 $par->nodeInserted($this);
868 $node_data = $this->tree->getNodeData($a_prg->
getRefId());
869 $this->tree->deleteTree($node_data);
897 $rbacadmin = $DIC[
'rbacadmin'];
904 $rbacadmin->adjustMovedObjectPermissions($this->
getRefId(),
$parent->getRefId());
912 $parent->clearLPChildrenCache();
928 return $msgs->withNewTopic($topic);
943 $this->members_cache = null;
947 "ilObjStudyProgramme::assignUser: Can't assign user to program '" 948 . $this->
getId() .
"', since it's not in active status." 952 if (is_null($acting_usr_id)) {
956 $ass = $this->assignment_repository->createFor($this->
getId(), $usr_id, $acting_usr_id);
958 ->initAssignmentDates();
960 $ass = $ass->resetProgresses(
965 $this->assignment_repository->store($ass);
968 $this->events->userAssigned($ass);
982 $this->members_cache = null;
985 "ilObjStudyProgramme::removeAssignment: Assignment '" 986 . $assignment->
getId() .
"' does not belong to study " 987 .
"program '" . $this->
getId() .
"'." 991 $this->assignment_repository->delete($assignment);
993 $affected_node_ids = array_map(fn ($pgs) => $pgs->getNodeId(), $assignment->
getProgresses());
994 foreach ($affected_node_ids as $node_obj_id) {
998 $this->events->userDeassigned($assignment);
1004 return $this->assignment_repository->get($assignment_id);
1009 $this->assignment_repository->storeExpiryInfoSentFor($ass);
1014 $this->assignment_repository->resetExpiryInfoSentFor($ass);
1019 $this->assignment_repository->storeRiskyToFailSentFor($ass);
1024 $this->assignment_repository->resetRiskyToFailSentFor($ass);
1053 $assignments = $this->assignment_repository->getAllForNodeIsContained(
1058 usort($assignments,
function ($a_one, $a_other) {
1060 $a_one->getLastChange()->format(
'Y-m-d'),
1061 $a_other->getLastChange()->format(
'Y-m-d')
1064 return $assignments;
1072 return $this->assignment_repository->getAllForNodeIsContained($this->
getId());
1083 $usr_ids[] = $assignment->getUserId();
1085 return array_unique($usr_ids);
1093 if (!$this->members_cache) {
1094 $this->members_cache = array_map(
1095 static function ($assignment) {
1096 return $assignment->getUserId();
1098 $this->assignment_repository->getByPrgId($this->
getId())
1110 $count = $this->assignment_repository->countAllForNodeIsContained(
1126 return $this->assignment_repository->getAllForSpecificNode($this->
getId(), [$usr_id]);
1150 foreach ($assignments as $ass) {
1151 $this->assignment_repository->store($ass);
1161 $filter = $filter->withValues([
1162 'prg_status_hide_irrelevant' =>
true 1164 $count = $this->assignment_repository->countAllForNodeIsContained(
1175 fn ($ass) => $ass->getUserId(),
1191 return $this->auto_categories_repository->getFor($this->
getId());
1206 $ac = $this->auto_categories_repository->create(
1210 $this->auto_categories_repository->update($ac);
1219 $this->auto_categories_repository->delete($this->
getId(), $category_ids);
1227 $this->auto_categories_repository->deleteFor($this->
getId());
1235 foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1238 $course_ref->setTargetRefId($crs_ref_id);
1239 $course_ref->create();
1240 $course_ref->createReference();
1241 $course_ref->putInTree($prg->getRefId());
1242 $course_ref->setPermissions($crs_ref_id);
1244 $course_ref->update();
1247 $lp->setMode($lp::LP_MODE_COURSE_REFERENCE);
1259 foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1260 foreach ($prg->getLPChildren() as $child) {
1261 if ((
int) $child->getTargetRefId() === $crs_ref_id) {
1278 static function (array $rec) {
1279 $values = array_values($rec);
1280 $prg_obj_id = (
int) array_shift($values);
1283 $prg_ref_id = (
int) array_shift($references);
1285 $prg = self::getInstanceByRefId($prg_ref_id);
1286 if ($prg->isAutoContentApplicable()) {
1290 $db::getProgrammesFor($cat_ref_id)
1304 $valid_status = in_array(
1318 return $valid_status && $crslnk_allowed;
1332 return $this->auto_memberships_repository->getFor($this->
getId());
1340 $ams = $this->auto_memberships_repository->create($this->
getId(), $type, $src_id,
false);
1341 $this->auto_memberships_repository->update($ams);
1349 $this->auto_memberships_repository->delete($this->
getId(), $type, $src_id);
1357 $this->auto_memberships_repository->deleteFor($this->
getId());
1365 $ams = $this->auto_memberships_repository->create($this->
getId(), $type, $src_id,
false);
1366 $this->auto_memberships_repository->update($ams);
1378 foreach ($member_ids as $usr_id) {
1384 $ams = $this->auto_memberships_repository->create($this->
getId(), $type, $src_id,
true);
1385 $this->auto_memberships_repository->update($ams);
1395 $source_reader = $this->membersourcereader_factory->getReaderFor($src_type, $src_id);
1396 return $source_reader->getMemberIds();
1407 $programmes = array_map(
1408 static function ($rec) {
1409 $values = array_values($rec);
1410 $prg_obj_id = (
int) array_shift($values);
1413 $prg_ref_id = (
int) array_shift($references);
1415 $prg = self::getInstanceByRefId($prg_ref_id);
1418 $db::getProgrammesFor($src_type, $src_id)
1425 foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1426 if ($prg->isActive() &&
1427 !$prg->hasAssignmentsOfSingleProgramForUser($usr_id)) {
1429 $prg->assignUser($usr_id, $assigned_by);
1438 foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1439 $assignments = $prg->getAssignmentsOfSingleProgramForUser($usr_id);
1440 $next_membership_source = $prg->getApplicableMembershipSourceForUser($usr_id, $src_id);
1442 foreach ($assignments as $assignment) {
1443 if (!$assignment->getProgressTree()->isInProgress()) {
1447 if (!is_null($next_membership_source) && $next_membership_source->isEnabled()) {
1448 $new_src_type = $next_membership_source->getSourceType();
1450 $assignment = $assignment->withLastChange($assigned_by, $now);
1451 $assignment_repository->
store($assignment);
1454 $assignment_repository->
delete($assignment);
1466 if ($src_id !== $exclude_id
1467 && $ams->isEnabled()
1470 if (in_array($usr_id, $source_members)) {
1511 $tree = $DIC[
'tree'];
1513 if (count($node_data) === 0 || !array_key_exists(
'type', $node_data) || $node_data[
"type"] !==
"prg") {
1516 self::initStudyProgrammeCache();
1517 $prg = self::getInstanceByRefId($node_data[
"child"]);
1521 $prg->succeed($user_id, $obj_id);
1526 $progress_node_id = $this->
getId();
1527 if (is_null($ass)) {
1528 $user_assignments = $this->assignment_repository
1529 ->getAllForNodeIsContained($progress_node_id, [$usr_id]);
1531 $user_assignments = [$ass];
1534 foreach ($user_assignments as $ass) {
1535 $ass = $ass->succeed(
1540 $this->assignment_repository->store($ass);
1551 $tree = $DIC[
'tree'];
1557 return $nd[
"obj_id"];
1563 $customIcon = $this->custom_icon_factory->getByObjId($this->
getId(), $this->
getType());
1567 && $this->webdir->has($subtype->getIconPath(
true))
1568 && $subtype->getIconPath(
true) !== $subtype->getIconPath(
false)
1570 $icon = $subtype->getIconPath(
true);
1571 $customIcon->saveFromSourceFile($icon);
1573 $customIcon->remove();
1598 throw new ilException(
"Ref-Id '$ref_id' does not belong to a study programme object.");
1607 $possible_subobjects = $subobjects;
1610 $possible_subobjects = [
1611 "prg" => $subobjects[
"prg"],
1612 "prgr" => $subobjects[
"prgr"]
1616 $possible_subobjects = [
'crsr' => $subobjects[
'crsr']];
1619 throw new ilException(
"Undefined mode for study programme: '$mode'");
1622 if (
$parent->hasAutomaticContentCategories()) {
1623 $possible_subobjects = array_filter(
1624 $possible_subobjects,
1625 static function ($subtype) {
1626 return $subtype ===
'crsr';
1628 ARRAY_FILTER_USE_KEY
1631 return $possible_subobjects;
1637 return $this->ilUser->getId();
1649 $prgs = $this->tree->getChildsByType($node_ref_id,
"prg");
1650 $prg_ids = array_map(
1651 static function (
$nd) {
1652 return (
int)
$nd[
'obj_id'];
1658 $prg_refs = $this->tree->getChildsByType($node_ref_id,
"prgr");
1659 foreach ($prg_refs as $ref) {
1661 $prg_ref_ids[] = $ref_obj->getReferencedObject()->getId();
1664 return array_merge($prg_ids, $prg_ref_ids);
1669 if (is_null($node_obj_id)) {
1670 $node_obj_id = $this->
getId();
1680 $progress_node_id = $this->
getId();
1681 $assignment = $this->assignment_repository->get($assignment_id)
1690 $this->assignment_repository->store($assignment);
1698 $progress_node_id = $this->
getId();
1699 $assignment = $this->assignment_repository->get($assignment_id)
1707 $this->assignment_repository->store($assignment);
1716 $progress_node_id = $this->
getId();
1717 $assignment = $this->assignment_repository->get($assignment_id)
1725 $this->assignment_repository->store($assignment);
1734 $progress_node_id = $this->
getId();
1735 $assignment = $this->assignment_repository->get($assignment_id)
1743 $this->assignment_repository->store($assignment);
1754 $progress_node_id = $this->
getId();
1755 $assignment = $this->assignment_repository->get($assignment_id)
1756 ->changeProgressDeadline(
1764 $this->assignment_repository->store($assignment);
1774 $progress_node_id = $this->
getId();
1775 $assignment = $this->assignment_repository->get($assignment_id)
1776 ->changeProgressValidityDate(
1784 $this->assignment_repository->store($assignment);
1794 $progress_node_id = $this->
getId();
1795 $assignment = $this->assignment_repository->get($assignment_id)
1796 ->changeAmountOfPoints(
1804 $this->assignment_repository->store($assignment);
1813 $assignment = $this->assignment_repository->get($assignment_id)
1814 ->updatePlanFromRepository(
1820 $this->assignment_repository->store($assignment);
1830 $assignment = $this->assignment_repository->get($assignment_id);
1831 foreach($nodes as $nodeinfo) {
1832 [$node_obj_id, $course_obj_id] = $nodeinfo;
1834 $assignment = $assignment->succeed(
1835 $this->settings_repository,
1841 '%s, progress-id (%s/%s)',
1842 $assignment->getUserInformation()->getFullname(),
1843 $assignment->getId(),
1844 (string) $node_obj_id
1846 $err_collection->add(
true,
'acknowledged_course', $msg);
1848 $this->assignment_repository->store($assignment);
1869 return $lng->
txt(
"prg_status_in_progress");
1872 return $lng->
txt(
"prg_status_completed");
1875 return $lng->
txt(
"prg_status_accredited");
1878 return $lng->
txt(
"prg_status_not_relevant");
1881 return $lng->
txt(
"prg_status_failed");
1883 throw new ilException(
"Unknown status: '$status'");
1890 '%s, progress-id (%s/%s)',
1892 $assignment->
getId(),
getCompletedCourses(int $usr_id)
Get courses in this program that the given user already completed.
setStatus(int $a_status)
Set the status of the node.
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
adjustLPMode()
Adjust the lp mode to match current state of tree:
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addNode(ilObjStudyProgramme $a_prg)
Inserts another ilObjStudyProgramme in this object.
clearLPChildrenCache()
Clear the cached lp children.
static addCrsToProgrammes(int $crs_ref_id, int $cat_ref_id)
Check, if a category is under surveilllance and automatically add the course.
getSubType()
Gets the SubType Object.
static _lookupTitle(int $obj_id)
markRelevant(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
storeAutomaticContentCategory(int $category_ref_id)
Store a Category with auto-content for this StudyProgramme; a category can only be referenced once (p...
static getLogger(string $a_component_id)
Get component logger.
getParent()
Get the parent ilObjStudyProgramme of this object.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getApplicableMembershipSourceForUser(int $usr_id, ?int $exclude_id)
changeProgressValidityDate(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection, ?DateTimeImmutable $validity)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isAutoContentApplicable()
AutoContent should only be available in active- or draft-mode, and only, if there is no sub-programme...
assignUser(int $usr_id, int $acting_usr_id=null, $raise_event=true)
Assign a user to this node at the study program.
getMembers()
get usr_ids with any progress on this node
unmarkAccredited(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
getAssignmentRepository()
ilStudyProgrammeMembershipSourceReaderFactory $membersourcereader_factory
static _lookupFullname(int $a_user_id)
getChildren(bool $include_references=false)
Get all ilObjStudyProgrammes that are direct children of this object.
static getProgrammesMonitoringMemberSource(string $src_type, int $src_id)
Get all StudyProgrammes monitoring this membership-source.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getLPChildren()
Get the leafs the study programme contains.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID
nodeInserted($prg)
Clears child cache and adds progress for new node.
isInTree(?int $a_node_id)
get all information of a node.
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
__construct(int $id=0, bool $call_by_reference=true)
ATTENTION: After using the constructor the object won't be in the cache.
static saveObjRecSelection(int $a_obj_id, string $a_sub_type="", array $a_records=null, bool $a_delete_before=true)
Save repository object record selection.
static getInstanceByRefId($ref_id)
disableAutomaticMembershipSource(string $type, int $src_id)
Disable a membership source.
applyToSubTreeNodes(Closure $fun, bool $include_references=false)
Apply the given Closure to every node in the subtree starting at this object.
static getCreatableSubObjects(array $subobjects, $ref_id)
Filter the list of possible subobjects for the objects that actually could be created on a concrete n...
static initStudyProgrammeCache()
loadLanguageModule(string $a_module)
Load language module.
deleteAssignmentsAndProgresses()
Delete all assignments from the DB.
markNotRelevant(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
delete(ilPRGAssignment $assignment)
storeAutomaticMembershipSource(string $type, int $src_id)
Store a source to be monitored for automatic memberships.
hasAssignmentOf(int $user_id)
Check whether user is assigned to this program or any node above.
array $reference_children
storeRiskyToFailSentFor(ilPRGAssignment $ass)
storeExpiryInfoSentFor(ilPRGAssignment $ass)
getLocalMembers()
get usr_ids with assignment on this node
getAssignmentsOf(int $user_id)
Get the assignments of user at this program or any node above.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getParentId(ilObjCourseReference $leaf)
Get the obj id of the parent object for the given object.
changeProgressDeadline(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection, ?DateTimeImmutable $deadline)
getAmountOfLPChildren()
Get the amount of leafs the study programme contains.
enableAutomaticMembershipSource(string $type, int $src_id, bool $assign_now=false)
Enable a membership source.
getRoot()
Get the ilObjStudyProgramme that is the root node of the tree this programme is in.
static getProgrammesMonitoringCategory(int $cat_ref_id)
Get all (not OUTDATED) StudyProgrammes monitoring this category.
static removeCrsFromProgrammes(int $crs_ref_id, int $cat_ref_id)
Check, if a category is under surveillance and automatically remove the deleted course.
resetRiskyToFailSentFor(ilPRGAssignment $ass)
createReference()
creates reference for object
removeNode(ilObjStudyProgramme $a_prg)
Remove a node from this object.
hasAssignments()
Are there any assignments on this node or any node above?
A Progress is the status of a user on a single node of an assignment; it is unique by assignment_id:u...
getObjIdsOfChildren(int $node_obj_id)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
clearChildrenCache()
Clear the cached children.
getAutomaticContentCategories()
Get configuration of categories with auto-content for this StudyProgramme;.
getParentNodeData(int $a_node_id)
get data of parent node from tree and object_data
resetExpiryInfoSentFor(ilPRGAssignment $ass)
deleteAllAutomaticContentCategories()
Delete all configuration of categories with auto-content for this StudyProgramme;.
ilStudyProgrammeAutoMembershipsDBRepository $auto_memberships_repository
hasRelevantProgresses()
Are there any users that have a relevant progress on this programme?
removeAssignment(ilPRGAssignment $assignment)
Remove an assignment from this program.
static addMemberToProgrammes(string $src_type, int $src_id, int $usr_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
store(ilPRGAssignment $assignment)
getParents(bool $include_references=false)
Get all parents of the node, where the root of the program comes first.
getAssignmentsOfSingleProgramForUser(int $usr_id)
Get assignments of user to this program-node only.
static ilObjStudyProgrammeCache $study_programme_cache
getSpecificAssignment(int $assignment_id)
acknowledgeCourses(int $assignment_id, array $nodes, ilPRGMessageCollection $err_collection=null)
getProgresses(array &$ret=[], ilPRGProgress $pgs=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjectId(int $ref_id)
statusToRepr(int $status)
Get a user readable representation of a status.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasAssignmentsOfSingleProgramForUser(int $usr_id)
Get assignments of user to this program-node only.
markAccredited(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
changeAmountOfPoints(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection, int $points)
moveTo(ilObjStudyProgramme $new_parent)
Move this tree node to a new parent.
succeed(int $usr_id, int $triggering_obj_id, ilPRGAssignment $ass=null)
getProgressIdString(ilPRGAssignment $assignment, ilPRGProgress $progress)
const STATUS_NOT_RELEVANT
static removeMemberFromProgrammes(string $src_type, int $src_id, int $usr_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getIdsOfUsersWithRelevantProgress()
static _lookupSourceIds(int $a_target_id)
Get ids of all container references that target the object with the given id.
getMembersOfMembershipSource(string $src_type, int $src_id)
Get member-ids of a certain source.
canBeCompleted(ilPRGProgress $progress)
setPoints(int $points)
Set the amount of points.
updatePlanFromRepository(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection=null)
static getInstanceByObjId(int $obj_id)
getLastChange()
Get the timestamp of the last change on this program or sub program.
ilStudyProgrammeEvents $events
getObjId()
Get the id of the study program.
hasAutomaticContentCategories()
static setProgressesCompletedIfParentIsProgrammeInLPCompletedMode(int $ref_id, int $obj_id, int $user_id)
Succeed all StudyProgramme(Nodes) where the object with the given id (a CRSR) is in a Programme with ...
ilPRGAssignmentDBRepository $assignment_repository
addMissingProgresses()
Add missing progress records for all assignments of this programm.
getReferencesTo(ilObjStudyProgramme $prg)
Class ilStudyProgrammeType.
static getAllChildren(int $a_ref_id, bool $include_references=false)
Get a list of all ilObjStudyProgrammes in the subtree starting at $a_ref_id.
canBeRemoved()
Check weather a node can be removed.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAutomaticMembershipSources()
Get sources for auto-memberships.
getDepth()
Get the depth of this StudyProgramme in the tree starting at the topmost StudyProgramme (not root nod...
hasChildren(bool $include_references=false)
Does this StudyProgramme have other ilObjStudyProgrammes as children?
__construct(Container $dic, ilPlugin $plugin)
ilStudyProgrammeAutoCategoryDBRepository $auto_categories_repository
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
putInTree(int $parent_ref_id)
Overwritten from ilObject.
ilObjectFactoryWrapper $object_factory
static _getInstance(int $a_obj_id)
static _lookupTargetRefId(int $a_obj_id)
getLPChildrenIds()
Get the obj-ids of the leafs the program contains.
static _lookupTargetId(int $a_obj_id)
getPossiblePointsOfRelevantChildren()
static createInstance()
Create an instance of ilObjStudyProgramme, put in cache.
static getRefIdFor(int $obj_id)
deleteAutomaticContentCategories(array $category_ids=[])
Delete configuration of categories with auto-content for this StudyProgramme;.
getPoints()
Get the amount of points.
ilStudyProgrammeSettingsDBRepository $settings_repository
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAmountOfChildren($include_references=false)
Get the amount of other StudyProgrammes this StudyProgramme has as children.
refreshLPStatus(int $usr_id, int $node_obj_id=null)
getMessageCollection(string $topic)
getAmountOfAssignmentsOf(int $user_id)
Get the amount of assignments a user has on this program node or any node above.
ilObjectCustomIconFactory $custom_icon_factory
static _lookupDeletedDate(int $ref_id)
Class FlySystemFileAccessTest disabled disabled disabled.
deleteAllAutomaticMembershipSources()
Delete all membership sources of this StudyProgramme;.
updateLastChange()
Update last change timestamp on this node and its parents.
clearParentCache()
Clear the cached parent to query it again at the tree.
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
deleteAutomaticMembershipSource(string $type, int $src_id)
Delete a membership source.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilStudyProgrammeTypeDBRepository $type_repository
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateSettings(ilStudyProgrammeSettings $settings)
getPrgInstanceByObjId(int $obj_id)