ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjStudyProgramme Class Reference
+ Inheritance diagram for ilObjStudyProgramme:
+ Collaboration diagram for ilObjStudyProgramme:

Public Member Functions

 __construct ($a_id=0, bool $a_call_by_reference=true)
 ATTENTION: After using the constructor the object won't be in the cache. More...
 
 read ()
 
 create ()
 
 update ()
 
 delete ()
 Delete Study Programme and all related data. More...
 
 getLastChange ()
 Get the timestamp of the last change on this program or sub program. More...
 
 getPoints ()
 Get the amount of points. More...
 
 setPoints (int $a_points)
 Set the amount of points. More...
 
 getLPMode ()
 
 adjustLPMode ()
 Adjust the lp mode to match current state of tree: More...
 
 getStatus ()
 
 setStatus (int $a_status)
 Set the status of the node. More...
 
 isActive ()
 
 getSubType ()
 Gets the SubType Object. More...
 
 getTypeSettings ()
 
 setTypeSettings (\ilStudyProgrammeTypeSettings $type_settings)
 
 getAssessmentSettings ()
 
 setAssessmentSettings (\ilStudyProgrammeAssessmentSettings $assessment_settings)
 
 getDeadlineSettings ()
 
 setDeadlineSettings (\ilStudyProgrammeDeadlineSettings $deadline_settings)
 
 getValidityOfQualificationSettings ()
 
 setValidityOfQualificationSettings (\ilStudyProgrammeValidityOfAchievedQualificationSettings $validity_of_qualification_settings)
 
 getAccessControlByOrguPositionsGlobal ()
 
 getPositionSettingsIsActiveForPrg ()
 
 getPositionSettingsIsChangeableForPrg ()
 
 getAutoMailSettings ()
 
 setAutoMailSettings (\ilStudyProgrammeAutoMailSettings $automail_settings)
 
 shouldSendReAssignedMail ()
 
 shouldSendInfoToReAssignMail ()
 
 shouldSendRiskyToFailMail ()
 
 getAllPrgChildren ()
 
 getChildren (bool $include_references=false)
 Get all ilObjStudyProgrammes that are direct children of this object. More...
 
 getParent ()
 Get the parent ilObjStudyProgramme of this object. More...
 
 getReferencesToSelf ()
 
 getParents (bool $include_references=false)
 Get all parents of the node, where the root of the program comes first. More...
 
 hasChildren (bool $include_references=false)
 Does this StudyProgramme have other ilObjStudyProgrammes as children? More...
 
 getAmountOfChildren ($include_references=false)
 Get the amount of other StudyProgrammes this StudyProgramme has as children. More...
 
 getDepth ()
 Get the depth of this StudyProgramme in the tree starting at the topmost StudyProgramme (not root node of the repo tree!). More...
 
 getRoot ()
 Get the ilObjStudyProgramme that is the root node of the tree this programme is in. More...
 
 getLPChildren ()
 Get the leafs the study programme contains. More...
 
 getLPChildrenIds ()
 Get the ids of the leafs the program contains. More...
 
 getAmountOfLPChildren ()
 Get the amount of leafs, the study programme contains. More...
 
 hasLPChildren ()
 Does this StudyProgramme has leafs? More...
 
 applyToSubTreeNodes (Closure $fun, bool $include_references=false)
 Apply the given Closure to every node in the subtree starting at this object. More...
 
 getCompletedCourses (int $a_user_id)
 Get courses in this program that the given user already completed. More...
 
 addNode (ilObjStudyProgramme $a_prg)
 Inserts another ilObjStudyProgramme in this object. More...
 
 nodeInserted (ilObjStudyProgramme $a_prg)
 Clears child chache and adds progress for new node. More...
 
 putInTree ($a_parent_ref)
 Overwritten from ilObject. More...
 
 removeNode (ilObjStudyProgramme $a_prg)
 Remove a node from this object. More...
 
 canBeRemoved ()
 Check weather a node can be removed. More...
 
 addLeaf (ilStudyProgrammeLeaf $a_leaf)
 Insert a leaf in this object. More...
 
 removeLeaf (ilStudyProgrammeLeaf $a_leaf)
 Remove a leaf from this object. More...
 
 moveTo (ilObjStudyProgramme $a_new_parent)
 Move this tree node to a new parent. More...
 
 assignUser (int $a_usr_id, int $a_assigning_usr_id=null)
 Assign a user to this node at the study program. More...
 
 removeAssignment (ilStudyProgrammeUserAssignment $a_assignment)
 Remove an assignment from this program. More...
 
 hasAssignmentOf (int $a_user_id)
 Check whether user is assigned to this program or any node above. More...
 
 getAmountOfAssignmentsOf (int $a_user_id)
 Get the amount of assignments a user has on this program node or any node above. More...
 
 getAssignmentsOf (int $a_user_id)
 Get the assignments of user at this program or any node above. More...
 
 getAssignments ()
 Get all assignments to this program or any node above. More...
 
 getMembers ()
 
 hasAssignments ()
 Are there any assignments on this node or any node above? More...
 
 updateAllAssignments ()
 Update all assignments to this program node. More...
 
 getAssignmentsOfSingleProgramForUser (int $usr_id)
 Get assignments of user to this program-node only. More...
 
 hasAssignmentsOfSingleProgramForUser (int $usr_id)
 Get assignments of user to this program-node only. More...
 
 createProgressForAssignment (ilStudyProgrammeAssignment $ass)
 Create a progress on this programme for the given assignment. More...
 
 getProgressesOf (int $a_user_id)
 Get the progresses the user has on this node. More...
 
 getProgressForAssignment (int $a_assignment_id)
 Get the progress for an assignment on this node. More...
 
 addMissingProgresses ()
 Add missing progress records for all assignments of this programm. More...
 
 getProgresses ()
 Get all progresses on this node. More...
 
 hasProgresses ()
 Are there any users that have a progress on this programme? More...
 
 hasRelevantProgresses ()
 Are there any users that have a relevant progress on this programme? More...
 
 getIdsOfUsersWithRelevantProgress ()
 Get the ids of all users that have a relevant progress at this programme. More...
 
 getIdsOfUsersWithCompletedProgress ()
 Get the ids of all users that have completed this programme. More...
 
 getIdsOfUsersWithFailedProgress ()
 Get the ids of all users that have failed this programme. More...
 
 getIdsOfUsersWithNotCompletedAndRelevantProgress ()
 Get the ids of all users that have not completed this programme but have a relevant progress on it. More...
 
 getAutomaticContentCategories ()
 Get configuration of categories with auto-content for this StudyProgramme;. More...
 
 hasAutomaticContentCategories ()
 
 storeAutomaticContentCategory (int $category_ref_id)
 Store a Category with auto-content for this StudyProgramme; a category can only be referenced once (per programme). More...
 
 deleteAutomaticContentCategories (array $category_ids=[])
 Delete configuration of categories with auto-content for this StudyProgramme;. More...
 
 deleteAllAutomaticContentCategories ()
 Delete all configuration of categories with auto-content for this StudyProgramme;. More...
 
 isAutoContentApplicable ()
 AutoContent should only be available in active- or draft-mode, and only, if there is no sub-programme. More...
 
 getAutomaticMembershipSources ()
 Get sources for auto-memberships. More...
 
 storeAutomaticMembershipSource (string $type, int $src_id)
 Store a source to be monitored for automatic memberships. More...
 
 deleteAutomaticMembershipSource (string $type, int $src_id)
 Delete a membership source. More...
 
 deleteAllAutomaticMembershipSources ()
 Delete all membership sources of this StudyProgramme;. More...
 
 disableAutomaticMembershipSource (string $type, int $src_id)
 Disable a membership source. More...
 
 enableAutomaticMembershipSource (string $type, int $src_id)
 Enable a membership source. More...
 
 getApplicableMembershipSourceForUser (int $usr_id, string $exclude_type)
 
 getRawSettings ()
 Get the underlying model of this program. More...
 
- Public Member Functions inherited from ilContainer
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 getObjectTranslation ()
 Get object translation. More...
 
 setObjectTranslation (ilObjectTranslation $obj_trans)
 Get object translation. More...
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems). More...
 
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems). More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 setNewsTimeline ($a_val)
 Set news timeline. More...
 
 getNewsTimeline ()
 Get news timeline. More...
 
 setNewsTimelineAutoEntries ($a_val)
 Set news timeline auto entries. More...
 
 getNewsTimelineAutoEntries ()
 Get news timeline auto entries. More...
 
 setNewsTimelineLandingPage ($a_val)
 Set news timline is landing page. More...
 
 getNewsTimelineLandingPage ()
 Get news timline is landing page. More...
 
 isNewsTimelineEffective ()
 Is news timeline effective? More...
 
 isNewsTimelineLandingPageEffective ()
 Is news timeline landing page effective? More...
 
 setNewsBlockActivated ($a_val)
 Set news block activated. More...
 
 getNewsBlockActivated ()
 Get news block activated. More...
 
 setUseNews ($a_val)
 Set use news. More...
 
 getUseNews ()
 Get use news. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false, $a_submode=1)
 clone all objects according to this container More...
 
 delete ()
 delete category and all related data More...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 isClassificationFilterActive ()
 Is classification filter active? More...
 
 filteredSubtree ()
 Note grp/crs currently allow to filter in their whole subtrees Catetories only their direct childs. More...
 
 getSubItems ( $a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0, \ilContainerUserFilter $container_user_filter=null)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!?
Todo:
role/rbac stuff
Parameters
int$a_parent_refRef-ID of the parent object
More...
 
 update ()
 Update. More...
 
 read ()
 read More...
 
 readContainerSettings ()
 Read container settings. More...
 
 removeTranslations ()
 Remove all translations of container. More...
 
 deleteTranslation ($a_lang)
 Delete translation. More...
 
 addTranslation ($a_title, $a_desc, $a_lang, $a_lang_default)
 Add translation. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 setOfflineStatus ($a_status)
 Set offline status. More...
 
 getOfflineStatus ()
 Get offline status. More...
 
 supportsOfflineHandling ()
 Check whether object supports offline handling. More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static initStudyProgrammeCache ()
 
static getInstanceByRefId ($a_ref_id)
 
static createInstance ()
 Create an instance of ilObjStudyProgramme, put in cache. More...
 
static getAllChildren (int $a_ref_id, bool $include_references=false)
 Get a list of all ilObjStudyProgrammes in the subtree starting at $a_ref_id. More...
 
static addCrsToProgrammes (int $crs_ref_id, int $cat_ref_id)
 Check, if a category is under surveilllance and automatically add the course. More...
 
static removeCrsFromProgrammes (int $crs_ref_id, int $cat_ref_id)
 Check, if a category is under surveilllance and automatically remove the deleted course. More...
 
static addMemberToProgrammes (string $src_type, int $src_id, int $usr_id)
 
static removeMemberFromProgrammes (string $src_type, int $src_id, int $usr_id)
 
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. More...
 
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 node. More...
 
static sendInvalidateMail (int $ref_id, int $usr_id)
 
- Static Public Member Functions inherited from ilContainer
static _getContainerDirectory ($a_id)
 Get the container directory. More...
 
static _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=null)
 Lookup a container setting. More...
 
static _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
static _getContainerSettings ($a_id)
 
static _deleteContainerSettings ($a_id, $a_keyword=null, $a_keyword_like=false)
 
static _exportContainerSettings (ilXmlWriter $a_xml, $a_obj_id)
 
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description) More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static lookupOfflineStatus ($a_obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id, $a_deleted_by)
 
static setDeletedDates ($a_ref_ids, $a_user_id)
 Set deleted date. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

 $webdir
 
 $tree
 
 $ilUser
 
 $object_factory
 
- Data Fields inherited from ilContainer
const VIEW_SESSIONS = 0
 
const VIEW_OBJECTIVE = 1
 
const VIEW_TIMING = 2
 
const VIEW_ARCHIVE = 3
 
const VIEW_SIMPLE = 4
 
const VIEW_BY_TYPE = 5
 
const VIEW_INHERIT = 6
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
const SORT_CREATION = 4
 
const SORT_DIRECTION_ASC = 0
 
const SORT_DIRECTION_DESC = 1
 
const SORT_NEW_ITEMS_POSITION_TOP = 0
 
const SORT_NEW_ITEMS_POSITION_BOTTOM = 1
 
const SORT_NEW_ITEMS_ORDER_TITLE = 0
 
const SORT_NEW_ITEMS_ORDER_CREATION = 1
 
const SORT_NEW_ITEMS_ORDER_ACTIVATION = 2
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Static Public Attributes

static $study_programme_cache = null
 
- Static Public Attributes inherited from ilContainer
static $data_preloaded = false
 

