ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ __checkStartObjects()

ilObjCourseGUI::__checkStartObjects ( )

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

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

Referenced by executeCommand(), and renderObject().

2819  : bool
2820  {
2821  if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
2822  return true;
2823  }
2824  $this->start_obj = new ilContainerStartObjects(
2825  $this->object->getRefId(),
2826  $this->object->getId()
2827  );
2828  if (count($this->start_obj->getStartObjects()) &&
2829  !$this->start_obj->allFullfilled($this->user->getId())) {
2830  return false;
2831  }
2832  return true;
2833  }
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 2538 of file class.ilObjCourseGUI.php.

2538  : array
2539  {
2540  return array("ilCourseRegisterGUI", 'ilConditionHandlerGUI');
2541  }

◆ _goto()

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

Definition at line 2548 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().

2548  : void
2549  {
2550  global $DIC;
2551  $main_tpl = $DIC->ui()->mainTemplate();
2552  $ilAccess = $DIC['ilAccess'];
2553  $ilErr = $DIC['ilErr'];
2554  $lng = $DIC['lng'];
2555  $ilUser = $DIC['ilUser'];
2556  $http = $DIC->http();
2557  $refinery = $DIC->refinery();
2558 
2559  $a_target = (int) $a_target;
2560 
2561  if (substr($a_add, 0, 5) == 'rcode') {
2562  if ($ilUser->getId() == ANONYMOUS_USER_ID) {
2563  $target = '';
2564  if ($http->wrapper()->query()->has('target')) {
2565  $target = $http->wrapper()->query()->retrieve(
2566  'target',
2567  $refinery->kindlyTo()->string()
2568  );
2569  }
2570  // Redirect to login for anonymous
2572  "login.php?target=" . $target . "&cmd=force_login&lang=" .
2573  $ilUser->getCurrentLanguage()
2574  );
2575  }
2576 
2577  // Redirects to target location after assigning user to course
2579  $a_target,
2581  substr($a_add, 5)
2582  );
2583  }
2584 
2585  if ($a_add == "mem" && $ilAccess->checkAccess("manage_members", "", $a_target)) {
2586  ilObjectGUI::_gotoRepositoryNode($a_target, "members");
2587  }
2588 
2589  if ($a_add == "comp" && ilContSkillPresentationGUI::isAccessible($a_target)) {
2590  ilObjectGUI::_gotoRepositoryNode($a_target, "competences");
2591  }
2592 
2593  if ($ilAccess->checkAccess("read", "", $a_target)) {
2595  } else {
2596  // to do: force flat view
2597  if ($ilAccess->checkAccess("visible", "", $a_target)) {
2598  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreenGoto");
2599  } else {
2600  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
2601  $main_tpl->setOnScreenMessage('failure', sprintf(
2602  $lng->txt("msg_no_perm_read_item"),
2604  ), true);
2606  }
2607  }
2608  }
2609  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
2610  }
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:33
static _lookupObjId(int $ref_id)
GlobalHttpState $http
ilLanguage $lng
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
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:55
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 2709 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().

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

◆ addContentTab()

ilObjCourseGUI::addContentTab ( )

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

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

Referenced by getTabs().

1836  : void
1837  {
1838  $this->tabs_gui->addTab(
1839  "view_content",
1840  $this->lng->txt("content"),
1841  $this->ctrl->getLinkTarget($this, "view")
1842  );
1843  }
+ 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 1612 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().

1612  : void
1613  {
1614  $new_object->getMemberObject()->add($this->user->getId(), ilParticipants::IL_CRS_ADMIN);
1615  $new_object->getMemberObject()->updateNotification(
1616  $this->user->getId(),
1617  $this->settings->get('mail_crs_admin_notification', '1')
1618  );
1619  $new_object->getMemberObject()->updateContact($this->user->getId(), 1);
1620  $new_object->update();
1621 
1622  ilChangeEvent::_recordWriteEvent($new_object->getId(), $this->user->getId(), 'create');
1623  // END ChangeEvent: Record write event.
1624 
1625  // always send a message
1626  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_added"), true);
1627  $this->ctrl->setParameter($this, "ref_id", $new_object->getRefId());
1629  "save",
1630  $this->ctrl->getLinkTarget($this, "edit", "")
1631  ));
1632  }
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 2949 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl().

2949  : void
2950  {
2951  $this->ctrl->redirectByClass(array('ilrepositorygui', 'ilobjcoursegui', 'illoeditorgui'), 'materials');
2952  }
+ Here is the call graph for this function:

◆ askResetObject()

ilObjCourseGUI::askResetObject ( )

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

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

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

◆ autoFillObject()

ilObjCourseGUI::autoFillObject ( )

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

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

