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()) {
56 $ilHelp =
$DIC[
'ilHelp'];
58 $ilHelp->setSubScreenId(
"trac_settings");
60 $info = $this->obj_lp->getSettingsInfo();
66 $this->tpl->setContent(
69 $this->getTableByMode()
81 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
83 $form->setTitle($this->lng->txt(
'tracking_settings'));
84 $form->setFormAction($this->ctrl->getFormAction($this));
88 $mod->setRequired(
true);
89 $mod->setValue($this->obj_lp->getCurrentMode());
92 foreach ($this->obj_lp->getValidModes() as $mode_key) {
94 $this->obj_lp->getModeText($mode_key),
96 $this->obj_lp->getModeInfoText($mode_key)
98 $opt->setValue($mode_key);
99 $mod->addOption($opt);
105 $vis->setMaxLength(4);
106 $vis->setInfo(sprintf(
107 $this->lng->txt(
'trac_visits_info'),
110 $vis->setRequired(
true);
111 $vis->setValue($this->obj_settings->getVisits());
112 $opt->addSubItem($vis);
116 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
128 if (
$form->checkInput()) {
132 $new_mode = (int)
$form->getInput(
'modus');
133 $old_mode = $this->obj_lp->getCurrentMode();
134 $mode_changed = ($old_mode != $new_mode);
138 $visits_changed =
null;
140 $new_visits = (int)
$form->getInput(
'visits');
141 $old_visits = $this->obj_settings->getVisits();
142 $visits_changed = ($old_visits != $new_visits);
147 $collection = $this->obj_lp->getCollectionInstance();
149 $collection->delete();
153 $refresh_lp = ($mode_changed || $visits_changed);
156 $this->obj_lp->resetCaches();
158 $this->obj_settings->setMode($new_mode);
159 $this->obj_settings->setVisits($new_visits);
160 $this->obj_settings->update($refresh_lp);
163 $this->obj_lp->getCollectionInstance() &&
167 ilUtil::sendSuccess($this->lng->txt(
'trac_settings_saved'),
true);
168 $this->ctrl->redirect($this,
'show');
171 $form->setValuesByPost();
174 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lp_obj_settings.html',
'Services/Tracking');
175 $this->tpl->setVariable(
'PROP_FORM',
$form->getHTML());
176 $this->tpl->setVariable(
'COLLECTION_TABLE', $this->
getTableByMode());
184 $collection = $this->obj_lp->getCollectionInstance();
185 if ($collection && $collection->hasSelectableItems()) {
186 include_once
"Services/Tracking/classes/repository_statistics/class.ilLPCollectionSettingsTableGUI.php";
188 $table->parse($collection);
199 if (!
$_POST[
'item_ids']) {
201 $this->ctrl->redirect($this,
'show');
203 if (count(
$_POST[
'item_ids'])) {
204 $collection = $this->obj_lp->getCollectionInstance();
205 if ($collection && $collection->hasSelectableItems()) {
206 $collection->activateEntries(
$_POST[
'item_ids']);
210 $this->obj_lp->resetCaches();
213 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
216 ilUtil::sendSuccess($this->lng->txt(
'trac_settings_saved'),
true);
217 $this->ctrl->redirect($this,
'show');
226 if (!
$_POST[
'item_ids']) {
228 $this->ctrl->redirect($this,
'show');
231 if (count(
$_POST[
'item_ids'])) {
232 $collection = $this->obj_lp->getCollectionInstance();
233 if ($collection && $collection->hasSelectableItems()) {
234 $collection->deactivateEntries(
$_POST[
'item_ids']);
238 $this->obj_lp->resetCaches();
241 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
244 ilUtil::sendSuccess($this->lng->txt(
'trac_settings_saved'),
true);
245 $this->ctrl->redirect($this,
'show');
253 if (!count((array)
$_POST[
'item_ids'])) {
255 $this->ctrl->redirect($this,
'show');
258 $collection = $this->obj_lp->getCollectionInstance();
259 if ($collection && $collection->hasSelectableItems()) {
261 $collection->createNewGrouping((array)
$_POST[
'item_ids']);
264 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
268 ilUtil::sendSuccess($this->lng->txt(
'trac_settings_saved'),
true);
269 $this->ctrl->redirect($this,
'show');
277 if (!count((array)
$_POST[
'item_ids'])) {
279 $this->ctrl->redirect($this,
'show');
282 $collection = $this->obj_lp->getCollectionInstance();
283 if ($collection && $collection->hasSelectableItems()) {
284 $collection->releaseGrouping((array)
$_POST[
'item_ids']);
287 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
291 ilUtil::sendSuccess($this->lng->txt(
'trac_settings_saved'),
true);
292 $this->ctrl->redirect($this,
'show');
300 if (!is_array((array)
$_POST[
'grp'])) {
302 $this->ctrl->redirect($this,
'show');
306 $collection = $this->obj_lp->getCollectionInstance();
307 if ($collection && $collection->hasSelectableItems()) {
308 $collection->saveObligatoryMaterials((array)
$_POST[
'grp']);
311 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
315 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
316 $this->ctrl->redirect($this,
'show');
317 }
catch (UnexpectedValueException $e) {
320 $this->ctrl->redirect($this,
'show');
326 include_once
"Services/MetaData/classes/class.ilMD.php";
327 foreach (
$_POST[
'tlt'] as $item_id => $item) {
329 if (!is_object($md_section = $md_obj->getEducational())) {
330 $md_section = $md_obj->addEducational();
333 $md_section->setPhysicalTypicalLearningTime(
340 $md_section->update();
344 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
347 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
348 $this->ctrl->redirect($this,
'show');
369 $has_lp_parents =
false;
373 foreach (
$path as $node) {
376 if ($supports_lp || $has_lp_parents) {
377 $a_res[$node[
"child"]][
"node"] = array(
378 "type" => $node[
"type"]
379 ,
"title" => $node[
"title"]
380 ,
"obj_id" => $node[
"obj_id"]
388 $node[
"child"] != $a_ref_id) {
389 $a_res[$node[
"child"]][
"node"][
"lp"] =
true;
390 $has_lp_parents =
true;
392 $parent_obj_id = $node[
'obj_id'];
394 $parent_collection = $parent_obj_lp->getCollectionInstance();
396 $parent_collection &&
397 $parent_collection->hasSelectableItems() &&
398 $parent_collection->isAssignedEntry($a_ref_id)
400 $a_res[$node[
'child']][
'node'][
'active'] =
true;
404 return $has_lp_parents;
412 $ilAccess =
$DIC[
'ilAccess'];
422 include_once
"Services/Link/classes/class.ilLink.php";
424 $tpl =
new ilTemplate(
"tpl.lp_obj_settings_tree_info.html",
true,
true,
"Services/Tracking");
428 foreach ($coll as $parent_ref_id => $parts) {
429 $node = $parts[
"node"];
432 if ($node[
"active"]) {
433 $tpl->touchBlock(
"parent_active_bl");
440 if ($ilAccess->checkAccess(
"read",
"", $parent_ref_id) &&
442 $tpl->setCurrentBlock(
"parent_link_bl");
443 $tpl->setVariable(
"PARENT_LINK_TITLE", $node[
"title"]);
445 $tpl->parseCurrentBlock();
447 $tpl->setCurrentBlock(
"parent_nolink_bl");
448 $tpl->setVariable(
"PARENT_NOLINK_TITLE", $node[
"title"]);
449 $tpl->parseCurrentBlock();
452 $tpl->setCurrentBlock(
"parent_usage_bl");
454 $tpl->setVariable(
"PARENT_TYPE_ALT",
$lng->txt(
"obj_" . $node[
"type"]));
456 $tpl->setVariable(
"PARENT_STYLE", $node[
"lp"]
458 :
' class="ilLPParentInfoListLPUnsupported"');
459 $tpl->setVariable(
"MARGIN", $margin);
460 $tpl->parseCurrentBlock();
466 $tpl->setVariable(
"LEGEND", sprintf(
467 $lng->txt(
"trac_lp_settings_info_parent_legend"),
472 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
475 $panel->setHeading(
$lng->txt(
"trac_lp_settings_info_parent_container"));
476 $panel->setBody(
$tpl->get());
478 return $panel->getHTML();
An exception for terminatinating execution or to throw for unit testing.
Class ilLPListOfSettingsGUI.
__construct($a_mode, $a_ref_id)
getLPPathInfo($a_ref_id, array &$a_res)
Gather LP data about parent objects.
initFormSettings()
Init property form.
assign()
Save material assignment.
show()
Show settings tables.
saveObligatoryMaterials()
Save obligatory state per grouped materials.
executeCommand()
execute command
groupMaterials()
Group materials.
getTableByMode()
Get tables by mode.
saveSettings()
Save learning progress settings.
deassign()
save mterial assignment
const LP_MODE_MANUAL_BY_TUTOR
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getValidTimeSpan()
static isSupportedObjectType($a_type)
static getInstance($a_obj_id)
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
const PANEL_STYLE_SECONDARY
static getInstance()
Get instance.
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
if(empty($password)) $table
if(isset($_POST['submit'])) $form