Protected Member Functions

 clearParentCache ()
 Clear the cached parent to query it again at the tree. More...
 
 clearChildrenCache ()
 Clear the cached children. More...
 
 clearLPChildrenCache ()
 Clear the cached lp children. More...
 
 readSettings ()
 Load Settings from DB. More...
 
 createSettings ()
 Create new settings object. More...
 
 updateSettings ()
 Update settings in DB. More...
 
 deleteSettings ()
 Delete settings from DB. More...
 
 deleteAssignments ()
 Delete all assignments from the DB. More...
 
 getReferencesTo (ilObjStudyProgramme $prg)
 
 throwIfNotInTree ()
 Helper function to check, weather object is in tree. More...
 
 getMembersOfMembershipSource (string $src_type, int $src_id)
 Get member-ids of a certain source. More...
 
 updateLastChange ()
 Update last change timestamp on this node and its parents. More...
 
 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, including the id of this node. More...
 
 getAssignmentsRaw ()
 Get model objects for the assignments on this programm. More...
 
 getLog ()
 
- Protected Member Functions inherited from ilContainer
 getInitialSubitems ()
 Get initial subitems. More...
 
 applyContainerUserFilter ($objects, ilContainerUserFilter $container_user_filter=null)
 Apply container user filter on objects. More...
 
 legacyOnlineFilter ($obj_ids, $objects, $val)
 Legacy online filter. More...
 

Static Protected Member Functions

static getProgrammesMonitoringCategory (int $cat_ref_id)
 Get all StudyProgrammes monitoring this category. More...
 
static getProgrammesMonitoringMemberSource (string $src_type, int $src_id)
 Get all StudyProgrammes monitoring this membership-source. More...
 
static setProgressesCompletedIfParentIsProgrammeInLPCompletedMode (int $a_ref_id, int $a_obj_id, int $a_user_id)
 
static getParentId (ilObject $a_object)
 Get the obj id of the parent object for the given object. More...
 

Protected Attributes

 $settings
 
 $parent
 
 $children
 
 $lp_children
 
 $type_repository
 
 $assignment_repository
 
 $progress_repository
 
 $auto_categories_repository
 
 $auto_memberships_repository
 
 $membersourcereader_factory
 
 $progress_db
 
 $assignment_db
 
 $events
 
 $db
 
 $plugin_admin
 
 $settings_repository
 
 $ps
 
 $reference_children = []
 
 $members_cache
 
- Protected Attributes inherited from ilContainer
 $db
 
 $log
 
 $access
 
 $error
 
 $rbacsystem
 
 $tree
 
 $user
 
 $obj_definition
 
 $order_type = 0
 
 $hiddenfilesfound = false
 
 $news_timeline = false
 
 $news_timeline_auto_entries = false
 
 $setting
 
 $obj_trans = null
 
 $recommended_content_manager
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Detailed Description

Definition at line 7 of file class.ilObjStudyProgramme.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgramme::__construct (   $a_id = 0,
bool  $a_call_by_reference = true 
)

ATTENTION: After using the constructor the object won't be in the cache.

This could lead to unexpected behaviour when using the tree navigation.

Definition at line 136 of file class.ilObjStudyProgramme.php.

137 {
138 $this->type = "prg";
139 $this->settings = null;
140 $this->settings_repository =
141 ilStudyProgrammeDIC::dic()['model.Settings.ilStudyProgrammeSettingsRepository'];
142 $this->type_repository =
143 ilStudyProgrammeDIC::dic()['model.Type.ilStudyProgrammeTypeRepository'];
144 $this->assignment_repository =
145 ilStudyProgrammeDIC::dic()['model.Assignment.ilStudyProgrammeAssignmentRepository'];
146 $this->progress_repository =
147 ilStudyProgrammeDIC::dic()['model.Progress.ilStudyProgrammeProgressRepository'];
148 $this->auto_categories_repository =
149 ilStudyProgrammeDIC::dic()['model.AutoCategories.ilStudyProgrammeAutoCategoriesRepository'];
150 $this->auto_memberships_repository =
151 ilStudyProgrammeDIC::dic()['model.AutoMemberships.ilStudyProgrammeAutoMembershipsRepository'];
152 $this->membersourcereader_factory =
153 ilStudyProgrammeDIC::dic()['model.AutoMemberships.ilStudyProgrammeMembershipSourceReaderFactory'];
154
155 $this->progress_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserProgressDB'];
156 $this->assignment_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserAssignmentDB'];
157 $this->events = ilStudyProgrammeDIC::dic()['ilStudyProgrammeEvents'];
158
159 parent::__construct($a_id, $a_call_by_reference);
160
161 $this->clearParentCache();
162 $this->clearChildrenCache();
163 $this->clearLPChildrenCache();
164
165 global $DIC;
166 $tree = $DIC['tree'];
167 $ilUser = $DIC['ilUser'];
168 $this->webdir = $DIC->filesystem()->web();
169 $this->tree = $tree;
170 $this->ilUser = $ilUser;
171 $this->db = $DIC['ilDB'];
172 $this->plugin_admin = $DIC['ilPluginAdmin'];
173 $this->lng = $DIC['lng'];
174
175 $this->object_factory = ilObjectFactoryWrapper::singleton();
176 $this->ps = ilStudyProgrammeDIC::dic()['ilOrgUnitObjectTypePositionSetting'];
177
179 }
clearLPChildrenCache()
Clear the cached lp children.
clearParentCache()
Clear the cached parent to query it again at the tree.
clearChildrenCache()
Clear the cached children.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46

References $DIC, $ilUser, $tree, ILIAS\GlobalScreen\Provider\__construct(), clearChildrenCache(), clearLPChildrenCache(), clearParentCache(), ilStudyProgrammeDIC\dic(), initStudyProgrammeCache(), settings(), and ilObjectFactoryWrapper\singleton().

+ Here is the call graph for this function:

Member Function Documentation

◆ addCrsToProgrammes()

static ilObjStudyProgramme::addCrsToProgrammes ( int  $crs_ref_id,
int  $cat_ref_id 
)
static

Check, if a category is under surveilllance and automatically add the course.

Definition at line 1573 of file class.ilObjStudyProgramme.php.

1573 : void
1574 {
1575 foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1576 $course_ref = new ilObjCourseReference();
1577 $course_ref->setTitleType(ilObjCourseReference::TITLE_TYPE_REUSE);
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);
1583 $course_ref->setTargetId(ilObject::_lookupObjectId($crs_ref_id));
1584 $course_ref->update();
1585 }
1586 }
static _lookupObjectId($a_ref_id)
lookup object id

References ilObject\_lookupObjectId(), and ilContainerReference\TITLE_TYPE_REUSE.

Referenced by ilStudyProgrammeAppEventListener\addCrsToProgrammes().

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

◆ addLeaf()

ilObjStudyProgramme::addLeaf ( ilStudyProgrammeLeaf  $a_leaf)

Insert a leaf in this object.

Throws when object already contain ilObjStudyProgrammes as children. Throws when this object is not in tree.

Exceptions
ilStudyProgrammeTreeException
ilException

Definition at line 1062 of file class.ilObjStudyProgramme.php.

1063 {
1064 $this->throwIfNotInTree();
1065
1066 if ($this->hasChildren()) {
1067 throw new ilStudyProgrammeTreeException("Program already contains other programm nodes.");
1068 }
1069
1070 if ($a_leaf->getRefId() === null) {
1071 $a_leaf->createReference();
1072 }
1073 $a_leaf->putInTree($this->getRefId());
1074 $this->clearLPChildrenCache();
1075 $this->settings_repository->update(
1077 );
1078
1079 return $this;
1080 }
throwIfNotInTree()
Helper function to check, weather object is in tree.
hasChildren(bool $include_references=false)
Does this StudyProgramme have other ilObjStudyProgrammes as children?
getRefId()
get reference id @access public
Exception is thrown when invariants on the program tree would be violated by manipulation of tree.
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.

References ilStudyProgrammeLeaf\createReference(), ilStudyProgrammeLeaf\getRefId(), ilStudyProgrammeSettings\MODE_LP_COMPLETED, ilStudyProgrammeLeaf\putInTree(), and settings().

+ Here is the call graph for this function:

◆ addMemberToProgrammes()

static ilObjStudyProgramme::addMemberToProgrammes ( string  $src_type,
int  $src_id,
int  $usr_id 
)
static

Definition at line 1746 of file class.ilObjStudyProgramme.php.

1746 : void
1747 {
1748 foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1749 if (!$prg->hasAssignmentsOfSingleProgramForUser($usr_id)) {
1751 $prg->assignUser($usr_id, $assigned_by);
1752 }
1753 }
1754 }

References ilStudyProgrammeAutoMembershipSource\SOURCE_MAPPING.

Referenced by ilStudyProgrammeAppEventListener\addMemberToProgrammes().

+ Here is the caller graph for this function:

◆ addMissingProgresses()

ilObjStudyProgramme::addMissingProgresses ( )

Add missing progress records for all assignments of this programm.

Use this after the structure of the programme was modified.

ilStudyProgrammeUserAssignment[]

Definition at line 1392 of file class.ilObjStudyProgramme.php.

1392 : void
1393 {
1395 $log = $this->getLog();
1396
1397 foreach ($this->getAssignments() as $ass) {
1398 $id = $ass->getId();
1399 $assignment = $ass->getSPAssignment();
1400
1401 $mapping = function (ilObjStudyProgramme $node) use ($id, $log, $progress_repository, $assignment) {
1402 try {
1403 $node->getProgressForAssignment($id);
1405 $log->debug("Adding progress for: " . $id . " " . $node->getId());
1406 $progress_repository->update(
1407 $progress_repository->createFor(
1408 $node->getRawSettings(),
1409 $assignment
1410 )->setStatus(
1412 )
1413 );
1414 }
1415 };
1416
1417 $this->applyToSubTreeNodes($mapping, true);
1418 }
1419 }
applyToSubTreeNodes(Closure $fun, bool $include_references=false)
Apply the given Closure to every node in the subtree starting at this object.
getAssignments()
Get all assignments to this program or any node above.
Exception is thrown when a progress for some programme node and assignment is missing.

References Vendor\Package\$e, $log, and ilStudyProgrammeProgress\STATUS_NOT_RELEVANT.

◆ addNode()

ilObjStudyProgramme::addNode ( ilObjStudyProgramme  $a_prg)

Inserts another ilObjStudyProgramme in this object.

Throws when object already contains non ilObjStudyProgrammes as children. Throws when $a_prg already is in the tree. Throws when this object is not in tree.

Returns
ilObjStudyProgramme
Exceptions
ilStudyProgrammeTreeException

Definition at line 946 of file class.ilObjStudyProgramme.php.

947 {
948 $this->throwIfNotInTree();
949
951 throw new ilStudyProgrammeTreeException("Program already contains leafs.");
952 }
953
954 if ($this->tree->isInTree($a_prg->getRefId())) {
955 throw new ilStudyProgrammeTreeException("Other program already is in tree.");
956 }
957
958 if ($a_prg->getRefId() === null) {
959 $a_prg->createReference();
960 }
961 $a_prg->putInTree($this->getRefId());
962 return $this;
963 }
putInTree($a_parent_ref)
Overwritten from ilObject.
createReference()
creates reference for object

References ilObject\createReference(), ilObject\getRefId(), ilStudyProgrammeSettings\MODE_LP_COMPLETED, and putInTree().

+ Here is the call graph for this function:

◆ adjustLPMode()

ilObjStudyProgramme::adjustLPMode ( )

Adjust the lp mode to match current state of tree:

If there are any non programme children, the mode is MODE_LP_COMPLETED, otherwise its MODE_POINTS.

Exceptions
ilExceptionwhen programme is not in draft mode.

Definition at line 433 of file class.ilObjStudyProgramme.php.

433 : void
434 {
435 if ($this->getAmountOfLPChildren() > 0) {
436 $this->settings_repository->update(
438 );
439 } else {
440 if ($this->getAmountOfChildren(true) > 0) {
441 $this->settings_repository->update(
443 );
444 } else {
445 $this->settings_repository->update(
447 );
448 }
449 }
450 }
getAmountOfChildren($include_references=false)
Get the amount of other StudyProgrammes this StudyProgramme has as children.
getAmountOfLPChildren()
Get the amount of leafs, the study programme contains.

References getAmountOfChildren(), getAmountOfLPChildren(), ilStudyProgrammeSettings\MODE_LP_COMPLETED, ilStudyProgrammeSettings\MODE_POINTS, ilStudyProgrammeSettings\MODE_UNDEFINED, and settings().

+ Here is the call graph for this function:

◆ applyToSubTreeNodes()

ilObjStudyProgramme::applyToSubTreeNodes ( Closure  $fun,
bool  $include_references = false 
)

Apply the given Closure to every node in the subtree starting at this object.

When the closure returns false, the underlying nodes won't be visited.

Exceptions
ilStudyProgrammeTreeExceptionThrows when this object is not in tree.

Definition at line 892 of file class.ilObjStudyProgramme.php.