1750  : bool
1751  {
1752  $this->checkPermission('write');
1753  if (
1754  $this->object->isSubscriptionMembershipLimited() &&
1755  $this->object->getSubscriptionMaxMembers() &&
1756  $this->object->getSubscriptionMaxMembers() <= $this->object->getMembersObject()->getCountMembers()
1757  ) {
1758  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_max_members_reached"));
1759  $this->membersObject();
1760  return false;
1761  }
1762  if ($number = $this->object->getMembersObject()->autoFillSubscribers()) {
1763  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_number_users_added") . " " . $number);
1764  } else {
1765  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_added"));
1766  }
1767  $this->membersObject();
1768  return true;
1769  }
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 2503 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().

2503  : bool
2504  {
2505  if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
2506  return true;
2507  }
2508 
2509  // Disable aggrement if is not member of course
2510  if (!$this->object->getMemberObject()->isAssigned()) {
2511  return true;
2512  }
2513 
2514  if (ilMemberViewSettings::getInstance()->isActive()) {
2515  return true;
2516  }
2517 
2518  $privacy = ilPrivacySettings::getInstance();
2519 
2520  // Check agreement
2521  if (
2522  (
2523  $privacy->courseConfirmationRequired() || ilCourseDefinedFieldDefinition::_hasFields($this->object->getId())
2524  ) &&
2525  !ilMemberAgreement::_hasAccepted($this->user->getId(), $this->object->getId())
2526  ) {
2527  $this->logger->warning('Missing course confirmation.');
2528  return false;
2529  }
2530  // Check required fields
2531  if (!ilCourseUserData::_checkRequired($this->user->getId(), $this->object->getId())) {
2532  $this->logger->warning('Missing required fields');
2533  return false;
2534  }
2535  return true;
2536  }
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  }
editInfoObject(?ilPropertyFormGUI $a_form=null)
static http()
Fetches the global http state from ILIAS.
setSubTabs(string $a_tab)
+ Here is the call graph for this function:

◆ confirmLPSync()

ilObjCourseGUI::confirmLPSync ( )
protected

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

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

Referenced by updateObject().

974  : void
975  {
976  $cgui = new ilConfirmationGUI();
977  $cgui->setFormAction($this->ctrl->getFormAction($this, "setLPSync"));
978  $cgui->setHeaderText($this->lng->txt("crs_status_determination_sync"));
979  $cgui->setCancel($this->lng->txt("cancel"), "edit");
980  $cgui->setConfirm($this->lng->txt("confirm"), "setLPSync");
981  $this->tpl->setContent($cgui->getHTML());
982  }
+ 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 2839 of file class.ilObjCourseGUI.php.

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

Referenced by infoScreen().

2839  : string
2840  {
2841  $link = chr(13) . chr(10) . chr(13) . chr(10);
2842  $link .= $this->lng->txt('crs_mail_permanent_link');
2843  $link .= chr(13) . chr(10) . chr(13) . chr(10);
2844  $link .= ilLink::_getLink($this->object->getRefId());
2845  return rawurlencode(base64_encode($link));
2846  }
+ 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  }
editInfoObject(?ilPropertyFormGUI $a_form=null)
static http()
Fetches the global http state from ILIAS.
+ 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 2912 of file class.ilObjCourseGUI.php.

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

2912  : void
2913  {
2914  $user_id = null;
2915  if ($this->access->checkAccess('manage_members', '', $this->ref_id)) {
2916  $user_id = 0;
2917  if ($this->http->wrapper()->query()->has('member_id')) {
2918  $user_id = $this->http->wrapper()->query()->retrieve(
2919  'member_id',
2920  $this->refinery->kindlyTo()->int()
2921  );
2922  }
2923  }
2924  if (!$user_id) {
2925  $user_id = $this->user->getId();
2926  }
2927 
2928  $objId = $this->object->getId();
2929 
2930  $validator = new ilCertificateDownloadValidator();
2931 
2932  if (false === $validator->isCertificateDownloadable($user_id, $objId)) {
2933  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
2934  $this->ctrl->redirect($this);
2935  }
2936 
2937  $repository = new ilUserCertificateRepository();
2938 
2939  $pdfGenerator = new ilPdfGenerator($repository);
2940 
2941  $pdfAction = new ilCertificatePdfAction(
2942  $pdfGenerator,
2944  $this->lng->txt('error_creating_certificate_pdf')
2945  );
2946  $pdfAction->downloadPdf((int) $user_id, $objId);
2947  }
$objId
Definition: xapitoken.php:57
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 2612 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().

