19declare(strict_types=0);
72 $this->
ui = $DIC->ui();
73 $this->
ctrl = $DIC->ctrl();
74 $this->
user = $DIC->user();
75 $this->
lng = $DIC->language();
76 $this->
http = $DIC->http();
78 $this->
access = $DIC->access();
79 $this->data_factory =
new DataFactory();
80 $this->static_url =
$DIC[
'static_url'];
81 $this->tracking_view =
new ViewFactory();
82 $this->
lng->loadLanguageModule(
"trac");
92 if ($this->
http->wrapper()->query()->has(self::URL_VAR_MODE)) {
93 return $this->
http->wrapper()->query()->retrieve(
95 $this->
refinery->kindlyTo()->string()
104 $presentation_options = [
105 self::PRESENTATION_OPTION_CURRENT => $this->
lng->txt(self::LNG_VAR_PRESENTATION_OPTION_CURRENT),
106 self::PRESENTATION_OPTION_FUTURE => $this->
lng->txt(self::LNG_VAR_PRESENTATION_OPTION_FUTURE),
107 self::PRESENTATION_OPTION_PAST => $this->
lng->txt(self::LNG_VAR_PRESENTATION_OPTION_PAST),
108 self::PRESENTATION_OPTION_ALL => $this->
lng->txt(self::LNG_VAR_PRESENTATION_OPTION_ALL),
110 $uri = $this->
http->request()->getUri()->__toString();
111 $url_builder =
new URLBuilder($this->data_factory->uri($uri));
112 list($url_builder, $action_parameter_token) =
113 $url_builder->acquireParameters(
114 [self::URL_NAMESPACE_VIEWCONTROL, self::URL_NAMESPACE_PLP],
115 self::URL_VAR_ACTION_MODE
117 $modes = $this->
ui->factory()->viewControl()->mode(
119 $presentation_options[self::PRESENTATION_OPTION_CURRENT] => (
string) $url_builder->withParameter($action_parameter_token, self::PRESENTATION_OPTION_CURRENT)->buildURI(),
120 $presentation_options[self::PRESENTATION_OPTION_FUTURE] => (
string) $url_builder->withParameter($action_parameter_token, self::PRESENTATION_OPTION_FUTURE)->buildURI(),
121 $presentation_options[self::PRESENTATION_OPTION_PAST] => (
string) $url_builder->withParameter($action_parameter_token, self::PRESENTATION_OPTION_PAST)->buildURI(),
122 $presentation_options[self::PRESENTATION_OPTION_ALL] => (
string) $url_builder->withParameter($action_parameter_token, self::PRESENTATION_OPTION_ALL)->buildURI(),
126 ->withActive($presentation_options[$current_presentation]);
135 protected function buildPanelItems(
136 string $presentation_mode
140 $filter = $this->tracking_view->dataRetrieval()->filter()
141 ->withUserIds($this->
user->getId())
142 ->withObjectIds(...$ids)
143 ->withOnlyDataOfObjectWithLPEnabled(
false);
144 $view_info = $this->tracking_view->dataRetrieval()->service()->retrieveViewInfo($filter);
146 foreach ($view_info->combinedInfoIterator() as $combinedInfo) {
147 $obj_id = $combinedInfo->getObjectInfo()->getObjectId();
148 $ids_with_lp[] = $obj_id;
153 !$this->
isPresentable($presentation_mode, $crs->getCourseStart(), $crs->getCourseEnd())
157 $offline_str = $crs->getOfflineStatus()
158 ? $this->
lng->txt(self::LNG_VAR_PROPERTY_CRS_ONLINE_NO)
159 : $this->
lng->txt(self::LNG_VAR_PROPERTY_CRS_ONLINE_YES);
160 $property_builder = $this->tracking_view->propertyList()->builder();
161 if (!is_null($crs->getCourseStart())) {
163 $property_builder = $property_builder
164 ->withProperty($this->
lng->txt(self::LNG_VAR_PROPERTY_CRS_START), $crs_start);
166 if (!is_null($crs->getCourseEnd())) {
168 $property_builder = $property_builder
169 ->withProperty($this->
lng->txt(self::LNG_VAR_PROPERTY_CRS_END), $crs_end);
171 $property_builder = $property_builder
172 ->withProperty($this->
lng->txt(self::LNG_VAR_PROPERTY_CRS_ONLINE), $offline_str);
173 $item = $this->tracking_view->renderer()->service()->standardItem(
174 $combinedInfo->getObjectInfo(),
175 $property_builder->getList(),
176 $this->buildLinkToCourse($obj_id)
182 $progress_chart = $this->tracking_view->renderer()->service()->standardProgressMeter($combinedInfo->getLPInfo());
183 $item = $item->withProgress($progress_chart);
185 $items[$obj_id] = $item;
191 string $presentation_mode,
196 $crs_start = (is_null($crs_start) || $crs_start->isNull()) ? $now : $crs_start;
197 $crs_end = (is_null($crs_end) || $crs_end->isNull()) ? $now : $crs_end;
198 if ($presentation_mode === self::PRESENTATION_OPTION_ALL) {
203 $presentation_mode === self::PRESENTATION_OPTION_PAST &&
210 $presentation_mode === self::PRESENTATION_OPTION_FUTURE &&
218 $presentation_mode === self::PRESENTATION_OPTION_CURRENT &&
228 $view_controls = $this->buildViewControls();
229 $items = $this->buildPanelItems($this->getCurrentPresentationModeFromQuery());
230 $crs_item_group = $this->
ui->factory()->item()->group(
"", $items);
231 $ui_panel = $this->
ui->factory()->panel()->listing()->standard(
232 $this->
lng->txt(self::LNG_VAR_LISTING_TITLE),
237 ->withViewControls($view_controls);
238 $this->
ui->mainTemplate()->setContent($this->
ui->renderer()->render([$ui_panel]));
244 if ($this->
access->checkAccess(
"read",
"", $ref_id)) {
254 if (count($ref_ids) === 0) {
257 return $this->static_url->builder()->build(
259 $this->data_factory->refId((
int) current($ref_ids))
Provides fluid interface to RBAC services.
The scope of this class is split ilias-conform URI's into components.
Class ilCtrl provides processing control methods.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _within(ilDateTime $dt, ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
Check whether an date is within a date duration given by start and end.
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
const LP_MODE_DEACTIVATED
@ilCtrl_IsCalledBy ilLPPersonalGUI: ilDashboardGUI
RefineryFactory $refinery
const URL_NAMESPACE_VIEWCONTROL
const LNG_VAR_PRESENTATION_OPTION_FUTURE
const LNG_VAR_PROPERTY_CRS_ONLINE_NO
const PRESENTATION_OPTION_ALL
const LNG_VAR_LISTING_TITLE
const LNG_VAR_PROPERTY_CRS_ONLINE_YES
const LNG_VAR_PROPERTY_CRS_ONLINE
const PRESENTATION_OPTION_PAST
const LNG_VAR_PRESENTATION_OPTION_ALL
const LNG_VAR_PROPERTY_CRS_START
const LNG_VAR_PRESENTATION_OPTION_PAST
isPresentable(string $presentation_mode, ilDateTime|null $crs_start, ilDateTime|null $crs_end)
hasReadAccess(int $obj_id)
getCurrentPresentationModeFromQuery()
const URL_VAR_ACTION_MODE
const PRESENTATION_OPTION_CURRENT
const PRESENTATION_OPTION_FUTURE
DataFactory $data_factory
ViewFactoryInterface $tracking_view
buildLinkToCourse(int $obj_id)
const LNG_VAR_PRESENTATION_OPTION_CURRENT
const LNG_VAR_PROPERTY_CRS_END
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _getAllReferences(int $id)
get all reference ids for object ID
Base class for course and group participants.
This describes a Standard Dropdown.
This describes how an icon could be modified during construction of UI.
This describes the specific behavior of an ILIAS standard icon.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
static http()
Fetches the global http state from ILIAS.