4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
34 $this->content_type = $ilObjDataCache->lookupType($this->content_obj->getId());
36 $this->
id = $a_obj_id;
37 $this->ctrl->saveParameter($this,
'obj_id');
47 $ilTabs->setTabActive(
'crs_groupings');
49 $cmd = $this->ctrl->getCmd();
50 if (!
$cmd = $this->ctrl->getCmd())
60 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
67 return $this->content_type;
74 if(!$ilAccess->checkAccess(
'write',
'',$this->content_obj->getRefId()))
76 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
79 $ilToolbar->addButton($this->lng->txt(
'crs_add_grouping'),
80 $this->ctrl->getLinkTarget($this,
'create'));
82 include_once
'Modules/Course/classes/class.ilCourseGroupingTableGUI.php';
85 $tpl->setContent($table->getHTML());
92 if(!$ilAccess->checkAccess(
'write',
'',$this->content_obj->getRefId()))
94 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
97 if(!count(
$_POST[
'grouping']))
106 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
108 $cgui->setFormAction($this->ctrl->getFormAction($this));
109 $cgui->setHeaderText($this->lng->txt(
"crs_grouping_delete_sure"));
110 $cgui->setCancel($this->lng->txt(
"cancel"),
"listGroupings");
111 $cgui->setConfirm($this->lng->txt(
"delete"),
"deleteGrouping");
114 foreach(
$_POST[
'grouping'] as $grouping_id)
117 $cgui->addItem(
"grouping[]", $grouping_id, $tmp_obj->getTitle());
120 $tpl->setContent($cgui->getHTML());
127 if(!$ilAccess->checkAccess(
'write',
'',$this->content_obj->getRefId()))
129 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
132 foreach(
$_POST[
'grouping'] as $grouping_id)
139 $this->ctrl->redirect($this,
'listGroupings');
146 if(!$ilAccess->checkAccess(
'write',
'',$this->content_obj->getRefId()))
148 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
156 $tpl->setContent($a_form->getHTML());
161 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
163 $form->setFormAction($this->ctrl->getFormAction($this));
166 $title->setRequired(
true);
170 $form->addItem($desc);
174 'matriculation' =>
'matriculation');
176 foreach(
$options as $value => $caption)
178 $options[$value] = $this->lng->txt($caption);
183 $form->addItem($uniq);
187 $form->setTitle($this->lng->txt(
'crs_add_grouping'));
188 $form->addCommandButton(
'add', $this->lng->txt(
'btn_add'));
193 $title->setValue($grouping->getTitle());
194 $desc->setValue($grouping->getDescription());
195 $uniq->setValue($grouping->getUniqueField());
197 $ass =
new ilCustomInputGUI($this->lng->txt(
'groupings_assigned_obj_'.$this->getContentType()));
198 $form->addItem($ass);
202 foreach($grouping->getAssignedItems() as $cond_data)
208 $ass->setHtml(implode(
"<br />", $items));
212 $ass->setHtml($this->lng->txt(
'crs_grp_no_courses_assigned'));
215 $form->setTitle($this->lng->txt(
'edit_grouping'));
216 $form->addCommandButton(
'update', $this->lng->txt(
'save'));
217 $form->addCommandButton(
'selectCourse', $this->lng->txt(
'grouping_change_assignment'));
220 $form->addCommandButton(
'listGroupings', $this->lng->txt(
'cancel'));
228 if($form->checkInput())
230 $this->grp_obj->setTitle($form->getInput(
'title'));
231 $this->grp_obj->setDescription($form->getInput(
'description'));
232 $this->grp_obj->setUniqueField($form->getInput(
'unique'));
234 if($this->grp_obj->create($this->content_obj->getRefId(),$this->content_obj->getId()))
243 $this->ctrl->redirect($this,
'listGroupings');
246 $form->setValuesByPost();
254 if(!$ilAccess->checkAccess(
'write',
'',$this->content_obj->getRefId()))
256 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
264 $tpl->setContent($a_form->getHTML());
269 global
$ilErr,$ilAccess,$ilObjDataCache;
271 if(!$ilAccess->checkAccess(
'write',
'',$this->content_obj->getRefId()))
273 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
277 if($form->checkInput())
280 $tmp_grouping->setTitle($form->getInput(
'title'));
281 $tmp_grouping->setDescription($form->getInput(
'description'));
282 $tmp_grouping->setUniqueField($form->getInput(
'unique'));
283 $tmp_grouping->update();
286 $this->ctrl->redirect($this,
'listGroupings');
289 $form->setValuesByPost();
297 if(!$ilAccess->checkAccess(
'write',
'',$this->content_obj->getRefId()))
299 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
309 $ilTabs->clearTargets();
310 $ilTabs->setBackTarget($this->lng->txt(
'back'),
311 $this->ctrl->getLinkTarget($this,
'edit'));
315 include_once
'Modules/Course/classes/class.ilCourseGroupingAssignmentTableGUI.php';
318 $tpl->setContent($table->getHTML());
327 if(!$ilAccess->checkAccess(
'write',
'',$this->content_obj->getRefId()))
329 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
339 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
341 $condh->deleteByObjId((
int)
$_GET[
'obj_id']);
345 foreach($container_ids as $course_ref_id)
349 $tmp_condh->enableAutomaticValidation(
false);
351 $tmp_condh->setTargetRefId($course_ref_id);
352 $tmp_condh->setTargetObjId($tmp_crs->getId());
354 $tmp_condh->setTriggerRefId(0);
355 $tmp_condh->setTriggerObjId($this->
id);
356 $tmp_condh->setTriggerType(
'crsg');
357 $tmp_condh->setOperator(
'not_member');
358 $tmp_condh->setValue($this->grp_obj->getUniqueField());
360 if(!$tmp_condh->checkExists())
362 $tmp_condh->storeCondition();
368 $this->ctrl->redirect($this,
'edit');
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupTitle($a_id)
lookup object title
__construct($content_obj, $a_obj_id=0)
Constructor public.
if(!is_array($argv)) $options
This class represents a text property in a property form.
Create styles array
The data for the language used.
Class ilObjCourseGroupingGUI.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Handles conditions for accesses to different ILIAS objects.
This class represents a text area property in a property form.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Confirmation screen class.