2612  : void
2613  {
2614  $this->setSubTabs("properties");
2615  $this->tabs_gui->activateTab('settings');
2616  $this->tabs_gui->activateSubTab('crs_map_settings');
2617 
2618  if (!ilMapUtil::isActivated() ||
2619  !$this->access->checkAccess("write", "", $this->object->getRefId())) {
2620  return;
2621  }
2622 
2623  $latitude = $this->object->getLatitude();
2624  $longitude = $this->object->getLongitude();
2625  $zoom = $this->object->getLocationZoom();
2626 
2627  // Get Default settings, when nothing is set
2628  if ($latitude == 0 && $longitude == 0 && $zoom == 0) {
2630  $latitude = $def["latitude"];
2631  $longitude = $def["longitude"];
2632  $zoom = $def["zoom"];
2633  }
2634 
2635  $form = new ilPropertyFormGUI();
2636  $form->setFormAction($this->ctrl->getFormAction($this));
2637  $form->setTitle($this->lng->txt("crs_map_settings"));
2638 
2639  // enable map
2640  $public = new ilCheckboxInputGUI(
2641  $this->lng->txt("crs_enable_map"),
2642  "enable_map"
2643  );
2644  $public->setValue("1");
2645  $public->setChecked($this->object->getEnableCourseMap());
2646  $form->addItem($public);
2647 
2648  // map location
2649  $loc_prop = new ilLocationInputGUI(
2650  $this->lng->txt("crs_map_location"),
2651  "location"
2652  );
2653  $loc_prop->setLatitude((float) $latitude);
2654  $loc_prop->setLongitude((float) $longitude);
2655  $loc_prop->setZoom((int) $zoom);
2656  $form->addItem($loc_prop);
2657 
2658  $form->addCommandButton("saveMapSettings", $this->lng->txt("save"));
2659 
2660  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
2661  //$this->tpl->show();
2662  }
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 993 of file class.ilObjCourseGUI.php.

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

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

◆ executeCommand()

ilObjCourseGUI::executeCommand ( )

Definition at line 2040 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, null, 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().

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

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

1811  : void
1812  {
1813  if ($this->access->checkAccess('visible', '', $this->ref_id)) {
1814  $this->tabs->addTarget(
1815  "info_short",
1816  $this->ctrl->getLinkTargetByClass(
1817  array("ilobjcoursegui", "ilinfoscreengui"),
1818  "showSummary"
1819  ),
1820  "infoScreen"
1821  );
1822  }
1823  if (
1824  $this->access->checkAccess('leave', '', $this->object->getRefId()) &&
1825  $this->object->getMemberObject()->isMember()
1826  ) {
1827  $this->tabs->addTarget(
1828  "crs_unsubscribe",
1829  $this->ctrl->getLinkTarget($this, "unsubscribe"),
1830  'leave',
1831  ""
1832  );
1833  }
1834  }
+ 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 1009 of file class.ilObjCourseGUI.php.

1009  : array
1010  {
1011  return [];
1012  }

◆ 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 3080 of file class.ilObjCourseGUI.php.

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

Referenced by executeCommand().

3080  : array
3081  {
3082  $crs_admin = $this->object->getDefaultAdminRole();
3083  $crs_member = $this->object->getDefaultMemberRole();
3084  $local_roles = $this->object->getLocalCourseRoles(false);
3085  $crs_roles = [];
3086 
3087  //put the course member role to the top of the crs_roles array
3088  if (in_array($crs_member, $local_roles)) {
3089  #$crs_roles[$crs_member] = ilObjRole::_getTranslation(array_search ($crs_member, $local_roles));
3090  #unset($local_roles[$crs_roles[$crs_member]]);
3091  }
3092 
3093  foreach ($local_roles as $title => $role_id) {
3094  if ($role_id == $crs_admin && !$this->hasAdminPermission()) {
3095  continue;
3096  }
3097 
3098  $crs_roles[$role_id] = ilObjRole::_getTranslation($title);
3099  }
3100 
3101  if ($a_exclude !== []) {
3102  foreach ($a_exclude as $excluded_role) {
3103  if (isset($crs_roles[$excluded_role])) {
3104  unset($crs_roles[$excluded_role]);
3105  }
3106  }
3107  }
3108  return $crs_roles;
3109  }
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 954 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().

954  : array
955  {
956  $subs = array(
966  );
967  if ($this->news->isGloballyActivated()) {
969  }
970 
971  return $subs;
972  }
+ Here is the caller graph for this function:

◆ getTabs()

ilObjCourseGUI::getTabs ( )
protected

Definition at line 1845 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().

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

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

Referenced by getLocalRoles().

3111  : bool
3112  {
3113  return
3114  ilCourseParticipant::_getInstanceByObjId($this->object->getId(), $this->user->getId())->isAdmin() ||
3115  $this->checkPermissionBool('edit_permission');
3116  }
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(), ILIAS\UICore\GlobalTemplate\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(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), ilAdvancedMDRecordGUI\setInfoObject(), ILIAS\UICore\GlobalTemplate\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  }
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
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.
static getLinkTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _readFilesByCourse(int $a_course_id)
ilAdvancedMDRecordGUI $record_gui
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
const IL_CAL_UNIX
setVariable(string $variable, $value='')
Sets the given variable to the given value.
$c
Definition: deliver.php:25
GUI class for public user profile presentation.
ilGlobalTemplateInterface $tpl
createMailSignature()
Create a course mail signature.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
$txt
Definition: error.php:31
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static _getInstanceByType(string $a_type)
Get Singleton Instance.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
setInfoObject(ilInfoScreenGUI $info)
get info sections
static makeClickable(string $a_text, bool $detectGotoLinks=false)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
+ 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 1014 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(), ilNumberInputGUI\setMinValue(), 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().

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

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

