19 declare(strict_types=0);
35 public function __construct(
int $a_mode,
int $a_ref_id,
int $a_user_id = 0)
42 $this->
ctrl->saveParameter($this,
'details_id');
47 if ($this->
http->wrapper()->query()->has(
'details_id')) {
48 return $this->
http->wrapper()->query()->retrieve(
61 $this->
ctrl->setReturn($this,
"show");
62 $this->
ctrl->setParameter($this,
'user_id', $this->
getUserId());
63 switch ($this->
ctrl->getNextClass()) {
64 case 'illpprogresstablegui':
70 $this->
ctrl->setReturn($this,
'show');
71 $this->
ctrl->forwardCommand($table_gui);
80 public function show(): void
84 case self::LP_CONTEXT_REPOSITORY:
89 case self::LP_CONTEXT_USER_FOLDER:
90 case self::LP_CONTEXT_ORG_UNIT:
105 $info->setContextRefId($this->ref_id);
106 $info->setContextObjId($this->details_obj_id);
107 $info->setContentObjType((
string) $this->obj_type);
108 $info->saveProgress(
false);
109 $this->
ctrl->redirect($this);
117 if ($this->
http->wrapper()->query()->has(
'crs_id')) {
118 $crs_id = $this->
http->wrapper()->query()->retrieve(
124 $this->
ctrl->setParameter($this,
'details_id', $crs_id);
126 $this->
lng->txt(
'trac_view_crs'),
127 $this->
ctrl->getLinkTarget($this,
'details')
129 } elseif ($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP or
130 $this->
getMode() == self::LP_CONTEXT_USER_FOLDER) {
132 $this->
lng->txt(
'trac_view_list'),
133 $this->
ctrl->getLinkTarget($this,
'show')
137 $this->tpl->addBlockFile(
140 'tpl.lp_progress_container.html',
141 'components/ILIAS/Tracking' 145 $info->setContextRefId($this->details_id);
146 $info->setContextObjId($this->details_obj_id);
147 $info->setContentObjType((
string) $this->obj_type);
148 $info->enableLearningProgress(
true);
149 $info->setFormAction($this->
ctrl->getFormAction($this));
152 $this->details_obj_id,
153 $this->tracked_user->getId()
158 $this->tpl->setVariable(
"LM_INFO", $info->getHTML());
161 $collection = $olp->getCollectionInstance();
164 foreach ($collection->getItems() as $item_id) {
167 if ($this->
access->checkAccessOfUser(
168 $this->tracked_user->getId(),
173 $obj_ids[
$obj_id] = array($item_id);
176 $obj_ids[] = $item_id;
182 if (count($obj_ids) > 0) {
185 'read_learning_progress',
196 $this->details_obj_id,
199 $this->tpl->setVariable(
"LP_OBJECTS", $lp_table->getHTML());
207 $this->tpl->addBlockFile(
210 'tpl.lp_list_progress.html',
211 'components/ILIAS/Tracking' 216 $info->setFormAction($this->
ctrl->getFormAction($this));
229 $this->tpl->setVariable(
"LP_OBJECTS", $lp_table->getHTML());
239 if ($this->
http->wrapper()->post()->has(
'user_id')) {
240 $a_usr_id = $this->
http->wrapper()->post()->retrieve(
244 $this->
ctrl->setParameter($this,
'user_id', $a_usr_id);
250 'Invalid user id given: ' . $a_usr_id
253 $this->tracked_user =
$user;
259 if ($this->mode == self::LP_CONTEXT_USER_FOLDER &&
260 $this->rbacsystem->checkAccess(
'read', $this->ref_id)) {
264 if ($this->mode == self::LP_CONTEXT_ORG_UNIT &&
273 if (!$this->rbacreview->isAssigned(
274 $this->user->getId(),
285 if (!$a_details_id) {
291 $this->details_id = $a_details_id;
296 $this->details_obj_id
300 $this->details_mode = $olp->getCurrentMode();
__showObjectDetails(ilInfoScreenGUI $info, int $item_id=0, string $item_type='', bool $add_section=true)
show details about current object.
static _getAllReferences(int $id)
get all reference ids for object ID
TableGUI class for learning progress.
__initDetails(int $a_details_id)
LP collection of repository objects.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__initUser(int $a_usr_id=0)
static http()
Fetches the global http state from ILIAS.
executeCommand()
execute command
__construct(int $a_mode, int $a_ref_id, int $a_user_id=0)
static _lookupObjectId(int $ref_id)
static _checkAccessToUserLearningProgress(int $ref_id, int $usr_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
__appendLPDetails(ilInfoScreenGUI $info, int $item_id, int $user_id)
__construct(Container $dic, ilPlugin $plugin)
static checkPermission(string $a_permission, int $a_ref_id, ?int $a_user_id=null)
wrapper for rbac access checks
__getLegendHTML(int $variant=ilLPStatusIcons::ICON_VARIANT_LONG)
static getInstance(int $obj_id)