3 declare(strict_types=1);
81 $this->type = self::OBJ_TYPE;
82 $this->lng = $DIC[
'lng'];
83 $this->ctrl = $DIC[
'ilCtrl'];
84 $this->
user = $DIC[
'ilUser'];
85 $this->tree = $DIC[
'tree'];
86 $this->kiosk_mode_service = $DIC[
'service.kiosk_mode'];
87 $this->
template = $DIC[
'tpl'];
88 $this->database = $DIC[
'ilDB'];
89 $this->log = $DIC[
"ilLoggerFactory"]->getRootLogger();
90 $this->rbacadmin = $DIC[
'rbacadmin'];
91 $this->rbacreview = $DIC[
'rbacreview'];
92 $this->app_event_handler = $DIC[
'ilAppEventHandler'];
93 $this->filesystem = $DIC[
'filesystem'];
94 $this->
ilias = $DIC[
'ilias'];
95 $this->il_settings = $DIC[
'ilSetting'];
96 $this->il_news = $DIC->news();
99 $this->data_factory = new \ILIAS\Data\Factory();
101 parent::__construct(
$id, $call_by_reference);
120 $id = parent::create();
126 return (
int) $this->
getId();
139 public function delete() :
bool 141 if (!parent::delete()) {
157 $this->app_event_handler->raise(
158 'Modules/LearningSequence',
161 'obj_id' => $this->
getId(),
162 'appointments' => null
169 $new_obj = parent::cloneObject(
$target_id, $copy_id, $omit_tree);
176 $new_obj->addMember((
int) $this->
user->getId(), $new_obj->getDefaultAdminRole());
187 if (!$admin || !$new_admin || !$this->
getRefId() || !$new_obj->
getRefId()) {
188 $this->log->write(__METHOD__ .
' : Error cloning auto generated role: il_lso_admin');
191 $this->rbacadmin->copyRolePermissions($admin, $this->
getRefId(), $new_obj->
getRefId(), $new_admin,
true);
192 $this->log->write(__METHOD__ .
' : Finished copying of role lso_admin.');
197 if (!$member || !$new_member) {
198 $this->log->write(__METHOD__ .
' : Error cloning auto generated role: il_lso_member');
201 $this->rbacadmin->copyRolePermissions($member, $this->
getRefId(), $new_obj->
getRefId(), $new_member,
true);
202 $this->log->write(__METHOD__ .
' : Finished copying of role lso_member.');
212 foreach (
$source->getUploads() as
$key => $upload_info) {
216 foreach (
$source->getDeletions() as $deletion) {
221 ->withAbstract(
$source->getAbstract())
222 ->withExtro(
$source->getExtro())
223 ->withAbstractImage(
$source->getAbstractImage())
224 ->withExtroImage(
$source->getExtroImage())
233 $lp_settings->cloneSettings($obj_id);
238 if (!$this->settings_db) {
250 if (!$this->activation_db) {
260 if (!$this->ls_activation) {
270 $this->ls_activation = $settings;
275 if (!$this->ls_file_system) {
283 if (!$this->ls_settings) {
293 $this->ls_settings = $settings;
298 if (!$this->items_db) {
312 if (!$this->conditions_db) {
321 if (!$this->ls_item_online_status) {
330 if (!$this->ls_participant) {
332 (
int) $this->
getId(),
334 $this->app_event_handler,
345 if (is_null($this->ls_access)) {
349 return $this->ls_access;
368 $db->storeItems($ls_items);
378 $rep_utils->deleteObjects($this->
getRefId(), $ref_ids);
380 $db->delete($ref_ids);
388 $condition_types = $this->il_condition_handler->getOperatorsByTriggerType($type);
390 $this->conditions_db::STD_ALWAYS_OPERATOR => $this->lng->txt(
'condition_always')
392 foreach ($condition_types as $cond_type) {
393 $conditions[$cond_type] = $this->lng->txt($cond_type);
400 if (!$this->learner_progress_db) {
413 if (!$this->state_db) {
414 $this->state_db =
new ilLSStateDB($this->database);
431 if (!$this->ls_roles) {
479 $player_url = $this->data_factory->uri(ILIAS_HTTP_PATH .
'/' . $player_url);
486 return $db->getSettings();
499 $player_url = $this->ctrl->getLinkTarget($gui, $player_command,
'',
false,
false);
517 $this->kiosk_mode_service,
542 if (!$this->kiosk_renderer) {
545 $kiosk_template =
new ilTemplate(
"tpl.kioskpage.html",
true,
true,
'Modules/LearningSequence');
547 $toc_gui =
new ilLSTOCGUI($url_builder, $this->ctrl);
550 $window_title = $this->il_settings->get(
'short_inst_name');
551 if ($window_title ===
false) {
552 $window_title =
'ILIAS';
565 return $this->kiosk_renderer;
574 return $this->mail_members;
587 $ilAccess = $DIC[
'ilAccess'];
592 if (substr($add, 0, 5) ==
'rcode') {
593 if (
$ilUser->getId() == ANONYMOUS_USER_ID) {
596 "login.php?target=" .
$_GET[
"target"] .
"&cmd=force_login&lang=" .
609 if ($add ==
"mem" && $ilAccess->checkAccess(
"manage_members",
"",
$target)) {
613 if ($ilAccess->checkAccess(
"read",
"",
$target)) {
617 if ($ilAccess->checkAccess(
"visible",
"",
$target)) {
620 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID)) {
623 $lng->txt(
"msg_no_perm_read_item"),
644 return $part->isMember($usr_id);
652 return ($tracking_active && $user_completion);
662 return $this->access->checkAccess(
'unparticipate',
'', $this->
getRefId());
667 return $this->access->checkAccess(
'participate',
'', $this->
getRefId());
672 $ns = $this->il_news;
675 $item->setContentIsLangVar(
true);
676 $item->setContentTextIsLangVar(
true);
677 $item->setTitle(
"lso_news_online_title");
678 $item->setContent(
"lso_news_online_txt");
679 $news_id = $ns->data()->save($item);
689 $act_db->setEffectiveOnlineStatus((
int) $this->
getRefId(), $status);
699 return $this->
getLSRoles()->getLocalLearningSequenceRoles($translate);
704 return $this->
getLSRoles()->getDefaultMemberRole();
709 return $this->
getLSRoles()->getDefaultAdminRole();
714 return $this->
getLSRoles()->addLSMember($user_id, $mem_role);
717 public function join(
int $user_id)
720 return $this->
getLSRoles()->join($user_id, $member_role);
725 return $this->
getLSRoles()->leaveLearningSequence();
730 return $this->
getLSRoles()->getLearningSequenceMemberIds();
735 return $this->
getLSRoles()->leave($a_user_id);
740 return $this->
getLSRoles()->getLearningSequenceMemberData($a_mem_ids, $active);
745 return $this->
getLSRoles()->getLearningSequenceAdminIds();
750 return $this->
getLSRoles()->getDefaultLearningSequenceRoles($a_grp_id);
755 return $this->
getLSRoles()->initDefaultRoles();
760 return $this->getLsRoles()->readMemberData($user_ids,
$columns);
765 foreach ($this->tree->getPathFull($ref_id) as $hop) {
766 if (in_array($hop[
'type'], $search_types)) {
const LP_STATUS_COMPLETED_NUM
Storage for ilLSPostConditions.
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
deletePostConditionsForSubObjects(array $ref_ids)
Delete post conditions for ref ids.
getMailToMembersType()
Get mail to members type.
updateSettings(ilLearningSequenceSettings $settings)
setEffectiveOnlineStatus(bool $status)
Repository Utilities (application layer, put GUI related stuff into ilRepUtilGUI) ...
cloneLPSettings(int $obj_id)
cloneObject($target_id, $copy_id=0, $omit_tree=false)
cloneAutoGeneratedRoles(ilObjLearningSequence $new_obj)
getParentObjectInfo(int $ref_id, array $search_types)
cloneSettings(ilObjLearningSequence $new_obj)
Global Settings of the Learning Sequence.
Class ilObjLearningSequence.
getCurrentItemForLearner(int $usr_id)
Get ref-id of the last item the user touched.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
Repository for LSGlobalSettings over ILIAS global settings.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
__construct(int $id=0, bool $call_by_reference=true)
static _lookupTitle($a_id)
lookup object title
getLearningSequenceMemberData($a_mem_ids, $active=1)
static handleCode($a_ref_id, $a_type, $a_code)
Handle target parameter.
Storage of images in settings.
getLearningSequenceMemberIds()
Activation-Settings for an LSO.
getLocalLearningSequenceRoles(bool $translate=false)
readMemberData(array $user_ids, array $columns=null)
static _enabledLearningProgress()
check wether learing progress is enabled or not
getUrlBuilder(string $player_url)
getSequencePlayer($gui, string $player_command, int $usr_id)
factors the player
Settings for an LSO (like abstract, extro)
getLearningSequenceAdminIds($a_grpId="")
getId()
get object id public
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
getCurriculumBuilder(array $items, LSUrlBuilder $url_builder=null)
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
static _lookupObjId($a_id)
static getInstanceByRefId(int $ref_id)
special template class to simplify handling of ITX/PEAR
getTitle()
get object title public
Persistence for View-States.
getLSLearnerItems(int $usr_id)
Get a list of LSLearnerItems.
redirection script todo: (a better solution should control the processing via a xml file) ...
cloneMetaData($target_obj)
Copy meta data.
getKioskRenderer(LSUrlBuilder $url_builder)
static _goto($target, $add="")
Goto target learning sequence.
Persistence for Settings (like abstract, extro)
raiseEvent(string $event_type)
addMember($user_id, $mem_role)
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
INTERNAL CLASS: Please do not use in consumer code.
update($pash, $contents, Config $config)
getLSItems()
Get a list of LSItems.
getPossiblePostConditionsForType(string $type)
Implementation of KioskMode Player.
Get LearningProgress and availability of items in sequence.
isCompletedByUser(int $usr_id)
getRefId()
get reference id public
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Persistence for online/activation period.
static _getInstance($a_obj_id)
get instance by obj_id
getDefaultLearningSequenceRoles($a_grp_id="")
static redirect($a_script)
updateActivation(ilLearningSequenceActivation $settings)
Builds the overview (curriculum) of a LearningSequence.
storeLSItems(array $ls_items)
Update LSItems.
Class ilObjLearningSequenceAccess class.