3declare(strict_types=1);
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();
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);
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(),
511 $this->app_event_handler,
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),
564 $this->getLinkTarget(self::CMD_INFO)
571 $this->lng->txt(self::TAB_SETTINGS),
572 $this->getLinkTarget(self::CMD_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),
596 $this->getLinkTarget(self::CMD_LP)
603 $this->lng->txt(self::TAB_EXPORT),
604 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
610 self::TAB_PERMISSIONS,
611 $this->lng->txt(self::TAB_PERMISSIONS),
612 $this->getLinkTarget(self::CMD_PERMISSIONS)
624 $this->tabs->addSubTab(
625 self::TAB_VIEW_CONTENT,
626 $this->lng->txt(self::TAB_VIEW_CONTENT),
627 $this->getLinkTarget(self::CMD_LEARNER_VIEW)
631 $this->tabs->addSubTab(
633 $this->lng->txt(self::TAB_MANAGE),
634 $this->getLinkTarget(self::CMD_CONTENT)
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);
669 return 'ilObjLearningSequenceContentGUI';
671 return 'ilObjLearningSequenceLearnerGUI';
673 return 'ilObjLearningSequenceSettingsGUI';
675 return 'ilInfoScreenGUI';
677 return 'ilPermissionGUI';
679 return 'ilLearningProgressGUI';
682 throw new InvalidArgumentException(
'cannot resolve class for command: ' . $cmd);
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;
An exception for terminatinating execution or to throw for unit testing.
const PARAM_LP_CURRENT_ITEM_OBJID
const CMD_CHECK_CURRENT_ITEM_LP
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.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
trashObject()
Show trash content of object.
cutObject()
cut object(s) out from a container and write the information to clipboard
showPasteTreeObject()
Show paste tree.
performPasteIntoMultipleObjectsObject()
undeleteObject()
Get objects back from trash.
linkObject()
create an new reference of an object in tree it's like a hard link of unix
keepObjectsInClipboardObject()
Keep objects in the clipboard.
const SORT_NEW_ITEMS_ORDER_CREATION
const SORT_NEW_ITEMS_POSITION_BOTTOM
Base class for ILIAS Exception handling.
Export User Interface Class.
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
GUI class for learning sequence membership features.
static _isParticipant($ref_id, $usr_id)
Static function to check if a user is a participant of the container object.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Class ilObjLearningSequenceContentGUI.
Class ilObjLearningSequenceGUI.
settings(string $cmd=self::CMD_SETTINGS)
learningProgress(string $cmd=self::CMD_LP)
getCurrentItemForLearner(int $usr_id)
getLearnerItems(int $usr_id)
recordLearningSequenceRead()
getTabs()
common tabs for all container objects (should be called at the end of child getTabs() method
removeMember(int $usr_id)
renderObject()
render the object
static _goto(string $target)
getCurrentItemLearningProgress()
const CMD_MEMBERS_GALLERY
afterSave(ilObject $new_object)
Post (successful) object creation hook.
manageContent(string $cmd=self::CMD_CONTENT)
const CMD_DELETE_CONFIRMED
info(string $cmd=self::CMD_INFO)
const MAIL_ALLOWED_TUTORS
manage_members(string $cmd=self::CMD_MANAGE_MEMBERS)
permissions(string $cmd=self::CMD_PERMISSIONS)
executeCommand()
execute command note: this method is overwritten in all container objects
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
getLinkTarget(string $cmd)
const CMD_REMOVE_FROM_DESK
getAdditionalWhitelistTypes()
append additional types to ilRepositoryExplorerGUI's whitelist
learnerView(string $cmd=self::CMD_LEARNER_VIEW)
getClassForTabs(string $cmd)
Class ilObjLearningSequenceLearnerGUI.
Class ilObjLearningSequenceSettingsGUI.
static getInstanceByRefId(int $ref_id)
static _getTranslation($a_role_title)
static _enabledLearningProgress()
check wether learing progress is enabled or not
GUI class for the workflow of copying objects.
confirmedDeleteObject()
confirmed deletion of object -> objects are moved to trash or deleted immediately,...
cancelCreation()
cancel create action and go back to repository parent
importFileObject($parent_id=null, $a_catch_errors=true)
Import.
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
getCreationMode()
get creation mode
addHeaderAction()
Add header action menu.
deleteObject($a_error=false)
Display deletion confirmation screen.
Class ilObject Basic functions for all objects.
getRefId()
get reference id @access public
getId()
get object id @access public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _getInstance()
Get instance of ilPrivacySettings.
static redirect($a_script)
if(!array_key_exists('StateId', $_REQUEST)) $id
mail($to, $subject, $message, $additional_headers=null, $additional_parameters=null)
if(isset($_POST['submit'])) $form