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/object_statistics/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,
"settings"),
106 if ($rbacsystem->checkAccess(
"read",$this->object->getRefId()))
110 $tabs_gui->addTarget(
"statistics",
111 $this->ctrl->getLinkTargetByClass(
"illpobjectstatisticsgui",
114 "illpobjectstatisticsgui");
119 $tabs_gui->addTarget(
"learning_progress",
120 $this->ctrl->getLinkTargetByClass(
"illearningprogressgui",
123 "illearningprogressgui");
129 $tabs_gui->addTarget(
"session_statistics",
130 $this->ctrl->getLinkTargetByClass(
"ilsessionstatisticsgui",
133 "ilsessionstatisticsgui");
137 if ($rbacsystem->checkAccess(
"edit_permission",$this->object->getRefId()))
139 $tabs_gui->addTarget(
"perm_settings",
140 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
141 array(
"perm",
"info",
"owner"),
154 if (!$rbacsystem->checkAccess(
'read',$this->object->getRefId()))
156 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read_track"),
$ilErr->WARNING);
159 $this->tabs_gui->setTabActive(
'settings');
166 $this->tpl->setContent($a_form->getHTML());
173 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
175 $form->setFormAction($this->ctrl->getFormAction($this));
176 $form->setTitle($this->lng->txt(
'tracking_settings'));
179 $form->addItem($activate);
182 $lp =
new ilCheckboxInputGUI($this->lng->txt(
'trac_learning_progress'),
'learning_progress_tracking');
183 if($this->object->enabledLearningProgress())
187 $activate->addSubItem($lp);
199 $learner =
new ilCheckboxInputGUI($this->lng->txt(
'trac_lp_learner_access'),
'lp_learner');
200 $learner->
setInfo($this->lng->txt(
'trac_lp_learner_access_info'));
201 $learner->setChecked($this->object->hasLearningProgressLearner());
202 $lp->addSubItem($learner);
209 $extdata->addOption(
new ilCheckboxOption($this->lng->txt(
'trac_read_count'),
'lp_count'));
210 $extdata->addOption(
new ilCheckboxOption($this->lng->txt(
'trac_spent_seconds'),
'lp_spent'));
211 $lp->addSubItem($extdata);
213 $ext_value = array();
216 $ext_value[] =
'lp_access';
220 $ext_value[] =
'lp_count';
224 $ext_value[] =
'lp_spent';
226 $extdata->setValue($ext_value);
229 $listgui->
setInfo($this->lng->txt(
'trac_lp_list_gui_info'));
230 $listgui->setChecked($this->object->hasLearningProgressListGUI());
231 $lp->addSubItem($listgui);
244 $objstat =
new ilCheckboxInputGUI($this->lng->txt(
'trac_object_statistics'),
'object_statistics');
245 if($this->object->enabledObjectStatistics())
249 $activate->addSubItem($objstat);
252 $sessstat =
new ilCheckboxInputGUI($this->lng->txt(
'session_statistics'),
'session_statistics');
253 if($this->object->enabledSessionStatistics())
257 $activate->addSubItem($sessstat);
261 $user->
setInfo($this->lng->txt(
'trac_anonymized_info'));
262 $user->setChecked(!$this->object->enabledUserRelatedData());
263 $form->addItem($user);
269 $valid->setSuffix($this->lng->txt(
'seconds'));
270 $valid->setInfo($this->lng->txt(
'info_valid_request'));
271 $valid->setValue($this->object->getValidTimeSpan());
273 $valid->setMaxValue(9999);
274 $valid->setRequired(
true);
277 include_once
"Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
285 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
287 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
291 $lp->setDisabled(
true);
292 $learner->setDisabled(
true);
293 $extdata->setDisabled(
true);
294 $listgui->setDisabled(
true);
295 $objstat->setDisabled(
true);
296 $user->setDisabled(
true);
297 $valid->setDisabled(
true);
310 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
316 if($form->checkInput())
318 $lp_active = $form->getInput(
'learning_progress_tracking');
320 $this->
object->enableLearningProgress($lp_active);
324 $ext_data = (array)$form->getInput(
"lp_extdata");
326 if(in_array(
'lp_access', $ext_data))
330 if(in_array(
'lp_count', $ext_data))
334 if(in_array(
'lp_spent', $ext_data))
338 $this->
object->setExtendedData($code);
341 $this->
object->enableChangeEventTracking($form->getInput(
'change_event_tracking'));
342 $this->
object->enableObjectStatistics($form->getInput(
'object_statistics'));
343 $this->
object->enableUserRelatedData(!$form->getInput(
'user_related'));
344 $this->
object->setValidTimeSpan($form->getInput(
'valid_request'));
346 $this->
object->setLearningProgressLearner($form->getInput(
'lp_learner'));
347 $this->
object->enableSessionStatistics($form->getInput(
'session_statistics'));
348 $this->
object->setLearningProgressListGUI($form->getInput(
'lp_list'));
349 $this->
object->updateSettings();
352 $this->ctrl->redirect($this,
"settings");
355 $form->setValuesByPost();