4 include_once(
"./Services/Tracking/classes/class.ilLPTableBaseGUI.php");
38 $this->in_group = $tree->checkForParentType($this->ref_id,
"grp");
45 $this->in_course = $tree->checkForParentType($this->ref_id,
"crs");
55 parent::__construct($a_parent_obj, $a_parent_cmd);
58 $this->
parseTitle($this->obj_id,
"trac_matrix");
61 $this->
setFormAction($ilCtrl->getFormActionByClass(get_class($this)));
62 $this->
setRowTemplate(
"tpl.user_object_matrix_row.html",
"Services/Tracking");
68 include_once
"Services/Mail/classes/class.ilMail.php";
69 $mail =
new ilMail($ilUser->getId());
70 if($rbacsystem->checkAccess(
"internal_mail", $mail->getMailObjectReferenceId()))
72 $this->
addMultiCommand(
"mailselectedusers", $this->lng->txt(
"send_mail"));
74 $this->has_multi =
true;
77 $this->
addColumn($this->lng->txt(
"login"),
"login");
81 foreach ($selected as $c)
83 $title = $labels[$c][
"txt"];
85 if(isset($labels[$c][
"no_permission"]) && (
bool)$labels[$c][
"no_permission"])
87 $title .=
" (".$lng->txt(
"status_no_permission").
")";
91 if(isset($labels[$c][
"icon"]))
93 $alt = $lng->txt($labels[$c][
"type"]);
94 $icon =
'<img src="'.$labels[$c][
"icon"].
'" alt="'.$alt.
'" />';
95 if(
sizeof($selected) > 5)
104 if($labels[$c][
"path"])
106 $tooltip[] = $labels[$c][
"path"];
110 if(isset($labels[$c][
"id"]))
112 $sort_id = $labels[$c][
"id"];
117 $sort_id = (substr($c, 0, 4) ==
"udf_") ?
"" : $c;
120 $this->
addColumn(
$title, $sort_id,
"",
false,
"", implode(
" - ", $tooltip));
131 $this->filter[
"name"] = $item->getValue();
134 if(isset(
$_GET[$this->prefix.
"_tpl"]))
136 $this->filter[
"name"] = null;
143 global $ilObjDataCache, $rbacsystem;
147 if($this->obj_ids === NULL)
151 $this->obj_ids = $this->
getItems(array_keys($user_cols[0]), $user_cols[1]);
156 foreach($this->obj_ids as $obj_id)
158 if($obj_id == $this->obj_id)
160 $parent = array(
"txt" => $this->lng->txt(
"status"),
167 $ref_id = $this->ref_ids[$obj_id];
168 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
173 $this->privacy_cols[] = $obj_id;
176 $title = $ilObjDataCache->lookupTitle($obj_id);
177 $type = $ilObjDataCache->lookupType($obj_id);
181 include_once
"Modules/Session/classes/class.ilObjSession.php";
188 include_once
'./Services/Tree/classes/class.ilPathGUI.php';
193 $relpath = $this->lng->txt(
'path').
': '.
$path;
196 $tmp_cols[strtolower(
$title).
"#~#obj_".$obj_id] = array(
201 "no_permission" => $no_perm,
205 if(
sizeof($this->objective_ids))
207 foreach($this->objective_ids as $obj_id =>
$title)
209 $tmp_cols[strtolower(
$title).
"#~#objtv_".$obj_id] = array(
"txt" =>
$title,
"default" =>
true);
212 if(
sizeof($this->sco_ids))
214 foreach($this->sco_ids as $obj_id =>
$title)
217 $tmp_cols[strtolower(
$title).
"#~#objsco_".$obj_id] = array(
"txt" =>
$title,
"icon"=>
$icon,
"default" =>
true);
220 if(
sizeof($this->subitem_ids))
222 foreach($this->subitem_ids as $obj_id =>
$title)
224 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
226 $tmp_cols[strtolower(
$title).
"#~#objsub_".$obj_id] = array(
"txt" =>
$title,
"icon"=>
$icon,
"default" =>
true);
231 if(!
sizeof($this->sco_ids) && !
sizeof($this->subitem_ids))
235 foreach($tmp_cols as $id => $def)
237 $id = explode(
'#~#', $id);
244 $columns[
"obj_".$this->obj_id] = $parent;
248 unset($user_cols[0][
"status"]);
249 unset($user_cols[0][
"login"]);
250 foreach($user_cols[0] as $col_id => $col_def)
255 $col_def[
"default"] =
false;
263 function getItems(array $a_user_fields, array $a_privary_fields = null)
266 if($this->restore_filter)
268 $name = $this->restore_filter_values[
"name"];
270 $this->filter[
"name"] = $name;
273 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
275 if($collection[
"object_ids"])
278 $this->ref_ids = $collection[
"ref_ids"];
281 $check_agreement =
false;
285 include_once
"Services/PrivacySecurity/classes/class.ilPrivacySettings.php";
287 if($privacy->courseConfirmationRequired())
292 else if($this->in_group)
295 include_once
"Services/PrivacySecurity/classes/class.ilPrivacySettings.php";
297 if($privacy->groupConfirmationRequired())
304 if($collection[
"objectives_parent_id"] &&
$data[
"users"])
309 $this->objective_ids = array();
311 foreach($objectives as $user_id => $objectives)
313 if(isset(
$data[
"set"][$user_id]))
315 foreach($objectives as $objective_id => $status)
317 $obj_id =
"objtv_".$objective_id;
318 $data[
"set"][$user_id][$obj_id] = $status;
320 if(!in_array($obj_id, $this->objective_ids))
330 if($collection[
"scorm"] &&
$data[
"set"])
332 $this->sco_ids = array();
333 foreach(array_keys(
$data[
"set"]) as $user_id)
335 foreach($collection[
"scorm"][
"scos"] as $sco)
337 if(!in_array($sco, $this->sco_ids))
339 $this->sco_ids[$sco] = $collection[
"scorm"][
"scos_title"][$sco];
347 if(in_array($user_id, $collection[
"scorm"][
"failed"][$sco]))
351 else if(in_array($user_id, $collection[
"scorm"][
"completed"][$sco]))
355 else if(in_array($user_id, $collection[
"scorm"][
"in_progress"][$sco]))
360 $obj_id =
"objsco_".$sco;
361 $data[
"set"][$user_id][$obj_id] = $status;
367 if($collection[
"subitems"] &&
$data[
"set"])
369 foreach(array_keys(
$data[
"set"]) as $user_id)
371 foreach($collection[
"subitems"][
"items"] as $item_id)
373 $this->subitem_ids[$item_id] = $collection[
"subitems"][
"item_titles"][$item_id];
376 if(in_array($user_id, $collection[
"subitems"][
"completed"][$item_id]))
380 else if(is_array($collection[
"subitems"][
"in_progress"]) &&
381 in_array($user_id, $collection[
"subitems"][
"in_progress"][$item_id]))
386 $obj_id =
"objsub_".$item_id;
387 $data[
"set"][$user_id][$obj_id] = $status;
395 $this->perc_map = array();
396 foreach(
$data[
"set"] as $row_idx =>
$row)
398 foreach(
$row as $column => $value)
400 if(substr($column, -5) ==
"_perc")
402 $obj_id = explode(
"_", $column);
403 $obj_id = (int)$obj_id[1];
409 unset(
$data[
"set"][$row_idx][$column]);
413 $this->perc_map[$obj_id] =
true;
423 return $collection[
"object_ids"];
434 $this->tpl->setVariable(
"USER_ID", $a_set[
"usr_id"]);
441 case (substr($c, 0, 4) ==
"obj_"):
442 $obj_id = substr($c, 4);
445 if(in_array($obj_id, $this->privacy_cols) ||
446 $a_set[
"privacy_conflict"])
448 $this->tpl->setCurrentBlock(
"objects");
449 $this->tpl->setVariable(
"VAL_STATUS",
" ");
450 $this->tpl->parseCurrentBlock();
454 $status = isset($a_set[$c])
457 $percentage = isset($a_set[$c.
"_perc"])
458 ? (int)$a_set[$c.
"_perc"]
474 $this->tpl->setCurrentBlock(
'warning_img');
476 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
477 $this->tpl->parseCurrentBlock();
481 $this->tpl->setCurrentBlock(
"objects");
482 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status", $status,
""));
483 $this->tpl->setVariable(
"VAL_PERCENTAGE", $this->
parseValue(
"percentage", $percentage,
""));
484 $this->tpl->parseCurrentBlock();
488 case (substr($c, 0, 6) ==
"objtv_"):
489 case (substr($c, 0, 7) ==
"objsco_"):
490 case (substr($c, 0, 7) ==
"objsub_"):
491 $status = isset($a_set[$c])
495 $this->tpl->setCurrentBlock(
"objects");
496 if(!$a_set[
"privacy_conflict"])
498 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status", $status,
""));
502 $this->tpl->setVariable(
"VAL_STATUS",
" ");
504 $this->tpl->parseCurrentBlock();
508 $this->tpl->setCurrentBlock(
"user_field");
509 if(!$a_set[
"privacy_conflict"])
511 $this->tpl->setVariable(
"VAL_UF", $this->
parseValue($c, $a_set[$c],
""));
515 $this->tpl->setVariable(
"VAL_UF",
" ");
517 $this->tpl->parseCurrentBlock();
523 if(!$a_set[
"active"] || $a_set[
"privacy_conflict"])
526 if($a_set[
"privacy_conflict"])
528 $mess[] = $lng->txt(
"status_no_permission");
530 else if(!$a_set[
"active"])
532 $mess[] = $lng->txt(
"inactive");
534 $this->tpl->setCurrentBlock(
'inactive_bl');
535 $this->tpl->setVariable(
'TXT_INACTIVE', implode(
", ", $mess));
536 $this->tpl->parseCurrentBlock();
539 $login = !$a_set[
"privacy_conflict"]
542 $this->tpl->setVariable(
"VAL_LOGIN", $login);
547 global $ilObjDataCache;
549 $worksheet->write($a_row, 0, $this->lng->txt(
"login"));
555 if(substr($c, 0, 4) ==
"obj_")
557 $obj_id = substr($c, 4);
558 $type = $ilObjDataCache->lookupType($obj_id);
559 $worksheet->write($a_row, $cnt,
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
561 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
564 $worksheet->write($a_row, $cnt, $this->lng->txt(
"trac_percentage").
" (%)");
569 $worksheet->write($a_row, $cnt, $labels[$c][
"txt"]);
577 $worksheet->write($a_row, 0, $a_set[
"login"]);
584 case (substr($c, 0, 4) ==
"obj_"):
585 $obj_id = substr($c, 4);
587 $worksheet->write($a_row, $cnt, $val);
589 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
592 $perc = (int)$a_set[$c.
"_perc"];
597 $worksheet->write($a_row, $cnt, $perc);
601 case (substr($c, 0, 6) ==
"objtv_"):
602 case (substr($c, 0, 7) ==
"objsco_"):
603 case (substr($c, 0, 7) ==
"objsub_"):
605 $worksheet->write($a_row, $cnt, $val);
614 $val = $this->
parseValue($c, $a_set[$c],
"user");
615 $worksheet->write($a_row, $cnt, $val);
625 global $ilObjDataCache;
627 $a_csv->addColumn($this->lng->txt(
"login"));
632 if(substr($c, 0, 4) ==
"obj_")
634 $obj_id = substr($c, 4);
635 $type = $ilObjDataCache->lookupType($obj_id);
636 $a_csv->addColumn(
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
638 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
640 $a_csv->addColumn($this->lng->txt(
"trac_percentage").
" (%)");
645 $a_csv->addColumn($labels[$c][
"txt"]);
654 $a_csv->addColumn($a_set[
"login"]);
660 case (substr($c, 0, 4) ==
"obj_"):
661 $obj_id = substr($c, 4);
663 $a_csv->addColumn($val);
665 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
667 $perc = (int)$a_set[$c.
"_perc"];
672 $a_csv->addColumn($perc);
676 case (substr($c, 0, 6) ==
"objtv_"):
677 case (substr($c, 0, 7) ==
"objsco_"):
678 case (substr($c, 0, 7) ==
"objsub_"):
680 $a_csv->addColumn($val);
689 $val = $this->
parseValue($c, $a_set[$c],
"user");
690 $a_csv->addColumn($val);
const LP_STATUS_COMPLETED_NUM
Creates a path for a start and endnode.
getSelectableUserColumns($a_in_course=false, $a_in_group=false)
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExportFormats(array $formats)
Set available export formats.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
fillHeaderExcel($worksheet, &$a_row)
setShowTemplates($a_value)
Toggle templates.
__construct($a_parent_obj, $a_parent_cmd, $ref_id)
Constructor.
static getSubItemType($a_parent_obj_id)
Get sub-item object type for parent.
const LP_STATUS_IN_PROGRESS_NUM
parseTitle($a_obj_id, $action, $a_user_id=false)
parseValue($id, $value, $type)
static checkPermission($a_permission, $a_ref_id, $a_user_id=null)
wrapper for rbac access checks
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...
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
getItems(array $a_user_fields, array $a_privary_fields=null)
TableGUI class for learning progress.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class Mail this class handles base functions for mail handling.
static _lookupObjId($a_id)
_getStatusText($a_status, $a_lng=null)
Get status alt text.
addMultiCommand($a_cmd, $a_text)
Add Command button.
fillRowCSV($a_csv, $a_set)
isPercentageAvailable($a_obj_id)
getSelectedColumns()
Get selected columns.
SetFilterValue(ilFormPropertyGUI $a_item, $a_value)
Set current filter value.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getObjectIds($a_parent_obj_id, $a_parent_ref_id=false, $use_collection=true, $a_refresh_status=true, $a_user_ids=null)
Get (sub)objects for given object, also handles learning objectives (course only) ...
static getUserObjectiveMatrix($a_parent_obj_id, $a_users)
const LP_STATUS_NOT_ATTEMPTED_NUM
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
showTimingsWarning($a_ref_id, $a_user_id)
fillRowExcel($worksheet, &$a_row, $a_set)
static getUserObjectMatrix($a_parent_ref_id, $a_obj_ids, $a_user_filter=NULL, array $a_additional_fields=null, array $a_privacy_fields=null, $a_check_agreement=null)
Get status matrix for users on objects.
setEnableHeader($a_enableheader)
Set Enable Header.
static _getInstance()
Get instance of ilPrivacySettings.
setMaxCount($a_max_count)
set max.
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)
const LP_STATUS_FAILED_NUM