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');
46 $ilTabs->setTabActive(
'crs_groupings');
48 $cmd = $this->ctrl->getCmd();
49 if (!$cmd = $this->ctrl->getCmd()) {
58 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
65 return $this->content_type;
72 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
73 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
76 $ilToolbar->addButton(
77 $this->lng->txt(
'crs_add_grouping'),
78 $this->ctrl->getLinkTarget($this,
'create')
81 include_once
'Modules/Course/classes/class.ilCourseGroupingTableGUI.php';
84 $tpl->setContent(
$table->getHTML());
91 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
92 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
95 if (!count(
$_POST[
'grouping'])) {
103 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
105 $cgui->setFormAction($this->ctrl->getFormAction($this));
106 $cgui->setHeaderText($this->lng->txt(
"crs_grouping_delete_sure"));
107 $cgui->setCancel($this->lng->txt(
"cancel"),
"listGroupings");
108 $cgui->setConfirm($this->lng->txt(
"delete"),
"deleteGrouping");
111 foreach (
$_POST[
'grouping'] as $grouping_id) {
113 $cgui->addItem(
"grouping[]", $grouping_id, $tmp_obj->getTitle());
116 $tpl->setContent($cgui->getHTML());
123 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
124 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
127 foreach (
$_POST[
'grouping'] as $grouping_id) {
133 $this->ctrl->redirect($this,
'listGroupings');
140 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
141 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
148 $tpl->setContent($a_form->getHTML());
153 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
155 $form->setFormAction($this->ctrl->getFormAction($this));
158 $title->setRequired(
true);
162 $form->addItem($desc);
166 'matriculation' =>
'matriculation');
168 foreach (
$options as $value => $caption) {
169 $options[$value] = $this->lng->txt($caption);
174 $form->addItem($uniq);
177 $form->setTitle($this->lng->txt(
'crs_add_grouping'));
178 $form->addCommandButton(
'add', $this->lng->txt(
'btn_add'));
181 $title->setValue($grouping->getTitle());
182 $desc->setValue($grouping->getDescription());
183 $uniq->setValue($grouping->getUniqueField());
185 $ass =
new ilCustomInputGUI($this->lng->txt(
'groupings_assigned_obj_' . $this->getContentType()));
186 $form->addItem($ass);
190 foreach ($grouping->getAssignedItems() as $cond_data) {
194 $ass->setHtml(implode(
"<br />", $items));
196 $ass->setHtml($this->lng->txt(
'crs_grp_no_courses_assigned'));
199 $form->setTitle($this->lng->txt(
'edit_grouping'));
200 $form->addCommandButton(
'update', $this->lng->txt(
'save'));
201 $form->addCommandButton(
'selectCourse', $this->lng->txt(
'grouping_change_assignment'));
204 $form->addCommandButton(
'listGroupings', $this->lng->txt(
'cancel'));
212 if (
$form->checkInput()) {
213 $this->grp_obj->setTitle(
$form->getInput(
'title'));
214 $this->grp_obj->setDescription(
$form->getInput(
'description'));
215 $this->grp_obj->setUniqueField(
$form->getInput(
'unique'));
217 if ($this->grp_obj->create($this->content_obj->getRefId(), $this->content_obj->getId())) {
223 $this->ctrl->redirect($this,
'listGroupings');
226 $form->setValuesByPost();
230 public function edit($a_form = null)
234 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
235 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
242 $tpl->setContent($a_form->getHTML());
247 global
$ilErr,$ilAccess,$ilObjDataCache;
249 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
250 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
254 if (
$form->checkInput()) {
256 $tmp_grouping->setTitle(
$form->getInput(
'title'));
257 $tmp_grouping->setDescription(
$form->getInput(
'description'));
258 $tmp_grouping->setUniqueField(
$form->getInput(
'unique'));
259 $tmp_grouping->update();
262 $this->ctrl->redirect($this,
'listGroupings');
265 $form->setValuesByPost();
273 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
274 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
277 if (!
$_GET[
'obj_id']) {
283 $ilTabs->clearTargets();
284 $ilTabs->setBackTarget(
285 $this->lng->txt(
'back'),
286 $this->ctrl->getLinkTarget($this,
'edit')
291 include_once
'Modules/Course/classes/class.ilCourseGroupingAssignmentTableGUI.php';
294 $tpl->setContent(
$table->getHTML());
303 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
304 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
307 if (!
$_GET[
'obj_id']) {
313 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
315 $condh->deleteByObjId((
int)
$_GET[
'obj_id']);
319 foreach ($container_ids as $course_ref_id) {
322 $tmp_condh->enableAutomaticValidation(
false);
324 $tmp_condh->setTargetRefId($course_ref_id);
325 $tmp_condh->setTargetObjId($tmp_crs->getId());
327 $tmp_condh->setTriggerRefId(0);
328 $tmp_condh->setTriggerObjId($this->
id);
329 $tmp_condh->setTriggerType(
'crsg');
330 $tmp_condh->setOperator(
'not_member');
331 $tmp_condh->setValue($this->grp_obj->getUniqueField());
333 if (!$tmp_condh->checkExists()) {
334 $tmp_condh->storeCondition();
340 $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(isset($_POST['submit'])) $form
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
if(empty($password)) $table
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Confirmation screen class.