2848  : ?ilObjectListGUI
2849  {
2850  $lg = parent::initHeaderAction($sub_type, $sub_id);
2851 
2852  if ($lg && $this->ref_id && ilCourseParticipants::_isParticipant($this->ref_id, $this->user->getId())) {
2853  // certificate
2854 
2855  $validator = new ilCertificateDownloadValidator();
2856  if ($validator->isCertificateDownloadable($this->user->getId(), $this->object->getId())) {
2857  $cert_url = $this->ctrl->getLinkTarget($this, "deliverCertificate");
2858 
2859  $this->lng->loadLanguageModule("certificate");
2860  $lg->addCustomCommand($cert_url, "download_certificate");
2861 
2862  $lg->addHeaderIcon(
2863  "cert_icon",
2864  ilUtil::getImagePath("standard/icon_cert.svg"),
2865  $this->lng->txt("download_certificate"),
2866  null,
2867  null,
2868  $cert_url
2869  );
2870  }
2871 
2872  // notification
2873  if (ilMembershipNotifications::isActiveForRefId($this->ref_id)) {
2874  $noti = new ilMembershipNotifications($this->ref_id);
2875  if (!$noti->isCurrentUserActive()) {
2876  $lg->addHeaderIcon(
2877  "not_icon",
2878  ilUtil::getImagePath("object/notification_off.svg"),
2879  $this->lng->txt("crs_notification_deactivated")
2880  );
2881 
2882  $this->ctrl->setParameter($this, "crs_ntf", 1);
2883  $caption = "crs_activate_notification";
2884  } else {
2885  $lg->addHeaderIcon(
2886  "not_icon",
2887  ilUtil::getImagePath("object/notification_on.svg"),
2888  $this->lng->txt("crs_notification_activated")
2889  );
2890 
2891  $this->ctrl->setParameter($this, "crs_ntf", 0);
2892  $caption = "crs_deactivate_notification";
2893  }
2894 
2895  if ($noti->canCurrentUserEdit()) {
2896  $lg->addCustomCommand(
2897  $this->ctrl->getLinkTarget($this, "saveNotification"),
2898  $caption
2899  );
2900  }
2901 
2902  $this->ctrl->setParameter($this, "crs_ntf", "");
2903  }
2904  }
2905 
2906  return $lg;
2907  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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.
Membership notification settings.
+ Here is the call graph for this function:

◆ initInfoEditor()

ilObjCourseGUI::initInfoEditor ( )

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

References ilContainerGUI\$form, 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)
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 3118 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl().

3118  : void
3119  {
3120  $this->ctrl->redirectByClass(ilUsersGalleryGUI::class);
3121  }
+ Here is the call graph for this function:

◆ leaveObject()

ilObjCourseGUI::leaveObject ( )

Definition at line 1771 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().

1771  : void
1772  {
1773  $this->checkPermission('leave');
1774 
1775  if ($this->object->getMembersObject()->isLastAdmin($this->user->getId())) {
1776  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('crs_min_one_admin'));
1777  $this->viewObject();
1778  return;
1779  }
1780 
1781  $this->tabs_gui->setTabActive('crs_unsubscribe');
1782  $cgui = new ilConfirmationGUI();
1783  $cgui->setHeaderText($this->lng->txt('crs_unsubscribe_sure'));
1784  $cgui->setFormAction($this->ctrl->getFormAction($this));
1785  $cgui->setCancel($this->lng->txt("cancel"), "cancel");
1786  $cgui->setConfirm($this->lng->txt("crs_unsubscribe"), "performUnsubscribe");
1787  $this->tpl->setContent($cgui->getHTML());
1788  }
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 2543 of file class.ilObjCourseGUI.php.

References ILIAS\Repository\ctrl().

Referenced by autoFillObject().

2543  : void
2544  {
2545  $this->ctrl->redirectByClass('ilcoursemembershipgui');
2546  }
+ 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 2697 of file class.ilObjCourseGUI.php.

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

2697  : void
2698  {
2700  $a_item_list_gui,
2701  'ilcoursecontentgui',
2702  $a_item_data,
2703  $this->object->getAboStatus(),
2704  $this->object->getRefId(),
2705  $this->object->getId()
2706  );
2707  }
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 1795 of file class.ilObjCourseGUI.php.

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

1796  {
1797  $this->checkPermission('leave');
1798  $this->getObject()->getMembersObject()->delete($this->user->getId());
1799  $this->getObject()->getMembersObject()->sendUnsubscribeNotificationToAdmins($this->user->getId());
1800  $this->getObject()->getMembersObject()->sendNotification(
1802  $this->user->getId()
1803  );
1804  $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_unsubscribed_from_crs'), true);
1805 
1806  $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->tree->getParentId($this->ref_id));
1807  $this->ctrl->redirectByClass("ilrepositorygui", "");
1808  }
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 1634 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, null, ILIAS\Repository\object(), and ilObjCourse\STATUS_DETERMINATION_LP.

1634  : array
1635  {
1636  $show_tracking =
1637  (
1640  );
1641  if ($show_tracking) {
1642  $olp = ilObjectLP::getInstance($this->object->getId());
1643  $show_tracking = $olp->isActive();
1644  }
1645 
1646  if ($show_tracking) {
1647  $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
1648  $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
1649  $failed = ilLPStatusWrapper::_lookupFailedForObject($this->object->getId());
1650  }
1651  $privacy = ilPrivacySettings::getInstance();
1652 
1653  if ($privacy->enabledCourseAccessTimes()) {
1654  $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
1655  }
1656 
1657  $do_prtf = (is_array($selected_columns) &&
1658  in_array('prtf', $selected_columns) &&
1659  is_array($ids));
1660  if ($do_prtf) {
1662  $ids,
1663  $this->ctrl->getLinkTarget($this, "members")
1664  );
1665  }
1666 
1667  $members = [];
1668  foreach ($ids as $usr_id) {
1676  if (!$skip_names) {
1677  $name = ilObjUser::_lookupName($usr_id);
1678  $tmp_data['firstname'] = $name['firstname'];
1679  $tmp_data['lastname'] = $name['lastname'];
1680  $tmp_data['login'] = $name['login'];
1681  }
1682  $tmp_data['passed'] = $this->object->getMembersObject()->hasPassed($usr_id) ? 1 : 0;
1683  if ($this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) {
1684  $tmp_data['passed_info'] = $this->object->getMembersObject()->getPassedInfo($usr_id);
1685  }
1686  $tmp_data['notification'] = $this->object->getMembersObject()->isNotificationEnabled($usr_id) ? 1 : 0;
1687  $tmp_data['blocked'] = $this->object->getMembersObject()->isBlocked($usr_id) ? 1 : 0;
1688  $tmp_data['contact'] = $this->object->getMembersObject()->isContact($usr_id) ? 1 : 0;
1689 
1690  $tmp_data['usr_id'] = $usr_id;
1691 
1692  if ($show_tracking) {
1693  if (in_array($usr_id, $completed)) {
1694  $tmp_data['progress'] = ilLPStatus::LP_STATUS_COMPLETED;
1695  } elseif (in_array($usr_id, $in_progress)) {
1696  $tmp_data['progress'] = ilLPStatus::LP_STATUS_IN_PROGRESS;
1697  } elseif (in_array($usr_id, $failed)) {
1698  $tmp_data['progress'] = ilLPStatus::LP_STATUS_FAILED;
1699  } else {
1700  $tmp_data['progress'] = ilLPStatus::LP_STATUS_NOT_ATTEMPTED;
1701  }
1702  }
1703 
1704  if ($privacy->enabledCourseAccessTimes()) {
1705  if (isset($progress[$usr_id]['ts']) && $progress[$usr_id]['ts']) {
1706  $tmp_data['access_ut'] = $progress[$usr_id]['ts'];
1707  $tmp_data['access_time'] = ilDatePresentation::formatDate(new ilDateTime(
1708  $progress[$usr_id]['ts'],
1709  IL_CAL_UNIX
1710  ));
1711  } else {
1712  $tmp_data['access_ut'] = 0;
1713  $tmp_data['access_time'] = $this->lng->txt('no_date');
1714  }
1715  }
1716 
1717  if ($do_prtf) {
1718  $tmp_data['prtf'] = $all_prtf[$usr_id] ?? null;
1719  }
1720 
1721  $members[$usr_id] = $tmp_data;
1722  }
1723  return $members;
1724  }
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)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const LP_STATUS_FAILED
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
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 3054 of file class.ilObjCourseGUI.php.

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

Referenced by redirectLocToTestObject().

3054  : void
3055  {
3056  $confirm = new ilConfirmationGUI();
3057  $confirm->setFormAction($GLOBALS['DIC']['ilCtrl']->getFormAction($this));
3058 
3059  if ($a_objective_id) {
3060  $question = $this->lng->txt('crs_loc_objective_passed_confirmation');
3061  } else {
3062  $question = $this->lng->txt('crs_loc_objectives_passed_confirmation');
3063  }
3064 
3065  $confirm->setHeaderText($question);
3066  $confirm->addHiddenItem('objective_id', (string) $a_objective_id);
3067  $confirm->addHiddenItem('tid', (string) $a_test_id);
3068  $confirm->setConfirm($this->lng->txt('crs_loc_tst_start'), 'redirectLocToTestConfirmed');
3069  $confirm->setCancel($this->lng->txt('cancel'), 'view');
3070 
3071  //$this->tpl->setOnScreenMessage('question', $question);
3072  $this->tpl->setContent($confirm->getHTML());
3073  }
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:53
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectLocToTestConfirmedObject()

ilObjCourseGUI::redirectLocToTestConfirmedObject ( )
protected

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

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

