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->setSubScreenId(
"trac_settings");
58 $info = $this->obj_lp->getSettingsInfo();
64 $this->tpl->setContent(
67 $this->getTableByMode()
79 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
81 $form->setTitle($this->lng->txt(
'tracking_settings'));
82 $form->setFormAction($this->ctrl->getFormAction($this));
86 $mod->setRequired(
true);
87 $mod->setValue($this->obj_lp->getCurrentMode());
90 foreach ($this->obj_lp->getValidModes() as $mode_key) {
92 $this->obj_lp->getModeText($mode_key),
94 $this->obj_lp->getModeInfoText($mode_key)
96 $opt->setValue($mode_key);
97 $mod->addOption($opt);
103 $vis->setMaxLength(4);
105 $this->lng->txt(
'trac_visits_info'),
108 $vis->setRequired(
true);
109 $vis->setValue($this->obj_settings->getVisits());
110 $opt->addSubItem($vis);
114 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
126 if (
$form->checkInput()) {
130 $new_mode = (int)
$form->getInput(
'modus');
131 $old_mode = $this->obj_lp->getCurrentMode();
132 $mode_changed = ($old_mode != $new_mode);
136 $visits_changed =
null;
138 $new_visits = (int)
$form->getInput(
'visits');
139 $old_visits = $this->obj_settings->getVisits();
140 $visits_changed = ($old_visits != $new_visits);
145 $collection = $this->obj_lp->getCollectionInstance();
147 $collection->delete();
151 $refresh_lp = ($mode_changed || $visits_changed);
154 $this->obj_lp->resetCaches();
156 $this->obj_settings->setMode($new_mode);
157 $this->obj_settings->setVisits($new_visits);
158 $this->obj_settings->update($refresh_lp);
161 $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()) {
184 include_once
"Services/Tracking/classes/repository_statistics/class.ilLPCollectionSettingsTableGUI.php";
186 $table->parse($collection);
197 if (!
$_POST[
'item_ids']) {
199 $this->ctrl->redirect($this,
'show');
201 if (count(
$_POST[
'item_ids'])) {
202 $collection = $this->obj_lp->getCollectionInstance();
203 if ($collection && $collection->hasSelectableItems()) {
204 $collection->activateEntries(
$_POST[
'item_ids']);
208 $this->obj_lp->resetCaches();
211 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
215 $this->ctrl->redirect($this,
'show');
224 if (!
$_POST[
'item_ids']) {
226 $this->ctrl->redirect($this,
'show');
229 if (count(
$_POST[
'item_ids'])) {
230 $collection = $this->obj_lp->getCollectionInstance();
231 if ($collection && $collection->hasSelectableItems()) {
232 $collection->deactivateEntries(
$_POST[
'item_ids']);
236 $this->obj_lp->resetCaches();
239 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
243 $this->ctrl->redirect($this,
'show');
251 if (!count((array)
$_POST[
'item_ids'])) {
253 $this->ctrl->redirect($this,
'show');
256 $collection = $this->obj_lp->getCollectionInstance();
257 if ($collection && $collection->hasSelectableItems()) {
259 $collection->createNewGrouping((array)
$_POST[
'item_ids']);
262 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
267 $this->ctrl->redirect($this,
'show');
275 if (!count((array)
$_POST[
'item_ids'])) {
277 $this->ctrl->redirect($this,
'show');
280 $collection = $this->obj_lp->getCollectionInstance();
281 if ($collection && $collection->hasSelectableItems()) {
282 $collection->releaseGrouping((array)
$_POST[
'item_ids']);
285 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
290 $this->ctrl->redirect($this,
'show');
298 if (!is_array((array)
$_POST[
'grp'])) {
300 $this->ctrl->redirect($this,
'show');
304 $collection = $this->obj_lp->getCollectionInstance();
305 if ($collection && $collection->hasSelectableItems()) {
306 $collection->saveObligatoryMaterials((array)
$_POST[
'grp']);
309 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
314 $this->ctrl->redirect($this,
'show');
315 }
catch (UnexpectedValueException $e) {
318 $this->ctrl->redirect($this,
'show');
324 include_once
"Services/MetaData/classes/class.ilMD.php";
325 foreach (
$_POST[
'tlt'] as $item_id => $item) {
327 if (!is_object($md_section = $md_obj->getEducational())) {
328 $md_section = $md_obj->addEducational();
331 $md_section->setPhysicalTypicalLearningTime(
338 $md_section->update();
342 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
346 $this->ctrl->redirect($this,
'show');
365 $has_lp_parents =
false;
367 $path = $tree->getNodePath($a_ref_id);
369 foreach (
$path as $node) {
372 if ($supports_lp || $has_lp_parents) {
373 $a_res[$node[
"child"]][
"node"] = array(
374 "type" => $node[
"type"]
375 ,
"title" => $node[
"title"]
376 ,
"obj_id" => $node[
"obj_id"]
383 $node[
"child"] != $a_ref_id) {
384 $a_res[$node[
"child"]][
"node"][
"lp"] =
true;
385 $has_lp_parents =
true;
387 $parent_obj_id = $node[
"obj_id"];
391 $parent_collection = $parent_obj_lp->getCollectionInstance();
392 if ($parent_collection &&
393 $parent_collection->hasSelectableItems() &&
394 $parent_collection->isAssignedEntry($a_ref_id)) {
395 $a_res[$node[
"child"]][
"node"][
"active"] =
true;
399 foreach ($parent_collection->getTableGUIData($node[
"parent"]) as $item) {
402 if ($item[
"grouped"]) {
404 foreach ($item[
"grouped"] as $group_item) {
405 if ($group_item[
"ref_id"] == $a_ref_id) {
408 $grp_tmp[$group_item[
"ref_id"]] = array(
409 "type" => $group_item[
"type"]
410 ,
"title" => $group_item[
"title"]
411 ,
"obj_id" => $group_item[
"obj_id"]
416 if (
sizeof($grp_tmp) ||
418 if ($item[
"ref_id"] == $a_ref_id) {
425 $group[$item[
"ref_id"]] = array(
426 "type" => $item[
"type"]
427 ,
"title" => $item[
"title"]
428 ,
"obj_id" => $item[
"obj_id"]
433 $a_res[$node[
"child"]][
"group"] = $group;
439 return $has_lp_parents;
444 global
$lng, $ilAccess;
454 include_once
"Services/Link/classes/class.ilLink.php";
456 $tpl =
new ilTemplate(
"tpl.lp_obj_settings_tree_info.html",
true,
true,
"Services/Tracking");
460 foreach ($coll as $parent_ref_id => $parts) {
492 $node = $parts[
"node"];
496 if ($node[
"active"]) {
497 $tpl->touchBlock(
"parent_active_bl");
504 if ($ilAccess->checkAccess(
"read",
"", $parent_ref_id) &&
506 $tpl->setCurrentBlock(
"parent_link_bl");
507 $tpl->setVariable(
"PARENT_LINK_TITLE", $node[
"title"]);
509 $tpl->parseCurrentBlock();
511 $tpl->setCurrentBlock(
"parent_nolink_bl");
512 $tpl->setVariable(
"PARENT_NOLINK_TITLE", $node[
"title"]);
513 $tpl->parseCurrentBlock();
516 $tpl->setCurrentBlock(
"parent_usage_bl");
518 $tpl->setVariable(
"PARENT_TYPE_ALT",
$lng->txt(
"obj_" . $node[
"type"]));
520 $tpl->setVariable(
"PARENT_STYLE", $node[
"lp"]
522 :
' class="ilLPParentInfoListLPUnsupported"');
523 $tpl->setVariable(
"MARGIN", $margin);
524 $tpl->parseCurrentBlock();
531 $lng->txt(
"trac_lp_settings_info_parent_legend"),
536 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
539 $panel->setHeading(
$lng->txt(
"trac_lp_settings_info_parent_container"));
540 $panel->setBody(
$tpl->get());
542 return $panel->getHTML();
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
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.
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 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(empty($password)) $table
if(isset($_POST['submit'])) $form