4 include_once(
"./Services/Tracking/classes/class.ilLPTableBaseGUI.php");
29 public function __construct($a_parent_obj, $a_parent_cmd, $ref_id)
33 $this->
setId(
"trsmtx_" . $ref_id);
34 $this->ref_id = $ref_id;
38 $this->in_group = $tree->checkForParentType($this->ref_id,
"grp");
39 if ($this->in_group) {
42 $this->in_course = $tree->checkForParentType($this->ref_id,
"crs");
43 if ($this->in_course) {
51 parent::__construct($a_parent_obj, $a_parent_cmd);
53 $this->
parseTitle($this->obj_id,
"trac_matrix");
56 $this->
setFormAction($ilCtrl->getFormActionByClass(get_class($this)));
57 $this->
setRowTemplate(
"tpl.user_object_matrix_row.html",
"Services/Tracking");
63 include_once
"Services/Mail/classes/class.ilMail.php";
64 $mail =
new ilMail($ilUser->getId());
65 if ($rbacsystem->checkAccess(
"internal_mail", $mail->getMailObjectReferenceId())) {
66 $this->
addMultiCommand(
"mailselectedusers", $this->lng->txt(
"send_mail"));
69 $this->lng->loadLanguageModule(
'user');
72 $this->lng->txt(
'clipboard_add_btn')
75 $this->has_multi =
true;
77 $this->
addColumn($this->lng->txt(
"login"),
"login");
81 foreach ($selected as $c) {
82 $title = $labels[$c][
"txt"];
84 if (isset($labels[$c][
"no_permission"]) && (
bool) $labels[$c][
"no_permission"]) {
85 $title .=
" (" . $lng->txt(
"status_no_permission") .
")";
89 if (isset($labels[$c][
"icon"])) {
90 $alt = $lng->txt($labels[$c][
"type"]);
91 $icon =
'<img src="' . $labels[$c][
"icon"] .
'" alt="' . $alt .
'" />';
92 if (
sizeof($selected) > 5) {
98 if ($labels[$c][
"path"]) {
99 $tooltip[] = $labels[$c][
"path"];
103 if (isset($labels[$c][
"id"])) {
104 $sort_id = $labels[$c][
"id"];
107 $sort_id = (substr($c, 0, 4) ==
"udf_") ?
"" : $c;
110 $this->
addColumn(
$title, $sort_id,
"",
false,
"", implode(
" - ", $tooltip));
121 $this->filter[
"name"] = $item->getValue();
124 if (isset(
$_GET[$this->prefix .
"_tpl"])) {
125 $this->filter[
"name"] = null;
132 global $ilObjDataCache, $rbacsystem;
136 if ($this->obj_ids === null) {
139 $this->obj_ids = $this->
getItems(array_keys($user_cols[0]), $user_cols[1]);
141 if (is_array($this->obj_ids)) {
143 foreach ($this->obj_ids as $obj_id) {
144 if ($obj_id == $this->obj_id) {
145 $parent =
array(
"txt" => $this->lng->txt(
"status"),
150 $ref_id = $this->ref_ids[$obj_id];
151 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
155 $this->privacy_cols[] = $obj_id;
158 $title = $ilObjDataCache->lookupTitle($obj_id);
159 $type = $ilObjDataCache->lookupType($obj_id);
161 if (
$type ==
"sess") {
162 include_once
"Modules/Session/classes/class.ilObjSession.php";
169 include_once
'./Services/Tree/classes/class.ilPathGUI.php';
171 $path =
$path->getPath($this->ref_id, $ref_id);
173 $relpath = $this->lng->txt(
'path') .
': ' .
$path;
176 $tmp_cols[strtolower(
$title) .
"#~#obj_" . $obj_id] =
array(
181 "no_permission" => $no_perm,
185 if (
sizeof($this->objective_ids)) {
186 foreach ($this->objective_ids as $obj_id =>
$title) {
187 $tmp_cols[strtolower(
$title) .
"#~#objtv_" . $obj_id] =
array(
"txt" =>
$title,
"default" =>
true);
190 if (
sizeof($this->sco_ids)) {
191 foreach ($this->sco_ids as $obj_id =>
$title) {
193 $tmp_cols[strtolower(
$title) .
"#~#objsco_" . $obj_id] =
array(
"txt" =>
$title,
"icon"=>
$icon,
"default" =>
true);
196 if (
sizeof($this->subitem_ids)) {
197 foreach ($this->subitem_ids as $obj_id =>
$title) {
198 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
200 $tmp_cols[strtolower(
$title) .
"#~#objsub_" . $obj_id] =
array(
"txt" =>
$title,
"icon"=>
$icon,
"default" =>
true);
205 if (!
sizeof($this->sco_ids) && !
sizeof($this->subitem_ids)) {
208 foreach ($tmp_cols as
$id =>
$def) {
209 $id = explode(
'#~#',
$id);
215 $columns[
"obj_" . $this->obj_id] = $parent;
219 unset($user_cols[0][
"status"]);
220 unset($user_cols[0][
"login"]);
221 foreach ($user_cols[0] as $col_id => $col_def) {
224 $col_def[
"default"] =
false;
235 if ($this->restore_filter) {
236 $name = $this->restore_filter_values[
"name"];
238 $this->filter[
"name"] =
$name;
241 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
243 if ($collection[
"object_ids"]) {
245 $this->ref_ids = $collection[
"ref_ids"];
248 $check_agreement =
false;
249 if ($this->in_course) {
251 include_once
"Services/PrivacySecurity/classes/class.ilPrivacySettings.php";
253 if ($privacy->courseConfirmationRequired()) {
256 } elseif ($this->in_group) {
258 include_once
"Services/PrivacySecurity/classes/class.ilPrivacySettings.php";
260 if ($privacy->groupConfirmationRequired()) {
266 if ($collection[
"objectives_parent_id"] &&
$data[
"users"]) {
270 $this->objective_ids =
array();
272 foreach ($objectives as $user_id => $objectives) {
273 if (isset(
$data[
"set"][$user_id])) {
274 foreach ($objectives as $objective_id => $status) {
275 $obj_id =
"objtv_" . $objective_id;
276 $data[
"set"][$user_id][$obj_id] = $status;
278 if (!in_array($obj_id, $this->objective_ids)) {
287 if ($collection[
"scorm"] &&
$data[
"set"]) {
288 $this->sco_ids =
array();
289 foreach (array_keys(
$data[
"set"]) as $user_id) {
290 foreach ($collection[
"scorm"][
"scos"] as $sco) {
291 if (!in_array($sco, $this->sco_ids)) {
292 $this->sco_ids[$sco] = $collection[
"scorm"][
"scos_title"][$sco];
300 if (in_array($user_id, $collection[
"scorm"][
"failed"][$sco])) {
302 } elseif (in_array($user_id, $collection[
"scorm"][
"completed"][$sco])) {
304 } elseif (in_array($user_id, $collection[
"scorm"][
"in_progress"][$sco])) {
308 $obj_id =
"objsco_" . $sco;
309 $data[
"set"][$user_id][$obj_id] = $status;
315 if ($collection[
"subitems"] &&
$data[
"set"]) {
316 foreach (array_keys(
$data[
"set"]) as $user_id) {
317 foreach ($collection[
"subitems"][
"items"] as $item_id) {
318 $this->subitem_ids[$item_id] = $collection[
"subitems"][
"item_titles"][$item_id];
321 if (in_array($user_id, $collection[
"subitems"][
"completed"][$item_id])) {
323 } elseif (is_array($collection[
"subitems"][
"in_progress"]) &&
324 in_array($user_id, $collection[
"subitems"][
"in_progress"][$item_id])) {
328 $obj_id =
"objsub_" . $item_id;
329 $data[
"set"][$user_id][$obj_id] = $status;
336 $this->perc_map =
array();
337 foreach (
$data[
"set"] as $row_idx =>
$row) {
339 if (substr(
$column, -5) ==
"_perc") {
340 $obj_id = explode(
"_",
$column);
341 $obj_id = (int) $obj_id[1];
348 $this->perc_map[$obj_id] =
true;
358 return $collection[
"object_ids"];
367 if ($this->has_multi) {
368 $this->tpl->setVariable(
"USER_ID", $a_set[
"usr_id"]);
373 case (substr($c, 0, 4) ==
"obj_"):
374 $obj_id = substr($c, 4);
377 if (in_array($obj_id, $this->privacy_cols) ||
378 $a_set[
"privacy_conflict"]) {
379 $this->tpl->setCurrentBlock(
"objects");
380 $this->tpl->setVariable(
"VAL_STATUS",
" ");
381 $this->tpl->parseCurrentBlock();
385 $status = isset($a_set[$c])
388 $percentage = isset($a_set[$c .
"_perc"])
389 ? (int) $a_set[$c .
"_perc"]
395 if ($timing !==
true) {
400 $this->tpl->setCurrentBlock(
'warning_img');
402 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed') . $timing);
403 $this->tpl->parseCurrentBlock();
407 $this->tpl->setCurrentBlock(
"objects");
408 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status", $status,
""));
409 $this->tpl->setVariable(
"VAL_PERCENTAGE", $this->
parseValue(
"percentage", $percentage,
""));
410 $this->tpl->parseCurrentBlock();
414 case (substr($c, 0, 6) ==
"objtv_"):
415 case (substr($c, 0, 7) ==
"objsco_"):
416 case (substr($c, 0, 7) ==
"objsub_"):
417 $status = isset($a_set[$c])
421 $this->tpl->setCurrentBlock(
"objects");
422 if (!$a_set[
"privacy_conflict"]) {
423 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status", $status,
""));
425 $this->tpl->setVariable(
"VAL_STATUS",
" ");
427 $this->tpl->parseCurrentBlock();
431 $this->tpl->setCurrentBlock(
"user_field");
432 if (!$a_set[
"privacy_conflict"]) {
433 $this->tpl->setVariable(
"VAL_UF", $this->
parseValue($c, $a_set[$c],
""));
435 $this->tpl->setVariable(
"VAL_UF",
" ");
437 $this->tpl->parseCurrentBlock();
443 if (!$a_set[
"active"] || $a_set[
"privacy_conflict"]) {
445 if ($a_set[
"privacy_conflict"]) {
446 $mess[] = $lng->txt(
"status_no_permission");
447 } elseif (!$a_set[
"active"]) {
448 $mess[] = $lng->txt(
"inactive");
450 $this->tpl->setCurrentBlock(
'inactive_bl');
451 $this->tpl->setVariable(
'TXT_INACTIVE', implode(
", ", $mess));
452 $this->tpl->parseCurrentBlock();
455 $login = !$a_set[
"privacy_conflict"]
458 $this->tpl->setVariable(
"VAL_LOGIN", $login);
463 global $ilObjDataCache;
465 $a_excel->
setCell($a_row, 0, $this->lng->txt(
"login"));
470 if (substr($c, 0, 4) ==
"obj_") {
471 $obj_id = substr($c, 4);
472 $type = $ilObjDataCache->lookupType($obj_id);
473 $a_excel->
setCell($a_row, $cnt,
"(" . $this->lng->txt(
$type) .
") " . $labels[$c][
"txt"]);
475 if (is_array($this->perc_map) && $this->perc_map[$obj_id]) {
477 $a_excel->
setCell($a_row, $cnt, $this->lng->txt(
"trac_percentage") .
" (%)");
480 $a_excel->
setCell($a_row, $cnt, $labels[$c][
"txt"]);
490 $a_excel->
setCell($a_row, 0, $a_set[
"login"]);
495 case (substr($c, 0, 4) ==
"obj_"):
496 $obj_id = substr($c, 4);
498 $a_excel->
setCell($a_row, $cnt, $val);
500 if (is_array($this->perc_map) && $this->perc_map[$obj_id]) {
502 $perc = (int) $a_set[$c .
"_perc"];
506 $a_excel->
setCell($a_row, $cnt, $perc);
510 case (substr($c, 0, 6) ==
"objtv_"):
511 case (substr($c, 0, 7) ==
"objsco_"):
512 case (substr($c, 0, 7) ==
"objsub_"):
514 $a_excel->
setCell($a_row, $cnt, $val);
523 $val = $this->
parseValue($c, $a_set[$c],
"user");
524 $a_excel->
setCell($a_row, $cnt, $val);
534 global $ilObjDataCache;
536 $a_csv->addColumn($this->lng->txt(
"login"));
540 if (substr($c, 0, 4) ==
"obj_") {
541 $obj_id = substr($c, 4);
542 $type = $ilObjDataCache->lookupType($obj_id);
543 $a_csv->addColumn(
"(" . $this->lng->txt(
$type) .
") " . $labels[$c][
"txt"]);
545 if (is_array($this->perc_map) && $this->perc_map[$obj_id]) {
546 $a_csv->addColumn($this->lng->txt(
"trac_percentage") .
" (%)");
549 $a_csv->addColumn($labels[$c][
"txt"]);
558 $a_csv->addColumn($a_set[
"login"]);
562 case (substr($c, 0, 4) ==
"obj_"):
563 $obj_id = substr($c, 4);
565 $a_csv->addColumn($val);
567 if (is_array($this->perc_map) && $this->perc_map[$obj_id]) {
568 $perc = (int) $a_set[$c .
"_perc"];
572 $a_csv->addColumn($perc);
576 case (substr($c, 0, 6) ==
"objtv_"):
577 case (substr($c, 0, 7) ==
"objsco_"):
578 case (substr($c, 0, 7) ==
"objsub_"):
580 $a_csv->addColumn($val);
589 $val = $this->
parseValue($c, $a_set[$c],
"user");
590 $a_csv->addColumn($val);
const LP_STATUS_COMPLETED_NUM
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
fillRowExcel(ilExcel $a_excel, &$a_row, $a_set)
Creates a path for a start and endnode.
getSelectableUserColumns($a_in_course=false, $a_in_group=false)
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExportFormats(array $formats)
Set available export formats.
fillHeaderExcel(ilExcel $a_excel, &$a_row)
setShowTemplates($a_value)
Toggle templates.
__construct($a_parent_obj, $a_parent_cmd, $ref_id)
Constructor.
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static getSubItemType($a_parent_obj_id)
Get sub-item object type for parent.
const LP_STATUS_IN_PROGRESS_NUM
if(!array_key_exists('StateId', $_REQUEST)) $id
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
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)
getColumnCoord($a_col)
Get column "name" from number.
TableGUI class for learning progress.
setBold($a_coords)
Set cell(s) to bold.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class handles base functions for mail handling.
static _lookupObjId($a_id)
addMultiCommand($a_cmd, $a_text)
Add Command button.
fillRowCSV($a_csv, $a_set)
isPercentageAvailable($a_obj_id)
getSelectedColumns()
Get selected columns.
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
SetFilterValue(ilFormPropertyGUI $a_item, $a_value)
Set current filter value.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
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)
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 _getInstance()
Get instance of ilPrivacySettings.
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.
setMaxCount($a_max_count)
set max.
const LP_STATUS_FAILED_NUM