5declare(strict_types=1);
136 public function __construct($a_id = 0,
bool $a_call_by_reference =
true)
140 $this->settings_repository =
142 $this->type_repository =
144 $this->assignment_repository =
146 $this->progress_repository =
148 $this->auto_categories_repository =
150 $this->auto_memberships_repository =
152 $this->membersourcereader_factory =
168 $this->webdir =
$DIC->filesystem()->web();
171 $this->db =
$DIC[
'ilDB'];
172 $this->plugin_admin =
$DIC[
'ilPluginAdmin'];
173 $this->lng =
$DIC[
'lng'];
183 if (self::$study_programme_cache ===
null) {
194 $this->parent =
false;
202 $this->children =
null;
210 $this->lp_children =
null;
215 if (self::$study_programme_cache ===
null) {
218 return self::$study_programme_cache->getInstanceByRefId($a_ref_id);
230 $obj->createReference();
231 self::$study_programme_cache->addInstance($obj);
249 throw new ilException(
"ilObjStudyProgramme::loadSettings: already loaded.");
253 throw new ilException(
"ilObjStudyProgramme::loadSettings: no id.");
255 $this->
settings = $this->settings_repository->read($this->
getId());
268 throw new ilException(
"ilObjStudyProgramme::createSettings: already loaded.");
273 throw new ilException(
"ilObjStudyProgramme::loadSettings: no id.");
275 $this->
settings = $this->settings_repository->createFor($this->
getId());
287 throw new ilException(
"ilObjStudyProgramme::updateSettings: no settings loaded.");
289 $this->settings_repository->update($this->
settings);
301 throw new ilException(
"ilObjStudyProgramme::deleteSettings: no settings loaded.");
303 $this->settings_repository->delete($this->
settings);
332 $id = parent::create();
350 $this->type_repository->readAssignedAMDRecordIdsByType($this->getTypeSettings()->getTypeId())
364 public function delete() :
bool
367 if (!parent::delete()) {
374 $this->auto_categories_repository->deleteFor((
int) $this->
getId());
382 $this->events->raise(
'delete', [
'object' => $this,
'obj_id' => $this->
getId()]);
395 return $this->
settings->getLastChange();
403 return $this->
settings->getAssessmentSettings()->getPoints();
422 return $this->
settings->getLPMode();
436 $this->settings_repository->update(
441 $this->settings_repository->update(
445 $this->settings_repository->update(
482 if (!in_array($this->
getTypeSettings()->getTypeId(), array(
"-",
"0"))) {
484 return $this->type_repository->readType($subtype_id);
492 return $this->
settings->getTypeSettings();
502 return $this->
settings->getAssessmentSettings();
508 $this->
settings = $this->
settings->withAssessmentSettings($assessment_settings);
513 return $this->
settings->getDeadlineSettings();
518 $this->
settings = $this->
settings->withDeadlineSettings($deadline_settings);
523 return $this->
settings->getValidityOfQualificationSettings();
530 $validity_of_qualification_settings
537 $this->getPositionSettingsIsActiveForPrg() &&
538 !$this->getPositionSettingsIsChangeableForPrg()
544 return $this->ps->isActive();
549 return $this->ps->isChangeableForObject();
554 return $this->
settings->getAutoMailSettings();
559 $this->
settings = $this->
settings->withAutoMailSettings($automail_settings);
564 return $this->getAutoMailSettings()->getSendReAssignedMail();
569 return $this->getAutoMailSettings()->getReminderNotRestartedByUserDays() > 0;
574 return $this->getAutoMailSettings()->getProcessingEndsNotSuccessfulDays() > 0;
589 public static function getAllChildren(
int $a_ref_id,
bool $include_references =
false)
592 $root = self::getInstanceByRefId($a_ref_id);
593 $root_id = $root->getId();
596 if ($prg->
getId() == $root_id) {
600 }, $include_references);
607 $this->applyToSubTreeNodes(
609 if ($prg->
getId() == $this->getId()) {
626 public function getChildren(
bool $include_references =
false) : array
628 $this->throwIfNotInTree();
630 if ($this->children ===
null) {
631 $ref_ids = $this->tree->getChildsByType($this->getRefId(),
"prg");
635 $ref_ids = $sorting->sortItems(array(
'prg' => $ref_ids));
636 $ref_ids = $ref_ids[
'prg'];
638 $this->children = array_map(
function ($node_data) {
642 if ($include_references && $this->reference_children ===
null) {
643 $this->reference_children = [];
644 $ref_child_ref_ids = $this->tree->getChildsByType($this->getRefId(),
"prgr");
645 foreach ($this->children as $prg) {
648 $this->tree->getChildsByType($prg->getRefId(),
"prgr"),
656 return $data[
'child'];
658 array_filter($ref_child_ref_ids,
function (
$data) {
659 return $data[
"deleted"] ===
null;
664 $this->reference_children[] =
668 return $include_references ?
669 array_merge($this->children, $this->reference_children) :
682 if ($this->parent ===
false) {
683 $this->throwIfNotInTree();
684 $parent_data = $this->tree->getParentNodeData($this->getRefId());
685 if ($parent_data[
"type"] !=
"prg") {
686 $this->parent =
null;
691 return $this->parent;
708 function ($prg_ref) use ($tree) {
709 return !$tree->isDeleted($prg_ref->getRefId());
716 return $this->getReferencesTo($this);
728 $queque = [$current];
729 while ($element = array_shift($queque)) {
730 $parent = $element->getParent();
731 if ($parent ===
null || $include_references) {
732 foreach ($this->getReferencesTo($element) as $reference) {
733 if ($this->tree->isDeleted($reference->getRefId())) {
736 $r_parent = $reference->getParent();
737 if (is_null($r_parent)) {
740 array_push($queque, $r_parent);
741 $parents[] = $r_parent;
745 array_push($queque, $parent);
746 $parents[] = $parent;
748 return array_reverse($parents);
756 public function hasChildren(
bool $include_references =
false) : bool
758 return $this->getAmountOfChildren($include_references) > 0;
770 return count($this->getChildren($include_references));
784 while ($cur = $cur->getParent()) {
798 $parents = $this->getParents();
810 $this->throwIfNotInTree();
812 if ($this->lp_children ===
null) {
813 $this->lp_children = array();
816 $ref_ids = $this->tree->getChildsByType($this->getRefId(),
"crsr");
820 $ref_ids = $sorting->sortItems(array(
'crs_ref' => $ref_ids));
821 $ref_ids = $ref_ids[
'crs_ref'];
823 $lp_children = array_map(
function ($node_data) {
824 $lp_obj = $this->object_factory->getInstanceByRefId($node_data[
"child"]);
827 return ($lp_obj instanceof $this) ?
null : $lp_obj;
830 $this->lp_children = array_filter($lp_children);
832 return $this->lp_children;
843 return array_map(
function ($child) {
844 return $child->getId();
845 }, $this->getLPChildren());
855 return count($this->getLPChildren());
867 return ($this->getAmountOfLPChildren() > 0);
876 if (!$this->tree->isInTree($this->getRefId())) {
894 $this->throwIfNotInTree();
896 if ($fun($this) !==
false) {
897 foreach ($this->getChildren($include_references) as $child) {
898 $child->applyToSubTreeNodes($fun, $include_references);
910 require_once(
"Services/ContainerReference/classes/class.ilContainerReference.php");
911 require_once(
"Services/Tracking/classes/class.ilLPStatus.php");
913 $node_data = $this->tree->getNodeData($this->getRefId());
914 $crsrs = $this->tree->getSubTree($node_data,
true,
"crsr");
916 $completed_crss = array();
917 foreach ($crsrs as $ref) {
920 $completed_crss[] = array(
"crs_id" => $crs_id
921 ,
"prg_ref_id" => $ref[
"parent"]
922 ,
"crsr_ref_id" => $ref[
"child"]
923 ,
"crsr_id" => $ref[
"obj_id"]
929 return $completed_crss;
948 $this->throwIfNotInTree();
954 if ($this->tree->isInTree($a_prg->
getRefId())) {
978 $this->settings_repository->update(
983 $this->clearChildrenCache();
984 $this->addMissingProgresses();
998 $res = parent::putInTree($a_parent_ref);
1002 $par->nodeInserted($this);
1019 if ($a_prg->
getParent()->getId() !== $this->getId()) {
1028 $node_data = $this->tree->getNodeData($a_prg->
getRefId());
1029 $this->tree->deleteTree($node_data);
1031 $this->clearChildrenCache();
1042 foreach ($this->getProgresses() as $progress) {
1046 if ($progress->getLastChangeBy() !==
null) {
1064 $this->throwIfNotInTree();
1066 if ($this->hasChildren()) {
1070 if ($a_leaf->
getRefId() ===
null) {
1074 $this->clearLPChildrenCache();
1075 $this->settings_repository->update(
1093 if (self::getParentId($a_leaf) !== $this->getId()) {
1097 $node_data = $this->tree->getNodeData($a_leaf->
getRefId());
1098 $this->tree->deleteTree($node_data);
1099 $this->clearLPChildrenCache();
1116 $rbacadmin =
$DIC[
'rbacadmin'];
1118 if ($parent = $this->getParent()) {
1122 $this->tree->moveTree($this->getRefId(), $a_new_parent->
getRefId());
1124 $rbacadmin->adjustMovedObjectPermissions($this->getRefId(), $parent->getRefId());
1129 $this->clearParentCache();
1131 $parent->clearChildrenCache();
1132 $parent->clearLPChildrenCache();
1157 $this->members_cache =
null;
1160 "ilObjStudyProgramme::assignUser: Program was not properly created.'"
1166 "ilObjStudyProgramme::assignUser: Can't assign user to program '"
1167 . $this->getId() .
"', since it's not in active status."
1171 if ($a_assigning_usr_id ===
null) {
1172 $a_assigning_usr_id = $this->ilUser->getId();
1174 $ass_mod = $this->assignment_repository->createFor($this->
settings->getObjId(), $a_usr_id, $a_assigning_usr_id);
1175 $ass = $this->assignment_db->getInstanceByModel($ass_mod);
1176 $this->applyToSubTreeNodes(
1180 $this->progress_repository->update(
1181 $progress->setStatus(ilStudyProgrammeProgress::STATUS_NOT_RELEVANT)
1184 $deadline_date = null;
1185 if ($deadline_date = $node->getDeadlineSettings()->getDeadlineDate()) {
1186 $this->progress_repository->update(
1187 $progress->setDeadline($deadline_date)
1191 $deadline_date = new DateTime();
1192 $deadline_date->add(new DateInterval(
'P' . $deadline_period .
'D'));
1193 $this->progress_repository->update(
1194 $progress->setDeadline($deadline_date)
1197 if ($deadline_date) {
1198 $this->progress_db->getInstanceById($progress->getId())->recalculateFailedToDeadline();
1205 $this->events->userAssigned($ass);
1219 $this->members_cache =
null;
1222 "ilObjStudyProgramme::removeAssignment: Assignment '"
1223 . $a_assignment->
getId() .
"' does not belong to study "
1224 .
"program '" . $this->getId() .
"'."
1228 $this->events->userDeassigned($a_assignment);
1240 return $this->getAmountOfAssignmentsOf($a_user_id) > 0;
1249 return count($this->getAssignmentsOf($a_user_id));
1261 $prg_ids = $this->getIdsFromNodesOnPathFromRootToHere();
1263 foreach ($prg_ids as $prg_id) {
1264 $assignments = array_merge(
1266 $this->assignment_repository->readByUsrIdAndPrgId($a_user_id, $prg_id)
1269 usort($assignments,
function ($a_one, $a_other) {
1271 $a_one->getLastChange()->format(
'Y-m-d'),
1272 $a_other->getLastChange()->format(
'Y-m-d')
1275 $assignment_db = $this->assignment_db;
1276 return array_map(
function ($ass) use ($assignment_db) {
1277 return $assignment_db->getInstanceByModel($ass);
1278 }, array_values($assignments));
1288 $assignment_db = $this->assignment_db;
1289 return array_map(
function ($ass) use ($assignment_db) {
1290 return $assignment_db->getInstanceByModel($ass);
1291 }, array_values($this->getAssignmentsRaw()));
1299 if (!$this->members_cache) {
1300 $this->members_cache = array_map(
1301 function ($assignment) {
1302 return $assignment->getUserId();
1304 $this->assignment_repository->readByPrgId($this->getId())
1307 return $this->members_cache;
1315 return count($this->getAssignments()) > 0;
1323 $this->members_cache =
null;
1324 $assignments = $this->assignment_db->getInstancesForProgram((
int) $this->getId());
1325 foreach ($assignments as $ass) {
1326 $ass->updateFromProgram();
1338 return $this->assignment_repository->readByUsrIdAndPrgId($usr_id, $this->getId());
1346 return count($this->getAssignmentsOfSingleProgramForUser($usr_id)) > 0;
1359 return $this->progress_repository->createFor($this->
settings, $ass);
1370 return $this->progress_db->getInstancesForUser($this->getId(), $a_user_id);
1384 return $this->progress_db->getInstanceForAssignment($this->getId(), $a_assignment_id);
1394 $progress_repository = $this->progress_repository;
1395 $log = $this->getLog();
1397 foreach ($this->getAssignments() as $ass) {
1398 $id = $ass->getId();
1399 $assignment = $ass->getSPAssignment();
1403 $node->getProgressForAssignment($id);
1405 $log->debug(
"Adding progress for: " . $id .
" " . $node->getId());
1406 $progress_repository->update(
1407 $progress_repository->createFor(
1408 $node->getRawSettings(),
1417 $this->applyToSubTreeNodes($mapping,
true);
1428 return $this->progress_db->getInstancesForProgram($this->getId());
1436 return count($this->getProgresses()) > 0;
1444 foreach ($this->getProgresses() as $progress) {
1445 if ($progress->isRelevant()) {
1460 foreach ($this->getProgresses() as $progress) {
1461 if ($progress->isRelevant()) {
1462 $returns[] = $progress->getUserId();
1465 return array_unique($returns);
1476 foreach ($this->getProgresses() as $progress) {
1477 $progress->recalculateFailedToDeadline();
1478 if ($progress->isSuccessful() && !$progress->isSuccessfulExpired()) {
1479 $returns[] = $progress->getUserId();
1482 return array_unique($returns);
1493 foreach ($this->getProgresses() as $progress) {
1494 $progress->recalculateFailedToDeadline();
1495 if ($progress->isFailed() || $progress->isSuccessfulExpired()) {
1496 $returns[] = $progress->getUserId();
1499 return array_unique(array_diff($returns, $this->getIdsOfUsersWithCompletedProgress()));
1512 foreach ($this->getProgresses() as $progress) {
1513 if ($progress->isRelevant() && !$progress->isSuccessful()) {
1514 $returns[] = $progress->getUserId();
1517 return array_unique($returns);
1531 return $this->auto_categories_repository->readFor($this->getId());
1536 return count($this->getAutomaticContentCategories()) > 0;
1546 $ac = $this->auto_categories_repository->create(
1550 $this->auto_categories_repository->update($ac);
1559 $this->auto_categories_repository->delete($this->getId(), $category_ids);
1567 $this->auto_categories_repository->deleteFor($this->getId());
1575 foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1578 $course_ref->setTargetRefId($crs_ref_id);
1579 $course_ref->create();
1580 $course_ref->createReference();
1581 $course_ref->putInTree($prg->getRefId());
1582 $course_ref->setPermissions($crs_ref_id);
1584 $course_ref->update();
1595 foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1596 foreach ($prg->getLPChildren() as $child) {
1597 if ((
int) $child->getTargetRefId() === $crs_ref_id) {
1611 $programmes = array_map(
1613 $prg_obj_id = (int) array_shift(array_values($rec));
1615 $prg = self::getInstanceByRefId($prg_ref_id);
1616 if ($prg->isAutoContentApplicable()) {
1620 $db::getProgrammesFor($cat_ref_id)
1633 $valid_status = in_array(
1634 $this->
settings->getAssessmentSettings()->getStatus(),
1642 $this->hasLPChildren()
1643 || $this->getAmountOfChildren(
true) === 0
1646 return $valid_status && $crslnk_allowed;
1660 return $this->auto_memberships_repository->readFor($this->getId());
1668 $ams = $this->auto_memberships_repository->create($this->getId(),
$type, $src_id,
false);
1669 $this->auto_memberships_repository->update($ams);
1677 $this->auto_memberships_repository->delete($this->getId(),
$type, $src_id);
1685 $this->auto_memberships_repository->deleteFor($this->getId());
1693 $ams = $this->auto_memberships_repository->create($this->getId(),
$type, $src_id,
false);
1694 $this->auto_memberships_repository->update($ams);
1704 $member_ids = $this->getMembersOfMembershipSource(
$type, $src_id);
1706 foreach ($member_ids as $usr_id) {
1707 if (!$this->getAssignmentsOfSingleProgramForUser($usr_id)) {
1708 $this->assignUser($usr_id, $assigned_by);
1711 $ams = $this->auto_memberships_repository->create($this->getId(),
$type, $src_id,
true);
1712 $this->auto_memberships_repository->update($ams);
1722 $source_reader = $this->membersourcereader_factory->getReaderFor($src_type, $src_id);
1723 return $source_reader->getMemberIds();
1734 $programmes = array_map(
1736 $prg_obj_id = (int) array_shift(array_values($rec));
1738 $prg = self::getInstanceByRefId($prg_ref_id);
1741 $db::getProgrammesFor($src_type, $src_id)
1748 foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1749 if (!$prg->hasAssignmentsOfSingleProgramForUser($usr_id)) {
1751 $prg->assignUser($usr_id, $assigned_by);
1758 foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1759 foreach ($prg->getProgressesOf($usr_id) as $progress) {
1763 $assignments = $prg->getAssignmentsOfSingleProgramForUser($usr_id);
1764 $next_membership_source = $prg->getApplicableMembershipSourceForUser($usr_id, $src_type);
1766 foreach ($assignments as $assignment) {
1767 if (!is_null($next_membership_source)) {
1768 $new_src_type = $next_membership_source->getSourceType();
1770 $assignment = $assignment->setLastChangeBy($assigned_by);
1771 $prg->assignment_repository->update($assignment);
1775 $user_assignment = $assignment_db->getInstanceByModel($assignment);
1776 $prg->removeAssignment($user_assignment);
1788 foreach ($this->getAutomaticMembershipSources() as $ams) {
1789 $src_type = $ams->getSourceType();
1790 if ($src_type !== $exclude_type) {
1791 $source_members = $this->getMembersOfMembershipSource($src_type, $ams->getSourceId());
1792 if (in_array($usr_id, $source_members)) {
1809 $this->
settings->updateLastChange();
1810 if ($parent = $this->getParent()) {
1811 $parent->updateLastChange();
1824 $prg_ids = array_map(
function ($par) {
1825 return $par->getId();
1826 }, $this->getParents($include_references));
1827 $prg_ids[] = $this->getId();
1839 foreach ($this->getIdsFromNodesOnPathFromRootToHere(
true) as $prg_id) {
1840 $assignments = array_merge($this->assignment_repository->readByPrgId($prg_id), $assignments);
1851 return $assignments;
1862 if (
$type ==
"crs") {
1863 require_once(
"Services/ContainerReference/classes/class.ilContainerReference.php");
1865 foreach ($crs_reference_obj_ids as $obj_id) {
1867 self::setProgressesCompletedIfParentIsProgrammeInLPCompletedMode((
int) $ref_id, (
int) $obj_id, $a_user_id);
1872 self::setProgressesCompletedIfParentIsProgrammeInLPCompletedMode((
int) $ref_id, $a_obj_id, $a_user_id);
1886 $tree =
$DIC[
'tree'];
1887 $node_data = $tree->getParentNodeData($a_ref_id);
1888 if ($node_data[
"type"] !==
"prg") {
1891 self::initStudyProgrammeCache();
1896 foreach ($prg->getProgressesOf($a_user_id) as $progress) {
1897 $progress->setLPCompleted($a_obj_id, $a_user_id);
1910 $tree =
$DIC[
'tree'];
1911 if (!$tree->isInTree($a_object->
getRefId())) {
1915 $nd = $tree->getParentNodeData($a_object->
getRefId());
1916 return $nd[
"obj_id"];
1928 return $this->settings;
1935 public function updateCustomIcon() : void
1940 $customIconFactory =
$DIC[
'object.customicons.factory'];
1941 $customIcon = $customIconFactory->getByObjId($this->getId(), $this->getType());
1943 $subtype = $this->getSubType();
1946 if ($this->webdir->has($subtype->getIconPath(
true))) {
1947 $icon = $subtype->getIconPath(
true);
1948 $customIcon->saveFromSourceFile($icon);
1950 $customIcon->remove();
1953 $customIcon->remove();
1973 if ($a_ref_id ===
null) {
1974 return $a_subobjects;
1978 throw new ilException(
"Ref-Id '$a_ref_id' does not belong to a study programme object.");
1983 $mode = $parent->getLPMode();
1987 $possible_subobjects = $a_subobjects;
1990 $possible_subobjects = [
1991 "prg" => $a_subobjects[
"prg"],
1992 "prgr" => $a_subobjects[
"prgr"]
1996 $possible_subobjects = [
'crsr' => $a_subobjects[
'crsr']];
1999 throw new ilException(
"Undefined mode for study programme: '$mode'");
2002 if ($parent->hasAutomaticContentCategories()) {
2003 $possible_subobjects = array_filter(
2004 $possible_subobjects,
2005 function ($subtype) {
2006 return $subtype ===
'crsr';
2008 ARRAY_FILTER_USE_KEY
2012 return $possible_subobjects;
2015 public static function sendReAssignedMail(
int $ref_id,
int $usr_id) : bool
2020 $lng->loadLanguageModule(
"prg");
2021 $lng->loadLanguageModule(
"mail");
2026 if (!$prg->shouldSendReAssignedMail()) {
2027 $log->write(
"Send re assign mail is deactivated in study programme settings");
2031 $subject =
$lng->txt(
"re_assigned_mail_subject");
2035 $lng->txt(
"re_assigned_mail_body"),
2036 $lng->txt(
"mail_salutation_" . $gender),
2042 $mail =
new ilMail(ANONYMOUS_USER_ID);
2052 }
catch (Exception
$e) {
2063 $lng->loadLanguageModule(
"prg");
2064 $lng->loadLanguageModule(
"mail");
2068 $subject =
$lng->txt(
"invalidate_mail_subject");
2072 $lng->txt(
"invalidate_mail_body"),
2073 $lng->txt(
"mail_salutation_" . $gender),
2079 $mail =
new ilMail(ANONYMOUS_USER_ID);
2089 }
catch (Exception
$e) {
An exception for terminatinating execution or to throw for unit testing.
static saveObjRecSelection($a_obj_id, $a_sub_type="", array $a_records=null, $a_delete_before=true)
Save repository object record selection.
static _lookupTargetId($a_obj_id)
lookup target id
static _lookupTargetTitle($a_obj_id)
Lookup target title.
static _lookupSourceIds($a_target_id)
Get ids of all container references that target the object with the given id.
static _getInstance($a_obj_id)
get instance by obj_id
Base class for ILIAS Exception handling.
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
static getLogger($a_component_id)
Get component logger.
static setProgressesCompletedIfParentIsProgrammeInLPCompletedMode(int $a_ref_id, int $a_obj_id, int $a_user_id)
getLPChildren()
Get the leafs the study programme contains.
getAssignmentsOf(int $a_user_id)
Get the assignments of user at this program or any node above.
hasLPChildren()
Does this StudyProgramme has leafs?
getRoot()
Get the ilObjStudyProgramme that is the root node of the tree this programme is in.
addLeaf(ilStudyProgrammeLeaf $a_leaf)
Insert a leaf in this object.
getAmountOfAssignmentsOf(int $a_user_id)
Get the amount of assignments a user has on this program node or any node above.
getAssignmentsRaw()
Get model objects for the assignments on this programm.
setPoints(int $a_points)
Set the amount of points.
setValidityOfQualificationSettings(\ilStudyProgrammeValidityOfAchievedQualificationSettings $validity_of_qualification_settings)
getAmountOfChildren($include_references=false)
Get the amount of other StudyProgrammes this StudyProgramme has as children.
static sendInvalidateMail(int $ref_id, int $usr_id)
getApplicableMembershipSourceForUser(int $usr_id, string $exclude_type)
static removeCrsFromProgrammes(int $crs_ref_id, int $cat_ref_id)
Check, if a category is under surveilllance and automatically remove the deleted course.
removeLeaf(ilStudyProgrammeLeaf $a_leaf)
Remove a leaf from this object.
$membersourcereader_factory
hasAssignmentsOfSingleProgramForUser(int $usr_id)
Get assignments of user to this program-node only.
shouldSendRiskyToFailMail()
deleteAutomaticContentCategories(array $category_ids=[])
Delete configuration of categories with auto-content for this StudyProgramme;.
static initStudyProgrammeCache()
setAssessmentSettings(\ilStudyProgrammeAssessmentSettings $assessment_settings)
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.
enableAutomaticMembershipSource(string $type, int $src_id)
Enable a membership source.
getIdsOfUsersWithNotCompletedAndRelevantProgress()
Get the ids of all users that have not completed this programme but have a relevant progress on it.
static $study_programme_cache
$auto_memberships_repository
isAutoContentApplicable()
AutoContent should only be available in active- or draft-mode, and only, if there is no sub-programme...
static getProgrammesMonitoringMemberSource(string $src_type, int $src_id)
Get all StudyProgrammes monitoring this membership-source.
storeAutomaticMembershipSource(string $type, int $src_id)
Store a source to be monitored for automatic memberships.
deleteAssignments()
Delete all assignments from the DB.
deleteAllAutomaticContentCategories()
Delete all configuration of categories with auto-content for this StudyProgramme;.
getReferencesTo(ilObjStudyProgramme $prg)
getCompletedCourses(int $a_user_id)
Get courses in this program that the given user already completed.
getAccessControlByOrguPositionsGlobal()
setAutoMailSettings(\ilStudyProgrammeAutoMailSettings $automail_settings)
readSettings()
Load Settings from DB.
shouldSendReAssignedMail()
createProgressForAssignment(ilStudyProgrammeAssignment $ass)
Create a progress on this programme for the given assignment.
static getProgrammesMonitoringCategory(int $cat_ref_id)
Get all StudyProgrammes monitoring this category.
static getInstanceByRefId($a_ref_id)
deleteAllAutomaticMembershipSources()
Delete all membership sources of this StudyProgramme;.
getIdsFromNodesOnPathFromRootToHere(bool $include_references=false)
Get the ids from the nodes in the path leading from the root node of this program to this node,...
getPoints()
Get the amount of points.
static getCreatableSubObjects(array $a_subobjects, $a_ref_id)
Filter the list of possible subobjects for the objects that actually could be created on a concrete n...
$auto_categories_repository
storeAutomaticContentCategory(int $category_ref_id)
Store a Category with auto-content for this StudyProgramme; a category can only be referenced once (p...
moveTo(ilObjStudyProgramme $a_new_parent)
Move this tree node to a new parent.
getProgressesOf(int $a_user_id)
Get the progresses the user has on this node.
getProgressForAssignment(int $a_assignment_id)
Get the progress for an assignment on this node.
shouldSendInfoToReAssignMail()
createSettings()
Create new settings object.
getAssignments()
Get all assignments to this program or any node above.
clearLPChildrenCache()
Clear the cached lp children.
static getParentId(ilObject $a_object)
Get the obj id of the parent object for the given object.
setTypeSettings(\ilStudyProgrammeTypeSettings $type_settings)
getPositionSettingsIsChangeableForPrg()
getMembersOfMembershipSource(string $src_type, int $src_id)
Get member-ids of a certain source.
hasAutomaticContentCategories()
disableAutomaticMembershipSource(string $type, int $src_id)
Disable a membership source.
getRawSettings()
Get the underlying model of this program.
clearParentCache()
Clear the cached parent to query it again at the tree.
addMissingProgresses()
Add missing progress records for all assignments of this programm.
getChildren(bool $include_references=false)
Get all ilObjStudyProgrammes that are direct children of this object.
getProgresses()
Get all progresses on this node.
assignUser(int $a_usr_id, int $a_assigning_usr_id=null)
Assign a user to this node at the study program.
updateAllAssignments()
Update all assignments to this program node.
static addMemberToProgrammes(string $src_type, int $src_id, int $usr_id)
nodeInserted(ilObjStudyProgramme $a_prg)
Clears child chache and adds progress for new node.
getAutomaticContentCategories()
Get configuration of categories with auto-content for this StudyProgramme;.
static addCrsToProgrammes(int $crs_ref_id, int $cat_ref_id)
Check, if a category is under surveilllance and automatically add the course.
setDeadlineSettings(\ilStudyProgrammeDeadlineSettings $deadline_settings)
getLastChange()
Get the timestamp of the last change on this program or sub program.
throwIfNotInTree()
Helper function to check, weather object is in tree.
clearChildrenCache()
Clear the cached children.
__construct($a_id=0, bool $a_call_by_reference=true)
ATTENTION: After using the constructor the object won't be in the cache.
hasProgresses()
Are there any users that have a progress on this programme?
getIdsOfUsersWithRelevantProgress()
Get the ids of all users that have a relevant progress at this programme.
hasChildren(bool $include_references=false)
Does this StudyProgramme have other ilObjStudyProgrammes as children?
setStatus(int $a_status)
Set the status of the node.
getAssignmentsOfSingleProgramForUser(int $usr_id)
Get assignments of user to this program-node only.
getAutomaticMembershipSources()
Get sources for auto-memberships.
getIdsOfUsersWithFailedProgress()
Get the ids of all users that have failed this programme.
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.
getSubType()
Gets the SubType Object.
getPositionSettingsIsActiveForPrg()
removeNode(ilObjStudyProgramme $a_prg)
Remove a node from this object.
hasAssignmentOf(int $a_user_id)
Check whether user is assigned to this program or any node above.
deleteAutomaticMembershipSource(string $type, int $src_id)
Delete a membership source.
removeAssignment(ilStudyProgrammeUserAssignment $a_assignment)
Remove an assignment from this program.
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 ids of the leafs the program contains.
deleteSettings()
Delete settings from DB.
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)
putInTree($a_parent_ref)
Overwritten from ilObject.
adjustLPMode()
Adjust the lp mode to match current state of tree:
static setProgressesCompletedFor(int $a_obj_id, int $a_user_id)
Set all progresses to completed where the object with given id is a leaf and that belong to the user.
addNode(ilObjStudyProgramme $a_prg)
Inserts another ilObjStudyProgramme in this object.
getIdsOfUsersWithCompletedProgress()
Get the ids of all users that have completed this programme.
updateSettings()
Update settings in DB.
getParents(bool $include_references=false)
Get all parents of the node, where the root of the program comes first.
getValidityOfQualificationSettings()
static _lookupLogin($a_user_id)
lookup login
static _lookupGender($a_user_id)
Lookup gender.
static _lookupFullname($a_user_id)
Lookup Full Name.
Class ilObject Basic functions for all objects.
createReference()
creates reference for object
static _lookupObjectId($a_ref_id)
lookup object id
getRefId()
get reference id @access public
static _getAllReferences($a_id)
get all reference ids of object
getId()
get object id @access public
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilStudyProgrammeAssignment.
getLastChange()
Get the timestamp of the last change on this program or a sub program.
Exception is thrown when a progress for some programme node and assignment is missing.
Class ilStudyProgrammeProgress.
const STATUS_NOT_RELEVANT
Exception is thrown when invariants on the program tree would be violated by manipulation of tree.
Represents one assignment of a user to a study programme.
getStudyProgramme()
Get the program node where this assignment was made.
getId()
Get the id of the assignment.
delete()
Delete the assignment from database.
Represents the progress of a user at one node of a study programme.
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
The interface a class has to fullfill if it should be used as leaf in a program.
getRefId()
Get the ILIAS reference id of the leaf.
putInTree($a_ref_id)
Put the leaf object in the repository tree under object identified by $a_ref_id.
createReference()
Create a reference id for this object.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res