4 include_once(
"./Services/Tracking/classes/class.ilLPTableBaseGUI.php");
5 require_once(
"./Services/Tracking/classes/class.ilLearningProgressGUI.php");
21 function __construct($a_parent_obj, $a_parent_cmd, $a_user =
"", $obj_ids = NULL, $details =
false, $mode = null, $personal_only =
false, $a_parent_id = null, $a_parent_ref_id = null, $lp_context = null)
25 $this->tracked_user = $a_user;
26 $this->obj_ids = $obj_ids;
27 $this->details = $details;
29 $this->parent_obj_id = $a_parent_id;
30 $this->lp_context = $lp_context;
35 $this->obj_id = $this->parent_obj_id;
36 $this->ref_id = $a_parent_ref_id;
39 $this->
setId(
"lpprgtbl");
41 parent::__construct($a_parent_obj, $a_parent_cmd);
47 $this->has_object_subitems =
true;
49 $user = $this->tracked_user;
56 $this->
addColumn($this->lng->txt(
"trac_title"),
"title",
"26%");
57 $this->
addColumn($this->lng->txt(
"status"),
"status",
"7%");
58 $this->
addColumn($this->lng->txt(
'trac_status_changed'),
'status_changed',
'10%');
59 $this->
addColumn($this->lng->txt(
"trac_percentage"),
"percentage",
"7%");
60 $this->
addColumn($this->lng->txt(
"trac_mark"),
"",
"5%");
61 $this->
addColumn($this->lng->txt(
"comment"),
"",
"10%");
62 $this->
addColumn($this->lng->txt(
"trac_mode"),
"",
"20%");
63 $this->
addColumn($this->lng->txt(
"path"),
"",
"20%");
64 $this->
addColumn($this->lng->txt(
"actions"),
"",
"5%");
66 $this->
setTitle(sprintf($this->lng->txt(
"trac_learning_progress_of"), $user->getFullName()));
70 $this->
addMultiCommand(
"hideSelected", $lng->txt(
"trac_hide_selected"));
76 include_once
'./Services/Object/classes/class.ilObjectLP.php';
78 $collection = $olp->getCollectionInstance();
91 $this->
setTitle($this->lng->txt(
"details"));
93 $this->
addColumn($this->lng->txt(
"trac_title"),
"title",
"31%");
94 $this->
addColumn($this->lng->txt(
"status"),
"status",
"7%");
98 $this->lng->loadLanguageModule(
'content');
99 $this->
addColumn($this->lng->txt(
'cont_score'),
'score',
'10%');
101 else if($this->has_object_subitems)
103 $this->
addColumn($this->lng->txt(
'trac_status_changed'),
'status_changed',
'10%');
104 $this->
addColumn($this->lng->txt(
"trac_percentage"),
"percentage",
"7%");
105 $this->
addColumn($this->lng->txt(
"trac_mark"),
"",
"5%");
106 $this->
addColumn($this->lng->txt(
"comment"),
"",
"10%");
107 $this->
addColumn($this->lng->txt(
"trac_mode"),
"",
"20%");
108 $this->
addColumn($this->lng->txt(
"path"),
"",
"20%");
113 $this->
setFormAction($ilCtrl->getFormActionByClass(get_class($this)));
114 $this->
setRowTemplate(
"tpl.lp_progress_list_row.html",
"Services/Tracking");
121 if($this->has_object_subitems)
127 if($this->tracked_user)
135 return ($a_field ==
"percentage");
140 $obj_ids = $this->obj_ids;
141 if(!$obj_ids && !$this->details)
143 switch($this->lp_context)
153 include_once
"Services/Object/classes/class.ilObjectLP.php";
158 unset($obj_ids[$obj_id]);
166 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
185 foreach(
$data as $idx => $item)
187 if(!$item[
"status"] && !$this->filter[
"status"] && !$this->details)
205 $data[$idx][
"percentage"] = -1;
222 $this->tpl->setCurrentBlock(
"column_checkbox");
223 $this->tpl->setVariable(
"OBJ_ID", $a_set[
"obj_id"]);
224 $this->tpl->parseCurrentBlock();
228 $this->tpl->setVariable(
"ICON_ALT", $this->lng->txt($a_set[
"type"]));
229 $this->tpl->setVariable(
"TITLE_TEXT", $a_set[
"title"]);
231 if($a_set[
"offline"])
233 $this->tpl->setCurrentBlock(
"offline");
234 $this->tpl->setVariable(
"TEXT_STATUS", $this->lng->txt(
"status"));
235 $this->tpl->setVariable(
"TEXT_OFFLINE", $this->lng->txt(
"offline"));
236 $this->tpl->parseCurrentBlock();
244 $this->tpl->setVariable(
'SCORE_VAL', $a_set[
"score"]);
246 else if($this->has_object_subitems)
248 $this->tpl->setCurrentBlock(
"status_details");
253 $this->tpl->setVariable(
"MODE_TEXT", $olp->getModeText($a_set[
"u_mode"]));
254 $this->tpl->setVariable(
"MARK_VALUE", $a_set[
"mark"]);
255 $this->tpl->setVariable(
"COMMENT_TEXT", $a_set[
"comment"]);
257 if($a_set[
"percentage"] < 0)
259 $this->tpl->setVariable(
"PERCENTAGE_VALUE",
"");
263 $this->tpl->setVariable(
"PERCENTAGE_VALUE", sprintf(
"%d%%", $a_set[
"percentage"]));
270 $this->tpl->setCurrentBlock(
"item_path");
271 foreach(
$path as $path_item)
273 $this->tpl->setVariable(
"PATH_ITEM", $path_item);
274 $this->tpl->parseCurrentBlock();
278 $this->tpl->parseCurrentBlock();
300 $this->tpl->setCurrentBlock(
'warning_img');
302 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
303 $this->tpl->parseCurrentBlock();
310 $this->tpl->setCurrentBlock(
"item_command");
311 $ilCtrl->setParameterByClass(get_class($this),
'hide', $a_set[
"obj_id"]);
312 $this->tpl->setVariable(
"HREF_COMMAND", $ilCtrl->getLinkTargetByClass(get_class($this),
'hide'));
313 $this->tpl->setVariable(
"TXT_COMMAND", $this->lng->txt(
'trac_hide'));
314 $this->tpl->parseCurrentBlock();
317 if($olp->getCollectionInstance() && $a_set[
"ref_ids"])
321 $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(),
'details_id',
$ref_id);
322 $this->tpl->setVariable(
"HREF_COMMAND", $ilCtrl->getLinkTargetByClass($ilCtrl->getCmdClass(),
'details'));
323 $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(),
'details_id',
'');
324 $this->tpl->setVariable(
"TXT_COMMAND", $this->lng->txt(
'trac_subitems'));
325 $this->tpl->parseCurrentBlock();
328 $this->tpl->setCurrentBlock(
"column_action");
329 $this->tpl->parseCurrentBlock();
336 $a_excel->
setCell($a_row, 0, $this->lng->txt(
"type"));
337 $a_excel->
setCell($a_row, 1, $this->lng->txt(
"trac_title"));
338 $a_excel->
setCell($a_row, 2, $this->lng->txt(
"status"));
339 $a_excel->
setCell($a_row, 3, $this->lng->txt(
"trac_status_changed"));
340 $a_excel->
setCell($a_row, 4, $this->lng->txt(
"trac_percentage"));
341 $a_excel->
setCell($a_row, 5, $this->lng->txt(
"trac_mark"));
342 $a_excel->
setCell($a_row, 6, $this->lng->txt(
"comment"));
343 $a_excel->
setCell($a_row, 7, $this->lng->txt(
"trac_mode"));
346 $a_excel->
setBold(
"A".$a_row.
":H".$a_row);
351 $a_excel->
setCell($a_row, 0, $this->lng->txt($a_set[
"type"]));
352 $a_excel->
setCell($a_row, 1, $a_set[
"title"]);
357 $a_excel->
setCell($a_row, 4, $a_set[
"percentage"].
"%");
358 $a_excel->
setCell($a_row, 5, $a_set[
"mark"]);
359 $a_excel->
setCell($a_row, 6, $a_set[
"comment"]);
380 $a_csv->addColumn($this->lng->txt(
"type"));
381 $a_csv->addColumn($this->lng->txt(
"trac_title"));
382 $a_csv->addColumn($this->lng->txt(
"status"));
383 $a_csv->addColumn($this->lng->txt(
"trac_status_changed"));
384 $a_csv->addColumn($this->lng->txt(
"trac_percentage"));
385 $a_csv->addColumn($this->lng->txt(
"trac_mark"));
386 $a_csv->addColumn($this->lng->txt(
"comment"));
387 $a_csv->addColumn($this->lng->txt(
"trac_mode"));
394 $a_csv->addColumn($this->lng->txt($a_set[
"type"]));
395 $a_csv->addColumn($a_set[
"title"]);
402 $a_csv->addColumn(sprintf(
"%d%%", $a_set[
"percentage"]));
403 $a_csv->addColumn($a_set[
"mark"]);
404 $a_csv->addColumn($a_set[
"comment"]);
const LP_STATUS_COMPLETED_NUM
fillRowExcel(ilExcel $a_excel, &$a_row, $a_set)
buildPath($ref_ids)
Build path with deep-link.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExportFormats(array $formats)
Set available export formats.
static _getImagePathForStatus($a_status)
Get image path for status.
fillHeaderExcel(ilExcel $a_excel, &$a_row)
setShowTemplates($a_value)
Toggle templates.
setEnableNumInfo($a_val)
Set enable num info.
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
searchObjects(array $filter, $permission, array $preset_obj_ids=null, $a_check_lp_activation=true)
Search objects that match current filters.
const LP_MODE_COLLECTION_MANUAL
static resetToDefaults()
reset to defaults
static setUseRelativeDates($a_status)
set use relative dates
const LP_MODE_COLLECTION_TLT
static getObjectsStatusForUser($a_user_id, array $obj_refs)
TableGUI class for learning progress.
fillRowCSV($a_csv, $a_set)
initBaseFilter($a_split_learning_resources=false, $a_include_no_status_filter=true)
Init filter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
LP collection of repository objects.
static getSCOsStatusForUser($a_user_id, $a_parent_obj_id, array $a_sco_ids)
TableGUI class for learning progress.
setBold($a_coords)
Set cell(s) to bold.
static getSubItemsStatusForUser($a_user_id, $a_parent_obj_id, array $a_item_ids)
Get subitems status.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static isObjectOffline($a_obj_id, $a_type=null)
fillRow($a_set)
Fill table row.
addMultiCommand($a_cmd, $a_text)
Add Command button.
static formatDate(ilDateTime $date)
Format a date public.
isPercentageAvailable($a_obj_id)
const LP_CONTEXT_ORG_UNIT
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setCell($a_row, $a_col, $a_value)
Set cell value.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static getObjectivesStatusForUser($a_user_id, $a_obj_id, array $a_objective_ids)
numericOrdering($a_field)
const LP_MODE_COLLECTION_MOBS
showTimingsWarning($a_ref_id, $a_user_id)
setEnableHeader($a_enableheader)
Set Enable Header.
__construct($a_parent_obj, $a_parent_cmd, $a_user="", $obj_ids=NULL, $details=false, $mode=null, $personal_only=false, $a_parent_id=null, $a_parent_ref_id=null, $lp_context=null)
Constructor.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
static getLPMemberships($a_usr_id, array $a_obj_ids, $a_parent_ref_id=null, $a_mapped_ref_ids=false)
Get all objects where given user is member (from LP POV)
getCurrentFilter($as_query=false)
setEnableTitle($a_enabletitle)
Set Enable Title.
static getInstance($a_obj_id)
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setLimit($a_limit=0, $a_default_limit=0)
static _mode2Text($a_mode)