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, $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;
32 $this->
setId(
"lpprgtbl");
34 parent::__construct($a_parent_obj, $a_parent_cmd);
40 $this->has_object_subitems =
true;
42 $user = $this->tracked_user;
49 $this->
addColumn($this->lng->txt(
"trac_title"),
"title",
"26%");
50 $this->
addColumn($this->lng->txt(
"status"),
"status",
"7%");
51 $this->
addColumn($this->lng->txt(
'trac_status_changed'),
'status_changed',
'10%');
52 $this->
addColumn($this->lng->txt(
"trac_percentage"),
"percentage",
"7%");
53 $this->
addColumn($this->lng->txt(
"trac_mark"),
"",
"5%");
54 $this->
addColumn($this->lng->txt(
"comment"),
"",
"10%");
55 $this->
addColumn($this->lng->txt(
"trac_mode"),
"",
"20%");
56 $this->
addColumn($this->lng->txt(
"path"),
"",
"20%");
57 $this->
addColumn($this->lng->txt(
"actions"),
"",
"5%");
59 $this->
setTitle(sprintf($this->lng->txt(
"trac_learning_progress_of"), $user->getFullName()));
63 $this->
addMultiCommand(
"hideSelected", $lng->txt(
"trac_hide_selected"));
67 include_once
'./Services/Object/classes/class.ilObjectLP.php';
69 $collection = $olp->getCollectionInstance();
74 $this->
parseTitle($a_parent_obj->details_obj_id,
"trac_subitems");
78 $this->
parseTitle($a_parent_obj->details_obj_id,
"trac_progress");
81 $this->
addColumn($this->lng->txt(
"trac_title"),
"title",
"31%");
82 $this->
addColumn($this->lng->txt(
"status"),
"status",
"7%");
86 $this->lng->loadLanguageModule(
'content');
87 $this->
addColumn($this->lng->txt(
'cont_score'),
'score',
'10%');
89 else if($this->has_object_subitems)
91 $this->
addColumn($this->lng->txt(
'trac_status_changed'),
'status_changed',
'10%');
92 $this->
addColumn($this->lng->txt(
"trac_percentage"),
"percentage",
"7%");
93 $this->
addColumn($this->lng->txt(
"trac_mark"),
"",
"5%");
94 $this->
addColumn($this->lng->txt(
"comment"),
"",
"10%");
95 $this->
addColumn($this->lng->txt(
"trac_mode"),
"",
"20%");
96 $this->
addColumn($this->lng->txt(
"path"),
"",
"20%");
101 $this->
setFormAction($ilCtrl->getFormActionByClass(get_class($this)));
102 $this->
setRowTemplate(
"tpl.lp_progress_list_row.html",
"Services/Tracking");
110 if($this->has_object_subitems)
116 if($this->tracked_user)
124 $obj_ids = $this->obj_ids;
125 if(!$obj_ids && !$this->details)
128 $membership_ids = null;
129 if($this->filter[
"type"] ==
"crs" || $this->filter[
"type"] ==
"grp")
131 include_once
"Services/Membership/classes/class.ilParticipants.php";
133 $this->filter[
"type"]);
135 if($membership_ids === null ||
sizeof($membership_ids))
137 switch($this->lp_context)
150 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
168 foreach(
$data as $idx => $item)
170 if(!$item[
"status"] && !$this->filter[
"status"] && !$this->details)
194 $this->tpl->setCurrentBlock(
"column_checkbox");
195 $this->tpl->setVariable(
"OBJ_ID", $a_set[
"obj_id"]);
196 $this->tpl->parseCurrentBlock();
200 $this->tpl->setVariable(
"ICON_ALT", $this->lng->txt($a_set[
"type"]));
201 $this->tpl->setVariable(
"TITLE_TEXT", $a_set[
"title"]);
203 if($a_set[
"offline"])
205 $this->tpl->setCurrentBlock(
"offline");
206 $this->tpl->setVariable(
"TEXT_STATUS", $this->lng->txt(
"status"));
207 $this->tpl->setVariable(
"TEXT_OFFLINE", $this->lng->txt(
"offline"));
208 $this->tpl->parseCurrentBlock();
216 $this->tpl->setVariable(
'SCORE_VAL', $a_set[
"score"]);
218 else if($this->has_object_subitems)
220 $this->tpl->setCurrentBlock(
"status_details");
225 $this->tpl->setVariable(
"MODE_TEXT", $olp->getModeText($a_set[
"u_mode"]));
226 $this->tpl->setVariable(
"MARK_VALUE", $a_set[
"mark"]);
227 $this->tpl->setVariable(
"COMMENT_TEXT", $a_set[
"comment"]);
231 $this->tpl->setVariable(
"PERCENTAGE_VALUE",
"");
235 $this->tpl->setVariable(
"PERCENTAGE_VALUE", sprintf(
"%d%%", $a_set[
"percentage"]));
242 $this->tpl->setCurrentBlock(
"item_path");
243 foreach(
$path as $path_item)
245 $this->tpl->setVariable(
"PATH_ITEM", $path_item);
246 $this->tpl->parseCurrentBlock();
250 $this->tpl->parseCurrentBlock();
272 $this->tpl->setCurrentBlock(
'warning_img');
274 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
275 $this->tpl->parseCurrentBlock();
282 $this->tpl->setCurrentBlock(
"item_command");
283 $ilCtrl->setParameterByClass(get_class($this),
'hide', $a_set[
"obj_id"]);
284 $this->tpl->setVariable(
"HREF_COMMAND", $ilCtrl->getLinkTargetByClass(get_class($this),
'hide'));
285 $this->tpl->setVariable(
"TXT_COMMAND", $this->lng->txt(
'trac_hide'));
286 $this->tpl->parseCurrentBlock();
289 if($olp->getCollectionInstance() && $a_set[
"ref_ids"])
293 $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(),
'details_id',
$ref_id);
294 $this->tpl->setVariable(
"HREF_COMMAND", $ilCtrl->getLinkTargetByClass($ilCtrl->getCmdClass(),
'details'));
295 $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(),
'details_id',
'');
296 $this->tpl->setVariable(
"TXT_COMMAND", $this->lng->txt(
'trac_subitems'));
297 $this->tpl->parseCurrentBlock();
300 $this->tpl->setCurrentBlock(
"column_action");
301 $this->tpl->parseCurrentBlock();
308 $worksheet->write($a_row, 0, $this->lng->txt(
"type"));
309 $worksheet->write($a_row, 1, $this->lng->txt(
"trac_title"));
310 $worksheet->write($a_row, 2, $this->lng->txt(
"status"));
311 $worksheet->write($a_row, 3, $this->lng->txt(
"trac_status_changed"));
312 $worksheet->write($a_row, 4, $this->lng->txt(
"trac_percentage"));
313 $worksheet->write($a_row, 5, $this->lng->txt(
"trac_mark"));
314 $worksheet->write($a_row, 6, $this->lng->txt(
"comment"));
315 $worksheet->write($a_row, 7, $this->lng->txt(
"trac_mode"));
321 $worksheet->write($a_row, 0, $this->lng->txt($a_set[
"type"]));
322 $worksheet->write($a_row, 1, $a_set[
"title"]);
329 $worksheet->write($a_row, 4, sprintf(
"%d%%", $a_set[
"percentage"]));
330 $worksheet->write($a_row, 5, $a_set[
"mark"]);
331 $worksheet->write($a_row, 6, $a_set[
"comment"]);
352 $a_csv->addColumn($this->lng->txt(
"type"));
353 $a_csv->addColumn($this->lng->txt(
"trac_title"));
354 $a_csv->addColumn($this->lng->txt(
"status"));
355 $a_csv->addColumn($this->lng->txt(
"trac_status_changed"));
356 $a_csv->addColumn($this->lng->txt(
"trac_percentage"));
357 $a_csv->addColumn($this->lng->txt(
"trac_mark"));
358 $a_csv->addColumn($this->lng->txt(
"comment"));
359 $a_csv->addColumn($this->lng->txt(
"trac_mode"));
366 $a_csv->addColumn($this->lng->txt($a_set[
"type"]));
367 $a_csv->addColumn($a_set[
"title"]);
374 $a_csv->addColumn(sprintf(
"%d%%", $a_set[
"percentage"]));
375 $a_csv->addColumn($a_set[
"mark"]);
376 $a_csv->addColumn($a_set[
"comment"]);
const LP_STATUS_COMPLETED_NUM
getObjectivesStatusForUser($a_user_id, array $a_objective_ids)
getSCOsStatusForUser($a_user_id, $a_parent_obj_id, array $a_sco_ids)
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.
setShowTemplates($a_value)
Toggle templates.
setEnableNumInfo($a_val)
Set enable num info.
fillRowExcel($worksheet, &$a_row, $a_set)
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
const LP_MODE_COLLECTION_MANUAL
_getImagePathForStatus($a_status)
Get image path for status.
static resetToDefaults()
reset to defaults
static setUseRelativeDates($a_status)
set use relative dates
const LP_MODE_COLLECTION_TLT
parseTitle($a_obj_id, $action, $a_user_id=false)
TableGUI class for learning progress.
_getStatusText($a_status)
Get status alt text.
fillRowCSV($a_csv, $a_set)
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.
setLimit($a_limit=0, $a_default_limit=0)
set max.
TableGUI class for learning progress.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
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)
fillHeaderExcel($worksheet, &$a_row)
fillRow($a_set)
Fill table row.
__construct($a_parent_obj, $a_parent_cmd, $a_user="", $obj_ids=NULL, $details=false, $mode=null, $personal_only=false, $a_parent_id=null, $lp_context=null)
Constructor.
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.
searchObjects(array $filter, $permission, array $preset_obj_ids=null)
Search objects that match current filters.
showTimingsWarning($a_ref_id, $a_user_id)
setFormAction($a_form_action)
Set Form action parameter.
getObjectsStatusForUser($a_user_id, array $obj_refs)
setEnableHeader($a_enableheader)
Set Enable Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
getCurrentFilter($as_query=false)
setEnableTitle($a_enabletitle)
Set Enable Title.
static getInstance($a_obj_id)
getSubItemsStatusForUser($a_user_id, $a_parent_obj_id, array $a_item_ids)
static _mode2Text($a_mode)