4 include_once(
"./Services/Tracking/classes/class.ilLPTableBaseGUI.php");
5 require_once(
"./Services/Tracking/classes/class.ilLearningProgressGUI.php");
21 public 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)
29 $this->tracked_user = $a_user;
30 $this->obj_ids = $obj_ids;
31 $this->details = $details;
33 $this->parent_obj_id = $a_parent_id;
34 $this->lp_context = $lp_context;
38 $this->obj_id = $this->parent_obj_id;
39 $this->ref_id = $a_parent_ref_id;
42 $this->
setId(
"lpprgtbl");
44 parent::__construct($a_parent_obj, $a_parent_cmd);
48 if (!$this->details) {
49 $this->has_object_subitems =
true;
51 $user = $this->tracked_user;
57 $this->
addColumn($this->lng->txt(
"trac_title"),
"title",
"26%");
58 $this->
addColumn($this->lng->txt(
"status"),
"status",
"7%");
59 $this->
addColumn($this->lng->txt(
'trac_status_changed'),
'status_changed',
'10%');
60 $this->
addColumn($this->lng->txt(
"trac_percentage"),
"percentage",
"7%");
61 $this->
addColumn($this->lng->txt(
"trac_mark"),
"",
"5%");
62 $this->
addColumn($this->lng->txt(
"comment"),
"",
"10%");
63 $this->
addColumn($this->lng->txt(
"trac_mode"),
"",
"20%");
64 $this->
addColumn($this->lng->txt(
"path"),
"",
"20%");
65 $this->
addColumn($this->lng->txt(
"actions"),
"",
"5%");
67 $this->
setTitle(sprintf($this->lng->txt(
"trac_learning_progress_of"),
$user->getFullName()));
75 include_once
'./Services/Object/classes/class.ilObjectLP.php';
77 $collection = $olp->getCollectionInstance();
90 $this->
setTitle($this->lng->txt(
"details"));
92 $this->
addColumn($this->lng->txt(
"trac_title"),
"title",
"31%");
93 $this->
addColumn($this->lng->txt(
"status"),
"status",
"7%");
96 $this->lng->loadLanguageModule(
'content');
97 $this->
addColumn($this->lng->txt(
'cont_score'),
'score',
'10%');
98 } elseif ($this->has_object_subitems) {
99 $this->
addColumn($this->lng->txt(
'trac_status_changed'),
'status_changed',
'10%');
100 $this->
addColumn($this->lng->txt(
"trac_percentage"),
"percentage",
"7%");
101 $this->
addColumn($this->lng->txt(
"trac_mark"),
"",
"5%");
102 $this->
addColumn($this->lng->txt(
"comment"),
"",
"10%");
103 $this->
addColumn($this->lng->txt(
"trac_mode"),
"",
"20%");
104 $this->
addColumn($this->lng->txt(
"path"),
"",
"20%");
110 $this->
setRowTemplate(
"tpl.lp_progress_list_row.html",
"Services/Tracking");
117 if ($this->has_object_subitems) {
122 if ($this->tracked_user) {
129 return ($a_field ==
"percentage");
134 $obj_ids = $this->obj_ids;
135 if (!$obj_ids && !$this->details) {
136 switch ($this->lp_context) {
145 include_once
"Services/Object/classes/class.ilObjectLP.php";
148 unset($obj_ids[$obj_id]);
155 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
156 switch ($this->mode) {
173 foreach (
$data as $idx => $item) {
174 if (!$item[
"status"] && !$this->filter[
"status"] && !$this->details) {
187 $data[$idx][
"percentage"] = -1;
204 if (!$this->details) {
205 $this->tpl->setCurrentBlock(
"column_checkbox");
206 $this->tpl->setVariable(
"OBJ_ID", $a_set[
"obj_id"]);
207 $this->tpl->parseCurrentBlock();
210 $this->tpl->setVariable(
"ICON_SRC", ilObject::_getIcon(
"",
"tiny", $a_set[
"type"]));
211 $this->tpl->setVariable(
"ICON_ALT", $this->lng->txt($a_set[
"type"]));
212 $this->tpl->setVariable(
"TITLE_TEXT", $a_set[
"title"]);
214 if ($a_set[
"offline"]) {
215 $this->tpl->setCurrentBlock(
"offline");
216 $this->tpl->setVariable(
"TEXT_STATUS", $this->lng->txt(
"status"));
217 $this->tpl->setVariable(
"TEXT_OFFLINE", $this->lng->txt(
"offline"));
218 $this->tpl->parseCurrentBlock();
225 $this->tpl->setVariable(
'SCORE_VAL', $a_set[
"score"]);
226 } elseif ($this->has_object_subitems) {
227 $this->tpl->setCurrentBlock(
"status_details");
232 $this->tpl->setVariable(
"MODE_TEXT", $olp->getModeText($a_set[
"u_mode"]));
233 $this->tpl->setVariable(
"MARK_VALUE", $a_set[
"mark"]);
234 $this->tpl->setVariable(
"COMMENT_TEXT", $a_set[
"comment"]);
236 if ($a_set[
"percentage"] < 0) {
237 $this->tpl->setVariable(
"PERCENTAGE_VALUE",
"");
239 $this->tpl->setVariable(
"PERCENTAGE_VALUE", sprintf(
"%d%%", $a_set[
"percentage"]));
245 $this->tpl->setCurrentBlock(
"item_path");
246 foreach (
$path as $path_item) {
247 $this->tpl->setVariable(
"PATH_ITEM", $path_item);
248 $this->tpl->parseCurrentBlock();
252 $this->tpl->parseCurrentBlock();
259 $ref_id = $a_set[
"ref_ids"];
260 $ref_id = array_shift($ref_id);
263 if ($timing !==
true) {
268 $this->tpl->setCurrentBlock(
'warning_img');
270 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed') . $timing);
271 $this->tpl->parseCurrentBlock();
276 if (!$this->details) {
277 $this->tpl->setCurrentBlock(
"item_command");
278 $ilCtrl->setParameterByClass(get_class($this),
'hide', $a_set[
"obj_id"]);
279 $this->tpl->setVariable(
"HREF_COMMAND",
$ilCtrl->getLinkTargetByClass(get_class($this),
'hide'));
280 $this->tpl->setVariable(
"TXT_COMMAND", $this->lng->txt(
'trac_hide'));
281 $this->tpl->parseCurrentBlock();
284 if ($olp->getCollectionInstance() && $a_set[
"ref_ids"]) {
285 $ref_id = $a_set[
"ref_ids"];
286 $ref_id = array_shift($ref_id);
287 $ilCtrl->setParameterByClass(
$ilCtrl->getCmdClass(),
'details_id', $ref_id);
288 $this->tpl->setVariable(
"HREF_COMMAND",
$ilCtrl->getLinkTargetByClass(
$ilCtrl->getCmdClass(),
'details'));
289 $ilCtrl->setParameterByClass(
$ilCtrl->getCmdClass(),
'details_id',
'');
290 $this->tpl->setVariable(
"TXT_COMMAND", $this->lng->txt(
'trac_subitems'));
291 $this->tpl->parseCurrentBlock();
294 $this->tpl->setCurrentBlock(
"column_action");
295 $this->tpl->parseCurrentBlock();
302 $a_excel->
setCell($a_row, 0, $this->lng->txt(
"type"));
303 $a_excel->
setCell($a_row, 1, $this->lng->txt(
"trac_title"));
304 $a_excel->
setCell($a_row, 2, $this->lng->txt(
"status"));
305 $a_excel->
setCell($a_row, 3, $this->lng->txt(
"trac_status_changed"));
306 $a_excel->
setCell($a_row, 4, $this->lng->txt(
"trac_percentage"));
307 $a_excel->
setCell($a_row, 5, $this->lng->txt(
"trac_mark"));
308 $a_excel->
setCell($a_row, 6, $this->lng->txt(
"comment"));
309 $a_excel->
setCell($a_row, 7, $this->lng->txt(
"trac_mode"));
312 $a_excel->
setBold(
"A" . $a_row .
":H" . $a_row);
317 $a_excel->
setCell($a_row, 0, $this->lng->txt($a_set[
"type"]));
318 $a_excel->
setCell($a_row, 1, $a_set[
"title"]);
324 $a_excel->
setCell($a_row, 4,
'-');
326 $a_excel->
setCell($a_row, 4, $a_set[
"percentage"] .
"%");
328 $a_excel->
setCell($a_row, 5, $a_set[
"mark"]);
329 $a_excel->
setCell($a_row, 6, $a_set[
"comment"]);
335 $a_csv->addColumn($this->lng->txt(
"type"));
336 $a_csv->addColumn($this->lng->txt(
"trac_title"));
337 $a_csv->addColumn($this->lng->txt(
"status"));
338 $a_csv->addColumn($this->lng->txt(
"trac_status_changed"));
339 $a_csv->addColumn($this->lng->txt(
"trac_percentage"));
340 $a_csv->addColumn($this->lng->txt(
"trac_mark"));
341 $a_csv->addColumn($this->lng->txt(
"comment"));
342 $a_csv->addColumn($this->lng->txt(
"trac_mode"));
349 $a_csv->addColumn($this->lng->txt($a_set[
"type"]));
350 $a_csv->addColumn($a_set[
"title"]);
358 $a_csv->addColumn(
'-');
360 $a_csv->addColumn(sprintf(
"%d%%", $a_set[
"percentage"]));
362 $a_csv->addColumn($a_set[
"mark"]);
363 $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.
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)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
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.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
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.
__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.
isPercentageAvailable($a_obj_id)
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
const LP_CONTEXT_ORG_UNIT
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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)
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.
setEnableHeader($a_enableheader)
Set Enable Header.
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)
setLimit($a_limit=0, $a_default_limit=0)
static _mode2Text($a_mode)