ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 getSettings ()
 
 updateSettings (ilStudyProgrammeSettings $settings)
 
 create ()
 
 update ()
 
 delete ()
 Delete Study Programme and all related data. More...
 
 hasAdvancedMetadata ()
 
 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...
 
 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 obj-ids of the leafs the program contains. More...
 
 getAmountOfLPChildren ()
 Get the amount of leafs, the study programme contains. More...
 
 hasLPChildren ()
 
 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 $usr_id, int $acting_usr_id=null)
 Assign a user to this node at the study program. More...
 
 removeAssignment (ilStudyProgrammeAssignment $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 ()
 get usr_ids with any progress on this node More...
 
 getLocalMembers ()
 get usr_ids with assignment on this node More...
 
 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, int $acting_user=null)
 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 $assignment_id)
 
 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, $assign_now=false)
 Enable a membership source. More...
 
 getApplicableMembershipSourceForUser (int $usr_id, string $exclude_type)
 
 updateCustomIcon ()
 
 getIdsOfSuccessfulChildren (int $ass_id)
 
 getNamesOfCompletedOrAccreditedChildren (int $ass_id)
 
 getChildrenProgress ($progress)
 
 getPossiblePointsOfRelevantChildren (ilStudyProgrammeProgress $progress)
 
 getAchievedPointsOfChildren (ilStudyProgrammeProgress $progress)
 
 markAccredited (int $progress_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
 
 unmarkAccredited (int $progress_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
 
 markFailed (int $progress_id, int $acting_usr_id)
 
 markNotFailed (int $progress_id, int $acting_usr_id)
 
 markNotRelevant (int $progress_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
 
 markRelevant (int $progress_id, int $acting_usr_id, ilPRGMessageCollection $err_collection)
 
 invalidate (int $progress_id)
 
 succeed (int $progress_id, int $triggering_obj_id)
 
 changeProgressDeadline (int $progress_id, int $acting_usr_id, ilPRGMessageCollection $err_collection, ?DateTimeImmutable $deadline)
 
 changeProgressValidityDate (int $progress_id, int $acting_usr_id, ilPRGMessageCollection $err_collection, ?DateTimeImmutable $validity)
 
 changeAmountOfPoints (int $progress_id, int $acting_usr_id, ilPRGMessageCollection $err_collection, ?int $points)
 
 updatePlanFromRepository (int $progress_id, int $acting_usr_id, ilPRGMessageCollection $err_collection=null)
 
 canBeCompleted (ilStudyProgrammeProgress $progress)
 
 statusToRepr ($a_status)
 Get a user readable representation of a status. More...
 
- Public Member Functions inherited from ilContainer
 __construct ($a_id=0, $a_reference=true)
 
 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)
 
 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 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 public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title 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 public More...
 
 getLastUpdateDate ()
 get last update date 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...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! 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) 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 getRefIdFor (int $obj_id)
 
static getInstanceByObjId ($obj_id)
 
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 sendReAssignedMail (int $ref_id, int $usr_id)
 
static sendInvalidateMail (int $ref_id, int $usr_id)
 
static sendInformToReAssignMail (int $progress_id, int $usr_id)
 
static sendRiskyToFailMail (int $progress_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 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 _getIcon ( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. 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...
 
 getPrgInstanceByObjId (int $obj_id)
 
 getProgressRepository ()
 
 getAssignmentRepository ()
 
 getSettingsRepository ()
 
 getTree ()
 
 getLogger ()
 
 deleteSettings ()
 
 deleteAssignmentsAndProgresses ()
 Delete all assignments from the DB. More...
 
 getReferencesTo (ilObjStudyProgramme $prg)
 
 throwIfNotInTree ()
 
 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...
 
 getLoggedInUserId ()
 
 getNow ()
 
 getAssignmentForProgress (ilStudyProgrammeProgress $progress)
 
 getProgrammeSettingsForProgress (ilStudyProgrammeProgress $progress)
 
 getObjIdsOfChildren (int $node_obj_id)
 
 getParentProgress (ilStudyProgrammeProgress $progress)
 
 refreshLPStatus (int $usr_id, int $node_obj_id=null)
 
 updateParentProgress (ilStudyProgrammeProgress $progress)
 
 recalculateProgressStatus (ilStudyProgrammeProgress $progress)
 
 applyProgressDeadline (ilStudyProgrammeProgress $progress, int $acting_usr_id=null)
 
 resetProgressToSettings (ilStudyProgrammeProgress $progress, int $acting_usr_id)
 
 updateProgressRelevanceFromSettings ($progress)
 
 updateProgressValidityFromSettings ($progress)
 
 updateProgressDeadlineFromSettings ($progress)
 
 getProgressIdString (ilStudyProgrammeProgress $progress)
 
- 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

 $parent
 
 $children
 
 $lp_children
 
 $type_repository
 
 $assignment_repository
 
 $progress_repository
 
 $auto_categories_repository
 
 $auto_memberships_repository
 
 $membersourcereader_factory
 
 $events
 
 $db
 
 $plugin_admin
 
 $settings_repository
 
 $reference_children
 
 $members_cache
 
 $custom_icon_factory
 
- Protected Attributes inherited from ilContainer
 $news
 
 $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 5 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 119 of file class.ilObjStudyProgramme.php.

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

120  {
122  $this->type = "prg";
123 
124  $this->type_repository = $dic['model.Type.ilStudyProgrammeTypeRepository'];
125  $this->auto_categories_repository = $dic['model.AutoCategories.ilStudyProgrammeAutoCategoriesRepository'];
126  $this->auto_memberships_repository = $dic['model.AutoMemberships.ilStudyProgrammeAutoMembershipsRepository'];
127  $this->membersourcereader_factory = $dic['model.AutoMemberships.ilStudyProgrammeMembershipSourceReaderFactory'];
128 
129  $this->settings_repository = $dic['model.Settings.ilStudyProgrammeSettingsRepository'];
130  $this->assignment_repository = $dic['model.Assignment.ilStudyProgrammeAssignmentRepository'];
131  $this->progress_repository = $dic['model.Progress.ilStudyProgrammeProgressRepository'];
132 
133  $this->events = $dic['ilStudyProgrammeEvents'];
134 
135  parent::__construct($a_id, $a_call_by_reference);
136 
137  $this->clearParentCache();
138  $this->clearChildrenCache();
139  $this->clearLPChildrenCache();
140 
141  global $DIC;
142  $tree = $DIC['tree'];
143  $ilUser = $DIC['ilUser'];
144  $this->webdir = $DIC->filesystem()->web();
145  $this->tree = $tree;
146  $this->ilUser = $ilUser;
147  $this->db = $DIC['ilDB'];
148  $this->plugin_admin = $DIC['ilPluginAdmin'];
149  $this->lng = $DIC['lng'];
150  $this->logger = ilLoggerFactory::getLogger($this->type);
151 
152  $this->object_factory = ilObjectFactoryWrapper::singleton();
153 
154  $this->custom_icon_factory = $DIC['object.customicons.factory'];
155 
156  self::initStudyProgrammeCache();
157  }
clearLPChildrenCache()
Clear the cached lp children.
clearChildrenCache()
Clear the cached children.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
$dic
Definition: result.php:13
static getLogger($a_component_id)
Get component logger.
clearParentCache()
Clear the cached parent to query it again at the tree.
+ 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 1453 of file class.ilObjStudyProgramme.php.

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

Referenced by ilStudyProgrammeAppEventListener\addCrsToProgrammes().

1453  : void
1454  {
1455  foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1456  $course_ref = new ilObjCourseReference();
1457  $course_ref->setTitleType(ilObjCourseReference::TITLE_TYPE_REUSE);
1458  $course_ref->setTargetRefId($crs_ref_id);
1459  $course_ref->create();
1460  $course_ref->createReference();
1461  $course_ref->putInTree($prg->getRefId());
1462  $course_ref->setPermissions($crs_ref_id);
1463  $course_ref->setTargetId(ilObject::_lookupObjectId($crs_ref_id));
1464  $course_ref->update();
1465  $lp = new ilLPObjSettings($course_ref->getId());
1466  $lp->insert();
1467  $lp->setMode($lp::LP_MODE_COURSE_REFERENCE);
1468  $lp->update(false);
1469  }
1470  }
static _lookupObjectId($a_ref_id)
lookup object id
+ 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 953 of file class.ilObjStudyProgramme.php.

References clearLPChildrenCache(), ilStudyProgrammeLeaf\createReference(), ilStudyProgrammeLeaf\getRefId(), ilObject\getRefId(), getSettings(), hasChildren(), ilStudyProgrammeSettings\MODE_LP_COMPLETED, ilStudyProgrammeLeaf\putInTree(), and throwIfNotInTree().

954  {
955  $this->throwIfNotInTree();
956 
957  if ($this->hasChildren()) {
958  throw new ilStudyProgrammeTreeException("Program already contains other programm nodes.");
959  }
960 
961  if ($a_leaf->getRefId() === null) {
962  $a_leaf->createReference();
963  }
964  $a_leaf->putInTree($this->getRefId());
965  $this->clearLPChildrenCache();
966  $this->settings_repository->update(
968  );
969 
970  return $this;
971  }
clearLPChildrenCache()
Clear the cached lp children.
createReference()
Create a reference id for this object.
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.
hasChildren(bool $include_references=false)
Does this StudyProgramme have other ilObjStudyProgrammes as children?
getRefId()
get reference id public
Exception is thrown when invariants on the program tree would be violated by manipulation of tree...
+ 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 1631 of file class.ilObjStudyProgramme.php.

References ilStudyProgrammeAutoMembershipSource\SOURCE_MAPPING.

Referenced by ilStudyProgrammeAppEventListener\addMemberToProgrammes().

1631  : void
1632  {
1633  foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1634  if ($prg->isActive() &&
1635  !$prg->hasAssignmentsOfSingleProgramForUser($usr_id)) {
1636  $assigned_by = ilStudyProgrammeAutoMembershipSource::SOURCE_MAPPING[$src_type];
1637  $prg->assignUser($usr_id, $assigned_by);
1638  }
1639  }
1640  }
+ 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, i.e.: there was a node added below this one.

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

References $assignment_repository, $progress_repository, $settings_repository, getAssignmentRepository(), getChildren(), ilObject\getId(), getLogger(), getProgressRepository(), getSettingsRepository(), and ilStudyProgrammeProgress\STATUS_NOT_RELEVANT.

Referenced by nodeInserted().

1266  : void
1267  {
1268  $logger = $this->getLogger();
1272 
1273  $assignment_ids_here = array_unique(
1274  array_map(
1275  function ($progress) {
1276  return $progress->getAssignmentId();
1277  },
1278  $progress_repository->getByPrgId((int) $this->getId())
1279  )
1280  );
1281 
1282  $nodes_below = $this->getChildren(true); //include references
1283  foreach ($assignment_ids_here as $ass_id) {
1284  foreach ($nodes_below as $node) {
1285  $node_id = $node->getId();
1286  if (!$progress_repository->getByPrgIdAndAssignmentId($node_id, $ass_id)) {
1287  $new_progress = $progress_repository->createFor(
1288  $settings_repository->get($node_id),
1289  $assignment_repository->get($ass_id),
1290  null //acting user
1291  );
1292  $progress_repository->update(
1293  $new_progress->withStatus(ilStudyProgrammeProgress::STATUS_NOT_RELEVANT)
1294  );
1295 
1296  $logger->log("Added progress for assingnment $ass_id at node $node_id.");
1297  }
1298  $node->addMissingProgresses();
1299  }
1300  }
1301  }
getChildren(bool $include_references=false)
Get all ilObjStudyProgrammes that are direct children of this object.
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 836 of file class.ilObjStudyProgramme.php.

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

837  {
838  $this->throwIfNotInTree();
839 
841  throw new ilStudyProgrammeTreeException("Program already contains leafs.");
842  }
843 
844  if ($this->tree->isInTree($a_prg->getRefId())) {
845  throw new ilStudyProgrammeTreeException("Other program already is in tree.");
846  }
847 
848  if ($a_prg->getRefId() === null) {
849  $a_prg->createReference();
850  }
851  $a_prg->putInTree($this->getRefId());
852  return $this;
853  }
createReference()
creates reference for object
putInTree($a_parent_ref)
Overwritten from ilObject.
getRefId()
get reference id public
Exception is thrown when invariants on the program tree would be violated by manipulation of tree...
+ 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 405 of file class.ilObjStudyProgramme.php.

References clearChildrenCache(), clearLPChildrenCache(), getAmountOfChildren(), getAmountOfLPChildren(), getSettings(), ilStudyProgrammeSettings\MODE_LP_COMPLETED, ilStudyProgrammeSettings\MODE_POINTS, and ilStudyProgrammeSettings\MODE_UNDEFINED.

405  : void
406  {
407  // Clear caches here, there have been some changes, because this method
408  // would not have been called otherwise, and the changer just does not
409  // know if we have filled the caches already...
410  $this->clearLPChildrenCache();
411  $this->clearChildrenCache();
412 
413  if ($this->getAmountOfLPChildren() > 0) {
414  $this->settings_repository->update(
416  );
417  } else {
418  if ($this->getAmountOfChildren(true) > 0) {
419  $this->settings_repository->update(
421  );
422  } else {
423  $this->settings_repository->update(
425  );
426  }
427  }
428  }
clearLPChildrenCache()
Clear the cached lp children.
getAmountOfLPChildren()
Get the amount of leafs, the study programme contains.
clearChildrenCache()
Clear the cached children.
getAmountOfChildren($include_references=false)
Get the amount of other StudyProgrammes this StudyProgramme has as children.
+ Here is the call graph for this function:

◆ applyProgressDeadline()

ilObjStudyProgramme::applyProgressDeadline ( ilStudyProgrammeProgress  $progress,
int  $acting_usr_id = null 
)
protected

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

References $format, ilStudyProgrammeProgress\DATE_FORMAT, ilStudyProgrammeProgress\getDeadline(), getLoggedInUserId(), getNow(), ilStudyProgrammeProgress\getStatus(), ilStudyProgrammeProgress\markFailed(), ilStudyProgrammeProgress\markNotFailed(), ilStudyProgrammeProgress\STATUS_FAILED, and ilStudyProgrammeProgress\STATUS_IN_PROGRESS.

Referenced by changeProgressDeadline(), unmarkAccredited(), and updatePlanFromRepository().

2309  {
2310  $today = $this->getNow();
2312  $deadline = $progress->getDeadline();
2313 
2314  if (is_null($acting_usr_id)) {
2315  $acting_usr_id = $this->getLoggedInUserId();
2316  }
2317 
2318  switch ($progress->getStatus()) {
2319 
2321  if (!is_null($deadline)
2322  && $deadline->format($format) < $today->format($format)
2323  ) {
2324  $progress = $progress->markFailed($this->getNow(), $acting_usr_id);
2325  }
2326  break;
2327 
2329  if (is_null($deadline)
2330  || $deadline->format($format) >= $today->format($format)
2331  ) {
2332  $progress = $progress->markNotFailed($this->getNow(), $acting_usr_id);
2333  }
2334  break;
2335  }
2336 
2337  return $progress;
2338  }
markFailed(DateTimeImmutable $date, int $acting_usr_id)
markNotFailed(DateTimeImmutable $date, int $acting_usr_id)
getStatus()
Get the status the user has on this node.
$format
Definition: metadata.php:218
Class ilStudyProgrammeProgress.
+ Here is the call graph for this function:
+ Here is the caller 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 778 of file class.ilObjStudyProgramme.php.

References getChildren(), and throwIfNotInTree().

Referenced by assignUser(), and getAllPrgChildren().

778  : void
779  {
780  $this->throwIfNotInTree();
781 
782  if ($fun($this) !== false) {
783  foreach ($this->getChildren($include_references) as $child) {
784  $child->applyToSubTreeNodes($fun, $include_references);
785  }
786  }
787  }
getChildren(bool $include_references=false)
Get all ilObjStudyProgrammes that are direct children of this object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignUser()

ilObjStudyProgramme::assignUser ( int  $usr_id,
int  $acting_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 1046 of file class.ilObjStudyProgramme.php.

References applyToSubTreeNodes(), createProgressForAssignment(), ilObject\getId(), getLoggedInUserId(), getProgressRepository(), getStatus(), resetProgressToSettings(), and ilStudyProgrammeSettings\STATUS_ACTIVE.

Referenced by enableAutomaticMembershipSource().

1047  {
1048  $this->members_cache = null;
1049 
1051  throw new ilException(
1052  "ilObjStudyProgramme::assignUser: Can't assign user to program '"
1053  . $this->getId() . "', since it's not in active status."
1054  );
1055  }
1056 
1057  if (is_null($acting_usr_id)) {
1058  $acting_usr_id = $this->getLoggedInUserId();
1059  }
1060 
1061  $ass = $this->assignment_repository->createFor($this->getId(), $usr_id, $acting_usr_id);
1062 
1063  $this->applyToSubTreeNodes(
1064  function (ilObjStudyProgramme $node) use ($ass, $acting_usr_id) {
1065  $progress = $node->createProgressForAssignment($ass, $acting_usr_id);
1066  $progress = $node->resetProgressToSettings($progress, $acting_usr_id);
1067  $this->getProgressRepository()->update($progress);
1068  },
1069  true
1070  );
1071 
1072  $this->events->userAssigned($ass);
1073  return $ass;
1074  }
applyToSubTreeNodes(Closure $fun, bool $include_references=false)
Apply the given Closure to every node in the subtree starting at this object.
createProgressForAssignment(ilStudyProgrammeAssignment $ass, int $acting_user=null)
Create a progress on this programme for the given assignment.
getId()
get object id public
Represents one assignment of the user to a program tree.
resetProgressToSettings(ilStudyProgrammeProgress $progress, int $acting_usr_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ canBeCompleted()

ilObjStudyProgramme::canBeCompleted ( ilStudyProgrammeProgress  $progress)

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

References ilStudyProgrammeProgress\getAmountOfPoints(), getLPMode(), getPossiblePointsOfRelevantChildren(), and ilStudyProgrammeSettings\MODE_LP_COMPLETED.

2710  : bool
2711  {
2713  return true;
2714  }
2715  $possible_points = $this->getPossiblePointsOfRelevantChildren($progress);
2716  return $possible_points >= $progress->getAmountOfPoints();
2717  }
getPossiblePointsOfRelevantChildren(ilStudyProgrammeProgress $progress)
getAmountOfPoints()
Get the amount of points the user needs to achieve on the subnodes of this node.
+ 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 931 of file class.ilObjStudyProgramme.php.

References getProgresses(), and ilStudyProgrammeProgress\STATUS_NOT_RELEVANT.

Referenced by removeNode().

931  : bool
932  {
933  foreach ($this->getProgresses() as $progress) {
934  if ($progress->getStatus() != ilStudyProgrammeProgress::STATUS_NOT_RELEVANT) {
935  return false;
936  }
937  if ($progress->getLastChangeBy() !== null) {
938  return false;
939  }
940  }
941  return true;
942  }
getProgresses()
Get all progresses on this node.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeAmountOfPoints()

ilObjStudyProgramme::changeAmountOfPoints ( int  $progress_id,
int  $acting_usr_id,
ilPRGMessageCollection  $err_collection,
?int  $points 
)

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

References ilPRGMessageCollection\add(), getNow(), getProgressIdString(), getProgressRepository(), recalculateProgressStatus(), refreshLPStatus(), and updateParentProgress().

2580  : void {
2581  $progress = $this->getProgressRepository()->get($progress_id);
2582 
2583  if (!$progress->isRelevant()) {
2584  $err_collection->add(false, 'will_not_modify_irrelevant_progress', $this->getProgressIdString($progress));
2585  return;
2586  }
2587  if ($progress->isSuccessful()) {
2588  $err_collection->add(false, 'will_not_modify_successful_progress', $this->getProgressIdString($progress));
2589  return;
2590  }
2591 
2592  $progress = $progress
2593  ->withAmountOfPoints($points)
2594  ->withLastChange($acting_usr_id, $this->getNow())
2595  ->withIndividualModifications(true);
2596 
2597  $progress = $this->recalculateProgressStatus($progress);
2598 
2599  $this->getProgressRepository()->update($progress);
2600  $err_collection->add(true, 'required_points_updated', $this->getProgressIdString($progress));
2601  $this->refreshLPStatus($progress->getUserId());
2602  $this->updateParentProgress($progress);
2603  }
add(bool $success, string $message, string $record_identitifer)
recalculateProgressStatus(ilStudyProgrammeProgress $progress)
getProgressIdString(ilStudyProgrammeProgress $progress)
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ changeProgressDeadline()

ilObjStudyProgramme::changeProgressDeadline ( int  $progress_id,
int  $acting_usr_id,
ilPRGMessageCollection  $err_collection,
?DateTimeImmutable  $deadline 
)

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

References ilPRGMessageCollection\add(), applyProgressDeadline(), getNow(), getProgressIdString(), getProgressRepository(), refreshLPStatus(), and updateParentProgress().

2521  : void {
2522  $progress = $this->getProgressRepository()->get($progress_id);
2523 
2524  if (!$progress->isRelevant()) {
2525  $err_collection->add(false, 'will_not_modify_irrelevant_progress', $this->getProgressIdString($progress));
2526  return;
2527  }
2528  if ($progress->isSuccessful()) {
2529  $err_collection->add(false, 'will_not_modify_deadline_on_successful_progress', $this->getProgressIdString($progress));
2530  return;
2531  }
2532 
2533  $progress = $progress
2534  ->withDeadline($deadline)
2535  ->withLastChange($acting_usr_id, $this->getNow())
2536  ->withIndividualModifications(true);
2537 
2538  $progress = $this->applyProgressDeadline($progress, $acting_usr_id);
2539 
2540  $this->getProgressRepository()->update($progress);
2541  $this->refreshLPStatus($progress->getUserId());
2542  $this->updateParentProgress($progress);
2543  $err_collection->add(true, 'deadline_updated', $this->getProgressIdString($progress));
2544  }
add(bool $success, string $message, string $record_identitifer)
applyProgressDeadline(ilStudyProgrammeProgress $progress, int $acting_usr_id=null)
getProgressIdString(ilStudyProgrammeProgress $progress)
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ changeProgressValidityDate()

ilObjStudyProgramme::changeProgressValidityDate ( int  $progress_id,
int  $acting_usr_id,
ilPRGMessageCollection  $err_collection,
?DateTimeImmutable  $validity 
)

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

References ilPRGMessageCollection\add(), getNow(), getProgressIdString(), getProgressRepository(), and refreshLPStatus().

2551  : void {
2552  $progress = $this->getProgressRepository()->get($progress_id);
2553 
2554  if (!$progress->isRelevant()) {
2555  $err_collection->add(false, 'will_not_modify_irrelevant_progress', $this->getProgressIdString($progress));
2556  return;
2557  }
2558  if (!$progress->isSuccessful()) {
2559  $err_collection->add(false, 'will_not_modify_validity_on_non_successful_progress', $this->getProgressIdString($progress));
2560  return;
2561  }
2562 
2563  $progress = $progress
2564  ->withValidityOfQualification($validity)
2565  ->withLastChange($acting_usr_id, $this->getNow())
2566  ->withIndividualModifications(true);
2567 
2568  $this->getProgressRepository()->update($progress);
2569  $err_collection->add(true, 'validity_updated', $this->getProgressIdString($progress));
2570 
2571  //update LearningProgress, but this does not affect upper progresses
2572  $this->refreshLPStatus($progress->getUserId());
2573  }
add(bool $success, string $message, string $record_identitifer)
getProgressIdString(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ clearChildrenCache()

ilObjStudyProgramme::clearChildrenCache ( )
protected

Clear the cached children.

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

Referenced by __construct(), adjustLPMode(), moveTo(), nodeInserted(), and removeNode().

178  : void
179  {
180  $this->children = null;
181  }
+ Here is the caller graph for this function:

◆ clearLPChildrenCache()

ilObjStudyProgramme::clearLPChildrenCache ( )
protected

Clear the cached lp children.

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

Referenced by __construct(), addLeaf(), adjustLPMode(), moveTo(), and removeLeaf().

186  : void
187  {
188  $this->lp_children = null;
189  }
+ 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 169 of file class.ilObjStudyProgramme.php.

Referenced by __construct(), moveTo(), and removeNode().

169  : void
170  {
171  // This is not initialized, but we need null if there is no parent.
172  $this->parent = false;
173  }
+ Here is the caller graph for this function:

◆ create()

ilObjStudyProgramme::create ( )
Exceptions
ilException

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

References ilObject\$id, and getSettingsRepository().

293  : int
294  {
295  $id = (int) parent::create();
296  $this->getSettingsRepository()->createFor($id);
297  return $id;
298  }
+ 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 244 of file class.ilObjStudyProgramme.php.

Referenced by ilObjStudyProgrammeTest\createSmallTree(), ilPrgRestartAssignmentsCronJobTest\newPrg(), ilPrgInvalidateExpiredProgressesCronJobTest\newPrg(), ilStudyProgrammeProgressCalculationTest\setUp(), ilStudyProgrammeUserAssignmentTest\setUp(), ilStudyProgrammeLPTest\setUp(), ilStudyProgrammeUserProgressTest\setUp(), ilStudyProgrammeEventsTest\setUp(), ilObjStudyProgrammeTest\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().

245  {
246  $obj = new ilObjStudyProgramme();
247  $obj->create();
248  $obj->createReference();
249  self::$study_programme_cache->addInstance($obj);
250  return $obj;
251  }
+ Here is the caller graph for this function:

◆ createProgressForAssignment()

ilObjStudyProgramme::createProgressForAssignment ( ilStudyProgrammeAssignment  $ass,
int  $acting_user = null 
)

Create a progress on this programme for the given assignment.

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

References getSettings().

Referenced by assignUser().

1240  {
1241  return $this->progress_repository->createFor($this->getSettings(), $ass, $acting_user);
1242  }
Class ilStudyProgrammeProgress.
+ 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

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

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

326  : bool
327  {
328  // always call parent delete function first!!
329  if (!parent::delete()) {
330  return false;
331  }
332 
333  $this->deleteSettings();
335  try {
336  $this->auto_categories_repository->deleteFor((int) $this->getId());
338  // This would be the case when SP is in trash (#17797)
339  }
340 
343 
344  $this->events->raise('delete', ['object' => $this, 'obj_id' => $this->getId()]);
345  return true;
346  }
deleteAssignmentsAndProgresses()
Delete all assignments from the DB.
getId()
get object id public
deleteAllAutomaticContentCategories()
Delete all configuration of categories with auto-content for this StudyProgramme;.
Exception is thrown when invariants on the program tree would be violated by manipulation of tree...
deleteAllAutomaticMembershipSources()
Delete all membership sources of this StudyProgramme;.
+ 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 1445 of file class.ilObjStudyProgramme.php.

References ilObject\getId().

Referenced by delete().

1445  : void
1446  {
1447  $this->auto_categories_repository->deleteFor($this->getId());
1448  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAllAutomaticMembershipSources()

ilObjStudyProgramme::deleteAllAutomaticMembershipSources ( )

Delete all membership sources of this StudyProgramme;.

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

References ilObject\getId().

Referenced by delete().

1567  : void
1568  {
1569  $this->auto_memberships_repository->deleteFor($this->getId());
1570  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAssignmentsAndProgresses()

ilObjStudyProgramme::deleteAssignmentsAndProgresses ( )
protected

Delete all assignments from the DB.

Exceptions
ilException

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

References $assignment_repository, $progress_repository, getAssignmentRepository(), ilObject\getId(), and getProgressRepository().

Referenced by delete().

280  : void
281  {
283  $assignment_repository->deleteAllAssignmentsForProgrammeId($this->getId());
284  $orphan_condition_field = $assignment_repository->getTableAndFieldOfAssignmentIds();
286  $progress_repository->deleteProgressesFor($this->getId());
287  $progress_repository->deleteAllOrphanedProgresses(...$orphan_condition_field);
288  }
getId()
get object id public
+ 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 1437 of file class.ilObjStudyProgramme.php.

References ilObject\getId().

1437  : void
1438  {
1439  $this->auto_categories_repository->delete($this->getId(), $category_ids);
1440  }
getId()
get object id public
+ Here is the call graph for this function:

◆ deleteAutomaticMembershipSource()

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

Delete a membership source.

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

References ilObject\getId().

1559  : void
1560  {
1561  $this->auto_memberships_repository->delete($this->getId(), $type, $src_id);
1562  }
getId()
get object id public
+ Here is the call graph for this function:

◆ deleteSettings()

ilObjStudyProgramme::deleteSettings ( )
protected

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

References getSettings(), and getSettingsRepository().

Referenced by delete().

270  : void
271  {
272  $this->getSettingsRepository()->delete($this->getSettings());
273  }
+ 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 1575 of file class.ilObjStudyProgramme.php.

References ilObject\getId().

1575  : void
1576  {
1577  $ams = $this->auto_memberships_repository->create($this->getId(), $type, $src_id, false);
1578  $this->auto_memberships_repository->update($ams);
1579  }
getId()
get object id public
+ Here is the call graph for this function:

◆ enableAutomaticMembershipSource()

ilObjStudyProgramme::enableAutomaticMembershipSource ( string  $type,
int  $src_id,
  $assign_now = false 
)

Enable a membership source.

Exceptions
ilException

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

References ilObject\$type, assignUser(), getAssignmentsOfSingleProgramForUser(), ilObject\getId(), getMembersOfMembershipSource(), and ilStudyProgrammeAutoMembershipSource\SOURCE_MAPPING.

1585  : void
1586  {
1587  if ($assign_now) {
1589  $member_ids = $this->getMembersOfMembershipSource($type, $src_id);
1590  foreach ($member_ids as $usr_id) {
1591  if (!$this->getAssignmentsOfSingleProgramForUser($usr_id)) {
1592  $this->assignUser($usr_id, $assigned_by);
1593  }
1594  }
1595  }
1596  $ams = $this->auto_memberships_repository->create($this->getId(), $type, $src_id, true);
1597  $this->auto_memberships_repository->update($ams);
1598  }
assignUser(int $usr_id, int $acting_usr_id=null)
Assign a user to this node at the study program.
getId()
get object id public
getAssignmentsOfSingleProgramForUser(int $usr_id)
Get assignments of user to this program-node only.
getMembersOfMembershipSource(string $src_type, int $src_id)
Get member-ids of a certain source.
+ Here is the call graph for this function:

◆ getAchievedPointsOfChildren()

ilObjStudyProgramme::getAchievedPointsOfChildren ( ilStudyProgrammeProgress  $progress)

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

References $children, and getChildrenProgress().

Referenced by recalculateProgressStatus(), and unmarkAccredited().

2218  : int
2219  {
2220  $sum = 0;
2221  $children = $this->getChildrenProgress($progress);
2222  foreach ($children as $child_progress) {
2223  if (!is_null($child_progress) && $child_progress->isSuccessful()) {
2224  $sum += $child_progress->getAmountOfPoints();
2225  }
2226  }
2227  return $sum;
2228  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 483 of file class.ilObjStudyProgramme.php.

References $ret, and ilObject\getId().

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

484  {
485  $ret = array();
486  $root = self::getInstanceByRefId($a_ref_id);
487  $root_id = $root->getId();
488  $root->applyToSubTreeNodes(function (ilObjStudyProgramme $prg) use (&$ret, $root_id) {
489  // exclude root node of subtree.
490  if ($prg->getId() == $root_id) {
491  return;
492  }
493  $ret[] = $prg;
494  }, $include_references);
495  return $ret;
496  }
getId()
get object id public
$ret
Definition: parser.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllPrgChildren()

ilObjStudyProgramme::getAllPrgChildren ( )

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

References $ret, applyToSubTreeNodes(), and ilObject\getId().

Referenced by ilStudyProgrammeDashboardViewGUI\calculatePercent().

498  : array
499  {
500  $ret = [];
501  $this->applyToSubTreeNodes(
502  function (ilObjStudyProgramme $prg) use (&$ret) {
503  if ($prg->getId() == $this->getId()) {
504  return;
505  }
506  $ret[] = $prg;
507  },
508  false
509  );
510  return $ret;
511  }
applyToSubTreeNodes(Closure $fun, bool $include_references=false)
Apply the given Closure to every node in the subtree starting at this object.
getId()
get object id public
$ret
Definition: parser.php:6
+ 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 1117 of file class.ilObjStudyProgramme.php.

References getAssignmentsOf().

Referenced by hasAssignmentOf().

1117  : int
1118  {
1119  return count($this->getAssignmentsOf($a_user_id));
1120  }
getAssignmentsOf(int $a_user_id)
Get the assignments of user at this program or any node above.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAmountOfChildren()

ilObjStudyProgramme::getAmountOfChildren (   $include_references = false)

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

Exceptions
ilStudyProgrammeTreeExceptionwhen this object is not in tree.

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

References getChildren().

Referenced by adjustLPMode(), hasChildren(), and isAutoContentApplicable().

661  : int
662  {
663  return count($this->getChildren($include_references));
664  }
getChildren(bool $include_references=false)
Get all ilObjStudyProgrammes that are direct children of this object.
+ Here is the call graph for this function:
+ 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 747 of file class.ilObjStudyProgramme.php.

References getLPChildren().

Referenced by adjustLPMode(), and hasLPChildren().

748  {
749  return count($this->getLPChildren());
750  }
getLPChildren()
Get the leafs the study programme contains.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getApplicableMembershipSourceForUser()

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

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

References getAutomaticMembershipSources(), and getMembersOfMembershipSource().

1674  {
1675  foreach ($this->getAutomaticMembershipSources() as $ams) {
1676  $src_type = $ams->getSourceType();
1677  if ($src_type !== $exclude_type) {
1678  $source_members = $this->getMembersOfMembershipSource($src_type, $ams->getSourceId());
1679  if (in_array($usr_id, $source_members)) {
1680  return $ams;
1681  }
1682  }
1683  }
1684  return null;
1685  }
getMembersOfMembershipSource(string $src_type, int $src_id)
Get member-ids of a certain source.
getAutomaticMembershipSources()
Get sources for auto-memberships.
+ Here is the call graph for this function:

◆ getAssignmentForProgress()

ilObjStudyProgramme::getAssignmentForProgress ( ilStudyProgrammeProgress  $progress)
protected

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

References ilStudyProgrammeProgress\getAssignmentId().

2122  {
2123  return $this->assignment_repository->get($progress->getAssignmentId());
2124  }
getAssignmentId()
Get the assignment this progress belongs to.
Represents one assignment of the user to a program tree.
+ Here is the call graph for this function:

◆ getAssignmentRepository()

ilObjStudyProgramme::getAssignmentRepository ( )
protected

◆ getAssignments()

ilObjStudyProgramme::getAssignments ( )

Get all assignments to this program or any node above.

Returns
ilStudyProgrammeAssignment[]

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

References $assignment_repository, and getAssignmentsRaw().

Referenced by hasAssignments().

1156  : array
1157  {
1159  return array_map(function ($ass) use ($assignment_repository) {
1160  return $assignment_repository->getInstanceByModel($ass);
1161  }, array_values($this->getAssignmentsRaw())); // use array values since we want keys 0...
1162  }
getAssignmentsRaw()
Get model objects for the assignments on this programm.
+ Here is the call graph for this function:
+ 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
ilStudyProgrammeAssignment[]

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

References $assignment_repository, and getIdsFromNodesOnPathFromRootToHere().

Referenced by getAmountOfAssignmentsOf().

1129  : array
1130  {
1131  $prg_ids = $this->getIdsFromNodesOnPathFromRootToHere();
1132  $assignments = [];
1133  foreach ($prg_ids as $prg_id) {
1134  $assignments = array_merge(
1135  $assignments,
1136  $this->assignment_repository->getByUsrIdAndPrgId($a_user_id, $prg_id)
1137  );
1138  }
1139  usort($assignments, function ($a_one, $a_other) {
1140  return strcmp(
1141  $a_one->getLastChange()->format('Y-m-d'),
1142  $a_other->getLastChange()->format('Y-m-d')
1143  );
1144  });
1146  return array_map(function ($ass) use ($assignment_repository) {
1147  return $assignment_repository->getInstanceByModel($ass);
1148  }, array_values($assignments)); // use array values since we want keys 0...
1149  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignmentsOfSingleProgramForUser()

ilObjStudyProgramme::getAssignmentsOfSingleProgramForUser ( int  $usr_id)

Get assignments of user to this program-node only.

Returns
ilStudyProgrammeAssignment[]

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

References ilObject\getId().

Referenced by enableAutomaticMembershipSource(), and hasAssignmentsOfSingleProgramForUser().

1218  : array
1219  {
1220  return $this->assignment_repository->getByUsrIdAndPrgId($usr_id, $this->getId());
1221  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignmentsRaw()

ilObjStudyProgramme::getAssignmentsRaw ( )
protected

Get model objects for the assignments on this programm.

Returns
ilStudyProgrammeAssignment[]

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

References getIdsFromNodesOnPathFromRootToHere(), and ilStudyProgrammeAssignment\getLastChange().

Referenced by getAssignments().

1723  : array
1724  {
1725  $assignments = [];
1726  foreach ($this->getIdsFromNodesOnPathFromRootToHere(true) as $prg_id) {
1727  $assignments = array_merge($this->assignment_repository->getByPrgId($prg_id), $assignments);
1728  }
1729  usort(
1730  $assignments,
1731  function (ilStudyProgrammeAssignment $a_one, ilStudyProgrammeAssignment $a_other) {
1732  return strcmp(
1733  $a_one->getLastChange()->format('Y-m-d'),
1734  $a_other->getLastChange()->format('Y-m-d')
1735  );
1736  }
1737  );
1738  return $assignments;
1739  }
Represents one assignment of the user to a program tree.
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutomaticContentCategories()

ilObjStudyProgramme::getAutomaticContentCategories ( )

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

Returns
ilStudyProgrammeAutoCategory[]

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

References ilObject\getId().

Referenced by hasAutomaticContentCategories().

1409  : array
1410  {
1411  return $this->auto_categories_repository->getFor($this->getId());
1412  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutomaticMembershipSources()

ilObjStudyProgramme::getAutomaticMembershipSources ( )

Get sources for auto-memberships.

Returns
ilStudyProgrammeAutoMembershipSource[]

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

References ilObject\getId().

Referenced by getApplicableMembershipSourceForUser().

1542  : array
1543  {
1544  return $this->auto_memberships_repository->getFor($this->getId());
1545  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 520 of file class.ilObjStudyProgramme.php.

References $children, $data, ilContainerSorting\_getInstance(), ilObject\getId(), getInstanceByRefId(), ilObject\getRefId(), and throwIfNotInTree().

Referenced by addMissingProgresses(), applyToSubTreeNodes(), getAmountOfChildren(), and getIdsOfSuccessfulChildren().

520  : array
521  {
522  $this->throwIfNotInTree();
523 
524  if ($this->children === null) {
525  $ref_ids = $this->tree->getChildsByType($this->getRefId(), "prg");
526 
527  // apply container sorting to tree
528  $sorting = ilContainerSorting::_getInstance($this->getId());
529  $ref_ids = $sorting->sortItems(array('prg' => $ref_ids));
530  $ref_ids = $ref_ids['prg'];
531 
532  $this->children = array_map(function ($node_data) {
533  return ilObjStudyProgramme::getInstanceByRefId($node_data["child"]);
534  }, $ref_ids);
535  }
536 
537  if ($include_references && $this->reference_children === null) {
538  $this->reference_children = [];
539  $ref_child_ref_ids = $this->tree->getChildsByType($this->getRefId(), "prgr");
540  foreach ($this->children as $prg) {
541  $ref_child_ref_ids =
542  array_merge(
543  $this->tree->getChildsByType($prg->getRefId(), "prgr"),
544  $ref_child_ref_ids
545  );
546  }
547  foreach (
548  array_unique(
549  array_map(
550  function ($data) {
551  return $data['child'];
552  },
553  array_filter($ref_child_ref_ids, function ($data) {
554  return $data["deleted"] === null;
555  })
556  )
557  ) as $prg_ref_id
558  ) {
559  $this->reference_children[] =
560  (new ilObjStudyProgrammeReference($prg_ref_id))->getReferencedObject();
561  }
562  }
563  return $include_references ?
564  array_merge($this->children, $this->reference_children) :
565  $this->children;
566  }
$data
Definition: storeScorm.php:23
static getInstanceByRefId($a_ref_id)
getId()
get object id public
getRefId()
get reference id public
static _getInstance($a_obj_id)
get instance by obj_id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChildrenProgress()

ilObjStudyProgramme::getChildrenProgress (   $progress)
Returns
ilStudyProgrammeProgress[]

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

References $children, $ret, getObjIdsOfChildren(), and getProgressRepository().

Referenced by getAchievedPointsOfChildren(), and getPossiblePointsOfRelevantChildren().

2157  : array
2158  {
2159  $children = $this->getObjIdsOfChildren($progress->getNodeId());
2160  $ass_id = $progress->getAssignmentId();
2161 
2162  $ret = [];
2163  foreach ($children as $child_obj_id) {
2164  $progress = $this->getProgressRepository()->getByPrgIdAndAssignmentId($child_obj_id, $ass_id);
2165  $ret[] = $this->getProgressRepository()->getByPrgIdAndAssignmentId($child_obj_id, $ass_id);
2166  }
2167 
2168  return $ret;
2169  }
getObjIdsOfChildren(int $node_obj_id)
$ret
Definition: parser.php:6
+ 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 794 of file class.ilObjStudyProgramme.php.

References ilObject\_exists(), ilLPStatus\_hasUserCompleted(), ilObject\_lookupDeletedDate(), ilContainerReference\_lookupTargetId(), ilContainerReference\_lookupTitle(), and ilObject\getRefId().

794  : array
795  {
796  $node_data = $this->tree->getNodeData($this->getRefId());
797  $crsrs = $this->tree->getSubTree($node_data, true, "crsr");
798 
799  $completed_crss = array();
800  foreach ($crsrs as $ref) {
801  if (ilObject::_exists($ref['ref_id'], true) &&
802  is_null(ilObject::_lookupDeletedDate($ref['ref_id']))
803  ) {
804  $crs_id = ilContainerReference::_lookupTargetId($ref["obj_id"]);
805  if (ilLPStatus::_hasUserCompleted($crs_id, $a_user_id)) {
806  $containing_prg = self::getInstanceByRefId($ref["parent"]);
807  if ($containing_prg->isActive()) {
808  $completed_crss[] = [
809  "crs_id" => $crs_id
810  , "prg_ref_id" => $ref["parent"]
811  , "crsr_ref_id" => $ref["child"]
812  , "crsr_id" => $ref["obj_id"]
813  , "title" => ilContainerReference::_lookupTitle($ref["obj_id"])
814  ];
815  }
816  }
817  }
818  }
819  return $completed_crss;
820  }
static _lookupDeletedDate($a_ref_id)
only called in ilObjectGUI::insertSavedNodes
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static _lookupTitle($a_obj_id)
Overwitten from base class.
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
getRefId()
get reference id public
static _lookupTargetId($a_obj_id)
lookup target id
+ 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.

ilException

Parameters
string[]$a_subobjects

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

References $parent, 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().

1837  : array
1838  {
1839  if ($a_ref_id === null) {
1840  return $a_subobjects;
1841  }
1842 
1843  if (ilObject::_lookupType($a_ref_id, true) != "prg") {
1844  throw new ilException("Ref-Id '$a_ref_id' does not belong to a study programme object.");
1845  }
1846 
1848 
1849  $mode = $parent->getLPMode();
1850 
1851  switch ($mode) {
1853  $possible_subobjects = $a_subobjects;
1854  break;
1856  $possible_subobjects = [
1857  "prg" => $a_subobjects["prg"],
1858  "prgr" => $a_subobjects["prgr"]
1859  ];
1860  break;
1862  $possible_subobjects = ['crsr' => $a_subobjects['crsr']];
1863  break;
1864  default:
1865  throw new ilException("Undefined mode for study programme: '$mode'");
1866  }
1867 
1868  if ($parent->hasAutomaticContentCategories()) {
1869  $possible_subobjects = array_filter(
1870  $possible_subobjects,
1871  function ($subtype) {
1872  return $subtype === 'crsr';
1873  },
1874  ARRAY_FILTER_USE_KEY
1875  );
1876  }
1877  return $possible_subobjects;
1878  }
static getInstanceByRefId($a_ref_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
+ 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.

Exceptions
ilExceptionwhen this object is not in tree.

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

672  : int
673  {
674  $cur = $this;
675  $count = 0;
676  while ($cur = $cur->getParent()) {
677  $count++;
678  }
679  return $count;
680  }

◆ 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 1709 of file class.ilObjStudyProgramme.php.

References ilObject\getId(), and getParents().

Referenced by getAssignmentsOf(), and getAssignmentsRaw().

1709  : array
1710  {
1711  $prg_ids = array_map(function ($par) {
1712  return $par->getId();
1713  }, $this->getParents($include_references));
1714  $prg_ids[] = $this->getId();
1715  return $prg_ids;
1716  }
getId()
get object id public
getParents(bool $include_references=false)
Get all parents of the node, where the root of the program comes first.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIdsOfSuccessfulChildren()

ilObjStudyProgramme::getIdsOfSuccessfulChildren ( int  $ass_id)
Returns
array <obj_id, ref_id>

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

References $children, ilObject\$ref_id, ilObject\_exists(), ilLPStatus\_hasUserCompleted(), ilObject\_lookupDeletedDate(), ilContainerReference\_lookupTargetId(), ilContainerReference\_lookupTargetRefId(), getAssignmentRepository(), getChildren(), ilObject\getRefId(), and getTree().

Referenced by getNamesOfCompletedOrAccreditedChildren().

2064  : array
2065  {
2066  $children = $this->getChildren(true);
2067 
2068  $ids = array();
2069 
2070  foreach ($children as $child) {
2071  $prgrs = $child->getProgressForAssignment($ass_id);
2072  if (!$prgrs->isSuccessful()) {
2073  continue;
2074  }
2075  $ids[] = [$child->getId(), $child->getRefId()];
2076  }
2077  if (count($ids) > 0) {
2078  return $ids;
2079  }
2080 
2081  //courses:
2082  $children = $this->getTree()->getChildsByType($this->getRefId(), "crsr");
2083  $usr_id = $this->getAssignmentRepository()->get($ass_id)->getUserId();
2084  foreach ($children as $child) {
2085  if (ilObject::_exists($child['ref_id'], true) &&
2086  is_null(ilObject::_lookupDeletedDate($child['ref_id']))
2087  ) {
2088  continue;
2089  }
2090  $crs_id = ilContainerReference::_lookupTargetId($child["obj_id"]);
2091 
2092  if (ilLPStatus::_hasUserCompleted($crs_id, $usr_id)) {
2094  $ids[] = [$crs_id, $ref_id];
2095  }
2096  }
2097  return $ids;
2098  }
static _lookupDeletedDate($a_ref_id)
only called in ilObjectGUI::insertSavedNodes
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
getChildren(bool $include_references=false)
Get all ilObjStudyProgrammes that are direct children of this object.
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
getRefId()
get reference id public
static _lookupTargetRefId($a_obj_id)
Lookup target ref_id.
static _lookupTargetId($a_obj_id)
lookup target id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIdsOfUsersWithCompletedProgress()

ilObjStudyProgramme::getIdsOfUsersWithCompletedProgress ( )

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

Returns
int[]

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

References getProgresses().

Referenced by getIdsOfUsersWithFailedProgress().

1355  : array
1356  {
1357  $returns = array();
1358  foreach ($this->getProgresses() as $progress) {
1359  if ($progress->isSuccessful() && !$progress->isSuccessfulExpired()) {
1360  $returns[] = $progress->getUserId();
1361  }
1362  }
1363  return array_unique($returns);
1364  }
getProgresses()
Get all progresses on this node.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIdsOfUsersWithFailedProgress()

ilObjStudyProgramme::getIdsOfUsersWithFailedProgress ( )

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

Returns
int[]

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

References getIdsOfUsersWithCompletedProgress(), and getProgresses().

1371  : array
1372  {
1373  $returns = array();
1374  foreach ($this->getProgresses() as $progress) {
1375  if ($progress->isFailed() || $progress->isSuccessfulExpired()) {
1376  $returns[] = $progress->getUserId();
1377  }
1378  }
1379  return array_unique(array_diff($returns, $this->getIdsOfUsersWithCompletedProgress()));
1380  }
getIdsOfUsersWithCompletedProgress()
Get the ids of all users that have completed this programme.
getProgresses()
Get all progresses on this node.
+ Here is the call graph for this function:

◆ 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 1389 of file class.ilObjStudyProgramme.php.

References getProgresses().

1389  : array
1390  {
1391  $returns = array();
1392  foreach ($this->getProgresses() as $progress) {
1393  if ($progress->isRelevant() && !$progress->isSuccessful()) {
1394  $returns[] = $progress->getUserId();
1395  }
1396  }
1397  return array_unique($returns);
1398  }
getProgresses()
Get all progresses on this node.
+ Here is the call graph for this function:

◆ getIdsOfUsersWithRelevantProgress()

ilObjStudyProgramme::getIdsOfUsersWithRelevantProgress ( )

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

Returns
int[]

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

References getProgresses().

1339  : array
1340  {
1341  $returns = array();
1342  foreach ($this->getProgresses() as $progress) {
1343  if ($progress->isRelevant()) {
1344  $returns[] = $progress->getUserId();
1345  }
1346  }
1347  return array_unique($returns);
1348  }
getProgresses()
Get all progresses on this node.
+ Here is the call graph for this function:

◆ getInstanceByObjId()

static ilObjStudyProgramme::getInstanceByObjId (   $obj_id)
static

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

Referenced by ilStudyProgrammeProgressListGUI\buildProgressBar(), ilStudyProgrammeIndividualPlanProgressListGUI\buildProgressStatus(), ilStudyProgrammeProgressListGUI\buildProgressStatus(), ilStudyProgrammeIndividualPlanTableGUI\fetchData(), ilStudyProgrammeMembersTableGUI\fetchData(), ilStudyProgrammeProgressListGUI\fillTemplate(), ilStudyProgrammeDashboardViewGUI\findValid(), ilStudyProgrammeExpandableProgressListGUI\getAccordionContentCoursesHTML(), ilStudyProgrammeExpandableProgressListGUI\getAccordionContentHTML(), ilStudyProgrammeExpandableProgressListGUI\getAccordionContentProgressesHTML(), ilStudyProgrammeDashboardViewGUI\getHTML(), ilPDStudyProgrammeSimpleListGUI\hasPermission(), ilStudyProgrammeDashboardViewGUI\hasPermission(), ilPDStudyProgrammeExpandableListGUI\new_ilStudyProgrammeAssignmentListGUI(), ilPDStudyProgrammeSimpleListGUI\new_ilStudyProgrammeAssignmentListGUI(), ilStudyProgrammeAppEventListener\onServiceUserDeleteUser(), ilPrgUpdateProgressCronJob\run(), ilPrgRestartAssignmentsCronJob\run(), sendInformToReAssignMail(), sendRiskyToFailMail(), ilStudyProgrammeExpandableProgressListGUI\shouldShowSubProgress(), and ilObjStudyProgrammeIndividualPlanGUI\view().

206  {
207  return self::getInstanceByRefId(self::getRefIdFor($obj_id));
208  }
+ Here is the caller graph for this function:

◆ getInstanceByRefId()

static ilObjStudyProgramme::getInstanceByRefId (   $a_ref_id)
static

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

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

211  {
212  if (self::$study_programme_cache === null) {
213  self::initStudyProgrammeCache();
214  }
215  return self::$study_programme_cache->getInstanceByRefId($a_ref_id);
216  }
+ 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 365 of file class.ilObjStudyProgramme.php.

References getSettings().

365  : DateTime
366  {
367  return $this->getSettings()->getLastChange();
368  }
+ Here is the call graph for this function:

◆ getLocalMembers()

ilObjStudyProgramme::getLocalMembers ( )

get usr_ids with assignment on this node

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

References $members_cache, and ilObject\getId().

1179  : array
1180  {
1181  if (!$this->members_cache) {
1182  $this->members_cache = array_map(
1183  function ($assignment) {
1184  return $assignment->getUserId();
1185  },
1186  $this->assignment_repository->getByPrgId($this->getId())
1187  );
1188  }
1189  return $this->members_cache;
1190  }
getId()
get object id public
+ Here is the call graph for this function:

◆ getLoggedInUserId()

ilObjStudyProgramme::getLoggedInUserId ( )
protected

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

Referenced by applyProgressDeadline(), and assignUser().

2111  : int
2112  {
2113  return (int) $this->ilUser->getId();
2114  }
+ Here is the caller graph for this function:

◆ getLogger()

ilObjStudyProgramme::getLogger ( )
protected

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

Referenced by addMissingProgresses().

235  {
236  return $this->logger;
237  }
Component logger with individual log levels by component id.
+ Here is the caller 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 703 of file class.ilObjStudyProgramme.php.

References $lp_children, ilContainerSorting\_getInstance(), ilObject\getId(), ilObject\getRefId(), and throwIfNotInTree().

Referenced by getAmountOfLPChildren(), and getLPChildrenIds().

704  {
705  $this->throwIfNotInTree();
706 
707  if ($this->lp_children === null) {
708  $this->lp_children = array();
709 
710  $ref_ids = $this->tree->getChildsByType($this->getRefId(), "crsr");
711 
712  // apply container sorting to tree
713  $sorting = ilContainerSorting::_getInstance($this->getId());
714  $ref_ids = $sorting->sortItems(array('crs_ref' => $ref_ids));
715  $ref_ids = $ref_ids['crs_ref'];
716 
717  $lp_children = array_map(function ($node_data) {
718  $lp_obj = $this->object_factory->getInstanceByRefId($node_data["child"]);
719 
720  // filter out all StudyProgramme instances
721  return ($lp_obj instanceof $this) ? null : $lp_obj;
722  }, $ref_ids);
723 
724  $this->lp_children = array_filter($lp_children);
725  }
726  return $this->lp_children;
727  }
getId()
get object id public
getRefId()
get reference id public
static _getInstance($a_obj_id)
get instance by obj_id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLPChildrenIds()

ilObjStudyProgramme::getLPChildrenIds ( )

Get the obj-ids of the leafs the program contains.

Returns
ilStudyProgrammeLeaf[]
Exceptions
ilStudyProgrammeTreeException

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

References getLPChildren().

736  {
737  return array_map(function ($child) {
738  return $child->getId();
739  }, $this->getLPChildren());
740  }
getLPChildren()
Get the leafs the study programme contains.
+ Here is the call graph for this function:

◆ getLPMode()

ilObjStudyProgramme::getLPMode ( )

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

References getSettings().

Referenced by addNode(), canBeCompleted(), and nodeInserted().

392  : int
393  {
394  return $this->getSettings()->getLPMode();
395  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMembers()

ilObjStudyProgramme::getMembers ( )

get usr_ids with any progress on this node

Returns
int[]

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

References getProgresses().

1168  : array
1169  {
1170  $usr_ids = [];
1171  foreach ($this->getProgresses() as $progress) {
1172  $usr_ids[] = $progress->getUserId();
1173  }
1174  return array_unique($usr_ids);
1175  }
getProgresses()
Get all progresses on this node.
+ Here is the call 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 1605 of file class.ilObjStudyProgramme.php.

Referenced by enableAutomaticMembershipSource(), and getApplicableMembershipSourceForUser().

1605  : array
1606  {
1607  $source_reader = $this->membersourcereader_factory->getReaderFor($src_type, $src_id);
1608  return $source_reader->getMemberIds();
1609  }
+ Here is the caller graph for this function:

◆ getNamesOfCompletedOrAccreditedChildren()

ilObjStudyProgramme::getNamesOfCompletedOrAccreditedChildren ( int  $ass_id)

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

References ilObject\$ref_id, ilObject\_lookupTitle(), and getIdsOfSuccessfulChildren().

2100  : array
2101  {
2102  return array_map(
2103  function ($entry) {
2104  list($obj_id, $ref_id) = $entry;
2106  },
2107  $this->getIdsOfSuccessfulChildren($ass_id)
2108  );
2109  }
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:

◆ getNow()

ilObjStudyProgramme::getNow ( )
protected

◆ getObjIdsOfChildren()

ilObjStudyProgramme::getObjIdsOfChildren ( int  $node_obj_id)
protected

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

References $nd.

Referenced by getChildrenProgress().

2132  : array
2133  {
2134  $node_ref_id = self::getRefIdFor($node_obj_id);
2135 
2136  $prgs = $this->tree->getChildsByType($node_ref_id, "prg");
2137  $prg_ids = array_map(
2138  function ($nd) {
2139  return (int) $nd['obj_id'];
2140  },
2141  $prgs
2142  );
2143 
2144  $prg_ref_ids = [];
2145  $prg_refs = $this->tree->getChildsByType($node_ref_id, "prgr");
2146  foreach ($prg_refs as $ref) {
2147  $ref_obj = new ilObjStudyProgrammeReference((int) $ref['ref_id']);
2148  $prg_ref_ids[] = (int) $ref_obj->getReferencedObject()->getId();
2149  }
2150 
2151  return array_merge($prg_ids, $prg_ref_ids);
2152  }
$nd
Definition: error.php:12
+ Here is the caller graph for this function:

◆ getParent()

ilObjStudyProgramme::getParent ( )

Get the parent ilObjStudyProgramme of this object.

Returns null if parent is no StudyProgramme.

Exceptions
ilExceptionwhen this object is not in tree.

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

References $parent, getInstanceByRefId(), ilObject\getRefId(), and throwIfNotInTree().

Referenced by moveTo(), removeNode(), and updateLastChange().

575  {
576  if ($this->parent === false) {
577  $this->throwIfNotInTree();
578  $parent_data = $this->tree->getParentNodeData($this->getRefId());
579  if ($parent_data["type"] != "prg") {
580  $this->parent = null;
581  } else {
582  $this->parent = ilObjStudyProgramme::getInstanceByRefId($parent_data["ref_id"]);
583  }
584  }
585  return $this->parent;
586  }
static getInstanceByRefId($a_ref_id)
getRefId()
get reference id public
+ 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 1794 of file class.ilObjStudyProgramme.php.

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

1795  {
1796  global $DIC;
1797  $tree = $DIC['tree'];
1798  if (!$tree->isInTree($a_object->getRefId())) {
1799  return null;
1800  }
1801 
1802  $nd = $tree->getParentNodeData($a_object->getRefId());
1803  return $nd["obj_id"];
1804  }
$nd
Definition: error.php:12
global $DIC
Definition: goto.php:24
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ getParentProgress()

ilObjStudyProgramme::getParentProgress ( ilStudyProgrammeProgress  $progress)
protected

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

References ilObject\_getAllReferences(), ilContainerReference\_lookupSourceIds(), ilStudyProgrammeProgress\getAssignmentId(), ilStudyProgrammeProgress\getNodeId(), and getRefIdFor().

Referenced by markNotRelevant(), and updateParentProgress().

2172  {
2173  $assignment_id = $progress->getAssignmentId();
2174 
2175  $prg_ref_id = $this->getRefIdFor($progress->getNodeId());
2176  $parent_node = $this->tree->getParentNodeData($prg_ref_id);
2177  $parent_prg_obj_id = (int) $parent_node["obj_id"];
2178 
2179  $parent_progress = $this->progress_repository->getByPrgIdAndAssignmentId(
2180  $parent_prg_obj_id,
2181  $assignment_id
2182  );
2183 
2184  if (!$parent_progress) {
2185  //maybe by reference?
2186  $obj_ids_referencing_node = ilContainerReference::_lookupSourceIds($progress->getNodeId());
2187  foreach (ilContainerReference::_lookupSourceIds($progress->getNodeId()) as $obj_id_referencing) {
2188  foreach (ilObject::_getAllReferences($obj_id_referencing) as $ref_id_referencing) {
2189  $parent_node = $this->tree->getParentNodeData($ref_id_referencing);
2190  $parent_prg_obj_id = (int) $parent_node["obj_id"];
2191 
2192  $parent_progress = $this->progress_repository->getByPrgIdAndAssignmentId(
2193  $parent_prg_obj_id,
2194  $assignment_id
2195  );
2196  if ($parent_progress) {
2197  return $parent_progress;
2198  }
2199  }
2200  }
2201  }
2202 
2203  return $parent_progress; //...which is null here
2204  }
getAssignmentId()
Get the assignment this progress belongs to.
static _getAllReferences($a_id)
get all reference ids of object
Class ilStudyProgrammeProgress.
static getRefIdFor(int $obj_id)
static _lookupSourceIds($a_target_id)
Get ids of all container references that target the object with the given id.
getNodeId()
Get the obj_id of the program node this progress belongs to.
+ Here is the call graph for this function:
+ Here is the caller 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 618 of file class.ilObjStudyProgramme.php.

References $parent, and getReferencesTo().

Referenced by getIdsFromNodesOnPathFromRootToHere(), and getRoot().

618  : array
619  {
620  $current = $this;
621  $parents = [];
622  $queque = [$current];
623  while ($element = array_shift($queque)) {
624  $parent = $element->getParent();
625  if ($parent === null || $include_references) {
626  foreach ($this->getReferencesTo($element) as $reference) {
627  if ($this->tree->isDeleted($reference->getRefId())) {
628  continue;
629  }
630  $r_parent = $reference->getParent();
631  if (is_null($r_parent)) {
632  continue;
633  }
634  array_push($queque, $r_parent);
635  $parents[] = $r_parent;
636  }
637  continue;
638  }
639  array_push($queque, $parent);
640  $parents[] = $parent;
641  }
642  return array_reverse($parents);
643  }
getReferencesTo(ilObjStudyProgramme $prg)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPoints()

ilObjStudyProgramme::getPoints ( )

Get the amount of points.

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

References getSettings().

Referenced by ilStudyProgrammeDashboardViewGUI\calculatePercent(), and resetProgressToSettings().

373  : int
374  {
375  return $this->getSettings()->getAssessmentSettings()->getPoints();
376  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPossiblePointsOfRelevantChildren()

ilObjStudyProgramme::getPossiblePointsOfRelevantChildren ( ilStudyProgrammeProgress  $progress)

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

References getChildrenProgress().

Referenced by canBeCompleted().

2207  : int
2208  {
2209  $sum = 0;
2210  foreach ($this->getChildrenProgress($progress) as $child_progress) {
2211  if (!is_null($child_progress) && $child_progress->isRelevant()) {
2212  $sum += $child_progress->getAmountOfPoints();
2213  }
2214  }
2215  return $sum;
2216  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPrgInstanceByObjId()

ilObjStudyProgramme::getPrgInstanceByObjId ( int  $obj_id)
protected

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

Referenced by updatePlanFromRepository().

201  {
202  return self::getInstanceByRefId(self::getRefIdFor($obj_id));
203  }
+ Here is the caller graph for this function:

◆ getProgrammeSettingsForProgress()

ilObjStudyProgramme::getProgrammeSettingsForProgress ( ilStudyProgrammeProgress  $progress)
protected

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

References ilStudyProgrammeProgress\getNodeId().

2127  {
2128  return $this->settings_repository->get($progress->getNodeId());
2129  }
getNodeId()
Get the obj_id of the program node this progress belongs to.
+ Here is the call graph for this function:

◆ getProgrammesMonitoringCategory()

static ilObjStudyProgramme::getProgrammesMonitoringCategory ( int  $cat_ref_id)
staticprotected

Get all StudyProgrammes monitoring this category.

Returns
ilObjStudyProgramme[]

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

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

1492  : array
1493  {
1494  $db = ilStudyProgrammeDIC::dic()['model.AutoCategories.ilStudyProgrammeAutoCategoriesRepository'];
1495  $programmes = array_map(
1496  function ($rec) {
1497  $prg_obj_id = (int) array_shift(array_values($rec));
1498  $prg_ref_id = (int) array_shift(ilObject::_getAllReferences($prg_obj_id));
1499  $prg = self::getInstanceByRefId($prg_ref_id);
1500  if ($prg->isAutoContentApplicable()) {
1501  return $prg;
1502  }
1503  },
1504  $db::getProgrammesFor($cat_ref_id)
1505  );
1506  return $programmes;
1507  }
static _getAllReferences($a_id)
get all reference ids of object
+ 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 1616 of file class.ilObjStudyProgramme.php.

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

1616  : array
1617  {
1618  $db = ilStudyProgrammeDIC::dic()['model.AutoMemberships.ilStudyProgrammeAutoMembershipsRepository'];
1619  $programmes = array_map(
1620  function ($rec) {
1621  $prg_obj_id = (int) array_shift(array_values($rec));
1622  $prg_ref_id = (int) array_shift(ilObject::_getAllReferences($prg_obj_id));
1623  $prg = self::getInstanceByRefId($prg_ref_id);
1624  return $prg;
1625  },
1626  $db::getProgrammesFor($src_type, $src_id)
1627  );
1628  return $programmes;
1629  }
static _getAllReferences($a_id)
get all reference ids of object
+ Here is the call graph for this function:

◆ getProgresses()

ilObjStudyProgramme::getProgresses ( )

Get all progresses on this node.

Returns
ilStudyProgrammeProgress[]

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

References ilObject\getId().

Referenced by canBeRemoved(), getIdsOfUsersWithCompletedProgress(), getIdsOfUsersWithFailedProgress(), getIdsOfUsersWithNotCompletedAndRelevantProgress(), getIdsOfUsersWithRelevantProgress(), getMembers(), hasProgresses(), and hasRelevantProgresses().

1308  : array
1309  {
1310  return $this->progress_repository->getByPrgId($this->getId());
1311  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProgressesOf()

ilObjStudyProgramme::getProgressesOf ( int  $a_user_id)

Get the progresses the user has on this node.

Parameters
int$a_user_id
Returns
ilStudyProgrammeProgress[]

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

References ilObject\getId().

Referenced by ilStudyProgrammeMailTemplateContext\getNewestProgressForUser().

1250  : array
1251  {
1252  return $this->progress_repository->getByPrgIdAndUserId($this->getId(), $a_user_id);
1253  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProgressForAssignment()

ilObjStudyProgramme::getProgressForAssignment ( int  $assignment_id)

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

References ilObject\getId(), and getProgressRepository().

1256  {
1257  return $this->getProgressRepository()->getByPrgIdAndAssignmentId($this->getId(), $assignment_id);
1258  }
getId()
get object id public
Class ilStudyProgrammeProgress.
+ Here is the call graph for this function:

◆ getProgressIdString()

ilObjStudyProgramme::getProgressIdString ( ilStudyProgrammeProgress  $progress)
protected

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

References ilObjUser\_lookupFullname(), ilStudyProgrammeProgress\getId(), and ilStudyProgrammeProgress\getUserId().

Referenced by changeAmountOfPoints(), changeProgressDeadline(), changeProgressValidityDate(), markAccredited(), markNotRelevant(), markRelevant(), and unmarkAccredited().

2745  : string
2746  {
2747  $username = ilObjUser::_lookupFullname($progress->getUserId());
2748  return sprintf(
2749  '%s, progress-id %s',
2750  $username,
2751  $progress->getId()
2752  );
2753  }
static _lookupFullname($a_user_id)
Lookup Full Name.
getId()
Get the id of the progress.
getUserId()
Get the id of the user this progress is for.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProgressRepository()

◆ getReferencesTo()

ilObjStudyProgramme::getReferencesTo ( ilObjStudyProgramme  $prg)
protected

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

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

Referenced by getParents(), and getReferencesToSelf().

588  : array
589  {
590  $tree = $this->tree;
591  return array_filter(
592  array_map(
593  function ($id) {
594  return new ilObjStudyProgrammeReference(
595  array_shift(
597  )
598  );
599  },
601  ),
602  function ($prg_ref) use ($tree) {
603  return !$tree->isDeleted((int) $prg_ref->getRefId());
604  }
605  );
606  }
static _getAllReferences($a_id)
get all reference ids of object
getId()
get object id public
static _lookupSourceIds($a_target_id)
Get ids of all container references that target the object with the given id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getReferencesToSelf()

ilObjStudyProgramme::getReferencesToSelf ( )

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

References getReferencesTo().

608  : array
609  {
610  return $this->getReferencesTo($this);
611  }
getReferencesTo(ilObjStudyProgramme $prg)
+ Here is the call graph for this function:

◆ getRefIdFor()

static ilObjStudyProgramme::getRefIdFor ( int  $obj_id)
static

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

References ilObject\_getAllReferences().

Referenced by getParentProgress(), ilStudyProgrammeMailMemberSearchGUI\getRootPrgRefId(), ilObjStudyProgrammeMembersGUI\remove(), and ilStudyProgrammeEvents\userReAssigned().

191  : int
192  {
194  if (count($refs) < 1) {
195  throw new ilException("Could not find ref_id for programme with obj_id $obj_id");
196  }
197  return (int) array_shift($refs);
198  }
static _getAllReferences($a_id)
get all reference ids of object
+ Here is the call graph for this function:
+ 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 688 of file class.ilObjStudyProgramme.php.

References getParents().

689  {
690  $parents = $this->getParents();
691  if (count($parents) < 1) {
692  return $this;
693  }
694  return $parents[0];
695  }
getParents(bool $include_references=false)
Get all parents of the node, where the root of the program comes first.
+ Here is the call graph for this function:

◆ getSettings()

◆ getSettingsRepository()

ilObjStudyProgramme::getSettingsRepository ( )
protected

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

References $settings_repository.

Referenced by addMissingProgresses(), create(), deleteSettings(), getSettings(), recalculateProgressStatus(), and updateSettings().

227  {
229  }
Covers the persistence of settings belonging to a study programme (SP).
+ Here is the caller graph for this function:

◆ getStatus()

ilObjStudyProgramme::getStatus ( )

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

References getSettings().

Referenced by assignUser(), ilStudyProgrammeIndividualPlanProgressListGUI\getTitleForItem(), isActive(), and isAutoContentApplicable().

430  : int
431  {
432  return $this->getSettings()->getAssessmentSettings()->getStatus();
433  }
+ 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 459 of file class.ilObjStudyProgramme.php.

References getSettings().

Referenced by updateCustomIcon().

460  {
461  $type_settings = $this->getSettings()->getTypeSettings();
462  if (!in_array($type_settings->getTypeId(), array("-", "0"))) {
463  $subtype_id = $type_settings->getTypeId();
464  return $this->type_repository->getType($subtype_id);
465  }
466 
467  return null;
468  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTree()

ilObjStudyProgramme::getTree ( )
protected

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

References $tree.

Referenced by getIdsOfSuccessfulChildren().

230  : ilTree
231  {
232  return $this->tree;
233  }
+ Here is the caller graph for this function:

◆ hasAdvancedMetadata()

ilObjStudyProgramme::hasAdvancedMetadata ( )

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

References ilObject\$type, and getSettings().

348  : bool
349  {
350  $sub_type_id = $this->getSettings()->getTypeSettings()->getTypeId();
351  if ($sub_type_id) {
352  $type = $this->type_repository->getType($sub_type_id);
353  }
354 
355  return !is_null($type) && count($this->type_repository->getAssignedAMDRecordIdsByType($type->getId(), true)) > 0;
356  }
+ Here is the call 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 1108 of file class.ilObjStudyProgramme.php.

References getAmountOfAssignmentsOf().

1108  : bool
1109  {
1110  return $this->getAmountOfAssignmentsOf($a_user_id) > 0;
1111  }
getAmountOfAssignmentsOf(int $a_user_id)
Get the amount of assignments a user has on this program node or any node above.
+ Here is the call graph for this function:

◆ hasAssignments()

ilObjStudyProgramme::hasAssignments ( )

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

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

References getAssignments().

1195  : bool
1196  {
1197  return count($this->getAssignments()) > 0;
1198  }
getAssignments()
Get all assignments to this program or any node above.
+ Here is the call graph for this function:

◆ hasAssignmentsOfSingleProgramForUser()

ilObjStudyProgramme::hasAssignmentsOfSingleProgramForUser ( int  $usr_id)

Get assignments of user to this program-node only.

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

References getAssignmentsOfSingleProgramForUser().

1226  : bool
1227  {
1228  return count($this->getAssignmentsOfSingleProgramForUser($usr_id)) > 0;
1229  }
getAssignmentsOfSingleProgramForUser(int $usr_id)
Get assignments of user to this program-node only.
+ Here is the call graph for this function:

◆ hasAutomaticContentCategories()

ilObjStudyProgramme::hasAutomaticContentCategories ( )

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

References getAutomaticContentCategories().

1414  : bool
1415  {
1416  return count($this->getAutomaticContentCategories()) > 0;
1417  }
getAutomaticContentCategories()
Get configuration of categories with auto-content for this StudyProgramme;.
+ Here is the call graph for this function:

◆ hasChildren()

ilObjStudyProgramme::hasChildren ( bool  $include_references = false)

Does this StudyProgramme have other ilObjStudyProgrammes as children?

Exceptions
ilStudyProgrammeTreeException

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

References getAmountOfChildren().

Referenced by addLeaf().

650  : bool
651  {
652  return $this->getAmountOfChildren($include_references) > 0;
653  }
getAmountOfChildren($include_references=false)
Get the amount of other StudyProgrammes this StudyProgramme has as children.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasLPChildren()

ilObjStudyProgramme::hasLPChildren ( )

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

References getAmountOfLPChildren().

Referenced by ilStudyProgrammeDashboardViewGUI\calculatePercent(), and isAutoContentApplicable().

752  : bool
753  {
754  return ($this->getAmountOfLPChildren() > 0);
755  }
getAmountOfLPChildren()
Get the amount of leafs, the study programme contains.
+ Here is the call graph for this function:
+ 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 1316 of file class.ilObjStudyProgramme.php.

References getProgresses().

1316  : bool
1317  {
1318  return count($this->getProgresses()) > 0;
1319  }
getProgresses()
Get all progresses on this node.
+ Here is the call graph for this function:

◆ hasRelevantProgresses()

ilObjStudyProgramme::hasRelevantProgresses ( )

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

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

References getProgresses().

1324  : bool
1325  {
1326  foreach ($this->getProgresses() as $progress) {
1327  if ($progress->isRelevant()) {
1328  return true;
1329  }
1330  }
1331  return false;
1332  }
getProgresses()
Get all progresses on this node.
+ Here is the call graph for this function:

◆ initStudyProgrammeCache()

static ilObjStudyProgramme::initStudyProgrammeCache ( )
static

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

References ilObjStudyProgrammeCache\singleton().

159  : void
160  {
161  if (self::$study_programme_cache === null) {
162  self::$study_programme_cache = ilObjStudyProgrammeCache::singleton();
163  }
164  }
+ Here is the call graph for this function:

◆ invalidate()

ilObjStudyProgramme::invalidate ( int  $progress_id)

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

References getProgressRepository(), refreshLPStatus(), and updateParentProgress().

2491  : void
2492  {
2493  $progress = $this->getProgressRepository()->get($progress_id)
2494  ->invalidate();
2495 
2496  $this->getProgressRepository()->update($progress);
2497  $this->refreshLPStatus($progress->getUserId());
2498  $this->updateParentProgress($progress);
2499  }
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ isActive()

ilObjStudyProgramme::isActive ( )

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

References getStatus(), and ilStudyProgrammeSettings\STATUS_ACTIVE.

Referenced by updateProgressRelevanceFromSettings().

+ Here is the call graph for this function:
+ Here is the caller 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 1515 of file class.ilObjStudyProgramme.php.

References getAmountOfChildren(), getSettings(), getStatus(), hasLPChildren(), ilStudyProgrammeSettings\STATUS_ACTIVE, and ilStudyProgrammeSettings\STATUS_DRAFT.

1515  : bool
1516  {
1517  $valid_status = in_array(
1518  $this->getSettings()->getAssessmentSettings()->getStatus(),
1519  [
1522  ]
1523  );
1524 
1525  $crslnk_allowed = (
1526  $this->hasLPChildren()
1527  || $this->getAmountOfChildren(true) === 0
1528  );
1529 
1530  return $valid_status && $crslnk_allowed;
1531  }
getAmountOfChildren($include_references=false)
Get the amount of other StudyProgrammes this StudyProgramme has as children.
+ Here is the call graph for this function:

◆ markAccredited()

ilObjStudyProgramme::markAccredited ( int  $progress_id,
int  $acting_usr_id,
ilPRGMessageCollection  $err_collection 
)

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

References ilPRGMessageCollection\add(), getNow(), getProgressIdString(), getProgressRepository(), refreshLPStatus(), updateParentProgress(), and updateProgressValidityFromSettings().

2344  : void {
2345  $progress = $this->getProgressRepository()->get($progress_id);
2346  $new_status = $progress::STATUS_ACCREDITED;
2347 
2348  if (!$progress->isRelevant()) {
2349  $err_collection->add(false, 'will_not_modify_irrelevant_progress', $this->getProgressIdString($progress));
2350  return;
2351  }
2352  if ($progress->getStatus() === $new_status) {
2353  $err_collection->add(false, 'status_unchanged', $this->getProgressIdString($progress));
2354  return;
2355  }
2356  if (!$progress->isTransitionAllowedTo($new_status)) {
2357  $err_collection->add(false, 'status_transition_not_allowed', $this->getProgressIdString($progress));
2358  return;
2359  }
2360 
2361  $progress = $progress
2362  ->markAccredited($this->getNow(), $acting_usr_id)
2363  ->withCurrentAmountOfPoints($progress->getAmountOfPoints());
2364 
2365  if (!$progress->getValidityOfQualification()) {
2366  $progress = $this->updateProgressValidityFromSettings($progress);
2367  }
2368 
2369  $this->events->userSuccessful($progress);
2370 
2371  $this->getProgressRepository()->update($progress);
2372  $this->refreshLPStatus($progress->getUserId());
2373  $this->updateParentProgress($progress);
2374  $err_collection->add(true, 'status_changed', $this->getProgressIdString($progress));
2375  }
add(bool $success, string $message, string $record_identitifer)
getProgressIdString(ilStudyProgrammeProgress $progress)
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ markFailed()

ilObjStudyProgramme::markFailed ( int  $progress_id,
int  $acting_usr_id 
)

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

References getNow(), getProgressRepository(), refreshLPStatus(), and updateParentProgress().

2415  : void
2416  {
2417  $progress = $this->getProgressRepository()->get($progress_id);
2418  if (!$progress->isRelevant()) {
2419  return;
2420  }
2421  $progress = $progress->markFailed($this->getNow(), $acting_usr_id);
2422 
2423  $this->getProgressRepository()->update($progress);
2424  $this->refreshLPStatus($progress->getUserId());
2425  $this->updateParentProgress($progress);
2426  }
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ markNotFailed()

ilObjStudyProgramme::markNotFailed ( int  $progress_id,
int  $acting_usr_id 
)

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

References getNow(), getProgressRepository(), refreshLPStatus(), and updateParentProgress().

2428  : void
2429  {
2430  if (!$progress->isRelevant()) {
2431  return;
2432  }
2433  $progress = $this->getProgressRepository()->get($progress_id)
2434  ->markNotFailed($this->getNow(), $acting_usr_id);
2435 
2436  $this->getProgressRepository()->update($progress);
2437  $this->refreshLPStatus($progress->getUserId());
2438  $this->updateParentProgress($progress);
2439  }
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ markNotRelevant()

ilObjStudyProgramme::markNotRelevant ( int  $progress_id,
int  $acting_usr_id,
ilPRGMessageCollection  $err_collection 
)

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

References ilPRGMessageCollection\add(), getNow(), getParentProgress(), getProgressIdString(), getProgressRepository(), refreshLPStatus(), ilStudyProgrammeProgress\STATUS_COMPLETED, and updateParentProgress().

2445  : void {
2446  $progress = $this->getProgressRepository()->get($progress_id);
2447  if (!$progress->isRelevant()) {
2448  $err_collection->add(false, 'will_not_modify_irrelevant_progress', $this->getProgressIdString($progress));
2449  return;
2450  }
2451  if (is_null($this->getParentProgress($progress))) {
2452  $err_collection->add(false, 'will_not_set_top_progress_to_irrelevant', $this->getProgressIdString($progress));
2453  return;
2454  }
2455  if ($progress->getStatus() === ilStudyProgrammeProgress::STATUS_COMPLETED) {
2456  $err_collection->add(false, 'will_not_set_completed_progress_to_irrelevant_', $this->getProgressIdString($progress));
2457  return;
2458  }
2459 
2460  $progress = $progress
2461  ->markNotRelevant($this->getNow(), $acting_usr_id);
2462 
2463  $this->getProgressRepository()->update($progress);
2464  $this->refreshLPStatus($progress->getUserId());
2465  $this->updateParentProgress($progress);
2466  $err_collection->add(true, 'set_to_irrelevant', $this->getProgressIdString($progress));
2467  }
add(bool $success, string $message, string $record_identitifer)
getProgressIdString(ilStudyProgrammeProgress $progress)
getParentProgress(ilStudyProgrammeProgress $progress)
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ markRelevant()

ilObjStudyProgramme::markRelevant ( int  $progress_id,
int  $acting_usr_id,
ilPRGMessageCollection  $err_collection 
)

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

References ilPRGMessageCollection\add(), getNow(), getProgressIdString(), getProgressRepository(), recalculateProgressStatus(), refreshLPStatus(), and updateParentProgress().

2473  : void {
2474  $progress = $this->getProgressRepository()->get($progress_id);
2475  if ($progress->isRelevant()) {
2476  $err_collection->add(false, 'will_not_modify_relevant_progress', $this->getProgressIdString($progress));
2477  return;
2478  }
2479 
2480  $progress = $progress
2481  ->markRelevant($this->getNow(), $acting_usr_id);
2482 
2483  $progress = $this->recalculateProgressStatus($progress);
2484 
2485  $this->getProgressRepository()->update($progress);
2486  $this->refreshLPStatus($progress->getUserId());
2487  $this->updateParentProgress($progress);
2488  $err_collection->add(true, 'set_to_relevant', $this->getProgressIdString($progress));
2489  }
add(bool $success, string $message, string $record_identitifer)
recalculateProgressStatus(ilStudyProgrammeProgress $progress)
getProgressIdString(ilStudyProgrammeProgress $progress)
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ 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 1004 of file class.ilObjStudyProgramme.php.

References $DIC, $parent, ilObject\$rbacadmin, clearChildrenCache(), clearLPChildrenCache(), clearParentCache(), getParent(), and ilObject\getRefId().

1005  {
1006  global $DIC;
1007  $rbacadmin = $DIC['rbacadmin'];
1008 
1009  if ($parent = $this->getParent()) {
1010 
1011  // TODO: check if there some leafs in the new parent
1012 
1013  $this->tree->moveTree($this->getRefId(), $a_new_parent->getRefId());
1014  // necessary to clean up permissions
1015  $rbacadmin->adjustMovedObjectPermissions($this->getRefId(), $parent->getRefId());
1016 
1017  // TODO: lp-progress needs to be updated
1018 
1019  // clear caches on different nodes
1020  $this->clearParentCache();
1021 
1022  $parent->clearChildrenCache();
1023  $parent->clearLPChildrenCache();
1024 
1025  $a_new_parent->clearChildrenCache();
1026  $a_new_parent->clearLPChildrenCache();
1027  }
1028 
1029  return $this;
1030  }
clearLPChildrenCache()
Clear the cached lp children.
getParent()
Get the parent ilObjStudyProgramme of this object.
clearChildrenCache()
Clear the cached children.
global $DIC
Definition: goto.php:24
getRefId()
get reference id public
clearParentCache()
Clear the cached parent to query it again at the tree.
+ Here is the call graph for this function:

◆ nodeInserted()

ilObjStudyProgramme::nodeInserted ( ilObjStudyProgramme  $a_prg)

Clears child chache and adds progress for new node.

called by ilObjStudyProgrammeReference::putInTree, e.g.

Exceptions
ilStudyProgrammeTreeException
ilException

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

References addMissingProgresses(), clearChildrenCache(), getLPMode(), getSettings(), ilStudyProgrammeSettings\MODE_LP_COMPLETED, and ilStudyProgrammeSettings\MODE_POINTS.

863  {
865  throw new ilStudyProgrammeTreeException("Program already contains leafs.");
866  }
867 
869  $this->settings_repository->update(
871  );
872  }
873 
874  $this->clearChildrenCache();
875  $this->addMissingProgresses();
876  }
clearChildrenCache()
Clear the cached children.
addMissingProgresses()
Add missing progress records for all assignments of this programm.
Exception is thrown when invariants on the program tree would be violated by manipulation of tree...
+ 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

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

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

Referenced by addNode().

888  {
889  $res = parent::putInTree($a_parent_ref);
890 
891  if (ilObject::_lookupType($a_parent_ref, true) == "prg") {
892  $par = ilObjStudyProgramme::getInstanceByRefId($a_parent_ref);
893  $par->nodeInserted($this);
894  }
895 
896  return $res;
897  }
static getInstanceByRefId($a_ref_id)
foreach($_POST as $key=> $value) $res
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recalculateProgressStatus()

ilObjStudyProgramme::recalculateProgressStatus ( ilStudyProgrammeProgress  $progress)
protected

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

References $children, ilObject\_exists(), ilLPStatus\_hasUserCompleted(), ilObject\_lookupDeletedDate(), ilContainerReference\_lookupTargetId(), getAchievedPointsOfChildren(), ilStudyProgrammeProgress\getAmountOfPoints(), ilStudyProgrammeProgress\getNodeId(), getSettingsRepository(), ilStudyProgrammeProgress\getUserId(), ilStudyProgrammeProgress\isRelevant(), ilStudyProgrammeProgress\isSuccessful(), ilStudyProgrammeSettings\MODE_LP_COMPLETED, ilStudyProgrammeSettings\MODE_POINTS, ilStudyProgrammeSettings\MODE_UNDEFINED, ilStudyProgrammeProgress\STATUS_COMPLETED, ilStudyProgrammeProgress\STATUS_IN_PROGRESS, ilStudyProgrammeProgress\withCurrentAmountOfPoints(), and ilStudyProgrammeProgress\withStatus().

Referenced by changeAmountOfPoints(), markRelevant(), updateParentProgress(), and updatePlanFromRepository().

2250  {
2251  if (!$progress->isRelevant()) {
2252  return $progress;
2253  }
2254  $node_settings = $this->getSettingsRepository()->get($progress->getNodeId());
2255  $completion_mode = $node_settings->getLPMode();
2256 
2257  if ($completion_mode === ilStudyProgrammeSettings::MODE_UNDEFINED) {
2258  return $progress;
2259  }
2260 
2261  $required_points = $progress->getAmountOfPoints();
2262 
2263  if ($completion_mode === ilStudyProgrammeSettings::MODE_LP_COMPLETED) {
2264  $achieved_points = 0;
2265 
2266  $node_ref = self::getRefIdFor($progress->getNodeId());
2267  $children = $this->tree->getChildsByType($node_ref, "crsr");
2268  foreach ($children as $child) {
2269  if (ilObject::_exists($child['ref_id'], true) &&
2270  is_null(ilObject::_lookupDeletedDate($child['ref_id']))
2271  ) {
2272  $crs_id = ilContainerReference::_lookupTargetId($child["obj_id"]);
2273  if (ilLPStatus::_hasUserCompleted($crs_id, $progress->getUserId())) {
2274  $achieved_points = $progress->getAmountOfPoints();
2275  break;
2276  }
2277  }
2278  }
2279  }
2280 
2281  if ($completion_mode === ilStudyProgrammeSettings::MODE_POINTS) {
2282  $achieved_points = $this->getAchievedPointsOfChildren($progress);
2283  }
2284 
2285  $progress = $progress->withCurrentAmountOfPoints($achieved_points);
2286  $successful = ($achieved_points >= $required_points);
2287 
2288  if ($successful && !$progress->isSuccessful()) {
2289  $progress = $progress
2291  ->withCompletion(null, new DateTimeImmutable());
2292 
2293  // there was a status change, so:
2294  $this->events->userSuccessful($progress);
2295  }
2296 
2297  if (!$successful && $progress->isSuccessful()) {
2298  $progress = $progress
2300  ->withCompletion(null, null)
2301  ->withValidityOfQualification(null);
2302  }
2303 
2304  return $progress;
2305  }
static _lookupDeletedDate($a_ref_id)
only called in ilObjectGUI::insertSavedNodes
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
withCurrentAmountOfPoints(int $points_cur)
Set the amount of points the user currently has achieved on this node.
getAchievedPointsOfChildren(ilStudyProgrammeProgress $progress)
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
getAmountOfPoints()
Get the amount of points the user needs to achieve on the subnodes of this node.
getUserId()
Get the id of the user this progress is for.
Class ilStudyProgrammeProgress.
withStatus(int $status)
Set the status of this node.
getNodeId()
Get the obj_id of the program node this progress belongs to.
static _lookupTargetId($a_obj_id)
lookup target id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshLPStatus()

ilObjStudyProgramme::refreshLPStatus ( int  $usr_id,
int  $node_obj_id = null 
)
protected

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

References ilLPStatusWrapper\_updateStatus(), and ilObject\getId().

Referenced by changeAmountOfPoints(), changeProgressDeadline(), changeProgressValidityDate(), invalidate(), markAccredited(), markFailed(), markNotFailed(), markNotRelevant(), markRelevant(), removeAssignment(), succeed(), unmarkAccredited(), and updatePlanFromRepository().

2230  : void
2231  {
2232  if (is_null($node_obj_id)) {
2233  $node_obj_id = $this->getId();
2234  }
2235  ilLPStatusWrapper::_updateStatus($node_obj_id, $usr_id);
2236  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAssignment()

ilObjStudyProgramme::removeAssignment ( ilStudyProgrammeAssignment  $assignment)

Remove an assignment from this program.

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

Exceptions
ilException

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

References ilStudyProgrammeAssignment\getId(), ilObject\getId(), ilStudyProgrammeAssignment\getRootId(), ilStudyProgrammeAssignment\getUserId(), and refreshLPStatus().

1084  {
1085  $this->members_cache = null;
1086  if ($assignment->getRootId() != $this->getId()) {
1087  throw new ilException(
1088  "ilObjStudyProgramme::removeAssignment: Assignment '"
1089  . $assignment->getId() . "' does not belong to study "
1090  . "program '" . $this->getId() . "'."
1091  );
1092  }
1093 
1094  $this->assignment_repository->delete($assignment);
1095 
1096  $affected_node_ids = $this->progress_repository->deleteForAssignmentId($assignment->getId());
1097  foreach ($affected_node_ids as $node_obj_id) {
1098  $this->refreshLPStatus($assignment->getUserId(), $node_obj_id);
1099  }
1100 
1101  $this->events->userDeassigned($assignment);
1102  return $this;
1103  }
getId()
get object id public
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ 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 1477 of file class.ilObjStudyProgramme.php.

Referenced by ilStudyProgrammeAppEventListener\removeCrsFromProgrammes().

1478  {
1479  foreach (self::getProgrammesMonitoringCategory($cat_ref_id) as $prg) {
1480  foreach ($prg->getLPChildren() as $child) {
1481  if ((int) $child->getTargetRefId() === $crs_ref_id) {
1482  $child->delete();
1483  }
1484  }
1485  }
1486  }
+ 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 982 of file class.ilObjStudyProgramme.php.

References clearLPChildrenCache(), ilObject\getId(), and ilStudyProgrammeLeaf\getRefId().

983  {
984  if (self::getParentId($a_leaf) !== $this->getId()) {
985  throw new ilStudyProgrammeTreeException("This is no parent of the given leaf node.");
986  }
987 
988  $node_data = $this->tree->getNodeData($a_leaf->getRefId());
989  $this->tree->deleteTree($node_data);
990  $this->clearLPChildrenCache();
991 
992  return $this;
993  }
clearLPChildrenCache()
Clear the cached lp children.
getRefId()
Get the ILIAS reference id of the leaf.
getId()
get object id public
Exception is thrown when invariants on the program tree would be violated by manipulation of tree...
+ 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 1642 of file class.ilObjStudyProgramme.php.

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

Referenced by ilStudyProgrammeAppEventListener\removeMemberFromProgrammes().

1642  : void
1643  {
1644  $now = new DateTimeImmutable();
1645  foreach (self::getProgrammesMonitoringMemberSource($src_type, $src_id) as $prg) {
1646  foreach ($prg->getProgressesOf($usr_id) as $progress) {
1647  if ($progress->getStatus() !== ilStudyProgrammeProgress::STATUS_IN_PROGRESS) {
1648  continue;
1649  }
1650  $assignments = $prg->getAssignmentsOfSingleProgramForUser($usr_id);
1651  $next_membership_source = $prg->getApplicableMembershipSourceForUser($usr_id, $src_type);
1652 
1653  foreach ($assignments as $assignment) {
1654  if (!is_null($next_membership_source) && $next_membership_source->isEnabled()) {
1655  $new_src_type = $next_membership_source->getSourceType();
1656  $assigned_by = ilStudyProgrammeAutoMembershipSource::SOURCE_MAPPING[$new_src_type];
1657  $assignment = $assignment->withLastChange($assigned_by, $now);
1658  $prg->assignment_repository->update($assignment);
1659  break;
1660  } else {
1661  $assignment_repository = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserAssignmentDB'];
1662  $user_assignment = $assignment_repository->getInstanceByModel($assignment);
1663  $prg->removeAssignment($user_assignment);
1664  }
1665  }
1666  }
1667  }
1668  }
+ 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 908 of file class.ilObjStudyProgramme.php.

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

909  {
910  if ($a_prg->getParent()->getId() !== $this->getId()) {
911  throw new ilStudyProgrammeTreeException("This is no parent of the given programm.");
912  }
913 
914  if (!$a_prg->canBeRemoved()) {
915  throw new ilStudyProgrammeTreeException("The node has relevant assignments.");
916  }
917 
918  // *sigh*...
919  $node_data = $this->tree->getNodeData($a_prg->getRefId());
920  $this->tree->deleteTree($node_data);
921  $a_prg->clearParentCache();
922  $this->clearChildrenCache();
923 
924  return $this;
925  }
getParent()
Get the parent ilObjStudyProgramme of this object.
clearChildrenCache()
Clear the cached children.
getId()
get object id public
canBeRemoved()
Check weather a node can be removed.
getRefId()
get reference id public
Exception is thrown when invariants on the program tree would be violated by manipulation of tree...
clearParentCache()
Clear the cached parent to query it again at the tree.
+ Here is the call graph for this function:

◆ resetProgressToSettings()

ilObjStudyProgramme::resetProgressToSettings ( ilStudyProgrammeProgress  $progress,
int  $acting_usr_id 
)
protected

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

References getNow(), getPoints(), ilStudyProgrammeProgress\isRelevant(), updateProgressDeadlineFromSettings(), updateProgressValidityFromSettings(), ilStudyProgrammeProgress\withAmountOfPoints(), ilStudyProgrammeProgress\withLastChange(), and ilStudyProgrammeProgress\withValidityOfQualification().

Referenced by assignUser().

2641  if ($progress->isRelevant()) {
2642  $progress = $this->updateProgressValidityFromSettings($progress);
2643  $progress = $this->updateProgressDeadlineFromSettings($progress);
2644  } else {
2645  $progress = $progress
2647  ->withDeadline(null);
2648  }
2649 
2650  $progress = $progress->withAmountOfPoints($this->getPoints());
2651  $progress = $progress
2652  ->withLastChange($acting_usr_id, $this->getNow())
2653  ->withIndividualModifications(false);
2654 
2655  return $progress;
2656  }
withLastChange(int $last_change_by, DateTimeImmutable $timestamp)
Class ilStudyProgrammeProgress.
withValidityOfQualification(DateTimeImmutable $date=null)
getPoints()
Get the amount of points.
withAmountOfPoints(int $points)
Throws when amount of points is smaller then zero.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendInformToReAssignMail()

static ilObjStudyProgramme::sendInformToReAssignMail ( int  $progress_id,
int  $usr_id 
)
static

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

References $DIC, Vendor\Package\$e, ilObject\$lng, ilContainer\$log, $name, ilObjUser\_lookupFullname(), ilObjUser\_lookupGender(), ilObjUser\_lookupLogin(), ANONYMOUS_USER_ID, ilStudyProgrammeDIC\dic(), and getInstanceByObjId().

Referenced by ilStudyProgrammeAppEventListener\sendInformToReAssignMail().

1960  : void
1961  {
1962  global $DIC;
1963  $lng = $DIC['lng'];
1964  $log = $DIC['ilLog'];
1965  $lng->loadLanguageModule("prg");
1966  $lng->loadLanguageModule("mail");
1967 
1968  $usr_progress_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserProgressDB'];
1969  $usr_progress = $usr_progress_db->get($progress_id);
1970  $prg = ilObjStudyProgramme::getInstanceByObjId($usr_progress->getNodeId());
1971  $prg_should_send_mail = $prg->getSettings()->getAutoMailSettings()
1972  ->getReminderNotRestartedByUserDays() > 0;
1973 
1974  if (!$prg_should_send_mail) {
1975  $log->write("Send info to re assign mail is deactivated in study programme settings");
1976  return;
1977  }
1978 
1979  $subject = $lng->txt("info_to_re_assign_mail_subject");
1980  $gender = ilObjUser::_lookupGender($usr_id);
1981  $name = ilObjUser::_lookupFullname($usr_id);
1982  $body = sprintf(
1983  $lng->txt("info_to_re_assign_mail_body"),
1984  $lng->txt("mail_salutation_" . $gender),
1985  $name,
1986  $prg->getTitle()
1987  );
1988 
1989  $send = true;
1990  $mail = new ilMail(ANONYMOUS_USER_ID);
1991  try {
1992  $mail->enqueue(
1993  ilObjUser::_lookupLogin($usr_id),
1994  '',
1995  '',
1996  $subject,
1997  $body,
1998  null
1999  );
2000  } catch (Exception $e) {
2001  $send = false;
2002  }
2003 
2004  if ($send) {
2005  $usr_progress_db->sentExpiryInfoFor($usr_progress->getId());
2006  }
2007  }
static _lookupLogin($a_user_id)
lookup login
const ANONYMOUS_USER_ID
Definition: constants.php:25
static _lookupFullname($a_user_id)
Lookup Full Name.
static _lookupGender($a_user_id)
Lookup gender.
if($format !==null) $name
Definition: metadata.php:230
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendInvalidateMail()

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

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

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

1923  : bool
1924  {
1925  global $DIC;
1926  $lng = $DIC['lng'];
1927  $lng->loadLanguageModule("prg");
1928  $lng->loadLanguageModule("mail");
1929 
1931 
1932  $subject = $lng->txt("invalidate_mail_subject");
1933  $gender = ilObjUser::_lookupGender($usr_id);
1934  $name = ilObjUser::_lookupFullname($usr_id);
1935  $body = sprintf(
1936  $lng->txt("invalidate_mail_body"),
1937  $lng->txt("mail_salutation_" . $gender),
1938  $name,
1939  $prg->getTitle()
1940  );
1941 
1942  $send = true;
1943  $mail = new ilMail(ANONYMOUS_USER_ID);
1944  try {
1945  $mail->enqueue(
1946  ilObjUser::_lookupLogin($usr_id),
1947  '',
1948  '',
1949  $subject,
1950  $body,
1951  null
1952  );
1953  } catch (Exception $e) {
1954  $send = false;
1955  }
1956 
1957  return $send;
1958  }
static _lookupLogin($a_user_id)
lookup login
const ANONYMOUS_USER_ID
Definition: constants.php:25
static _lookupFullname($a_user_id)
Lookup Full Name.
static _lookupGender($a_user_id)
Lookup gender.
static getInstanceByRefId($a_ref_id)
if($format !==null) $name
Definition: metadata.php:230
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ sendReAssignedMail()

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

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

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

Referenced by ilStudyProgrammeAppEventListener\sendReAssignedMail().

1880  : bool
1881  {
1882  global $DIC;
1883  $lng = $DIC['lng'];
1884  $lng->loadLanguageModule("prg");
1885  $lng->loadLanguageModule("mail");
1886  $log = $DIC['ilLog'];
1887 
1889  $prg_should_send_mail = $prg->getSettings()->getAutoMailSettings()->getSendReAssignedMail();
1890  if (!$prg_should_send_mail) {
1891  $log->write("Send re assign mail is deactivated in study programme settings");
1892  return false;
1893  }
1894 
1895  $subject = $lng->txt("re_assigned_mail_subject");
1896  $gender = ilObjUser::_lookupGender($usr_id);
1897  $name = ilObjUser::_lookupFullname($usr_id);
1898  $body = sprintf(
1899  $lng->txt("re_assigned_mail_body"),
1900  $lng->txt("mail_salutation_" . $gender),
1901  $name,
1902  $prg->getTitle()
1903  );
1904 
1905  $send = true;
1906  $mail = new ilMail(ANONYMOUS_USER_ID);
1907  try {
1908  $mail->enqueue(
1909  ilObjUser::_lookupLogin($usr_id),
1910  '',
1911  '',
1912  $subject,
1913  $body,
1914  null
1915  );
1916  } catch (Exception $e) {
1917  $send = false;
1918  }
1919 
1920  return $send;
1921  }
static _lookupLogin($a_user_id)
lookup login
const ANONYMOUS_USER_ID
Definition: constants.php:25
static _lookupFullname($a_user_id)
Lookup Full Name.
static _lookupGender($a_user_id)
Lookup gender.
static getInstanceByRefId($a_ref_id)
if($format !==null) $name
Definition: metadata.php:230
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendRiskyToFailMail()

static ilObjStudyProgramme::sendRiskyToFailMail ( int  $progress_id,
int  $usr_id 
)
static
Exceptions
ilException

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

References $DIC, Vendor\Package\$e, ilObject\$lng, ilContainer\$log, $name, ilObjUser\_lookupFullname(), ilObjUser\_lookupGender(), ilObjUser\_lookupLogin(), ANONYMOUS_USER_ID, ilStudyProgrammeDIC\dic(), and getInstanceByObjId().

Referenced by ilStudyProgrammeAppEventListener\sendRiskyToFailMail().

2012  : void
2013  {
2014  global $DIC;
2015  $lng = $DIC['lng'];
2016  $log = $DIC['ilLog'];
2017  $lng->loadLanguageModule("prg");
2018  $lng->loadLanguageModule("mail");
2019 
2020  $usr_progress_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserProgressDB'];
2021  $usr_progress = $usr_progress_db->get($progress_id);
2022  $prg = ilObjStudyProgramme::getInstanceByObjId($usr_progress->getNodeId());
2023  $prg_should_send_mail = $prg->getSettings()->getAutoMailSettings()
2024  ->getProcessingEndsNotSuccessfulDays() > 0;
2025 
2026  if (!$prg_should_send_mail) {
2027  $log->write("Send risky to fail mail is deactivated in study programme settings");
2028  return;
2029  }
2030 
2031  $subject = $lng->txt("risky_to_fail_mail_subject");
2032  $gender = ilObjUser::_lookupGender($usr_id);
2033  $name = ilObjUser::_lookupFullname($usr_id);
2034  $body = sprintf(
2035  $lng->txt("risky_to_fail_mail_body"),
2036  $lng->txt("mail_salutation_" . $gender),
2037  $name,
2038  $prg->getTitle()
2039  );
2040 
2041  $send = true;
2042  $mail = new ilMail(ANONYMOUS_USER_ID);
2043  try {
2044  $mail->enqueue(
2045  ilObjUser::_lookupLogin($usr_id),
2046  '',
2047  '',
2048  $subject,
2049  $body,
2050  null
2051  );
2052  } catch (Exception $e) {
2053  $send = false;
2054  }
2055 
2056  if ($send) {
2057  $usr_progress_db->sentRiskyToFailFor($usr_progress->getId());
2058  }
2059  }
static _lookupLogin($a_user_id)
lookup login
const ANONYMOUS_USER_ID
Definition: constants.php:25
static _lookupFullname($a_user_id)
Lookup Full Name.
static _lookupGender($a_user_id)
Lookup gender.
if($format !==null) $name
Definition: metadata.php:230
global $DIC
Definition: goto.php:24
+ 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 383 of file class.ilObjStudyProgramme.php.

References getSettings(), and updateLastChange().

384  {
385  $settings = $this->getSettings()->getAssessmentSettings()
386  ->withPoints($a_points);
387  $this->setAssessmentSettings($settings);
388  $this->updateLastChange();
389  return $this;
390  }
updateLastChange()
Update last change timestamp on this node and its parents.
+ 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 1745 of file class.ilObjStudyProgramme.php.

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

Referenced by ilStudyProgrammeAppEventListener\onServiceTrackingUpdateStatus().

1745  : void
1746  {
1747  // We only use courses via crs_refs
1748  $type = ilObject::_lookupType($a_obj_id);
1749  if ($type == "crsr") {
1750  foreach (ilObject::_getAllReferences($a_obj_id) as $ref_id) {
1751  self::setProgressesCompletedIfParentIsProgrammeInLPCompletedMode((int) $ref_id, $a_obj_id, $a_user_id);
1752  }
1753  }
1754  }
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
+ 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 1759 of file class.ilObjStudyProgramme.php.

References $DIC, $tree, getInstanceByRefId(), ilStudyProgrammeSettings\MODE_LP_COMPLETED, and ilStudyProgrammeProgress\STATUS_IN_PROGRESS.

1763  : void {
1764  global $DIC; // TODO: replace this by a settable static for testing purpose?
1765  $tree = $DIC['tree'];
1766  $node_data = $tree->getParentNodeData($a_ref_id);
1767  if ($node_data["type"] !== "prg") {
1768  return;
1769  }
1770  self::initStudyProgrammeCache();
1771  $prg = ilObjStudyProgramme::getInstanceByRefId($node_data["child"]);
1772  if ($prg->getLPMode() != ilStudyProgrammeSettings::MODE_LP_COMPLETED) {
1773  return;
1774  }
1775 
1776  $now = new DateTimeImmutable();
1777  foreach ($prg->getProgressesOf($a_user_id) as $progress) {
1778  $progress_deadline = $progress->getDeadline();
1779  if (
1780  (is_null($progress_deadline) || $progress_deadline >= $now)
1781  && $progress->getStatus() === ilStudyProgrammeProgress::STATUS_IN_PROGRESS
1782  ) {
1783  $prg->succeed($progress->getId(), $a_obj_id);
1784  }
1785  }
1786  }
static getInstanceByRefId($a_ref_id)
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ setStatus()

ilObjStudyProgramme::setStatus ( int  $a_status)

Set the status of the node.

Exceptions
ilException

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

References getSettings(), and updateLastChange().

441  {
442  $settings = $this->getSettings()->getAssessmentSettings()
443  ->withStatus($a_status);
444  $this->setAssessmentSettings($settings);
445  $this->updateLastChange();
446  return $this;
447  }
updateLastChange()
Update last change timestamp on this node and its parents.
+ Here is the call graph for this function:

◆ statusToRepr()

ilObjStudyProgramme::statusToRepr (   $a_status)

Get a user readable representation of a status.

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

References ilObject\$lng, ilStudyProgrammeProgress\STATUS_ACCREDITED, ilStudyProgrammeProgress\STATUS_COMPLETED, ilStudyProgrammeProgress\STATUS_FAILED, ilStudyProgrammeProgress\STATUS_IN_PROGRESS, and ilStudyProgrammeProgress\STATUS_NOT_RELEVANT.

2723  {
2724  $lng = $this->lng;
2725  $lng->loadLanguageModule("prg");
2726 
2728  return $lng->txt("prg_status_in_progress");
2729  }
2730  if ($a_status == ilStudyProgrammeProgress::STATUS_COMPLETED) {
2731  return $lng->txt("prg_status_completed");
2732  }
2734  return $lng->txt("prg_status_accredited");
2735  }
2737  return $lng->txt("prg_status_not_relevant");
2738  }
2739  if ($a_status == ilStudyProgrammeProgress::STATUS_FAILED) {
2740  return $lng->txt("prg_status_failed");
2741  }
2742  throw new ilException("Unknown status: '$a_status'");
2743  }

◆ 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 1424 of file class.ilObjStudyProgramme.php.

References ilObject\getId().

1424  : void
1425  {
1426  $ac = $this->auto_categories_repository->create(
1427  $this->getId(),
1428  $category_ref_id
1429  );
1430  $this->auto_categories_repository->update($ac);
1431  }
getId()
get object id public
+ Here is the call graph for this function:

◆ storeAutomaticMembershipSource()

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

Store a source to be monitored for automatic memberships.

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

References ilObject\getId().

1550  : void
1551  {
1552  $ams = $this->auto_memberships_repository->create($this->getId(), $type, $src_id, false);
1553  $this->auto_memberships_repository->update($ams);
1554  }
getId()
get object id public
+ Here is the call graph for this function:

◆ succeed()

ilObjStudyProgramme::succeed ( int  $progress_id,
int  $triggering_obj_id 
)

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

References getNow(), getProgressRepository(), refreshLPStatus(), updateParentProgress(), and updateProgressValidityFromSettings().

2501  : void
2502  {
2503  $progress = $this->getProgressRepository()->get($progress_id)
2504  ->succeed($this->getNow(), $triggering_obj_id);
2505 
2506  $achieved_points = $progress->getAmountOfPoints();
2507  $progress = $progress->withCurrentAmountOfPoints($achieved_points);
2508  $progress = $this->updateProgressValidityFromSettings($progress);
2509 
2510  $this->getProgressRepository()->update($progress);
2511 
2512  $this->refreshLPStatus($progress->getUserId());
2513  $this->updateParentProgress($progress);
2514  }
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ throwIfNotInTree()

ilObjStudyProgramme::throwIfNotInTree ( )
protected
Exceptions
ilStudyProgrammeTreeExceptionif object is not in tree.

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

Referenced by addLeaf(), addNode(), applyToSubTreeNodes(), getChildren(), getLPChildren(), and getParent().

760  : void
761  {
762  if (!$this->tree->isInTree($this->getRefId())) {
763  throw new ilStudyProgrammeTreeException("This program is not in tree.");
764  }
765  }
Exception is thrown when invariants on the program tree would be violated by manipulation of tree...
+ Here is the caller graph for this function:

◆ unmarkAccredited()

ilObjStudyProgramme::unmarkAccredited ( int  $progress_id,
int  $acting_usr_id,
ilPRGMessageCollection  $err_collection 
)

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

References ilPRGMessageCollection\add(), applyProgressDeadline(), getAchievedPointsOfChildren(), getNow(), getProgressIdString(), getProgressRepository(), refreshLPStatus(), and updateParentProgress().

2381  : void {
2382  $progress = $this->getProgressRepository()->get($progress_id);
2383  $new_status = $progress::STATUS_IN_PROGRESS;
2384 
2385  if (!$progress->isRelevant()) {
2386  $err_collection->add(false, 'will_not_modify_irrelevant_progress', $this->getProgressIdString($progress));
2387  return;
2388  }
2389  if ($progress->getStatus() === $new_status) {
2390  $err_collection->add(false, 'status_unchanged', $this->getProgressIdString($progress));
2391  return;
2392  }
2393  if (!$progress->isTransitionAllowedTo($new_status)
2394  //special case: completion may not be revoked manually (but might be as a calculation-result of underlying progresses)
2395  || $progress->getStatus() === $progress::STATUS_COMPLETED
2396  ) {
2397  $err_collection->add(false, 'status_transition_not_allowed', $this->getProgressIdString($progress));
2398  return;
2399  }
2400 
2401  $progress = $progress
2402  ->unmarkAccredited($this->getNow(), $acting_usr_id);
2403 
2404  $achieved_points = $this->getAchievedPointsOfChildren($progress);
2405  $progress = $progress->withCurrentAmountOfPoints($achieved_points);
2406 
2407  $progress = $this->applyProgressDeadline($progress);
2408 
2409  $this->getProgressRepository()->update($progress);
2410  $this->refreshLPStatus($progress->getUserId());
2411  $this->updateParentProgress($progress);
2412  $err_collection->add(true, 'status_changed', $this->getProgressIdString($progress));
2413  }
add(bool $success, string $message, string $record_identitifer)
applyProgressDeadline(ilStudyProgrammeProgress $progress, int $acting_usr_id=null)
getAchievedPointsOfChildren(ilStudyProgrammeProgress $progress)
getProgressIdString(ilStudyProgrammeProgress $progress)
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ update()

ilObjStudyProgramme::update ( )
Exceptions
ilException

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

References ilObject\getId(), getSettings(), and ilAdvancedMDRecord\saveObjRecSelection().

Referenced by updateLastChange().

303  : void
304  {
305  parent::update();
306 
307  $type_settings = $this->getSettings()->getTypeSettings();
308  // Update selection for advanced meta data of the type
309  if ($type_settings->getTypeId()) {
311  $this->getId(),
312  'prg_type',
313  $this->type_repository->getAssignedAMDRecordIdsByType($type_settings->getTypeId())
314  );
315  } else {
316  // If no type is assigned, delete relations by passing an empty array
317  ilAdvancedMDRecord::saveObjRecSelection($this->getId(), 'prg_type', array());
318  }
319  }
static saveObjRecSelection($a_obj_id, $a_sub_type="", array $a_records=null, $a_delete_before=true)
Save repository object record selection.
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAllAssignments()

ilObjStudyProgramme::updateAllAssignments ( )

Update all assignments to this program node.

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

References getAssignmentRepository(), and ilObject\getId().

1204  {
1205  $this->members_cache = null;
1206  $assignments = $this->getAssignmentRepository()->getByPrgId((int) $this->getId());
1207  foreach ($assignments as $ass) {
1208  $ass->updateFromProgram();
1209  }
1210  return $this;
1211  }
getId()
get object id public
+ Here is the call graph for this function:

◆ updateCustomIcon()

ilObjStudyProgramme::updateCustomIcon ( )

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

References ilObject\getId(), getSubType(), and ilObject\getType().

Referenced by ilObjStudyProgrammeSettingsGUI\buildForm().

1807  : void
1808  {
1809  $customIcon = $this->custom_icon_factory->getByObjId($this->getId(), $this->getType());
1810  $subtype = $this->getSubType();
1811 
1812  if ($subtype
1813  && $this->webdir->has($subtype->getIconPath(true))
1814  && $subtype->getIconPath(true) != $subtype->getIconPath(false)
1815  ) {
1816  $icon = $subtype->getIconPath(true);
1817  $customIcon->saveFromSourceFile($icon);
1818  } else {
1819  $customIcon->remove();
1820  }
1821  }
getSubType()
Gets the SubType Object.
getId()
get object id public
getType()
get object type public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLastChange()

ilObjStudyProgramme::updateLastChange ( )
protected

Update last change timestamp on this node and its parents.

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

References $parent, getParent(), getSettings(), and update().

Referenced by setPoints(), and setStatus().

1694  : void
1695  {
1696  $this->getSettings()->updateLastChange();
1697  if ($parent = $this->getParent()) {
1698  $parent->updateLastChange();
1699  }
1700  $this->update();
1701  }
getParent()
Get the parent ilObjStudyProgramme of this object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateParentProgress()

ilObjStudyProgramme::updateParentProgress ( ilStudyProgrammeProgress  $progress)
protected

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

References getParentProgress(), getProgressRepository(), and recalculateProgressStatus().

Referenced by changeAmountOfPoints(), changeProgressDeadline(), invalidate(), markAccredited(), markFailed(), markNotFailed(), markNotRelevant(), markRelevant(), succeed(), unmarkAccredited(), and updatePlanFromRepository().

2239  {
2240  $parent_progress = $this->getParentProgress($progress);
2241  if (is_null($parent_progress)) {
2242  return $progress;
2243  }
2244  $parent_progress = $this->recalculateProgressStatus($parent_progress);
2245  $this->getProgressRepository()->update($parent_progress);
2246  return $this->updateParentProgress($parent_progress); //recurse
2247  }
recalculateProgressStatus(ilStudyProgrammeProgress $progress)
Class ilStudyProgrammeProgress.
getParentProgress(ilStudyProgrammeProgress $progress)
updateParentProgress(ilStudyProgrammeProgress $progress)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updatePlanFromRepository()

ilObjStudyProgramme::updatePlanFromRepository ( int  $progress_id,
int  $acting_usr_id,
ilPRGMessageCollection  $err_collection = null 
)

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

References applyProgressDeadline(), getPrgInstanceByObjId(), getProgressRepository(), recalculateProgressStatus(), refreshLPStatus(), and updateParentProgress().

2609  : void {
2610  $progress = $this->getProgressRepository()->get($progress_id);
2611  $assignment_id = $progress->getAssignmentId();
2612  $progresses = $this->getProgressRepository()->getByAssignmentId($assignment_id);
2613 
2614  $leafs = [];
2615  foreach ($progresses as $progress) {
2616  // get node for progress; settings are pulled from the node, which might not be "this"
2617  $node = $this->getPrgInstanceByObjId($progress->getNodeId());
2618  $progress = $node->updateProgressRelevanceFromSettings($progress);
2619  $progress = $node->resetProgressToSettings($progress, $acting_usr_id);
2620  $this->getProgressRepository()->update($progress);
2621 
2622  if (!$node->hasChildren(true)) {
2623  $leafs[] = [$node, $progress];
2624  }
2625  }
2626 
2627  foreach ($leafs as $leaf) {
2628  list($node, $progress) = $leaf;
2629  $progress = $this->recalculateProgressStatus($progress);
2630  $progress = $this->applyProgressDeadline($progress);
2631  $this->getProgressRepository()->update($progress);
2632  $this->refreshLPStatus($progress->getUserId(), (int) $node->getId());
2633  $this->updateParentProgress($progress);
2634  }
2635  }
applyProgressDeadline(ilStudyProgrammeProgress $progress, int $acting_usr_id=null)
recalculateProgressStatus(ilStudyProgrammeProgress $progress)
updateParentProgress(ilStudyProgrammeProgress $progress)
refreshLPStatus(int $usr_id, int $node_obj_id=null)
+ Here is the call graph for this function:

◆ updateProgressDeadlineFromSettings()

ilObjStudyProgramme::updateProgressDeadlineFromSettings (   $progress)
protected

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

References getSettings().

Referenced by resetProgressToSettings().

2695  {
2696  $settings = $this->getSettings()->getDeadlineSettings();
2697  $period = $settings->getDeadlinePeriod();
2698  $date = $settings->getDeadlineDate();
2699  if ($date) {
2700  $date = DateTimeImmutable::createFromMutable($date);
2701  }
2702 
2703  if ($period) {
2704  $date = $progress->getAssignmentDate();
2705  $date = $date->add(new DateInterval('P' . $period . 'D'));
2706  }
2707  return $progress->withDeadline($date);
2708  }
Class ilStudyProgrammeProgress.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateProgressRelevanceFromSettings()

ilObjStudyProgramme::updateProgressRelevanceFromSettings (   $progress)
protected

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

References isActive(), ilStudyProgrammeProgress\STATUS_IN_PROGRESS, ilStudyProgrammeProgress\STATUS_NOT_RELEVANT, and ilStudyProgrammeProgress\withStatus().

2659  {
2660  if ($this->isActive() && !$progress->isRelevant()) {
2662  }
2663  if (!$this->isActive() && $progress->isInProgress()) {
2664  $progress = $progress->withStatus(ilStudyProgrammeProgress::STATUS_NOT_RELEVANT);
2665  }
2666 
2667  return $progress;
2668  }
Class ilStudyProgrammeProgress.
withStatus(int $status)
Set the status of this node.
+ Here is the call graph for this function:

◆ updateProgressValidityFromSettings()

ilObjStudyProgramme::updateProgressValidityFromSettings (   $progress)
protected

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

References ilStudyProgrammeProgress\getCompletionDate(), and getSettings().

Referenced by markAccredited(), resetProgressToSettings(), and succeed().

2671  {
2672  $cdate = $progress->getCompletionDate();
2673  if (!$cdate
2674  || $progress->isSuccessful() === false
2675  ) {
2676  return $progress;
2677  }
2678 
2679  $settings = $this->getSettings()->getValidityOfQualificationSettings();
2680  $period = $settings->getQualificationPeriod();
2681  $date = $settings->getQualificationDate();
2682 
2683  if ($date) {
2684  $date = DateTimeImmutable::createFromMutable($date);
2685  }
2686 
2687  if ($period) {
2688  $date = $cdate->add(new DateInterval('P' . $period . 'D'));
2689  }
2690 
2691  return $progress->withValidityOfQualification($date);
2692  }
Class ilStudyProgrammeProgress.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSettings()

ilObjStudyProgramme::updateSettings ( ilStudyProgrammeSettings  $settings)

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

References ilObject\getId(), ilStudyProgrammeSettings\getObjId(), and getSettingsRepository().

Referenced by ilObjStudyProgrammeSettingsGUI\buildForm().

262  : void
263  {
264  if ($settings->getObjId() !== (int) $this->getId()) {
265  throw new Exception("The given settings-object does not belong to this programme", 1);
266  }
267  $this->getSettingsRepository()->update($settings);
268  }
getId()
get object id public
getObjId()
Get the id of the study program.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $assignment_repository

ilObjStudyProgramme::$assignment_repository
protected

◆ $auto_categories_repository

ilObjStudyProgramme::$auto_categories_repository
protected

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

◆ $auto_memberships_repository

ilObjStudyProgramme::$auto_memberships_repository
protected

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

◆ $children

ilObjStudyProgramme::$children
protected

◆ $custom_icon_factory

ilObjStudyProgramme::$custom_icon_factory
protected

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

◆ $db

ilObjStudyProgramme::$db
protected

◆ $events

ilObjStudyProgramme::$events
protected

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

◆ $ilUser

ilObjStudyProgramme::$ilUser

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

Referenced by __construct().

◆ $lp_children

ilObjStudyProgramme::$lp_children
protected

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

Referenced by getLPChildren().

◆ $members_cache

ilObjStudyProgramme::$members_cache
protected

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

Referenced by getLocalMembers().

◆ $membersourcereader_factory

ilObjStudyProgramme::$membersourcereader_factory
protected

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

◆ $object_factory

ilObjStudyProgramme::$object_factory

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

◆ $parent

ilObjStudyProgramme::$parent
protected

◆ $plugin_admin

ilObjStudyProgramme::$plugin_admin
protected

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

◆ $progress_repository

ilObjStudyProgramme::$progress_repository
protected

◆ $reference_children

ilObjStudyProgramme::$reference_children
protected

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

◆ $settings_repository

ilObjStudyProgramme::$settings_repository
protected

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

Referenced by addMissingProgresses(), and getSettingsRepository().

◆ $study_programme_cache

ilObjStudyProgramme::$study_programme_cache = null
static

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

◆ $tree

◆ $type_repository

ilObjStudyProgramme::$type_repository
protected

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

◆ $webdir

ilObjStudyProgramme::$webdir

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


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