893 {
894 $this->throwIfNotInTree();
895
896 if ($fun($this) !== false) {
897 foreach ($this->getChildren($include_references) as $child) {
898 $child->applyToSubTreeNodes($fun, $include_references);
899 }
900 }
901 }
getChildren(bool $include_references=false)
Get all ilObjStudyProgrammes that are direct children of this object.

◆ assignUser()

ilObjStudyProgramme::assignUser ( int  $a_usr_id,
int  $a_assigning_usr_id = null 
)

Assign a user to this node at the study program.

Throws when node is in DRAFT or OUTDATED status. Throws when there are no settings for the program.

TODO: Should it be allowed to assign inactive users?

Exceptions
ilException

Definition at line 1155 of file class.ilObjStudyProgramme.php.

1156 {
1157 $this->members_cache = null;
1158 if ($this->settings === null) {
1159 throw new ilException(
1160 "ilObjStudyProgramme::assignUser: Program was not properly created.'"
1161 );
1162 }
1163
1165 throw new ilException(
1166 "ilObjStudyProgramme::assignUser: Can't assign user to program '"
1167 . $this->getId() . "', since it's not in active status."
1168 );
1169 }
1170
1171 if ($a_assigning_usr_id === null) {
1172 $a_assigning_usr_id = $this->ilUser->getId();
1173 }
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(
1177 function (ilObjStudyProgramme $node) use ($ass_mod, $a_assigning_usr_id) {
1178 $progress = $node->createProgressForAssignment($ass_mod);
1180 $this->progress_repository->update(
1181 $progress->setStatus(ilStudyProgrammeProgress::STATUS_NOT_RELEVANT)
1182 );
1183 } else {
1184 $deadline_date = null;
1185 if ($deadline_date = $node->getDeadlineSettings()->getDeadlineDate()) {
1186 $this->progress_repository->update(
1187 $progress->setDeadline($deadline_date)
1188 );
1189 }
1190 if ($deadline_period = $node->getDeadlineSettings()->getDeadlinePeriod()) {
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)
1195 );
1196 }
1197 if ($deadline_date) {
1198 $this->progress_db->getInstanceById($progress->getId())->recalculateFailedToDeadline();
1199 }
1200 }
1201 },
1202 true
1203 );
1204
1205 $this->events->userAssigned($ass);
1206
1207 return $ass;
1208 }
Base class for ILIAS Exception handling.
createProgressForAssignment(ilStudyProgrammeAssignment $ass)
Create a progress on this programme for the given assignment.
getId()
get object id @access public
Represents one assignment of a user to a study programme.
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12

References createProgressForAssignment(), getDeadlineSettings(), getStatus(), if, settings(), and ilStudyProgrammeSettings\STATUS_ACTIVE.

+ Here is the call graph for this function:

◆ canBeRemoved()

ilObjStudyProgramme::canBeRemoved ( )

Check weather a node can be removed.

This is allowed when all progresses on the node are marked as not relevant programmatically.

Definition at line 1040 of file class.ilObjStudyProgramme.php.

1040 : bool
1041 {
1042 foreach ($this->getProgresses() as $progress) {
1043 if ($progress->getStatus() != ilStudyProgrammeProgress::STATUS_NOT_RELEVANT) {
1044 return false;
1045 }
1046 if ($progress->getLastChangeBy() !== null) {
1047 return false;
1048 }
1049 }
1050 return true;
1051 }
getProgresses()
Get all progresses on this node.

References ilStudyProgrammeProgress\STATUS_NOT_RELEVANT.

Referenced by removeNode().

+ Here is the caller graph for this function:

◆ clearChildrenCache()

ilObjStudyProgramme::clearChildrenCache ( )
protected

Clear the cached children.

Definition at line 200 of file class.ilObjStudyProgramme.php.

200 : void
201 {
202 $this->children = null;
203 }

Referenced by __construct(), and moveTo().

+ Here is the caller graph for this function:

◆ clearLPChildrenCache()

ilObjStudyProgramme::clearLPChildrenCache ( )
protected

Clear the cached lp children.

Definition at line 208 of file class.ilObjStudyProgramme.php.

208 : void
209 {
210 $this->lp_children = null;
211 }

Referenced by __construct(), and moveTo().

+ Here is the caller graph for this function:

◆ clearParentCache()

ilObjStudyProgramme::clearParentCache ( )
protected

Clear the cached parent to query it again at the tree.

Definition at line 191 of file class.ilObjStudyProgramme.php.

191 : void
192 {
193 // This is not initialized, but we need null if there is no parent.
194 $this->parent = false;
195 }

Referenced by __construct(), and removeNode().

+ Here is the caller graph for this function:

◆ create()

ilObjStudyProgramme::create ( )
Exceptions
ilException

Reimplemented from ilContainer.

Definition at line 330 of file class.ilObjStudyProgramme.php.

330 : int
331 {
332 $id = parent::create();
333 $this->createSettings();
334
335 return (int) $id;
336 }
createSettings()
Create new settings object.

References ilObject\$id, and createSettings().

+ Here is the call graph for this function:

◆ createInstance()

static ilObjStudyProgramme::createInstance ( )
static

Create an instance of ilObjStudyProgramme, put in cache.

Exceptions
ilException

Definition at line 226 of file class.ilObjStudyProgramme.php.

227 {
228 $obj = new ilObjStudyProgramme();
229 $obj->create();
230 $obj->createReference();
231 self::$study_programme_cache->addInstance($obj);
232 return $obj;
233 }

Referenced by ilObjStudyProgrammeTest\createSmallTree(), ilPrgInvalidateExpiredProgressesCronJobTest\newPrg(), ilPrgRestartAssignmentsCronJobTest\newPrg(), ilObjStudyProgrammeTest\setUp(), ilStudyProgrammeEventsTest\setUp(), ilStudyProgrammeLPTest\setUp(), ilStudyProgrammeProgressCalculationTest\setUp(), ilStudyProgrammeUserAssignmentTest\setUp(), ilStudyProgrammeUserProgressTest\setUp(), ilStudyProgrammeAssignmentRepositoryTest\setUpBeforeClass(), ilStudyProgrammeProgressCalculationTest\setUpNodes(), ilStudyProgrammeUserProgressTest\test_limited_validity_accredited(), ilStudyProgrammeUserProgressTest\test_limited_validity_date(), ilStudyProgrammeUserProgressTest\test_limited_validity_period(), ilStudyProgrammeUserProgressTest\test_set_failed_limited_validity_future(), ilStudyProgrammeUserProgressTest\test_set_failed_limited_validity_past(), ilStudyProgrammeUserProgressTest\test_set_failed_no_limited_validity(), ilStudyProgrammeUserProgressTest\testCanBeCompleted3(), ilStudyProgrammeUserProgressTest\testCompletionOnDeeplyNestedProgresses(), ilStudyProgrammeLPTest\testNewNodesAreNotRelevant(), ilStudyProgrammeUserProgressTest\testNewNodesAreNotRelevant(), ilStudyProgrammeUserAssignmentTest\testNoRestartDate(), ilStudyProgrammeUserAssignmentTest\testRestartDate(), ilStudyProgrammeUserAssignmentTest\testRstartAssignment(), and ilObjStudyProgrammeTest\testTreeGetParents().

+ Here is the caller graph for this function:

◆ createProgressForAssignment()

ilObjStudyProgramme::createProgressForAssignment ( ilStudyProgrammeAssignment  $ass)

Create a progress on this programme for the given assignment.

Definition at line 1357 of file class.ilObjStudyProgramme.php.

1358 {
1359 return $this->progress_repository->createFor($this->settings, $ass);
1360 }
Class ilStudyProgrammeProgress.

References settings().

Referenced by assignUser().

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

◆ createSettings()

ilObjStudyProgramme::createSettings ( )
protected

Create new settings object.

Throws when settings are already loaded or id is null.

Exceptions
ilExceptionif settings are already created
ilExceptionif there is no oid to create settings

Definition at line 265 of file class.ilObjStudyProgramme.php.

265 : void
266 {
267 if ($this->settings !== null) {
268 throw new ilException("ilObjStudyProgramme::createSettings: already loaded.");
269 }
270
271 $id = $this->getId();
272 if (!$id) {
273 throw new ilException("ilObjStudyProgramme::loadSettings: no id.");
274 }
275 $this->settings = $this->settings_repository->createFor($this->getId());
276 }

References ilObject\$id, ilObject\getId(), and settings().

Referenced by create().

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

◆ delete()

ilObjStudyProgramme::delete ( )

Delete Study Programme and all related data.

Exceptions
ilException

Reimplemented from ilContainer.

Definition at line 364 of file class.ilObjStudyProgramme.php.

364 : bool
365 {
366 // always call parent delete function first!!
367 if (!parent::delete()) {
368 return false;
369 }
370
371 $this->deleteSettings();
372 try {
373 $this->deleteAssignments();
374 $this->auto_categories_repository->deleteFor((int) $this->getId());
376 // This would be the case when SP is in trash (#17797)
377 }
378
381
382 $this->events->raise('delete', ['object' => $this, 'obj_id' => $this->getId()]);
383 return true;
384 }
deleteAssignments()
Delete all assignments from the DB.
deleteAllAutomaticContentCategories()
Delete all configuration of categories with auto-content for this StudyProgramme;.
deleteAllAutomaticMembershipSources()
Delete all membership sources of this StudyProgramme;.
deleteSettings()
Delete settings from DB.

References Vendor\Package\$e, deleteAllAutomaticContentCategories(), deleteAllAutomaticMembershipSources(), deleteAssignments(), deleteSettings(), and ilObject\getId().

+ Here is the call graph for this function:

◆ deleteAllAutomaticContentCategories()

ilObjStudyProgramme::deleteAllAutomaticContentCategories ( )

Delete all configuration of categories with auto-content for this StudyProgramme;.

Definition at line 1565 of file class.ilObjStudyProgramme.php.

1565 : void
1566 {
1567 $this->auto_categories_repository->deleteFor($this->getId());
1568 }

Referenced by delete().

+ Here is the caller graph for this function:

◆ deleteAllAutomaticMembershipSources()

ilObjStudyProgramme::deleteAllAutomaticMembershipSources ( )

Delete all membership sources of this StudyProgramme;.

Definition at line 1683 of file class.ilObjStudyProgramme.php.

1683 : void
1684 {
1685 $this->auto_memberships_repository->deleteFor($this->getId());
1686 }

Referenced by delete().

+ Here is the caller graph for this function:

◆ deleteAssignments()

ilObjStudyProgramme::deleteAssignments ( )
protected

Delete all assignments from the DB.

Exceptions
ilException

Definition at line 311 of file class.ilObjStudyProgramme.php.

311 : void
312 {
313 foreach ($this->getAssignments() as $ass) {
314 $ass->delete();
315 }
316 }

References getAssignments().

Referenced by delete().

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

◆ deleteAutomaticContentCategories()

ilObjStudyProgramme::deleteAutomaticContentCategories ( array  $category_ids = [])

Delete configuration of categories with auto-content for this StudyProgramme;.

Parameters
int[]$category_ids

Definition at line 1557 of file class.ilObjStudyProgramme.php.

1557 : void
1558 {
1559 $this->auto_categories_repository->delete($this->getId(), $category_ids);
1560 }

◆ deleteAutomaticMembershipSource()

ilObjStudyProgramme::deleteAutomaticMembershipSource ( string  $type,
int  $src_id 
)

Delete a membership source.

Definition at line 1675 of file class.ilObjStudyProgramme.php.

1675 : void
1676 {
1677 $this->auto_memberships_repository->delete($this->getId(), $type, $src_id);
1678 }

References $type.

◆ deleteSettings()

ilObjStudyProgramme::deleteSettings ( )
protected

Delete settings from DB.

Throws when settings are not loaded.

Exceptions
ilExceptionif no settings are loaded

Definition at line 298 of file class.ilObjStudyProgramme.php.

298 : void
299 {
300 if ($this->settings === null) {
301 throw new ilException("ilObjStudyProgramme::deleteSettings: no settings loaded.");
302 }
303 $this->settings_repository->delete($this->settings);
304 }

References settings().

Referenced by delete().

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

◆ disableAutomaticMembershipSource()

ilObjStudyProgramme::disableAutomaticMembershipSource ( string  $type,
int  $src_id 
)

Disable a membership source.

Definition at line 1691 of file class.ilObjStudyProgramme.php.

1691 : void
1692 {
1693 $ams = $this->auto_memberships_repository->create($this->getId(), $type, $src_id, false);
1694 $this->auto_memberships_repository->update($ams);
1695 }

References $type.

◆ enableAutomaticMembershipSource()

ilObjStudyProgramme::enableAutomaticMembershipSource ( string  $type,
int  $src_id 
)

Enable a membership source.

Exceptions
ilException

Definition at line 1701 of file class.ilObjStudyProgramme.php.

