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 $info = $this->obj_lp->getSettingsInfo();
66 $this->tpl->setContent(
69 $this->getTableByMode());
80 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
82 $form->setTitle($this->lng->txt(
'tracking_settings'));
83 $form->setFormAction($this->ctrl->getFormAction($this));
87 $mod->setRequired(
true);
88 $mod->setValue($this->obj_lp->getCurrentMode());
91 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);
106 $vis->setMaxLength(4);
107 $vis->setInfo(sprintf($this->lng->txt(
'trac_visits_info'),
109 $vis->setRequired(
true);
110 $vis->setValue($this->obj_settings->getVisits());
111 $opt->addSubItem($vis);
115 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
127 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;
141 $new_visits = (int)$form->getInput(
'visits');
142 $old_visits = $this->obj_settings->getVisits();
143 $visits_changed = ($old_visits != $new_visits);
149 $collection = $this->obj_lp->getCollectionInstance();
152 $collection->delete();
156 $refresh_lp = ($mode_changed || $visits_changed);
159 $this->obj_lp->resetCaches();
161 $this->obj_settings->setMode($new_mode);
162 $this->obj_settings->setVisits($new_visits);
163 $this->obj_settings->update($refresh_lp);
166 $this->obj_lp->getCollectionInstance() &&
172 $this->ctrl->redirect($this,
'show');
175 $form->setValuesByPost();
178 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lp_obj_settings.html',
'Services/Tracking');
179 $this->tpl->setVariable(
'PROP_FORM',$form->getHTML());
180 $this->tpl->setVariable(
'COLLECTION_TABLE',$this->
getTableByMode());
188 $collection = $this->obj_lp->getCollectionInstance();
189 if($collection && $collection->hasSelectableItems())
191 include_once
"Services/Tracking/classes/repository_statistics/class.ilLPCollectionSettingsTableGUI.php";
193 $table->parse($collection);
194 return $table->getHTML();
207 $this->ctrl->redirect($this,
'show');
209 if(count(
$_POST[
'item_ids']))
211 $collection = $this->obj_lp->getCollectionInstance();
212 if($collection && $collection->hasSelectableItems())
214 $collection->activateEntries(
$_POST[
'item_ids']);
218 $this->obj_lp->resetCaches();
221 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
225 $this->ctrl->redirect($this,
'show');
237 $this->ctrl->redirect($this,
'show');
240 if(count(
$_POST[
'item_ids']))
242 $collection = $this->obj_lp->getCollectionInstance();
243 if($collection && $collection->hasSelectableItems())
245 $collection->deactivateEntries(
$_POST[
'item_ids']);
249 $this->obj_lp->resetCaches();
252 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
256 $this->ctrl->redirect($this,
'show');
264 if(!count((array)
$_POST[
'item_ids']))
267 $this->ctrl->redirect($this,
'show');
270 $collection = $this->obj_lp->getCollectionInstance();
271 if($collection && $collection->hasSelectableItems())
274 $collection->createNewGrouping((array)
$_POST[
'item_ids']);
277 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
282 $this->ctrl->redirect($this,
'show');
290 if(!count((array)
$_POST[
'item_ids']))
293 $this->ctrl->redirect($this,
'show');
296 $collection = $this->obj_lp->getCollectionInstance();
297 if($collection && $collection->hasSelectableItems())
299 $collection->releaseGrouping((array)
$_POST[
'item_ids']);
302 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
307 $this->ctrl->redirect($this,
'show');
315 if(!is_array((array)
$_POST[
'grp']))
318 $this->ctrl->redirect($this,
'show');
323 $collection = $this->obj_lp->getCollectionInstance();
324 if($collection && $collection->hasSelectableItems())
326 $collection->saveObligatoryMaterials((array)
$_POST[
'grp']);
329 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
334 $this->ctrl->redirect($this,
'show');
336 catch(UnexpectedValueException $e) {
339 $this->ctrl->redirect($this,
'show');
345 include_once
"Services/MetaData/classes/class.ilMD.php";
346 foreach(
$_POST[
'tlt'] as $item_id => $item)
349 if(!is_object($md_section = $md_obj->getEducational()))
351 $md_section = $md_obj->addEducational();
354 $md_section->setPhysicalTypicalLearningTime((
int)$item[
'mo'],
355 (
int)$item[
'd'],(
int)$item[
'h'],(
int)$item[
'm'],0);
356 $md_section->update();
360 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
364 $this->ctrl->redirect($this,
'show');
383 $has_lp_parents =
false;
385 $path = $tree->getNodePath($a_ref_id);
387 foreach(
$path as $node)
391 if($supports_lp || $has_lp_parents)
393 $a_res[$node[
"child"]][
"node"] = array(
394 "type" => $node[
"type"]
395 ,
"title" => $node[
"title"]
396 ,
"obj_id" => $node[
"obj_id"]
403 $node[
"child"] != $a_ref_id)
405 $a_res[$node[
"child"]][
"node"][
"lp"] =
true;
406 $has_lp_parents =
true;
408 $parent_obj_id = $node[
"obj_id"];
412 $parent_collection = $parent_obj_lp->getCollectionInstance();
413 if($parent_collection &&
414 $parent_collection->hasSelectableItems() &&
415 $parent_collection->isAssignedEntry($a_ref_id))
417 $a_res[$node[
"child"]][
"node"][
"active"] =
true;
422 foreach($parent_collection->getTableGUIData($node[
"parent"]) as $item)
429 foreach($item[
"grouped"] as $group_item)
431 if($group_item[
"ref_id"] == $a_ref_id)
437 $grp_tmp[$group_item[
"ref_id"]] = array(
438 "type" => $group_item[
"type"]
439 ,
"title" => $group_item[
"title"]
440 ,
"obj_id" => $group_item[
"obj_id"]
445 if(
sizeof($grp_tmp) ||
448 if($item[
"ref_id"] == $a_ref_id)
458 $group[$item[
"ref_id"]] = array(
459 "type" => $item[
"type"]
460 ,
"title" => $item[
"title"]
461 ,
"obj_id" => $item[
"obj_id"]
466 $a_res[$node[
"child"]][
"group"] = $group;
472 return $has_lp_parents;
477 global
$lng, $ilAccess;
489 include_once
"Services/Link/classes/class.ilLink.php";
491 $tpl =
new ilTemplate(
"tpl.lp_obj_settings_tree_info.html",
true,
true,
"Services/Tracking");
495 foreach($coll as $parent_ref_id => $parts)
528 $node = $parts[
"node"];
535 $tpl->touchBlock(
"parent_active_bl");
542 if($ilAccess->checkAccess(
"read",
"", $parent_ref_id) &&
545 $tpl->setCurrentBlock(
"parent_link_bl");
546 $tpl->setVariable(
"PARENT_LINK_TITLE", $node[
"title"]);
548 $tpl->parseCurrentBlock();
552 $tpl->setCurrentBlock(
"parent_nolink_bl");
553 $tpl->setVariable(
"PARENT_NOLINK_TITLE", $node[
"title"]);
554 $tpl->parseCurrentBlock();
557 $tpl->setCurrentBlock(
"parent_usage_bl");
559 $tpl->setVariable(
"PARENT_TYPE_ALT",
$lng->txt(
"obj_".$node[
"type"]));
561 $tpl->setVariable(
"PARENT_STYLE", $node[
"lp"]
563 :
' class="ilLPParentInfoListLPUnsupported"');
564 $tpl->setVariable(
"MARGIN", $margin);
565 $tpl->parseCurrentBlock();
572 $tpl->setVariable(
"LEGEND", sprintf(
573 $lng->txt(
"trac_lp_settings_info_parent_legend"),
578 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
581 $panel->setHeading(
$lng->txt(
"trac_lp_settings_info_parent_container"));
582 $panel->setBody(
$tpl->get());
584 return $panel->getHTML();
LP collection of repository objects.
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.
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 _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 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.
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($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']