Class ilObjCourseGroupingGUI.
More...
Class ilObjCourseGroupingGUI.
- Author
- your name <your email>="">
- Version
- $Id$
Definition at line 13 of file class.ilObjCourseGroupingGUI.php.
◆ __construct()
ilObjCourseGroupingGUI::__construct |
( |
|
$content_obj, |
|
|
|
$a_obj_id = 0 |
|
) |
| |
◆ __initGroupingObject()
ilObjCourseGroupingGUI::__initGroupingObject |
( |
| ) |
|
◆ add()
ilObjCourseGroupingGUI::add |
( |
| ) |
|
Definition at line 232 of file class.ilObjCourseGroupingGUI.php.
References $form, create(), initForm(), and ilUtil\sendFailure().
235 if (
$form->checkInput()) {
236 $this->grp_obj->setTitle(
$form->getInput(
'title'));
237 $this->grp_obj->setDescription(
$form->getInput(
'description'));
238 $this->grp_obj->setUniqueField(
$form->getInput(
'unique'));
240 if ($this->grp_obj->create($this->content_obj->getRefId(), $this->content_obj->getId())) {
241 ilUtil::sendSuccess($this->lng->txt(
'crs_grp_added_grouping'),
true);
246 $this->ctrl->redirect($this,
'listGroupings');
249 $form->setValuesByPost();
if(isset($_POST['submit'])) $form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ askDeleteGrouping()
ilObjCourseGroupingGUI::askDeleteGrouping |
( |
| ) |
|
Definition at line 99 of file class.ilObjCourseGroupingGUI.php.
References $_POST, $DIC, $ilErr, $tpl, listGroupings(), and ilUtil\sendFailure().
104 $ilAccess = $DIC[
'ilAccess'];
107 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
108 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
111 if (empty(
$_POST[
'grouping'])) {
119 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
121 $cgui->setFormAction($this->ctrl->getFormAction($this));
122 $cgui->setHeaderText($this->lng->txt(
"crs_grouping_delete_sure"));
123 $cgui->setCancel($this->lng->txt(
"cancel"),
"listGroupings");
124 $cgui->setConfirm($this->lng->txt(
"delete"),
"deleteGrouping");
127 foreach (
$_POST[
'grouping'] as $grouping_id) {
129 $cgui->addItem(
"grouping[]", $grouping_id, $tmp_obj->getTitle());
132 $tpl->setContent($cgui->getHTML());
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Confirmation screen class.
◆ assignCourse()
ilObjCourseGroupingGUI::assignCourse |
( |
| ) |
|
Definition at line 335 of file class.ilObjCourseGroupingGUI.php.
References $_GET, $_POST, $DIC, $ilErr, $ilUser, $tree, getContentType(), ilObjectFactory\getInstanceByRefId(), and listGroupings().
340 $ilAccess = $DIC[
'ilAccess'];
341 $ilObjDataCache = $DIC[
'ilObjDataCache'];
342 $tree = $DIC[
'tree'];
345 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
346 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
349 if (!
$_GET[
'obj_id']) {
355 include_once
'./Services/Conditions/classes/class.ilConditionHandler.php';
357 $condh->deleteByObjId((
int)
$_GET[
'obj_id']);
360 $container_ids = is_array(
$_POST[
'crs_ids']) ?
$_POST[
'crs_ids'] : array();
361 foreach ($container_ids as $course_ref_id) {
364 $tmp_condh->enableAutomaticValidation(
false);
366 $tmp_condh->setTargetRefId($course_ref_id);
367 $tmp_condh->setTargetObjId($tmp_crs->getId());
369 $tmp_condh->setTriggerRefId(0);
370 $tmp_condh->setTriggerObjId($this->
id);
371 $tmp_condh->setTriggerType(
'crsg');
372 $tmp_condh->setOperator(
'not_member');
373 $tmp_condh->setValue($this->grp_obj->getUniqueField());
375 if (!$tmp_condh->checkExists()) {
376 $tmp_condh->storeCondition();
381 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
382 $this->ctrl->redirect($this,
'edit');
INTERNAL CLASS: Please do not use in consumer code.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
◆ create()
ilObjCourseGroupingGUI::create |
( |
|
$a_form = null | ) |
|
◆ deleteGrouping()
ilObjCourseGroupingGUI::deleteGrouping |
( |
| ) |
|
Definition at line 135 of file class.ilObjCourseGroupingGUI.php.
References $_POST, $DIC, and $ilErr.
140 $ilAccess = $DIC[
'ilAccess'];
142 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
143 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
146 foreach (
$_POST[
'grouping'] as $grouping_id) {
151 ilUtil::sendSuccess($this->lng->txt(
'crs_grouping_deleted'),
true);
152 $this->ctrl->redirect($this,
'listGroupings');
◆ edit()
ilObjCourseGroupingGUI::edit |
( |
|
$a_form = null | ) |
|
◆ executeCommand()
ilObjCourseGroupingGUI::executeCommand |
( |
| ) |
|
Definition at line 47 of file class.ilObjCourseGroupingGUI.php.
References $DIC.
51 $ilTabs = $DIC[
'ilTabs'];
53 $ilTabs->setTabActive(
'crs_groupings');
55 $cmd = $this->ctrl->getCmd();
56 if (!$cmd = $this->ctrl->getCmd()) {
◆ getContentType()
ilObjCourseGroupingGUI::getContentType |
( |
| ) |
|
◆ initForm()
ilObjCourseGroupingGUI::initForm |
( |
|
$a_create | ) |
|
Definition at line 174 of file class.ilObjCourseGroupingGUI.php.
References $form, PHPMailer\PHPMailer\$options, $title, ilObject\_lookupTitle(), and ilFormPropertyGUI\setRequired().
Referenced by add(), create(), edit(), and update().
176 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
178 $form->setFormAction($this->ctrl->getFormAction($this));
181 $title->setRequired(
true);
185 $form->addItem($desc);
187 $options = array(
'login' =>
'login',
189 'matriculation' =>
'matriculation');
191 foreach (
$options as $value => $caption) {
192 $options[$value] = $this->lng->txt($caption);
197 $form->addItem($uniq);
200 $form->setTitle($this->lng->txt(
'crs_add_grouping'));
201 $form->addCommandButton(
'add', $this->lng->txt(
'btn_add'));
204 $title->setValue($grouping->getTitle());
205 $desc->setValue($grouping->getDescription());
206 $uniq->setValue($grouping->getUniqueField());
208 $ass =
new ilCustomInputGUI($this->lng->txt(
'groupings_assigned_obj_' . $this->getContentType()));
209 $form->addItem($ass);
213 foreach ($grouping->getAssignedItems() as $cond_data) {
217 $ass->setHtml(implode(
"<br />", $items));
219 $ass->setHtml($this->lng->txt(
'crs_grp_no_courses_assigned'));
222 $form->setTitle($this->lng->txt(
'edit_grouping'));
223 $form->addCommandButton(
'update', $this->lng->txt(
'save'));
224 $form->addCommandButton(
'selectCourse', $this->lng->txt(
'grouping_change_assignment'));
227 $form->addCommandButton(
'listGroupings', $this->lng->txt(
'cancel'));
static _lookupTitle($a_id)
lookup object title
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
This class represents a text area property in a property form.
◆ listGroupings()
ilObjCourseGroupingGUI::listGroupings |
( |
| ) |
|
Definition at line 75 of file class.ilObjCourseGroupingGUI.php.
References $DIC, $ilErr, $table, and $tpl.
Referenced by askDeleteGrouping(), assignCourse(), and selectCourse().
80 $ilAccess = $DIC[
'ilAccess'];
81 $ilToolbar = $DIC[
'ilToolbar'];
84 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
85 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
88 $ilToolbar->addButton(
89 $this->lng->txt(
'crs_add_grouping'),
90 $this->ctrl->getLinkTarget($this,
'create')
93 include_once
'Modules/Course/classes/class.ilCourseGroupingTableGUI.php';
if(empty($password)) $table
◆ selectCourse()
ilObjCourseGroupingGUI::selectCourse |
( |
| ) |
|
Definition at line 300 of file class.ilObjCourseGroupingGUI.php.
References $_GET, $DIC, $ilErr, $table, $tpl, listGroupings(), and ilUtil\sendFailure().
305 $ilAccess = $DIC[
'ilAccess'];
307 $ilTabs = $DIC[
'ilTabs'];
309 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
310 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
313 if (!
$_GET[
'obj_id']) {
319 $ilTabs->clearTargets();
320 $ilTabs->setBackTarget(
321 $this->lng->txt(
'back'),
322 $this->ctrl->getLinkTarget($this,
'edit')
327 include_once
'Modules/Course/classes/class.ilCourseGroupingAssignmentTableGUI.php';
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(empty($password)) $table
◆ update()
ilObjCourseGroupingGUI::update |
( |
| ) |
|
Definition at line 272 of file class.ilObjCourseGroupingGUI.php.
References $DIC, $form, $ilErr, edit(), and initForm().
277 $ilAccess = $DIC[
'ilAccess'];
278 $ilObjDataCache = $DIC[
'ilObjDataCache'];
280 if (!$ilAccess->checkAccess(
'write',
'', $this->content_obj->getRefId())) {
281 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
285 if (
$form->checkInput()) {
287 $tmp_grouping->setTitle(
$form->getInput(
'title'));
288 $tmp_grouping->setDescription(
$form->getInput(
'description'));
289 $tmp_grouping->setUniqueField(
$form->getInput(
'unique'));
290 $tmp_grouping->update();
292 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
293 $this->ctrl->redirect($this,
'listGroupings');
296 $form->setValuesByPost();
if(isset($_POST['submit'])) $form
◆ $content_obj
ilObjCourseGroupingGUI::$content_obj |
◆ $ctrl
ilObjCourseGroupingGUI::$ctrl |
◆ $lng
ilObjCourseGroupingGUI::$lng |
◆ $tpl
ilObjCourseGroupingGUI::$tpl |
The documentation for this class was generated from the following file: