40 include_once
'Services/Tracking/classes/ItemList/class.ilLPItemListFactory.php';
41 include_once
'classes/class.ilXmlWriter.php';
57 $this->current_user_id = $a_tracked_user;
64 return $this->current_user_id;
74 $this->ctrl->setReturn($this,
"");
75 switch($this->ctrl->getNextClass())
78 $cmd = $this->ctrl->getCmd();
87 $this->type = $a_type;
100 include_once
'./classes/class.ilXmlWriter.php';
103 include_once
'./Services/Tracking/classes/class.ilLPFilter.php';
104 $this->filter =
new ilLPFilter($ilUser->getId());
106 include_once
'./Services/Tracking/classes/class.ilLPFilterGUI.php';
124 $this->ctrl->returnToParent($this);
142 global $ilObjDataCache;
144 include_once
'classes/class.ilXmlWriter.php';
146 $this->writer->xmlHeader();
147 $this->writer->xmlStartTag(
'LearningProgress');
148 $this->writer->xmlElement(
'Title',null,$this->lng->txt(
'learning_progress'));
152 $this->writer->xmlElement(
'Header',null,$header);
155 $this->writer->xmlElement(
'Footer',null,
'powered by ILIAS');
158 include_once
'Services/Tracking/classes/ItemList/class.ilLPItemListFactory.php';
159 $this->details_obj_id = $ilObjDataCache->lookupObjId($this->
getRefId());
164 $item_list->setCurrentUser($this->current_user_id);
165 $item_list->readUserInfo();
166 $item_list->renderObjectInfoXML($this->writer,
true,
true);
170 $item_list->renderObjectInfoXML($this->writer,
false,
false);
173 include_once
'Services/Tracking/classes/class.ilLPObjSettings.php';
179 $this->writer->xmlEndTag(
'LearningProgress');
187 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
189 global $ilObjDataCache,$ilUser;
199 $all_users = array_merge($completed,$in_progress,$not_attempted,
$failed);
200 $all_users = $this->
__sort($all_users,
'usr_data',
'lastname',
'usr_id');
204 $all_users = array($this->current_user_id);
209 $this->writer->xmlStartTag(
'Items');
210 $this->writer->xmlStartTag(
'ItemHeader');
211 $this->writer->xmlElement(
'HeaderTitle',null,$this->lng->txt(
'trac_objects'));
214 include_once
'Modules/Course/classes/class.ilCourseItems.php';
217 $this->writer->xmlElement(
'HeaderInfo',null,$this->lng->txt(
'trac_head_timing'));
219 $this->writer->xmlEndTag(
'ItemHeader');
222 $this->container_row_counter = 0;
223 foreach($all_users as
$user)
225 $this->writer->xmlStartTag(
'Item');
227 $this->writer->xmlEndTag(
'Item');
229 $this->writer->xmlEndTag(
'Items');
233 global $ilObjDataCache,$ilUser,$ilAccess;
235 include_once
'Services/Tracking/classes/ItemList/class.ilLPItemListFactory.php';
238 if($this->has_timings)
240 $item_list->readTimings();
241 $item_list->enable(
'timings');
243 $item_list->setCurrentUser($a_usr_id);
244 $item_list->readUserInfo();
245 $item_list->setIndentLevel($level);
248 $item_list->renderObjectDetailsXML($this->writer);
250 if(
$type ==
'sahs_item' or
251 $type ==
'objective' or
257 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
260 switch($item_list->getMode())
263 $this->writer->xmlStartTag(
'Item');
265 $this->writer->xmlEndTag(
'Item');
269 $this->writer->xmlStartTag(
'Item');
271 $this->writer->xmlEndTag(
'Item');
275 if(!$ilAccess->checkAccess(
'read',
'',$child_id))
279 $this->writer->xmlStartTag(
'Item');
281 $ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($child_id)),$level + 2);
282 $this->writer->xmlEndTag(
'Item');
290 include_once
'Services/Transformation/classes/class.ilXML2FO.php';
293 $xml2FO->setXSLTLocation($this->tpl->getTemplatePath(
'learning_progress_fo.xsl',
'Services/Tracking'));
294 $xml2FO->setXMLString($this->writer->xmlDumpMem());
295 $xml2FO->transform();
297 $this->fo_string = $xml2FO->getFOString();
298 #var_dump("<pre>",htmlentities($this->fo_string),"<pre>");
304 include_once
'Services/Transformation/classes/class.ilFO2PDF.php';
307 $fo2pdf->setFOString($this->fo_string);
308 $pdf_base64 = $fo2pdf->send();
313 $this->ctrl->returnToParent($this);
320 global $ilObjDataCache,$ilUser;
323 $this->tpl =
new ilTemplate(
'tpl.lp_pdf_list.xml',
true,
true,
'Services/Tracking');
326 $this->tpl->setVariable(
"FILTER",$this->filter_gui->getFO());
327 $this->filter->setRequiredPermission(
'read');
328 $type = $this->filter->getFilterType();
329 $this->tpl->setVariable(
"TXT_OBJS",$this->lng->txt(
'objs_'.$type));
332 $objs = $this->filter->getObjects();
333 $sorted_objs = $this->
__sort(array_keys($objs),
'object_data',
'title',
'obj_id');
336 foreach($sorted_objs as $object_id)
340 $item_list->readUserInfo();
341 $item_list->renderSimpleProgressFO();
350 global $ilObjDataCache,$ilUser;
353 $this->tpl =
new ilTemplate(
'tpl.lp_pdf_list.xml',
true,
true,
'Services/Tracking');
356 $this->tpl->setVariable(
"FILTER",$this->filter_gui->getFO());
357 $this->filter->setRequiredPermission(
'read');
358 $type = $this->filter->getFilterType();
359 $this->tpl->setVariable(
"TXT_OBJS",$this->lng->txt(
'objs_'.$type));
362 $objs = $this->filter->getObjects();
363 $sorted_objs = $this->
__sort(array_keys($objs),
'object_data',
'title',
'obj_id');
366 foreach($sorted_objs as $object_id)
369 #$item_list->setCurrentUser($this->tracked_user->getId());
371 $item_list->readUserInfo();
372 $item_list->renderObjectListFO();
382 global $ilUser,$ilObjDataCache;
384 $this->tpl->setVariable(
"LEARNING_PROGRESS_OF",$this->lng->txt(
'learning_progress'));
389 $this->tpl->setVariable(
"USER_FULLNAME",$name[
'lastname'].
', '.$name[
'firstname']);
400 #include_once 'Services/Transformation/classes/class.ilContentObject2FO.php';
401 #$co2fo = new ilContentObject2FO();
402 #$co2fo->setXMLString($xml = $this->xml_tpl->get());
404 #if(!$co2fo->transform())
406 #endInfo($this->lng->txt('trac_error_pdf',true));
407 # $this->ctrl->returnToParent($this);
410 include_once
'Services/Transformation/classes/class.ilFO2PDF.php';
413 #echo htmlentities($this->tpl->get());
414 $fo2pdf->setFOString($this->tpl->get());
416 #var_dump("<pre>",htmlentities($fo2pdf->getFOString()),"<pre>");
418 $pdf_base64 = $fo2pdf->send();
423 $this->ctrl->returnToParent($this);