72 $this->dcl_gui_object = $a_dcl_object;
75 $this->record_id = (int) $_REQUEST[
'record_id'];
78 if (!$this->record_obj->hasPermissionToView((
int)
$_GET[
'ref_id'])) {
80 $ilCtrl->redirectByClass(
'ildclrecordlistgui',
'listRecords');
84 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
86 $tpl->setCurrentBlock(
"SyntaxStyle");
88 $tpl->parseCurrentBlock();
90 $tpl->setCurrentBlock(
"ContentStyle");
92 $tpl->parseCurrentBlock();
94 $this->table = $this->record_obj->getTable();
97 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
98 $repId = $this->dcl_gui_object->getDataCollectionObject()->getId();
99 $objId = (int) $this->record_id;
100 $this->notesGUI =
new ilNoteGUI($repId, $objId);
101 $this->notesGUI->enablePublicNotes(
true);
102 $this->notesGUI->enablePublicNotesDeletion(
true);
103 $ilCtrl->setParameterByClass(
"ilnotegui",
"record_id", $this->record_id);
104 $ilCtrl->setParameterByClass(
"ilnotegui",
"rep_id", $repId);
106 if (isset($_GET[
'disable_paging']) && $_GET[
'disable_paging']) {
107 $this->is_enabled_paging =
false;
110 if ($this->is_enabled_paging) {
120 $this->tableview_id =
$_GET[
'tableview_id'] ?
$_GET[
'tableview_id'] : $this->table->getFirstTableViewId(
$_GET[
'ref_id']);
121 $ilCtrl->setParameter($this,
'tableview_id', $this->tableview_id);
122 $ilCtrl->setParameter($this->dcl_gui_object,
'tableview_id',
$_GET[
'back_tableview_id'] ?
$_GET[
'back_tableview_id'] : $this->tableview_id);
125 if ($this->table->getVisibleTableViews(
$_GET[
'ref_id'],
true)) {
135 $cmdClass =
$ilCtrl->getCmdClass();
146 $this->notesGUI->deleteNote();
150 $this->notesGUI->cancelDelete();
154 $this->notesGUI->$cmd();
171 $tpl->setContent($table_gui->getHTML());
181 $ilTabs = $DIC[
'ilTabs'];
185 $rctpl =
new ilTemplate(
"tpl.record_view.html",
false,
true,
"Modules/DataCollection");
187 $ilTabs->setTabActive(
"id_content");
189 if (!$this->tableview_id) {
190 $ilCtrl->redirectByClass(
"ildclrecordlistgui",
"listRecords");
194 include_once(
"class.ilDclDetailedViewDefinitionGUI.php");
196 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
199 $html = $pageObj->getHTML();
200 $rctpl->addCss(
"./Services/COPage/css/content.css");
201 $rctpl->fillCssFiles();
203 foreach (
$table->getRecordFields() as $field) {
205 $pattern =
'/\[dcliln field="' . preg_quote($field->getTitle(),
"/") .
'"\](.*?)\[\/dcliln\]/';
206 if (preg_match($pattern,
$html)) {
207 $html = preg_replace($pattern, $this->record_obj->getRecordFieldSingleHTML($field->getId(), $this->
setOptions(
"$1")),
$html);
211 $pattern =
'/\[dclrefln field="' . preg_quote($field->getTitle(),
"/") .
'"\](.*?)\[\/dclrefln\]/';
212 if (preg_match($pattern,
$html)) {
213 $this->currentField = $field;
214 $html = preg_replace_callback($pattern, array($this,
"doReplace"),
$html);
217 $pattern =
'/\[ext tableOf="' . preg_quote($field->getTitle(),
"/") .
'" field="(.*?)"\]/';
218 if (preg_match($pattern,
$html)) {
219 $this->currentField = $field;
220 $html = preg_replace_callback($pattern, array($this,
"doExtReplace"),
$html);
223 $html = str_ireplace(
"[" . $field->getTitle() .
"]", $this->record_obj->getRecordFieldSingleHTML($field->getId()),
$html);
225 foreach (
$table->getStandardFields() as $field) {
226 $html = str_ireplace(
"[" . $field->getId() .
"]", $this->record_obj->getRecordFieldSingleHTML($field->getId()),
$html);
228 $rctpl->setVariable(
"CONTENT",
$html);
231 $perma_link =
new ilPermanentLinkGUI(
"dcl",
$_GET[
"ref_id"],
"_" . $this->tableview_id .
"_" . $this->record_obj->getId());
232 $tpl->setVariable(
'PRMLINK', $perma_link->getHTML());
236 if ($this->is_enabled_paging) {
238 $rctpl->setVariable(
'PREV_NEXT_RECORD_LINKS', $prevNextLinks);
239 $ilCtrl->clearParameters($this);
240 $rctpl->setVariable(
'FORM_ACTION',
$ilCtrl->getFormAction($this));
241 $rctpl->setVariable(
'RECORD', $this->lng->txt(
'dcl_record'));
242 $rctpl->setVariable(
'RECORD_FROM_TOTAL', sprintf($this->lng->txt(
'dcl_record_from_total'),
$this->current_record_position, count($this->record_ids)));
243 $rctpl->setVariable(
'TABLEVIEW_ID', $this->tableview_id);
248 if ($this->record_obj->hasPermissionToEdit((
int)
$_GET[
'ref_id'])) {
250 $ilCtrl->setParameterByClass(
'ildclrecordeditgui',
'table_id', $this->table->getId());
251 $ilCtrl->setParameterByClass(
'ildclrecordeditgui',
'tableview_id', $this->tableview_id);
253 $ilCtrl->saveParameterByClass(
'ildclrecordeditgui',
'record_id');
254 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
'ildclrecordeditgui',
'edit'));
255 $button->setCaption($this->lng->txt(
'dcl_edit_record'),
false);
256 $rctpl->setVariable(
'EDIT_RECORD_BUTTON', $button->render());
260 if ($this->table->getPublicCommentsEnabled()) {
261 $rctpl->setVariable(
'COMMENTS', $this->
renderComments($editComments));
264 $tpl->setContent($rctpl->get());
275 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 = array($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 ilUtil::sendInfo(
"Bad Viewdefinition at [ext tableOf=\"" . $found[1] .
"\" ...]",
true);
310 foreach ($ref_recs as $ref_record) {
311 $tpl->setCurrentBlock(
"reference");
312 $tpl->setVariable(
"CONTENT", $ref_record->getRecordFieldHTML($field->getId()));
313 $tpl->parseCurrentBlock();
326 return $this->notesGUI->getOnlyCommentsHtml();
328 return $this->notesGUI->editNoteForm();
338 if (!isset(
$_SESSION[
'dcl_record_ids']) ||
$_SESSION[
'dcl_table_id'] != $this->table->getId()) {
343 $this->record_ids =
$_SESSION[
'dcl_record_ids'];
344 foreach ($this->record_ids as $k => $recId) {
345 if ($recId == $this->record_id) {
347 $this->prev_record_id = $this->record_ids[$k - 1];
349 if (($k + 1) < count($this->record_ids)) {
350 $this->next_record_id = $this->record_ids[$k + 1];
352 $this->current_record_position = $k + 1;
369 $ilCtrl->setParameter($this,
'tableview_id', $this->tableview_id);
370 $prevStr = $this->lng->txt(
'dcl_prev_record');
371 $nextStr = $this->lng->txt(
'dcl_next_record');
372 $ilCtrl->setParameter($this,
'record_id', $this->prev_record_id);
373 $url =
$ilCtrl->getLinkTarget($this,
'renderRecord');
376 $ilCtrl->setParameter($this,
'record_id', $this->next_record_id);
377 $url =
$ilCtrl->getLinkTarget($this,
'renderRecord');
392 foreach ($this->record_ids as $k => $recId) {
393 $selected = ($recId == $this->record_id) ?
" selected" :
"";
394 $out .=
"<option value='{$recId}'{$selected}>" . ($k + 1) .
"</option>";
409 $options[
'link'][
'name'] = $link_name;
423 $this->table->getPartialRecords(
$list->getOrderField(),
$list->getOrderDirection(),
$list->getLimit(),
$list->getOffset(),
$list->getFilter());
432 return ilObjDataCollectionAccess::hasAccessTo(filter_input(INPUT_GET,
'ref_id'), $this->table->getId(),
$this->tableview_id)
renderComments($edit=false)
loadSession()
If we come from a goto Link we need to build up the session data.
if(isset($_REQUEST['delete'])) $list
Class for permanent links.
renderSelectOptions()
Render select options.
Class ilDclDetailedViewDefinitionGUI.
static getTableCache($table_id=0)
Class ilDclTableViewTableGUI.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilObjDataCollectionGUI.
setOptions($link_name)
setOptions string $link_name
renderPrevNextLinks()
Determine and return the markup for the previous/next records.
special template class to simplify handling of ITX/PEAR
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static hasWriteAccess($ref, $user_id=0)
static getRecordCache($record_id=0)
renderRecord($editComments=false)
Class ilDclBaseFieldModel.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct(ilObjDataCollectionGUI $a_dcl_object)
determineNextPrevRecords()
Find the previous/next record from the current position.