ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLPListOfSettingsGUI Class Reference

Class ilLPListOfSettingsGUI. More...

+ Inheritance diagram for ilLPListOfSettingsGUI:
+ Collaboration diagram for ilLPListOfSettingsGUI:

Public Member Functions

 __construct ($a_mode, $a_ref_id)
 
 executeCommand ()
 execute command More...
 
- Public Member Functions inherited from ilLearningProgressBaseGUI
 __construct ($a_mode, $a_ref_id=0, $a_usr_id=0)
 
 isAnonymized ()
 
 getMode ()
 
 getRefId ()
 
 getObjId ()
 
 getUserId ()
 
 __getDefaultCommand ()
 
 __setSubTabs ($a_active)
 
 __buildFooter ()
 
 __buildHeader ()
 
 __insertPath (&$a_tpl, $a_ref_id)
 insert path More...
 
 __showImageByStatus (&$tpl, $a_status, $tpl_prefix="")
 
__initTableGUI ()
 
 __showObjectDetails (&$info, $item_id=0, $add_section=true)
 show details about current object. More...
 
 __appendUserInfo (&$info, $a_user)
 
 __appendLPDetails (&$info, $item_id, $user_id)
 
 __sort ($a_ids, $a_table, $a_field, $a_id_name)
 Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname. More...
 
 __getPercent ($max, $reached)
 
 __readItemStatusInfo ($a_items)
 
 __getLegendHTML ()
 
 __showEditUser ($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
 
 __updateUser ($user_id, $obj_id)
 

Protected Member Functions

 show ()
 Show settings tables. More...
 
 initFormSettings ()
 Init property form. More...
 
 saveSettings ()
 Save learning progress settings. More...
 
 getTableByMode ()
 Get tables by mode. More...
 
 assign ()
 Save material assignment. More...
 
 deassign ()
 save mterial assignment More...
 
 groupMaterials ()
 Group materials. More...
 
 releaseMaterials ()
 
 saveObligatoryMaterials ()
 Save obligatory state per grouped materials. More...
 
 updateTLT ()
 
 getLPPathInfo ($a_ref_id, array &$a_res)
 Gather LP data about parent objects. More...
 
 handleLPUsageInfo ()
 
- Protected Member Functions inherited from ilLearningProgressBaseGUI
 initEditUserForm ($a_user_id, $a_obj_id, $a_cancel=null)
 

Protected Attributes

 $obj_settings
 
 $obj_lp
 
- Protected Attributes inherited from ilLearningProgressBaseGUI
 $anonymized
 
 $logger
 
 $tabs_gui
 

Additional Inherited Members

- Static Public Member Functions inherited from ilLearningProgressBaseGUI
static _showImageByStatus (&$tpl, $a_status, $tpl_prefix="")
 
static _getImagePathForStatus ($a_status)
 Get image path for status. More...
 
static _getStatusText ($a_status, $a_lng=null)
 Get status alt text. More...
 
static __readStatus ($a_obj_id, $user_id)
 
static isObjectOffline ($a_obj_id, $a_type=null)
 
- Data Fields inherited from ilLearningProgressBaseGUI
 $tpl = null
 
 $ctrl = null
 
 $lng = null
 
 $ref_id = 0
 
 $mode = 0
 
const LP_CONTEXT_PERSONAL_DESKTOP = 1
 
const LP_CONTEXT_ADMINISTRATION = 2
 
const LP_CONTEXT_REPOSITORY = 3
 
const LP_CONTEXT_USER_FOLDER = 4
 
const LP_CONTEXT_ORG_UNIT = 5
 
const LP_ACTIVE_SETTINGS = 1
 
const LP_ACTIVE_OBJECTS = 2
 
const LP_ACTIVE_PROGRESS = 3
 
const LP_ACTIVE_USERS = 5
 
const LP_ACTIVE_SUMMARY = 6
 
const LP_ACTIVE_OBJSTATACCESS = 7
 
const LP_ACTIVE_OBJSTATTYPES = 8
 
const LP_ACTIVE_OBJSTATDAILY = 9
 
const LP_ACTIVE_OBJSTATADMIN = 10
 
const LP_ACTIVE_MATRIX = 11
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLPListOfSettingsGUI::__construct (   $a_mode,
  $a_ref_id 
)

Definition at line 25 of file class.ilLPListOfSettingsGUI.php.

References ilObjectLP\getInstance(), and ilLearningProgressBaseGUI\getObjId().

26  {
27  parent::__construct($a_mode, $a_ref_id);
28 
29  $this->obj_settings = new ilLPObjSettings($this->getObjId());
30 
31  include_once './Services/Object/classes/class.ilObjectLP.php';
32  $this->obj_lp = ilObjectLP::getInstance($this->getObjId());
33  }
static getInstance($a_obj_id)
+ Here is the call graph for this function:

Member Function Documentation

◆ assign()

ilLPListOfSettingsGUI::assign ( )
protected

Save material assignment.

Returns
void

Definition at line 197 of file class.ilLPListOfSettingsGUI.php.

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLearningProgressBaseGUI\getObjId(), and ilUtil\sendFailure().

198  {
199  if (!$_POST['item_ids']) {
200  ilUtil::sendFailure($this->lng->txt('select_one'), true);
201  $this->ctrl->redirect($this, 'show');
202  }
203  if (count($_POST['item_ids'])) {
204  $collection = $this->obj_lp->getCollectionInstance();
205  if ($collection && $collection->hasSelectableItems()) {
206  $collection->activateEntries($_POST['item_ids']);
207  }
208 
209  // #15045 - has to be done before LP refresh!
210  $this->obj_lp->resetCaches();
211 
212  // refresh learning progress
213  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
215  }
216  ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'), true);
217  $this->ctrl->redirect($this, 'show');
218  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ deassign()

ilLPListOfSettingsGUI::deassign ( )
protected

save mterial assignment

Returns
void

Definition at line 224 of file class.ilLPListOfSettingsGUI.php.

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLearningProgressBaseGUI\getObjId(), and ilUtil\sendFailure().

225  {
226  if (!$_POST['item_ids']) {
227  ilUtil::sendFailure($this->lng->txt('select_one'), true);
228  $this->ctrl->redirect($this, 'show');
229  return false;
230  }
231  if (count($_POST['item_ids'])) {
232  $collection = $this->obj_lp->getCollectionInstance();
233  if ($collection && $collection->hasSelectableItems()) {
234  $collection->deactivateEntries($_POST['item_ids']);
235  }
236 
237  // #15045 - has to be done before LP refresh!
238  $this->obj_lp->resetCaches();
239 
240  // refresh learning progress
241  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
243  }
244  ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'), true);
245  $this->ctrl->redirect($this, 'show');
246  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ executeCommand()

ilLPListOfSettingsGUI::executeCommand ( )

execute command

Definition at line 38 of file class.ilLPListOfSettingsGUI.php.

References ilLearningProgressBaseGUI\__getDefaultCommand().

39  {
40  switch ($this->ctrl->getNextClass()) {
41  default:
42  $cmd = $this->__getDefaultCommand();
43  $this->$cmd();
44 
45  }
46  return true;
47  }
+ Here is the call graph for this function:

◆ getLPPathInfo()

ilLPListOfSettingsGUI::getLPPathInfo (   $a_ref_id,
array &  $a_res 
)
protected

Gather LP data about parent objects.

Parameters
int$a_ref_id
array$a_res
Returns
bool

Definition at line 363 of file class.ilLPListOfSettingsGUI.php.

References $DIC, $path, $tree, ilObjectLP\getInstance(), and ilObjectLP\isSupportedObjectType().

Referenced by handleLPUsageInfo().

364  {
365  global $DIC;
366 
367  $tree = $DIC['tree'];
368 
369  $has_lp_parents = false;
370 
371  $path = $tree->getNodePath($a_ref_id);
372  array_shift($path); // root
373  foreach ($path as $node) {
374  $supports_lp = ilObjectLP::isSupportedObjectType($node["type"]);
375 
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"]
381  ,"lp" => false
382  ,"active" => false
383  );
384  }
385 
386  if (
387  $supports_lp &&
388  $node["child"] != $a_ref_id) {
389  $a_res[$node["child"]]["node"]["lp"] = true;
390  $has_lp_parents = true;
391 
392  $parent_obj_id = $node['obj_id'];
393  $parent_obj_lp = \ilObjectLP::getInstance($parent_obj_id);
394  $parent_collection = $parent_obj_lp->getCollectionInstance();
395  if (
396  $parent_collection &&
397  $parent_collection->hasSelectableItems() &&
398  $parent_collection->isAssignedEntry($a_ref_id)
399  ) {
400  $a_res[$node['child']]['node']['active'] = true;
401  }
402  }
403  }
404  return $has_lp_parents;
405  }
$path
Definition: aliased.php:25
global $DIC
Definition: saml.php:7
static isSupportedObjectType($a_type)
static getInstance($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTableByMode()

ilLPListOfSettingsGUI::getTableByMode ( )
protected

Get tables by mode.

Definition at line 182 of file class.ilLPListOfSettingsGUI.php.

References $table, and ilLearningProgressBaseGUI\getRefId().

Referenced by saveSettings(), and show().

183  {
184  $collection = $this->obj_lp->getCollectionInstance();
185  if ($collection && $collection->hasSelectableItems()) {
186  include_once "Services/Tracking/classes/repository_statistics/class.ilLPCollectionSettingsTableGUI.php";
187  $table = new ilLPCollectionSettingsTableGUI($this, 'show', $this->getRefId(), $this->obj_lp->getCurrentMode());
188  $table->parse($collection);
189  return $table->getHTML();
190  }
191  }
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ groupMaterials()

ilLPListOfSettingsGUI::groupMaterials ( )
protected

Group materials.

Definition at line 251 of file class.ilLPListOfSettingsGUI.php.

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLearningProgressBaseGUI\getObjId(), and ilUtil\sendFailure().

252  {
253  if (!count((array) $_POST['item_ids'])) {
254  ilUtil::sendFailure($this->lng->txt('select_one'), true);
255  $this->ctrl->redirect($this, 'show');
256  }
257 
258  $collection = $this->obj_lp->getCollectionInstance();
259  if ($collection && $collection->hasSelectableItems()) {
260  // Assign new grouping id
261  $collection->createNewGrouping((array) $_POST['item_ids']);
262 
263  // refresh learning progress
264  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
266  }
267 
268  ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'), true);
269  $this->ctrl->redirect($this, 'show');
270  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ handleLPUsageInfo()

ilLPListOfSettingsGUI::handleLPUsageInfo ( )
protected

Definition at line 407 of file class.ilLPListOfSettingsGUI.php.

References $_GET, $DIC, ilLearningProgressBaseGUI\$lng, PHPMailer\PHPMailer\$params, ilLearningProgressBaseGUI\$ref_id, ilLearningProgressBaseGUI\$tpl, ilLink\_getLink(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilPanelGUI\getInstance(), getLPPathInfo(), ilUtil\getTypeIconPath(), and ilPanelGUI\PANEL_STYLE_SECONDARY.

Referenced by show().

408  {
409  global $DIC;
410 
411  $lng = $DIC['lng'];
412  $ilAccess = $DIC['ilAccess'];
413 
414  $ref_id = $_GET["ref_id"];
415  if (!$ref_id) {
416  $ref_id = $_REQUEST["ref_id"];
417  }
418 
419  $coll = array();
420  if ($ref_id &&
421  $this->getLPPathInfo($ref_id, $coll)) {
422  include_once "Services/Link/classes/class.ilLink.php";
423 
424  $tpl = new ilTemplate("tpl.lp_obj_settings_tree_info.html", true, true, "Services/Tracking");
425 
426  $margin = 0;
427  $has_active = false;
428  foreach ($coll as $parent_ref_id => $parts) {
429  $node = $parts["node"];
430  $params = array();
431  if ($node["lp"]) {
432  if ($node["active"]) {
433  $tpl->touchBlock("parent_active_bl");
434  $has_active = true;
435  }
436 
437  $params["gotolp"] = 1;
438  }
439 
440  if ($ilAccess->checkAccess("read", "", $parent_ref_id) &&
441  $parent_ref_id != $ref_id) { // #17170
442  $tpl->setCurrentBlock("parent_link_bl");
443  $tpl->setVariable("PARENT_LINK_TITLE", $node["title"]);
444  $tpl->setVariable("PARENT_URL", ilLink::_getLink($parent_ref_id, $node["type"], $params));
445  $tpl->parseCurrentBlock();
446  } else {
447  $tpl->setCurrentBlock("parent_nolink_bl");
448  $tpl->setVariable("PARENT_NOLINK_TITLE", $node["title"]);
449  $tpl->parseCurrentBlock();
450  }
451 
452  $tpl->setCurrentBlock("parent_usage_bl");
453  $tpl->setVariable("PARENT_TYPE_URL", ilUtil::getTypeIconPath($node["type"], $node["obj_id"]));
454  $tpl->setVariable("PARENT_TYPE_ALT", $lng->txt("obj_" . $node["type"]));
455 
456  $tpl->setVariable("PARENT_STYLE", $node["lp"]
457  ? ''
458  : ' class="ilLPParentInfoListLPUnsupported"');
459  $tpl->setVariable("MARGIN", $margin);
460  $tpl->parseCurrentBlock();
461 
462  $margin += 25;
463  }
464 
465  if ($has_active) {
466  $tpl->setVariable("LEGEND", sprintf(
467  $lng->txt("trac_lp_settings_info_parent_legend"),
469  ));
470  }
471 
472  include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
473  $panel = ilPanelGUI::getInstance();
474  $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
475  $panel->setHeading($lng->txt("trac_lp_settings_info_parent_container"));
476  $panel->setBody($tpl->get());
477 
478  return $panel->getHTML();
479  }
480  }
getLPPathInfo($a_ref_id, array &$a_res)
Gather LP data about parent objects.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
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...
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static getInstance()
Get instance.
const PANEL_STYLE_SECONDARY
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSettings()

ilLPListOfSettingsGUI::initFormSettings ( )
protected

Init property form.

Returns
ilPropertyFormGUI $form

Definition at line 79 of file class.ilLPListOfSettingsGUI.php.

References $form, ilObjUserTracking\_getValidTimeSpan(), ilLPObjSettings\LP_MODE_VISITS, ilFormPropertyGUI\setRequired(), ilNumberInputGUI\setSize(), and ilRadioOption\setValue().

Referenced by saveSettings(), and show().

80  {
81  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
82  $form = new ilPropertyFormGUI();
83  $form->setTitle($this->lng->txt('tracking_settings'));
84  $form->setFormAction($this->ctrl->getFormAction($this));
85 
86  // Mode
87  $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
88  $mod->setRequired(true);
89  $mod->setValue($this->obj_lp->getCurrentMode());
90  $form->addItem($mod);
91 
92  foreach ($this->obj_lp->getValidModes() as $mode_key) {
93  $opt = new ilRadioOption(
94  $this->obj_lp->getModeText($mode_key),
95  $mode_key,
96  $this->obj_lp->getModeInfoText($mode_key)
97  );
98  $opt->setValue($mode_key);
99  $mod->addOption($opt);
100 
101  // :TODO: Subitem for visits ?!
102  if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) {
103  $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
104  $vis->setSize(3);
105  $vis->setMaxLength(4);
106  $vis->setInfo(sprintf(
107  $this->lng->txt('trac_visits_info'),
109  ));
110  $vis->setRequired(true);
111  $vis->setValue($this->obj_settings->getVisits());
112  $opt->addSubItem($vis);
113  }
114  }
115 
116  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
117 
118  return $form;
119  }
This class represents an option in a radio group.
This class represents a property form user interface.
This class represents a property in a property form.
setValue($a_value)
Set Value.
if(isset($_POST['submit'])) $form
This class represents a number property in a property form.
setSize($a_size)
Set Size.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ releaseMaterials()

ilLPListOfSettingsGUI::releaseMaterials ( )
protected

Definition at line 275 of file class.ilLPListOfSettingsGUI.php.

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLearningProgressBaseGUI\getObjId(), and ilUtil\sendFailure().

276  {
277  if (!count((array) $_POST['item_ids'])) {
278  ilUtil::sendFailure($this->lng->txt('select_one'), true);
279  $this->ctrl->redirect($this, 'show');
280  }
281 
282  $collection = $this->obj_lp->getCollectionInstance();
283  if ($collection && $collection->hasSelectableItems()) {
284  $collection->releaseGrouping((array) $_POST['item_ids']);
285 
286  // refresh learning progress
287  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
289  }
290 
291  ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'), true);
292  $this->ctrl->redirect($this, 'show');
293  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveObligatoryMaterials()

ilLPListOfSettingsGUI::saveObligatoryMaterials ( )
protected

Save obligatory state per grouped materials.

Definition at line 298 of file class.ilLPListOfSettingsGUI.php.

References $_POST, ilLPStatusWrapper\_refreshStatus(), ilLearningProgressBaseGUI\getObjId(), ilUtil\sendFailure(), and ilUtil\sendInfo().

299  {
300  if (!is_array((array) $_POST['grp'])) {
301  ilUtil::sendFailure($this->lng->txt('select_one'), true);
302  $this->ctrl->redirect($this, 'show');
303  }
304 
305  try {
306  $collection = $this->obj_lp->getCollectionInstance();
307  if ($collection && $collection->hasSelectableItems()) {
308  $collection->saveObligatoryMaterials((array) $_POST['grp']);
309 
310  // refresh learning progress
311  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
313  }
314 
315  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
316  $this->ctrl->redirect($this, 'show');
317  } catch (UnexpectedValueException $e) {
318  ilUtil::sendFailure($this->lng->txt('trac_grouped_material_obligatory_err'), true);
319  ilUtil::sendInfo($this->lng->txt('err_check_input'), true);
320  $this->ctrl->redirect($this, 'show');
321  }
322  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveSettings()

ilLPListOfSettingsGUI::saveSettings ( )
protected

Save learning progress settings.

Returns
void

Definition at line 125 of file class.ilLPListOfSettingsGUI.php.

References $form, getTableByMode(), initFormSettings(), ilLPObjSettings\LP_MODE_MANUAL_BY_TUTOR, ilLPObjSettings\LP_MODE_VISITS, ilUtil\sendFailure(), and ilUtil\sendInfo().

126  {
127  $form = $this->initFormSettings();
128  if ($form->checkInput()) {
129  // anything changed?
130 
131  // mode
132  $new_mode = (int) $form->getInput('modus');
133  $old_mode = $this->obj_lp->getCurrentMode();
134  $mode_changed = ($old_mode != $new_mode);
135 
136  // visits
137  $new_visits = null;
138  $visits_changed = null;
139  if ($new_mode == ilLPObjSettings::LP_MODE_VISITS) {
140  $new_visits = (int) $form->getInput('visits');
141  $old_visits = $this->obj_settings->getVisits();
142  $visits_changed = ($old_visits != $new_visits);
143  }
144 
145  if ($mode_changed) {
146  // delete existing collection
147  $collection = $this->obj_lp->getCollectionInstance();
148  if ($collection) {
149  $collection->delete();
150  }
151  }
152 
153  $refresh_lp = ($mode_changed || $visits_changed);
154 
155  // has to be done before LP refresh!
156  $this->obj_lp->resetCaches();
157 
158  $this->obj_settings->setMode($new_mode);
159  $this->obj_settings->setVisits($new_visits);
160  $this->obj_settings->update($refresh_lp);
161 
162  if ($mode_changed &&
163  $this->obj_lp->getCollectionInstance() &&
164  $new_mode != ilLPObjSettings::LP_MODE_MANUAL_BY_TUTOR) { // #14819
165  ilUtil::sendInfo($this->lng->txt('trac_edit_collection'), true);
166  }
167  ilUtil::sendSuccess($this->lng->txt('trac_settings_saved'), true);
168  $this->ctrl->redirect($this, 'show');
169  }
170 
171  $form->setValuesByPost();
172  ilUtil::sendFailure($this->lng->txt('err_check_input'));
173 
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());
177  }
initFormSettings()
Init property form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getTableByMode()
Get tables by mode.
+ Here is the call graph for this function:

◆ show()

ilLPListOfSettingsGUI::show ( )
protected

Show settings tables.

Definition at line 52 of file class.ilLPListOfSettingsGUI.php.

References $DIC, $form, $info, getTableByMode(), handleLPUsageInfo(), initFormSettings(), and ilUtil\sendInfo().

53  {
54  global $DIC;
55 
56  $ilHelp = $DIC['ilHelp'];
57 
58  $ilHelp->setSubScreenId("trac_settings");
59 
60  $info = $this->obj_lp->getSettingsInfo();
61  if ($info) {
63  }
64 
65  $form = $this->initFormSettings();
66  $this->tpl->setContent(
67  $this->handleLPUsageInfo() .
68  $form->getHTML() .
69  $this->getTableByMode()
70  );
71  }
global $DIC
Definition: saml.php:7
initFormSettings()
Init property form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
getTableByMode()
Get tables by mode.
$info
Definition: index.php:5
+ Here is the call graph for this function:

◆ updateTLT()

ilLPListOfSettingsGUI::updateTLT ( )
protected

Definition at line 324 of file class.ilLPListOfSettingsGUI.php.

References $_POST, ilLPStatusWrapper\_refreshStatus(), and ilLearningProgressBaseGUI\getObjId().

325  {
326  include_once "Services/MetaData/classes/class.ilMD.php";
327  foreach ($_POST['tlt'] as $item_id => $item) {
328  $md_obj = new ilMD($this->getObjId(), $item_id, 'st');
329  if (!is_object($md_section = $md_obj->getEducational())) {
330  $md_section = $md_obj->addEducational();
331  $md_section->save();
332  }
333  $md_section->setPhysicalTypicalLearningTime(
334  (int) $item['mo'],
335  (int) $item['d'],
336  (int) $item['h'],
337  (int) $item['m'],
338  0
339  );
340  $md_section->update();
341  }
342 
343  // refresh learning progress
344  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
346 
347  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
348  $this->ctrl->redirect($this, 'show');
349  }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $obj_lp

ilLPListOfSettingsGUI::$obj_lp
protected

Definition at line 23 of file class.ilLPListOfSettingsGUI.php.

◆ $obj_settings

ilLPListOfSettingsGUI::$obj_settings
protected

Definition at line 22 of file class.ilLPListOfSettingsGUI.php.


The documentation for this class was generated from the following file: