41 $ilToolbar = $DIC[
'ilToolbar'];
42 $ilCtrl = $DIC[
'ilCtrl'];
48 $this->
ctrl = $ilCtrl;
49 $this->parent_ref_id = $a_parent_ref_id;
50 $this->
lng->loadLanguageModule(
"administration");
51 $this->
lng->loadLanguageModule(
"dateplaner");
52 $this->user_request = new \ILIAS\User\StandardGUIRequest(
62 $ilCtrl = $DIC[
'ilCtrl'];
64 $cmd = $ilCtrl->getCmd();
65 if ($cmd ==
"roleStartingPointform" || !$cmd) {
66 $cmd =
"initRoleStartingPointForm";
79 if (!empty($roles_without_point)) {
81 $this->
lng->txt(
'create_starting_point'),
82 $this->
ctrl->getLinkTarget($this,
"roleStartingPointform")
85 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"all_roles_has_starting_point"));
91 $this->tpl->setContent($tbl->getHTML());
99 $this->tpl->setContent($form->getHTML());
107 $this->tpl->setContent($form->getHTML());
114 $ilCtrl = $DIC[
'ilCtrl'];
120 $startp->
setInfo($this->
lng->txt(
"adm_user_starting_point_personal_info"));
123 $form->addItem($startp);
125 $form->addCommandButton(
"saveUserStartingPoint", $this->
lng->txt(
"save"));
126 $form->setFormAction($ilCtrl->getFormAction($this));
138 $ilCtrl = $DIC[
'ilCtrl'];
139 $rbacsystem = $DIC[
'rbacsystem'];
145 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
146 $ilErr->raiseError($this->
lng->txt(
"msg_no_perm_read"),
$ilErr->FATAL);
149 $ilCtrl->saveParameter($this, array(
"spid"));
151 $spoint_id = $this->user_request->getStartingPointId();
152 $req_role_id = $this->user_request->getRoleId();
154 if ($spoint_id ===
'default') {
156 } elseif (is_numeric($spoint_id) && intval($spoint_id) > 0) {
161 && is_numeric($req_role_id) && intval($req_role_id) > 0
162 && ($role =
new ilObjRole((
int) $req_role_id))) {
163 $options[$req_role_id] = $role->getTitle();
164 $starting_point = $st_point->getStartingPoint();
172 $hi->setValue($req_role_id);
176 $hidde_sp_id->setValue($spoint_id);
177 $form->addItem($hidde_sp_id);
188 $radg->addOption($op1);
190 $radg->addOption($op2);
191 $form->addItem($radg);
193 foreach ($roles as $role) {
194 $options[$role[
'id']] = $role[
'title'];
197 $si_roles->setOptions($options);
198 $op1->addSubItem($si_roles);
202 $role_search->setSize(40);
203 $op2->addSubItem($role_search);
211 $si->setInfo($this->
lng->txt(
"adm_user_starting_point_info"));
224 $default_cal_view->addOption($option);
226 $default_cal_view->addOption($option);
228 $default_cal_view->addOption($option);
233 $cal_periods->setOptions([
239 $cal_periods->setRequired(
true);
242 if (isset($st_point)) {
243 $default_cal_view->
setValue($st_point->getCalendarView());
244 $cal_periods->
setValue($st_point->getCalendarPeriod());
249 $option->addSubItem($cal_periods);
250 $default_cal_view->addOption($option);
252 $opt->addSubItem($default_cal_view);
255 $si->addOption($opt);
257 if (!in_array($value,
$valid)) {
258 $opt->setInfo($this->
lng->txt(
"adm_user_starting_point_invalid_info"));
261 $si->setValue($starting_point);
266 $repobj_id =
new ilTextInputGUI($this->
lng->txt(
"adm_user_starting_point_ref_id"),
"start_object");
267 $repobj_id->setRequired(
true);
268 $repobj_id->setSize(5);
272 $start_ref_id = $st_point->getStartingObject();
277 $repobj_id->
setValue($start_ref_id);
286 $repobj->addSubItem($repobj_id);
287 $si->addOption($repobj);
290 $form->addCommandButton(
"saveStartingPoint", $this->
lng->txt(
"save"));
291 $form->addCommandButton(
"startingPoints", $this->
lng->txt(
"cancel"));
293 $form->setTitle($this->
lng->txt(
"starting_point_settings"));
294 $form->setFormAction($ilCtrl->getFormAction($this));
308 $ilCtrl = $DIC[
'ilCtrl'];
309 $rbacsystem = $DIC[
'rbacsystem'];
312 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
313 $ilErr->raiseError($this->
lng->txt(
"msg_no_perm_read"),
$ilErr->FATAL);
318 if ($form->checkInput()) {
320 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
321 $ilCtrl->redirect($this,
"startingPoints");
323 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_error"),
true);
324 $ilCtrl->redirect($this,
"startingPoints");
334 $ilCtrl = $DIC[
'ilCtrl'];
335 $tree = $DIC[
'tree'];
336 $rbacsystem = $DIC[
'rbacsystem'];
341 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
342 $ilErr->raiseError($this->
lng->txt(
"msg_no_perm_read"),
$ilErr->FATAL);
345 if ($this->user_request->getStartingPointId() > 0) {
346 $start_point_id = $this->user_request->getStartingPointId();
351 if ($form->checkInput()) {
353 if ($form->getInput(
'role')) {
356 if ($form->getInput(
'role_type') == 1) {
357 if ($this->user_request->getRoleId() > 0) {
358 $role_id = $this->user_request->getRoleId();
368 $object_search->setFilter(array(
'role'));
369 $res = $object_search->performSearch();
371 $entries =
$res->getEntries();
372 if (count($entries) == 1) {
373 $role = current($entries);
374 $role_id = $role[
'obj_id'];
375 } elseif (count($entries) > 1) {
377 $form->getInput(
'role'),
378 $form->getInput(
'role_search'),
379 $form->getInput(
'start_point'),
380 $form->getInput(
'start_object')
386 $role_id = $form->getInput(
'role');
390 if ($start_point_id) {
396 $starting_point->setStartingPoint((
int) $form->getInput(
"start_point"));
397 $rules = array(
"role_id" => $role_id);
398 $starting_point->setRuleOptions(serialize($rules));
400 $obj_id = $form->getInput(
'start_object');
401 $cal_view = $form->getInput(
"user_calendar_view");
402 $cal_period = $form->getInput(
"user_cal_period");
405 $starting_point->setStartingObject($obj_id);
406 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
408 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"obj_ref_id_not_exist"),
true);
411 $starting_point->setStartingObject(0);
415 $starting_point->setCalendarView($cal_view);
416 $starting_point->setCalendarPeriod($cal_period);
418 $starting_point->setCalendarView(0);
419 $starting_point->setCalendarPeriod(0);
422 if ($start_point_id) {
423 $starting_point->update();
425 $starting_point->save();
427 } elseif (!empty($form->getInput(
"user_calendar_view")) && !empty($form->getInput(
"user_cal_period"))) {
429 "user_calendar_view" => $form->getInput(
"user_calendar_view"),
430 "user_cal_period" => $form->getInput(
"user_cal_period")
433 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
436 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
439 $ilCtrl->redirect($this,
"startingPoints");
441 $form->setValuesByPost();
452 $parser->setMinWordLength(1);
457 $object_search->setFilter(array(
'role'));
458 $res = $object_search->performSearch();
460 $entries =
$res->getEntries();
463 $table->setLimit(9999);
464 $table->disable(
"sort");
465 $table->addHiddenInput(
"role_search", $role_search);
466 $table->addHiddenInput(
"start_point", $start_point);
467 $table->addHiddenInput(
"start_object", $start_object);
468 $table->addHiddenInput(
"role", $role);
469 $table->addHiddenInput(
"role_type", 1);
470 $table->setTitle($this->
lng->txt(
'user_role_selection'));
471 $table->addMultiCommand(
'saveStartingPoint', $this->
lng->txt(
'select'));
472 $table->parse($entries);
474 $this->tpl->setContent($table->getHTML());
481 $ilCtrl = $DIC[
'ilCtrl'];
482 $rbacsystem = $DIC[
'rbacsystem'];
484 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
488 $positions = $this->user_request->getPositions();
489 if (count($positions) > 0) {
491 $sp->saveOrder($positions);
494 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
495 $ilCtrl->redirect($this,
"startingPoints");
505 $ilCtrl = $DIC[
'ilCtrl'];
508 $ilTabs = $DIC[
'ilTabs'];
510 $ilTabs->clearTargets();
511 $ilTabs->setBackTarget($lng->
txt(
'back_to_starting_points_list'), $ilCtrl->getLinkTarget($this,
'startingPoints'));
514 $conf->setFormAction($ilCtrl->getFormAction($this));
515 $conf->setHeaderText($lng->
txt(
'confirm_delete_starting_point'));
517 $req_role_id = $this->user_request->getRoleId();
518 $req_sp_id = $this->user_request->getStartingPointId();
521 if ($req_role_id && $req_sp_id) {
522 $rolid = $req_role_id;
527 $conf->addItem(
'rolid', $rolid, $role->getTitle());
528 $conf->addItem(
'spid', $spid,
"");
531 $conf->setConfirm($lng->
txt(
'delete'),
'deleteStartingPoint');
532 $conf->setCancel($lng->
txt(
'cancel'),
'startingPoints');
544 $ilCtrl = $DIC[
'ilCtrl'];
545 $rbacsystem = $DIC[
'rbacsystem'];
548 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
552 $spoint_id = $this->user_request->getStartingPointId();
553 $req_role_id = $this->user_request->getRoleId();
555 if ($req_role_id && $spid = $spoint_id) {
558 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
560 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_spoint_not_modified"),
true);
562 $ilCtrl->redirect($this,
"startingPoints");
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLogger(string $a_component_id)
Get component logger.
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...
saveStartingPoint()
store starting point from the form
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getUserStartingPointForm()
static getGlobalRolesWithoutStartingPoint()
Get id and title of the roles without starting points.
static getStartingPoint()
Get current starting point setting.
ILIAS User StandardGUIRequest $user_request
ilGlobalTemplateInterface $tpl
showRoleSelection(string $role, string $role_search, string $start_point, string $start_object)
static hasPersonalStartingPoint()
Can starting point be personalized?
initRoleStartingPointForm(ilPropertyFormGUI $form=null)
static _lookupObjId(int $ref_id)
setMinWordLength(int $a_length)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
startingPoints()
table form to set up starting points depends of user roles
static getPossibleStartingPoints(bool $a_force_all=false)
Get all valid starting points.
confirmDeleteStartingPoint()
Confirm delete starting point.
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
initUserStartingPointForm(ilPropertyFormGUI $form=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setValue(string $a_value)
static getStartingObject()
Get ref id of starting object.
getRoleStartingPointForm()
deleteStartingPoint()
Set to 0 the starting point values.
static setStartingPoint(int $a_value, int $a_ref_id=null, array $a_cal_view=[])
Set starting point setting.
static getCalendarPeriod()
Get time frame of calendar view.
static togglePersonalStartingPoint(bool $a_value)
Toggle personal starting point setting.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addRoleAutoCompleteObject()
static getCalendarView()
Get specific view of calendar starting point.
const START_REPOSITORY_OBJ
__construct(int $a_parent_ref_id)
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...