3 declare(strict_types=1);
91 $id = explode(
"_", $target);
92 $ctrl->setTargetScript(
"ilias.php");
93 $ctrl->initBaseClass(
"ilRepositoryGUI");
94 $ctrl->setParameterByClass(
"ilobjlearningsequencegui",
"ref_id",
$id[0]);
95 $ctrl->redirectByClass(array(
"ilRepositoryGUI",
"ilobjlearningsequencegui" ), self::CMD_VIEW);
100 $this->ref_id = (int)
$_GET[
'ref_id'];
101 parent::__construct([], $this->ref_id,
true,
false);
106 $this->ctrl = $DIC[
'ilCtrl'];
107 $this->lng = $DIC[
'lng'];
108 $this->
user = $DIC[
'ilUser'];
109 $this->tabs = $DIC[
'ilTabs'];
110 $this->toolbar = $DIC[
'ilToolbar'];
111 $this->help = $DIC[
'ilHelp'];
112 $this->
settings = $DIC[
'ilSetting'];
113 $this->access = $DIC[
'ilAccess'];
114 $this->rbac_review = $DIC[
'rbacreview'];
115 $this->ui_factory = $DIC[
'ui.factory'];
116 $this->ui_renderer = $DIC[
'ui.renderer'];
117 $this->log = $DIC[
"ilLoggerFactory"]->getRootLogger();
118 $this->app_event_handler = $DIC[
'ilAppEventHandler'];
119 $this->navigation_history = $DIC[
'ilNavigationHistory'];
120 $this->obj_definition = $DIC[
'objDefinition'];
121 $this->obj_service = $DIC->object();
122 $this->toolbar = $DIC[
'ilToolbar'];
124 $this->help->setScreenIdComponent($this->obj_type);
125 $this->lng->loadLanguageModule($this->obj_type);
132 $usr_id = (int) $this->
user->getId();
135 foreach ($items as
$index => $item) {
136 if ($item->getRefId() === $current_item_ref_id) {
137 return $item->getLearningProgressStatus();
145 $this->object->getType(),
146 $this->
object->getRefId(),
147 $this->
object->getId(),
154 $next_class = $this->ctrl->getNextClass($this);
155 $cmd = $this->ctrl->getCmd();
160 $current_obj_obj_id = (int)
$_GET[LSControlBuilder::PARAM_LP_CURRENT_ITEM_OBJID];
164 $this->
user->getId(),
177 parent::prepareOutput();
185 $next_class ===
'ilobjlearningsequencelearnergui' 189 $tpl->setPermanentLink(
"lso", $this->ref_id);
191 switch ($next_class) {
192 case "ilcommonactiondispatchergui":
194 $this->ctrl->forwardCommand($gui);
196 case "ilinfoscreengui":
199 case "ilpermissiongui":
202 case "ilobjlearningsequencesettingsgui":
205 case "ilobjlearningsequencecontentgui":
208 case "ilobjlearningsequencelearnergui":
211 case "illearningsequencemembershipgui":
214 case 'ilmailmembersearchgui':
217 case 'illearningprogressgui':
223 case 'ilobjectcopygui':
226 $this->ctrl->forwardCommand($cp);
228 case 'ilobjindividualassessmentgui':
229 $struct = [
'ilrepositorygui',
'ilobjindividualassessmentgui'];
230 if ($cmd ===
'edit') {
231 $struct[] =
'ilindividualassessmentsettingsgui';
233 $this->ctrl->redirectByClass($struct, $cmd);
239 $cmd = self::CMD_VIEW;
243 case self::CMD_IMPORT:
247 case self::CMD_INFO_SCREEN:
251 case self::CMD_LEARNER_VIEW:
252 case self::CMD_CONTENT:
253 case self::CMD_MEMBERS:
254 case self::CMD_SETTINGS:
256 case self::CMD_CREATE:
258 case self::CMD_UNPARTICIPATE:
261 case self::CMD_CANCEL:
266 case self::CMD_REMOVE_FROM_DESK:
270 case self::CMD_ADD_TO_DESK:
277 case self::CMD_CUT_SHOWTREE:
280 case self::CMD_CUT_CLIPBOARD:
286 case self::CMD_DELETE:
289 case self::CMD_DELETE_CONFIRMED:
292 case self::CMD_PERFORM_PASTE:
295 case self::CMD_SHOW_TRASH:
298 case self::CMD_UNDELETE:
302 case self::CMD_CANCEL_CUT:
303 case self::CMD_CANCEL_DELETE:
304 case self::CMD_CANCEL_LINK:
305 $cmd = self::CMD_CONTENT;
310 throw new ilException(
"ilObjLearningSequenceGUI: Invalid command '$cmd'");
314 throw new ilException(
"ilObjLearningSequenceGUI: Can't forward to next class $next_class");
326 $this->access->checkAccess(
'read',
'', $this->ref_id)
329 $this->navigation_history->addItem($this->ref_id, $link, $this->obj_type);
333 protected function info(
string $cmd = self::CMD_INFO)
335 $this->tabs->setTabActive(self::TAB_INFO);
336 $this->ctrl->setCmdClass(
'ilinfoscreengui');
337 $this->ctrl->setCmd($cmd);
339 $this->ctrl->forwardCommand(
$info);
342 protected function permissions(
string $cmd = self::CMD_PERMISSIONS)
344 $this->tabs->setTabActive(self::TAB_PERMISSIONS);
346 $this->ctrl->setCmd($cmd);
347 $this->ctrl->forwardCommand($perm_gui);
350 protected function settings(
string $cmd = self::CMD_SETTINGS)
352 $this->tabs->activateTab(self::TAB_SETTINGS);
360 $this->ctrl->setCmd($cmd);
361 $this->ctrl->forwardCommand($gui);
366 $this->tabs->clearSubTabs();
376 $this->
info(self::CMD_INFO);
382 $this->tabs->activateTab(self::TAB_CONTENT_MAIN);
384 $this->tabs->activateSubTab(self::TAB_MANAGE);
395 $this->ctrl->setCmd($cmd);
396 $this->ctrl->forwardCommand($gui);
399 protected function learnerView(
string $cmd = self::CMD_LEARNER_VIEW)
401 $this->tabs->activateTab(self::TAB_CONTENT_MAIN);
403 $this->tabs->activateSubTab(self::TAB_VIEW_CONTENT);
405 $usr_id = (int) $this->
user->getId();
413 $current_item_ref_id,
422 $this->ctrl->setCmd($cmd);
423 $this->ctrl->forwardCommand($gui);
428 $may_manage_members = $this->
checkAccess(
"edit_members");
429 $this->ctrl->setCmdClass(
'ilLearningSequenceMembershipGUI');
430 if ($may_manage_members) {
439 $this->tabs->setTabActive(self::TAB_MEMBERS);
454 $this->ctrl->setCmd($cmd);
455 $this->ctrl->forwardCommand($ms_gui);
460 $this->tabs->setTabActive(self::TAB_LP);
462 $for_user = $this->
user->getId();
464 if (
$_GET[
'user_id']) {
465 $for_user =
$_GET[
'user_id'];
474 if ($cmd === self::CMD_LP) {
478 $this->ctrl->setCmd($cmd);
479 $this->ctrl->forwardCommand($lp_gui);
484 $this->tabs->setTabActive(self::TAB_EXPORT);
486 $gui->addFormat(
"xml");
488 $this->ctrl->forwardCommand($gui);
498 parent::createObject();
503 parent::saveObject();
509 (
int) $new_object->
getId(),
516 $participant->updateNotification($this->
user->getId(), $this->
settings->get(
'mail_lso_admin_notification',
true));
519 $settings = new \ilContainerSortingSettings($new_object->
getId());
526 ilUtil::sendSuccess($this->lng->txt(
'object_added'),
true);
527 $this->ctrl->setParameter($this,
"ref_id", $new_object->
getRefId());
531 $this->ctrl->getLinkTarget($this, self::CMD_SETTINGS,
"",
false,
false)
539 $usr_id = (int) $this->
user->getId();
547 $this->ls_object->leave($usr_id);
554 self::TAB_CONTENT_MAIN,
555 $this->lng->txt(self::TAB_CONTENT_MAIN),
556 $this->ctrl->getLinkTarget($this, self::CMD_VIEW,
"",
false,
false)
563 $this->lng->txt(self::TAB_INFO),
571 $this->lng->txt(self::TAB_SETTINGS),
579 $this->
getObject()->getLSSettings()->getMembersGallery()
581 $this->
object->isMember((
int) $this->
user->getId())
586 $this->lng->txt(self::TAB_MEMBERS),
587 $this->ctrl->getLinkTarget($this, self::CMD_MEMBERS,
"",
false,
false)
595 $this->lng->txt(self::TAB_LP),
603 $this->lng->txt(self::TAB_EXPORT),
604 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
610 self::TAB_PERMISSIONS,
611 $this->lng->txt(self::TAB_PERMISSIONS),
624 $this->tabs->addSubTab(
625 self::TAB_VIEW_CONTENT,
626 $this->lng->txt(self::TAB_VIEW_CONTENT),
631 $this->tabs->addSubTab(
633 $this->lng->txt(self::TAB_MANAGE),
641 return $this->access->checkAccess($which,
"", $this->ref_id);
650 $may_edit_lp_settings = $this->
checkAccess(
'edit_learning_progress');
652 return ($lp_access || $may_edit_lp_settings);
659 strtolower(
'ilObjLearningSequenceGUI'),
662 return $this->ctrl->getLinkTargetByClass($class_path, $cmd);
668 case self::CMD_CONTENT:
669 return 'ilObjLearningSequenceContentGUI';
670 case self::CMD_LEARNER_VIEW:
671 return 'ilObjLearningSequenceLearnerGUI';
672 case self::CMD_SETTINGS:
673 return 'ilObjLearningSequenceSettingsGUI';
675 return 'ilInfoScreenGUI';
676 case self::CMD_PERMISSIONS:
677 return 'ilPermissionGUI';
679 return 'ilLearningProgressGUI';
687 $link = chr(13) . chr(10) . chr(13) . chr(10);
688 $link .= $this->lng->txt(
'lso_mail_permanent_link');
689 $link .= chr(13) . chr(10) . chr(13) . chr(10);
692 return rawurlencode(base64_encode($link));
697 return $this->
getObject()->getLSLearnerItems($usr_id);
702 return $this->
getObject()->getCurrentItemForLearner($usr_id);
707 if ($this->
object === null) {
724 $local_roles = $this->
object->getLocalLearningSequenceRoles(
false);
725 $lso_member = $this->
object->getDefaultMemberRole();
726 $lso_roles = array();
728 if (in_array($lso_member, $local_roles)) {
730 unset($local_roles[$lso_roles[$lso_member]]);
733 foreach ($local_roles as
$title => $role_id) {
745 $types = array_filter(
746 array_keys($this->obj_definition->getSubObjects(
'lso',
false)),
748 return $type !==
'rolf';
758 foreach ($a_data as $usr_id => $user_data) {
759 $res_data[$usr_id] = $user_data;
762 foreach ($udf_data->getAll() as $field => $value) {
763 list(
$f, $field_id) = explode(
'_', $field);
764 $res_data[$usr_id][
'udf_' . $field_id] = (string) $value;
getCurrentItemForLearner(int $usr_id)
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
const MAIL_ALLOWED_TUTORS
cancelCreation()
cancel create action and go back to repository parent
getLearnerItems(int $usr_id)
GUI class for the workflow of copying objects.
static _isParticipant($ref_id, $usr_id)
const CMD_DELETE_CONFIRMED
trashObject()
Show trash content of object.
if(!array_key_exists('StateId', $_REQUEST)) $id
Class ilObjLearningSequenceLearnerGUI.
const CMD_REMOVE_FROM_DESK
learningProgress(string $cmd=self::CMD_LP)
const PARAM_LP_CURRENT_ITEM_OBJID
confirmedDeleteObject()
confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
const CMD_CHECK_CURRENT_ITEM_LP
Class ilObjLearningSequenceSettingsGUI.
mail($to, $subject, $message, $additional_headers=null, $additional_parameters=null)
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _enabledLearningProgress()
check wether learing progress is enabled or not
const SORT_NEW_ITEMS_POSITION_BOTTOM
initDidacticTemplate(ilPropertyFormGUI $form)
undeleteObject()
Get objects back from trash.
if(isset($_POST['submit'])) $form
getId()
get object id public
linkObject()
create an new reference of an object in tree it's like a hard link of unix
manage_members(string $cmd=self::CMD_MANAGE_MEMBERS)
const SORT_NEW_ITEMS_ORDER_CREATION
afterSave(ilObject $new_object)
manageContent(string $cmd=self::CMD_CONTENT)
static getInstanceByRefId(int $ref_id)
settings(string $cmd=self::CMD_SETTINGS)
Class ilObjLearningSequenceContentGUI.
showPasteTreeObject()
Show paste tree.
importFileObject($parent_id=null, $a_catch_errors=true)
Import.
getAdditionalWhitelistTypes()
append additional types to ilRepositoryExplorerGUI's whitelist
getLinkTarget(string $cmd)
learnerView(string $cmd=self::CMD_LEARNER_VIEW)
const CMD_MEMBERS_GALLERY
removeMember(int $usr_id)
getClassForTabs(string $cmd)
static _getTranslation($a_role_title)
recordLearningSequenceRead()
performPasteIntoMultipleObjectsObject()
getCurrentItemLearningProgress()
static _goto(string $target)
const LP_CONTEXT_REPOSITORY
info(string $cmd=self::CMD_INFO)
getCreationMode()
get creation mode
cutObject()
cut object(s) out from a container and write the information to clipboard
getRefId()
get reference id public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
deleteObject($a_error=false)
Display deletion confirmation screen.
Class ilObjLearningSequenceGUI.
static _getInstance()
Get instance of ilPrivacySettings.
permissions(string $cmd=self::CMD_PERMISSIONS)
static redirect($a_script)
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
keepObjectsInClipboardObject()
Keep objects in the clipboard.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
GUI class for learning sequence membership features.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.