ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilObjCourseGUI Class Reference

Class ilObjCourseGUI. More...

+ Inheritance diagram for ilObjCourseGUI:
+ Collaboration diagram for ilObjCourseGUI:

Public Member Functions

 __construct ($a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
 gatewayObject ()
 
 renderObject ()
 
 deleteObject (bool $error=false)
 
 renderContainer ()
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreen ()
 
 saveNotificationObject ()
 
 editInfoObject (ilPropertyFormGUI $a_form=null)
 
 confirmDeleteInfoFilesObject ()
 
 deleteInfoFilesObject ()
 
 initInfoEditor ()
 
 updateInfoObject ()
 
 updateObject ()
 
 editObject (ilPropertyFormGUI $form=null)
 
 sendFileObject ()
 
 setSubTabs (string $a_tab)
 
 renderAddNewItem (string ... $disabled_object_types)
 
 readMemberData (array $ids, array $selected_columns=null, bool $skip_names=false)
 
 updateLPFromStatus (int $a_member_id, bool $a_has_passed)
 sync course status and lp status More...
 
 autoFillObject ()
 
 leaveObject ()
 
 unsubscribeObject ()
 
 performUnsubscribeObject ()
 
 addContentTab ()
 
 executeCommand ()
 
 editMapSettingsObject ()
 
 saveMapSettingsObject ()
 
 modifyItemGUI (ilObjectListGUI $a_item_list_gui, array $a_item_data)
 
 setContentSubTabs ()
 
 askResetObject ()
 
 resetObject ()
 
 __checkStartObjects ()
 
 createMailSignature ()
 Create a course mail signature. More...
 
 deliverCertificateObject ()
 
 saveSortingObject ()
 
 getLocalRoles (array $a_exclude=array())
 
 setSideColumnReturn ()
 
- Public Member Functions inherited from ilContainerGUI
 executeCommand ()
 
 forwardToPageObject ()
 
 addPageTabs ()
 
 getContainerPageHTML ()
 
 getContentGUI ()
 
 renderObject ()
 
 renderBlockAsynchObject ()
 render the object More...
 
 setContentSubTabs ()
 
 showAdministrationPanel ()
 
 showPermanentLink ()
 
 editPageFrameObject ()
 
 cancelPageContentObject ()
 
 showLinkListObject ()
 
 addHeaderRow (ilTemplate $a_tpl, string $a_type, bool $a_show_image=true)
 
 addMessageRow (ilTemplate $a_tpl, string $a_message, string $a_type)
 
 setPageEditorTabs ()
 
 addStandardContainerSubTabs (bool $a_include_view=true)
 Add standard container subtabs for view, manage, oderdering and text/media editor link. More...
 
 enableAdministrationPanelObject ()
 
 disableAdministrationPanelObject ()
 
 editOrderObject ()
 
 isActiveOrdering ()
 
 isActiveItemOrdering ()
 
 enableMultiDownloadObject ()
 
 isMultiDownloadEnabled ()
 
 cutObject ()
 cut object(s) out from a container and write the information to clipboard public More...
 
 copyObject ()
 Copy object(s) out from a container and write the information to clipboard It is not possible to copy multiple objects at once. More...
 
 downloadObject ()
 
 getBucketTitle ()
 
 linkObject ()
 create an new reference of an object in tree it's like a hard link of unix More...
 
 clearObject ()
 clear clipboard and go back to last object More...
 
 performPasteIntoMultipleObjectsObject ()
 
 initAndDisplayLinkIntoMultipleObjectsObject ()
 
 showPasteTreeObject ()
 
 cancelMoveLinkObject ()
 Cancel move|link empty clipboard and return to parent. More...
 
 keepObjectsInClipboardObject ()
 
 initAndDisplayCopyIntoMultipleObjectsObject ()
 
 initAndDisplayMoveIntoObjectObject ()
 
 pasteObject ()
 paste object from clipboard to current place Depending on the chosen command the object(s) are linked, copied or moved More...
 
 clipboardObject ()
 
 isActiveAdministrationPanel ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 allowBlocksMoving ()
 Standard is to allow blocks moving. More...
 
 allowBlocksConfigure ()
 Standard is to allow blocks configuration. More...
 
 cloneAllObject ()
 Clone all object Overwritten method for copying container objects. More...
 
 saveSortingObject ()
 
 cloneNodes (int $srcRef, int $dstRef, array &$mapping, string $newName=null)
 Recursively clones all nodes of the RBAC tree. More...
 
 modifyItemGUI (ilObjectListGUI $a_item_list_gui, array $a_item_data)
 
 editStylePropertiesObject ()
 
 redrawListItemObject ()
 Redraw a list item (ajax) More...
 
 trashObject ()
 Show trash content of object. More...
 
 trashApplyFilterObject ()
 
 trashResetFilterObject ()
 
 removeFromSystemObject ()
 
 undeleteObject ()
 Get objects back from trash. More...
 
 confirmRemoveFromSystemObject ()
 
 setSideColumnReturn ()
 
 getAdminTabs ()
 
 competencesObject ()
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Static Public Member Functions

static _forwards ()
 
static _goto ($a_target, string $a_add="")
 
static _modifyItemGUI (ilObjectListGUI $a_item_list_gui, string $a_cmd_class, array $a_item_data, bool $a_abo_status, int $a_course_ref_id, int $a_course_obj_id, int $a_parent_ref_id=0)
 
- Static Public Member Functions inherited from ilContainerGUI
static _buildPath (int $a_ref_id, int $a_course_ref_id)
 build path More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

const BREADCRUMB_DEFAULT = 0
 
const BREADCRUMB_CRS_ONLY = 1
 
const BREADCRUMB_FULL_PATH = 2
 
- Data Fields inherited from ilContainerGUI
int $bl_cnt = 1
 
bool $multi_download_enabled = false
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

 afterImport (ilObject $new_object)
 
 getSubServices ()
 
 confirmLPSync ()
 
 setLPSyncObject ()
 
 getEditFormValues ()
 values are already set in initEditForm Returning an empty array avoid overriding these values. More...
 
 initEditForm ()
 
 showPossibleSubObjects ()
 
 afterSave (ilObject $new_object)
 
 getAgreementTabs ()
 
 getTabs ()
 
 membersObject ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 
 afterSaveCallback ()
 
 redirectLocToTestConfirmedObject ()
 
 redirectLocToTestObject ($a_force_new_run=null)
 
 redirectLocToTestConfirmation (int $a_objective_id, int $a_test_id)
 Show confirmation whether user wants to start a new run or resume a previous run. More...
 
 hasAdminPermission ()
 
 jump2UsersGalleryObject ()
 
- Protected Member Functions inherited from ilContainerGUI
 getModeManager ()
 
 getItemPresentation ( $include_empty_blocks=true, ?string $lang=null)
 
 getEditFormValues ()
 
 afterUpdate ()
 
 setTitleAndDescription ()
 
 showPossibleSubObjects ()
 
 supportsPageEditor ()
 
 gotItems ()
 
 getTabs ()
 
 showContainerPageTabs ()
 
 showPasswordInstructionObject (bool $a_init=true)
 
 initFormPasswordInstruction ()
 Init password form. More...
 
 savePasswordObject ()
 
 initEditForm ()
 
 initSortingForm (ilPropertyFormGUI $form, array $a_sorting_settings)
 Append sorting settings to property form. More...
 
 initListPresentationForm (ilPropertyFormGUI $form)
 Add list presentation settings to form. More...
 
 saveListPresentation (ilPropertyFormGUI $form)
 
 initSortingDirectionForm (ilContainerSortingSettings $sorting_settings, ilRadioOption $element, string $a_prefix)
 Add sorting direction. More...
 
 initManualSortingOptionForm (ilContainerSortingSettings $settings, ilRadioOption $element, string $a_prefix, array $a_sorting_settings)
 Add manual sorting options. More...
 
 saveSortingSettings (ilPropertyFormGUI $form)
 
 trashHandleFilter (bool $action_apply, bool $action_reset)
 
 restoreToNewLocationObject (ilPropertyFormGUI $form=null)
 
 getTreeSelectorGUI (string $cmd)
 
 initFilter ()
 
 showContainerFilter ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

News $news
 
GlobalHttpState $http
 
Factory $refinery
 
ilHelpGUI $help
 
ilNavigationHistory $navigation_history
 
- Protected Attributes inherited from ilContainerGUI
ILIAS Container InternalGUIService $gui
 
ILIAS Style Content GUIService $content_style_gui
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ILIAS Container Content ItemPresentationManager $item_presentation = null
 
ILIAS Container InternalDomainService $domain
 
ilTabsGUI $tabs
 
ilErrorHandling $error
 
ilObjectDefinition $obj_definition
 
ilRbacAdmin $rbacadmin
 
ilPropertyFormGUI $form
 
ilLogger $log
 
ilObjectDataCache $obj_data_cache
 
Services $global_screen
 
ilAppEventHandler $app_event_handler
 
UIServices $ui
 
ilContainerFilterService $container_filter_service
 
ilContainerUserFilter $container_user_filter = null
 
Standard $ui_filter = null
 
bool $edit_order = false
 
bool $adminCommands = false
 
string $requested_redirectSource = ""
 
int $current_position = 0
 
ClipboardManager $clipboard
 
StandardGUIRequest $std_request
 
ModeManager $mode_manager = null
 
ilComponentFactory $component_factory
 
ILIAS Style Content DomainService $content_style_domain
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 checkAgreement ()
 

Private Attributes

ilAdvancedMDRecordGUI $record_gui = null
 
ilContainerStartObjects $start_obj = null
 
ilLogger $logger
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjCourseGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference = true,
bool  $a_prepare_output = true 
)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), and ILIAS\Repository\refinery().

63  {
64  global $DIC;
65 
66  $this->type = "crs";
67  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
68 
69  $this->help = $DIC->help();
70  $this->logger = $DIC->logger()->crs();
71  $this->navigation_history = $DIC['ilNavigationHistory'];
72  $this->ctrl->saveParameter($this, ['ref_id']);
73  $this->lng->loadLanguageModule('crs');
74  $this->lng->loadLanguageModule('cert');
75  $this->lng->loadLanguageModule('obj');
76 
77  $this->http = $DIC->http();
78  $this->refinery = $DIC->refinery();
79  $this->news = $DIC->news();
80  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:25
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ __checkStartObjects()

ilObjCourseGUI::__checkStartObjects ( )

Definition at line 2815 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\access(), and ILIAS\Repository\object().

Referenced by executeCommand(), and renderObject().

2815  : bool
2816  {
2817  if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
2818  return true;
2819  }
2820  $this->start_obj = new ilContainerStartObjects(
2821  $this->object->getRefId(),
2822  $this->object->getId()
2823  );
2824  if (count($this->start_obj->getStartObjects()) &&
2825  !$this->start_obj->allFullfilled($this->user->getId())) {
2826  return false;
2827  }
2828  return true;
2829  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _forwards()

static ilObjCourseGUI::_forwards ( )
static

Definition at line 2534 of file class.ilObjCourseGUI.php.

2534  : array
2535  {
2536  return array("ilCourseRegisterGUI", 'ilConditionHandlerGUI');
2537  }

◆ _goto()

static ilObjCourseGUI::_goto (   $a_target,
string  $a_add = "" 
)
static

Definition at line 2544 of file class.ilObjCourseGUI.php.

References $DIC, $ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ANONYMOUS_USER_ID, ilMembershipRegistrationCodeUtils\handleCode(), ILIAS\Repository\int(), ilContSkillPresentationGUI\isAccessible(), ILIAS\Refinery\Factory\kindlyTo(), ilUtil\redirect(), ROOT_FOLDER_ID, ilLanguage\txt(), and ILIAS\HTTP\GlobalHttpState\wrapper().

Referenced by ILIAS\StaticURL\Handler\LegacyGotoHandler\handle().

2544  : void
2545  {
2546  global $DIC;
2547  $main_tpl = $DIC->ui()->mainTemplate();
2548  $ilAccess = $DIC['ilAccess'];
2549  $ilErr = $DIC['ilErr'];
2550  $lng = $DIC['lng'];
2551  $ilUser = $DIC['ilUser'];
2552  $http = $DIC->http();
2553  $refinery = $DIC->refinery();
2554 
2555  $a_target = (int) $a_target;
2556 
2557  if (substr($a_add, 0, 5) == 'rcode') {
2558  if ($ilUser->getId() == ANONYMOUS_USER_ID) {
2559  $target = '';
2560  if ($http->wrapper()->query()->has('target')) {
2561  $target = $http->wrapper()->query()->retrieve(
2562  'target',
2563  $refinery->kindlyTo()->string()
2564  );
2565  }
2566  // Redirect to login for anonymous
2568  "login.php?target=" . $target . "&cmd=force_login&lang=" .
2569  $ilUser->getCurrentLanguage()
2570  );
2571  }
2572 
2573  // Redirects to target location after assigning user to course
2575  $a_target,
2577  substr($a_add, 5)
2578  );
2579  }
2580 
2581  if ($a_add == "mem" && $ilAccess->checkAccess("manage_members", "", $a_target)) {
2582  ilObjectGUI::_gotoRepositoryNode($a_target, "members");
2583  }
2584 
2585  if ($a_add == "comp" && ilContSkillPresentationGUI::isAccessible($a_target)) {
2586  ilObjectGUI::_gotoRepositoryNode($a_target, "competences");
2587  }
2588 
2589  if ($ilAccess->checkAccess("read", "", $a_target)) {
2591  } else {
2592  // to do: force flat view
2593  if ($ilAccess->checkAccess("visible", "", $a_target)) {
2594  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreenGoto");
2595  } else {
2596  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
2597  $main_tpl->setOnScreenMessage('failure', sprintf(
2598  $lng->txt("msg_no_perm_read_item"),
2600  ), true);
2602  }
2603  }
2604  }
2605  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
2606  }
static handleCode(int $a_ref_id, string $a_type, string $a_code)
const ANONYMOUS_USER_ID
Definition: constants.php:27
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...
const ROOT_FOLDER_ID
Definition: constants.php:32
static _gotoRepositoryNode(int $ref_id, string $cmd="")
$ilErr
Definition: raiseError.php:17
static _lookupObjId(int $ref_id)
GlobalHttpState $http
ilLanguage $lng
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:25
static redirect(string $a_script)
static _lookupType(int $id, bool $reference=false)
kindlyTo()
Combined validations and transformations for primitive data types that establish a baseline for furth...
Definition: Factory.php:56
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _modifyItemGUI()

static ilObjCourseGUI::_modifyItemGUI ( ilObjectListGUI  $a_item_list_gui,
string  $a_cmd_class,
array  $a_item_data,
bool  $a_abo_status,
int  $a_course_ref_id,
int  $a_course_obj_id,
int  $a_parent_ref_id = 0 
)
static

Definition at line 2705 of file class.ilObjCourseGUI.php.

References $DIC, ilObjectGUI\$lng, ilObjCourse\_lookupViewMode(), ilObjectListGUI\enableSubscribe(), and ilContainer\VIEW_OBJECTIVE.

Referenced by ilObjGroupGUI\modifyItemGUI(), ilObjSessionGUI\modifyItemGUI(), ilObjFolderGUI\modifyItemGUI(), and modifyItemGUI().

2713  : void {
2714  global $DIC;
2715  $lng = $DIC->language();
2716  $ilAccess = $DIC->access();
2717 
2718  // this is set for folders within the course
2719  if ($a_parent_ref_id == 0) {
2720  $a_parent_ref_id = $a_course_ref_id;
2721  }
2722 
2723  // Special handling for tests in courses with learning objectives
2724  if ($a_item_data['type'] == 'tst' && ilObjCourse::_lookupViewMode($a_course_obj_id) == ilContainer::VIEW_OBJECTIVE) {
2725  $a_item_list_gui->addCommandLinkParameter(array('crs_show_result' => $a_course_ref_id));
2726  }
2727 
2728  $a_item_list_gui->enableSubscribe($a_abo_status);
2729 
2730  $is_tutor = ($ilAccess->checkAccess(
2731  'write',
2732  '',
2733  $a_course_ref_id,
2734  'crs',
2735  $a_course_obj_id
2736  ));
2737  }
enableSubscribe(bool $status)
static _lookupViewMode(int $a_id)
ilLanguage $lng
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addContentTab()

ilObjCourseGUI::addContentTab ( )

Definition at line 1832 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by getTabs().