1701 : void
1702 {
1704 $member_ids = $this->getMembersOfMembershipSource($type, $src_id);
1705
1706 foreach ($member_ids as $usr_id) {
1707 if (!$this->getAssignmentsOfSingleProgramForUser($usr_id)) {
1708 $this->assignUser($usr_id, $assigned_by);
1709 }
1710 }
1711 $ams = $this->auto_memberships_repository->create($this->getId(), $type, $src_id, true);
1712 $this->auto_memberships_repository->update($ams);
1713 }
getMembersOfMembershipSource(string $src_type, int $src_id)
Get member-ids of a certain source.
assignUser(int $a_usr_id, int $a_assigning_usr_id=null)
Assign a user to this node at the study program.
getAssignmentsOfSingleProgramForUser(int $usr_id)
Get assignments of user to this program-node only.

References $type, and ilStudyProgrammeAutoMembershipSource\SOURCE_MAPPING.

◆ getAccessControlByOrguPositionsGlobal()

ilObjStudyProgramme::getAccessControlByOrguPositionsGlobal ( )

Definition at line 534 of file class.ilObjStudyProgramme.php.

534 : bool
535 {
536 return
539 ;
540 }

◆ getAllChildren()

static ilObjStudyProgramme::getAllChildren ( int  $a_ref_id,
bool  $include_references = false 
)
static

Get a list of all ilObjStudyProgrammes in the subtree starting at $a_ref_id.

Throws when object is not in tree.

Returns
ilObjStudyProgramme[]

Definition at line 589 of file class.ilObjStudyProgramme.php.

590 {
591 $ret = array();
592 $root = self::getInstanceByRefId($a_ref_id);
593 $root_id = $root->getId();
594 $root->applyToSubTreeNodes(function (ilObjStudyProgramme $prg) use (&$ret, $root_id) {
595 // exclude root node of subtree.
596 if ($prg->getId() == $root_id) {
597 return;
598 }
599 $ret[] = $prg;
600 }, $include_references);
601 return $ret;
602 }
static getInstanceByRefId($a_ref_id)
$ret
Definition: parser.php:6

References $ret, and ilObject\getId().

Referenced by ilObjStudyProgrammeTreeGUI\confirmedDelete(), ilObjStudyProgrammeTest\testMoveTo(), and ilObjStudyProgrammeTest\testTreeGetChildren().

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

◆ getAllPrgChildren()

ilObjStudyProgramme::getAllPrgChildren ( )

Definition at line 604 of file class.ilObjStudyProgramme.php.

604 : array
605 {
606 $ret = [];
607 $this->applyToSubTreeNodes(
608 function (ilObjStudyProgramme $prg) use (&$ret) {
609 if ($prg->getId() == $this->getId()) {
610 return;
611 }
612 $ret[] = $prg;
613 },
614 false
615 );
616 return $ret;
617 }

References $ret, and ilObject\getId().

Referenced by ilStudyProgrammeDashboardViewGUI\calculatePercent().

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

◆ getAmountOfAssignmentsOf()

ilObjStudyProgramme::getAmountOfAssignmentsOf ( int  $a_user_id)

Get the amount of assignments a user has on this program node or any node above.

Definition at line 1247 of file class.ilObjStudyProgramme.php.

1247 : int
1248 {
1249 return count($this->getAssignmentsOf($a_user_id));
1250 }
getAssignmentsOf(int $a_user_id)
Get the assignments of user at this program or any node above.

◆ getAmountOfChildren()

ilObjStudyProgramme::getAmountOfChildren (   $include_references = false)

Get the amount of other StudyProgrammes this StudyProgramme has as children.

Returns
int
Exceptions
ilStudyProgrammeTreeExceptionwhen this object is not in tree.

Definition at line 768 of file class.ilObjStudyProgramme.php.

769 {
770 return count($this->getChildren($include_references));
771 }

Referenced by adjustLPMode().

+ Here is the caller graph for this function:

◆ getAmountOfLPChildren()

ilObjStudyProgramme::getAmountOfLPChildren ( )

Get the amount of leafs, the study programme contains.

Throws when this object is not in tree.

Definition at line 853 of file class.ilObjStudyProgramme.php.

854 {
855 return count($this->getLPChildren());
856 }
getLPChildren()
Get the leafs the study programme contains.

Referenced by adjustLPMode().

+ Here is the caller graph for this function:

◆ getApplicableMembershipSourceForUser()

ilObjStudyProgramme::getApplicableMembershipSourceForUser ( int  $usr_id,
string  $exclude_type 
)
Returns
ilStudyProgrammeAutoMembershipSource | null

Definition at line 1786 of file class.ilObjStudyProgramme.php.

1787 {
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)) {
1793 return $ams;
1794 }
1795 }
1796 }
1797 return null;
1798 }
getAutomaticMembershipSources()
Get sources for auto-memberships.

◆ getAssessmentSettings()

ilObjStudyProgramme::getAssessmentSettings ( )

Definition at line 500 of file class.ilObjStudyProgramme.php.

References settings().

Referenced by getStatus(), setPoints(), and setStatus().

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

◆ getAssignments()

ilObjStudyProgramme::getAssignments ( )

Get all assignments to this program or any node above.

Returns
ilStudyProgrammeUserAssignment[]

Definition at line 1286 of file class.ilObjStudyProgramme.php.

1286 : array
1287 {
1289 return array_map(function ($ass) use ($assignment_db) {
1290 return $assignment_db->getInstanceByModel($ass);
1291 }, array_values($this->getAssignmentsRaw())); // use array values since we want keys 0...
1292 }
getAssignmentsRaw()
Get model objects for the assignments on this programm.

Referenced by deleteAssignments().

+ Here is the caller graph for this function:

◆ getAssignmentsOf()

ilObjStudyProgramme::getAssignmentsOf ( int  $a_user_id)

Get the assignments of user at this program or any node above.

The assignments are ordered by last_change, where the most recently changed assignments is the first one.

Returns
ilStudyProgrammeUserAssignment[]

Definition at line 1259 of file class.ilObjStudyProgramme.php.

1259 : array
1260 {
1261 $prg_ids = $this->getIdsFromNodesOnPathFromRootToHere();
1262 $assignments = [];
1263 foreach ($prg_ids as $prg_id) {
1264 $assignments = array_merge(
1265 $assignments,
1266 $this->assignment_repository->readByUsrIdAndPrgId($a_user_id, $prg_id)
1267 );
1268 }
1269 usort($assignments, function ($a_one, $a_other) {
1270 return strcmp(
1271 $a_one->getLastChange()->format('Y-m-d'),
1272 $a_other->getLastChange()->format('Y-m-d')
1273 );
1274 });
1276 return array_map(function ($ass) use ($assignment_db) {
1277 return $assignment_db->getInstanceByModel($ass);
1278 }, array_values($assignments)); // use array values since we want keys 0...
1279 }
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,...

◆ getAssignmentsOfSingleProgramForUser()

ilObjStudyProgramme::getAssignmentsOfSingleProgramForUser ( int  $usr_id)

Get assignments of user to this program-node only.

Returns
ilStudyProgrammeUserAssignment[]

Definition at line 1336 of file class.ilObjStudyProgramme.php.

1336 : array
1337 {
1338 return $this->assignment_repository->readByUsrIdAndPrgId($usr_id, $this->getId());
1339 }

◆ getAssignmentsRaw()

ilObjStudyProgramme::getAssignmentsRaw ( )
protected

Get model objects for the assignments on this programm.

Returns
ilStudyProgrammeAssignment[]

Definition at line 1836 of file class.ilObjStudyProgramme.php.

1836 : array
1837 {
1838 $assignments = [];
1839 foreach ($this->getIdsFromNodesOnPathFromRootToHere(true) as $prg_id) {
1840 $assignments = array_merge($this->assignment_repository->readByPrgId($prg_id), $assignments);
1841 }
1842 usort(
1843 $assignments,
1844 function (ilStudyProgrammeAssignment $a_one, ilStudyProgrammeAssignment $a_other) {
1845 return -strcmp(
1846 $a_one->getLastChange()->format('Y-m-d'),
1847 $a_other->getLastChange()->format('Y-m-d')
1848 );
1849 }
1850 );
1851 return $assignments;
1852 }
Class ilStudyProgrammeAssignment.
getLastChange()
Get the timestamp of the last change on this program or a sub program.

References ilStudyProgrammeAssignment\getLastChange().

+ Here is the call graph for this function:

◆ getAutoMailSettings()

ilObjStudyProgramme::getAutoMailSettings ( )

Definition at line 552 of file class.ilObjStudyProgramme.php.

References settings().

+ Here is the call graph for this function:

◆ getAutomaticContentCategories()

ilObjStudyProgramme::getAutomaticContentCategories ( )

Get configuration of categories with auto-content for this StudyProgramme;.

Returns
ilStudyProgrammeAutoCategory[]

Definition at line 1529 of file class.ilObjStudyProgramme.php.

1529 : array
1530 {
1531 return $this->auto_categories_repository->readFor($this->getId());
1532 }

◆ getAutomaticMembershipSources()

ilObjStudyProgramme::getAutomaticMembershipSources ( )

Get sources for auto-memberships.

Returns
ilStudyProgrammeAutoMembershipSource[]

Definition at line 1658 of file class.ilObjStudyProgramme.php.

1658 : array
1659 {
1660 return $this->auto_memberships_repository->readFor($this->getId());
1661 }

◆ getChildren()

ilObjStudyProgramme::getChildren ( bool  $include_references = false)

Get all ilObjStudyProgrammes that are direct children of this object.

Returns
ilObjStudyProgramme[]
Exceptions
ilStudyProgrammeTreeExceptionwhen this object is not in tree.

Definition at line 626 of file class.ilObjStudyProgramme.php.

626 : array
627 {
628 $this->throwIfNotInTree();
629
630 if ($this->children === null) {
631 $ref_ids = $this->tree->getChildsByType($this->getRefId(), "prg");
632
633 // apply container sorting to tree
634 $sorting = ilContainerSorting::_getInstance($this->getId());
635 $ref_ids = $sorting->sortItems(array('prg' => $ref_ids));
636 $ref_ids = $ref_ids['prg'];
637
638 $this->children = array_map(function ($node_data) {
639 return ilObjStudyProgramme::getInstanceByRefId($node_data["child"]);
640 }, $ref_ids);
641 }
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) {
646 $ref_child_ref_ids =
647 array_merge(
648 $this->tree->getChildsByType($prg->getRefId(), "prgr"),
649 $ref_child_ref_ids
650 );
651 }
652 foreach (
653 array_unique(
654 array_map(
655 function ($data) {
656 return $data['child'];
657 },
658 array_filter($ref_child_ref_ids, function ($data) {
659 return $data["deleted"] === null;
660 })
661 )
662 ) as $prg_ref_id
663 ) {
664 $this->reference_children[] =
665 (new ilObjStudyProgrammeReference($prg_ref_id))->getReferencedObject();
666 }
667 }
668 return $include_references ?
669 array_merge($this->children, $this->reference_children) :
670 $this->children;
671 }
static _getInstance($a_obj_id)
get instance by obj_id
$data
Definition: storeScorm.php:23

References $data, ilContainerSorting\_getInstance(), and getInstanceByRefId().

Referenced by ilStudyProgrammeUserProgress\getChildrenProgress(), and ilStudyProgrammeUserProgress\getNamesOfCompletedOrAccreditedChildren().

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

◆ getCompletedCourses()

ilObjStudyProgramme::getCompletedCourses ( int  $a_user_id)

Get courses in this program that the given user already completed.

Returns
int[]

Definition at line 908 of file class.ilObjStudyProgramme.php.

908 : array
909 {
910 require_once("Services/ContainerReference/classes/class.ilContainerReference.php");
911 require_once("Services/Tracking/classes/class.ilLPStatus.php");
912
913 $node_data = $this->tree->getNodeData($this->getRefId());
914 $crsrs = $this->tree->getSubTree($node_data, true, "crsr");
915
916 $completed_crss = array();
917 foreach ($crsrs as $ref) {
918 $crs_id = ilContainerReference::_lookupTargetId($ref["obj_id"]);
919 if (ilLPStatus::_hasUserCompleted($crs_id, $a_user_id)) {
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"]
924 , "title" => ilContainerReference::_lookupTargetTitle($ref["obj_id"])
925 );
926 }
927 }
928
929 return $completed_crss;
930 }
static _lookupTargetId($a_obj_id)
lookup target id
static _lookupTargetTitle($a_obj_id)
Lookup target title.
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.

References ilLPStatus\_hasUserCompleted(), ilContainerReference\_lookupTargetId(), and ilContainerReference\_lookupTargetTitle().

+ Here is the call graph for this function:

◆ getCreatableSubObjects()

static ilObjStudyProgramme::getCreatableSubObjects ( array  $a_subobjects,
  $a_ref_id 
)
static

Filter the list of possible subobjects for the objects that actually could be created on a concrete node.

