5require_once(
"./Services/Container/classes/class.ilContainerGUI.php");
6require_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
7require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
8require_once(
"./Services/AccessControl/classes/class.ilPermissionGUI.php");
9require_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
10require_once(
"./Services/Object/classes/class.ilObjectAddNewItemGUI.php");
11require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgrammeTreeGUI.php");
12require_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
13require_once(
"./Modules/StudyProgramme/classes/types/class.ilStudyProgrammeTypeGUI.php");
14require_once(
"./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php");
15require_once(
"./Services/Object/classes/class.ilObjectCopyGUI.php");
16require_once(
"./Services/Repository/classes/class.ilRepUtil.php");
134 $ilCtrl =
$DIC[
'ilCtrl'];
135 $ilToolbar =
$DIC[
'ilToolbar'];
141 $ilHelp =
$DIC[
'ilHelp'];
147 $this->ctrl = $ilCtrl;
150 $this->toolbar = $ilToolbar;
154 $this->
help = $ilHelp;
157 $lng->loadLanguageModule(
"prg");
171 $cmd = $this->ctrl->getCmd();
172 $next_class = $this->ctrl->getNextClass($this);
180 parent::prepareOutput();
184 switch ($next_class) {
185 case "ilinfoscreengui":
186 $this->tabs_gui->activateTab(self::TAB_INFO);
193 $this->ctrl->forwardCommand($info);
204 case 'ilpermissiongui':
205 $this->tabs_gui->activateTab(
'perm_settings');
207 $this->ctrl->forwardCommand($ilPermissionGUI);
209 case "ilcommonactiondispatchergui":
210 require_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
212 $this->ctrl->forwardCommand($gui);
214 case "ilobjstudyprogrammesettingsgui":
217 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
218 $this->tabs_gui->activateSubTab(
'settings');
219 $this->settings_gui->setRefId($this->ref_id);
220 $this->ctrl->forwardCommand($this->settings_gui);
223 case "ilobjstudyprogrammeautocategoriesgui":
226 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
227 $this->tabs_gui->activateSubTab(
'auto_content');
228 $this->autocategories_gui->setRefId($this->ref_id);
230 $this->ctrl->forwardCommand($this->autocategories_gui);
233 case "ilobjstudyprogrammemembersgui":
237 $this->tabs_gui->activateTab(self::TAB_MEMBERS);
238 $this->tabs_gui->activateSubTab(
'edit_participants');
240 $this->members_gui->setParentGUI($this);
241 $this->members_gui->setRefId($this->ref_id);
242 $this->ctrl->forwardCommand($this->members_gui);
246 case "ilobjstudyprogrammeautomembershipsgui":
250 $this->tabs_gui->activateTab(self::TAB_MEMBERS);
251 $this->tabs_gui->activateSubTab(
'auto_memberships');
253 $this->memberships_gui->setParentGUI($this);
254 $this->memberships_gui->setRefId($this->ref_id);
255 $this->ctrl->forwardCommand($this->memberships_gui);
260 case "ilobjstudyprogrammetreegui":
265 $this->tabs_gui->activateTab(self::TAB_VIEW_CONTENT);
266 $this->tabs_gui->activateSubTab(self::SUBTAB_VIEW_TREE);
269 $_SESSION[
"il_cont_admin_panel"] =
false;
271 $this->tree_gui->setRefId($this->
id);
272 $this->ctrl->forwardCommand($this->tree_gui);
274 case 'ilstudyprogrammetypegui':
275 $this->tabs_gui->activateTab(
'subtypes');
277 $this->type_gui->setParentGUI($this);
278 $this->ctrl->forwardCommand($this->type_gui);
280 case 'ilobjectcopygui':
281 $gui =
new ilobjectcopygui($this);
282 $this->ctrl->forwardCommand($gui);
284 case 'ilobjecttranslationgui':
287 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
288 $this->tabs_gui->activateSubTab(
'settings_trans');
290 $this->ctrl->forwardCommand($transgui);
292 case "ilcertificategui":
295 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
296 $this->tabs_gui->activateSubTab(
'certificate');
298 $output_gui = $guiFactory->create($this->
object);
299 $this->ctrl->forwardCommand($output_gui);
301 case strtolower(ilPropertyFormGUI::class):
311 $this->object->getId(),
313 $this->object->getSettings()->getTypeSettings()->getTypeId()
315 $gui->setPropertyForm($form);
317 $this->ctrl->forwardCommand($form);
333 $this->tabs_gui->clearTargets();
334 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this));
335 parent::deleteObject();
337 case 'confirmedDelete':
338 parent::confirmedDeleteObject();
340 case 'editAdvancedSettings':
341 $this->tabs_gui->activateTab(
'edit_advanced_settings');
344 case 'updateAdvancedSettings':
345 $this->tabs_gui->activateTab(
'edit_advanced_settings');
349 $this->ctrl->redirectByClass(
"ilInfoScreenGUI",
"showSummary");
351 case 'getAsynchItemList':
352 parent::getAsynchItemListObject();
356 case 'confirmRemoveFromSystem':
357 case 'removeFromSystem':
358 case 'deliverCertificate':
360 case 'removeFromDesk':
365 throw new ilException(
"ilObjStudyProgrammeGUI: Command not supported: $cmd");
370 throw new ilException(
"ilObjStudyProgrammeGUI: Can't forward to next class $next_class");
377 parent::createObject();
382 parent::saveObject();
384 if ($this->ctrl->isAsynch()) {
386 $form->setValuesByPost();
398 parent::cancelCreation();
419 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
421 $this->ctrl->setParameter($this,
"ref_id", $a_new_object->
getRefId());
424 $this->ctrl->getLinkTarget($this,
"edit",
"",
false,
false)
430 if (!$this->permisssions) {
431 if (!$this->
object || !$this->object->getRefId()) {
432 throw new LogicException(
'Cannot ask for permission when not in tree!');
443 $this->tabs_gui->activateTab(self::TAB_VIEW_CONTENT);
444 parent::renderObject();
455 $form->setFormAction($this->ctrl->getFormAction($this));
456 $form->addCommandButton(
'updateAdvancedSettings', $this->lng->txt(
'save'));
457 $form->addCommandButton(
'editAdvancedSettings', $this->lng->txt(
'cancel'));
466 $this->ctrl->redirect($this);
472 $this->object->getId(),
474 $this->object->getSettings()->getTypeSettings()->getTypeId()
476 $gui->setPropertyForm($form);
478 $this->tpl->setContent($form->getHTML());
485 $this->ctrl->redirect($this);
492 $this->object->getId(),
494 $this->object->getSettings()->getTypeSettings()->getTypeId()
496 $gui->setPropertyForm($form);
499 if ($gui->importEditFormPostValues()) {
500 $gui->writeEditForm();
501 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
502 $this->ctrl->redirect($this,
'editAdvancedSettings');
504 $this->tpl->setContent($form->getHTML());
514 return array( self::CFORM_NEW => $this->
initCreateForm($a_new_type));
527 $asyncForm->cloneForm($tmp_forms[self::CFORM_NEW]);
528 $asyncForm->setAsync(
true);
552 $this->ctrl->redirectByClass(
'ilinfoscreengui',
'');
554 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_read"), $this->ilias->error_obj->WARNING);
569 $this->
help->setScreenIdComponent(
"prg");
571 $this->tabs_gui->addTab(self::TAB_VIEW_CONTENT, $this->lng->txt(
"content"), $this->getLinkTarget(
"view"));
575 $this->tabs_gui->addTab(
577 $this->lng->txt(
"info_short"),
578 $this->getLinkTarget(
"info_short")
583 $this->tabs_gui->addTab(
585 $this->lng->txt(
"settings"),
586 $this->getLinkTarget(
"settings")
591 $this->tabs_gui->addTab(
593 $this->lng->txt(
"assignments"),
594 $this->getLinkTarget(
"members")
598 if ($this->object->hasAdvancedMetadata()
601 $this->tabs_gui->addTab(
603 $this->lng->txt(
'meta_data'),
604 $this->ctrl->getLinkTarget($this,
'editAdvancedSettings')
618 switch ($a_parent_tab) {
623 $this->tabs_gui->addSubTab(self::TAB_VIEW_CONTENT, $this->lng->txt(
"view"), $this->getLinkTarget(
"view"));
627 $this->tabs_gui->addSubTab(self::SUBTAB_VIEW_TREE, $this->lng->txt(
"cntr_manage"), $this->getLinkTarget(self::SUBTAB_VIEW_TREE));
631 $this->tabs_gui->addSubTab(
'settings', $this->lng->txt(
'settings'), $this->getLinkTarget(
'settings'));
633 if ($this->object->isAutoContentApplicable()) {
634 $this->tabs_gui->addSubTab(
"auto_content", $this->lng->txt(
"content_automation"), $this->getLinkTarget(
"auto_content"));
637 $this->tabs_gui->addSubTab(
"settings_trans", $this->lng->txt(
"obj_multilinguality"), $this->ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
""));
641 if (
true === $validator->validate()) {
642 $this->tabs_gui->addSubTabTarget(
644 $this->ctrl->getLinkTargetByClass(
"ilcertificategui",
"certificateeditor"),
650 $this->tabs_gui->addSubTab(
652 $this->lng->txt(
"obj_features"),
653 $this->getLinkTarget(
"commonSettings")
658 $this->tabs_gui->addSubTab(
'edit_participants', $this->lng->txt(
'edit_participants'), $this->getLinkTarget(
'members'));
660 $this->tabs_gui->addSubTab(
'auto_memberships', $this->lng->txt(
'auto_memberships'), $this->getLinkTarget(
'memberships'));
685 if ($a_cmd ==
"info_short") {
686 return $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary");
688 if ($a_cmd ==
"settings") {
689 return $this->ctrl->getLinkTargetByClass(
"ilobjstudyprogrammesettingsgui",
"view");
691 if ($a_cmd ==
"auto_content") {
692 return $this->ctrl->getLinkTargetByClass(
"ilObjStudyProgrammeAutoCategoriesGUI",
"view");
695 if ($a_cmd == self::SUBTAB_VIEW_TREE) {
696 return $this->ctrl->getLinkTargetByClass(
"ilobjstudyprogrammetreegui",
"view");
698 if ($a_cmd ==
"members") {
699 return $this->ctrl->getLinkTargetByClass(
"ilobjstudyprogrammemembersgui",
"view");
701 if ($a_cmd ==
"memberships") {
702 return $this->ctrl->getLinkTargetByClass(
"ilobjstudyprogrammeautomembershipsgui",
"view");
704 if ($a_cmd ==
"subtypes") {
705 return $this->ctrl->getLinkTargetByClass(
"ilstudyprogrammetypegui",
"listTypes");
707 if ($a_cmd ==
"commonSettings") {
708 return $this->ctrl->getLinkTargetByClass(
710 "ilobjstudyprogrammesettingsgui",
711 "ilStudyProgrammeCommonSettingsGUI"
717 return $this->ctrl->getLinkTarget($this, $a_cmd);
728 if (!$this->object->getSettings()->getTypeSettings()->getTypeId() ||
730 ->getType($this->object->getSettings()->getTypeSettings()->getTypeId())
737 $this->object->getId(),
739 $this->object->getSettings()->getTypeSettings()->getTypeId()
741 $record_gui->setInfoObject($a_info_screen);
742 $record_gui->parse();
749 $link = $this->ctrl->getLinkTargetByClass(ilObjStudyProgrammeSettingsGUI::class,
'view');
750 $this->ctrl->redirectToURL($link);
759 public static function _goto($a_target)
762 $ilAccess =
$DIC[
'ilAccess'];
764 $ilCtrl =
$DIC[
'ilCtrl'];
765 $id = explode(
"_", $a_target);
766 $ilCtrl->initBaseClass(
"ilRepositoryGUI");
767 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id", $id[0]);
769 $ilCtrl->redirectByClass(array(
"ilRepositoryGUI",
"ilobjstudyprogrammegui" ),
"view");
775 $ilNavigationHistory =
$DIC[
'ilNavigationHistory'];
781 $ilNavigationHistory->addItem(
791 $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
793 if (
true === $validator->isCertificateDownloadable($this->user->getId(), $this->object->getId()) && $lg) {
794 $cert_url = $this->ctrl->getLinkTarget($this,
"deliverCertificate");
795 $this->lng->loadLanguageModule(
"certificate");
796 $lg->addCustomCommand($cert_url,
"download_certificate");
800 $this->lng->txt(
"download_certificate"),
814 $this->lng->loadLanguageModule(
'cert');
816 $user_id = (int) $this->
user->getId();
817 $obj_id = (int) $this->object->getId();
820 if (
false === $validator->isCertificateDownloadable($user_id,
$obj_id)) {
822 $this->ctrl->redirect($this);
825 $cert_logger =
$DIC->logger()->cert();
830 $this->lng->txt(
'error_creating_certificate_pdf')
832 $pdf_action->downloadPdf($user_id,
$obj_id);
An exception for terminatinating execution or to throw for unit testing.
static handleAsyncOutput($normal_content, $async_content=null, $apply_to_tpl=true)
Handles async output.
static encodeAsyncResponse(array $data=array())
Encode data as json for async output.
Validates if an active certificate is stored in the database and can be downloaded by the user.
Just a wrapper class to create Unit Test for other classes.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
const SORT_NEW_ITEMS_ORDER_CREATION
const SORT_NEW_ITEMS_POSITION_BOTTOM
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static init($a_main_tpl=null)
Init JS.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Class ilObjStudyProgrammeGUI class.
isActiveAdministrationPanel()
denyAccessIfNotAnyOf(array $permissions)
deliverCertificateObject()
initAdvancedSettingsForm()
getSubTabs($a_parent_tab)
Adds subtabs based on the parent tab.
executeCommand()
execute command note: this method is overwritten in all container objects
fillInfoScreen($a_info_screen)
Adding meta-data to the info-screen.
checkAccess(string $permission)
getLinkTarget($a_cmd)
Generates a link based on a cmd.
getAsyncCreationForm()
Method for implementing async windows-output Should be moved into core to enable async requests on cr...
getTabs()
common tabs for all container objects (should be called at the end of child getTabs() method
static _goto($a_target)
_goto Deep link
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add file manager link.
setContentSubTabs()
Disable default content subtabs.
denyAccessIfNot(string $permission)
initCreationForms($a_new_type)
Overwritten from ilObjectGUI since copy and import are not implemented.
afterSave(ilObject $a_new_object)
Sets the sorting of the container correctly.
initCreateForm($a_new_type)
Init object creation form.
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
getCreationMode()
get creation mode
addHeaderAction()
Add header action menu.
GUI class for object translation handling.
Class ilObject Basic functions for all objects.
getRefId()
get reference id @access public
getId()
get object id @access public
Both role and OrgU-based permissions are relevant in many places of the PRG.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static specificDicFor(\ilObjStudyProgramme $prg)
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ilPdfGeneratorConstantsTest.
redirection script todo: (a better solution should control the processing via a xml file)