1832  : void
1833  {
1834  $this->tabs_gui->addTab(
1835  "view_content",
1836  $this->lng->txt("content"),
1837  $this->ctrl->getLinkTarget($this, "view")
1838  );
1839  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterImport()

ilObjCourseGUI::afterImport ( ilObject  $new_object)
protected

Definition at line 90 of file class.ilObjCourseGUI.php.

References ilCourseParticipants\_getInstanceByObjId(), ilCourseConstants\CRS_ADMIN, ilObject\getId(), ILIAS\Repository\settings(), and ILIAS\Repository\user().

90  : void
91  {
92  $part = ilCourseParticipants::_getInstanceByObjId($new_object->getId());
93  $part->add($this->user->getId(), ilCourseConstants::CRS_ADMIN);
94  $part->updateNotification(
95  $this->user->getId(),
96  (bool) $this->settings->get('mail_crs_admin_notification', '1')
97  );
98  parent::afterImport($new_object);
99  }
static _getInstanceByObjId(int $a_obj_id)
+ Here is the call graph for this function:

◆ afterSave()

ilObjCourseGUI::afterSave ( ilObject  $new_object)
protected

Definition at line 1608 of file class.ilObjCourseGUI.php.

References ilChangeEvent\_recordWriteEvent(), ILIAS\Repository\ctrl(), ilObject\getId(), ilObject\getRefId(), ilObjectGUI\getReturnLocation(), ilParticipants\IL_CRS_ADMIN, ILIAS\Repository\lng(), ilUtil\redirect(), ILIAS\Repository\settings(), ilObject\update(), and ILIAS\Repository\user().

1608  : void
1609  {
1610  $new_object->getMemberObject()->add($this->user->getId(), ilParticipants::IL_CRS_ADMIN);
1611  $new_object->getMemberObject()->updateNotification(
1612  $this->user->getId(),
1613  $this->settings->get('mail_crs_admin_notification', '1')
1614  );
1615  $new_object->getMemberObject()->updateContact($this->user->getId(), 1);
1616  $new_object->update();
1617 
1618  ilChangeEvent::_recordWriteEvent($new_object->getId(), $this->user->getId(), 'create');
1619  // END ChangeEvent: Record write event.
1620 
1621  // always send a message
1622  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_added"), true);
1623  $this->ctrl->setParameter($this, "ref_id", $new_object->getRefId());
1625  "save",
1626  $this->ctrl->getLinkTarget($this, "edit", "")
1627  ));
1628  }
static _recordWriteEvent(int $obj_id, int $usr_id, string $action, ?int $parent_obj_id=null)
Records a write event.
static redirect(string $a_script)
getReturnLocation(string $cmd, string $default_location="")
Get return location for command (command is method name without "Object", e.g.
+ Here is the call graph for this function:

◆ afterSaveCallback()

ilObjCourseGUI::afterSaveCallback ( )
protected

Definition at line 2945 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl().

2945  : void
2946  {
2947  $this->ctrl->redirectByClass(array('ilrepositorygui', 'ilobjcoursegui', 'illoeditorgui'), 'materials');
2948  }
+ Here is the call graph for this function:

◆ askResetObject()

ilObjCourseGUI::askResetObject ( )

Definition at line 2787 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

2787  : void
2788  {
2789  //$this->tpl->setOnScreenMessage('question', $this->lng->txt('crs_objectives_reset_sure'));
2790  $confirm = new ilConfirmationGUI();
2791  $confirm->setHeaderText($this->lng->txt('crs_objectives_reset_sure'));
2792  $confirm->setFormAction($this->ctrl->getFormAction($this));
2793  $confirm->setConfirm($this->lng->txt('reset'), 'reset');
2794  $confirm->setCancel($this->lng->txt('cancel'), 'cancel');
2795  $this->tpl->setContent($confirm->getHTML());
2796  }
+ Here is the call graph for this function:

◆ autoFillObject()

ilObjCourseGUI::autoFillObject ( )

Definition at line 1746 of file class.ilObjCourseGUI.php.

References ilObjectGUI\checkPermission(), ILIAS\Repository\lng(), membersObject(), and ILIAS\Repository\object().

1746  : bool
1747  {
1748  $this->checkPermission('write');
1749  if (
1750  $this->object->isSubscriptionMembershipLimited() &&
1751  $this->object->getSubscriptionMaxMembers() &&
1752  $this->object->getSubscriptionMaxMembers() <= $this->object->getMembersObject()->getCountMembers()
1753  ) {
1754  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_max_members_reached"));
1755  $this->membersObject();
1756  return false;
1757  }
1758  if ($number = $this->object->getMembersObject()->autoFillSubscribers()) {
1759  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_number_users_added") . " " . $number);
1760  } else {
1761  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_added"));
1762  }
1763  $this->membersObject();
1764  return true;
1765  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ checkAgreement()

ilObjCourseGUI::checkAgreement ( )
private

Definition at line 2499 of file class.ilObjCourseGUI.php.

References ilCourseUserData\_checkRequired(), ilMemberAgreement\_hasAccepted(), ilCourseDefinedFieldDefinition\_hasFields(), ILIAS\Repository\access(), ilMemberViewSettings\getInstance(), ilPrivacySettings\getInstance(), ILIAS\Repository\logger(), ILIAS\Repository\object(), and ILIAS\Repository\user().

Referenced by renderObject().

2499  : bool
2500  {
2501  if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
2502  return true;
2503  }
2504 
2505  // Disable aggrement if is not member of course
2506  if (!$this->object->getMemberObject()->isAssigned()) {
2507  return true;
2508  }
2509 
2510  if (ilMemberViewSettings::getInstance()->isActive()) {
2511  return true;
2512  }
2513 
2514  $privacy = ilPrivacySettings::getInstance();
2515 
2516  // Check agreement
2517  if (
2518  (
2519  $privacy->courseConfirmationRequired() || ilCourseDefinedFieldDefinition::_hasFields($this->object->getId())
2520  ) &&
2521  !ilMemberAgreement::_hasAccepted($this->user->getId(), $this->object->getId())
2522  ) {
2523  $this->logger->warning('Missing course confirmation.');
2524  return false;
2525  }
2526  // Check required fields
2527  if (!ilCourseUserData::_checkRequired($this->user->getId(), $this->object->getId())) {
2528  $this->logger->warning('Missing required fields');
2529  return false;
2530  }
2531  return true;
2532  }
static _checkRequired(int $a_usr_id, int $a_obj_id)
static _hasAccepted(int $a_usr_id, int $a_obj_id)
Check if user has accepted agreement.
static _hasFields(int $a_container_id)
Check if there are any define fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteInfoFilesObject()

ilObjCourseGUI::confirmDeleteInfoFilesObject ( )

Definition at line 500 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl(), editInfoObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and setSubTabs().

500  : void
501  {
502  $file_ids = [];
503  if ($this->http->wrapper()->post()->has('file_id')) {
504  $file_ids = $this->http->wrapper()->post()->retrieve(
505  'file_id',
506  $this->refinery->kindlyTo()->listOf(
507  $this->refinery->kindlyTo()->int()
508  )
509  );
510  }
511  if (count($file_ids) === 0) {
512  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
513  $this->editInfoObject();
514  return;
515  }
516 
517  $this->setSubTabs('properties');
518  $this->tabs_gui->setTabActive('settings');
519  $this->tabs_gui->setSubTabActive('crs_info_settings');
520 
521  $c_gui = new ilConfirmationGUI();
522 
523  // set confirm/cancel commands
524  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteInfoFiles"));
525  $c_gui->setHeaderText($this->lng->txt("info_delete_sure"));
526  $c_gui->setCancel($this->lng->txt("cancel"), "editInfo");
527  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteInfoFiles");
528 
529  // add items to delete
530  foreach ($file_ids as $file_id) {
531  $file = new ilCourseFile($file_id);
532  $c_gui->addItem("file_id[]", $file_id, $file->getFileName());
533  }
534  $this->tpl->setContent($c_gui->getHTML());
535  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
setSubTabs(string $a_tab)
editInfoObject(ilPropertyFormGUI $a_form=null)
+ Here is the call graph for this function:

◆ confirmLPSync()

ilObjCourseGUI::confirmLPSync ( )
protected

Definition at line 970 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by updateObject().

970  : void
971  {
972  $cgui = new ilConfirmationGUI();
973  $cgui->setFormAction($this->ctrl->getFormAction($this, "setLPSync"));
974  $cgui->setHeaderText($this->lng->txt("crs_status_determination_sync"));
975  $cgui->setCancel($this->lng->txt("cancel"), "edit");
976  $cgui->setConfirm($this->lng->txt("confirm"), "setLPSync");
977  $this->tpl->setContent($cgui->getHTML());
978  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createMailSignature()

ilObjCourseGUI::createMailSignature ( )

Create a course mail signature.

Returns
string

Definition at line 2835 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by infoScreen().

2835  : string
2836  {
2837  $link = chr(13) . chr(10) . chr(13) . chr(10);
2838  $link .= $this->lng->txt('crs_mail_permanent_link');
2839  $link .= chr(13) . chr(10) . chr(13) . chr(10);
2840  $link .= ilLink::_getLink($this->object->getRefId());
2841  return rawurlencode(base64_encode($link));
2842  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteInfoFilesObject()

ilObjCourseGUI::deleteInfoFilesObject ( )

Definition at line 537 of file class.ilObjCourseGUI.php.

References editInfoObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\refinery().

537  : void
538  {
539  $file_ids = [];
540  if ($this->http->wrapper()->post()->has('file_id')) {
541  $file_ids = $this->http->wrapper()->post()->retrieve(
542  'file_id',
543  $this->refinery->kindlyTo()->listOf(
544  $this->refinery->kindlyTo()->int()
545  )
546  );
547  }
548 
549  if (count($file_ids) === 0) {
550  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
551  $this->editInfoObject();
552  return;
553  }
554 
555  foreach ($file_ids as $file_id) {
556  $file = new ilCourseFile($file_id);
557  if ($this->object->getId() == $file->getCourseId()) {
558  $file->delete();
559  }
560  }
561  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
562  $this->editInfoObject();
563  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
editInfoObject(ilPropertyFormGUI $a_form=null)
+ Here is the call graph for this function:

◆ deleteObject()

ilObjCourseGUI::deleteObject ( bool  $error = false)

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

References ilContainerGUI\$error.

159  : void
160  {
161  $this->tabs_gui->activateTab('view_content');
162  parent::deleteObject($error);
163  }
ilErrorHandling $error

◆ deliverCertificateObject()

ilObjCourseGUI::deliverCertificateObject ( )
Todo:
get rid of cert logger

Definition at line 2908 of file class.ilObjCourseGUI.php.

References $objId, $user_id, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilCertificatePdfAction\downloadPdf(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

2908  : void
2909  {
2910  $user_id = null;
2911  if ($this->access->checkAccess('manage_members', '', $this->ref_id)) {
2912  $user_id = 0;
2913  if ($this->http->wrapper()->query()->has('member_id')) {
2914  $user_id = $this->http->wrapper()->query()->retrieve(
2915  'member_id',
2916  $this->refinery->kindlyTo()->int()
2917  );
2918  }
2919  }
2920  if (!$user_id) {
2921  $user_id = $this->user->getId();
2922  }
2923 
2924  $objId = $this->object->getId();
2925 
2926  $validator = new ilCertificateDownloadValidator();
2927 
2928  if (false === $validator->isCertificateDownloadable($user_id, $objId)) {
2929  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
2930  $this->ctrl->redirect($this);
2931  }
2932 
2933  $repository = new ilUserCertificateRepository();
2934 
2935  $pdfGenerator = new ilPdfGenerator($repository);
2936 
2937  $pdfAction = new ilCertificatePdfAction(
2938  $pdfGenerator,
2940  $this->lng->txt('error_creating_certificate_pdf')
2941  );
2942  $pdfAction->downloadPdf((int) $user_id, $objId);
2943  }
$objId
Definition: xapitoken.php:55
static http()
Fetches the global http state from ILIAS.
Validates if an active certificate is stored in the database and can be downloaded by the user...
downloadPdf(int $userId, int $objectId)
+ Here is the call graph for this function:

◆ editInfoObject()

ilObjCourseGUI::editInfoObject ( ilPropertyFormGUI  $a_form = null)

Definition at line 466 of file class.ilObjCourseGUI.php.

References ilCourseFile\_readFilesByCourse(), ilObjectGUI\checkPermission(), initInfoEditor(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and setSubTabs().

Referenced by confirmDeleteInfoFilesObject(), deleteInfoFilesObject(), and updateInfoObject().

466  : void
467  {
468  $this->checkPermission('write');
469  $this->setSubTabs('properties');
470  $this->tabs_gui->setTabActive('settings');
471  $this->tabs_gui->setSubTabActive('crs_info_settings');
472 
473  if (!$a_form) {
474  $a_form = $this->initInfoEditor();
475  }
476  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.edit_info.html', 'components/ILIAS/Course');
477  $this->tpl->setVariable('INFO_TABLE', $a_form->getHTML());
478 
479  if (!count($files = ilCourseFile::_readFilesByCourse($this->object->getId()))) {
480  return;
481  }
482  $rows = array();
483  foreach ($files as $file) {
484  $table_data['id'] = $file->getFileId();
485  $table_data['filename'] = $file->getFileName();
486  $table_data['filetype'] = $file->getFileType();
487  $table_data['filesize'] = $file->getFileSize();
488 
489  $rows[] = $table_data;
490  }
491  $table_gui = new ilCourseInfoFileTableGUI($this, 'editInfo');
492  $table_gui->setTitle($this->lng->txt("crs_info_download"));
493  $table_gui->setData($rows);
494  $table_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
495  $table_gui->addMultiCommand("confirmDeleteInfoFiles", $this->lng->txt("delete"));
496  $table_gui->setSelectAllCheckbox("file_id");
497  $this->tpl->setVariable('INFO_FILE_TABLE', $table_gui->getHTML());
498  }
static _readFilesByCourse(int $a_course_id)
setSubTabs(string $a_tab)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editMapSettingsObject()

ilObjCourseGUI::editMapSettingsObject ( )

Definition at line 2608 of file class.ilObjCourseGUI.php.

References ilContainerGUI\$form, ILIAS\Repository\access(), ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ilMapUtil\getDefaultSettings(), ilPropertyFormGUI\getHTML(), ilMapUtil\isActivated(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilFormGUI\setFormAction(), ilLocationInputGUI\setLatitude(), setSubTabs(), and ilPropertyFormGUI\setTitle().

2608  : void
2609  {
2610  $this->setSubTabs("properties");
2611  $this->tabs_gui->activateTab('settings');
2612  $this->tabs_gui->activateSubTab('crs_map_settings');
2613 
2614  if (!ilMapUtil::isActivated() ||
2615  !$this->access->checkAccess("write", "", $this->object->getRefId())) {
2616  return;
2617  }
2618 
2619  $latitude = $this->object->getLatitude();
2620  $longitude = $this->object->getLongitude();
2621  $zoom = $this->object->getLocationZoom();
2622 
2623  // Get Default settings, when nothing is set
2624  if ($latitude == 0 && $longitude == 0 && $zoom == 0) {
2626  $latitude = $def["latitude"];
2627  $longitude = $def["longitude"];
2628  $zoom = $def["zoom"];
2629  }
2630 
2631  $form = new ilPropertyFormGUI();
2632  $form->setFormAction($this->ctrl->getFormAction($this));
2633  $form->setTitle($this->lng->txt("crs_map_settings"));
2634 
2635  // enable map
2636  $public = new ilCheckboxInputGUI(
2637  $this->lng->txt("crs_enable_map"),
2638  "enable_map"
2639  );
2640  $public->setValue("1");
2641  $public->setChecked($this->object->getEnableCourseMap());
2642  $form->addItem($public);
2643 
2644  // map location
2645  $loc_prop = new ilLocationInputGUI(
2646  $this->lng->txt("crs_map_location"),
2647  "location"
2648  );
2649  $loc_prop->setLatitude((float) $latitude);
2650  $loc_prop->setLongitude((float) $longitude);
2651  $loc_prop->setZoom((int) $zoom);
2652  $form->addItem($loc_prop);
2653 
2654  $form->addCommandButton("saveMapSettings", $this->lng->txt("save"));
2655 
2656  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
2657  //$this->tpl->show();
2658  }
setFormAction(string $a_formaction)
static getDefaultSettings()
Get default longitude, latitude and zoom.
This class represents a location property in a property form.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
ilPropertyFormGUI $form
static isActivated()
Checks whether Map feature is activated.
setLatitude(?float $a_latitude)
setSubTabs(string $a_tab)
+ Here is the call graph for this function:

◆ editObject()

ilObjCourseGUI::editObject ( ilPropertyFormGUI  $form = null)

Definition at line 989 of file class.ilObjCourseGUI.php.

References ilContainerGUI\$form, $GLOBALS, ilPropertyFormGUI\getHTML(), and setSubTabs().

989  : void
990  {
991  $this->setSubTabs('properties');
992  $this->tabs_gui->setSubTabActive('general');
993 
994  if ($form instanceof ilPropertyFormGUI) {
995  $GLOBALS['DIC']['tpl']->setContent($form->getHTML());
996  } else {
997  parent::editObject();
998  }
999  }
$GLOBALS["DIC"]
Definition: wac.php:30
setSubTabs(string $a_tab)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjCourseGUI::executeCommand ( )

Definition at line 2036 of file class.ilObjCourseGUI.php.

References $DIC, ilContainerGUI\$form, $GLOBALS, ilContainerGUI\$gui, ilObjectGUI\$html, $user_id, __checkStartObjects(), ilCourseParticipants\_getInstanceByObjId(), ilObjCourse\_isActivated(), ilParticipants\_isParticipant(), ilObjCourse\_registrationEnabled(), ilLearningProgress\_tracProgress(), ILIAS\Repository\access(), ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilContainerGUI\forwardToPageObject(), ilObjectGUI\getCreationMode(), ilNewsTimelineGUI\getInstance(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getLocalRoles(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), infoScreen(), infoScreenObject(), initInfoEditor(), ILIAS\Repository\lng(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilCourseConstants\MAIL_ALLOWED_ALL, ILIAS\Repository\object(), ilObjectGUI\prepareOutput(), ILIAS\Repository\rbac(), ILIAS\Repository\refinery(), ilLTIProviderObjectSettingGUI\setCustomRolesForSelection(), ilMailMemberSearchGUI\setObjParticipants(), setSubTabs(), ilContainerGUI\setTitleAndDescription(), ilContainerGUI\showContainerPageTabs(), ilContainerGUI\showPermanentLink(), ILIAS\Repository\user(), and ilObjectGUI\viewObject().

2036  : void
2037  {
2038  $next_class = $this->ctrl->getNextClass($this);
2039  $cmd = $this->ctrl->getCmd();
2040 
2041  $this->prepareOutput();
2042 
2043  // add entry to navigation history
2044  if (!$this->getCreationMode() &&
2045  $this->access->checkAccess('read', '', $this->ref_id)) {
2046  $this->navigation_history->addItem(
2047  $this->ref_id,
2048  ilLink::_getLink($this->ref_id, "crs"),
2049  "crs"
2050  );
2051  }
2052  $header_action = true;
2053  switch ($next_class) {
2054  case strtolower(ilRepositoryTrashGUI::class):
2055  $ru = new \ilRepositoryTrashGUI($this);
2056  $this->ctrl->setReturn($this, 'trash');
2057  $this->ctrl->forwardCommand($ru);
2058  break;
2059 
2060  case 'illtiproviderobjectsettinggui':
2061 
2062  $this->setSubTabs('properties');
2063  $this->tabs_gui->activateTab('settings');
2064  $this->tabs_gui->activateSubTab('lti_provider');
2065  $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
2066  $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
2067  $lti_gui->offerLTIRolesForSelection(false);
2068  $this->ctrl->forwardCommand($lti_gui);
2069  break;
2070 
2071  case 'ilcoursemembershipgui':
2072 
2073  $this->tabs_gui->activateTab('members');
2074 
2075  $mem_gui = new ilCourseMembershipGUI($this, $this->object);
2076  $this->ctrl->forwardCommand($mem_gui);
2077  break;
2078 
2079  case "ilinfoscreengui":
2080  $this->infoScreen(); // forwards command
2081  break;
2082 
2083  case 'ilobjectmetadatagui':
2084  if (!$this->access->checkAccess('write', '', $this->object->getRefId())) {
2085  $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->WARNING);
2086  }
2087  $this->tabs_gui->setTabActive('meta_data');
2088  $md_gui = new ilObjectMetaDataGUI($this->object);
2089  $this->ctrl->forwardCommand($md_gui);
2090  break;
2091 
2092  case 'ilcourseregistrationgui':
2093  $this->ctrl->setReturn($this, '');
2094  $this->tabs_gui->setTabActive('join');
2095  $registration = new ilCourseRegistrationGUI($this->object, $this);
2096  $this->ctrl->forwardCommand($registration);
2097  break;
2098 
2099  case 'ilobjectcustomuserfieldsgui':
2100  $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
2101  $this->setSubTabs('properties');
2102  $this->tabs_gui->activateTab('settings');
2103  $this->tabs_gui->activateSubTab('crs_custom_user_fields');
2104  $this->ctrl->forwardCommand($cdf_gui);
2105  break;
2106 
2107  case "ilcourseobjectivesgui":
2108 
2109  $this->ctrl->setReturn($this, "");
2110  $reg_gui = new ilCourseObjectivesGUI($this->object->getRefId());
2111  $this->ctrl->forwardCommand($reg_gui);
2112  break;
2113 
2114  case 'ilobjcoursegroupinggui':
2115 
2116  $this->ctrl->setReturn($this, 'edit');
2117  $this->setSubTabs('properties');
2118  $this->tabs_gui->activateTab('settings');
2119  $this->tabs_gui->activateSubTab('groupings');
2120 
2121  $grouping_id = 0;
2122  if ($this->http->wrapper()->query()->has('obj_id')) {
2123  $grouping_id = $this->http->wrapper()->query()->retrieve(
2124  'obj_id',
2125  $this->refinery->kindlyTo()->int()
2126  );
2127  }
2128  $crs_grp_gui = new ilObjCourseGroupingGUI($this->object, $grouping_id);
2129  $this->ctrl->forwardCommand($crs_grp_gui);
2130  break;
2131 
2132  case "ilpropertyformgui":
2133  // only case is currently adv metadata internal link in info settings, see #24497
2134  $form = $this->initInfoEditor();
2135  $this->ctrl->forwardCommand($form);
2136  break;
2137 
2138  case "ilcolumngui":
2139  $this->ctrl->setReturn($this, "");
2140  $this->tabs_gui->setTabActive('none');
2141  $this->checkPermission("read");
2142  //$this->prepareOutput();
2143  //$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
2144  // ilObjStyleSheet::getContentStylePath(0));
2145  //$this->renderObject();
2146  $this->viewObject();
2147  break;
2148 
2149  case "ilconditionhandlergui":
2150  // preconditions for whole course
2151  $this->setSubTabs("properties");
2152  $this->tabs_gui->activateTab('settings');
2153  $this->tabs_gui->activateSubTab('preconditions');
2154  $new_gui = new ilConditionHandlerGUI($this->object->getRefId());
2155  $this->ctrl->forwardCommand($new_gui);
2156  break;
2157 
2158  case "illearningprogressgui":
2159 
2160  $user_id = $this->user->getId();
2161  if ($this->http->wrapper()->query()->has('user_id')) {
2162  $user_id = $this->http->wrapper()->query()->retrieve(
2163  'user_id',
2164  $this->refinery->kindlyTo()->int()
2165  );
2166  }
2167  $new_gui = new ilLearningProgressGUI(
2169  $this->object->getRefId(),
2170  $user_id
2171  );
2172  $this->ctrl->forwardCommand($new_gui);
2173  $this->tabs_gui->setTabActive('learning_progress');
2174  break;
2175 
2176  case 'ilpermissiongui':
2177  $this->tabs_gui->setTabActive('perm_settings');
2178  $perm_gui = new ilPermissionGUI($this);
2179  $this->ctrl->forwardCommand($perm_gui);
2180  break;
2181 
2182  case 'ilcalendarpresentationgui':
2183  $cal = new ilCalendarPresentationGUI($this->object->getRefId());
2184  $ret = $this->ctrl->forwardCommand($cal);
2185  $header_action = false;
2186  break;
2187 
2188  case 'ilcoursecontentgui':
2189  $this->ctrl->setReturn($this, 'members');
2190  $course_content_obj = new ilCourseContentGUI($this);
2191  $this->ctrl->forwardCommand($course_content_obj);
2192  break;
2193 
2194  case 'ilpublicuserprofilegui':
2195  $this->tpl->enableDragDropFileUpload(null);
2196  $this->setSubTabs('members');
2197  $this->tabs_gui->setTabActive('members');
2198 
2199  $user_id = $this->user->getId();
2200  if ($this->http->wrapper()->query()->has('user_id')) {
2201  $user_id = $this->http->wrapper()->query()->retrieve(
2202  'user_id',
2203  $this->refinery->kindlyTo()->int()
2204  );
2205  }
2206  $profile_gui = new ilPublicUserProfileGUI($user_id);
2207  $profile_gui->setBackUrl($this->ctrl->getLinkTargetByClass(["ilCourseMembershipGUI",
2208  "ilUsersGalleryGUI"
2209  ], 'view'));
2210  $this->tabs_gui->setSubTabActive('crs_members_gallery');
2211  $html = $this->ctrl->forwardCommand($profile_gui);
2212  $this->tpl->setVariable("ADM_CONTENT", $html);
2213  break;
2214 
2215  case 'ilmemberagreementgui':
2216  $this->tabs_gui->clearTargets();
2217 
2218  $this->ctrl->setReturn($this, '');
2219  $agreement = new ilMemberAgreementGUI($this->object->getRefId());
2220  $this->ctrl->forwardCommand($agreement);
2221  break;
2222 
2223  // container page editing
2224  case "ilcontainerpagegui":
2225  $ret = $this->forwardToPageObject();
2226  if ($ret != "") {
2227  $this->tpl->setContent($ret);
2228  }
2229  $header_action = false;
2230  break;
2231 
2232  case "ilcontainerstartobjectspagegui":
2233  // file downloads, etc. (currently not active)
2234  $pgui = new ilContainerStartObjectsPageGUI($this->object->getId());
2235  $ret = $this->ctrl->forwardCommand($pgui);
2236  if ($ret) {
2237  $this->tpl->setContent($ret);
2238  }
2239  break;
2240 
2241  case 'ilobjectcopygui':
2242  $cp = new ilObjectCopyGUI($this);
2243  $cp->setType('crs');
2244  $this->ctrl->forwardCommand($cp);
2245  break;
2246 
2247  case "ilobjectcontentstylesettingsgui":
2248 
2249  global $DIC;
2250 
2251  $this->checkPermission("write");
2252  $this->setTitleAndDescription();
2253  $this->showContainerPageTabs();
2254  $settings_gui = $DIC->contentStyle()->gui()
2255  ->objectSettingsGUIForRefId(
2256  null,
2257  $this->object->getRefId()
2258  );
2259  $this->ctrl->forwardCommand($settings_gui);
2260  break;
2261 
2262  case 'ilexportgui':
2263  $this->tabs_gui->setTabActive('export');
2264  $exp = new ilExportGUI($this);
2265  $exp->addFormat('xml');
2266  $this->ctrl->forwardCommand($exp);
2267  break;
2268 
2269  case "ilcommonactiondispatchergui":
2271  $this->ctrl->forwardCommand($gui);
2272  break;
2273 
2274  case 'ildidactictemplategui':
2275  $this->ctrl->setReturn($this, 'edit');
2276  $did = new ilDidacticTemplateGUI($this);
2277  $this->ctrl->forwardCommand($did);
2278  break;
2279 
2280  case "ilcertificategui":
2281  $this->tabs_gui->activateTab("settings");
2282  $this->setSubTabs("properties");
2283  $this->tabs_gui->activateSubTab('certificate');
2284 
2285  $guiFactory = new ilCertificateGUIFactory();
2286  $output_gui = $guiFactory->create($this->object);
2287  $this->ctrl->forwardCommand($output_gui);
2288  break;
2289 
2290  case 'illoeditorgui':
2291  #$this->tabs_gui->clearTargets();
2292  #$this->tabs_gui->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,''));
2293  $this->tabs_gui->activateTab('crs_objectives');
2294 
2295  $editor = new ilLOEditorGUI($this);
2296  $this->ctrl->forwardCommand($editor);
2297  if (strtolower($this->ctrl->getCmdClass()) === "illopagegui") {
2298  $header_action = false;
2299  }
2300  break;
2301 
2302  case 'ilcontainerstartobjectsgui':
2303  $this->ctrl->setReturn($this, 'edit');
2304  $this->tabs_gui->clearTargets();
2305  $this->tabs_gui->setBackTarget(
2306  $this->lng->txt("back_to_crs_content"),
2307  $this->ctrl->getLinkTarget($this, "edit")
2308  );
2309  $this->tabs_gui->addTab(
2310  "start",
2311  $this->lng->txt("crs_start_objects"),
2312  $this->ctrl->getLinkTargetByClass("ilcontainerstartobjectsgui", "listStructure")
2313  );
2314  $this->tabs_gui->activateTab("start");
2315  if (strtolower($this->ctrl->getCmdClass()) ==
2316  "ilcontainerstartobjectspagegui") {
2317  $header_action = false;
2318  }
2319  global $DIC;
2320 
2321  $ilHelp = $DIC['ilHelp'];
2322  $this->help->setScreenIdComponent("crs");
2323  $stgui = new ilContainerStartObjectsGUI($this->object);
2324  $this->ctrl->forwardCommand($stgui);
2325  break;
2326 
2327  case 'illomembertestresultgui':
2328  $GLOBALS['DIC']['ilCtrl']->setReturn($this, 'members');
2329  $GLOBALS['DIC']['ilTabs']->clearTargets();
2330  $GLOBALS['DIC']['ilTabs']->setBackTarget(
2331  $GLOBALS['DIC']['lng']->txt('back'),
2332  $GLOBALS['DIC']['ilCtrl']->getLinkTarget($this, 'members')
2333  );
2334 
2335  $uid = 0;
2336  if ($this->http->wrapper()->query()->has('uid')) {
2337  $uid = $this->http->wrapper()->query()->retrieve(
2338  'uid',
2339  $this->refinery->kindlyTo()->int()
2340  );
2341  }
2342  $result_view = new ilLOMemberTestResultGUI($this, $this->object, $uid);
2343  $this->ctrl->forwardCommand($result_view);
2344  break;
2345 
2346  case 'ilmailmembersearchgui':
2347  $mail = new ilMail($this->user->getId());
2348 
2349  if (
2350  !($this->object->getMailToMembersType() == ilCourseConstants::MAIL_ALLOWED_ALL ||
2351  $this->access->checkAccess('manage_members', "", $this->object->getRefId())) &&
2352  $this->rbac_system->checkAccess('internal_mail', $mail->getMailObjectReferenceId())) {
2353  $this->error->raiseError($this->lng->txt("msg_no_perm_read"), $this->error->MESSAGE);
2354  }
2355 
2356  $this->tabs_gui->setTabActive('members');
2357 
2358  $mail_search = new ilMailMemberSearchGUI(
2359  $this,
2360  $this->object->getRefId(),
2362  );
2363  $mail_search->setObjParticipants(
2365  );
2366  $this->ctrl->forwardCommand($mail_search);
2367  break;
2368 
2369  case 'ilbadgemanagementgui':
2370  $this->tabs_gui->setTabActive('obj_tool_setting_badges');
2371  $bgui = new ilBadgeManagementGUI($this->object->getRefId(), $this->object->getId(), 'crs');
2372  $this->ctrl->forwardCommand($bgui);
2373  break;
2374 
2375  case "ilcontainernewssettingsgui":
2376  $this->setSubTabs("properties");
2377  $this->tabs_gui->activateTab('settings');
2378  $this->tabs_gui->activateSubTab('obj_news_settings');
2379  $news_set_gui = new ilContainerNewsSettingsGUI($this);
2380  $news_set_gui->setTimeline(true);
2381  $news_set_gui->setCronNotifications(true);
2382  $news_set_gui->setHideByDate(true);
2383  $this->ctrl->forwardCommand($news_set_gui);
2384  break;
2385 
2386  case "ilnewstimelinegui":
2387  if (!$this->__checkStartObjects()) { // see #37236
2388  $this->ctrl->redirectByClass(self::class, "view");
2389  }
2390  $this->tabs_gui->setTabActive('news_timeline');
2392  $this->object->getRefId(),
2393  $this->object->getNewsTimelineAutoEntries()
2394  );
2395  $t->setUserEditAll($this->access->checkAccess('write', '', $this->object->getRefId(), 'grp'));
2396  $this->showPermanentLink();
2397  $this->ctrl->forwardCommand($t);
2399  $this->user->getId(),
2400  $this->object->getId(),
2401  $this->object->getRefId(),
2402  'crs'
2403  );
2404  break;
2405 
2406  case 'ilmemberexportsettingsgui':
2407  $this->setSubTabs('properties');
2408  $this->tabs_gui->activateTab('properties');
2409  $this->tabs_gui->activateSubTab('export_members');
2410  $settings_gui = new ilMemberExportSettingsGUI($this->object->getType(), $this->object->getId());
2411  $this->ctrl->forwardCommand($settings_gui);
2412  break;
2413 
2414  case "ilcontainerskillgui":
2415  $this->tabs_gui->activateTab('obj_tool_setting_skills');
2416  $gui = new ilContainerSkillGUI($this);
2417  $this->ctrl->forwardCommand($gui);
2418  break;
2419 
2420  case 'ilobjecttranslationgui':
2421  $this->checkPermissionBool("write");
2422  $this->setSubTabs("properties");
2423  $this->tabs_gui->activateTab("settings");
2424  $this->tabs_gui->activateSubTab("obj_multilinguality");
2425  $transgui = new ilObjectTranslationGUI($this);
2426  $this->ctrl->forwardCommand($transgui);
2427  break;
2428 
2429  case "ilbookinggatewaygui":
2430  $this->tabs_gui->activateTab('obj_tool_setting_booking');
2431  $gui = new ilBookingGatewayGUI($this);
2432  $this->ctrl->forwardCommand($gui);
2433  break;
2434 
2435  default:
2436  // #9401 - see also ilStartupGUI::_checkGoto()
2437  if ($cmd == 'infoScreenGoto') {
2438  if (ilObjCourse::_isActivated($this->object->getId()) &&
2439  ilObjCourse::_registrationEnabled($this->object->getId())) {
2440  $cmd = 'join';
2441  } else {
2442  $cmd = 'infoScreen';
2443  }
2444  }
2445 
2446  if (!$this->creation_mode) {
2447  if ($cmd == "infoScreen") {
2448  $this->checkPermission("visible");
2449  } else {
2450  // $this->checkPermission("read");
2451  }
2452  }
2453 
2454  if (!$this->creation_mode
2455  && $cmd != 'infoScreen'
2456  && $cmd != 'sendfile'
2457  && $cmd != 'unsubscribe'
2458  && $cmd != 'deliverCertificate'
2459  && $cmd != 'performUnsubscribe'
2460  && $cmd != 'removeFromDesk'
2461  && $cmd !== 'leave'
2462  && !$this->access->checkAccess("read", '', $this->object->getRefId())
2463  || $cmd == 'join'
2464  || $cmd == 'subscribe'
2465  || $cmd === 'leaveWaitList') {
2466  if ($this->rbac_system->checkAccess('join', $this->object->getRefId()) &&
2467  !ilCourseParticipants::_isParticipant($this->object->getRefId(), $this->user->getId())) {
2468  $this->ctrl->redirectByClass("ilCourseRegistrationGUI");
2469  } else {
2470  $this->infoScreenObject();
2471  break;
2472  }
2473  }
2474 
2475  if ($cmd == 'listObjectives') {
2476  $this->ctrl->setReturn($this, "");
2477  $obj_gui = new ilCourseObjectivesGUI($this->object->getRefId());
2478  $this->ctrl->forwardCommand($obj_gui);
2479  break;
2480  }
2481  // if news timeline is landing page, redirect if necessary
2482  if ($cmd == "" && $this->object->isNewsTimelineLandingPageEffective()) {
2483  $this->ctrl->redirectByClass("ilnewstimelinegui");
2484  }
2485 
2486  if (!$cmd) {
2487  $cmd = 'view';
2488  }
2489  $cmd .= 'Object';
2490  $this->$cmd();
2491  break;
2492  }
2493 
2494  if ($header_action) {
2495  $this->addHeaderAction();
2496  }
2497  }
static getInstance(int $a_ref_id, bool $a_include_auto_entries)
Class ilObjectMetaDataGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilBadgeManagementGUI: ilPropertyFormGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
GUI class for the workflow of copying objects.
prepareOutput(bool $show_sub_objects=true)
static _isActivated(int $a_obj_id)
Is activated.
Class ilLOEditorGUI.
This class is used for integration of the booking manager as a service into other repository objects...
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions" ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
GUI class for public user profile presentation.
Class ilMailMemberCourseRoles.
static http()
Fetches the global http state from ILIAS.
class ilobjcourseobjectivesgui
static _getInstanceByObjId(int $a_obj_id)
$GLOBALS["DIC"]
Definition: wac.php:30
GUI class for LTI provider object settings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:25
Repository GUI Utilities.
setCustomRolesForSelection(array $a_roles)
Set custom roles for mapping to LTI roles.
Class ilObjCourseGroupingGUI.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
ilPropertyFormGUI $form
setObjParticipants(ilParticipants $objParticipants)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _registrationEnabled(int $a_obj_id)
Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
Class ilCourseContentGUI.
ILIAS Container InternalGUIService $gui
setSubTabs(string $a_tab)
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
addHeaderAction()
Add header action menu.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilContainerStartObjectsGUI.
GUI class for object translation handling.
getLocalRoles(array $a_exclude=array())
+ Here is the call graph for this function:

◆ gatewayObject()

ilObjCourseGUI::gatewayObject ( )
Todo:
check deletable

Definition at line 85 of file class.ilObjCourseGUI.php.

References ilObjectGUI\viewObject().

85  : void
86  {
87  $this->viewObject();
88  }
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions" ...
+ Here is the call graph for this function:

◆ getAgreementTabs()

ilObjCourseGUI::getAgreementTabs ( )
protected

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

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and ILIAS\Repository\tabs().

1807  : void
1808  {
1809  if ($this->access->checkAccess('visible', '', $this->ref_id)) {
1810  $this->tabs->addTarget(
1811  "info_short",
1812  $this->ctrl->getLinkTargetByClass(
1813  array("ilobjcoursegui", "ilinfoscreengui"),
1814  "showSummary"
1815  ),
1816  "infoScreen"
1817  );
1818  }
1819  if (
1820  $this->access->checkAccess('leave', '', $this->object->getRefId()) &&
1821  $this->object->getMemberObject()->isMember()
1822  ) {
1823  $this->tabs->addTarget(
1824  "crs_unsubscribe",
1825  $this->ctrl->getLinkTarget($this, "unsubscribe"),
1826  'leave',
1827  ""
1828  );
1829  }
1830  }
+ Here is the call graph for this function:

◆ getEditFormValues()

ilObjCourseGUI::getEditFormValues ( )
protected

values are already set in initEditForm Returning an empty array avoid overriding these values.

Definition at line 1005 of file class.ilObjCourseGUI.php.

1005  : array
1006  {
1007  return [];
1008  }

◆ getLocalRoles()

ilObjCourseGUI::getLocalRoles ( array  $a_exclude = array())
Returns
array localroles
Parameters
int[]$a_exclude a list of role ids which will not added to the results (optional) returns all local roles [role_id] => title

Definition at line 3076 of file class.ilObjCourseGUI.php.

References ilObjRole\_getTranslation(), and hasAdminPermission().

Referenced by executeCommand().

3076  : array
3077  {
3078  $crs_admin = $this->object->getDefaultAdminRole();
3079  $crs_member = $this->object->getDefaultMemberRole();
3080  $local_roles = $this->object->getLocalCourseRoles(false);
3081  $crs_roles = [];
3082 
3083  //put the course member role to the top of the crs_roles array
3084  if (in_array($crs_member, $local_roles)) {
3085  #$crs_roles[$crs_member] = ilObjRole::_getTranslation(array_search ($crs_member, $local_roles));
3086  #unset($local_roles[$crs_roles[$crs_member]]);
3087  }
3088 
3089  foreach ($local_roles as $title => $role_id) {
3090  if ($role_id == $crs_admin && !$this->hasAdminPermission()) {
3091  continue;
3092  }
3093 
3094  $crs_roles[$role_id] = ilObjRole::_getTranslation($title);
3095  }
3096 
3097  if ($a_exclude !== []) {
3098  foreach ($a_exclude as $excluded_role) {
3099  if (isset($crs_roles[$excluded_role])) {
3100  unset($crs_roles[$excluded_role]);
3101  }
3102  }
3103  }
3104  return $crs_roles;
3105  }
static _getTranslation(string $a_role_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubServices()

ilObjCourseGUI::getSubServices ( )
protected

Definition at line 950 of file class.ilObjCourseGUI.php.

References ilObjectServiceSettingsGUI\AUTO_RATING_NEW_OBJECTS, ilObjectServiceSettingsGUI\BADGES, ilObjectServiceSettingsGUI\BOOKING, ilObjectServiceSettingsGUI\CALENDAR_CONFIGURATION, ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilObjectServiceSettingsGUI\EXTERNAL_MAIL_PREFIX, ilObjectServiceSettingsGUI\ORGU_POSITION_ACCESS, ilObjectServiceSettingsGUI\SKILLS, ilObjectServiceSettingsGUI\TAG_CLOUD, and ilObjectServiceSettingsGUI\USE_NEWS.

Referenced by initEditForm(), and updateObject().

950  : array
951  {
952  $subs = array(
962  );
963  if ($this->news->isGloballyActivated()) {
965  }
966 
967  return $subs;
968  }
+ Here is the caller graph for this function:

◆ getTabs()

ilObjCourseGUI::getTabs ( )
protected

Definition at line 1841 of file class.ilObjCourseGUI.php.

References ilCourseObjective\_getCountObjectives(), ilWaitingList\_isOnList(), ilParticipants\_isParticipant(), ilContainer\_lookupContainerSetting(), ILIAS\Repository\access(), addContentTab(), ilObjectServiceSettingsGUI\BOOKING, ilLearningProgressAccess\checkAccess(), ILIAS\Repository\ctrl(), ilBadgeHandler\getInstance(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ilCourseConstants\IL_CRS_VIEW_OBJECTIVE, ilCourseConstants\IL_CRS_VIEW_TIMING, ilContSkillPresentationGUI\isAccessible(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

1841  : void
1842  {
1843  $this->help->setScreenIdComponent("crs");
1844  $this->ctrl->setParameter($this, "ref_id", $this->ref_id);
1845 
1846  if ($this->access->checkAccess('read', '', $this->ref_id)) {
1847  // default activation
1848  $this->tabs_gui->activateTab('view_content');
1849  if ($this->object->isNewsTimelineEffective()) {
1850  if (!$this->object->isNewsTimelineLandingPageEffective()) {
1851  $this->addContentTab();
1852  }
1853  $this->tabs_gui->addTab(
1854  "news_timeline",
1855  $this->lng->txt("cont_news_timeline_tab"),
1856  $this->ctrl->getLinkTargetByClass("ilnewstimelinegui", "show")
1857  );
1858  if ($this->object->isNewsTimelineLandingPageEffective()) {
1859  $this->addContentTab();
1860  }
1861  } else {
1862  $this->addContentTab();
1863  }
1864  }
1865 
1866  if ($this->object->getViewMode() == ilCourseConstants::IL_CRS_VIEW_TIMING && $this->access->checkAccess('write', '', $this->ref_id)
1867  ) {
1868  $this->tabs->addTab(
1869  'timings_timings',
1870  $this->lng->txt('timings_timings'),
1871  $this->ctrl->getLinkTargetByClass('ilcoursecontentgui', 'manageTimings')
1872  );
1873  } elseif (
1874  $this->object->getViewMode() == ilCourseConstants::IL_CRS_VIEW_TIMING && $this->object->getMemberObject()->isParticipant() && $this->access->checkAccess('read', '', $this->ref_id)) {
1875  $this->tabs->addTab(
1876  'timings_timings',
1877  $this->lng->txt('timings_timings'),
1878  $this->ctrl->getLinkTargetByClass('ilcoursecontentgui', 'managePersonalTimings')
1879  );
1880  }
1881 
1882  // learning objectives
1883  if ($this->access->checkAccess('write', '', $this->ref_id)) {
1884  if ($this->object->getViewMode() == ilCourseConstants::IL_CRS_VIEW_OBJECTIVE or ilCourseObjective::_getCountObjectives($this->object->getId())) {
1885  $this->tabs_gui->addTarget(
1886  'crs_objectives',
1887  $this->ctrl->getLinkTargetByClass('illoeditorgui', ''),
1888  'illoeditorgui'
1889  );
1890  }
1891  }
1892 
1893  if (
1894  $this->access->checkAccess('visible', '', $this->ref_id) ||
1895  $this->access->checkAccess('join', '', $this->ref_id) ||
1896  $this->access->checkAccess('read', '', $this->ref_id)
1897  ) {
1898  $force_active =
1899  strcasecmp($this->ctrl->getCmdClass(), ilInfoScreenGUI::class) === 0 ||
1900  strcasecmp($this->ctrl->getCmdClass(), ilNoteGUI::class) === 0;
1901  $this->tabs_gui->addTarget(
1902  "info_short",
1903  $this->ctrl->getLinkTargetByClass(
1904  array("ilobjcoursegui", "ilinfoscreengui"),
1905  "showSummary"
1906  ),
1907  "infoScreen",
1908  "",
1909  "",
1910  $force_active
1911  );
1912  }
1913  if ($this->access->checkAccess('write', '', $this->ref_id)) {
1914  $force_active =
1915  strcasecmp($this->ctrl->getCmdClass(), ilConditionHandlerGUI::class) &&
1916  !$this->http->wrapper()->query()->has('item_id');
1917  $this->tabs_gui->addTarget(
1918  "settings",
1919  $this->ctrl->getLinkTarget($this, "edit"),
1920  array("edit", "editMapSettings", "editCourseIcons", "listStructure"),
1921  "",
1922  "",
1923  $force_active
1924  );
1925  }
1926 
1927  $is_participant = ilCourseParticipants::_isParticipant($this->ref_id, $this->user->getId());
1928  $mail = new ilMail($this->user->getId());
1929 
1930  $membership_gui = new ilCourseMembershipGUI($this, $this->object);
1931  $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1932 
1933  // badges
1934  if ($this->access->checkAccess('write', '', $this->ref_id)) {
1935  if (ilBadgeHandler::getInstance()->isObjectActive($this->object->getId())) {
1936  $this->tabs_gui->addTarget(
1937  "obj_tool_setting_badges",
1938  $this->ctrl->getLinkTargetByClass("ilbadgemanagementgui", ""),
1939  "",
1940  "ilbadgemanagementgui"
1941  );
1942  }
1943  }
1944 
1945  // skills
1946  if (ilContSkillPresentationGUI::isAccessible($this->ref_id)) {
1947  $this->tabs_gui->addTarget(
1948  "obj_tool_setting_skills",
1949  $this->ctrl->getLinkTargetByClass(array("ilcontainerskillgui", "ilcontskillpresentationgui"), ""),
1950  "",
1951  array("ilcontainerskillgui", "ilcontskillpresentationgui", "ilcontskilladmingui")
1952  );
1953  }
1954 
1955  // booking
1956  if ($this->access->checkAccess('write', '', $this->ref_id) && ilContainer::_lookupContainerSetting(
1957  $this->object->getId(),
1959  '0'
1960  )) {
1961  $this->tabs_gui->addTarget(
1962  "obj_tool_setting_booking",
1963  $this->ctrl->getLinkTargetByClass(array("ilbookinggatewaygui"), "")
1964  );
1965  }
1966 
1967  // learning progress
1968  if (ilLearningProgressAccess::checkAccess($this->object->getRefId(), $is_participant)) {
1969  $this->tabs_gui->addTarget(
1970  'learning_progress',
1971  $this->ctrl->getLinkTargetByClass(array('ilobjcoursegui', 'illearningprogressgui'), ''),
1972  '',
1973  array('illplistofobjectsgui', 'illplistofsettingsgui', 'illearningprogressgui', 'illplistofprogressgui')
1974  );
1975  }
1976 
1977  // meta data
1978  if ($this->access->checkAccess('write', '', $this->ref_id)) {
1979  $mdgui = new ilObjectMetaDataGUI($this->object);
1980  $mdtab = $mdgui->getTab();
1981  if ($mdtab) {
1982  $this->tabs_gui->addTarget(
1983  "meta_data",
1984  $mdtab,
1985  "",
1986  "ilobjectmetadatagui"
1987  );
1988  }
1989  }
1990 
1991  if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
1992  $this->tabs_gui->addTarget(
1993  'export',
1994  $this->ctrl->getLinkTargetByClass('ilexportgui', ''),
1995  'export',
1996  'ilexportgui'
1997  );
1998  }
1999 
2000  if ($this->access->checkAccess('edit_permission', '', $this->ref_id)) {
2001  $this->tabs_gui->addTarget(
2002  "perm_settings",
2003  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), "perm"),
2004  array("perm", "info", "owner"),
2005  'ilpermissiongui'
2006  );
2007  }
2008 
2009  // Join/Leave
2010  if ($this->access->checkAccess('join', '', $this->ref_id) && !$this->object->getMemberObject()->isAssigned()) {
2011  if (ilCourseWaitingList::_isOnList($this->user->getId(), $this->object->getId())) {
2012  $this->tabs_gui->addTab(
2013  'leave',
2014  $this->lng->txt('membership_leave'),
2015  $this->ctrl->getLinkTargetByClass('ilcourseregistrationgui', 'show', '')
2016  );
2017  } else {
2018  $this->tabs_gui->addTarget(
2019  "join",
2020  $this->ctrl->getLinkTargetByClass('ilcourseregistrationgui', "show"),
2021  'show',
2022  ""
2023  );
2024  }
2025  }
2026  if ($this->access->checkAccess('leave', '', $this->object->getRefId()) && $this->object->getMemberObject()->isMember()) {
2027  $this->tabs_gui->addTarget(
2028  "crs_unsubscribe",
2029  $this->ctrl->getLinkTarget($this, "unsubscribe"),
2030  'leave',
2031  ""
2032  );
2033  }
2034  }
Class ilObjectMetaDataGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
static http()
Fetches the global http state from ILIAS.
static _getCountObjectives(int $a_obj_id, bool $a_activated_only=false)
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
static _isOnList(int $a_usr_id, int $a_obj_id)
+ Here is the call graph for this function:

◆ hasAdminPermission()

ilObjCourseGUI::hasAdminPermission ( )
protected

Definition at line 3107 of file class.ilObjCourseGUI.php.

References ilCourseParticipant\_getInstanceByObjId(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\object(), and ILIAS\Repository\user().

Referenced by getLocalRoles().

3107  : bool
3108  {
3109  return
3110  ilCourseParticipant::_getInstanceByObjId($this->object->getId(), $this->user->getId())->isAdmin() ||
3111  $this->checkPermissionBool('edit_permission');
3112  }
static _getInstanceByObjId(int $a_obj_id, int $a_usr_id)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreen()

ilObjCourseGUI::infoScreen ( )

Definition at line 184 of file class.ilObjCourseGUI.php.

References $c, $parts, ilObjectGUI\$tpl, $txt, ilCourseDefinedFieldDefinition\_fieldsToInfoString(), ilCourseDefinedFieldDefinition\_getFields(), ilExportFieldsInfo\_getInstanceByType(), ilCourseFile\_readFilesByCourse(), ILIAS\Repository\access(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ilMailFormCall\CONTEXT_KEY, createMailSignature(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), ilGlobalTemplateInterface\get(), ilPrivacySettings\getInstance(), ilParticipants\getInstanceByObjId(), ilMailFormCall\getLinkTarget(), ilMailGlobalServices\getMailObjectRefId(), ilCourseMailTemplateMemberContext\ID, IL_CAL_UNIX, ilCourseConstants\IL_CRS_SUBSCRIPTION_CONFIRMATION, ilCourseConstants\IL_CRS_SUBSCRIPTION_DEACTIVATED, ilCourseConstants\IL_CRS_SUBSCRIPTION_DIRECT, ilCourseConstants\IL_CRS_SUBSCRIPTION_PASSWORD, ILIAS\Repository\lng(), ilObjCourseAccess\lookupRegistrationInfo(), ilUtil\makeClickable(), ilAdvancedMDRecordGUI\MODE_INFO, ILIAS\Repository\object(), ilAdvancedMDRecordGUI\parse(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilAdvancedMDRecordGUI\setInfoObject(), ilGlobalTemplateInterface\setVariable(), and ILIAS\Repository\user().

Referenced by executeCommand().

184  : void
185  {
186  if (!$this->checkPermissionBool('read')) {
187  $this->checkPermission('visible');
188  }
189 
190  $this->tabs_gui->setTabActive('info_short');
191  $files = ilCourseFile::_readFilesByCourse($this->object->getId());
192 
193  $info = new ilInfoScreenGUI($this);
194  $info->enablePrivateNotes();
195  $info->enableFeedback();
196  $info->enableNews();
197  $info->enableBookingInfo(true);
198  if ($this->access->checkAccess("write", "", $this->ref_id)) {
199  $info->enableNewsEditing();
200  }
201 
202  if (
203  strlen($this->object->getImportantInformation()) ||
204  strlen($this->object->getSyllabus()) ||
205  strlen((string) $this->object->getTargetGroup()) ||
206  count($files)) {
207  $info->addSection($this->lng->txt('crs_general_informations'));
208  }
209 
210  if (strlen($this->object->getImportantInformation())) {
211  $info->addProperty(
212  $this->lng->txt('crs_important_info'),
213  "<strong>" . nl2br(
214  ilUtil::makeClickable($this->object->getImportantInformation(), true) . "</strong>"
215  )
216  );
217  }
218  if (strlen($this->object->getSyllabus())) {
219  $info->addProperty($this->lng->txt('crs_syllabus'), nl2br(
220  ilUtil::makeClickable($this->object->getSyllabus(), true)
221  ));
222  }
223  if (strlen((string) $this->object->getTargetGroup())) {
224  $info->addProperty(
225  $this->lng->txt('crs_target_group'),
226  nl2br(
227  \ilUtil::makeClickable($this->object->getTargetGroup(), true)
228  )
229  );
230  }
231  // files
232  if ($files !== []) {
233  $tpl = new ilTemplate('tpl.event_info_file.html', true, true, 'components/ILIAS/Course');
234 
235  foreach ($files as $file) {
236  $tpl->setCurrentBlock("files");
237  $this->ctrl->setParameter($this, 'file_id', $file->getFileId());
238  $tpl->setVariable("DOWN_LINK", $this->ctrl->getLinkTarget($this, 'sendfile'));
239  $tpl->setVariable("DOWN_NAME", $file->getFileName());
240  $tpl->setVariable("DOWN_INFO_TXT", $this->lng->txt('crs_file_size_info'));
241  $tpl->setVariable("DOWN_SIZE", $file->getFileSize());
242  $tpl->setVariable("TXT_BYTES", $this->lng->txt('bytes'));
244  }
245  $info->addProperty(
246  $this->lng->txt('crs_file_download'),
247  $tpl->get()
248  );
249  }
250 
252  $record_gui->setInfoObject($info);
253  $record_gui->parse();
254 
255  // meta data
256  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
257 
258  // contact
259  if ($this->object->hasContactData()) {
260  $info->addSection($this->lng->txt("crs_contact"));
261  }
262  if (strlen($this->object->getContactName())) {
263  $info->addProperty(
264  $this->lng->txt("crs_contact_name"),
265  $this->object->getContactName()
266  );
267  }
268  if (strlen($this->object->getContactResponsibility())) {
269  $info->addProperty(
270  $this->lng->txt("crs_contact_responsibility"),
271  $this->object->getContactResponsibility()
272  );
273  }
274  if (strlen($this->object->getContactPhone())) {
275  $info->addProperty(
276  $this->lng->txt("crs_contact_phone"),
277  $this->object->getContactPhone()
278  );
279  }
280  if ($this->object->getContactEmail()) {
281  /* needs to be rbacsystem, does not work with ilAccess */
282  $has_mail_access = $this->rbacsystem->checkAccessOfUser(
283  $this->user->getId(),
284  'internal_mail',
286  );
287  $emails = explode(",", $this->object->getContactEmail());
288  $mailString = '';
289  foreach ($emails as $email) {
290  $email = trim($email);
291  if (!$has_mail_access) {
292  $mailString .= $email . "<br />";
293  continue;
294  }
295  $etpl = new ilTemplate("tpl.crs_contact_email.html", true, true, 'components/ILIAS/Course');
296  $etpl->setVariable(
297  "EMAIL_LINK",
299  $info,
300  'showSummary',
301  array(),
302  array(
303  'type' => 'new',
304  'rcp_to' => $email,
305  'sig' => $this->createMailSignature()
306  ),
307  array(
309  'ref_id' => $this->object->getRefId(),
310  'ts' => time()
311  )
312  )
313  );
314  $etpl->setVariable("CONTACT_EMAIL", $email);
315  $mailString .= $etpl->get() . "<br />";
316  }
317  $info->addProperty($this->lng->txt("crs_contact_email"), $mailString);
318  }
319  if (strlen($this->object->getContactConsultation())) {
320  $info->addProperty(
321  $this->lng->txt("crs_contact_consultation"),
322  nl2br($this->object->getContactConsultation())
323  );
324  }
325  // support contacts
327  $conts = $parts->getContacts();
328  if ($conts !== []) {
329  $info->addSection($this->lng->txt("crs_mem_contacts"));
330  foreach ($conts as $c) {
331  $pgui = new ilPublicUserProfileGUI($c);
332  $pgui->setBackUrl($this->ctrl->getLinkTargetByClass("ilinfoscreengui"));
333  $pgui->setEmbedded(true);
334  $info->addProperty("", $pgui->getHTML());
335  }
336  }
337 
338  // #10360
339  $info->enableAvailability(false);
340  $this->lng->loadLanguageModule("rep");
341  $info->addSection($this->lng->txt("rep_activation_availability"));
342  $info->showLDAPRoleGroupMappingInfo();
343 
344  // activation
345  $info->addAccessPeriodProperty();
346 
347  $txt = '';
348  switch ($this->object->getSubscriptionLimitationType()) {
350  $txt = $this->lng->txt("crs_info_reg_deactivated");
351  break;
352 
353  default:
354  switch ($this->object->getSubscriptionType()) {
356  $txt = $this->lng->txt("crs_info_reg_confirmation");
357  break;
359  $txt = $this->lng->txt("crs_info_reg_direct");
360  break;
362  $txt = $this->lng->txt("crs_info_reg_password");
363  break;
364  }
365  }
366 
367  // subscription
368  $info->addProperty($this->lng->txt("crs_info_reg"), $txt);
369  if ($this->object->getSubscriptionLimitationType() != ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED) {
370  if ($this->object->getSubscriptionUnlimitedStatus()) {
371  $info->addProperty(
372  $this->lng->txt("crs_reg_until"),
373  $this->lng->txt('crs_unlimited')
374  );
375  } elseif ($this->object->getSubscriptionStart() < time()) {
376  $info->addProperty(
377  $this->lng->txt("crs_reg_until"),
378  $this->lng->txt('crs_to') . ' ' .
379  ilDatePresentation::formatDate(new ilDateTime($this->object->getSubscriptionEnd(), IL_CAL_UNIX))
380  );
381  } elseif ($this->object->getSubscriptionStart() > time()) {
382  $info->addProperty(
383  $this->lng->txt("crs_reg_until"),
384  $this->lng->txt('crs_from') . ' ' .
385  ilDatePresentation::formatDate(new ilDateTime($this->object->getSubscriptionStart(), IL_CAL_UNIX))
386  );
387  }
388  if ($this->object->isSubscriptionMembershipLimited()) {
389  if ($this->object->getSubscriptionMinMembers()) {
390  $info->addProperty(
391  $this->lng->txt("mem_min_users"),
392  $this->object->getSubscriptionMinMembers()
393  );
394  }
395  if ($this->object->getSubscriptionMaxMembers()) {
396  $reg_info = ilObjCourseAccess::lookupRegistrationInfo($this->object->getId());
397  $info->addProperty(
398  $this->lng->txt('mem_free_places'),
399  (string) ($reg_info['reg_info_free_places'] ?? '0')
400  );
401  }
402  }
403  }
404 
405  if ($this->object->getCancellationEnd()) {
406  $info->addProperty(
407  $this->lng->txt('crs_cancellation_end'),
408  ilDatePresentation::formatDate($this->object->getCancellationEnd())
409  );
410  }
411 
412  if (
413  $this->object->getCourseStart() instanceof ilDateTime &&
414  !$this->object->getCourseStart()->isNull()
415  ) {
416  $info->addProperty(
417  $this->lng->txt('crs_period'),
419  $this->object->getCourseStart(),
420  $this->object->getCourseEnd()
421  )
422  );
423  }
424 
425  // Confirmation
426  $privacy = ilPrivacySettings::getInstance();
427 
428  if ($privacy->courseConfirmationRequired() || ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) || $privacy->enabledCourseExport()) {
429  $field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
430 
431  $this->lng->loadLanguageModule('ps');
432  $info->addSection($this->lng->txt('crs_user_agreement_info'));
433  $info->addProperty($this->lng->txt('ps_export_data'), $field_info->exportableFieldsToInfoString());
434 
435  if ($fields = ilCourseDefinedFieldDefinition::_fieldsToInfoString($this->object->getId())) {
436  $info->addProperty($this->lng->txt('ps_crs_user_fields'), $fields);
437  }
438  }
439  $info->enableLearningProgress(true);
440 
441  // forward the command
442  $this->ctrl->forwardCommand($info);
443  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
static lookupRegistrationInfo(int $a_obj_id)
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
static getLinkTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _readFilesByCourse(int $a_course_id)
ilAdvancedMDRecordGUI $record_gui
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
const IL_CAL_UNIX
$c
Definition: deliver.php:9
GUI class for public user profile presentation.
ilGlobalTemplateInterface $tpl
createMailSignature()
Create a course mail signature.
$txt
Definition: error.php:30
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
static _getInstanceByType(string $a_type)
Get Singleton Instance.
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ilObjUser $user=null)
Format a period of two dates Shows: 14.
setInfoObject(ilInfoScreenGUI $info)
get info sections
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
static makeClickable(string $a_text, bool $detectGotoLinks=false)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjCourseGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Todo:

Definition at line 176 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

176  : void
177  {
178  $this->ctrl->redirectByClass([
179  static::class,
180  ilInfoScreenGUI::class
181  ]);
182  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditForm()

ilObjCourseGUI::initEditForm ( )
protected

Definition at line 1010 of file class.ilObjCourseGUI.php.

References ilContainerGUI\$form, ilObjectGUI\$settings, ilObjUserTracking\_enabledLearningProgress(), ilContainer\_lookupContainerSetting(), ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ilMembershipRegistrationCodeUtils\generateCode(), ilObjectLP\getInstance(), ilPrivacySettings\getInstance(), ilObjectGUI\getObjectService(), getSubServices(), IL_CAL_UNIX, ilCourseConstants\IL_CRS_SUBSCRIPTION_CONFIRMATION, ilCourseConstants\IL_CRS_SUBSCRIPTION_DEACTIVATED, ilCourseConstants\IL_CRS_SUBSCRIPTION_DIRECT, ilCourseConstants\IL_CRS_SUBSCRIPTION_PASSWORD, ilCourseConstants\IL_CRS_SUBSCRIPTION_UNLIMITED, ilCourseConstants\IL_CRS_VIEW_BY_TYPE, ilCourseConstants\IL_CRS_VIEW_OBJECTIVE, ilCourseConstants\IL_CRS_VIEW_SESSIONS, ilCourseConstants\IL_CRS_VIEW_SIMPLE, ilCourseConstants\IL_CRS_VIEW_TIMING, ilCourseConstants\IL_CRS_VIEW_TIMING_ABSOLUTE, ilCourseConstants\IL_CRS_VIEW_TIMING_RELATIVE, ilObjectGUI\initDidacticTemplate(), ilContainerGUI\initListPresentationForm(), ilObjectServiceSettingsGUI\initServiceSettingsForm(), ilContainerGUI\initSortingForm(), ILIAS\Repository\lng(), ilCourseConstants\MAIL_ALLOWED_ALL, ilCourseConstants\MAIL_ALLOWED_TUTORS, ILIAS\Repository\object(), ilFormGUI\setFormAction(), ilFormPropertyGUI\setInfo(), ilPropertyFormGUI\setTitle(), ilRadioGroupInputGUI\setValue(), ilSelectInputGUI\setValue(), ilContainer\SORT_ACTIVATION, ilContainer\SORT_CREATION, ilContainer\SORT_MANUAL, ilContainer\SORT_TITLE, ilObjCourse\STATUS_DETERMINATION_LP, and ilObjCourse\STATUS_DETERMINATION_MANUAL.

Referenced by updateObject().

1011  {
1012  $obj_service = $this->getObjectService();
1013  $setting = $this->settings;
1014 
1015  $form = new ilPropertyFormGUI();
1016  $form->setTitle($this->lng->txt('crs_edit'));
1017 
1018  $form->addCommandButton('update', $this->lng->txt('save'));
1019  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
1020 
1021  $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
1022 
1023  // title and description
1024  $this->initFormTitleDescription($form);
1025 
1026  // Show didactic template type
1027  $this->initDidacticTemplate($form);
1028 
1029  // period
1030  $cdur = new ilDateDurationInputGUI($this->lng->txt('crs_period'), 'period');
1031  $this->lng->loadLanguageModule('mem');
1032  $cdur->enableToggleFullTime(
1033  $this->lng->txt('mem_period_without_time'),
1034  !$this->object->getCourseStartTimeIndication()
1035  );
1036  $cdur->setShowTime(true);
1037  $cdur->setInfo($this->lng->txt('crs_period_info'));
1038  $cdur->setStart($this->object->getCourseStart());
1039  $cdur->setEnd($this->object->getCourseEnd());
1040  $form->addItem($cdur);
1041 
1042  // activation/availability
1043 
1044  $this->lng->loadLanguageModule('rep');
1045 
1046  $section = new ilFormSectionHeaderGUI();
1047  $section->setTitle($this->lng->txt('rep_activation_availability'));
1048  $form->addItem($section);
1049 
1050  $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'activation_online');
1051  $online->setChecked(!$this->object->getOfflineStatus());
1052  $online->setInfo($this->lng->txt('crs_activation_online_info'));
1053  $form->addItem($online);
1054 
1055  $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
1056  $dur->setShowTime(true);
1057  $dur->setStart(new ilDateTime($this->object->getActivationStart(), IL_CAL_UNIX));
1058  $dur->setEnd(new ilDateTime($this->object->getActivationEnd(), IL_CAL_UNIX));
1059  $form->addItem($dur);
1060 
1061  $visible = new ilCheckboxInputGUI(
1062  $this->lng->txt('rep_activation_limited_visibility'),
1063  'activation_visibility'
1064  );
1065  $visible->setInfo($this->lng->txt('crs_activation_limited_visibility_info'));
1066  $visible->setChecked((bool) $this->object->getActivationVisibility());
1067  $dur->addSubItem($visible);
1068 
1069  $section = new ilFormSectionHeaderGUI();
1070  $section->setTitle($this->lng->txt('crs_reg'));
1071  $form->addItem($section);
1072 
1073  // time limit
1074  $sdur = new ilDateDurationInputGUI($this->lng->txt('crs_registration_limited'), "subscription_period");
1075  $sdur->setShowTime(true);
1076  if ($this->object->getSubscriptionStart()) {
1077  $sdur->setStart(new ilDateTime($this->object->getSubscriptionStart(), IL_CAL_UNIX));
1078  }
1079  if ($this->object->getSubscriptionEnd()) {
1080  $sdur->setEnd(new ilDateTime($this->object->getSubscriptionEnd(), IL_CAL_UNIX));
1081  }
1082 
1083  $reg_proc = new ilRadioGroupInputGUI('', 'subscription_type');
1084  $reg_proc->setValue(
1085  ($this->object->getSubscriptionLimitationType() != ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED)
1086  ? (string) $this->object->getSubscriptionType()
1088  );
1089 
1090  $opt = new ilRadioOption(
1091  $this->lng->txt('crs_subscription_options_direct'),
1093  );
1094  $reg_proc->addOption($opt);
1095 
1096  $opt = new ilRadioOption(
1097  $this->lng->txt('crs_subscription_options_password'),
1099  );
1100 
1101  $pass = new ilTextInputGUI($this->lng->txt("password"), 'subscription_password');
1102  $pass->setRequired(true);
1103  $pass->setInfo($this->lng->txt('crs_reg_password_info'));
1104  $pass->setSubmitFormOnEnter(true);
1105  $pass->setSize(32);
1106  $pass->setMaxLength(32);
1107  $pass->setValue($this->object->getSubscriptionPassword());
1108 
1109  $opt->addSubItem($pass);
1110  $reg_proc->addOption($opt);
1111 
1112  $opt = new ilRadioOption(
1113  $this->lng->txt('crs_subscription_options_confirmation'),
1115  );
1116  $opt->setInfo($this->lng->txt('crs_registration_confirmation_info'));
1117  $reg_proc->addOption($opt);
1118 
1119  $opt_self_enrollment_enabled = new ilRadioOption(
1120  $this->lng->txt('crs_reg_selfreg'),
1122  );
1123  $opt_self_enrollment_enabled->addSubItem($reg_proc);
1124  $opt_self_enrollment_enabled->addSubItem($sdur);
1125  $opt_self_enrollment_disabled = new ilRadioOption(
1126  $this->lng->txt('crs_reg_no_selfreg'),
1128  );
1129  $opt_self_enrollment_disabled->setInfo($this->lng->txt('crs_registration_deactivated'));
1130  $reg_proc_subscription_reg_type = new ilRadioGroupInputGUI(
1131  $this->lng->txt('crs_registration_type'),
1132  'subscription_limitation_type'
1133  );
1134  $reg_proc_subscription_reg_type->setValue(
1135  $this->object->getSubscriptionLimitationType() !== ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED
1138  );
1139  $reg_proc_subscription_reg_type->addOption($opt_self_enrollment_enabled);
1140  $reg_proc_subscription_reg_type->addOption($opt_self_enrollment_disabled);
1141  $form->addItem($reg_proc_subscription_reg_type);
1142 
1143  // Registration codes
1144  $reg_code = new ilCheckboxInputGUI($this->lng->txt('crs_reg_code'), 'reg_code_enabled');
1145  $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
1146  $reg_code->setValue('1');
1147  $reg_code->setInfo($this->lng->txt('crs_reg_code_enabled_info'));
1148 
1149  // Create default access code
1150  if (!$this->object->getRegistrationAccessCode()) {
1151  $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1152  }
1153  $reg_link = new ilHiddenInputGUI('reg_code');
1154  $reg_link->setValue($this->object->getRegistrationAccessCode());
1155  $form->addItem($reg_link);
1156 
1157  $link = new ilCustomInputGUI($this->lng->txt('crs_reg_code_link'));
1158  $val = ilLink::_getLink(
1159  $this->object->getRefId(),
1160  $this->object->getType(),
1161  array(),
1162  'rcode' . $this->object->getRegistrationAccessCode()
1163  );
1164  $link->setHtml('<span class="small">' . $val . '</span>');
1165  $reg_code->addSubItem($link);
1166 
1167  $form->addItem($reg_code);
1168 
1169  // cancellation limit
1170  $cancel = new ilDateTimeInputGUI($this->lng->txt('crs_cancellation_end'), 'cancel_end');
1171  $cancel->setInfo($this->lng->txt('crs_cancellation_end_info'));
1172  $cancel_end = $this->object->getCancellationEnd();
1173  if ($cancel_end) {
1174  $cancel->setDate($cancel_end);
1175  }
1176  $form->addItem($cancel);
1177 
1178  // Max members
1179  $lim = new ilCheckboxInputGUI(
1180  $this->lng->txt('crs_subscription_max_members_short'),
1181  'subscription_membership_limitation'
1182  );
1183  $lim->setInfo($this->lng->txt('crs_subscription_max_members_short_info'));
1184  $lim->setValue((string) 1);
1185  $lim->setChecked($this->object->isSubscriptionMembershipLimited());
1186 
1187  $min = new ilTextInputGUI('', 'subscription_min');
1188  $min->setSubmitFormOnEnter(true);
1189  $min->setSize(4);
1190  $min->setMaxLength(4);
1191  $min->setValue($this->object->getSubscriptionMinMembers() ?: '');
1192  $min->setTitle($this->lng->txt('crs_subscription_min_members'));
1193  $min->setInfo($this->lng->txt('crs_subscription_min_members_info'));
1194  $lim->addSubItem($min);
1195 
1196  $max = new ilTextInputGUI('', 'subscription_max');
1197  $max->setSubmitFormOnEnter(true);
1198  $max->setSize(4);
1199  $max->setMaxLength(4);
1200  $max->setValue($this->object->getSubscriptionMaxMembers() ?: '');
1201  $max->setTitle($this->lng->txt('crs_subscription_max_members'));
1202  $max->setInfo($this->lng->txt('crs_reg_max_info'));
1203 
1204  $lim->addSubItem($max);
1205 
1206  $wait = new ilRadioGroupInputGUI($this->lng->txt('crs_waiting_list'), 'waiting_list');
1207  $option = new ilRadioOption($this->lng->txt('none'), '0');
1208  $wait->addOption($option);
1209 
1210  $option = new ilRadioOption($this->lng->txt('crs_waiting_list_no_autofill'), '1');
1211  $option->setInfo($this->lng->txt('crs_wait_info'));
1212  $wait->addOption($option);
1213 
1214  $option = new ilRadioOption($this->lng->txt('crs_waiting_list_autofill'), '2');
1215  $option->setInfo($this->lng->txt('crs_waiting_list_autofill_info'));
1216  $wait->addOption($option);
1217 
1218  if ($this->object->hasWaitingListAutoFill()) {
1219  $wait->setValue('2');
1220  } elseif ($this->object->enabledWaitingList()) {
1221  $wait->setValue('1');
1222  } else {
1223  $wait->setValue('0');
1224  }
1225  $lim->addSubItem($wait);
1226  $form->addItem($lim);
1227  $pres = new ilFormSectionHeaderGUI();
1228  $pres->setTitle($this->lng->txt('crs_view_mode'));
1229 
1230  $form->addItem($pres);
1231 
1232  // title and icon visibility
1233  $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTitleIconVisibility();
1234 
1235  // top actions visibility
1236  $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTopActionsVisibility();
1237 
1238  // breadcrumbs
1239  if ($setting->get("rep_breadcr_crs") && $setting->get("rep_breadcr_crs_overwrite")) {
1240  $add = $setting->get("rep_breadcr_crs_default")
1241  ? " (" . $this->lng->txt("crs_breadcrumb_crs_only") . ")"
1242  : " (" . $this->lng->txt("crs_breadcrumb_full_path") . ")";
1243  $options = array(
1244  self::BREADCRUMB_DEFAULT => $this->lng->txt("crs_sys_default") . $add,
1245  self::BREADCRUMB_CRS_ONLY => $this->lng->txt("crs_breadcrumb_crs_only"),
1246  self::BREADCRUMB_FULL_PATH => $this->lng->txt("crs_breadcrumb_full_path")
1247  );
1248  $si = new ilSelectInputGUI($this->lng->txt("crs_shorten_breadcrumb"), "rep_breacrumb");
1249  $si->setValue((int) ilContainer::_lookupContainerSetting($this->object->getId(), "rep_breacrumb"));
1250  $si->setOptions($options);
1251  $form->addItem($si);
1252  }
1253 
1254  // custom icon
1255  $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addIcon();
1256 
1257  // tile image
1258  $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
1259 
1260  // list presentation
1262 
1263  // presentation type
1264  $view_type = new ilRadioGroupInputGUI($this->lng->txt('crs_presentation_type'), 'view_mode');
1265  $view_type->setValue($this->object->getViewMode());
1266 
1267  $opts = new ilRadioOption(
1268  $this->lng->txt('cntr_view_sessions'),
1270  );
1271  $opts->setInfo($this->lng->txt('cntr_view_info_sessions'));
1272  $view_type->addOption($opts);
1273 
1274  // Limited sessions
1275  $sess = new ilCheckboxInputGUI($this->lng->txt('sess_limit'), 'sl');
1276  $sess->setValue('1');
1277  $sess->setChecked($this->object->isSessionLimitEnabled());
1278  $sess->setInfo($this->lng->txt('sess_limit_info'));
1279 
1280  $prev = new ilNumberInputGUI($this->lng->txt('sess_num_prev'), 'sp');
1281  #$prev->setSubmitFormOnEnter(true);
1282  $prev->setMinValue(0);
1283  $prev->setValue(
1284  $this->object->getNumberOfPreviousSessions() == -1 ?
1285  '' :
1286  $this->object->getNumberOfPreviousSessions()
1287  );
1288  $prev->setSize(2);
1289  $prev->setMaxLength(3);
1290  $sess->addSubItem($prev);
1291 
1292  $next = new ilNumberInputGUI($this->lng->txt('sess_num_next'), 'sn');
1293  #$next->setSubmitFormOnEnter(true);
1294  $next->setMinValue(0);
1295  $next->setValue(
1296  $this->object->getNumberOfNextSessions() == -1 ?
1297  '' :
1298  $this->object->getNumberOfnextSessions()
1299  );
1300  $next->setSize(2);
1301  $next->setMaxLength(3);
1302  $sess->addSubItem($next);
1303 
1304  $opts->addSubItem($sess);
1305 
1306  $optsi = new ilRadioOption($this->lng->txt('cntr_view_simple'), (string) ilCourseConstants::IL_CRS_VIEW_SIMPLE);
1307  $optsi->setInfo($this->lng->txt('cntr_view_info_simple'));
1308  $view_type->addOption($optsi);
1309 
1310  $optbt = new ilRadioOption(
1311  $this->lng->txt('cntr_view_by_type'),
1313  );
1314  $optbt->setInfo($this->lng->txt('cntr_view_info_by_type'));
1315  $view_type->addOption($optbt);
1316 
1317  $opto = new ilRadioOption(
1318  $this->lng->txt('crs_view_objective'),
1320  );
1321  $opto->setInfo($this->lng->txt('crs_view_info_objective'));
1322  $view_type->addOption($opto);
1323 
1324  $optt = new ilRadioOption($this->lng->txt('crs_view_timing'), (string) ilCourseConstants::IL_CRS_VIEW_TIMING);
1325  $optt->setInfo($this->lng->txt('crs_view_info_timing'));
1326 
1327  // cognos-blu-patch: begin
1328  $timing = new ilRadioGroupInputGUI($this->lng->txt('crs_view_timings'), "timing_mode");
1329  $timing->setValue($this->object->getTimingMode());
1330 
1331  $absolute = new ilRadioOption(
1332  $this->lng->txt('crs_view_timing_absolute'),
1334  );
1335  $absolute->setInfo($this->lng->txt('crs_view_info_timing_absolute'));
1336  $timing->addOption($absolute);
1337 
1338  $relative = new ilRadioOption(
1339  $this->lng->txt('crs_view_timing_relative'),
1341  );
1342  $relative->setInfo($this->lng->txt('crs_view_info_timing_relative'));
1343  $timing->addOption($relative);
1344 
1345  $optt->addSubItem($timing);
1346  // cognos-blu-patch: end
1347 
1348  $view_type->addOption($optt);
1349 
1350  $form->addItem($view_type);
1351 
1352  $this->initSortingForm(
1353  $form,
1354  array(
1359  )
1360  );
1361 
1362  $tutorial_support_panel_checkbox = new ilCheckboxInputGUI(
1363  $this->lng->txt('tutorial_support_block_setting_title'),
1364  'tutorial_support_block_checkbox'
1365  );
1366  //$tutorial_support_panel_checkbox->setValue($this->object->getTutorialSupportBlockSettingValue());
1367  $tutorial_support_panel_checkbox->setChecked((bool) $this->object->getTutorialSupportBlockSettingValue());
1368  $tutorial_support_panel_checkbox->setInfo($this->lng->txt('tutorial_support_block_byline'));
1369  $form->addItem($tutorial_support_panel_checkbox);
1370 
1371  // lp vs. course status
1373  $olp = ilObjectLP::getInstance($this->object->getId());
1374  if ($olp->getCurrentMode()) {
1375  $lp_status = new ilFormSectionHeaderGUI();
1376  $lp_status->setTitle($this->lng->txt('crs_course_status_of_users'));
1377  $form->addItem($lp_status);
1378 
1379  $lp_status_options = new ilRadioGroupInputGUI($this->lng->txt('crs_status_determination'), "status_dt");
1380  // $lp_status_options->setRequired(true);
1381  $lp_status_options->setValue($this->object->getStatusDetermination());
1382 
1383  $lp_option = new ilRadioOption(
1384  $this->lng->txt('crs_status_determination_lp'),
1386  $this->lng->txt('crs_status_determination_lp_info')
1387  );
1388  $lp_status_options->addOption($lp_option);
1389  $lp_status_options->addOption(new ilRadioOption(
1390  $this->lng->txt('crs_status_determination_manual'),
1392  ));
1393 
1394  $form->addItem($lp_status_options);
1395  }
1396  }
1397 
1398  // additional features
1399  $feat = new ilFormSectionHeaderGUI();
1400  $feat->setTitle($this->lng->txt('obj_features'));
1401  $form->addItem($feat);
1402 
1404  $this->object->getId(),
1405  $form,
1406  $this->getSubServices()
1407  );
1408 
1409  $mem = new ilCheckboxInputGUI($this->lng->txt('crs_show_members'), 'show_members');
1410  $mem->setChecked($this->object->getShowMembers());
1411  $mem->setInfo($this->lng->txt('crs_show_members_info'));
1412  $form->addItem($mem);
1413 
1414  // check privacy
1415  if (\ilPrivacySettings::getInstance()->participantsListInCoursesEnabled()) {
1416  $part_list = new ilCheckboxInputGUI($this->lng->txt('crs_show_member_export'), 'show_members_export');
1417  $part_list->setChecked($this->object->getShowMembersExport());
1418  $part_list->setInfo($this->lng->txt('crs_show_member_export_info'));
1419  $mem->addSubItem($part_list);
1420  }
1421 
1422  // Show members type
1423  $mail_type = new ilRadioGroupInputGUI($this->lng->txt('crs_mail_type'), 'mail_type');
1424  $mail_type->setValue($this->object->getMailToMembersType());
1425 
1426  $mail_tutors = new ilRadioOption(
1427  $this->lng->txt('crs_mail_tutors_only'),
1429  $this->lng->txt('crs_mail_tutors_only_info')
1430  );
1431  $mail_type->addOption($mail_tutors);
1432 
1433  $mail_all = new ilRadioOption(
1434  $this->lng->txt('crs_mail_all'),
1436  $this->lng->txt('crs_mail_all_info')
1437  );
1438  $mail_type->addOption($mail_all);
1439  $form->addItem($mail_type);
1440 
1441  // Notification Settings
1442  /*$notification = new ilFormSectionHeaderGUI();
1443  $notification->setTitle($this->lng->txt('crs_notification'));
1444  $form->addItem($notification);*/
1445 
1446  // Self notification
1447  $not = new ilCheckboxInputGUI($this->lng->txt('crs_auto_notification'), 'auto_notification');
1448  $not->setValue('1');
1449  $not->setInfo($this->lng->txt('crs_auto_notification_info'));
1450  $not->setChecked($this->object->getAutoNotification());
1451  $form->addItem($not);
1452 
1453  $desk = new ilCheckboxInputGUI($this->lng->txt('crs_add_remove_from_desktop'), 'abo');
1454  $desk->setChecked($this->object->getAboStatus());
1455  $desk->setInfo($this->lng->txt('crs_add_remove_from_desktop_info'));
1456  $form->addItem($desk);
1457 
1458  // Edit ecs export settings
1459  $ecs = new ilECSCourseSettings($this->object);
1460  $ecs->addSettingsToForm($form, 'crs');
1461  return $form;
1462  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
const IL_CAL_UNIX
const STATUS_DETERMINATION_LP
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
This class represents a date/time property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
setFormAction(string $a_formaction)
setValue($a_value)
Set Value.
initDidacticTemplate(ilPropertyFormGUI $form)
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
const STATUS_DETERMINATION_MANUAL
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
ilPropertyFormGUI $form
static generateCode()
Generate new registration key.
initListPresentationForm(ilPropertyFormGUI $form)
Add list presentation settings to form.
initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings)
Append sorting settings to property form.
static getInstance(int $obj_id)
ilSetting $settings
Class ilECSCourseSettings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initHeaderAction()

ilObjCourseGUI::initHeaderAction ( ?string  $sub_type = null,
?int  $sub_id = null 
)
protected

Definition at line 2844 of file class.ilObjCourseGUI.php.

References ilParticipants\_isParticipant(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ilMembershipNotifications\isActiveForRefId(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

2844  : ?ilObjectListGUI
2845  {
2846  $lg = parent::initHeaderAction($sub_type, $sub_id);
2847 
2848  if ($lg && $this->ref_id && ilCourseParticipants::_isParticipant($this->ref_id, $this->user->getId())) {
2849  // certificate
2850 
2851  $validator = new ilCertificateDownloadValidator();
2852  if ($validator->isCertificateDownloadable($this->user->getId(), $this->object->getId())) {
2853  $cert_url = $this->ctrl->getLinkTarget($this, "deliverCertificate");
2854 
2855  $this->lng->loadLanguageModule("certificate");
2856  $lg->addCustomCommand($cert_url, "download_certificate");
2857 
2858  $lg->addHeaderIcon(
2859  "cert_icon",
2860  ilUtil::getImagePath("standard/icon_cert.svg"),
2861  $this->lng->txt("download_certificate"),
2862  null,
2863  null,
2864  $cert_url
2865  );
2866  }
2867 
2868  // notification
2869  if (ilMembershipNotifications::isActiveForRefId($this->ref_id)) {
2870  $noti = new ilMembershipNotifications($this->ref_id);
2871  if (!$noti->isCurrentUserActive()) {
2872  $lg->addHeaderIcon(
2873  "not_icon",
2874  ilUtil::getImagePath("object/notification_off.svg"),
2875  $this->lng->txt("crs_notification_deactivated")
2876  );
2877 
2878  $this->ctrl->setParameter($this, "crs_ntf", 1);
2879  $caption = "crs_activate_notification";
2880  } else {
2881  $lg->addHeaderIcon(
2882  "not_icon",
2883  ilUtil::getImagePath("object/notification_on.svg"),
2884  $this->lng->txt("crs_notification_activated")
2885  );
2886 
2887  $this->ctrl->setParameter($this, "crs_ntf", 0);
2888  $caption = "crs_deactivate_notification";
2889  }
2890 
2891  if ($noti->canCurrentUserEdit()) {
2892  $lg->addCustomCommand(
2893  $this->ctrl->getLinkTarget($this, "saveNotification"),
2894  $caption
2895  );
2896  }
2897 
2898  $this->ctrl->setParameter($this, "crs_ntf", "");
2899  }
2900  }
2901 
2902  return $lg;
2903  }
Validates if an active certificate is stored in the database and can be downloaded by the user...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ initInfoEditor()

ilObjCourseGUI::initInfoEditor ( )

Definition at line 565 of file class.ilObjCourseGUI.php.

References ilContainerGUI\$form, $text, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ilFileInputGUI\enableFileNameSelection(), ILIAS\Repository\lng(), ilAdvancedMDRecordGUI\MODE_EDITOR, ILIAS\Repository\object(), ilFormGUI\setFormAction(), ilFormGUI\setMultipart(), ilAdvancedMDRecordGUI\setPropertyForm(), ilPropertyFormGUI\setTitle(), and ilTextAreaInputGUI\setValue().

Referenced by editInfoObject(), executeCommand(), and updateInfoObject().

566  {
567  $form = new ilPropertyFormGUI();
568  $form->setFormAction($this->ctrl->getFormAction($this, 'updateInfo'));
569  $form->setMultipart(true);
570  $form->setTitle($this->lng->txt('crs_general_info'));
571  $form->addCommandButton('updateInfo', $this->lng->txt('save'));
572  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
573 
574  $area = new ilTextAreaInputGUI($this->lng->txt('crs_important_info'), 'important');
575  $area->setValue($this->object->getImportantInformation());
576  $area->setRows(6);
577  $area->setCols(80);
578  $form->addItem($area);
579 
580  $area = new ilTextAreaInputGUI($this->lng->txt('crs_syllabus'), 'syllabus');
581  $area->setValue($this->object->getSyllabus());
582  $area->setRows(6);
583  $area->setCols(80);
584  $form->addItem($area);
585 
586  $tg = new \ilTextAreaInputGUI($this->lng->txt('crs_target_group'), 'target_group');
587  $tg->setValue($this->object->getTargetGroup() ?? "");
588  $tg->setRows(6);
589  $form->addItem($tg);
590 
591  $section = new ilFormSectionHeaderGUI();
592  $section->setTitle($this->lng->txt('crs_info_download'));
593  $form->addItem($section);
594 
595  $file = new ilFileInputGUI($this->lng->txt('crs_file'), 'file');
596  $file->enableFileNameSelection('file_name');
597  $form->addItem($file);
598 
599  $section = new ilFormSectionHeaderGUI();
600  $section->setTitle($this->lng->txt('crs_contact'));
601  $form->addItem($section);
602 
603  $text = new ilTextInputGUI($this->lng->txt('crs_contact_name'), 'contact_name');
604  $text->setValue($this->object->getContactName());
605  $text->setSize(40);
606  $text->setMaxLength(70);
607  $form->addItem($text);
608 
609  $text = new ilTextInputGUI($this->lng->txt('crs_contact_responsibility'), 'contact_responsibility');
610  $text->setValue($this->object->getContactResponsibility());
611  $text->setSize(40);
612  $text->setMaxLength(70);
613  $form->addItem($text);
614 
615  $text = new ilTextInputGUI($this->lng->txt('crs_contact_phone'), 'contact_phone');
616  $text->setValue($this->object->getContactPhone());
617  $text->setSize(40);
618  $text->setMaxLength(40);
619  $form->addItem($text);
620 
621  $text = new ilTextInputGUI($this->lng->txt('crs_contact_email'), 'contact_email');
622  $text->setValue($this->object->getContactEmail());
623  $text->setInfo($this->lng->txt('crs_contact_email_info'));
624  $text->setSize(40);
625  $text->setMaxLength(255);
626  $form->addItem($text);
627 
628  $area = new ilTextAreaInputGUI($this->lng->txt('crs_contact_consultation'), 'contact_consultation');
629  $area->setValue($this->object->getContactConsultation());
630  $area->setRows(6);
631  $area->setCols(80);
632  $form->addItem($area);
633 
634  $this->record_gui = new ilAdvancedMDRecordGUI(
636  'crs',
637  $this->object->getId()
638  );
639  $this->record_gui->setPropertyForm($form);
640  $this->record_gui->parse();
641  return $form;
642  }
setMultipart(bool $a_multipart)
setPropertyForm(ilPropertyFormGUI $form)
enableFileNameSelection(string $a_post_var)
This class represents a file property in a property form.
setFormAction(string $a_formaction)
$text
Definition: xapiexit.php:21
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
ilPropertyFormGUI $form
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jump2UsersGalleryObject()

ilObjCourseGUI::jump2UsersGalleryObject ( )
protected

Definition at line 3114 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl().

3114  : void
3115  {
3116  $this->ctrl->redirectByClass(ilUsersGalleryGUI::class);
3117  }
+ Here is the call graph for this function:

◆ leaveObject()

ilObjCourseGUI::leaveObject ( )

Definition at line 1767 of file class.ilObjCourseGUI.php.

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\user(), and ilObjectGUI\viewObject().

Referenced by unsubscribeObject().

1767  : void
1768  {
1769  $this->checkPermission('leave');
1770 
1771  if ($this->object->getMembersObject()->isLastAdmin($this->user->getId())) {
1772  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('crs_min_one_admin'));
1773  $this->viewObject();
1774  return;
1775  }
1776 
1777  $this->tabs_gui->setTabActive('crs_unsubscribe');
1778  $cgui = new ilConfirmationGUI();
1779  $cgui->setHeaderText($this->lng->txt('crs_unsubscribe_sure'));
1780  $cgui->setFormAction($this->ctrl->getFormAction($this));
1781  $cgui->setCancel($this->lng->txt("cancel"), "cancel");
1782  $cgui->setConfirm($this->lng->txt("crs_unsubscribe"), "performUnsubscribe");
1783  $this->tpl->setContent($cgui->getHTML());
1784  }
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions" ...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ membersObject()

ilObjCourseGUI::membersObject ( )
protected

Definition at line 2539 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl().

Referenced by autoFillObject().

2539  : void
2540  {
2541  $this->ctrl->redirectByClass('ilcoursemembershipgui');
2542  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyItemGUI()

ilObjCourseGUI::modifyItemGUI ( ilObjectListGUI  $a_item_list_gui,
array  $a_item_data 
)

Definition at line 2693 of file class.ilObjCourseGUI.php.

References _modifyItemGUI(), and ILIAS\Repository\object().

2693  : void
2694  {
2696  $a_item_list_gui,
2697  'ilcoursecontentgui',
2698  $a_item_data,
2699  $this->object->getAboStatus(),
2700  $this->object->getRefId(),
2701  $this->object->getId()
2702  );
2703  }
static _modifyItemGUI(ilObjectListGUI $a_item_list_gui, string $a_cmd_class, array $a_item_data, bool $a_abo_status, int $a_course_ref_id, int $a_course_obj_id, int $a_parent_ref_id=0)
+ Here is the call graph for this function:

◆ performUnsubscribeObject()

ilObjCourseGUI::performUnsubscribeObject ( )

Definition at line 1791 of file class.ilObjCourseGUI.php.

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilObjectGUI\getObject(), ILIAS\Repository\lng(), ilCourseMembershipMailNotification\TYPE_UNSUBSCRIBE_MEMBER, and ILIAS\Repository\user().

1792  {
1793  $this->checkPermission('leave');
1794  $this->getObject()->getMembersObject()->delete($this->user->getId());
1795  $this->getObject()->getMembersObject()->sendUnsubscribeNotificationToAdmins($this->user->getId());
1796  $this->getObject()->getMembersObject()->sendNotification(
1798  $this->user->getId()
1799  );
1800  $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_unsubscribed_from_crs'), true);
1801 
1802  $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->tree->getParentId($this->ref_id));
1803  $this->ctrl->redirectByClass("ilrepositorygui", "");
1804  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ readMemberData()

ilObjCourseGUI::readMemberData ( array  $ids,
array  $selected_columns = null,
bool  $skip_names = false 
)

When building the members table in a course, user names are already read out via ilUserQuery::getUserListData (#31394). Adding skip_name as a parameter here is not super elegant, but seems like the only practical way avoid unnecessarily reading out the names again.

Definition at line 1630 of file class.ilObjCourseGUI.php.

References ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ilLPStatusWrapper\_lookupCompletedForObject(), ilLPStatusWrapper\_lookupFailedForObject(), ilLPStatusWrapper\_lookupInProgressForObject(), ilObjUser\_lookupName(), ilLearningProgress\_lookupProgressByObjId(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ilObjPortfolio\getAvailablePortfolioLinksForUserIds(), ilObjectLP\getInstance(), ilPrivacySettings\getInstance(), IL_CAL_UNIX, ILIAS\Repository\lng(), ilLPStatus\LP_STATUS_COMPLETED, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, ILIAS\Repository\object(), and ilObjCourse\STATUS_DETERMINATION_LP.

1630  : array
1631  {
1632  $show_tracking =
1633  (
1636  );
1637  if ($show_tracking) {
1638  $olp = ilObjectLP::getInstance($this->object->getId());
1639  $show_tracking = $olp->isActive();
1640  }
1641 
1642  if ($show_tracking) {
1643  $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
1644  $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
1645  $failed = ilLPStatusWrapper::_lookupFailedForObject($this->object->getId());
1646  }
1647  $privacy = ilPrivacySettings::getInstance();
1648 
1649  if ($privacy->enabledCourseAccessTimes()) {
1650  $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
1651  }
1652 
1653  $do_prtf = (is_array($selected_columns) &&
1654  in_array('prtf', $selected_columns) &&
1655  is_array($ids));
1656  if ($do_prtf) {
1658  $ids,
1659  $this->ctrl->getLinkTarget($this, "members")
1660  );
1661  }
1662 
1663  $members = [];
1664  foreach ($ids as $usr_id) {
1672  if (!$skip_names) {
1673  $name = ilObjUser::_lookupName($usr_id);
1674  $tmp_data['firstname'] = $name['firstname'];
1675  $tmp_data['lastname'] = $name['lastname'];
1676  $tmp_data['login'] = $name['login'];
1677  }
1678  $tmp_data['passed'] = $this->object->getMembersObject()->hasPassed($usr_id) ? 1 : 0;
1679  if ($this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) {
1680  $tmp_data['passed_info'] = $this->object->getMembersObject()->getPassedInfo($usr_id);
1681  }
1682  $tmp_data['notification'] = $this->object->getMembersObject()->isNotificationEnabled($usr_id) ? 1 : 0;
1683  $tmp_data['blocked'] = $this->object->getMembersObject()->isBlocked($usr_id) ? 1 : 0;
1684  $tmp_data['contact'] = $this->object->getMembersObject()->isContact($usr_id) ? 1 : 0;
1685 
1686  $tmp_data['usr_id'] = $usr_id;
1687 
1688  if ($show_tracking) {
1689  if (in_array($usr_id, $completed)) {
1690  $tmp_data['progress'] = ilLPStatus::LP_STATUS_COMPLETED;
1691  } elseif (in_array($usr_id, $in_progress)) {
1692  $tmp_data['progress'] = ilLPStatus::LP_STATUS_IN_PROGRESS;
1693  } elseif (in_array($usr_id, $failed)) {
1694  $tmp_data['progress'] = ilLPStatus::LP_STATUS_FAILED;
1695  } else {
1696  $tmp_data['progress'] = ilLPStatus::LP_STATUS_NOT_ATTEMPTED;
1697  }
1698  }
1699 
1700  if ($privacy->enabledCourseAccessTimes()) {
1701  if (isset($progress[$usr_id]['ts']) && $progress[$usr_id]['ts']) {
1702  $tmp_data['access_ut'] = $progress[$usr_id]['ts'];
1703  $tmp_data['access_time'] = ilDatePresentation::formatDate(new ilDateTime(
1704  $progress[$usr_id]['ts'],
1705  IL_CAL_UNIX
1706  ));
1707  } else {
1708  $tmp_data['access_ut'] = 0;
1709  $tmp_data['access_time'] = $this->lng->txt('no_date');
1710  }
1711  }
1712 
1713  if ($do_prtf) {
1714  $tmp_data['prtf'] = $all_prtf[$usr_id] ?? null;
1715  }
1716 
1717  $members[$usr_id] = $tmp_data;
1718  }
1719  return $members;
1720  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
const LP_STATUS_NOT_ATTEMPTED
static _lookupInProgressForObject(int $a_obj_id, ?array $a_user_ids=null)
static _lookupName(int $a_user_id)
lookup user name
const IL_CAL_UNIX
const STATUS_DETERMINATION_LP
const LP_STATUS_IN_PROGRESS
static _lookupCompletedForObject(int $a_obj_id, ?array $a_user_ids=null)
const LP_STATUS_FAILED
static _lookupProgressByObjId(int $a_obj_id)
lookup progress for a specific object
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, ?string $a_back_url=null)
static _lookupFailedForObject(int $a_obj_id, ?array $a_user_ids=null)
const LP_STATUS_COMPLETED
static getInstance(int $obj_id)
+ Here is the call graph for this function:

◆ redirectLocToTestConfirmation()

ilObjCourseGUI::redirectLocToTestConfirmation ( int  $a_objective_id,
int  $a_test_id 
)
protected

Show confirmation whether user wants to start a new run or resume a previous run.

Definition at line 3050 of file class.ilObjCourseGUI.php.

References $GLOBALS, ilObjectGUI\getFormAction(), and ILIAS\Repository\lng().

Referenced by redirectLocToTestObject().

3050  : void
3051  {
3052  $confirm = new ilConfirmationGUI();
3053  $confirm->setFormAction($GLOBALS['DIC']['ilCtrl']->getFormAction($this));
3054 
3055  if ($a_objective_id) {
3056  $question = $this->lng->txt('crs_loc_objective_passed_confirmation');
3057  } else {
3058  $question = $this->lng->txt('crs_loc_objectives_passed_confirmation');
3059  }
3060 
3061  $confirm->setHeaderText($question);
3062  $confirm->addHiddenItem('objective_id', (string) $a_objective_id);
3063  $confirm->addHiddenItem('tid', (string) $a_test_id);
3064  $confirm->setConfirm($this->lng->txt('crs_loc_tst_start'), 'redirectLocToTestConfirmed');
3065  $confirm->setCancel($this->lng->txt('cancel'), 'view');
3066 
3067  //$this->tpl->setOnScreenMessage('question', $question);
3068  $this->tpl->setContent($confirm->getHTML());
3069  }
getFormAction(string $cmd, string $default_form_action="")
Get form action for command (command is method name without "Object", e.g.
$GLOBALS["DIC"]
Definition: wac.php:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectLocToTestConfirmedObject()

ilObjCourseGUI::redirectLocToTestConfirmedObject ( )
protected

Definition at line 2982 of file class.ilObjCourseGUI.php.

References ILIAS\FileDelivery\http(), ilUtil\redirect(), and ILIAS\Repository\refinery().

2982  : void
2983  {
2984  $tid = 0;
2985  if ($this->http->wrapper()->query()->has('tid')) {
2986  $tid = $this->http->wrapper()->query()->retrieve(
2987  'tid',
2988  $this->refinery->kindlyTo()->int()
2989  );
2990  } elseif ($this->http->wrapper()->post()->has('tid')) {
2991  $tid = $this->http->wrapper()->post()->retrieve(
2992  'tid',
2993  $this->refinery->kindlyTo()->int()
2994  );
2995  }
2996  ilUtil::redirect(ilLink::_getLink($tid));
2997  }
static http()
Fetches the global http state from ILIAS.
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ redirectLocToTestObject()

ilObjCourseGUI::redirectLocToTestObject (   $a_force_new_run = null)
protected

Definition at line 2999 of file class.ilObjCourseGUI.php.

References $res, ilCourseObjective\_getObjectiveIds(), ILIAS\FileDelivery\http(), ILIAS\Repository\object(), ilUtil\redirect(), redirectLocToTestConfirmation(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

2999  : void
3000  {
3001  $tid = 0;
3002  if ($this->http->wrapper()->query()->has('tid')) {
3003  $tid = $this->http->wrapper()->query()->retrieve(
3004  'tid',
3005  $this->refinery->kindlyTo()->int()
3006  );
3007  }
3008  $objective_id = 0;
3009  if ($this->http->wrapper()->query()->has('objective_id')) {
3010  $objective_id = $this->http->wrapper()->query()->retrieve(
3011  'objective_id',
3012  $this->refinery->kindlyTo()->int()
3013  );
3014  }
3015 
3016  $res = new ilLOUserResults(
3017  $this->object->getId(),
3018  $this->user->getId()
3019  );
3020  $passed = $res->getCompletedObjectiveIds();
3021 
3022  $has_completed = false;
3023  if ($objective_id) {
3024  $objective_ids = array($objective_id);
3025  if (in_array($objective_id, $passed)) {
3026  $has_completed = true;
3027  $passed = array();
3028  }
3029  } else {
3030  $objective_ids = ilCourseObjective::_getObjectiveIds($this->object->getId(), true);
3031 
3032  // do not disable objective question if all are passed
3033  if (count($objective_ids) === count($passed)) {
3034  $has_completed = true;
3035  $passed = array();
3036  }
3037  }
3038 
3039  if ($has_completed) {
3040  // show confirmation
3041  $this->redirectLocToTestConfirmation($objective_id, $tid);
3042  return;
3043  }
3044  ilUtil::redirect(ilLink::_getLink($tid));
3045  }
$res
Definition: ltiservices.php:69
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
static http()
Fetches the global http state from ILIAS.
redirectLocToTestConfirmation(int $a_objective_id, int $a_test_id)
Show confirmation whether user wants to start a new run or resume a previous run. ...
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ renderAddNewItem()

ilObjCourseGUI::renderAddNewItem ( string ...  $disabled_object_types)

Definition at line 1591 of file class.ilObjCourseGUI.php.

References ilContainerGUI\$gui, ilObjectGUI\$type, ilObjectGUI\buildAddNewItemElements(), and ilObjectGUI\getCreatableObjectTypes().

Referenced by showPossibleSubObjects().

1591  : void
1592  {
1593  $createble_object_types = $this->getCreatableObjectTypes();
1594 
1595  foreach ($disabled_object_types as $type) {
1596  unset($createble_object_types[$type]);
1597  }
1598 
1600  $this->buildAddNewItemElements($createble_object_types)
1601  );
1602  $gui->render();
1603  }
buildAddNewItemElements(array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
Render add new item selector.
ILIAS Container InternalGUIService $gui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderContainer()

ilObjCourseGUI::renderContainer ( )

Definition at line 165 of file class.ilObjCourseGUI.php.

165  : void
166  {
167  parent::renderObject();
168  }

◆ renderObject()

◆ resetObject()

ilObjCourseGUI::resetObject ( )

Definition at line 2798 of file class.ilObjCourseGUI.php.

References $GLOBALS, ilLOUserResults\delete(), ilLOTestRun\deleteRuns(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilCourseObjectiveResult\reset(), ILIAS\Repository\user(), and ilObjectGUI\viewObject().

2798  : void
2799  {
2800  $usr_results = new ilLOUserResults($this->object->getId(), $GLOBALS['DIC']['ilUser']->getId());
2801  $usr_results->delete();
2803  $this->object->getId(),
2804  $GLOBALS['DIC']['ilUser']->getId()
2805  );
2806 
2807  $tmp_obj_res = new ilCourseObjectiveResult($this->user->getId());
2808  $tmp_obj_res->reset($this->object->getId());
2809 
2810  $this->user->deletePref('crs_objectives_force_details_' . $this->object->getId());
2811  $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_objectives_reseted'));
2812  $this->viewObject();
2813  }
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions" ...
$GLOBALS["DIC"]
Definition: wac.php:30
static deleteRuns(int $a_container_id, int $a_user_id)
+ Here is the call graph for this function:

◆ saveMapSettingsObject()

ilObjCourseGUI::saveMapSettingsObject ( )
Todo:
centralize for course, group, others

Definition at line 2663 of file class.ilObjCourseGUI.php.

References $location, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

2663  : void
2664  {
2665  $location = [];
2666  if ($this->http->wrapper()->post()->has('location')) {
2667  $custom_transformer = $this->refinery->custom()->transformation(
2668  fn($array) => $array
2669  );
2670  $location = $this->http->wrapper()->post()->retrieve(
2671  'location',
2672  $custom_transformer
2673  );
2674  }
2675  $enable_map = false;
2676  if ($this->http->wrapper()->post()->has('enable_map')) {
2677  $enable_map = $this->http->wrapper()->post()->retrieve(
2678  'enable_map',
2679  $this->refinery->kindlyTo()->bool()
2680  );
2681  }
2682  $this->object->setLatitude($location['latitude']);
2683  $this->object->setLongitude($location['longitude']);
2684  $this->object->setLocationZoom($location['zoom']);
2685  $this->object->setEnableCourseMap($enable_map);
2686  $this->object->update();
2687  $this->ctrl->redirect($this, "editMapSettings");
2688  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ saveNotificationObject()

ilObjCourseGUI::saveNotificationObject ( )

Definition at line 445 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

445  : void
446  {
447  $noti = new ilMembershipNotifications($this->ref_id);
448  if ($noti->canCurrentUserEdit()) {
449  $crs_ntf = false;
450  if ($this->http->wrapper()->query()->has('crs_ntf')) {
451  $crs_ntf = $this->http->wrapper()->query()->retrieve(
452  'crs_ntf',
453  $this->refinery->kindlyTo()->bool()
454  );
455  }
456  if ($crs_ntf) {
457  $noti->activateUser();
458  } else {
459  $noti->deactivateUser();
460  }
461  }
462  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
463  $this->ctrl->redirect($this, "");
464  }
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveSortingObject()

ilObjCourseGUI::saveSortingObject ( )

Definition at line 2950 of file class.ilObjCourseGUI.php.

References $ass_id, and ILIAS\FileDelivery\http().

2950  : void
2951  {
2952  $post_position = (array) ($this->http->request()->getParsedBody()['position'] ?? []);
2953  if (isset($post_position['lobj'])) {
2954  $lobj = $post_position['lobj'];
2955  $objective_order = array();
2956  foreach ($lobj as $objective_id => $materials) {
2957  $objective_order[$objective_id] = $materials[0];
2958  unset($lobj[$objective_id][0]);
2959  }
2960  // objective order
2961  asort($objective_order);
2962  $pos = 0;
2963  foreach (array_keys($objective_order) as $objective_id) {
2964  $obj = new ilCourseObjective($this->object, $objective_id);
2965  $obj->writePosition(++$pos);
2966  }
2967 
2968  // material order
2969  foreach ($lobj as $objective_id => $materials) {
2970  $objmat = new ilCourseObjectiveMaterials($objective_id);
2971 
2972  asort($materials);
2973  $pos = 0;
2974  foreach (array_keys($materials) as $ass_id) {
2975  $objmat->writePosition($ass_id, ++$pos);
2976  }
2977  }
2978  }
2979  parent::saveSortingObject();
2980  }
class ilCourseObjectiveMaterials
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ sendFileObject()

ilObjCourseGUI::sendFileObject ( )

Definition at line 1464 of file class.ilObjCourseGUI.php.

References ilFileDelivery\deliverFileLegacy(), ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

1464  : void
1465  {
1466  $file_id = 0;
1467  if ($this->http->wrapper()->query()->has('file_id')) {
1468  $file_id = $this->http->wrapper()->query()->retrieve(
1469  'file_id',
1470  $this->refinery->kindlyTo()->int()
1471  );
1472  }
1473  $file = new ilCourseFile($file_id);
1474  ilFileDelivery::deliverFileLegacy($file->getAbsolutePath(), $file->getFileName(), $file->getFileType());
1475  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ setContentSubTabs()

ilObjCourseGUI::setContentSubTabs ( )

Definition at line 2742 of file class.ilObjCourseGUI.php.

References $DIC, ilObjectGUI\$lng, ILIAS\Repository\access(), ilContainerGUI\addStandardContainerSubTabs(), ILIAS\Repository\ctrl(), ilContainerGUI\isActiveAdministrationPanel(), ILIAS\Repository\object(), and ilLanguage\txt().

2742  : void
2743  {
2744  global $DIC;
2745 
2746  $ilAccess = $DIC['ilAccess'];
2747  $lng = $DIC['lng'];
2748  $ilCtrl = $DIC['ilCtrl'];
2749 
2750  if ($this->object->getType() != 'crs') {
2751  return;
2752  }
2753  if (!$this->access->checkAccess(
2754  'write',
2755  '',
2756  $this->object->getRefId(),
2757  'crs',
2758  $this->object->getId()
2759  )) {
2760  $is_tutor = false;
2761  // No further tabs if objective view or archives
2762  if ($this->object->enabledObjectiveView()) {
2763  return;
2764  }
2765  } else {
2766  $is_tutor = true;
2767  }
2768 
2769  if (!$this->isActiveAdministrationPanel()) {
2770  $this->tabs_gui->addSubTab(
2771  "view_content",
2772  $lng->txt("view"),
2773  $this->ctrl->getLinkTargetByClass("ilobjcoursegui", "view")
2774  );
2775  } else {
2776  $this->tabs_gui->addSubTab(
2777  "view_content",
2778  $lng->txt("view"),
2779  $this->ctrl->getLinkTargetByClass("ilobjcoursegui", "disableAdministrationPanel")
2780  );
2781  }
2782  //}
2783 
2784  $this->addStandardContainerSubTabs(false);
2785  }
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...
ilLanguage $lng
addStandardContainerSubTabs(bool $a_include_view=true)
Add standard container subtabs for view, manage, oderdering and text/media editor link...
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ setLPSyncObject()

ilObjCourseGUI::setLPSyncObject ( )
protected

Definition at line 980 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilObjCourse\STATUS_DETERMINATION_LP.

980  : void
981  {
982  $this->object->setStatusDetermination(ilObjCourse::STATUS_DETERMINATION_LP);
983  $this->object->update();
984  $this->object->syncMembersStatusWithLP();
985  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
986  $this->ctrl->redirect($this, "edit");
987  }
const STATUS_DETERMINATION_LP
+ Here is the call graph for this function:

◆ setSideColumnReturn()

ilObjCourseGUI::setSideColumnReturn ( )

Definition at line 3122 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl().

3122  : void
3123  {
3124  $this->ctrl->setReturn($this, "view");
3125  }
+ Here is the call graph for this function:

◆ setSubTabs()

ilObjCourseGUI::setSubTabs ( string  $a_tab)

Definition at line 1477 of file class.ilObjCourseGUI.php.

References ilCourseDefinedFieldDefinition\_hasFields(), ILIAS\Repository\ctrl(), ilPrivacySettings\getInstance(), ilMapUtil\isActivated(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by confirmDeleteInfoFilesObject(), editInfoObject(), editMapSettingsObject(), editObject(), and executeCommand().

1477  : void
1478  {
1479  switch ($a_tab) {
1480  case "properties":
1481  $this->tabs_gui->addSubTabTarget(
1482  "crs_settings",
1483  $this->ctrl->getLinkTarget($this, 'edit'),
1484  "edit",
1485  get_class($this)
1486  );
1487 
1488  $this->tabs_gui->addSubTabTarget(
1489  "crs_info_settings",
1490  $this->ctrl->getLinkTarget($this, 'editInfo'),
1491  "editInfo",
1492  get_class($this)
1493  );
1494 
1495  $this->tabs_gui->addSubTabTarget(
1496  "preconditions",
1497  $this->ctrl->getLinkTargetByClass('ilConditionHandlerGUI', 'listConditions'),
1498  "",
1499  "ilConditionHandlerGUI"
1500  );
1501 
1502  $this->tabs_gui->addSubTabTarget(
1503  "crs_start_objects",
1504  $this->ctrl->getLinkTargetByClass('ilContainerStartObjectsGUI', 'listStructure'),
1505  "listStructure",
1506  get_class($this)
1507  );
1508 
1509  $this->tabs_gui->addSubTabTarget(
1510  'groupings',
1511  $this->ctrl->getLinkTargetByClass('ilobjcoursegroupinggui', 'listGroupings'),
1512  'listGroupings',
1513  get_class($this)
1514  );
1515  $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
1516  if ($lti_settings->hasSettingsAccess()) {
1517  $this->tabs_gui->addSubTabTarget(
1518  'lti_provider',
1519  $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
1520  );
1521  }
1522 
1523  // map settings
1524  if (ilMapUtil::isActivated()) {
1525  $this->tabs_gui->addSubTabTarget(
1526  "crs_map_settings",
1527  $this->ctrl->getLinkTarget($this, 'editMapSettings'),
1528  "editMapSettings",
1529  get_class($this)
1530  );
1531  }
1532 
1533  // only show if export permission is granted
1534  if (ilPrivacySettings::getInstance()->checkExportAccess($this->object->getRefId()) || ilCourseDefinedFieldDefinition::_hasFields($this->object->getId())) {
1535  $this->tabs_gui->addSubTabTarget(
1536  'crs_custom_user_fields',
1537  $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui'),
1538  '',
1539  'ilobjectcustomuserfieldsgui'
1540  );
1541  }
1542 
1543  // certificates
1544  $validator = new ilCertificateActiveValidator();
1545  if (true === $validator->validate()) {
1546  $this->tabs_gui->addSubTabTarget(
1547  "certificate",
1548  $this->ctrl->getLinkTargetByClass("ilcertificategui", "certificateeditor"),
1549  "",
1550  "ilcertificategui"
1551  );
1552  }
1553  // news settings
1554  if ($this->object->getUseNews()) {
1555  $this->tabs_gui->addSubTab(
1556  'obj_news_settings',
1557  $this->lng->txt("cont_news_settings"),
1558  $this->ctrl->getLinkTargetByClass('ilcontainernewssettingsgui')
1559  );
1560  }
1561  if ($this->object->getShowMembersExport()) {
1562  $this->tabs_gui->addSubTab(
1563  'export_members',
1564  $this->lng->txt('crs_show_member_export_settings'),
1565  $this->ctrl->getLinkTargetByClass('ilmemberexportsettingsgui', '')
1566  );
1567  }
1568  $this->tabs_gui->addSubTabTarget(
1569  "obj_multilinguality",
1570  $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", ""),
1571  "",
1572  "ilobjecttranslationgui"
1573  );
1574  break;
1575  }
1576  }
GUI class for LTI provider object settings.
static isActivated()
Checks whether Map feature is activated.
static _hasFields(int $a_container_id)
Check if there are any define fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPossibleSubObjects()

ilObjCourseGUI::showPossibleSubObjects ( )
protected

Definition at line 1581 of file class.ilObjCourseGUI.php.

References ilContainerGUI\isActiveAdministrationPanel(), ILIAS\Repository\object(), renderAddNewItem(), and ilContainer\VIEW_OBJECTIVE.

1581  : void
1582  {
1583  if (
1584  $this->object->getViewMode() == ilContainer::VIEW_OBJECTIVE &&
1585  !$this->isActiveAdministrationPanel()) {
1586  return;
1587  }
1588  $this->renderAddNewItem();
1589  }
renderAddNewItem(string ... $disabled_object_types)
+ Here is the call graph for this function:

◆ unsubscribeObject()

ilObjCourseGUI::unsubscribeObject ( )

Definition at line 1786 of file class.ilObjCourseGUI.php.

References leaveObject().

1786  : void
1787  {
1788  $this->leaveObject();
1789  }
+ Here is the call graph for this function:

◆ updateInfoObject()

ilObjCourseGUI::updateInfoObject ( )
Todo:
switch to form

Definition at line 647 of file class.ilObjCourseGUI.php.

References ilContainerGUI\$error, ilContainerGUI\$form, ilPropertyFormGUI\checkInput(), ilObjectGUI\checkPermission(), editInfoObject(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ilErrorHandling\getMessage(), ilFileUtils\getValidFilename(), initInfoEditor(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\MESSAGE_TYPE_SUCCESS, ILIAS\Repository\object(), ilErrorHandling\setMessage(), and ilPropertyFormGUI\setValuesByPost().

647  : void
648  {
649  $this->checkPermission('write');
650 
651  $form = $this->initInfoEditor();
652  if ($form->checkInput()) {
653  $this->object->setImportantInformation((string) $form->getInput('important'));
654  $this->object->setSyllabus((string) $form->getInput('syllabus'));
655  $this->object->setTargetGroup((string) $form->getInput('target_group'));
656  $this->object->setContactName((string) $form->getInput('contact_name'));
657  $this->object->setContactResponsibility((string) $form->getInput('contact_responsibility'));
658  $this->object->setContactPhone((string) $form->getInput('contact_phone'));
659  $this->object->setContactEmail((string) $form->getInput('contact_email'));
660  $this->object->setContactConsultation((string) $form->getInput('contact_consultation'));
661 
662  $file_info = $form->getInput('file');
663  $file_name = $form->getItemByPostVar('file')->getFilename();
664  $file_name = ilFileUtils::getValidFilename($file_name);
665 
666  $file_obj = new ilCourseFile();
667  $file_obj->setCourseId($this->object->getId());
668  $file_obj->setFileName((string) $file_name);
669  $file_obj->setFileSize((int) $file_info['size']);
670  $file_obj->setFileType((string) $file_info['type']);
671  $file_obj->setTemporaryName((string) $file_info['tmp_name']);
672  $file_obj->setErrorCode((int) $file_info['error']);
673 
674  $error = false;
675  $this->error->setMessage('');
676  $file_obj->validate();
677  $this->object->validateInfoSettings();
678  if (strlen($this->error->getMessage())) {
679  $error = $this->error->getMessage();
680  }
681  if (!$this->record_gui->importEditFormPostValues()) {
682  $error = true;
683  }
684  if ($error) {
685  if ($error !== true) {
686  $this->tpl->setOnScreenMessage('failure', $this->error->getMessage());
687  }
689  $this->editInfoObject($form);
690  return;
691  }
692  $this->object->update();
693  $file_obj->create();
694  $this->record_gui->writeEditForm();
695 
696  // Update ecs content
697  $ecs = new ilECSCourseSettings($this->object);
698  $ecs->handleContentUpdate();
699 
700  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_settings_saved"));
701  $this->editInfoObject();
702  } else {
703  $this->tpl->setOnScreenMessage(
705  $this->lng->txt('settings_saved')
706  );
707  }
708  }
setMessage(string $a_message)
getItemByPostVar(string $a_post_var)
static getValidFilename(string $a_filename)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
ilErrorHandling $error
ilPropertyFormGUI $form
editInfoObject(ilPropertyFormGUI $a_form=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
Class ilECSCourseSettings.
+ Here is the call graph for this function:

◆ updateLPFromStatus()

ilObjCourseGUI::updateLPFromStatus ( int  $a_member_id,
bool  $a_has_passed 
)

sync course status and lp status

Definition at line 1725 of file class.ilObjCourseGUI.php.

References ilObjUserTracking\_enabledLearningProgress(), ilLPStatusWrapper\_updateStatus(), ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_MANUAL_BY_TUTOR, ILIAS\Repository\object(), ilCourseAppEventListener\setBlockedForLP(), ilLPMarks\setCompleted(), and ilObjCourse\STATUS_DETERMINATION_LP.

1725  : void
1726  {
1728  $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) {
1729  $olp = ilObjectLP::getInstance($this->object->getId());
1730  if ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_MANUAL_BY_TUTOR) {
1731  $marks = new ilLPMarks($this->object->getId(), $a_member_id);
1732 
1733  // only if status has changed
1734  if ($marks->getCompleted() !== $a_has_passed) {
1735  $marks->setCompleted($a_has_passed);
1736  $marks->update();
1737 
1738  // as course is origin of LP status change, block syncing
1740  ilLPStatusWrapper::_updateStatus($this->object->getId(), $a_member_id);
1741  }
1742  }
1743  }
1744  }
const STATUS_DETERMINATION_LP
static setBlockedForLP(bool $a_status)
Toggle LP blocking property status.
setCompleted(bool $a_status)
static getInstance(int $obj_id)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
+ Here is the call graph for this function:

◆ updateObject()

ilObjCourseGUI::updateObject ( )

Definition at line 710 of file class.ilObjCourseGUI.php.

References ilContainerGUI\$form, $GLOBALS, ilObjectGUI\$settings, ilChangeEvent\_catchupWriteEvents(), ilChangeEvent\_recordWriteEvent(), ilContainer\_writeContainerSetting(), ilContainerGUI\afterUpdate(), ilPropertyFormGUI\checkInput(), confirmLPSync(), ilObjectGUI\editObject(), ilPropertyFormGUI\getInput(), ilPrivacySettings\getInstance(), ilPropertyFormGUI\getItemByPostVar(), ilObjectGUI\getObjectService(), getSubServices(), ILIAS\FileDelivery\http(), IL_CAL_UNIX, ilCourseConstants\IL_CRS_SUBSCRIPTION_DEACTIVATED, ilCourseConstants\IL_CRS_SUBSCRIPTION_DIRECT, ilCourseConstants\IL_CRS_SUBSCRIPTION_LIMITED, ilCourseConstants\IL_CRS_SUBSCRIPTION_UNLIMITED, ilCourseConstants\IL_CRS_VIEW_OBJECTIVE, ilCourseConstants\IL_CRS_VIEW_TIMING, initEditForm(), ILIAS\Repository\int(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), ilContainerGUI\saveListPresentation(), ilContainerGUI\saveSortingSettings(), ilPropertyFormGUI\setValuesByPost(), ilContainer\SORT_ACTIVATION, ilObjCourse\STATUS_DETERMINATION_LP, ilObjectServiceSettingsGUI\updateServiceSettingsForm(), and ILIAS\Repository\user().

710  : void
711  {
712  $obj_service = $this->getObjectService();
713  $setting = $this->settings;
714 
715  $form = $this->initEditForm();
716 
717  if (!$form->checkInput()) {
719  $this->tpl->setOnScreenMessage('failure', $GLOBALS['DIC']->language()->txt('err_check_input'));
720  $this->editObject($form);
721  return;
722  }
723 
724  // Additional checks: subsription min/max
725  if (
726  $form->getInput('subscription_max') &&
727  $form->getInput('subscription_min') &&
728  ($form->getInput('subscription_max') < $form->getInput('subscription_min'))
729  ) {
730  $min = $form->getItemByPostVar('subscription_min');
731  $min->setAlert($this->lng->txt('crs_subscription_min_members_err'));
732  $this->tpl->setOnScreenMessage('failure', $GLOBALS['DIC']->language()->txt('err_check_input'));
733  $this->editObject($form);
734  return;
735  }
736 
737  // Additional checks: both tile and objective view activated (not supported)
738  if (
739  $form->getInput('list_presentation') == "tile" &&
741  $this->tpl->setOnScreenMessage(
742  'failure',
743  $GLOBALS['DIC']->language()->txt('crs_tile_and_objective_view_not_supported')
744  );
745  $this->editObject($form);
746  return;
747  }
748 
749  // Additional checks: both tile and session limitation activated (not supported)
750  if ($form->getInput('sl') == "1" &&
751  $form->getInput('list_presentation') == "tile") {
752  $this->tpl->setOnScreenMessage(
753  'failure',
754  $GLOBALS['DIC']->language()->txt('crs_tile_and_session_limit_not_supported')
755  );
756  $this->editObject($form);
757  return;
758  }
759 
760  // check successful
761  // title/desc
762  $this->object->setTitle($form->getInput('title'));
763  $this->object->setDescription($form->getInput('desc'));
764 
765  // period
766  $crs_period = $form->getItemByPostVar("period");
767 
768  $this->object->setCoursePeriod(
769  $crs_period->getStart(),
770  $crs_period->getEnd()
771  );
772 
773  // activation period
774  $period = $form->getItemByPostVar("access_period");
775  if ($period->getStart() && $period->getEnd()) {
776  $this->object->setActivationStart($period->getStart()->get(IL_CAL_UNIX));
777  $this->object->setActivationEnd($period->getEnd()->get(IL_CAL_UNIX));
778  $this->object->setActivationVisibility((int) $form->getInput('activation_visibility'));
779  } else {
780  $this->object->setActivationStart(0);
781  $this->object->setActivationEnd(0);
782  }
783 
784  // subscription settings
785  $this->object->setSubscriptionPassword($form->getInput('subscription_password'));
786  $this->object->setSubscriptionStart(0);
787  $this->object->setSubscriptionEnd(0);
788 
789  $sub_type = (int) $form->getInput('subscription_type');
790  $sub_reg_type = (int) $form->getInput('subscription_limitation_type');
791  $sub_period = $form->getItemByPostVar('subscription_period');
792 
793  $this->object->setSubscriptionType(
795  ? $sub_type
797  );
798  if ($sub_reg_type !== ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED) {
799  if ($sub_period->getStart() && $sub_period->getEnd()) {
800  $this->object->setSubscriptionLimitationType(ilCourseConstants::IL_CRS_SUBSCRIPTION_LIMITED);
801  $this->object->setSubscriptionStart($sub_period->getStart()->get(IL_CAL_UNIX));
802  $this->object->setSubscriptionEnd($sub_period->getEnd()->get(IL_CAL_UNIX));
803  } else {
804  $this->object->setSubscriptionLimitationType(ilCourseConstants::IL_CRS_SUBSCRIPTION_UNLIMITED);
805  }
806  } else {
807  $this->object->setSubscriptionType(ilCourseConstants::IL_CRS_SUBSCRIPTION_DIRECT);
808  $this->object->setSubscriptionLimitationType(ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED);
809  }
810 
811  // registration code
812  $this->object->enableRegistrationAccessCode((bool) $form->getInput('reg_code_enabled'));
813  $this->object->setRegistrationAccessCode($form->getInput('reg_code'));
814 
815  // cancellation end
816  $this->object->setCancellationEnd($form->getItemByPostVar("cancel_end")->getDate());
817 
818  // waiting list
819  $this->object->enableSubscriptionMembershipLimitation((bool) $form->getInput('subscription_membership_limitation'));
820  $this->object->setSubscriptionMaxMembers((int) $form->getInput('subscription_max'));
821  $this->object->setSubscriptionMinMembers((int) $form->getInput('subscription_min'));
822  switch ((int) $form->getInput('waiting_list')) {
823  case 2:
824  $this->object->enableWaitingList(true);
825  $this->object->setWaitingListAutoFill(true);
826  break;
827 
828  case 1:
829  $this->object->enableWaitingList(true);
830  $this->object->setWaitingListAutoFill(false);
831  break;
832 
833  default:
834  $this->object->enableWaitingList(false);
835  $this->object->setWaitingListAutoFill(false);
836  break;
837  }
838  $this->object->handleAutoFill();
839 
840  $property_online = $this->object->getObjectProperties()->getPropertyIsOnline();
841  $online = $form->getInput('activation_online') ? $property_online->withOnline() : $property_online->withOffline();
842  $this->object->getObjectProperties()->storePropertyIsOnline($online);
843 
844  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTitleIconVisibility();
845  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTopActionsVisibility();
846  ilContainer::_writeContainerSetting($this->object->getId(), "rep_breacrumb", $form->getInput('rep_breacrumb'));
847  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveIcon();
848  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
849  $this->saveListPresentation($form);
850 
851  $this->object->setViewMode((int) $form->getInput('view_mode'));
852  if ($this->object->getViewMode() == ilCourseConstants::IL_CRS_VIEW_TIMING) {
853  $this->object->setOrderType(ilContainer::SORT_ACTIVATION);
854  $this->object->setTimingMode((int) $form->getInput('timing_mode'));
855  }
856  $this->object->setTimingMode((int) $form->getInput('timing_mode'));
857  $this->object->setOrderType((int) $form->getInput('sorting'));
858  $this->saveSortingSettings($form);
859 
860  $this->log->debug(
861  "\n\n\nValue: " . (int) $form->getInput('tutorial_support_block_checkbox') . "\n\n\n"
862  );
863  $this->object->setTutorialSupportBlockSettingValue(
864  (int) $form->getInput('tutorial_support_block_checkbox')
865  );
866 
867  $this->object->setAboStatus((bool) $form->getInput('abo'));
868  $this->object->setShowMembers((bool) $form->getInput('show_members'));
869 
870  if (\ilPrivacySettings::getInstance()->participantsListInCoursesEnabled()) {
871  $this->object->setShowMembersExport((bool) $form->getInput('show_members_export'));
872  }
873  $this->object->setMailToMembersType((int) $form->getInput('mail_type'));
874 
875  $this->object->enableSessionLimit((int) $form->getInput('sl'));
876 
877  $session_sp = $form->getInput('sp');
878  $this->object->setNumberOfPreviousSessions(is_numeric($session_sp) ? (int) $session_sp : -1);
879  $session_sn = $form->getInput('sn');
880  $this->object->setNumberOfnextSessions(is_numeric($session_sn) ? (int) $session_sn : -1);
881  $this->object->setAutoNotification($form->getInput('auto_notification') == 1 ? true : false);
882 
883  // lp sync
884  $show_lp_sync_confirmation = false;
885 
886  // could be hidden in form
887  if ($this->http->wrapper()->post()->has('status_dt')) {
888  $status_dt = $this->http->wrapper()->post()->retrieve(
889  'status_dt',
890  $this->refinery->kindlyTo()->int()
891  );
892  if (
893  $this->object->getStatusDetermination() != ilObjCourse::STATUS_DETERMINATION_LP &&
895  ) {
896  $show_lp_sync_confirmation = true;
897  } else {
898  $this->object->setStatusDetermination($status_dt);
899  }
900  }
901 
902  $this->object->update();
903 
905  $this->object->getId(),
906  $form,
907  $this->getSubServices()
908  );
909 
910  ilChangeEvent::_recordWriteEvent($this->object->getId(), $this->user->getId(), 'update');
911  ilChangeEvent::_catchupWriteEvents($this->object->getId(), $this->user->getId());
912 
913  // lp sync confirmation required
914  if ($show_lp_sync_confirmation) {
915  $this->confirmLPSync();
916  return;
917  }
918 
919  // Update ecs export settings
920  $ecs = new ilECSCourseSettings($this->object);
921  if (!$ecs->handleSettingsUpdate($form)) {
923  $this->tpl->setOnScreenMessage('failure', $GLOBALS['DIC']->language()->txt('err_check_input'));
924  $this->editObject($form);
925  return;
926  }
927 
928  // 29589
929  if (
930  $sub_type === ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED &&
931  (
932  !is_null($sub_period->getStart()) ||
933  !is_null($sub_period->getEnd())
934  )
935  ) {
936  $this->tpl->setOnScreenMessage(
937  'failure',
938  $this->lng->txt('crs_msg_no_self_registration_period_if_self_enrolment_disabled'),
939  true
940  );
942  $this->tpl->setOnScreenMessage('failure', $GLOBALS['DIC']->language()->txt('err_check_input'));
943  $this->editObject($form);
944  return;
945  }
946 
947  $this->afterUpdate();
948  }
saveSortingSettings(ilPropertyFormGUI $form)
getItemByPostVar(string $a_post_var)
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
const IL_CAL_UNIX
const STATUS_DETERMINATION_LP
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
static http()
Fetches the global http state from ILIAS.
$GLOBALS["DIC"]
Definition: wac.php:30
static _recordWriteEvent(int $obj_id, int $usr_id, string $action, ?int $parent_obj_id=null)
Records a write event.
saveListPresentation(ilPropertyFormGUI $form)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
ilPropertyFormGUI $form
language()
description: > Example for rendring a language glyph.
Definition: language.php:25
static _catchupWriteEvents(int $obj_id, int $usr_id, ?string $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
ilSetting $settings
Class ilECSCourseSettings.
+ Here is the call graph for this function:

Field Documentation

◆ $help

ilHelpGUI ilObjCourseGUI::$help
protected

Definition at line 59 of file class.ilObjCourseGUI.php.

◆ $http

GlobalHttpState ilObjCourseGUI::$http
protected

Definition at line 57 of file class.ilObjCourseGUI.php.

◆ $logger

ilLogger ilObjCourseGUI::$logger
private

Definition at line 56 of file class.ilObjCourseGUI.php.

◆ $navigation_history

ilNavigationHistory ilObjCourseGUI::$navigation_history
protected

Definition at line 60 of file class.ilObjCourseGUI.php.

◆ $news

News ilObjCourseGUI::$news
protected

Definition at line 51 of file class.ilObjCourseGUI.php.

◆ $record_gui

ilAdvancedMDRecordGUI ilObjCourseGUI::$record_gui = null
private

Definition at line 53 of file class.ilObjCourseGUI.php.

◆ $refinery

Factory ilObjCourseGUI::$refinery
protected

Definition at line 58 of file class.ilObjCourseGUI.php.

◆ $start_obj

ilContainerStartObjects ilObjCourseGUI::$start_obj = null
private

Definition at line 54 of file class.ilObjCourseGUI.php.

◆ BREADCRUMB_CRS_ONLY

const ilObjCourseGUI::BREADCRUMB_CRS_ONLY = 1

Definition at line 49 of file class.ilObjCourseGUI.php.

◆ BREADCRUMB_DEFAULT

const ilObjCourseGUI::BREADCRUMB_DEFAULT = 0

Definition at line 48 of file class.ilObjCourseGUI.php.

Referenced by ilLocatorGUI\addRepositoryItems().

◆ BREADCRUMB_FULL_PATH

const ilObjCourseGUI::BREADCRUMB_FULL_PATH = 2

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

Referenced by ilLocatorGUI\addRepositoryItems().


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