2986  : void
2987  {
2988  $tid = 0;
2989  if ($this->http->wrapper()->query()->has('tid')) {
2990  $tid = $this->http->wrapper()->query()->retrieve(
2991  'tid',
2992  $this->refinery->kindlyTo()->int()
2993  );
2994  } elseif ($this->http->wrapper()->post()->has('tid')) {
2995  $tid = $this->http->wrapper()->post()->retrieve(
2996  'tid',
2997  $this->refinery->kindlyTo()->int()
2998  );
2999  }
3000  ilUtil::redirect(ilLink::_getLink($tid));
3001  }
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 3003 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().

3003  : void
3004  {
3005  $tid = 0;
3006  if ($this->http->wrapper()->query()->has('tid')) {
3007  $tid = $this->http->wrapper()->query()->retrieve(
3008  'tid',
3009  $this->refinery->kindlyTo()->int()
3010  );
3011  }
3012  $objective_id = 0;
3013  if ($this->http->wrapper()->query()->has('objective_id')) {
3014  $objective_id = $this->http->wrapper()->query()->retrieve(
3015  'objective_id',
3016  $this->refinery->kindlyTo()->int()
3017  );
3018  }
3019 
3020  $res = new ilLOUserResults(
3021  $this->object->getId(),
3022  $this->user->getId()
3023  );
3024  $passed = $res->getCompletedObjectiveIds();
3025 
3026  $has_completed = false;
3027  if ($objective_id) {
3028  $objective_ids = array($objective_id);
3029  if (in_array($objective_id, $passed)) {
3030  $has_completed = true;
3031  $passed = array();
3032  }
3033  } else {
3034  $objective_ids = ilCourseObjective::_getObjectiveIds($this->object->getId(), true);
3035 
3036  // do not disable objective question if all are passed
3037  if (count($objective_ids) === count($passed)) {
3038  $has_completed = true;
3039  $passed = array();
3040  }
3041  }
3042 
3043  if ($has_completed) {
3044  // show confirmation
3045  $this->redirectLocToTestConfirmation($objective_id, $tid);
3046  return;
3047  }
3048  ilUtil::redirect(ilLink::_getLink($tid));
3049  }
$res
Definition: ltiservices.php:66
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 1595 of file class.ilObjCourseGUI.php.

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

Referenced by showPossibleSubObjects().

1595  : void
1596  {
1597  $createble_object_types = $this->getCreatableObjectTypes();
1598 
1599  foreach ($disabled_object_types as $type) {
1600  unset($createble_object_types[$type]);
1601  }
1602 
1604  $this->buildAddNewItemElements($createble_object_types)
1605  );
1606  $gui->render();
1607  }
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 2802 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().

2802  : void
2803  {
2804  $usr_results = new ilLOUserResults($this->object->getId(), $GLOBALS['DIC']['ilUser']->getId());
2805  $usr_results->delete();
2807  $this->object->getId(),
2808  $GLOBALS['DIC']['ilUser']->getId()
2809  );
2810 
2811  $tmp_obj_res = new ilCourseObjectiveResult($this->user->getId());
2812  $tmp_obj_res->reset($this->object->getId());
2813 
2814  $this->user->deletePref('crs_objectives_force_details_' . $this->object->getId());
2815  $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_objectives_reseted'));
2816  $this->viewObject();
2817  }
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions" ...
$GLOBALS["DIC"]
Definition: wac.php:53
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 2667 of file class.ilObjCourseGUI.php.

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

2667  : void
2668  {
2669  $location = [];
2670  if ($this->http->wrapper()->post()->has('location')) {
2671  $custom_transformer = $this->refinery->custom()->transformation(
2672  fn($array) => $array
2673  );
2674  $location = $this->http->wrapper()->post()->retrieve(
2675  'location',
2676  $custom_transformer
2677  );
2678  }
2679  $enable_map = false;
2680  if ($this->http->wrapper()->post()->has('enable_map')) {
2681  $enable_map = $this->http->wrapper()->post()->retrieve(
2682  'enable_map',
2683  $this->refinery->kindlyTo()->bool()
2684  );
2685  }
2686  $this->object->setLatitude($location['latitude']);
2687  $this->object->setLongitude($location['longitude']);
2688  $this->object->setLocationZoom($location['zoom']);
2689  $this->object->setEnableCourseMap($enable_map);
2690  $this->object->update();
2691  $this->ctrl->redirect($this, "editMapSettings");
2692  }
$location
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.
Membership notification settings.
+ Here is the call graph for this function:

◆ saveSortingObject()

ilObjCourseGUI::saveSortingObject ( )

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

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

2954  : void
2955  {
2956  $post_position = (array) ($this->http->request()->getParsedBody()['position'] ?? []);
2957  if (isset($post_position['lobj'])) {
2958  $lobj = $post_position['lobj'];
2959  $objective_order = array();
2960  foreach ($lobj as $objective_id => $materials) {
2961  $objective_order[$objective_id] = $materials[0];
2962  unset($lobj[$objective_id][0]);
2963  }
2964  // objective order
2965  asort($objective_order);
2966  $pos = 0;
2967  foreach (array_keys($objective_order) as $objective_id) {
2968  $obj = new ilCourseObjective($this->object, $objective_id);
2969  $obj->writePosition(++$pos);
2970  }
2971 
2972  // material order
2973  foreach ($lobj as $objective_id => $materials) {
2974  $objmat = new ilCourseObjectiveMaterials($objective_id);
2975 
2976  asort($materials);
2977  $pos = 0;
2978  foreach (array_keys($materials) as $ass_id) {
2979  $objmat->writePosition($ass_id, ++$pos);
2980  }
2981  }
2982  }
2983  parent::saveSortingObject();
2984  }
class ilCourseObjectiveMaterials
static http()
Fetches the global http state from ILIAS.
class ilcourseobjective
+ Here is the call graph for this function:

◆ sendFileObject()

ilObjCourseGUI::sendFileObject ( )

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

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

1468  : void
1469  {
1470  $file_id = 0;
1471  if ($this->http->wrapper()->query()->has('file_id')) {
1472  $file_id = $this->http->wrapper()->query()->retrieve(
1473  'file_id',
1474  $this->refinery->kindlyTo()->int()
1475  );
1476  }
1477  $file = new ilCourseFile($file_id);
1478  ilFileDelivery::deliverFileLegacy($file->getAbsolutePath(), $file->getFileName(), $file->getFileType());
1479  }
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 2746 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().

2746  : void
2747  {
2748  global $DIC;
2749 
2750  $ilAccess = $DIC['ilAccess'];
2751  $lng = $DIC['lng'];
2752  $ilCtrl = $DIC['ilCtrl'];
2753 
2754  if ($this->object->getType() != 'crs') {
2755  return;
2756  }
2757  if (!$this->access->checkAccess(
2758  'write',
2759  '',
2760  $this->object->getRefId(),
2761  'crs',
2762  $this->object->getId()
2763  )) {
2764  $is_tutor = false;
2765  // No further tabs if objective view or archives
2766  if ($this->object->enabledObjectiveView()) {
2767  return;
2768  }
2769  } else {
2770  $is_tutor = true;
2771  }
2772 
2773  if (!$this->isActiveAdministrationPanel()) {
2774  $this->tabs_gui->addSubTab(
2775  "view_content",
2776  $lng->txt("view"),
2777  $this->ctrl->getLinkTargetByClass("ilobjcoursegui", "view")
2778  );
2779  } else {
2780  $this->tabs_gui->addSubTab(
2781  "view_content",
2782  $lng->txt("view"),
2783  $this->ctrl->getLinkTargetByClass("ilobjcoursegui", "disableAdministrationPanel")
2784  );
2785  }
2786  //}
2787 
2788  $this->addStandardContainerSubTabs(false);
2789  }
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:22
+ Here is the call graph for this function:

◆ setLPSyncObject()

ilObjCourseGUI::setLPSyncObject ( )
protected

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

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

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

◆ setSideColumnReturn()

ilObjCourseGUI::setSideColumnReturn ( )

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

References ILIAS\Repository\ctrl().

3126  : void
3127  {
3128  $this->ctrl->setReturn($this, "view");
3129  }
+ Here is the call graph for this function:

◆ setSubTabs()

ilObjCourseGUI::setSubTabs ( string  $a_tab)

Definition at line 1481 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().

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

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

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

◆ unsubscribeObject()

ilObjCourseGUI::unsubscribeObject ( )

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

References leaveObject().

1790  : void
1791  {
1792  $this->leaveObject();
1793  }
+ 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(), ILIAS\UICore\GlobalTemplate\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  }
editInfoObject(?ilPropertyFormGUI $a_form=null)
setMessage(string $a_message)
getItemByPostVar(string $a_post_var)
static getValidFilename(string $a_filename)
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
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 1729 of file class.ilObjCourseGUI.php.

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

