5include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
6include_once
'./Services/Tracking/classes/class.ilLPObjSettings.php';
27 parent::__construct($a_mode,$a_ref_id);
31 include_once
'./Services/Object/classes/class.ilObjectLP.php';
40 switch($this->ctrl->getNextClass())
57 $ilHelp->setSubScreenId(
"trac_settings");
59 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lp_obj_settings.html',
'Services/Tracking');
62 $this->tpl->setVariable(
'PROP_FORM',$form->getHTML());
63 $this->tpl->setVariable(
'COLLECTION_TABLE',$this->
getTableByMode());
74 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
76 $form->setTitle($this->lng->txt(
'tracking_settings'));
77 $form->setFormAction($this->ctrl->getFormAction($this));
81 $mod->setRequired(
true);
82 $mod->setValue($this->obj_lp->getCurrentMode());
85 foreach($this->obj_lp->getValidModes() as $mode_key)
88 $this->obj_lp->getModeText($mode_key),
90 $this->obj_lp->getModeInfoText($mode_key)
92 $opt->setValue($mode_key);
93 $mod->addOption($opt);
100 $vis->setMaxLength(4);
101 $vis->setInfo(sprintf($this->lng->txt(
'trac_visits_info'),
103 $vis->setRequired(
true);
104 $vis->setValue($this->obj_settings->getVisits());
105 $opt->addSubItem($vis);
109 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
121 if($form->checkInput())
126 $new_mode = (int)$form->getInput(
'modus');
127 $old_mode = $this->obj_lp->getCurrentMode();
128 $mode_changed = ($old_mode != $new_mode);
132 $visits_changed =
null;
135 $new_visits = (int)$form->getInput(
'visits');
136 $old_visits = $this->obj_settings->getVisits();
137 $visits_changed = ($old_visits != $new_visits);
143 $collection = $this->obj_lp->getCollectionInstance();
146 $collection->delete();
150 $refresh_lp = ($mode_changed || $visits_changed);
153 $this->obj_lp->resetCaches();
155 $this->obj_settings->setMode($new_mode);
156 $this->obj_settings->setVisits($new_visits);
157 $this->obj_settings->update($refresh_lp);
160 $this->obj_lp->getCollectionInstance() &&
166 $this->ctrl->redirect($this,
'show');
169 $form->setValuesByPost();
172 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lp_obj_settings.html',
'Services/Tracking');
173 $this->tpl->setVariable(
'PROP_FORM',$form->getHTML());
174 $this->tpl->setVariable(
'COLLECTION_TABLE',$this->
getTableByMode());
182 $collection = $this->obj_lp->getCollectionInstance();
183 if($collection && $collection->hasSelectableItems())
185 include_once
"Services/Tracking/classes/repository_statistics/class.ilLPCollectionSettingsTableGUI.php";
187 $table->parse($collection);
188 return $table->getHTML();
201 $this->ctrl->redirect($this,
'show');
203 if(count(
$_POST[
'item_ids']))
205 $collection = $this->obj_lp->getCollectionInstance();
206 if($collection && $collection->hasSelectableItems())
208 $collection->activateEntries(
$_POST[
'item_ids']);
212 $this->obj_lp->resetCaches();
215 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
219 $this->ctrl->redirect($this,
'show');
231 $this->ctrl->redirect($this,
'show');
234 if(count(
$_POST[
'item_ids']))
236 $collection = $this->obj_lp->getCollectionInstance();
237 if($collection && $collection->hasSelectableItems())
239 $collection->deactivateEntries(
$_POST[
'item_ids']);
243 $this->obj_lp->resetCaches();
246 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
250 $this->ctrl->redirect($this,
'show');
258 if(!count((array)
$_POST[
'item_ids']))
261 $this->ctrl->redirect($this,
'show');
264 $collection = $this->obj_lp->getCollectionInstance();
265 if($collection && $collection->hasSelectableItems())
268 $collection->createNewGrouping((array)
$_POST[
'item_ids']);
271 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
276 $this->ctrl->redirect($this,
'show');
284 if(!count((array)
$_POST[
'item_ids']))
287 $this->ctrl->redirect($this,
'show');
290 $collection = $this->obj_lp->getCollectionInstance();
291 if($collection && $collection->hasSelectableItems())
293 $collection->releaseGrouping((array)
$_POST[
'item_ids']);
296 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
301 $this->ctrl->redirect($this,
'show');
309 if(!is_array((array)
$_POST[
'grp']))
312 $this->ctrl->redirect($this,
'show');
317 $collection = $this->obj_lp->getCollectionInstance();
318 if($collection && $collection->hasSelectableItems())
320 $collection->saveObligatoryMaterials((array)
$_POST[
'grp']);
323 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
328 $this->ctrl->redirect($this,
'show');
330 catch(UnexpectedValueException $e) {
333 $this->ctrl->redirect($this,
'show');
339 include_once
"Services/MetaData/classes/class.ilMD.php";
340 foreach(
$_POST[
'tlt'] as $item_id => $item)
343 if(!is_object($md_section = $md_obj->getEducational()))
345 $md_section = $md_obj->addEducational();
348 $md_section->setPhysicalTypicalLearningTime((
int)$item[
'mo'],
349 (
int)$item[
'd'],(
int)$item[
'h'],(
int)$item[
'm'],0);
350 $md_section->update();
354 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
358 $this->ctrl->redirect($this,
'show');
Class ilLPListOfSettingsGUI.
__construct($a_mode, $a_ref_id)
initFormSettings()
Init property form.
assign()
Save material assignment.
show()
Show settings tables.
saveObligatoryMaterials()
Save obligatory state per grouped materials.
groupMaterials()
Group materials.
getTableByMode()
Get tables by mode.
saveSettings()
Save learning progress settings.
deassign()
save mterial assignment
& executeCommand()
execute command
const LP_MODE_MANUAL_BY_TUTOR
_refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static _getValidTimeSpan()
static getInstance($a_obj_id)
This class represents an option in a radio group.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.