19 declare(strict_types=1);
53 $this->type = self::OBJ_TYPE;
54 $this->
lng = $DIC[
'lng'];
55 $this->
ctrl = $DIC[
'ilCtrl'];
56 $this->
user = $DIC[
'ilUser'];
57 $this->tree = $DIC[
'tree'];
58 $this->log = $DIC[
"ilLoggerFactory"]->getRootLogger();
59 $this->app_event_handler = $DIC[
'ilAppEventHandler'];
60 $this->il_news = $DIC->news();
65 $this->
lng->loadLanguageModule(
'rbac');
73 public function read(): void
84 $id = parent::create();
90 return $this->
getId();
95 if (!parent::update()) {
103 public function delete():
bool 105 if (!parent::delete()) {
121 $this->app_event_handler->raise(
122 'components/ILIAS/LearningSequence',
125 'obj_id' => $this->
getId(),
126 'appointments' =>
null 131 public function cloneObject(
int $target_id,
int $copy_id = 0,
bool $omit_tree =
false): ?
ilObject 134 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
143 $roles = $new_obj->getLSRoles();
145 $this->
user->getId(),
146 $roles->getDefaultAdminRole()
153 foreach ($cp_types as
$type) {
155 if ($type ===
'lsoi') {
158 $original_page = new \ilLSOIntroPage($old_intro_page_id);
159 $original_page->copy($new_copg_id, $type, $new_copg_id);
161 if ($type ===
'lsoe') {
165 $original_page->copy($new_copg_id, $type, $new_copg_id);
175 if (!$admin || !$new_admin || !$this->
getRefId() || !$new_obj->
getRefId()) {
176 $this->log->write(__METHOD__ .
' : Error cloning auto generated role: il_lso_admin');
179 $this->rbac_admin->copyRolePermissions($admin, $this->
getRefId(), $new_obj->
getRefId(), $new_admin,
true);
180 $this->log->write(__METHOD__ .
' : Finished copying of role lso_admin.');
185 if (!$member || !$new_member) {
186 $this->log->write(__METHOD__ .
' : Error cloning auto generated role: il_lso_member');
189 $this->rbac_admin->copyRolePermissions($member, $this->
getRefId(), $new_obj->
getRefId(), $new_member,
true);
190 $this->log->write(__METHOD__ .
' : Finished copying of role lso_member.');
200 foreach ($source->getUploads() as $key => $upload_info) {
201 $target = $target->withUpload($upload_info, $key);
204 foreach ($source->getDeletions() as $deletion) {
205 $target = $target->withDeletion($deletion);
209 ->withAbstract($source->getAbstract())
210 ->withExtro($source->getExtro())
211 ->withAbstractImage($source->getAbstractImage())
212 ->withExtroImage($source->getExtroImage())
221 $lp_settings->cloneSettings($obj_id);
228 if ($cwo->isRootNode($this->getRefId())) {
237 $new_status = ($new_obj->
getLSActivation()->getEffectiveOnlineStatus())
254 if (is_null($this->di)) {
256 $di->init($this->
getDIC());
264 if (is_null($this->local_di)) {
272 $this->local_di =
$di;
279 if (!$this->settings_db) {
280 $this->settings_db = $this->
getDI()[
'db.settings'];
287 if (!$this->activation_db) {
288 $this->activation_db = $this->
getDI()[
'db.activation'];
295 if (!$this->ls_activation) {
305 $this->ls_activation = $settings;
310 if (!$this->ls_settings) {
320 $this->ls_settings = $settings;
325 if (!$this->items_db) {
326 $this->items_db = $this->
getLocalDI()[
'db.lsitems'];
333 if (!$this->conditions_db) {
334 $this->conditions_db = $this->
getDI()[
"db.postconditions"];
341 if (!$this->ls_participants) {
342 $this->ls_participants = $this->
getLocalDI()[
'participants'];
354 if (is_null($this->ls_access)) {
377 $db->storeItems($ls_items);
387 $rep_utils->deleteObjects($this->
getRefId(), $ref_ids);
389 $db->delete($ref_ids);
397 $condition_types = $this->il_condition_handler->getOperatorsByTriggerType($type);
401 foreach ($condition_types as $cond_type) {
402 $conditions[$cond_type] = $this->
lng->txt(
'condition_' . $cond_type);
409 if (!$this->learner_progress_db) {
410 $this->learner_progress_db = $this->
getLocalDI()[
'db.progress'];
417 if (!$this->state_db) {
418 $this->state_db = $this->
getDI()[
'db.states'];
429 return $db->getLearnerItems($usr_id, $this->
getRefId());
434 if (!$this->ls_roles) {
435 $this->ls_roles = $this->
getLocalDI()[
'roles'];
451 public static function _goto(
string $target,
string $add =
""): void
454 $main_tpl = $DIC->ui()->mainTemplate();
456 $ilAccess = $DIC[
'ilAccess'];
459 $ilUser = $DIC[
'ilUser'];
463 if (substr($add, 0, 5) ==
'rcode') {
468 "login.php?target=" . $request_target .
"&cmd=force_login&lang=" .
469 $ilUser->getCurrentLanguage()
481 if ($add ==
"mem" && $ilAccess->checkAccess(
"manage_members",
"", $target)) {
485 if ($ilAccess->checkAccess(
"read",
"", $target)) {
489 if ($ilAccess->checkAccess(
"visible",
"", $target)) {
493 $main_tpl->setOnScreenMessage(
'failure', sprintf(
494 $lng->
txt(
"msg_no_perm_read_item"),
515 $item->setContentIsLangVar(
true);
516 $item->setContentTextIsLangVar(
true);
517 $item->setTitle(
"lso_news_online_title");
518 $item->setContent(
"lso_news_online_txt");
519 $ns->data()->save($item);
529 $act_db->setEffectiveOnlineStatus($this->
getRefId(), $status);
535 $curriculum = $dic[
"player.curriculumbuilder"]->getLearnerCurriculum(
false);
536 return $dic[
'ui.renderer']->render($curriculum);
542 $buttons = $dic[
"player.launchlinksbuilder"]->getLaunchbuttonsComponent();
543 return $dic[
'ui.renderer']->render($buttons);
555 return $this->
getLSRoles()->getLocalLearningSequenceRoles($translate);
560 return $this->
getLSRoles()->getDefaultMemberRole();
565 return $this->
getLSRoles()->getDefaultAdminRole();
573 return $this->
getLSRoles()->getDefaultLearningSequenceRoles($a_grp_id);
588 return $this->getLsRoles()->readMemberData($user_ids, $columns);
593 foreach ($this->tree->getPathFull($ref_id) as $hop) {
594 if (in_array($hop[
'type'], $search_types)) {
613 return $this->
getId();
624 throw new \LogicException(
'will not create content page - it already exists.');
628 $new_page_object->setParentId($this->
getId());
629 $new_page_object->createFromXML();
638 $gui = $page_type === LSOPageType::INTRO ?
642 $gui->setPresentationTitle(
"");
643 $gui->setTemplateOutput(
false);
645 $ret = $gui->showPage();
const LP_STATUS_COMPLETED_NUM
static handleCode(int $a_ref_id, string $a_type, string $a_code)
Storage for ilLSPostConditions.
ilLSPostConditionDB $conditions_db
ilLearningSequenceActivation $ls_activation
deletePostConditionsForSubObjects(array $ref_ids)
Delete post conditions for ref ids.
getMailToMembersType()
Get mail to members type.
updateSettings(ilLearningSequenceSettings $settings)
setEffectiveOnlineStatus(bool $status)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
cloneLPSettings(int $obj_id)
ilLearningSequenceSettings $ls_settings
cloneAutoGeneratedRoles(ilObjLearningSequence $new_obj)
getParentObjectInfo(int $ref_id, array $search_types)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
cloneSettings(ilObjLearningSequence $new_obj)
Interface Observer Contains several chained tasks and infos about them.
getDefaultLearningSequenceRoles(string $a_grp_id="")
getCurrentUserCurriculum()
static _gotoRepositoryNode(int $ref_id, string $cmd="")
__construct(int $id=0, bool $call_by_reference=true)
Class ilObjLearningSequenceEditExtroGUI ilObjLearningSequenceEditExtroGUI: ilPageEditorGUI, ilEditClipboardGUI.
Class ilObjLearningSequenceEditIntroGUI ilObjLearningSequenceEditIntroGUI: ilPageEditorGUI, ilEditClipboardGUI.
ilLearningSequenceSettingsDB $settings_db
hasContentPage(LSOPageType $page_type)
createContentPage(LSOPageType $page_type)
Activation-Settings for an LSO.
static _lookupObjId(int $ref_id)
getLocalLearningSequenceRoles(bool $translate=false)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getCurrentUserLaunchButtons()
ILIAS News Service $il_news
cloneMetaData(ilObject $target_obj)
Copy meta data.
ilLearningSequenceActivationDB $activation_db
static _lookupTitle(int $obj_id)
Settings for an LSO (like abstract, extro)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static getInstanceByRefId(int $ref_id)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Persistence for View-States.
getLSLearnerItems(int $usr_id)
cloneIntroAndExtroContentPages(ilObjLearningSequence $new_obj, array $cp_types)
Persistence for Settings (like abstract, extro)
raiseEvent(string $event_type)
readMemberData(array $user_ids, ?array $columns=null)
cloneActivation(ilObjLearningSequence $new_obj, int $a_copy_id)
ilLearningSequenceRoles $ls_roles
static _deleteAllEntries(int $a_obj_id)
Delete all entries Normally called in case of object deletion.
getContentPageHTML(LSOPageType $page_type)
static redirect(string $a_script)
ilLearningSequenceParticipants $ls_participants
getPossiblePostConditionsForType(string $type)
Get LearningProgress and availability of items in sequence.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
ilConditionHandler $il_condition_handler
static _goto(string $target, string $add="")
Goto target learning sequence.
ilObjLearningSequenceAccess $ls_access
Persistence for online/activation period.
ilLearnerProgressDB $learner_progress_db
static _getInstance(int $a_copy_id)
static _lookupType(int $id, bool $reference=false)
updateActivation(ilLearningSequenceActivation $settings)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
storeLSItems(array $ls_items)
Update LSItems.