1729  : void
1730  {
1732  $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) {
1733  $olp = ilObjectLP::getInstance($this->object->getId());
1734  if ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_MANUAL_BY_TUTOR) {
1735  $marks = new ilLPMarks($this->object->getId(), $a_member_id);
1736 
1737  // only if status has changed
1738  if ($marks->getCompleted() !== $a_has_passed) {
1739  $marks->setCompleted($a_has_passed);
1740  $marks->update();
1741 
1742  // as course is origin of LP status change, block syncing
1744  ilLPStatusWrapper::_updateStatus($this->object->getId(), $a_member_id);
1745  }
1746  }
1747  }
1748  }
const STATUS_DETERMINATION_LP
static setBlockedForLP(bool $a_status)
Toggle LP blocking property 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  $old_autofill = $this->object->hasWaitingListAutoFill();
823  switch ((int) $form->getInput('waiting_list')) {
824  case 2:
825  $this->object->enableWaitingList(true);
826  $this->object->setWaitingListAutoFill(true);
827  break;
828 
829  case 1:
830  $this->object->enableWaitingList(true);
831  $this->object->setWaitingListAutoFill(false);
832  break;
833 
834  default:
835  $this->object->enableWaitingList(false);
836  $this->object->setWaitingListAutoFill(false);
837  break;
838  }
839  $this->object->handleAutoFill();
840 
841  $property_online = $this->object->getObjectProperties()->getPropertyIsOnline();
842  $online = $form->getInput('activation_online') ? $property_online->withOnline() : $property_online->withOffline();
843  $this->object->getObjectProperties()->storePropertyIsOnline($online);
844 
845  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTitleIconVisibility();
846  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTopActionsVisibility();
847  ilContainer::_writeContainerSetting($this->object->getId(), "rep_breacrumb", $form->getInput('rep_breacrumb'));
848  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveIcon();
849  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
850  $this->saveListPresentation($form);
851 
852  $this->object->setViewMode((int) $form->getInput('view_mode'));
853  if ($this->object->getViewMode() == ilCourseConstants::IL_CRS_VIEW_TIMING) {
854  $this->object->setOrderType(ilContainer::SORT_ACTIVATION);
855  $this->object->setTimingMode((int) $form->getInput('timing_mode'));
856  }
857  $this->object->setTimingMode((int) $form->getInput('timing_mode'));
858  $this->object->setOrderType((int) $form->getInput('sorting'));
859  $this->saveSortingSettings($form);
860 
861  $this->log->debug(
862  "\n\n\nValue: " . (int) $form->getInput('tutorial_support_block_checkbox') . "\n\n\n"
863  );
864  $this->object->setTutorialSupportBlockSettingValue(
865  (int) $form->getInput('tutorial_support_block_checkbox')
866  );
867 
868  $this->object->setAboStatus((bool) $form->getInput('abo'));
869  $this->object->setShowMembers((bool) $form->getInput('show_members'));
870 
871  if (\ilPrivacySettings::getInstance()->participantsListInCoursesEnabled()) {
872  $this->object->setShowMembersExport((bool) $form->getInput('show_members_export'));
873  }
874  $this->object->setMailToMembersType((int) $form->getInput('mail_type'));
875 
876  $this->object->enableSessionLimit((int) $form->getInput('sl'));
877 
878  $session_sp = $form->getInput('sp');
879  $this->object->setNumberOfPreviousSessions(is_numeric($session_sp) ? (int) $session_sp : -1);
880  $session_sn = $form->getInput('sn');
881  $this->object->setNumberOfnextSessions(is_numeric($session_sn) ? (int) $session_sn : -1);
882  $this->object->setAutoNotification($form->getInput('auto_notification') == 1 ? true : false);
883 
884  // lp sync
885  $show_lp_sync_confirmation = false;
886 
887  // could be hidden in form
888  if ($this->http->wrapper()->post()->has('status_dt')) {
889  $status_dt = $this->http->wrapper()->post()->retrieve(
890  'status_dt',
891  $this->refinery->kindlyTo()->int()
892  );
893  if (
894  $this->object->getStatusDetermination() != ilObjCourse::STATUS_DETERMINATION_LP &&
896  ) {
897  $show_lp_sync_confirmation = true;
898  } else {
899  $this->object->setStatusDetermination($status_dt);
900  }
901  }
902 
903  if (!$old_autofill && $this->object->hasWaitingListAutoFill()) {
904  $this->object->handleAutoFill();
905  }
906  $this->object->update();
907 
909  $this->object->getId(),
910  $form,
911  $this->getSubServices()
912  );
913 
914  ilChangeEvent::_recordWriteEvent($this->object->getId(), $this->user->getId(), 'update');
915  ilChangeEvent::_catchupWriteEvents($this->object->getId(), $this->user->getId());
916 
917  // lp sync confirmation required
918  if ($show_lp_sync_confirmation) {
919  $this->confirmLPSync();
920  return;
921  }
922 
923  // Update ecs export settings
924  $ecs = new ilECSCourseSettings($this->object);
925  if (!$ecs->handleSettingsUpdate($form)) {
927  $this->tpl->setOnScreenMessage('failure', $GLOBALS['DIC']->language()->txt('err_check_input'));
928  $this->editObject($form);
929  return;
930  }
931 
932  // 29589
933  if (
934  $sub_type === ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED &&
935  (
936  !is_null($sub_period->getStart()) ||
937  !is_null($sub_period->getEnd())
938  )
939  ) {
940  $this->tpl->setOnScreenMessage(
941  'failure',
942  $this->lng->txt('crs_msg_no_self_registration_period_if_self_enrolment_disabled'),
943  true
944  );
946  $this->tpl->setOnScreenMessage('failure', $GLOBALS['DIC']->language()->txt('err_check_input'));
947  $this->editObject($form);
948  return;
949  }
950 
951  $this->afterUpdate();
952  }
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:53
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:41
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: