19declare(strict_types=1);
80 $this->type_repository =
$dic[
'model.Type.ilStudyProgrammeTypeRepository'];
81 $this->auto_categories_repository =
$dic[
'model.AutoCategories.ilStudyProgrammeAutoCategoriesRepository'];
82 $this->auto_memberships_repository =
$dic[
'model.AutoMemberships.ilStudyProgrammeAutoMembershipsRepository'];
83 $this->membersourcereader_factory =
$dic[
'model.AutoMemberships.ilStudyProgrammeMembershipSourceReaderFactory'];
85 $this->settings_repository =
$dic[
'model.Settings.ilStudyProgrammeSettingsRepository'];
86 $this->assignment_repository =
$dic[
'repo.assignment'];
87 $this->events =
$dic[
'ilStudyProgrammeEvents'];
98 $this->webdir =
$DIC->filesystem()->web();
101 $this->db =
$DIC[
'ilDB'];
102 $this->
lng = $DIC[
'lng'];
107 $this->custom_icon_factory =
$DIC[
'object.customicons.factory'];
114 if (self::$study_programme_cache ===
null) {
125 $this->parent =
false;
133 $this->children =
null;
141 $this->lp_children =
null;
147 if (count($refs) < 1) {
148 throw new ilException(
"Could not find ref_id for programme with obj_id $obj_id");
150 return (
int) array_shift($refs);
165 if (self::$study_programme_cache ===
null) {
168 return self::$study_programme_cache->getInstanceByRefId((
int)
$ref_id);
197 $obj->createReference();
198 self::$study_programme_cache->addInstance($obj);
213 if ($settings->
getObjId() !== $this->getId()) {
214 throw new Exception(
"The given settings-object does not belong to this programme", 1);
233 $this->assignment_repository->deleteAllAssignmentsForProgrammeId($this->
getId());
241 $id = (
int) parent::create();
253 $type_settings = $this->
getSettings()->getTypeSettings();
255 if ($type_settings->getTypeId()) {
259 $this->type_repository->getAssignedAMDRecordIdsByType($type_settings->getTypeId())
273 public function delete():
bool
276 if (!parent::delete()) {
283 $this->auto_categories_repository->deleteFor($this->
getId());
291 $this->events->raise(
'delete', [
'object' => $this,
'obj_id' => $this->
getId()]);
297 $sub_type_id = $this->
getSettings()->getTypeSettings()->getTypeId();
300 $type = $this->type_repository->getType($sub_type_id);
303 return !is_null(
$type) && count($this->type_repository->getAssignedAMDRecordIdsByType(
$type->getId(),
true)) > 0;
308 $new_obj = parent::cloneObject($target_ref_id, $copy_id, $omit_tree);
309 $settings = $this->
getSettings()->withObjId($new_obj->getId());
310 $settings = $settings->withAssessmentSettings(
313 $new_obj->updateSettings($settings);
334 return $this->
getSettings()->getAssessmentSettings()->getPoints();
346 $settings->withAssessmentSettings($settings->getAssessmentSettings()->withPoints($points))
373 if ($this->tree->isInTree($this->getRefId())) {
375 $this->settings_repository->update(
379 $this->settings_repository->update(
383 $this->settings_repository->update(
392 return $this->
getSettings()->getAssessmentSettings()->getStatus();
404 $settings->withAssessmentSettings($settings->getAssessmentSettings()->withStatus($a_status))
420 $type_settings = $this->
getSettings()->getTypeSettings();
421 if (!in_array($type_settings->getTypeId(), array(
"-",
"0"))) {
422 $subtype_id = $type_settings->getTypeId();
423 return $this->type_repository->getType($subtype_id);
431 $global_settings =
new ilSetting(
'certificate');
432 $global_active = (bool) $global_settings->get(
'active',
'0');
433 if (!$global_active) {
438 return $certificate_template->isCurrentlyActive();
454 public static function getAllChildren(
int $a_ref_id,
bool $include_references =
false): array
458 $root_id = $root->getId();
461 if ($prg->
getId() === $root_id) {
465 }, $include_references);
474 if ($prg->
getId() === $this->getId()) {
490 public function getChildren(
bool $include_references =
false): array
494 if ($this->children ===
null) {
495 $ref_ids = $this->tree->getChildsByType($this->
getRefId(),
"prg");
499 $ref_ids = $sorting->sortItems(array(
'prg' => $ref_ids));
500 $ref_ids = $ref_ids[
'prg'];
502 $this->children = array_map(
static function ($node_data) {
507 if ($include_references && $this->reference_children ===
null) {
508 $this->reference_children = [];
509 $ref_child_ref_ids = $this->tree->getChildsByType($this->
getRefId(),
"prgr");
513 static function (
$data) {
514 return (
int)
$data[
'child'];
516 array_filter($ref_child_ref_ids,
static function (
$data) {
517 return $data[
"deleted"] ===
null;
522 $this->reference_children[] =
526 return $include_references ?
527 array_merge($this->children, $this->reference_children) :
539 if ($this->parent ===
false) {
541 $parent_data = $this->tree->getParentNodeData($this->
getRefId());
542 if ($parent_data[
"type"] !==
"prg") {
543 $this->parent =
null;
556 static function (
$id) {
564 static function ($prg_ref) use (
$tree) {
580 public function getParents(
bool $include_references =
false): array
584 $queque = [$current];
585 while ($element = array_shift($queque)) {
586 $parent = $element->getParent();
587 if (
$parent ===
null || $include_references) {
589 if ($this->tree->isDeleted($reference->getRefId())) {
592 $r_parent = $reference->getParent();
593 if (is_null($r_parent)) {
596 $queque[] = $r_parent;
597 $parents[] = $r_parent;
604 return array_reverse($parents);
612 public function hasChildren(
bool $include_references =
false): bool
625 return count($this->
getChildren($include_references));
638 while ($cur = $cur->getParent()) {
651 if (count($parents) < 1) {
667 if ($this->lp_children ===
null) {
668 $this->lp_children = array();
670 $ref_ids = $this->tree->getChildsByType($this->
getRefId(),
"crsr");
674 $ref_ids = $sorting->sortItems(array(
'crs_ref' => $ref_ids));
675 $ref_ids = $ref_ids[
'crs_ref'];
678 $lp_obj = $this->object_factory->getInstanceByRefId((
int) $node_data[
"child"]);
681 return ($lp_obj instanceof $this) ?
null : $lp_obj;
697 return array_map(
static function ($child) {
698 return $child->getId();
721 if (!$this->tree->isInTree($this->getRefId())) {
741 if ($fun($this) !==
false) {
742 foreach ($this->
getChildren($include_references) as $child) {
743 $child->applyToSubTreeNodes($fun, $include_references);
753 $completed_crss = [];
754 $f =
function ($prg) use (&$completed_crss, $assignment) {
755 if ($prg->isActive() &&
758 foreach ($prg->getLPChildren() as $child) {
761 $crsr_ref_id = (
int) $child->getRefId();
769 $completed_crss[] = [
771 'prg_ref_id' => $prg->getRefId(),
772 'prg_obj_id' => $prg->getId(),
773 'crsr_ref_id' => $crsr_ref_id,
774 'crsr_id' => $child->getId(),
775 'crs_ref_id' => $crs_ref_id,
785 return $completed_crss;
810 if ($this->tree->isInTree($a_prg->
getRefId())) {
841 $this->settings_repository->update(
859 parent::putInTree($parent_ref_id);
863 $par->nodeInserted($this);
878 if ($a_prg->
getParent()->getId() !== $this->getId()) {
887 $node_data = $this->tree->getNodeData($a_prg->
getRefId());
888 $this->tree->deleteTree($node_data);
916 $rbacadmin =
$DIC[
'rbacadmin'];
923 $rbacadmin->adjustMovedObjectPermissions($this->
getRefId(),
$parent->getRefId());
931 $parent->clearLPChildrenCache();
956 $this->members_cache =
null;
960 "ilObjStudyProgramme::assignUser: Can't assign user to program '"
961 . $this->
getId() .
"', since it's not in active status."
965 if (is_null($acting_usr_id)) {
969 $ass = $this->assignment_repository->createFor($this->
getId(), $usr_id, $acting_usr_id);
971 ->initAssignmentDates();
973 $ass = $ass->resetProgresses(
978 $this->assignment_repository->store($ass);
981 $this->events->userAssigned($ass);
995 $this->members_cache =
null;
996 if ($assignment->
getRootId() !== $this->getId()) {
998 "ilObjStudyProgramme::removeAssignment: Assignment '"
999 . $assignment->
getId() .
"' does not belong to study "
1000 .
"program '" . $this->getId() .
"'."
1004 $this->assignment_repository->delete($assignment);
1006 $affected_node_ids = array_map(fn($pgs) => $pgs->getNodeId(), $assignment->
getProgresses());
1007 foreach ($affected_node_ids as $node_obj_id) {
1011 $this->events->userDeassigned($assignment);
1017 return $this->assignment_repository->get($assignment_id);
1022 $this->assignment_repository->storeExpiryInfoSentFor($ass);
1027 $this->assignment_repository->resetExpiryInfoSentFor($ass);
1032 $this->assignment_repository->storeRiskyToFailSentFor($ass);
1037 $this->assignment_repository->resetRiskyToFailSentFor($ass);
1066 $assignments = $this->assignment_repository->getAllForNodeIsContained(
1074 if ($left ===
null || $right ===
null) {
1075 return (
int) ($left !==
null) <=> (
int) ($right !==
null);
1078 return $left->getTimestamp() <=> $right->getTimestamp();
1080 return $assignments;
1088 return $this->assignment_repository->getAllForNodeIsContained($this->
getId());
1099 $usr_ids[] = $assignment->getUserId();
1101 return array_unique($usr_ids);
1109 if (!$this->members_cache) {
1110 $this->members_cache = array_map(
1111 static function ($assignment) {
1112 return $assignment->getUserId();
1114 $this->assignment_repository->getByPrgId($this->
getId())
1126 $count = $this->assignment_repository->countAllForNodeIsContained(
1142 return $this->assignment_repository->getAllForSpecificNode($this->
getId(), [$usr_id]);
1155 return $this->assignment_repository->getCertificateRelevantAssignmentIds(
1174 foreach ($assignments as $ass) {
1175 $this->assignment_repository->store($ass);
1185 $filter = $filter->withValues([
1186 'prg_status_hide_irrelevant' =>
true
1188 $count = $this->assignment_repository->countAllForNodeIsContained(
1199 fn($ass) => $ass->getUserId(),
1200 $this->getAssignments()
1215 return $this->auto_categories_repository->getFor($this->
getId());
1230 $ac = $this->auto_categories_repository->create(
1234 $this->auto_categories_repository->update($ac);
1243 $this->auto_categories_repository->delete($this->
getId(), $category_ids);
1251 $this->auto_categories_repository->deleteFor($this->
getId());
1259 foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1262 $course_ref->setTargetRefId($crs_ref_id);
1263 $course_ref->create();
1264 $course_ref->createReference();
1265 $course_ref->putInTree($prg->getRefId());
1266 $course_ref->setPermissions($crs_ref_id);
1268 $course_ref->update();
1271 $lp->setMode($lp::LP_MODE_COURSE_REFERENCE);
1283 foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1284 foreach ($prg->getLPChildren() as $child) {
1285 if ((
int) $child->getTargetRefId() === $crs_ref_id) {
1302 static function (array $rec) {
1303 $values = array_values($rec);
1304 $prg_obj_id = (
int) array_shift($values);
1307 $prg_ref_id = (
int) array_shift($references);
1310 if ($prg->isAutoContentApplicable()) {
1314 $db::getProgrammesFor($cat_ref_id)
1328 $valid_status = in_array(
1342 return $valid_status && $crslnk_allowed;
1356 return $this->auto_memberships_repository->getFor($this->
getId());
1364 $ams = $this->auto_memberships_repository->create(
1373 $this->auto_memberships_repository->update($ams);
1381 $this->auto_memberships_repository->delete($this->
getId(), $type, $src_id);
1389 $this->auto_memberships_repository->deleteFor($this->
getId());
1397 $ams = $this->auto_memberships_repository->create(
1406 $this->auto_memberships_repository->update($ams);
1418 foreach ($member_ids as $usr_id) {
1424 $ams = $this->auto_memberships_repository->create(
1433 $this->auto_memberships_repository->update($ams);
1443 $source_reader = $this->membersourcereader_factory->getReaderFor($ams, $exclude_id);
1444 return $source_reader->getMemberIds();
1454 $programmes = array_map(
1455 static function ($rec) {
1456 $values = array_values($rec);
1457 $prg_obj_id = (
int) array_shift($values);
1460 $prg_ref_id = (
int) array_shift($references);
1465 $db::getProgrammesFor($src_type, $src_id)
1472 foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1473 if ($prg->isActive() &&
1474 !$prg->hasAssignmentsOfSingleProgramForUser($usr_id)) {
1476 $prg->assignUser($usr_id, $assigned_by);
1483 $now =
new DateTimeImmutable();
1485 foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1486 $assignments = $prg->getAssignmentsOfSingleProgramForUser($usr_id);
1487 $next_membership_source = $prg->getApplicableMembershipSourceForUser($usr_id, $src_id);
1489 foreach ($assignments as $assignment) {
1490 if (!$assignment->getProgressTree()->isInProgress()) {
1495 $next_membership_source !==
null
1496 && $next_membership_source?->isEnabled()
1497 && $next_membership_source->getSourceId() !== $src_id
1499 $new_src_type = $next_membership_source->getSourceType();
1501 $assignment = $assignment->withLastChange($assigned_by, $now);
1516 if ($ams->isEnabled()) {
1518 if (in_array($usr_id, $source_members)) {
1535 $this->getSettings()->updateLastChange();
1536 if ($parent = $this->getParent()) {
1537 $parent->updateLastChange();
1557 if ($type ===
"crsr") {
1559 self::setProgressesCompletedIfParentIsProgrammeInLPCompletedMode(
$ref_id, $obj_id,
$user_id);
1573 $tree =
$DIC[
'tree'];
1574 $node_data = $tree->getParentNodeData(
$ref_id);
1575 if (count($node_data) === 0 || !array_key_exists(
'type', $node_data) || $node_data[
"type"] !==
"prg") {
1578 self::initStudyProgrammeCache();
1579 $prg = self::getInstanceByRefId($node_data[
"child"]);
1588 $progress_node_id = $this->
getId();
1589 if (is_null($ass)) {
1590 $user_assignments = $this->assignment_repository
1591 ->getAllForNodeIsContained($progress_node_id, [$usr_id]);
1593 $user_assignments = [$ass];
1596 foreach ($user_assignments as $ass) {
1597 $ass = $ass->succeed(
1598 $this->getSettingsRepository(),
1602 $this->assignment_repository->store($ass);
1608 $customIcon = $this->custom_icon_factory->getByObjId($this->
getId(), $this->getType());
1609 $subtype = $this->getSubType();
1611 if ($subtype && $subtype->getIconIdentifier()) {
1612 $src = $this->type_repository->getIconPathFS($subtype);
1615 $tmp =
'ico_' . $this->
getId();
1618 $customIcon->saveFromTempFileName($tmp);
1620 $customIcon->remove();
1645 throw new ilException(
"Ref-Id '$ref_id' does not belong to a study programme object.");
1648 $parent = self::getInstanceByRefId(
$ref_id);
1650 $mode = $parent->getLPMode();
1654 $possible_subobjects = $subobjects;
1657 $possible_subobjects = [
1658 "prg" => $subobjects[
"prg"],
1659 "prgr" => $subobjects[
"prgr"]
1663 $possible_subobjects = [
'crsr' => $subobjects[
'crsr']];
1666 throw new ilException(
"Undefined mode for study programme: '$mode'");
1669 if ($parent->hasAutomaticContentCategories()) {
1670 $possible_subobjects = array_filter(
1671 $possible_subobjects,
1672 static function ($subtype) {
1673 return $subtype ===
'crsr';
1675 ARRAY_FILTER_USE_KEY
1678 return $possible_subobjects;
1684 return $this->ilUser->getId();
1687 protected function getNow(): DateTimeImmutable
1689 return new DateTimeImmutable();
1694 if (is_null($node_obj_id)) {
1695 $node_obj_id = $this->
getId();
1705 $progress_node_id = $this->
getId();
1706 $assignment = $this->assignment_repository->get($assignment_id)
1708 $this->getSettingsRepository(),
1715 $this->assignment_repository->store($assignment);
1723 $progress_node_id = $this->
getId();
1724 $assignment = $this->assignment_repository->get($assignment_id)
1726 $this->getSettingsRepository(),
1732 $this->assignment_repository->store($assignment);
1733 $this->refreshLPStatus($assignment->getUserId());
1741 $progress_node_id = $this->
getId();
1742 $assignment = $this->assignment_repository->get($assignment_id)
1744 $this->getSettingsRepository(),
1750 $this->assignment_repository->store($assignment);
1751 $this->refreshLPStatus($assignment->getUserId());
1759 $progress_node_id = $this->
getId();
1760 $assignment = $this->assignment_repository->get($assignment_id)
1762 $this->getSettingsRepository(),
1768 $this->assignment_repository->store($assignment);
1769 $this->refreshLPStatus($assignment->getUserId());
1776 ?DateTimeImmutable $deadline
1778 $progress_node_id = $this->
getId();
1779 $assignment = $this->assignment_repository->get($assignment_id)
1780 ->changeProgressDeadline(
1781 $this->getSettingsRepository(),
1788 $this->assignment_repository->store($assignment);
1789 $this->refreshLPStatus($assignment->getUserId());
1796 ?DateTimeImmutable $validity
1798 $progress_node_id = $this->
getId();
1799 $assignment = $this->assignment_repository->get($assignment_id)
1800 ->changeProgressValidityDate(
1801 $this->getSettingsRepository(),
1808 $this->assignment_repository->store($assignment);
1809 $this->refreshLPStatus($assignment->getUserId());
1818 $progress_node_id = $this->
getId();
1819 $assignment = $this->assignment_repository->get($assignment_id)
1820 ->changeAmountOfPoints(
1821 $this->getSettingsRepository(),
1828 $this->assignment_repository->store($assignment);
1829 $this->refreshLPStatus($assignment->getUserId());
1837 $assignment = $this->assignment_repository->
get($assignment_id)
1839 $this->getSettingsRepository(),
1844 $this->assignment_repository->store($assignment);
1845 $this->refreshLPStatus($assignment->getUserId());
1853 $acting_usr_id = $this->getLoggedInUserId();
1854 $assignment = $this->assignment_repository->get($assignment_id);
1855 foreach ($nodes as $nodeinfo) {
1856 [$node_obj_id, $course_obj_id] = $nodeinfo;
1858 $assignment = $assignment->succeed(
1859 $this->settings_repository,
1865 '%s, progress-id (%s/%s)',
1866 $assignment->getUserInformation()->getFullname(),
1867 $assignment->getId(),
1868 (
string) $node_obj_id
1870 $err_collection->
add(
true,
'acknowledged_course', $msg);
1872 $this->assignment_repository->store($assignment);
1873 $this->refreshLPStatus($assignment->getUserId());
1894 $lng->loadLanguageModule(
"prg");
1896 return $lng->txt(
"prg_status_in_progress");
1899 return $lng->txt(
"prg_status_completed");
1902 return $lng->txt(
"prg_status_accredited");
1905 return $lng->txt(
"prg_status_not_relevant");
1908 return $lng->txt(
"prg_status_failed");
1910 throw new ilException(
"Unknown status: '$status'");
1915 return \ilContainerPage::_exists(self::CP_TYPE, $this->
getId());
1919 if ($this->hasContentPage()) {
1920 throw new \LogicException(
'will not create content page - it already exists.');
1922 $new_page_object = new \ilContainerPage();
1923 $new_page_object->setId($this->
getId());
1924 $new_page_object->setParentId($this->
getId());
1925 $new_page_object->createFromXML();
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
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 _lookupTitle(int $obj_id)
static _lookupSourceIds(int $a_target_id)
Get ids of all container references that target the object with the given id.
static _lookupTargetId(int $a_obj_id)
static _lookupTargetRefId(int $a_obj_id)
static _getInstance(int $a_obj_id)
Base class for ILIAS Exception handling.
static getDataDir()
get data directory (outside webspace)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Cache for ilObjStudyProgrammes.
enableAutomaticMembershipSource(string $type, int $src_id, bool $search_recursive, $assign_now=false)
Enable a membership source.
array $reference_children
getLPChildren()
Get the leafs the study programme contains.
getCertificateRelevantAssignmentIds(int ... $usr_ids)
hasAssignmentOf(int $user_id)
Check whether user is assigned to this program or any node above.
getAssignmentsOf(int $user_id)
Get the assignments of user at this program or any node above.
getRoot()
Get the ilObjStudyProgramme that is the root node of the tree this programme is in.
static setProgressesCompletedIfParentIsProgrammeInLPCompletedMode(int $ref_id, int $obj_id, int $user_id)
getAmountOfChildren($include_references=false)
Get the amount of other StudyProgrammes this StudyProgramme has as children.
getMembers()
get usr_ids with any progress on this node
canBeCompleted(ilPRGProgress $progress)
__construct(int $id=0, bool $call_by_reference=true)
ATTENTION: After using the constructor the object won't be in the cache.
static removeCrsFromProgrammes(int $crs_ref_id, int $cat_ref_id)
Check, if a category is under surveillance and automatically remove the deleted course.
hasAssignmentsOfSingleProgramForUser(int $usr_id)
Get assignments of user to this program-node only.
deleteAutomaticContentCategories(array $category_ids=[])
Delete configuration of categories with auto-content for this StudyProgramme;.
ilStudyProgrammeSettingsDBRepository $settings_repository
getSpecificAssignment(int $assignment_id)
static getCreatableSubObjects(array $subobjects, $ref_id)
Filter the list of possible subobjects for the objects that actually could be created on a concrete n...
getMembersOfMembershipSource(ilStudyProgrammeAutoMembershipSource $ams, ?int $exclude_id)
Get member-ids of a certain source.
updateSettings(ilStudyProgrammeSettings $settings)
static initStudyProgrammeCache()
changeProgressDeadline(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection, ?DateTimeImmutable $deadline)
refreshLPStatus(int $usr_id, ?int $node_obj_id=null)
applyToSubTreeNodes(Closure $fun, bool $include_references=false)
Apply the given Closure to every node in the subtree starting at this object.
canBeRemoved()
Check weather a node can be removed.
changeAmountOfPoints(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection, int $points)
changeProgressValidityDate(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection, ?DateTimeImmutable $validity)
isAutoContentApplicable()
AutoContent should only be available in active- or draft-mode, and only, if there is no sub-programme...
resetRiskyToFailSentFor(ilPRGAssignment $ass)
static getProgrammesMonitoringMemberSource(string $src_type, int $src_id)
Get all StudyProgrammes monitoring this membership-source.
acknowledgeCourses(int $assignment_id, array $nodes, ?ilPRGMessageCollection $err_collection=null)
setPoints(int $points)
Set the amount of points.
resetExpiryInfoSentFor(ilPRGAssignment $ass)
deleteAllAutomaticContentCategories()
Delete all configuration of categories with auto-content for this StudyProgramme;.
static getInstanceByObjId(int $obj_id)
ilPRGAssignmentDBRepository $assignment_repository
getReferencesTo(ilObjStudyProgramme $prg)
static setProgressesCompletedFor(int $obj_id, int $user_id)
Succeed all StudyProgramme(Nodes) where the object with the given id (a CRSR) is in a Programme with ...
statusToRepr(int $status)
Get a user readable representation of a status.
static getInstanceByRefId($ref_id)
markRelevant(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
nodeInserted($prg)
Clears child cache and adds progress for new node.
static getProgrammesMonitoringCategory(int $cat_ref_id)
Get all (not OUTDATED) StudyProgrammes monitoring this category.
cloneObject(int $target_ref_id, int $copy_id=0, bool $omit_tree=false)
getAssignmentRepository()
deleteAllAutomaticMembershipSources()
Delete all membership sources of this StudyProgramme;.
getPoints()
Get the amount of points.
assignUser(int $usr_id, ?int $acting_usr_id=null, $raise_event=true)
Assign a user to this node at the study program.
removeAssignment(ilPRGAssignment $assignment)
Remove an assignment from this program.
storeAutomaticContentCategory(int $category_ref_id)
Store a Category with auto-content for this StudyProgramme; a category can only be referenced once (p...
ilStudyProgrammeEvents $events
clearLPChildrenCache()
Clear the cached lp children.
moveTo(ilObjStudyProgramme $new_parent)
Move this tree node to a new parent.
getLocalMembers()
get usr_ids with assignment on this node
getCompletedCourses(ilPRGAssignment $assignment)
Get courses in this program that the given user already completed.
hasAutomaticContentCategories()
disableAutomaticMembershipSource(string $type, int $src_id, bool $search_recursive)
Disable a membership source.
clearParentCache()
Clear the cached parent to query it again at the tree.
addMissingProgresses()
Add missing progress records for all assignments of this programm.
storeRiskyToFailSentFor(ilPRGAssignment $ass)
getChildren(bool $include_references=false)
Get all ilObjStudyProgrammes that are direct children of this object.
updatePlanFromRepository(int $assignment_id, int $acting_usr_id, ?ilPRGMessageCollection $err_collection=null)
static addMemberToProgrammes(string $src_type, int $src_id, int $usr_id)
ilStudyProgrammeTypeDBRepository $type_repository
CustomIconFactory $custom_icon_factory
ilObjectFactoryWrapper $object_factory
getAutomaticContentCategories()
Get configuration of categories with auto-content for this StudyProgramme;.
getPrgInstanceByObjId(int $obj_id)
static addCrsToProgrammes(int $crs_ref_id, int $cat_ref_id)
Check, if a category is under surveilllance and automatically add the course.
getLastChange()
Get the timestamp of the last change on this program or sub program.
getApplicableMembershipSourceForUser(int $usr_id, ?int $exclude_id)
clearChildrenCache()
Clear the cached children.
storeExpiryInfoSentFor(ilPRGAssignment $ass)
putInTree(int $parent_ref_id)
Overwritten from ilObject.
getIdsOfUsersWithRelevantProgress()
hasChildren(bool $include_references=false)
Does this StudyProgramme have other ilObjStudyProgrammes as children?
ilStudyProgrammeAutoMembershipsDBRepository $auto_memberships_repository
deleteAssignmentsAndProgresses()
Delete all assignments from the DB.
setStatus(int $a_status)
Set the status of the node.
getAssignmentsOfSingleProgramForUser(int $usr_id)
Get assignments of user to this program-node only.
succeed(int $usr_id, int $triggering_obj_id, ?ilPRGAssignment $ass=null)
getAutomaticMembershipSources()
Get sources for auto-memberships.
unmarkAccredited(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
getDepth()
Get the depth of this StudyProgramme in the tree starting at the topmost StudyProgramme (not root nod...
static getAllChildren(int $a_ref_id, bool $include_references=false)
Get a list of all ilObjStudyProgrammes in the subtree starting at $a_ref_id.
static createInstance()
Create an instance of ilObjStudyProgramme, put in cache.
static ilObjStudyProgrammeCache $study_programme_cache
getSubType()
Gets the SubType Object.
getAmountOfAssignmentsOf(int $user_id)
Get the amount of assignments a user has on this program node or any node above.
ilStudyProgrammeAutoCategoryDBRepository $auto_categories_repository
removeNode(ilObjStudyProgramme $a_prg)
Remove a node from this object.
static getRefIdFor(int $obj_id)
markAccredited(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
deleteAutomaticMembershipSource(string $type, int $src_id)
Delete a membership source.
hasAssignments()
Are there any assignments on this node or any node above?
getParent()
Get the parent ilObjStudyProgramme of this object.
hasRelevantProgresses()
Are there any users that have a relevant progress on this programme?
getLPChildrenIds()
Get the obj-ids of the leafs the program contains.
updateLastChange()
Update last change timestamp on this node and its parents.
getAmountOfLPChildren()
Get the amount of leafs the study programme contains.
static removeMemberFromProgrammes(string $src_type, int $src_id, int $usr_id)
adjustLPMode()
Adjust the lp mode to match current state of tree:
storeAutomaticMembershipSource(string $type, int $src_id, bool $search_recursive)
Store a source to be monitored for automatic memberships.
addNode(ilObjStudyProgramme $a_prg)
Inserts another ilObjStudyProgramme in this object.
ilStudyProgrammeMembershipSourceReaderFactory $membersourcereader_factory
getParents(bool $include_references=false)
Get all parents of the node, where the root of the program comes first.
markNotRelevant(int $assignment_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
Class ilObjectFactoryWrapper.
Class ilObject Basic functions for all objects.
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
createReference()
creates reference for object
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupDeletedDate(int $ref_id)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...
store(ilPRGAssignment $assignment)
delete(ilPRGAssignment $assignment)
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...
getProgresses(array &$ret=[], ?ilPRGProgress $pgs=null)
getProgressForNode(int $node_id)
Holds information about multi-actions, mainly in context of member-assignemnts and status changes.
add(bool $success, string $message, string $record_identitifer)
A Progress is the status of a user on a single node of an assignment; it is unique by assignment_id:u...
getPossiblePointsOfRelevantChildren()
const STATUS_NOT_RELEVANT
Class ilStudyProgrammeAutoCategoryDBRepository.
Class ilStudyProgrammeAutoMembershipSource.
Class ilStudyProgrammeAutoMembershipsDBRepository.
Provides adapters to read member-ids from a specific source.
getObjId()
Get the id of the study program.
Exception is thrown when invariants on the program tree would be violated by manipulation of tree.
Class ilStudyProgrammeType.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
updatePlanFromRepository(ilStudyProgrammeSettingsRepository $settings_repo, int $acting_usr_id, ilPRGMessageCollection $err_collection)
ilCertificateTemplateRepository $certificate_template_repository
The filesystem interface provides the public interface for the Filesystem service API consumer.
fetchCurrentlyUsedCertificate(int $objId)
Covers the persistence of settings belonging to a study programme (SP).
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc