5 require_once(
"./Services/Container/classes/class.ilContainerGUI.php");
6 require_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
7 require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
8 require_once(
"./Services/AccessControl/classes/class.ilPermissionGUI.php");
9 require_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
10 require_once(
"./Services/Object/classes/class.ilObjectAddNewItemGUI.php");
11 require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgrammeTreeGUI.php");
12 require_once(
'./Services/Container/classes/class.ilContainerSortingSettings.php');
13 require_once(
"./Modules/StudyProgramme/classes/types/class.ilStudyProgrammeTypeGUI.php");
14 require_once(
"./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php");
15 require_once(
"./Services/Object/classes/class.ilObjectCopyGUI.php");
16 require_once(
"./Services/Repository/classes/class.ilRepUtil.php");
134 $ilCtrl = $DIC[
'ilCtrl'];
135 $ilToolbar = $DIC[
'ilToolbar'];
137 $tree = $DIC[
'tree'];
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()
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()
478 $this->tpl->setContent($form->getHTML());
485 $this->ctrl->redirect($this);
492 $this->object->getId(),
494 $this->
object->getSettings()->getTypeSettings()->getTypeId()
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"),
583 $this->tabs_gui->addTab(
585 $this->lng->txt(
"settings"),
591 $this->tabs_gui->addTab(
593 $this->lng->txt(
"assignments"),
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) {
619 case self::TAB_VIEW_CONTENT:
620 case self::SUBTAB_VIEW_TREE:
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"),
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()
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')
Class ilPdfGeneratorConstantsTest.
Class ilObjStudyProgrammeGUI class.
denyAccessIfNotAnyOf(array $permissions)
setPropertyForm($form)
set property form object
static init($a_main_tpl=null)
Init JS.
checkAccess(string $permission)
deliverCertificateObject()
static _goto($a_target)
_goto Deep link
getSubTabs($a_parent_tab)
Adds subtabs based on the parent tab.
const SORT_NEW_ITEMS_POSITION_BOTTOM
static encodeAsyncResponse(array $data=array())
Encode data as json for async output.
denyAccessIfNot(string $permission)
setInfoObject($info)
get info sections
getId()
get object id public
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...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
const SORT_NEW_ITEMS_ORDER_CREATION
Validates if an active certificate is stored in the database and can be downloaded by the user...
initHeaderAction($a_sub_type=null, $a_sub_id=null)
redirection script todo: (a better solution should control the processing via a xml file) ...
isActiveAdministrationPanel()
initCreateForm($a_new_type)
Init object creation form.
static specificDicFor(\ilObjStudyProgramme $prg)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Both role and OrgU-based permissions are relevant in many places of the PRG.
Just a wrapper class to create Unit Test for other classes.
setContentSubTabs()
Disable default content subtabs.
fillInfoScreen($a_info_screen)
Adding meta-data to the info-screen.
__construct(Container $dic, ilPlugin $plugin)
getCreationMode()
get creation mode
getRefId()
get reference id public
afterSave(ilObject $a_new_object)
Sets the sorting of the container correctly.
initCreationForms($a_new_type)
Overwritten from ilObjectGUI since copy and import are not implemented.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
initAdvancedSettingsForm()
static redirect($a_script)
addHeaderAction()
Add header action menu.
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for object translation handling.
static handleAsyncOutput($normal_content, $async_content=null, $apply_to_tpl=true)
Handles async output.
downloadPdf(int $userId, int $objectId)