30 $ilToolbar =
$DIC[
'ilToolbar'];
31 $ilCtrl =
$DIC[
'ilCtrl'];
36 $this->toolbar = $ilToolbar;
37 $this->ctrl = $ilCtrl;
38 $this->parent_ref_id = $a_parent_ref_id;
39 $this->lng->loadLanguageModule(
"administration");
40 $this->lng->loadLanguageModule(
"dateplaner");
46 $ilCtrl =
$DIC[
'ilCtrl'];
48 $cmd = $ilCtrl->getCmd();
49 if ($cmd ==
"roleStartingPointform" || !$cmd) {
50 $cmd =
"initRoleStartingPointForm";
63 include_once
"Services/User/classes/class.ilUserRoleStartingPointTableGUI.php";
65 require_once
"./Services/AccessControl/classes/class.ilStartingPoint.php";
68 if (!empty($roles_without_point)) {
69 $this->toolbar->addButton(
70 $this->lng->txt(
'create_starting_point'),
71 $this->ctrl->getLinkTarget($this,
"roleStartingPointform")
80 $this->tpl->setContent($tbl->getHTML());
88 $this->tpl->setContent($form->getHTML());
96 $this->tpl->setContent($form->getHTML());
103 $ilCtrl =
$DIC[
'ilCtrl'];
105 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
106 require_once
"Services/User/classes/class.ilUserUtil.php";
111 $startp =
new ilCheckboxInputGUI($this->lng->txt(
"user_chooses_starting_page"),
"usr_start_pers");
112 $startp->setInfo($this->lng->txt(
"adm_user_starting_point_personal_info"));
115 $form->addItem($startp);
117 $form->addCommandButton(
"saveUserStartingPoint", $this->lng->txt(
"save"));
118 $form->setFormAction($ilCtrl->getFormAction($this));
130 $ilCtrl =
$DIC[
'ilCtrl'];
131 $rbacsystem =
$DIC[
'rbacsystem'];
134 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
138 require_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
139 require_once
"./Services/AccessControl/classes/class.ilObjRole.php";
140 require_once
"./Services/AccessControl/classes/class.ilStartingPoint.php";
141 include_once
"Services/User/classes/class.ilUserUtil.php";
144 $ilCtrl->saveParameter($this, array(
"spid"));
146 $spoint_id = $_REQUEST[
'spid'];
149 if ($spoint_id > 0 && $spoint_id !=
'default') {
154 $rolid = (int) $_REQUEST[
'rolid'];
156 $options[$rolid] = $role->getTitle();
157 $starting_point = $st_point->getStartingPoint();
158 $si_roles =
new ilSelectInputGUI($this->lng->txt(
"editing_this_role"),
'role_disabled');
159 $si_roles->setOptions($options);
160 $si_roles->setDisabled(
true);
161 $form->addItem($si_roles);
164 $hi->setValue($rolid);
168 $hidde_sp_id->setValue($spoint_id);
169 $form->addItem($hidde_sp_id);
174 elseif (!$spoint_id || $spoint_id !=
'default') {
179 foreach ($roles as $role) {
180 $options[$role[
'id']] = $role[
'title'];
182 $si_roles =
new ilSelectInputGUI($this->lng->txt(
"roles_without_starting_point"),
'role');
183 $si_roles->setOptions($options);
184 $form->addItem($si_roles);
193 $si->setRequired(
true);
194 $si->setInfo($this->lng->txt(
"adm_user_starting_point_info"));
201 $default_cal_view =
new ilRadioGroupInputGUI($this->lng->txt(
'cal_def_view'),
'user_calendar_view');
202 $default_cal_view->setRequired(
true);
205 $default_cal_view->addOption($option);
207 $default_cal_view->addOption($option);
209 $default_cal_view->addOption($option);
213 $cal_periods =
new ilSelectInputGUI($this->lng->txt(
"cal_list"),
"user_cal_period");
214 $cal_periods->setOptions([
220 $cal_periods->setRequired(
true);
223 if(isset($st_point)) {
224 $default_cal_view->setValue($st_point->getCalendarView());
225 $cal_periods->setValue($st_point->getCalendarPeriod());
230 $option->addSubItem($cal_periods);
231 $default_cal_view->addOption($option);
233 $opt->addSubItem($default_cal_view);
236 $si->addOption($opt);
238 if (!in_array($value,
$valid)) {
239 $opt->setInfo($this->lng->txt(
"adm_user_starting_point_invalid_info"));
242 $si->setValue($starting_point);
247 $repobj_id =
new ilTextInputGUI($this->lng->txt(
"adm_user_starting_point_ref_id"),
"start_object");
248 $repobj_id->setRequired(
true);
249 $repobj_id->setSize(5);
253 $start_ref_id = $st_point->getStartingObject();
258 $repobj_id->setValue($start_ref_id);
267 $repobj->addSubItem($repobj_id);
268 $si->addOption($repobj);
271 $form->addCommandButton(
"saveStartingPoint", $this->lng->txt(
"save"));
272 $form->addCommandButton(
"startingPoints", $this->lng->txt(
"cancel"));
274 $form->setTitle($this->lng->txt(
"starting_point_settings"));
275 $form->setFormAction($ilCtrl->getFormAction($this));
284 $ilCtrl =
$DIC[
'ilCtrl'];
285 $rbacsystem =
$DIC[
'rbacsystem'];
288 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
289 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),
$ilErr->FATAL);
292 include_once
"Services/User/classes/class.ilUserUtil.php";
296 if ($form->checkInput()) {
298 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
299 $ilCtrl->redirect($this,
"startingPoints");
302 $ilCtrl->redirect($this,
"startingPoints");
312 $ilCtrl =
$DIC[
'ilCtrl'];
313 $tree =
$DIC[
'tree'];
314 $rbacsystem =
$DIC[
'rbacsystem'];
318 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
319 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),
$ilErr->FATAL);
322 if ((
int)
$_POST[
'start_point_id'] > 0) {
323 $start_point_id = (int)
$_POST[
'start_point_id'];
328 if ($form->checkInput()) {
330 if ($form->getInput(
'role')) {
333 if ($start_point_id) {
339 $starting_point->setStartingPoint($form->getInput(
"start_point"));
340 $rules = array(
"role_id" => $form->getInput(
'role'));
341 $starting_point->setRuleOptions(serialize($rules));
343 $obj_id = $form->getInput(
'start_object');
344 $cal_view = $form->getInput(
"user_calendar_view");
345 $cal_period = $form->getInput(
"user_cal_period");
348 $starting_point->setStartingObject($obj_id);
349 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
354 $starting_point->setStartingObject(0);
358 $starting_point->setCalendarView($cal_view);
359 $starting_point->setCalendarPeriod($cal_period);
361 $starting_point->setCalendarView(0);
362 $starting_point->setCalendarPeriod(0);
365 if ($start_point_id) {
366 $starting_point->update();
368 $starting_point->save();
370 }
else if(!empty($form->getInput(
"user_calendar_view")) && !empty($form->getInput(
"user_cal_period"))) {
372 "user_calendar_view" => $form->getInput(
"user_calendar_view"),
373 "user_cal_period" => $form->getInput(
"user_cal_period")
376 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
379 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
382 $ilCtrl->redirect($this,
"startingPoints");
384 $tpl->setContent($form->getHTML());
393 $ilCtrl =
$DIC[
'ilCtrl'];
394 $rbacsystem =
$DIC[
'rbacsystem'];
397 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
402 require_once
"./Services/AccessControl/classes/class.ilStartingPoint.php";
405 $sp->saveOrder(
$_POST[
'position']);
408 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
409 $ilCtrl->redirect($this,
"startingPoints");
419 $ilCtrl =
$DIC[
'ilCtrl'];
422 $ilTabs =
$DIC[
'ilTabs'];
424 $ilTabs->clearTargets();
425 $ilTabs->setBackTarget(
$lng->txt(
'back_to_starting_points_list'), $ilCtrl->getLinkTarget($this,
'startingPoints'));
427 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
429 $conf->setFormAction($ilCtrl->getFormAction($this));
430 $conf->setHeaderText(
$lng->txt(
'confirm_delete_starting_point'));
433 if ($_REQUEST[
'rolid'] && $_REQUEST[
'spid']) {
434 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
436 $rolid = (int) $_REQUEST[
'rolid'];
437 $spid = (int) $_REQUEST[
'spid'];
441 $conf->addItem(
'rolid', $rolid, $role->getTitle());
442 $conf->addItem(
'spid', $spid,
"");
445 $conf->setConfirm(
$lng->txt(
'delete'),
'deleteStartingPoint');
446 $conf->setCancel(
$lng->txt(
'cancel'),
'startingPoints');
448 $tpl->setContent($conf->getHTML());
458 $ilCtrl =
$DIC[
'ilCtrl'];
459 $rbacsystem =
$DIC[
'rbacsystem'];
462 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
466 require_once
"./Services/AccessControl/classes/class.ilObjRole.php";
468 if ($rolid = $_REQUEST[
'rolid'] && $spid = $_REQUEST[
'spid']) {
469 include_once(
"./Services/AccessControl/classes/class.ilStartingPoint.php");
472 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
476 $ilCtrl->redirect($this,
"startingPoints");
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
static getLogger($a_component_id)
Get component logger.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents an option in a radio group.
static getGlobalRolesWithoutStartingPoint()
Get id and title of the roles without starting points.
This class represents a text property in a property form.
TableGUI class for LTI consumer listing.
Class ilUserStartingPointGUI.
initRoleStartingPointForm(ilPropertyFormGUI $form=null)
initUserStartingPointForm(ilPropertyFormGUI $form=null)
deleteStartingPoint()
Set to 0 the starting point values.
__construct($a_parent_ref_id)
Constructor @access public.
startingPoints()
table form to set up starting points depends of user roles
getRoleStartingPointForm()
confirmDeleteStartingPoint()
Confirm delete starting point.
saveStartingPoint()
store starting point from the form
getUserStartingPointForm()
static getCalendarPeriod()
Get time frame of calendar view.
static getPossibleStartingPoints($a_force_all=false)
Get all valid starting points.
static getCalendarView()
Get specific view of calendar starting point.
static hasPersonalStartingPoint()
Can starting point be personalized?
static togglePersonalStartingPoint($a_value)
Toggle personal starting point setting.
static setStartingPoint($a_value, $a_ref_id=null, $a_cal_view=[])
Set starting point setting.
static getStartingPoint()
Get current starting point setting.
static getStartingObject()
Get ref id of starting object.
const START_REPOSITORY_OBJ
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.