Will be called by ilObjDefinition::getCreatableSubObjects.

@thorws ilException

Parameters
string[]$a_subobjects

Definition at line 1971 of file class.ilObjStudyProgramme.php.

1971 : array
1972 {
1973 if ($a_ref_id === null) {
1974 return $a_subobjects;
1975 }
1976
1977 if (ilObject::_lookupType($a_ref_id, true) != "prg") {
1978 throw new ilException("Ref-Id '$a_ref_id' does not belong to a study programme object.");
1979 }
1980
1982
1983 $mode = $parent->getLPMode();
1984
1985 switch ($mode) {
1987 $possible_subobjects = $a_subobjects;
1988 break;
1990 $possible_subobjects = [
1991 "prg" => $a_subobjects["prg"],
1992 "prgr" => $a_subobjects["prgr"]
1993 ];
1994 break;
1996 $possible_subobjects = ['crsr' => $a_subobjects['crsr']];
1997 break;
1998 default:
1999 throw new ilException("Undefined mode for study programme: '$mode'");
2000 }
2001
2002 if ($parent->hasAutomaticContentCategories()) {
2003 $possible_subobjects = array_filter(
2004 $possible_subobjects,
2005 function ($subtype) {
2006 return $subtype === 'crsr';
2007 },
2008 ARRAY_FILTER_USE_KEY
2009
2010 );
2011 }
2012 return $possible_subobjects;
2013 }
static _lookupType($a_id, $a_reference=false)
lookup object type

References ilObject\_lookupType(), getInstanceByRefId(), ilStudyProgrammeSettings\MODE_LP_COMPLETED, ilStudyProgrammeSettings\MODE_POINTS, and ilStudyProgrammeSettings\MODE_UNDEFINED.

Referenced by ilObjectDefinition\getCreatableSubObjects(), ilObjStudyProgrammeTest\testCreatableSubObjectsRaisesOnNonProgramRef(), ilObjStudyProgrammeTest\testCreatableSubObjectsWithoutRef(), and ilObjStudyProgrammeTest\testCreateableSubObjects().

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

◆ getDeadlineSettings()

ilObjStudyProgramme::getDeadlineSettings ( )

Definition at line 511 of file class.ilObjStudyProgramme.php.

References settings().

Referenced by assignUser(), and ilStudyProgrammeChangeDeadlineGUI\getDeadlineSubForm().

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

◆ getDepth()

ilObjStudyProgramme::getDepth ( )

Get the depth of this StudyProgramme in the tree starting at the topmost StudyProgramme (not root node of the repo tree!).

Root node has depth = 0.

Returns
int
Exceptions
ilExceptionwhen this object is not in tree.

Definition at line 780 of file class.ilObjStudyProgramme.php.

780 : int
781 {
782 $cur = $this;
783 $count = 0;
784 while ($cur = $cur->getParent()) {
785 $count++;
786 }
787 return $count;
788 }

◆ getIdsFromNodesOnPathFromRootToHere()

ilObjStudyProgramme::getIdsFromNodesOnPathFromRootToHere ( bool  $include_references = false)
protected

Get the ids from the nodes in the path leading from the root node of this program to this node, including the id of this node.

Returns
int[]

Definition at line 1822 of file class.ilObjStudyProgramme.php.

1822 : array
1823 {
1824 $prg_ids = array_map(function ($par) {
1825 return $par->getId();
1826 }, $this->getParents($include_references));
1827 $prg_ids[] = $this->getId();
1828 return $prg_ids;
1829 }
getParents(bool $include_references=false)
Get all parents of the node, where the root of the program comes first.

◆ getIdsOfUsersWithCompletedProgress()

ilObjStudyProgramme::getIdsOfUsersWithCompletedProgress ( )

Get the ids of all users that have completed this programme.

Returns
int[]

Definition at line 1473 of file class.ilObjStudyProgramme.php.

1473 : array
1474 {
1475 $returns = array();
1476 foreach ($this->getProgresses() as $progress) {
1477 $progress->recalculateFailedToDeadline();
1478 if ($progress->isSuccessful() && !$progress->isSuccessfulExpired()) {
1479 $returns[] = $progress->getUserId();
1480 }
1481 }
1482 return array_unique($returns);
1483 }

◆ getIdsOfUsersWithFailedProgress()

ilObjStudyProgramme::getIdsOfUsersWithFailedProgress ( )

Get the ids of all users that have failed this programme.

Returns
int[]

Definition at line 1490 of file class.ilObjStudyProgramme.php.

1490 : array
1491 {
1492 $returns = array();
1493 foreach ($this->getProgresses() as $progress) {
1494 $progress->recalculateFailedToDeadline();
1495 if ($progress->isFailed() || $progress->isSuccessfulExpired()) {
1496 $returns[] = $progress->getUserId();
1497 }
1498 }
1499 return array_unique(array_diff($returns, $this->getIdsOfUsersWithCompletedProgress()));
1500 }
getIdsOfUsersWithCompletedProgress()
Get the ids of all users that have completed this programme.

◆ getIdsOfUsersWithNotCompletedAndRelevantProgress()

ilObjStudyProgramme::getIdsOfUsersWithNotCompletedAndRelevantProgress ( )

Get the ids of all users that have not completed this programme but have a relevant progress on it.

Returns
int[]

Definition at line 1509 of file class.ilObjStudyProgramme.php.

1509 : array
1510 {
1511 $returns = array();
1512 foreach ($this->getProgresses() as $progress) {
1513 if ($progress->isRelevant() && !$progress->isSuccessful()) {
1514 $returns[] = $progress->getUserId();
1515 }
1516 }
1517 return array_unique($returns);
1518 }

◆ getIdsOfUsersWithRelevantProgress()

ilObjStudyProgramme::getIdsOfUsersWithRelevantProgress ( )

Get the ids of all users that have a relevant progress at this programme.

Returns
int[]

Definition at line 1457 of file class.ilObjStudyProgramme.php.

1457 : array
1458 {
1459 $returns = array();
1460 foreach ($this->getProgresses() as $progress) {
1461 if ($progress->isRelevant()) {
1462 $returns[] = $progress->getUserId();
1463 }
1464 }
1465 return array_unique($returns);
1466 }

◆ getInstanceByRefId()

static ilObjStudyProgramme::getInstanceByRefId (   $a_ref_id)
static

Definition at line 213 of file class.ilObjStudyProgramme.php.

214 {
215 if (self::$study_programme_cache === null) {
217 }
218 return self::$study_programme_cache->getInstanceByRefId($a_ref_id);
219 }

References initStudyProgrammeCache().

Referenced by ilStudyProgrammeMembersTableGUI\__construct(), ilObjStudyProgrammeAccess\_checkAccess(), ilObjStudyProgrammeReferenceAccess\_checkAccess(), getChildren(), getCreatableSubObjects(), ilObjStudyProgrammeAutoCategoriesGUI\getObject(), ilObjStudyProgrammeAutoMembershipsGUI\getObject(), ilObjStudyProgrammeSettingsGUI\getObject(), ilStudyProgrammeChangeDeadlineGUI\getObject(), ilStudyProgrammeChangeExpireDateGUI\getObject(), getParent(), ilObjStudyProgrammeReference\getParent(), ilObjStudyProgrammeReference\getReferencedObject(), ilObjStudyProgrammeTreeExplorerGUI\getRootNode(), ilStudyProgrammeAppEventListener\getStudyProgramme(), ilStudyProgrammeUserAssignment\getStudyProgramme(), ilStudyProgrammeUserProgress\getStudyProgramme(), ilObjStudyProgrammeMembersGUI\getStudyProgramme(), putInTree(), ilObjStudyProgrammeReference\putInTree(), sendInvalidateMail(), ilObjStudyProgrammeMembersGUI\setRefId(), ilObjStudyProgrammeTest\testDelete(), ilObjStudyProgrammeTest\testGetInstanceByRefId(), ilObjStudyProgrammeTest\testLoadByObjId(), ilObjStudyProgrammeTest\testSettings(), and ilStudyProgrammeType\updateAssignedStudyProgrammesIcons().

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

◆ getLastChange()

ilObjStudyProgramme::getLastChange ( )

Get the timestamp of the last change on this program or sub program.

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

393 : DateTime
394 {
395 return $this->settings->getLastChange();
396 }

References settings().

+ Here is the call graph for this function:

◆ getLog()

ilObjStudyProgramme::getLog ( )
protected

Definition at line 2097 of file class.ilObjStudyProgramme.php.

2098 {
2099 return ilLoggerFactory::getLogger($this->type);
2100 }
static getLogger($a_component_id)
Get component logger.

References ilLoggerFactory\getLogger().

+ Here is the call graph for this function:

◆ getLPChildren()

ilObjStudyProgramme::getLPChildren ( )

Get the leafs the study programme contains.

Returns
ilStudyProgrammeLeaf[]
Exceptions
ilStudyProgrammeTreeExceptionwhen this object is not in tree.

Definition at line 808 of file class.ilObjStudyProgramme.php.

809 {
810 $this->throwIfNotInTree();
811
812 if ($this->lp_children === null) {
813 $this->lp_children = array();
814
815 // TODO: find a better way to get all elements except StudyProgramme-children
816 $ref_ids = $this->tree->getChildsByType($this->getRefId(), "crsr");
817
818 // apply container sorting to tree
819 $sorting = ilContainerSorting::_getInstance($this->getId());
820 $ref_ids = $sorting->sortItems(array('crs_ref' => $ref_ids));
821 $ref_ids = $ref_ids['crs_ref'];
822
823 $lp_children = array_map(function ($node_data) {
824 $lp_obj = $this->object_factory->getInstanceByRefId($node_data["child"]);
825
826 // filter out all StudyProgramme instances
827 return ($lp_obj instanceof $this) ? null : $lp_obj;
828 }, $ref_ids);
829
830 $this->lp_children = array_filter($lp_children);
831 }
832 return $this->lp_children;
833 }

References ilContainerSorting\_getInstance().

+ Here is the call graph for this function:

◆ getLPChildrenIds()

ilObjStudyProgramme::getLPChildrenIds ( )

Get the ids of the leafs the program contains.

Returns
ilStudyProgrammeLeaf[]
Exceptions
ilStudyProgrammeTreeException

Definition at line 841 of file class.ilObjStudyProgramme.php.

842 {
843 return array_map(function ($child) {
844 return $child->getId();
845 }, $this->getLPChildren());
846 }

◆ getLPMode()

ilObjStudyProgramme::getLPMode ( )

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

420 : int
421 {
422 return $this->settings->getLPMode();
423 }

References settings().

Referenced by ilStudyProgrammeUserProgress\getChildrenProgress().

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

◆ getMembers()

ilObjStudyProgramme::getMembers ( )
Returns
int[] | null

Definition at line 1297 of file class.ilObjStudyProgramme.php.

1298 {
1299 if (!$this->members_cache) {
1300 $this->members_cache = array_map(
1301 function ($assignment) {
1302 return $assignment->getUserId();
1303 },
1304 $this->assignment_repository->readByPrgId($this->getId())
1305 );
1306 }
1307 return $this->members_cache;
1308 }

Referenced by ilStudyProgrammePositionBasedAccess\getUsersInPrgAccessibleForOperation().

+ Here is the caller graph for this function:

◆ getMembersOfMembershipSource()

ilObjStudyProgramme::getMembersOfMembershipSource ( string  $src_type,
int  $src_id 
)
protected

Get member-ids of a certain source.

Returns
int[]
Exceptions
InvalidArgumentExceptionif $src_type is not in AutoMembershipSource-types

Definition at line 1720 of file class.ilObjStudyProgramme.php.

1720 : array
1721 {
1722 $source_reader = $this->membersourcereader_factory->getReaderFor($src_type, $src_id);
1723 return $source_reader->getMemberIds();
1724 }

◆ getParent()

ilObjStudyProgramme::getParent ( )

Get the parent ilObjStudyProgramme of this object.

Returns null if parent is no StudyProgramme.

Returns
ilObjStudyProgramme | null
Exceptions
ilExceptionwhen this object is not in tree.

Definition at line 680 of file class.ilObjStudyProgramme.php.

681 {
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;
687 } else {
688 $this->parent = ilObjStudyProgramme::getInstanceByRefId($parent_data["ref_id"]);
689 }
690 }
691 return $this->parent;
692 }

References getInstanceByRefId().

Referenced by ilStudyProgrammeUserProgress\getParentProgresses(), and removeNode().

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

◆ getParentId()

static ilObjStudyProgramme::getParentId ( ilObject  $a_object)
staticprotected

Get the obj id of the parent object for the given object.

Returns null if object is not in the tree currently.

Returns
int | null

Definition at line 1907 of file class.ilObjStudyProgramme.php.

1908 {
1909 global $DIC;
1910 $tree = $DIC['tree'];
1911 if (!$tree->isInTree($a_object->getRefId())) {
1912 return null;
1913 }
1914
1915 $nd = $tree->getParentNodeData($a_object->getRefId());
1916 return $nd["obj_id"];
1917 }
$nd
Definition: error.php:12

References $DIC, $nd, and ilObject\getRefId().

+ Here is the call graph for this function:

◆ getParents()

ilObjStudyProgramme::getParents ( bool  $include_references = false)

Get all parents of the node, where the root of the program comes first.

Returns
ilObjStudyProgramme[]

Definition at line 724 of file class.ilObjStudyProgramme.php.

725 {
726 $current = $this;
727 $parents = [];
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())) {
734 continue;
735 }
736 $r_parent = $reference->getParent();
737 if (is_null($r_parent)) {
738 continue;
739 }
740 array_push($queque, $r_parent);
741 $parents[] = $r_parent;
742 }
743 continue;
744 }
745 array_push($queque, $parent);
746 $parents[] = $parent;
747 }
748 return array_reverse($parents);
749 }
getReferencesTo(ilObjStudyProgramme $prg)

◆ getPoints()

ilObjStudyProgramme::getPoints ( )

Get the amount of points.

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

401 : int
402 {
403 return $this->settings->getAssessmentSettings()->getPoints();
404 }

References settings().

Referenced by ilStudyProgrammeDashboardViewGUI\calculatePercent().

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

◆ getPositionSettingsIsActiveForPrg()

ilObjStudyProgramme::getPositionSettingsIsActiveForPrg ( )

Definition at line 542 of file class.ilObjStudyProgramme.php.

542 : bool
543 {
544 return $this->ps->isActive();
545 }

◆ getPositionSettingsIsChangeableForPrg()

ilObjStudyProgramme::getPositionSettingsIsChangeableForPrg ( )

Definition at line 547 of file class.ilObjStudyProgramme.php.

547 : bool
548 {
549 return $this->ps->isChangeableForObject();
550 }

◆ getProgrammesMonitoringCategory()

static ilObjStudyProgramme::getProgrammesMonitoringCategory ( int  $cat_ref_id)
staticprotected

Get all StudyProgrammes monitoring this category.

Returns
ilObjStudyProgramme[]

Definition at line 1608 of file class.ilObjStudyProgramme.php.

1608 : array
1609 {
1610 $db = ilStudyProgrammeDIC::dic()['model.AutoCategories.ilStudyProgrammeAutoCategoriesRepository'];
1611 $programmes = array_map(
1612 function ($rec) {
1613 $prg_obj_id = (int) array_shift(array_values($rec));
1614 $prg_ref_id = (int) array_shift(ilObject::_getAllReferences($prg_obj_id));
1615 $prg = self::getInstanceByRefId($prg_ref_id);
1616 if ($prg->isAutoContentApplicable()) {
1617 return $prg;
1618 }
1619 },
1620 $db::getProgrammesFor($cat_ref_id)
1621 );
1622 return $programmes;
1623 }
static _getAllReferences($a_id)
get all reference ids of object

References ilObject\_getAllReferences(), and ilStudyProgrammeDIC\dic().

+ Here is the call graph for this function:

◆ getProgrammesMonitoringMemberSource()

static ilObjStudyProgramme::getProgrammesMonitoringMemberSource ( string  $src_type,
int  $src_id 
)
staticprotected

Get all StudyProgrammes monitoring this membership-source.

Returns
ilObjStudyProgramme[]

Definition at line 1731 of file class.ilObjStudyProgramme.php.

1731 : array
1732 {
1733 $db = ilStudyProgrammeDIC::dic()['model.AutoMemberships.ilStudyProgrammeAutoMembershipsRepository'];
1734 $programmes = array_map(
1735 function ($rec) {
1736 $prg_obj_id = (int) array_shift(array_values($rec));
1737 $prg_ref_id = (int) array_shift(ilObject::_getAllReferences($prg_obj_id));
1738 $prg = self::getInstanceByRefId($prg_ref_id);
1739 return $prg;
1740 },
1741 $db::getProgrammesFor($src_type, $src_id)
1742 );
1743 return $programmes;
1744 }

References ilObject\_getAllReferences(), and ilStudyProgrammeDIC\dic().

+ Here is the call graph for this function:

◆ getProgresses()

ilObjStudyProgramme::getProgresses ( )

Get all progresses on this node.

Returns
ilStudyProgrammeUserProgress[]

Definition at line 1426 of file class.ilObjStudyProgramme.php.

1426 : array
1427 {
1428 return $this->progress_db->getInstancesForProgram($this->getId());
1429 }

◆ getProgressesOf()

ilObjStudyProgramme::getProgressesOf ( int  $a_user_id)

Get the progresses the user has on this node.

Parameters
int$a_user_id
Returns
ilStudyProgrammeUserProgress[]

Definition at line 1368 of file class.ilObjStudyProgramme.php.

1368 : array
1369 {
1370 return $this->progress_db->getInstancesForUser($this->getId(), $a_user_id);
1371 }

Referenced by ilStudyProgrammeMailTemplateContext\getNewestProgressForUser().

+ Here is the caller graph for this function:

◆ getProgressForAssignment()

ilObjStudyProgramme::getProgressForAssignment ( int  $a_assignment_id)

Get the progress for an assignment on this node.

Throws when assignment does not belong to this program.

Parameters
int$a_assignment_id
Returns
ilStudyProgrammeUserProgress
Exceptions
ilException

Definition at line 1382 of file class.ilObjStudyProgramme.php.

1383 {
1384 return $this->progress_db->getInstanceForAssignment($this->getId(), $a_assignment_id);
1385 }
Represents the progress of a user at one node of a study programme.

◆ getRawSettings()

ilObjStudyProgramme::getRawSettings ( )

Get the underlying model of this program.

ATTENTION: Only use the model object if you know what you are doing.

Returns
ilStudyProgrammeSettings | null

Definition at line 1926 of file class.ilObjStudyProgramme.php.

1927 {
1928 return $this->settings;
1929 }

◆ getReferencesTo()

ilObjStudyProgramme::getReferencesTo ( ilObjStudyProgramme  $prg)
protected

Definition at line 694 of file class.ilObjStudyProgramme.php.

694 : array
695 {
697 return array_filter(
698 array_map(
699 function ($id) {
701 array_shift(
703 )
704 );
705 },
707 ),
708 function ($prg_ref) use ($tree) {
709 return !$tree->isDeleted($prg_ref->getRefId());
710 }
711 );
712 }
static _lookupSourceIds($a_target_id)
Get ids of all container references that target the object with the given id.

References ilObject\_getAllReferences(), ilContainerReference\_lookupSourceIds(), and ilObject\getId().

+ Here is the call graph for this function:

◆ getReferencesToSelf()

ilObjStudyProgramme::getReferencesToSelf ( )

Definition at line 714 of file class.ilObjStudyProgramme.php.

714 : array
715 {
716 return $this->getReferencesTo($this);
717 }

Referenced by ilStudyProgrammeUserProgress\getParentProgresses().

+ Here is the caller graph for this function:

◆ getRoot()

ilObjStudyProgramme::getRoot ( )

Get the ilObjStudyProgramme that is the root node of the tree this programme is in.

Returns
ilObjStudyProgramme

Definition at line 796 of file class.ilObjStudyProgramme.php.

797 {
798 $parents = $this->getParents();
799 return $parents[0];
800 }

◆ getStatus()

ilObjStudyProgramme::getStatus ( )

Definition at line 452 of file class.ilObjStudyProgramme.php.

452 : int
453 {
454 return $this->getAssessmentSettings()->getStatus();
455 }

References getAssessmentSettings().

Referenced by assignUser(), and isActive().

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

◆ getSubType()

ilObjStudyProgramme::getSubType ( )

Gets the SubType Object.

Returns
ilStudyProgrammeType | null

Definition at line 480 of file class.ilObjStudyProgramme.php.

481 {
482 if (!in_array($this->getTypeSettings()->getTypeId(), array("-", "0"))) {
483 $subtype_id = $this->getTypeSettings()->getTypeId();
484 return $this->type_repository->readType($subtype_id);
485 }
486
487 return null;
488 }

References getTypeSettings().

+ Here is the call graph for this function:

◆ getTypeSettings()

ilObjStudyProgramme::getTypeSettings ( )

Definition at line 490 of file class.ilObjStudyProgramme.php.

491 {
492 return $this->settings->getTypeSettings();
493 }

References settings().

Referenced by ilObjStudyProgrammeSettingsGUI\buildForm(), getSubType(), and update().

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

◆ getValidityOfQualificationSettings()

ilObjStudyProgramme::getValidityOfQualificationSettings ( )

Definition at line 521 of file class.ilObjStudyProgramme.php.

References settings().

Referenced by ilStudyProgrammeChangeExpireDateGUI\getValidityOfQualificationSubForm().

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

◆ hasAssignmentOf()

ilObjStudyProgramme::hasAssignmentOf ( int  $a_user_id)

Check whether user is assigned to this program or any node above.

Definition at line 1238 of file class.ilObjStudyProgramme.php.

1238 : bool
1239 {
1240 return $this->getAmountOfAssignmentsOf($a_user_id) > 0;
1241 }
getAmountOfAssignmentsOf(int $a_user_id)
Get the amount of assignments a user has on this program node or any node above.

◆ hasAssignments()

ilObjStudyProgramme::hasAssignments ( )

Are there any assignments on this node or any node above?

Definition at line 1313 of file class.ilObjStudyProgramme.php.

1313 : bool
1314 {
1315 return count($this->getAssignments()) > 0;
1316 }

◆ hasAssignmentsOfSingleProgramForUser()

ilObjStudyProgramme::hasAssignmentsOfSingleProgramForUser ( int  $usr_id)

Get assignments of user to this program-node only.

Definition at line 1344 of file class.ilObjStudyProgramme.php.

1344 : bool
1345 {
1346 return count($this->getAssignmentsOfSingleProgramForUser($usr_id)) > 0;
1347 }

◆ hasAutomaticContentCategories()

ilObjStudyProgramme::hasAutomaticContentCategories ( )

Definition at line 1534 of file class.ilObjStudyProgramme.php.

1534 : bool
1535 {
1536 return count($this->getAutomaticContentCategories()) > 0;
1537 }
getAutomaticContentCategories()
Get configuration of categories with auto-content for this StudyProgramme;.

◆ hasChildren()

ilObjStudyProgramme::hasChildren ( bool  $include_references = false)

Does this StudyProgramme have other ilObjStudyProgrammes as children?

Exceptions
ilStudyProgrammeTreeException

Definition at line 756 of file class.ilObjStudyProgramme.php.

756 : bool
757 {
758 return $this->getAmountOfChildren($include_references) > 0;
759 }

◆ hasLPChildren()

ilObjStudyProgramme::hasLPChildren ( )

Does this StudyProgramme has leafs?

Throws when this object is not in tree.

Returns
bool

Definition at line 865 of file class.ilObjStudyProgramme.php.

866 {
867 return ($this->getAmountOfLPChildren() > 0);
868 }

Referenced by ilStudyProgrammeDashboardViewGUI\calculatePercent().

+ Here is the caller graph for this function:

◆ hasProgresses()

ilObjStudyProgramme::hasProgresses ( )

Are there any users that have a progress on this programme?

Definition at line 1434 of file class.ilObjStudyProgramme.php.

1434 : bool
1435 {
1436 return count($this->getProgresses()) > 0;
1437 }

◆ hasRelevantProgresses()

ilObjStudyProgramme::hasRelevantProgresses ( )

Are there any users that have a relevant progress on this programme?

Definition at line 1442 of file class.ilObjStudyProgramme.php.

1442 : bool
1443 {
1444 foreach ($this->getProgresses() as $progress) {
1445 if ($progress->isRelevant()) {
1446 return true;
1447 }
1448 }
1449 return false;
1450 }

◆ initStudyProgrammeCache()

static ilObjStudyProgramme::initStudyProgrammeCache ( )
static

Definition at line 181 of file class.ilObjStudyProgramme.php.

181 : void
182 {
183 if (self::$study_programme_cache === null) {
184 self::$study_programme_cache = ilObjStudyProgrammeCache::singleton();
185 }
186 }

References ilObjStudyProgrammeCache\singleton().

Referenced by __construct(), and getInstanceByRefId().

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

◆ isActive()

ilObjStudyProgramme::isActive ( )

Definition at line 470 of file class.ilObjStudyProgramme.php.

470 : bool
471 {
473 }

References getStatus(), and ilStudyProgrammeSettings\STATUS_ACTIVE.

+ Here is the call graph for this function:

◆ isAutoContentApplicable()

ilObjStudyProgramme::isAutoContentApplicable ( )

AutoContent should only be available in active- or draft-mode, and only, if there is no sub-programme.

Exceptions
ilStudyProgrammeTreeException

Definition at line 1631 of file class.ilObjStudyProgramme.php.

