5 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
6 include_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));
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)
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);
159 if($mode_changed && $this->obj_lp->getCollectionInstance())
164 $this->ctrl->redirect($this,
'show');
167 $form->setValuesByPost();
170 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lp_obj_settings.html',
'Services/Tracking');
171 $this->tpl->setVariable(
'PROP_FORM',$form->getHTML());
172 $this->tpl->setVariable(
'COLLECTION_TABLE',$this->
getTableByMode());
180 $collection = $this->obj_lp->getCollectionInstance();
181 if($collection && $collection->hasSelectableItems())
183 include_once
"Services/Tracking/classes/repository_statistics/class.ilLPCollectionSettingsTableGUI.php";
185 $table->
parse($collection);
186 return $table->getHTML();
199 $this->ctrl->redirect($this,
'show');
201 if(count(
$_POST[
'item_ids']))
203 $collection = $this->obj_lp->getCollectionInstance();
204 if($collection && $collection->hasSelectableItems())
206 $collection->activateEntries(
$_POST[
'item_ids']);
210 $this->obj_lp->resetCaches();
213 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
217 $this->ctrl->redirect($this,
'show');
229 $this->ctrl->redirect($this,
'show');
232 if(count(
$_POST[
'item_ids']))
234 $collection = $this->obj_lp->getCollectionInstance();
235 if($collection && $collection->hasSelectableItems())
237 $collection->deactivateEntries(
$_POST[
'item_ids']);
241 $this->obj_lp->resetCaches();
244 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
248 $this->ctrl->redirect($this,
'show');
256 if(!count((array)
$_POST[
'item_ids']))
259 $this->ctrl->redirect($this,
'show');
262 $collection = $this->obj_lp->getCollectionInstance();
263 if($collection && $collection->hasSelectableItems())
266 $collection->createNewGrouping((array)$_POST[
'item_ids']);
269 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
274 $this->ctrl->redirect($this,
'show');
282 if(!count((array)
$_POST[
'item_ids']))
285 $this->ctrl->redirect($this,
'show');
288 $collection = $this->obj_lp->getCollectionInstance();
289 if($collection && $collection->hasSelectableItems())
291 $collection->releaseGrouping((array)$_POST[
'item_ids']);
294 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
299 $this->ctrl->redirect($this,
'show');
307 if(!is_array((array)
$_POST[
'grp']))
310 $this->ctrl->redirect($this,
'show');
315 $collection = $this->obj_lp->getCollectionInstance();
316 if($collection && $collection->hasSelectableItems())
318 $collection->saveObligatoryMaterials((array)$_POST[
'grp']);
321 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
326 $this->ctrl->redirect($this,
'show');
328 catch(UnexpectedValueException $e) {
331 $this->ctrl->redirect($this,
'show');
337 include_once
"Services/MetaData/classes/class.ilMD.php";
338 foreach(
$_POST[
'tlt'] as $item_id => $item)
341 if(!is_object($md_section = $md_obj->getEducational()))
343 $md_section = $md_obj->addEducational();
346 $md_section->setPhysicalTypicalLearningTime((
int)$item[
'mo'],
347 (
int)$item[
'd'],(
int)$item[
'h'],(
int)$item[
'm'],0);
348 $md_section->update();
352 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
356 $this->ctrl->redirect($this,
'show');
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a radio group.
saveSettings()
Save learning progress settings.
deassign()
save mterial assignment
show()
Show settings tables.
Class ilLPListOfSettingsGUI.
initFormSettings()
Init property form.
parse(ilLPCollection $a_collection)
Read and parse items.
__construct($a_mode, $a_ref_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setValue($a_value)
Set Value.
groupMaterials()
Group materials.
saveObligatoryMaterials()
Save obligatory state per grouped materials.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
assign()
Save material assignment.
getTableByMode()
Get tables by mode.
_refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static getInstance($a_obj_id)
& executeCommand()
execute command
static _getValidTimeSpan()