4 include_once
"./Services/Object/classes/class.ilObjectGUI.php";
31 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
36 $this->lng->loadLanguageModule(
'trac');
43 $next_class = $this->ctrl->getNextClass();
44 $this->ctrl->setReturn($this,
"show");
49 case 'ilpermissiongui':
50 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
52 $ret =& $this->ctrl->forwardCommand($perm_gui);
55 case 'illearningprogressgui':
56 $this->tabs_gui->setTabActive(
'learning_progress');
57 include_once(
"./Services/Tracking/classes/class.ilLearningProgressGUI.php");
59 $ret =& $this->ctrl->forwardCommand($lp_gui);
62 case 'illpobjectstatisticsgui':
63 $this->tabs_gui->setTabActive(
'statistics');
64 include_once(
"./Services/Tracking/classes/class.ilLPObjectStatisticsGUI.php");
66 $ret =& $this->ctrl->forwardCommand($os_gui);
69 case 'ilsessionstatisticsgui':
70 $this->tabs_gui->setTabActive(
'session_statistics');
71 include_once(
"./Services/Authentication/classes/class.ilSessionStatisticsGUI.php");
73 $ret =& $this->ctrl->forwardCommand($sess_gui);
77 $cmd = $this->ctrl->getCmd();
99 $this->ctrl->setParameter($this,
"ref_id",$this->ref_id);
101 $tabs_gui->addTarget(
"settings",
102 $this->ctrl->getLinkTarget($this,
107 if ($rbacsystem->checkAccess(
"read",$this->object->getRefId()))
111 $tabs_gui->addTarget(
"statistics",
112 $this->ctrl->getLinkTargetByClass(
"illpobjectstatisticsgui",
115 "illpobjectstatisticsgui");
120 $tabs_gui->addTarget(
"learning_progress",
121 $this->ctrl->getLinkTargetByClass(
"illearningprogressgui",
124 "illearningprogressgui");
130 $tabs_gui->addTarget(
"session_statistics",
131 $this->ctrl->getLinkTargetByClass(
"ilsessionstatisticsgui",
134 "ilsessionstatisticsgui");
138 if ($rbacsystem->checkAccess(
"edit_permission",$this->object->getRefId()))
140 $tabs_gui->addTarget(
"perm_settings",
141 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
142 array(
"perm",
"info",
"owner"),
155 if (!$rbacsystem->checkAccess(
'read',$this->object->getRefId()))
157 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read_track"),
$ilErr->WARNING);
160 $this->tabs_gui->setTabActive(
'settings');
167 $this->tpl->setContent($a_form->getHTML());
174 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
176 $form->setFormAction($this->ctrl->getFormAction($this));
177 $form->setTitle($this->lng->txt(
'tracking_settings'));
180 $form->addItem($activate);
183 $lp =
new ilCheckboxInputGUI($this->lng->txt(
'trac_learning_progress'),
'learning_progress_tracking');
184 if($this->object->enabledLearningProgress())
188 $activate->addSubItem($lp);
200 $learner =
new ilCheckboxInputGUI($this->lng->txt(
'trac_lp_learner_access'),
'lp_learner');
201 $learner->
setInfo($this->lng->txt(
'trac_lp_learner_access_info'));
202 $learner->setChecked($this->object->hasLearningProgressLearner());
203 $lp->addSubItem($learner);
210 $extdata->addOption(
new ilCheckboxOption($this->lng->txt(
'trac_read_count'),
'lp_count'));
211 $extdata->addOption(
new ilCheckboxOption($this->lng->txt(
'trac_spent_seconds'),
'lp_spent'));
212 $lp->addSubItem($extdata);
214 $ext_value = array();
217 $ext_value[] =
'lp_access';
221 $ext_value[] =
'lp_count';
225 $ext_value[] =
'lp_spent';
227 $extdata->setValue($ext_value);
230 $event =
new ilCheckboxInputGUI($this->lng->txt(
'trac_repository_changes'),
'change_event_tracking');
231 if($this->object->enabledChangeEventTracking())
235 $activate->addSubItem($event);
238 $objstat =
new ilCheckboxInputGUI($this->lng->txt(
'trac_object_statistics'),
'object_statistics');
239 if($this->object->enabledObjectStatistics())
243 $activate->addSubItem($objstat);
246 $sessstat =
new ilCheckboxInputGUI($this->lng->txt(
'session_statistics'),
'session_statistics');
247 if($this->object->enabledSessionStatistics())
251 $activate->addSubItem($sessstat);
256 $user->
setInfo($this->lng->txt(
'trac_anonymized_info'));
257 $user->setChecked(!$this->object->enabledUserRelatedData());
258 $form->addItem($user);
264 $valid->setSuffix($this->lng->txt(
'seconds'));
265 $valid->setInfo($this->lng->txt(
'info_valid_request'));
266 $valid->setValue($this->object->getValidTimeSpan());
268 $valid->setMaxValue(9999);
269 $valid->setRequired(
true);
273 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
275 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
279 $lp->setDisabled(
true);
280 $learner->setDisabled(
true);
281 $extdata->setDisabled(
true);
282 $event->setDisabled(
true);
283 $objstat->setDisabled(
true);
284 $user->setDisabled(
true);
285 $valid->setDisabled(
true);
297 if($form->checkInput())
299 $lp_active = $form->getInput(
'learning_progress_tracking');
301 $this->
object->enableLearningProgress($lp_active);
305 $ext_data = (array)$form->getInput(
"lp_extdata");
307 if(in_array(
'lp_access', $ext_data))
311 if(in_array(
'lp_count', $ext_data))
315 if(in_array(
'lp_spent', $ext_data))
319 $this->
object->setExtendedData($code);
322 $this->
object->enableChangeEventTracking($form->getInput(
'change_event_tracking'));
323 $this->
object->enableObjectStatistics($form->getInput(
'object_statistics'));
324 $this->
object->enableUserRelatedData(!$form->getInput(
'user_related'));
325 $this->
object->setValidTimeSpan($form->getInput(
'valid_request'));
327 $this->
object->setLearningProgressLearner($form->getInput(
'lp_learner'));
328 $this->
object->enableSessionStatistics($form->getInput(
'session_statistics'));
330 $this->
object->updateSettings();
333 $this->ctrl->redirect($this,
"settings");
336 $form->setValuesByPost();