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"));
75 $this->lng->loadLanguageModule(
'user');
78 $this->lng->txt(
'clipboard_add_btn')
81 $this->has_multi =
true;
83 $this->
addColumn($this->lng->txt(
"login"),
"login");
87 foreach ($selected as $c)
89 $title = $labels[$c][
"txt"];
91 if(isset($labels[$c][
"no_permission"]) && (
bool)$labels[$c][
"no_permission"])
93 $title .=
" (".$lng->txt(
"status_no_permission").
")";
97 if(isset($labels[$c][
"icon"]))
99 $alt = $lng->txt($labels[$c][
"type"]);
100 $icon =
'<img src="'.$labels[$c][
"icon"].
'" alt="'.$alt.
'" />';
101 if(
sizeof($selected) > 5)
110 if($labels[$c][
"path"])
112 $tooltip[] = $labels[$c][
"path"];
116 if(isset($labels[$c][
"id"]))
118 $sort_id = $labels[$c][
"id"];
123 $sort_id = (substr($c, 0, 4) ==
"udf_") ?
"" : $c;
126 $this->
addColumn(
$title, $sort_id,
"",
false,
"", implode(
" - ", $tooltip));
137 $this->filter[
"name"] = $item->getValue();
140 if(isset(
$_GET[$this->prefix.
"_tpl"]))
142 $this->filter[
"name"] = null;
149 global $ilObjDataCache, $rbacsystem;
153 if($this->obj_ids === NULL)
157 $this->obj_ids = $this->
getItems(array_keys($user_cols[0]), $user_cols[1]);
162 foreach($this->obj_ids as $obj_id)
164 if($obj_id == $this->obj_id)
166 $parent =
array(
"txt" => $this->lng->txt(
"status"),
173 $ref_id = $this->ref_ids[$obj_id];
174 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
179 $this->privacy_cols[] = $obj_id;
182 $title = $ilObjDataCache->lookupTitle($obj_id);
183 $type = $ilObjDataCache->lookupType($obj_id);
187 include_once
"Modules/Session/classes/class.ilObjSession.php";
194 include_once
'./Services/Tree/classes/class.ilPathGUI.php';
199 $relpath = $this->lng->txt(
'path').
': '.
$path;
202 $tmp_cols[strtolower(
$title).
"#~#obj_".$obj_id] =
array(
207 "no_permission" => $no_perm,
211 if(
sizeof($this->objective_ids))
213 foreach($this->objective_ids as $obj_id =>
$title)
215 $tmp_cols[strtolower(
$title).
"#~#objtv_".$obj_id] =
array(
"txt" =>
$title,
"default" =>
true);
218 if(
sizeof($this->sco_ids))
220 foreach($this->sco_ids as $obj_id =>
$title)
223 $tmp_cols[strtolower(
$title).
"#~#objsco_".$obj_id] =
array(
"txt" =>
$title,
"icon"=>
$icon,
"default" =>
true);
226 if(
sizeof($this->subitem_ids))
228 foreach($this->subitem_ids as $obj_id =>
$title)
230 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
232 $tmp_cols[strtolower(
$title).
"#~#objsub_".$obj_id] =
array(
"txt" =>
$title,
"icon"=>
$icon,
"default" =>
true);
237 if(!
sizeof($this->sco_ids) && !
sizeof($this->subitem_ids))
241 foreach($tmp_cols as $id => $def)
243 $id = explode(
'#~#', $id);
250 $columns[
"obj_".$this->obj_id] = $parent;
254 unset($user_cols[0][
"status"]);
255 unset($user_cols[0][
"login"]);
256 foreach($user_cols[0] as $col_id => $col_def)
261 $col_def[
"default"] =
false;
272 if($this->restore_filter)
274 $name = $this->restore_filter_values[
"name"];
276 $this->filter[
"name"] = $name;
279 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
281 if($collection[
"object_ids"])
284 $this->ref_ids = $collection[
"ref_ids"];
287 $check_agreement =
false;
291 include_once
"Services/PrivacySecurity/classes/class.ilPrivacySettings.php";
293 if($privacy->courseConfirmationRequired())
298 else if($this->in_group)
301 include_once
"Services/PrivacySecurity/classes/class.ilPrivacySettings.php";
303 if($privacy->groupConfirmationRequired())
310 if($collection[
"objectives_parent_id"] &&
$data[
"users"])
315 $this->objective_ids =
array();
317 foreach($objectives as $user_id => $objectives)
319 if(isset(
$data[
"set"][$user_id]))
321 foreach($objectives as $objective_id => $status)
323 $obj_id =
"objtv_".$objective_id;
324 $data[
"set"][$user_id][$obj_id] = $status;
326 if(!in_array($obj_id, $this->objective_ids))
336 if($collection[
"scorm"] &&
$data[
"set"])
338 $this->sco_ids =
array();
339 foreach(array_keys(
$data[
"set"]) as $user_id)
341 foreach($collection[
"scorm"][
"scos"] as $sco)
343 if(!in_array($sco, $this->sco_ids))
345 $this->sco_ids[$sco] = $collection[
"scorm"][
"scos_title"][$sco];
353 if(in_array($user_id, $collection[
"scorm"][
"failed"][$sco]))
357 else if(in_array($user_id, $collection[
"scorm"][
"completed"][$sco]))
361 else if(in_array($user_id, $collection[
"scorm"][
"in_progress"][$sco]))
366 $obj_id =
"objsco_".$sco;
367 $data[
"set"][$user_id][$obj_id] = $status;
373 if($collection[
"subitems"] &&
$data[
"set"])
375 foreach(array_keys(
$data[
"set"]) as $user_id)
377 foreach($collection[
"subitems"][
"items"] as $item_id)
379 $this->subitem_ids[$item_id] = $collection[
"subitems"][
"item_titles"][$item_id];
382 if(in_array($user_id, $collection[
"subitems"][
"completed"][$item_id]))
386 else if(is_array($collection[
"subitems"][
"in_progress"]) &&
387 in_array($user_id, $collection[
"subitems"][
"in_progress"][$item_id]))
392 $obj_id =
"objsub_".$item_id;
393 $data[
"set"][$user_id][$obj_id] = $status;
401 $this->perc_map =
array();
402 foreach(
$data[
"set"] as $row_idx =>
$row)
406 if(substr(
$column, -5) ==
"_perc")
408 $obj_id = explode(
"_",
$column);
409 $obj_id = (int)$obj_id[1];
419 $this->perc_map[$obj_id] =
true;
429 return $collection[
"object_ids"];
440 $this->tpl->setVariable(
"USER_ID", $a_set[
"usr_id"]);
447 case (substr($c, 0, 4) ==
"obj_"):
448 $obj_id = substr($c, 4);
451 if(in_array($obj_id, $this->privacy_cols) ||
452 $a_set[
"privacy_conflict"])
454 $this->tpl->setCurrentBlock(
"objects");
455 $this->tpl->setVariable(
"VAL_STATUS",
" ");
456 $this->tpl->parseCurrentBlock();
460 $status = isset($a_set[$c])
463 $percentage = isset($a_set[$c.
"_perc"])
464 ? (int)$a_set[$c.
"_perc"]
480 $this->tpl->setCurrentBlock(
'warning_img');
482 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
483 $this->tpl->parseCurrentBlock();
487 $this->tpl->setCurrentBlock(
"objects");
488 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status", $status,
""));
489 $this->tpl->setVariable(
"VAL_PERCENTAGE", $this->
parseValue(
"percentage", $percentage,
""));
490 $this->tpl->parseCurrentBlock();
494 case (substr($c, 0, 6) ==
"objtv_"):
495 case (substr($c, 0, 7) ==
"objsco_"):
496 case (substr($c, 0, 7) ==
"objsub_"):
497 $status = isset($a_set[$c])
501 $this->tpl->setCurrentBlock(
"objects");
502 if(!$a_set[
"privacy_conflict"])
504 $this->tpl->setVariable(
"VAL_STATUS", $this->
parseValue(
"status", $status,
""));
508 $this->tpl->setVariable(
"VAL_STATUS",
" ");
510 $this->tpl->parseCurrentBlock();
514 $this->tpl->setCurrentBlock(
"user_field");
515 if(!$a_set[
"privacy_conflict"])
517 $this->tpl->setVariable(
"VAL_UF", $this->
parseValue($c, $a_set[$c],
""));
521 $this->tpl->setVariable(
"VAL_UF",
" ");
523 $this->tpl->parseCurrentBlock();
529 if(!$a_set[
"active"] || $a_set[
"privacy_conflict"])
532 if($a_set[
"privacy_conflict"])
534 $mess[] = $lng->txt(
"status_no_permission");
536 else if(!$a_set[
"active"])
538 $mess[] = $lng->txt(
"inactive");
540 $this->tpl->setCurrentBlock(
'inactive_bl');
541 $this->tpl->setVariable(
'TXT_INACTIVE', implode(
", ", $mess));
542 $this->tpl->parseCurrentBlock();
545 $login = !$a_set[
"privacy_conflict"]
548 $this->tpl->setVariable(
"VAL_LOGIN", $login);
553 global $ilObjDataCache;
555 $a_excel->
setCell($a_row, 0, $this->lng->txt(
"login"));
561 if(substr($c, 0, 4) ==
"obj_")
563 $obj_id = substr($c, 4);
564 $type = $ilObjDataCache->lookupType($obj_id);
565 $a_excel->
setCell($a_row, $cnt,
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
567 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
570 $a_excel->
setCell($a_row, $cnt, $this->lng->txt(
"trac_percentage").
" (%)");
575 $a_excel->
setCell($a_row, $cnt, $labels[$c][
"txt"]);
585 $a_excel->
setCell($a_row, 0, $a_set[
"login"]);
592 case (substr($c, 0, 4) ==
"obj_"):
593 $obj_id = substr($c, 4);
595 $a_excel->
setCell($a_row, $cnt, $val);
597 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
600 $perc = (int)$a_set[$c.
"_perc"];
604 $a_excel->
setCell($a_row, $cnt, $perc);
608 case (substr($c, 0, 6) ==
"objtv_"):
609 case (substr($c, 0, 7) ==
"objsco_"):
610 case (substr($c, 0, 7) ==
"objsub_"):
612 $a_excel->
setCell($a_row, $cnt, $val);
621 $val = $this->
parseValue($c, $a_set[$c],
"user");
622 $a_excel->
setCell($a_row, $cnt, $val);
632 global $ilObjDataCache;
634 $a_csv->addColumn($this->lng->txt(
"login"));
639 if(substr($c, 0, 4) ==
"obj_")
641 $obj_id = substr($c, 4);
642 $type = $ilObjDataCache->lookupType($obj_id);
643 $a_csv->addColumn(
"(".$this->lng->txt($type).
") ".$labels[$c][
"txt"]);
645 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
647 $a_csv->addColumn($this->lng->txt(
"trac_percentage").
" (%)");
652 $a_csv->addColumn($labels[$c][
"txt"]);
661 $a_csv->addColumn($a_set[
"login"]);
667 case (substr($c, 0, 4) ==
"obj_"):
668 $obj_id = substr($c, 4);
670 $a_csv->addColumn($val);
672 if(is_array($this->perc_map) && $this->perc_map[$obj_id])
674 $perc = (int)$a_set[$c.
"_perc"];
679 $a_csv->addColumn($perc);
683 case (substr($c, 0, 6) ==
"objtv_"):
684 case (substr($c, 0, 7) ==
"objsco_"):
685 case (substr($c, 0, 7) ==
"objsub_"):
687 $a_csv->addColumn($val);
696 $val = $this->
parseValue($c, $a_set[$c],
"user");
697 $a_csv->addColumn($val);
const LP_STATUS_COMPLETED_NUM
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 _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(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 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)
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.
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)
setCell($a_row, $a_col, $a_value)
Set cell value.
const LP_STATUS_NOT_ATTEMPTED_NUM
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
showTimingsWarning($a_ref_id, $a_user_id)
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