39 $this->
toolbar = $DIC->toolbar();
40 $this->
ctrl = $DIC->ctrl();
41 $this->
lng = $DIC->language();
42 $this->main_tpl =
$DIC->ui()->mainTemplate();
44 $this->port_request =
$DIC->portfolio()
57 switch ($next_class) {
58 case "ilpropertyformgui":
68 "confirmAssignmentDeletion",
80 $lng->
txt(
"prtf_add_assignment"),
81 $this->ctrl->getLinkTarget($this,
"addAssignment")
89 $this->main_tpl->setContent($table->getHTML());
106 $options = $this->manager->getAvailableRoles();
108 $si_roles->setRequired(
true);
109 $si_roles->setOptions($options);
110 $form->addItem($si_roles);
113 $repo->setRequired(
true);
114 $repo->getExplorerGUI()->setSelectableTypes(array(
"prtt"));
115 $repo->getExplorerGUI()->setTypeWhiteList(array(
"root",
"prtt",
"cat",
"crs",
"grp",
"fold"));
116 $form->addItem($repo);
119 $form->addCommandButton(
"saveAssignment",
$lng->
txt(
"save"));
120 $form->addCommandButton(
"listAssignments",
$lng->
txt(
"cancel"));
122 $form->setTitle(
$lng->
txt(
"prtf_add_assignment"));
135 if ($form->checkInput()) {
137 (
int) $form->getInput(
"template_ref_id"),
138 (
int) $form->getInput(
"role_id")
140 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
143 $form->setValuesByPost();
154 $template_ids = $this->port_request->getRoleTemplateIds();
155 if (count($template_ids) === 0) {
161 $cgui->setHeaderText(
$lng->
txt(
"prtf_delete_assignment_sure"));
162 $cgui->setCancel(
$lng->
txt(
"cancel"),
"listAssignments");
163 $cgui->setConfirm(
$lng->
txt(
"delete"),
"deleteAssignments");
164 foreach ($template_ids as $i) {
165 $id_arr = explode(
"_", $i);
170 $cgui->addItem(
"role_template_ids[]", $i, $role_title .
171 " - " . $template_title);
182 $template_ids = $this->port_request->getRoleTemplateIds();
183 foreach ($template_ids as $i) {
184 $id_arr = explode(
"_", $i);
185 $this->manager->delete((
int) $id_arr[1], (
int) $id_arr[0]);
187 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
getNextClass($a_gui_class=null)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
forwardCommand(object $a_gui_object)
@inheritDoc
getCmd(?string $fallback_command=null)
@inheritDoc
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...
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
@ilCtrl_Calls ilPortfolioRoleAssignmentGUI: ilPropertyFormGUI
confirmAssignmentDeletion()
PortfolioRoleAssignmentManager $manager
StandardGUIRequest $port_request
ilGlobalTemplateInterface $main_tpl
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
setContent(string $a_html)
Sets content for standard template.