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");
136 $ilToolbar =
$DIC[
'ilToolbar'];
142 $ilHelp =
$DIC[
'ilHelp'];
152 $this->toolbar = $ilToolbar;
156 $this->
help = $ilHelp;
159 $lng->loadLanguageModule(
"prg");
174 $cmd = $this->ctrl->getCmd();
175 $next_class = $this->ctrl->getNextClass($this);
183 parent::prepareOutput();
187 switch ($next_class) {
188 case "ilinfoscreengui":
189 $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);
315 $this->tabs_gui->clearTargets();
316 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this));
317 parent::deleteObject();
319 case 'confirmedDelete':
320 parent::confirmedDeleteObject();
322 case 'editAdvancedSettings':
323 $this->tabs_gui->activateTab(
"settings");
324 $this->tabs_gui->activateSubTab(
'edit_advanced_settings');
327 case 'updateAdvancedSettings':
328 $this->tabs_gui->activateTab(
"settings");
329 $this->tabs_gui->activateSubTab(
'edit_advanced_settings');
333 $this->ctrl->redirectByClass(
"ilInfoScreenGUI",
"showSummary");
335 case 'getAsynchItemList':
336 parent::getAsynchItemListObject();
340 case 'confirmRemoveFromSystem':
341 case 'removeFromSystem':
342 case 'deliverCertificate':
344 case 'removeFromDesk':
349 throw new ilException(
"ilObjStudyProgrammeGUI: Command not supported: $cmd");
354 throw new ilException(
"ilObjStudyProgrammeGUI: Can't forward to next class $next_class");
364 parent::createObject();
375 parent::saveObject();
377 if ($this->ctrl->isAsynch()) {
379 $form->setValuesByPost();
397 parent::cancelCreation();
421 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
423 $this->ctrl->setParameter($this,
"ref_id", $a_new_object->
getRefId());
426 $this->ctrl->getLinkTarget($this,
"edit",
"",
false,
false)
437 $this->tabs_gui->activateTab(self::TAB_VIEW_CONTENT);
438 parent::renderObject();
454 $form->setFormAction($this->ctrl->getFormAction($this));
455 $form->addCommandButton(
'updateAdvancedSettings', $this->lng->txt(
'save'));
456 $form->addCommandButton(
'editAdvancedSettings', $this->lng->txt(
'cancel'));
468 $this->ctrl->redirect($this);
474 $this->object->getId(),
476 $this->object->getTypeSettings()->getTypeId()
478 $gui->setPropertyForm($form);
480 $this->tpl->setContent($form->getHTML());
490 $this->ctrl->redirect($this);
497 $this->object->getId(),
499 $this->object->getTypeSettings()->getTypeId()
501 $gui->setPropertyForm($form);
504 if ($gui->importEditFormPostValues()) {
505 $gui->writeEditForm();
506 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
507 $this->ctrl->redirect($this,
'editAdvancedSettings');
509 $this->tpl->setContent($form->getHTML());
523 return array( self::CFORM_NEW => $this->
initCreateForm($a_new_type));
538 $asyncForm->cloneForm($tmp_forms[self::CFORM_NEW]);
539 $asyncForm->setAsync(
true);
555 $perm = array($a_perm);
556 if (!is_null($position_permission)) {
557 $position_permission = array($position_permission);
565 foreach ($a_perms as $perm) {
570 if (!is_null($position_permissions)) {
571 $ref_id = (int) $this->object->getRefId();
572 foreach ($position_permissions as $perm) {
581 $this->ctrl->redirectByClass(
'ilinfoscreengui',
'');
584 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_read"), $this->ilias->error_obj->WARNING);
599 $this->
help->setScreenIdComponent(
"prg");
601 $this->tabs_gui->addTab(self::TAB_VIEW_CONTENT, $this->lng->txt(
"content"), $this->getLinkTarget(
"view"));
605 $this->tabs_gui->addTab(
607 $this->lng->txt(
"info_short"),
608 $this->getLinkTarget(
"info_short")
613 $this->tabs_gui->addTab(
615 $this->lng->txt(
"settings"),
616 $this->getLinkTarget(
"settings")
624 (
int) $this->object->getRefId()
627 $this->tabs_gui->addTab(
629 $this->lng->txt(
"members"),
630 $this->getLinkTarget(
"members")
643 switch ($a_parent_tab) {
648 $this->tabs_gui->addSubTab(self::TAB_VIEW_CONTENT, $this->lng->txt(
"view"), $this->getLinkTarget(
"view"));
652 $this->tabs_gui->addSubTab(self::SUBTAB_VIEW_TREE, $this->lng->txt(
"cntr_manage"), $this->getLinkTarget(self::SUBTAB_VIEW_TREE));
656 case 'editAdvancedSettings':
657 $this->tabs_gui->addSubTab(
'settings', $this->lng->txt(
'settings'), $this->getLinkTarget(
'settings'));
659 if ($this->object->isAutoContentApplicable()) {
660 $this->tabs_gui->addSubTab(
"auto_content", $this->lng->txt(
"content_automation"), $this->getLinkTarget(
"auto_content"));
663 $this->tabs_gui->addSubTab(
"settings_trans", $this->lng->txt(
"obj_multilinguality"), $this->ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
""));
666 $sub_type_id = $this->
object->getTypeSettings()->getTypeId();
668 $type = $this->type_repository->readType($sub_type_id);
673 $this->type_repository->readAssignedAMDRecordIdsByType(
679 $this->tabs_gui->addSubTab(
'edit_advanced_settings', $this->lng->txt(
'meta_data'), $this->ctrl->getLinkTarget($this,
'editAdvancedSettings'));
682 if (
true === $validator->validate()) {
683 $this->tabs_gui->addSubTabTarget(
685 $this->ctrl->getLinkTargetByClass(
"ilcertificategui",
"certificateeditor"),
691 $this->tabs_gui->addSubTab(
693 $this->lng->txt(
"obj_features"),
694 $this->getLinkTarget(
"commonSettings")
699 $this->tabs_gui->addSubTab(
'edit_participants', $this->lng->txt(
'edit_participants'), $this->getLinkTarget(
'members'));
700 $this->tabs_gui->addSubTab(
'auto_memberships', $this->lng->txt(
'auto_memberships'), $this->getLinkTarget(
'memberships'));
724 if ($a_cmd ==
"info_short") {
725 return $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary");
727 if ($a_cmd ==
"settings") {
728 return $this->ctrl->getLinkTargetByClass(
"ilobjstudyprogrammesettingsgui",
"view");
730 if ($a_cmd ==
"auto_content") {
731 return $this->ctrl->getLinkTargetByClass(
"ilObjStudyProgrammeAutoCategoriesGUI",
"view");
734 if ($a_cmd == self::SUBTAB_VIEW_TREE) {
735 return $this->ctrl->getLinkTargetByClass(
"ilobjstudyprogrammetreegui",
"view");
737 if ($a_cmd ==
"members") {
738 return $this->ctrl->getLinkTargetByClass(
"ilobjstudyprogrammemembersgui",
"view");
740 if ($a_cmd ==
"memberships") {
741 return $this->ctrl->getLinkTargetByClass(
"ilobjstudyprogrammeautomembershipsgui",
"view");
743 if ($a_cmd ==
"subtypes") {
744 return $this->ctrl->getLinkTargetByClass(
"ilstudyprogrammetypegui",
"listTypes");
746 if ($a_cmd ==
"commonSettings") {
747 return $this->ctrl->getLinkTargetByClass(
749 "ilobjstudyprogrammesettingsgui",
750 "ilStudyProgrammeCommonSettingsGUI"
756 return $this->ctrl->getLinkTarget($this, $a_cmd);
767 if (!$this->object->getTypeSettings()->getTypeId() ||
769 ->readType($this->object->getTypeSettings()->getTypeId())
776 $this->object->getId(),
778 $this->object->getTypeSettings()->getTypeId()
780 $record_gui->setInfoObject($a_info_screen);
781 $record_gui->parse();
788 $link = $this->ctrl->getLinkTargetByClass(ilObjStudyProgrammeSettingsGUI::class,
'view');
789 $this->ctrl->redirectToURL($link);
798 public static function _goto($a_target)
804 $id = explode(
"_", $a_target);
805 $ilCtrl->initBaseClass(
"ilRepositoryGUI");
806 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id", $id[0]);
808 $ilCtrl->redirectByClass(array(
"ilRepositoryGUI",
"ilobjstudyprogrammegui" ),
"view");
814 $ilNavigationHistory =
$DIC[
'ilNavigationHistory'];
820 $ilNavigationHistory->addItem(
830 $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
832 if (
true === $validator->isCertificateDownloadable($this->user->getId(), $this->object->getId()) && $lg) {
833 $cert_url = $this->ctrl->getLinkTarget($this,
"deliverCertificate");
834 $this->lng->loadLanguageModule(
"certificate");
835 $lg->addCustomCommand($cert_url,
"download_certificate");
839 $this->lng->txt(
"download_certificate"),
853 $user_id = (int) $this->
user->getId();
854 $obj_id = (int) $this->object->getId();
857 if (
false === $validator->isCertificateDownloadable($user_id,
$obj_id)) {
859 $this->ctrl->redirect($this);
862 $cert_logger =
$DIC->logger()->cert();
867 $this->lng->txt(
'error_creating_certificate_pdf')
869 $pdf_action->downloadPdf($user_id,
$obj_id);
An exception for terminatinating execution or to throw for unit testing.
checkPositionAccess($pos_perm, $ref_id)
getAvailablePositionRelatedPermissions for available permissionsbool
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)
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
Base class for ILIAS Exception handling.
static init($a_main_tpl=null)
Init JS.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Class ilObjStudyProgrammeGUI class.
isActiveAdministrationPanel()
create()
creates the object
deliverCertificateObject()
initAdvancedSettingsForm()
Initialize the form for editing advanced meta data.
getSubTabs($a_parent_tab)
Adds subtabs based on the parent tab.
cancel()
Cancel the object generation.
updateAdvancedSettings()
Update Advanced Metadata.
executeCommand()
execute command note: this method is overwritten in all container objects
fillInfoScreen($a_info_screen)
Adding meta-data to the info-screen.
getLinkTarget($a_cmd)
Generates a link based on a cmd.
editAdvancedSettings()
Edit Advanced Metadata.
getAsyncCreationForm()
Method for implementing async windows-output Should be moved into core to enable async requests on cr...
getTabs()
Adds the default tabs to the gui.
static _goto($a_target)
_goto Deep link
denyAccessIfNot($a_perm, $position_permission=null)
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add file manager link.
view()
Default view method.
denyAccessIfNotAnyOf($a_perms, $position_permissions=null)
setContentSubTabs()
Disable default content subtabs.
initCreationForms($a_new_type)
Overwritten from ilObjectGUI since copy and import are not implemented.
afterSave(ilObject $a_new_object)
After save hook 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
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
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)