1631 : bool
1632 {
1633 $valid_status = in_array(
1634 $this->settings->getAssessmentSettings()->getStatus(),
1635 [
1638 ]
1639 );
1640
1641 $crslnk_allowed = (
1642 $this->hasLPChildren()
1643 || $this->getAmountOfChildren(true) === 0
1644 );
1645
1646 return $valid_status && $crslnk_allowed;
1647 }
hasLPChildren()
Does this StudyProgramme has leafs?

References settings(), ilStudyProgrammeSettings\STATUS_ACTIVE, and ilStudyProgrammeSettings\STATUS_DRAFT.

+ Here is the call graph for this function:

◆ moveTo()

ilObjStudyProgramme::moveTo ( ilObjStudyProgramme  $a_new_parent)

Move this tree node to a new parent.

Throws when manipulation of tree is not allowed due to invariants that need to hold on the tree.

Exceptions
ilStudyProgrammeTreeException
ilException

Definition at line 1113 of file class.ilObjStudyProgramme.php.

1114 {
1115 global $DIC;
1116 $rbacadmin = $DIC['rbacadmin'];
1117
1118 if ($parent = $this->getParent()) {
1119
1120 // TODO: check if there some leafs in the new parent
1121
1122 $this->tree->moveTree($this->getRefId(), $a_new_parent->getRefId());
1123 // necessary to clean up permissions
1124 $rbacadmin->adjustMovedObjectPermissions($this->getRefId(), $parent->getRefId());
1125
1126 // TODO: lp-progress needs to be updated
1127
1128 // clear caches on different nodes
1129 $this->clearParentCache();
1130
1131 $parent->clearChildrenCache();
1132 $parent->clearLPChildrenCache();
1133
1134 $a_new_parent->clearChildrenCache();
1135 $a_new_parent->clearLPChildrenCache();
1136 }
1137
1138 return $this;
1139 }
getParent()
Get the parent ilObjStudyProgramme of this object.

References $DIC, clearChildrenCache(), clearLPChildrenCache(), and ilObject\getRefId().

+ Here is the call graph for this function:

◆ nodeInserted()

ilObjStudyProgramme::nodeInserted ( ilObjStudyProgramme  $a_prg)

Clears child chache and adds progress for new node.

Exceptions
ilStudyProgrammeTreeException
ilException

Definition at line 971 of file class.ilObjStudyProgramme.php.

972 {
974 throw new ilStudyProgrammeTreeException("Program already contains leafs.");
975 }
976
977 if ($this->settings->getLPMode() !== ilStudyProgrammeSettings::MODE_POINTS) {
978 $this->settings_repository->update(
980 );
981 }
982
983 $this->clearChildrenCache();
984 $this->addMissingProgresses();
985 }
addMissingProgresses()
Add missing progress records for all assignments of this programm.

References ilStudyProgrammeSettings\MODE_LP_COMPLETED, ilStudyProgrammeSettings\MODE_POINTS, and settings().

+ Here is the call graph for this function:

◆ putInTree()

ilObjStudyProgramme::putInTree (   $a_parent_ref)

Overwritten from ilObject.

Calls nodeInserted on parent object if parent object is another program.

Parameters
int$a_parent_ref
Exceptions
ilStudyProgrammeTreeException
ilException

Reimplemented from ilContainer.

Definition at line 996 of file class.ilObjStudyProgramme.php.

997 {
998 $res = parent::putInTree($a_parent_ref);
999
1000 if (ilObject::_lookupType($a_parent_ref, true) == "prg") {
1001 $par = ilObjStudyProgramme::getInstanceByRefId($a_parent_ref);
1002 $par->nodeInserted($this);
1003 }
1004
1005 return $res;
1006 }
foreach($_POST as $key=> $value) $res

References $res, ilObject\_lookupType(), and getInstanceByRefId().

Referenced by addNode().

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

◆ read()

ilObjStudyProgramme::read ( )
Exceptions
ilException

Reimplemented from ilContainer.

Definition at line 321 of file class.ilObjStudyProgramme.php.

321 : void
322 {
323 parent::read();
324 $this->readSettings();
325 }
readSettings()
Load Settings from DB.

References readSettings().

+ Here is the call graph for this function:

◆ readSettings()

ilObjStudyProgramme::readSettings ( )
protected

Load Settings from DB.

Throws when settings are already loaded or id is null.

Exceptions
ilExceptionif settings are already loaded
ilExceptionif there is no oid to load settings

Definition at line 246 of file class.ilObjStudyProgramme.php.

246 : void
247 {
248 if ($this->settings !== null) {
249 throw new ilException("ilObjStudyProgramme::loadSettings: already loaded.");
250 }
251 $id = $this->getId();
252 if (!$id) {
253 throw new ilException("ilObjStudyProgramme::loadSettings: no id.");
254 }
255 $this->settings = $this->settings_repository->read($this->getId());
256 }

References ilObject\$id, ilObject\getId(), and settings().

Referenced by read().

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

◆ removeAssignment()

ilObjStudyProgramme::removeAssignment ( ilStudyProgrammeUserAssignment  $a_assignment)

Remove an assignment from this program.

Throws when assignment doesn't have this program as root node.

Exceptions
ilException

Definition at line 1217 of file class.ilObjStudyProgramme.php.

1218 {
1219 $this->members_cache = null;
1220 if ($a_assignment->getStudyProgramme()->getId() != $this->getId()) {
1221 throw new ilException(
1222 "ilObjStudyProgramme::removeAssignment: Assignment '"
1223 . $a_assignment->getId() . "' does not belong to study "
1224 . "program '" . $this->getId() . "'."
1225 );
1226 }
1227
1228 $this->events->userDeassigned($a_assignment);
1229
1230 $a_assignment->delete();
1231
1232 return $this;
1233 }
getStudyProgramme()
Get the program node where this assignment was made.
delete()
Delete the assignment from database.

References ilStudyProgrammeUserAssignment\delete(), ilStudyProgrammeUserAssignment\getId(), and ilStudyProgrammeUserAssignment\getStudyProgramme().

+ Here is the call graph for this function:

◆ removeCrsFromProgrammes()

static ilObjStudyProgramme::removeCrsFromProgrammes ( int  $crs_ref_id,
int  $cat_ref_id 
)
static

Check, if a category is under surveilllance and automatically remove the deleted course.

Exceptions
ilStudyProgrammeTreeException

Definition at line 1593 of file class.ilObjStudyProgramme.php.

1594 {
1595 foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1596 foreach ($prg->getLPChildren() as $child) {
1597 if ((int) $child->getTargetRefId() === $crs_ref_id) {
1598 $child->delete();
1599 }
1600 }
1601 }
1602 }

Referenced by ilStudyProgrammeAppEventListener\removeCrsFromProgrammes().

+ Here is the caller graph for this function:

◆ removeLeaf()

ilObjStudyProgramme::removeLeaf ( ilStudyProgrammeLeaf  $a_leaf)

Remove a leaf from this object.

Throws when leaf is not a child of this object. Throws when manipulation of tree is not allowed due to invariants that need to hold on the tree.

Exceptions
ilException
ilStudyProgrammeTreeException

Definition at line 1091 of file class.ilObjStudyProgramme.php.

1092 {
1093 if (self::getParentId($a_leaf) !== $this->getId()) {
1094 throw new ilStudyProgrammeTreeException("This is no parent of the given leaf node.");
1095 }
1096
1097 $node_data = $this->tree->getNodeData($a_leaf->getRefId());
1098 $this->tree->deleteTree($node_data);
1099 $this->clearLPChildrenCache();
1100
1101 return $this;
1102 }

References ilStudyProgrammeLeaf\getRefId().

+ Here is the call graph for this function:

◆ removeMemberFromProgrammes()

static ilObjStudyProgramme::removeMemberFromProgrammes ( string  $src_type,
int  $src_id,
int  $usr_id 
)
static

Definition at line 1756 of file class.ilObjStudyProgramme.php.

1756 : void
1757 {
1758 foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1759 foreach ($prg->getProgressesOf($usr_id) as $progress) {
1760 if ($progress->getStatus() !== ilStudyProgrammeProgress::STATUS_IN_PROGRESS) {
1761 continue;
1762 }
1763 $assignments = $prg->getAssignmentsOfSingleProgramForUser($usr_id);
1764 $next_membership_source = $prg->getApplicableMembershipSourceForUser($usr_id, $src_type);
1765
1766 foreach ($assignments as $assignment) {
1767 if (!is_null($next_membership_source)) {
1768 $new_src_type = $next_membership_source->getSourceType();
1769 $assigned_by = ilStudyProgrammeAutoMembershipSource::SOURCE_MAPPING[$new_src_type];
1770 $assignment = $assignment->setLastChangeBy($assigned_by);
1771 $prg->assignment_repository->update($assignment);
1772 break;
1773 } else {
1774 $assignment_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserAssignmentDB'];
1775 $user_assignment = $assignment_db->getInstanceByModel($assignment);
1776 $prg->removeAssignment($user_assignment);
1777 }
1778 }
1779 }
1780 }
1781 }

References ilStudyProgrammeDIC\dic(), ilStudyProgrammeAutoMembershipSource\SOURCE_MAPPING, and ilStudyProgrammeProgress\STATUS_IN_PROGRESS.

Referenced by ilStudyProgrammeAppEventListener\removeMemberFromProgrammes().

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

◆ removeNode()

ilObjStudyProgramme::removeNode ( ilObjStudyProgramme  $a_prg)

Remove a node from this object.

Throws when node is no child of the object. Throws when manipulation of tree is not allowed due to invariants that need to hold on the tree.

Exceptions
ilException
ilStudyProgrammeTreeException

Definition at line 1017 of file class.ilObjStudyProgramme.php.

1018 {
1019 if ($a_prg->getParent()->getId() !== $this->getId()) {
1020 throw new ilStudyProgrammeTreeException("This is no parent of the given programm.");
1021 }
1022
1023 if (!$a_prg->canBeRemoved()) {
1024 throw new ilStudyProgrammeTreeException("The node has relevant assignments.");
1025 }
1026
1027 // *sigh*...
1028 $node_data = $this->tree->getNodeData($a_prg->getRefId());
1029 $this->tree->deleteTree($node_data);
1030 $a_prg->clearParentCache();
1031 $this->clearChildrenCache();
1032
1033 return $this;
1034 }
canBeRemoved()
Check weather a node can be removed.

References canBeRemoved(), clearParentCache(), getParent(), and ilObject\getRefId().

+ Here is the call graph for this function:

◆ sendInvalidateMail()

static ilObjStudyProgramme::sendInvalidateMail ( int  $ref_id,
int  $usr_id 
)
static

Definition at line 2059 of file class.ilObjStudyProgramme.php.

2059 : bool
2060 {
2061 global $DIC;
2062 $lng = $DIC['lng'];
2063 $lng->loadLanguageModule("prg");
2064 $lng->loadLanguageModule("mail");
2065
2067
2068 $subject = $lng->txt("invalidate_mail_subject");
2069 $gender = ilObjUser::_lookupGender($usr_id);
2071 $body = sprintf(
2072 $lng->txt("invalidate_mail_body"),
2073 $lng->txt("mail_salutation_" . $gender),
2074 $name,
2075 $prg->getTitle()
2076 );
2077
2078 $send = true;
2079 $mail = new ilMail(ANONYMOUS_USER_ID);
2080 try {
2081 $mail->enqueue(
2082 ilObjUser::_lookupLogin($usr_id),
2083 '',
2084 '',
2085 $subject,
2086 $body,
2087 null
2088 );
2089 } catch (Exception $e) {
2090 $send = false;
2091 }
2092
2093 return $send;
2094 }
static _lookupLogin($a_user_id)
lookup login
static _lookupGender($a_user_id)
Lookup gender.
static _lookupFullname($a_user_id)
Lookup Full Name.
if($format !==null) $name
Definition: metadata.php:230

References $DIC, Vendor\Package\$e, $lng, $name, ilObjUser\_lookupFullname(), ilObjUser\_lookupGender(), ilObjUser\_lookupLogin(), and getInstanceByRefId().

+ Here is the call graph for this function:

◆ setAssessmentSettings()

ilObjStudyProgramme::setAssessmentSettings ( \ilStudyProgrammeAssessmentSettings  $assessment_settings)

Definition at line 505 of file class.ilObjStudyProgramme.php.

507 : void {
508 $this->settings = $this->settings->withAssessmentSettings($assessment_settings);
509 }

Referenced by ilObjStudyProgrammeSettingsGUI\buildForm(), setPoints(), and setStatus().

+ Here is the caller graph for this function:

◆ setAutoMailSettings()

ilObjStudyProgramme::setAutoMailSettings ( \ilStudyProgrammeAutoMailSettings  $automail_settings)

Definition at line 557 of file class.ilObjStudyProgramme.php.

557 : void
558 {
559 $this->settings = $this->settings->withAutoMailSettings($automail_settings);
560 }

References settings().

Referenced by ilObjStudyProgrammeSettingsGUI\buildForm().

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

◆ setDeadlineSettings()

ilObjStudyProgramme::setDeadlineSettings ( \ilStudyProgrammeDeadlineSettings  $deadline_settings)

Definition at line 516 of file class.ilObjStudyProgramme.php.

516 : void
517 {
518 $this->settings = $this->settings->withDeadlineSettings($deadline_settings);
519 }

References settings().

Referenced by ilObjStudyProgrammeSettingsGUI\buildForm().

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

◆ setPoints()

ilObjStudyProgramme::setPoints ( int  $a_points)

Set the amount of points.

Exceptions
ilException

Definition at line 411 of file class.ilObjStudyProgramme.php.

412 {
414 $settings = $settings->withPoints($a_points);
416 $this->updateLastChange();
417 return $this;
418 }
setAssessmentSettings(\ilStudyProgrammeAssessmentSettings $assessment_settings)
updateLastChange()
Update last change timestamp on this node and its parents.

References $settings, getAssessmentSettings(), setAssessmentSettings(), and updateLastChange().

+ Here is the call graph for this function:

◆ setProgressesCompletedFor()

static ilObjStudyProgramme::setProgressesCompletedFor ( int  $a_obj_id,
int  $a_user_id 
)
static

Set all progresses to completed where the object with given id is a leaf and that belong to the user.

Definition at line 1858 of file class.ilObjStudyProgramme.php.

1858 : void
1859 {
1860 // We only use courses via crs_refs
1861 $type = ilObject::_lookupType($a_obj_id);
1862 if ($type == "crs") {
1863 require_once("Services/ContainerReference/classes/class.ilContainerReference.php");
1864 $crs_reference_obj_ids = ilContainerReference::_lookupSourceIds($a_obj_id);
1865 foreach ($crs_reference_obj_ids as $obj_id) {
1866 foreach (ilObject::_getAllReferences($obj_id) as $ref_id) {
1868 }
1869 }
1870 } else {
1871 foreach (ilObject::_getAllReferences($a_obj_id) as $ref_id) {
1873 }
1874 }
1875 }
static setProgressesCompletedIfParentIsProgrammeInLPCompletedMode(int $a_ref_id, int $a_obj_id, int $a_user_id)

References $type, ilObject\_getAllReferences(), ilContainerReference\_lookupSourceIds(), and ilObject\_lookupType().

Referenced by ilStudyProgrammeAppEventListener\onServiceTrackingUpdateStatus().

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

◆ setProgressesCompletedIfParentIsProgrammeInLPCompletedMode()

static ilObjStudyProgramme::setProgressesCompletedIfParentIsProgrammeInLPCompletedMode ( int  $a_ref_id,
int  $a_obj_id,
int  $a_user_id 
)
staticprotected
Exceptions
ilException

Definition at line 1880 of file class.ilObjStudyProgramme.php.

1884 : void {
1885 global $DIC; // TODO: replace this by a settable static for testing purpose?
1886 $tree = $DIC['tree'];
1887 $node_data = $tree->getParentNodeData($a_ref_id);
1888 if ($node_data["type"] !== "prg") {
1889 return;
1890 }
1892 $prg = ilObjStudyProgramme::getInstanceByRefId($node_data["child"]);
1893 if ($prg->getLPMode() != ilStudyProgrammeSettings::MODE_LP_COMPLETED) {
1894 return;
1895 }
1896 foreach ($prg->getProgressesOf($a_user_id) as $progress) {
1897 $progress->setLPCompleted($a_obj_id, $a_user_id);
1898 }
1899 }

◆ setStatus()

ilObjStudyProgramme::setStatus ( int  $a_status)

Set the status of the node.

Exceptions
ilException

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

463 {
464 $settings = $this->getAssessmentSettings()->withStatus($a_status);
466 $this->updateLastChange();
467 return $this;
468 }

References $settings, getAssessmentSettings(), setAssessmentSettings(), and updateLastChange().

+ Here is the call graph for this function:

◆ setTypeSettings()

ilObjStudyProgramme::setTypeSettings ( \ilStudyProgrammeTypeSettings  $type_settings)

Definition at line 495 of file class.ilObjStudyProgramme.php.

495 : void
496 {
497 $this->settings = $this->settings->withTypeSettings($type_settings);
498 }

References settings().

+ Here is the call graph for this function:

◆ setValidityOfQualificationSettings()

ilObjStudyProgramme::setValidityOfQualificationSettings ( \ilStudyProgrammeValidityOfAchievedQualificationSettings  $validity_of_qualification_settings)

Definition at line 526 of file class.ilObjStudyProgramme.php.

528 : void {
529 $this->settings = $this->settings->withValidityOfQualificationSettings(
530 $validity_of_qualification_settings
531 );
532 }

Referenced by ilObjStudyProgrammeSettingsGUI\buildForm().

+ Here is the caller graph for this function:

◆ shouldSendInfoToReAssignMail()

ilObjStudyProgramme::shouldSendInfoToReAssignMail ( )

Definition at line 567 of file class.ilObjStudyProgramme.php.

567 : bool
568 {
569 return $this->getAutoMailSettings()->getReminderNotRestartedByUserDays() > 0;
570 }

◆ shouldSendReAssignedMail()

ilObjStudyProgramme::shouldSendReAssignedMail ( )

Definition at line 562 of file class.ilObjStudyProgramme.php.

562 : bool
563 {
564 return $this->getAutoMailSettings()->getSendReAssignedMail();
565 }

◆ shouldSendRiskyToFailMail()

ilObjStudyProgramme::shouldSendRiskyToFailMail ( )

Definition at line 572 of file class.ilObjStudyProgramme.php.

572 : bool
573 {
574 return $this->getAutoMailSettings()->getProcessingEndsNotSuccessfulDays() > 0;
575 }

◆ storeAutomaticContentCategory()

ilObjStudyProgramme::storeAutomaticContentCategory ( int  $category_ref_id)

Store a Category with auto-content for this StudyProgramme; a category can only be referenced once (per programme).

Definition at line 1544 of file class.ilObjStudyProgramme.php.

1544 : void
1545 {
1546 $ac = $this->auto_categories_repository->create(
1547 $this->getId(),
1548 $category_ref_id
1549 );
1550 $this->auto_categories_repository->update($ac);
1551 }

◆ storeAutomaticMembershipSource()

ilObjStudyProgramme::storeAutomaticMembershipSource ( string  $type,
int  $src_id 
)

Store a source to be monitored for automatic memberships.

Definition at line 1666 of file class.ilObjStudyProgramme.php.

1666 : void
1667 {
1668 $ams = $this->auto_memberships_repository->create($this->getId(), $type, $src_id, false);
1669 $this->auto_memberships_repository->update($ams);
1670 }

References $type.

◆ throwIfNotInTree()

ilObjStudyProgramme::throwIfNotInTree ( )
protected

Helper function to check, weather object is in tree.

Throws ilStudyProgrammeTreeException if object is not in tree.

Definition at line 874 of file class.ilObjStudyProgramme.php.

875 {
876 if (!$this->tree->isInTree($this->getRefId())) {
877 throw new ilStudyProgrammeTreeException("This program is not in tree.");
878 }
879 }

◆ update()

ilObjStudyProgramme::update ( )
Exceptions
ilException

Reimplemented from ilContainer.

Definition at line 341 of file class.ilObjStudyProgramme.php.

341 : void
342 {
343 parent::update();
344
345 // Update selection for advanced meta data of the type
346 if ($this->getTypeSettings()->getTypeId()) {
348 $this->getId(),
349 'prg_type',
350 $this->type_repository->readAssignedAMDRecordIdsByType($this->getTypeSettings()->getTypeId())
351 );
352 } else {
353 // If no type is assigned, delete relations by passing an empty array
354 ilAdvancedMDRecord::saveObjRecSelection($this->getId(), 'prg_type', array());
355 }
356 $this->updateSettings();
357 }
static saveObjRecSelection($a_obj_id, $a_sub_type="", array $a_records=null, $a_delete_before=true)
Save repository object record selection.
updateSettings()
Update settings in DB.

References ilObject\getId(), getTypeSettings(), ilAdvancedMDRecord\saveObjRecSelection(), and updateSettings().

+ Here is the call graph for this function:

◆ updateAllAssignments()

ilObjStudyProgramme::updateAllAssignments ( )

Update all assignments to this program node.

Definition at line 1321 of file class.ilObjStudyProgramme.php.

1322 {
1323 $this->members_cache = null;
1324 $assignments = $this->assignment_db->getInstancesForProgram((int) $this->getId());
1325 foreach ($assignments as $ass) {
1326 $ass->updateFromProgram();
1327 }
1328 return $this;
1329 }

◆ updateLastChange()

ilObjStudyProgramme::updateLastChange ( )
protected

Update last change timestamp on this node and its parents.

Definition at line 1807 of file class.ilObjStudyProgramme.php.

1807 : void
1808 {
1809 $this->settings->updateLastChange();
1810 if ($parent = $this->getParent()) {
1811 $parent->updateLastChange();
1812 }
1813 $this->update();
1814 }

References settings().

Referenced by setPoints(), and setStatus().

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

◆ updateSettings()

ilObjStudyProgramme::updateSettings ( )
protected

Update settings in DB.

Throws when settings are not loaded.

Exceptions
ilExceptionif no settings are loaded

Definition at line 284 of file class.ilObjStudyProgramme.php.

284 : void
285 {
286 if ($this->settings === null) {
287 throw new ilException("ilObjStudyProgramme::updateSettings: no settings loaded.");
288 }
289 $this->settings_repository->update($this->settings);
290 }

References settings().

Referenced by update().

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

Field Documentation

◆ $assignment_db

ilObjStudyProgramme::$assignment_db
protected

Definition at line 67 of file class.ilObjStudyProgramme.php.

◆ $assignment_repository

ilObjStudyProgramme::$assignment_repository
protected

Definition at line 37 of file class.ilObjStudyProgramme.php.

◆ $auto_categories_repository

ilObjStudyProgramme::$auto_categories_repository
protected

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

◆ $auto_memberships_repository

ilObjStudyProgramme::$auto_memberships_repository
protected

Definition at line 52 of file class.ilObjStudyProgramme.php.

◆ $children

ilObjStudyProgramme::$children
protected

Definition at line 22 of file class.ilObjStudyProgramme.php.

◆ $db

ilObjStudyProgramme::$db
protected

Definition at line 94 of file class.ilObjStudyProgramme.php.

◆ $events

ilObjStudyProgramme::$events
protected

Definition at line 72 of file class.ilObjStudyProgramme.php.

◆ $ilUser

ilObjStudyProgramme::$ilUser

Definition at line 89 of file class.ilObjStudyProgramme.php.

Referenced by __construct().

◆ $lp_children

ilObjStudyProgramme::$lp_children
protected

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

◆ $members_cache

ilObjStudyProgramme::$members_cache
protected

Definition at line 130 of file class.ilObjStudyProgramme.php.

◆ $membersourcereader_factory

ilObjStudyProgramme::$membersourcereader_factory
protected

Definition at line 57 of file class.ilObjStudyProgramme.php.

◆ $object_factory

ilObjStudyProgramme::$object_factory

Definition at line 110 of file class.ilObjStudyProgramme.php.

◆ $parent

ilObjStudyProgramme::$parent
protected

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

◆ $plugin_admin

ilObjStudyProgramme::$plugin_admin
protected

Definition at line 99 of file class.ilObjStudyProgramme.php.

◆ $progress_db

ilObjStudyProgramme::$progress_db
protected

Definition at line 62 of file class.ilObjStudyProgramme.php.

◆ $progress_repository

ilObjStudyProgramme::$progress_repository
protected

Definition at line 42 of file class.ilObjStudyProgramme.php.

◆ $ps

ilObjStudyProgramme::$ps
protected

Definition at line 115 of file class.ilObjStudyProgramme.php.

◆ $reference_children

ilObjStudyProgramme::$reference_children = []
protected

Definition at line 120 of file class.ilObjStudyProgramme.php.

◆ $settings

ilObjStudyProgramme::$settings
protected

Definition at line 12 of file class.ilObjStudyProgramme.php.

Referenced by setPoints(), and setStatus().

◆ $settings_repository

ilObjStudyProgramme::$settings_repository
protected

Definition at line 104 of file class.ilObjStudyProgramme.php.

◆ $study_programme_cache

ilObjStudyProgramme::$study_programme_cache = null
static

Definition at line 125 of file class.ilObjStudyProgramme.php.

◆ $tree

ilObjStudyProgramme::$tree

Definition at line 84 of file class.ilObjStudyProgramme.php.

Referenced by __construct().

◆ $type_repository

ilObjStudyProgramme::$type_repository
protected

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

◆ $webdir

ilObjStudyProgramme::$webdir

Definition at line 79 of file class.ilObjStudyProgramme.php.


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