ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilCourseVerificationTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/Table/classes/class.ilTable2GUI.php';
5
13{
20 public function __construct($a_parent_obj, $a_parent_cmd = "")
21 {
22 global $ilCtrl;
23
24 parent::__construct($a_parent_obj, $a_parent_cmd);
25
26 $this->addColumn($this->lng->txt("title"), "title");
27 $this->addColumn($this->lng->txt("passed"), "passed");
28 $this->addColumn($this->lng->txt("action"), "");
29
30 $this->setTitle($this->lng->txt("crsv_create"));
31 $this->setDescription($this->lng->txt("crsv_create_info"));
32
33 $this->setRowTemplate("tpl.crs_verification_row.html", "Modules/Course");
34 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
35
36 $this->getItems();
37 }
38
42 protected function getItems()
43 {
44 global $ilUser;
45
46 $data = array();
47
48 include_once "Modules/Course/classes/class.ilObjCourse.php";
49 include_once "./Modules/Course/classes/class.ilCourseParticipants.php";
50
51 $obj_ids = ilCourseParticipants::_getMembershipByType($ilUser->getId(), "crs");
52 if ($obj_ids) {
53 include_once "./Services/Certificate/classes/class.ilCertificate.php";
54 include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
56
57 foreach ($obj_ids as $crs_id) {
58 // #11210 - only available certificates!
60 $crs = new ilObjCourse($crs_id, false);
63 $data[] = array("id" => $crs_id,
64 "title" => ilObject::_lookupTitle($crs_id),
65 "passed" => true);
66 }
67 }
68 }
69 }
70
71 $this->setData($data);
72 }
73
79 protected function fillRow($a_set)
80 {
81 global $ilCtrl;
82
83 $this->tpl->setVariable("TITLE", $a_set["title"]);
84 $this->tpl->setVariable("PASSED", ($a_set["passed"]) ? $this->lng->txt("yes") :
85 $this->lng->txt("no"));
86
87 if ($a_set["passed"]) {
88 $ilCtrl->setParameter($this->parent_obj, "crs_id", $a_set["id"]);
89 $action = $ilCtrl->getLinkTarget($this->parent_obj, "save");
90 $this->tpl->setVariable("URL_SELECT", $action);
91 $this->tpl->setVariable("TXT_SELECT", $this->lng->txt("select"));
92 }
93 }
94}
An exception for terminatinating execution or to throw for unit testing.
static _isComplete($adapter)
Checks the status of the certificate.
static _preloadListData($a_usr_ids, $a_obj_ids)
Get certificate/passed status for all given objects and users.
static _hasUserCertificate($a_usr_id, $a_obj_id)
Check if user has certificate for course.
List all completed course for current user.
__construct($a_parent_obj, $a_parent_cmd="")
Constructor.
Class ilObjCourse.
static _lookupTitle($a_id)
lookup object title
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
Class ilTable2GUI.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setDescription($a_val)
Set description.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
$action
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18