51 $this->dclUi = $adapter->getDataCollectionUi();
65 $this->
ctrl = $DIC->ctrl();
66 $this->dcl_gui_object = $a_dcl_object;
67 $this->
lng = $DIC->language();
68 $this->
http = $DIC->http();
70 $this->main_tpl =
$DIC->ui()->mainTemplate();
72 if ($this->
http->wrapper()->query()->has(
'record_id')) {
73 $this->record_id = $this->
http->wrapper()->query()->retrieve(
78 if ($this->
http->wrapper()->post()->has(
'record_id')) {
79 $this->record_id = $this->
http->wrapper()->post()->retrieve(
86 $ref_id = $this->dcl_gui_object->getRefId();
87 if (!$this->record_obj->hasPermissionToView(
$ref_id)) {
88 $this->dclUi->displayFailureMessage($this->
lng->txt(
'dcl_msg_no_perm_view'));
90 $this->dclEndPoint->redirect($this->dclEndPoint->getListRecordsLink());
94 $tpl->setCurrentBlock(
"SyntaxStyle");
96 $tpl->parseCurrentBlock();
98 $tpl->setCurrentBlock(
"ContentStyle");
100 $tpl->parseCurrentBlock();
102 $this->table = $this->record_obj->getTable();
105 $repId = $this->dcl_gui_object->getDataCollectionObject()->getId();
106 $objId = $this->record_id;
108 $this->notesGUI->enablePublicNotes(
true);
109 $this->notesGUI->enablePublicNotesDeletion(
true);
110 $this->
ctrl->setParameterByClass(
"ilnotegui",
"record_id", $this->record_id);
111 $this->
ctrl->setParameterByClass(
"ilnotegui",
"rep_id", $repId);
113 $this->tableview_id = $tableview_id;
115 if ($this->
http->wrapper()->query()->has(
'disable_paging')
116 && $this->http->wrapper()->query()->retrieve(
'disable_paging', $this->refinery->kindlyTo()->bool())) {
117 $this->is_enabled_paging =
false;
120 if ($this->is_enabled_paging) {
121 $this->determineNextPrevRecords();
123 $this->content_style_domain =
$DIC->contentStyle()
126 $this->dcl_gui_object->getDataCollectionObject()->getRefId()
132 $this->
ctrl->setParameter($this,
'tableview_id', $this->tableview_id);
134 if (!$this->checkAccess()) {
135 $ref_id = $this->
http->wrapper()->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
136 if ($this->table->getVisibleTableViews(
$ref_id,
true)) {
137 $this->offerAlternativeViews();
139 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
145 $cmd = $this->
ctrl->getCmd();
146 $cmdClass = $this->
ctrl->getCmdClass();
147 switch (strtolower($cmdClass)) {
149 $this->notesGUI->executeCommand();
161 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'dcl_msg_info_alternatives'));
162 $table_gui =
new ilDclTableViewTableGUI($this,
'renderRecord', $this->table, $this->dcl_gui_object->getRefId());
163 $tpl->setContent($table_gui->getHTML());
169 $ilTabs =
$DIC->tabs();
171 $ilCtrl =
$DIC->ctrl();
175 $ilTabs->setTabActive(
"id_content");
177 if (!$this->tableview_id) {
178 $ilCtrl->redirectByClass(
"ildclrecordlistgui",
"listRecords");
183 $pageObj->setStyleId(
184 $this->content_style_domain->getEffectiveStyleId()
187 $html = $pageObj->getHTML();
188 $rctpl->addCss(
"./Services/COPage/css/content.css");
189 $rctpl->fillCssFiles();
193 $pattern =
'/\[dcliln field="' . preg_quote($field->getTitle(),
"/") .
'"\](.*?)\[\/dcliln\]/';
194 if (preg_match($pattern, $html)) {
195 $html = preg_replace(
197 $this->record_obj->getRecordFieldSingleHTML($field->getId(), $this->setOptions(
"$1")),
203 $pattern =
'/\[dclrefln field="' . preg_quote($field->getTitle(),
"/") .
'"\](.*?)\[\/dclrefln\]/';
204 if (preg_match($pattern, $html)) {
205 $this->currentField = $field;
206 $html = preg_replace_callback($pattern, [$this,
"doReplace"], $html);
209 $pattern =
'/\[ext tableOf="' . preg_quote($field->getTitle(),
"/") .
'" field="(.*?)"\]/';
210 if (preg_match($pattern, $html)) {
211 $this->currentField = $field;
212 $html = preg_replace_callback($pattern, [$this,
"doExtReplace"], $html);
215 $html = str_ireplace(
216 "[" . $field->getTitle() .
"]",
217 $this->record_obj->getRecordFieldSingleHTML($field->getId(), [
'tableview_id' => $this->tableview_id]),
221 foreach ($table->getStandardFields() as $field) {
222 $html = str_ireplace(
223 "[" . $field->getId() .
"]",
224 $this->record_obj->getRecordFieldSingleHTML($field->getId(), [
'tableview_id' => $this->tableview_id]),
228 $rctpl->setVariable(
"CONTENT", $html);
231 $tpl->setPermanentLink(
233 filter_input(INPUT_GET,
'ref_id', FILTER_VALIDATE_INT),
234 '_' . $this->tableview_id .
'_' . $this->record_obj->getId()
239 if ($this->is_enabled_paging) {
240 $prevNextLinks = $this->renderPrevNextLinks();
241 $rctpl->setVariable(
'PREV_NEXT_RECORD_LINKS', $prevNextLinks);
242 $ilCtrl->clearParameters($this);
243 $rctpl->setVariable(
'FORM_ACTION', $ilCtrl->getFormAction($this));
244 $rctpl->setVariable(
'RECORD', $this->
lng->txt(
'dcl_record'));
248 $this->
lng->txt(
'dcl_record_from_total'),
249 $this->current_record_position,
250 count($this->record_ids)
253 $rctpl->setVariable(
'TABLEVIEW_ID', $this->tableview_id);
254 $rctpl->setVariable(
'SELECT_OPTIONS', $this->renderSelectOptions());
258 $ref_id = $this->
http->wrapper()->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
260 if ($this->record_obj->hasPermissionToEdit(
$ref_id)) {
262 $ilCtrl->setParameterByClass(
'ildclrecordeditgui',
'table_id', $this->table->getId());
263 $ilCtrl->setParameterByClass(
'ildclrecordeditgui',
'tableview_id', $this->tableview_id);
265 $ilCtrl->saveParameterByClass(
'ildclrecordeditgui',
'record_id');
266 $button->setUrl($ilCtrl->getLinkTargetByClass(
'ildclrecordeditgui',
'edit'));
267 $button->setCaption($this->
lng->txt(
'dcl_edit_record'),
false);
268 $rctpl->setVariable(
'EDIT_RECORD_BUTTON', $button->render());
272 if ($this->table->getPublicCommentsEnabled()) {
273 $rctpl->setVariable(
'COMMENTS', $this->renderComments($editComments));
276 $tpl->setContent($rctpl->get());
281 return $this->record_obj->getRecordFieldSingleHTML($this->currentField->getId(), $this->setOptions($found[1]));
286 $ref_rec_ids = $this->record_obj->getRecordFieldValue($this->currentField->getId());
287 if (!is_array($ref_rec_ids)) {
288 $ref_rec_ids = [$ref_rec_ids];
290 if (!count($ref_rec_ids) || !$ref_rec_ids) {
294 foreach ($ref_rec_ids as $ref_rec_id) {
297 $field = $ref_recs[0]->getTable()->getFieldByTitle($found[1]);
299 $tpl =
new ilTemplate(
"tpl.reference_list.html",
true,
true,
"Modules/DataCollection");
300 $tpl->setCurrentBlock(
"reference_list");
304 $this->main_tpl->setOnScreenMessage(
306 "Bad Viewdefinition at [ext tableOf=\"" . $found[1] .
"\" ...]",
314 foreach ($ref_recs as $ref_record) {
315 $tpl->setCurrentBlock(
"reference");
316 $tpl->setVariable(
"CONTENT", $ref_record->getRecordFieldHTML($field->getId()));
317 $tpl->parseCurrentBlock();
331 return $this->notesGUI->getCommentsHTML();
333 return $this->notesGUI->editNoteForm();
343 $this->loadSession();
348 foreach ($this->record_ids as $k => $recId) {
349 if ($recId == $this->record_id) {
351 $this->prev_record_id = $this->record_ids[$k - 1];
353 if (($k + 1) < count($this->record_ids)) {
354 $this->next_record_id = $this->record_ids[$k + 1];
356 $this->current_record_position = $k + 1;
369 $ilCtrl =
$DIC[
'ilCtrl'];
370 $ilCtrl->setParameter($this,
'tableview_id', $this->tableview_id);
371 $prevStr = $this->
lng->txt(
'dcl_prev_record');
372 $nextStr = $this->
lng->txt(
'dcl_next_record');
373 $ilCtrl->setParameter($this,
'record_id', $this->prev_record_id);
374 $url = $ilCtrl->getLinkTarget($this,
'renderRecord');
375 $out = ($this->prev_record_id) ?
"<a href='{$url}'>{$prevStr}</a>" :
"<span class='light'>{$prevStr}</span>";
377 $ilCtrl->setParameter($this,
'record_id', $this->next_record_id);
378 $url = $ilCtrl->getLinkTarget($this,
'renderRecord');
379 $out .= ($this->next_record_id) ?
"<a href='{$url}'>{$nextStr}</a>" :
"<span class='light'>{$nextStr}</span>";
390 foreach ($this->record_ids as $k => $recId) {
391 $selected = ($recId == $this->record_id) ?
" selected" :
"";
392 $out .=
"<option value='{$recId}'{$selected}>" . ($k + 1) .
"</option>";
405 $options[
'link'][
'display'] =
true;
406 $options[
'link'][
'name'] = $link_name;
417 new ilDclRecordListGUI($this->dcl_gui_object, $this->table->getId(), $this->tableview_id),
423 $list->determineOffsetAndOrder();
424 $this->table->getPartialRecords(
425 $this->table->getId(),
426 $list->getOrderField(),
427 $list->getOrderDirection(),
439 $ref_id = $this->dcl_gui_object->getRefId();
440 $has_accass = ilObjDataCollectionAccess::hasAccessTo(
$ref_id, $this->table->getId(), $this->tableview_id);
442 return $has_accass && $is_active;
External facade for object content styles.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDataCollectionEndpoint()
getDataCollectionAccess()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getRecordCache(?int $record_id)
static getTableCache(int $table_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
doExtReplace(array $found)
init(ilDataCollectionOutboundsAdapter $adapter)
__construct(ilObjDataCollectionGUI $a_dcl_object, int $tableview_id)
ilObjDataCollectionGUI $dcl_gui_object
renderPrevNextLinks()
Determine and return the markup for the previous/next records.
ILIAS Style Content Object ObjectFacade $content_style_domain
renderRecord(bool $editComments=false)
determineNextPrevRecords()
Find the previous/next record from the current position.
renderSelectOptions()
Render select options.
int $current_record_position
ilGlobalTemplateInterface $main_tpl
ILIAS HTTP Services $http
setOptions(string $link_name)
setOptions string $link_name
renderComments(bool $edit=false)
loadSession()
If we come from a goto Link we need to build up the session data.
ilDataCollectionUiPort $dclUi
ILIAS Refinery Factory $refinery
ilDclBaseRecordModel $record_obj
ilDclBaseFieldModel $currentField
ilDataCollectionEndpointPort $dclEndPoint
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getRecordFields()
Returns all fields of this table which are NOT standard fields.
static hasWriteAccess(int $ref, ?int $user_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static getSyntaxStylePath()
static get(string $a_var)
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
static http()
Fetches the global http state from ILIAS.