5 require_once(
'./Modules/DataCollection/classes/Table/class.ilDclTable.php');
6 require_once(
'./Services/COPage/classes/class.ilPageObjectGUI.php');
7 require_once(
'./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordModel.php');
8 require_once(
'./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldModel.php');
9 require_once(
'class.ilDclDetailedViewDefinition.php');
10 require_once(
'./Services/UIComponent/Button/classes/class.ilLinkButton.php');
11 require_once(
'./Modules/DataCollection/classes/Content/class.ilDclRecordEditGUI.php');
12 require_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
13 require_once(
"./Modules/DataCollection/classes/Content/class.ilDclRecordListTableGUI.php");
14 require_once(
"./Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php");
15 require_once(
"./Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php");
82 $this->dcl_gui_object = $a_dcl_object;
85 $this->record_id = (int)$_REQUEST[
'record_id'];
88 if (!$this->record_obj->hasPermissionToView((
int)
$_GET[
'ref_id'])) {
90 $ilCtrl->redirectByClass(
'ildclrecordlistgui',
'listRecords');
94 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
96 $tpl->setCurrentBlock(
"SyntaxStyle");
98 $tpl->parseCurrentBlock();
100 $tpl->setCurrentBlock(
"ContentStyle");
102 $tpl->parseCurrentBlock();
104 $this->table = $this->record_obj->getTable();
107 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
108 $repId = $this->dcl_gui_object->getDataCollectionObject()->getId();
109 $objId = (int)$this->record_id;
110 $this->notesGUI =
new ilNoteGUI($repId, $objId);
111 $this->notesGUI->enablePublicNotes(
true);
112 $this->notesGUI->enablePublicNotesDeletion(
true);
113 $ilCtrl->setParameterByClass(
"ilnotegui",
"record_id", $this->record_id);
114 $ilCtrl->setParameterByClass(
"ilnotegui",
"rep_id", $repId);
116 if (isset($_GET[
'disable_paging']) && $_GET[
'disable_paging']) {
117 $this->is_enabled_paging =
false;
120 if ($this->is_enabled_paging) {
129 $this->tableview_id =
$_GET[
'tableview_id'] ?
$_GET[
'tableview_id'] : $this->table->getFirstTableViewId(
$_GET[
'ref_id']);
130 $ilCtrl->setParameter($this,
'tableview_id', $this->tableview_id);
131 $ilCtrl->setParameter($this->dcl_gui_object,
'tableview_id',
$_GET[
'back_tableview_id'] ?
$_GET[
'back_tableview_id'] : $this->tableview_id);
135 if ($this->table->getVisibleTableViews(
$_GET[
'ref_id'],
true)) {
144 $cmdClass =
$ilCtrl->getCmdClass();
155 $this->notesGUI->deleteNote();
159 $this->notesGUI->cancelDelete();
163 $this->notesGUI->$cmd();
178 $tpl->setContent($table_gui->getHTML());
186 $ilTabs = $DIC[
'ilTabs'];
190 $rctpl =
new ilTemplate(
"tpl.record_view.html",
false,
true,
"Modules/DataCollection");
192 $ilTabs->setTabActive(
"id_content");
194 if (!$this->tableview_id) {
195 $ilCtrl->redirectByClass(
"ildclrecordlistgui",
"listRecords");
199 include_once(
"class.ilDclDetailedViewDefinitionGUI.php");
201 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
204 $html = $pageObj->getHTML();
205 $rctpl->addCss(
"./Services/COPage/css/content.css");
206 $rctpl->fillCssFiles();
208 foreach (
$table->getRecordFields() as $field) {
210 $pattern =
'/\[dcliln field="' . preg_quote($field->getTitle(),
"/") .
'"\](.*?)\[\/dcliln\]/';
211 if (preg_match($pattern,
$html)) {
212 $html = preg_replace($pattern, $this->record_obj->getRecordFieldSingleHTML($field->getId(), $this->
setOptions(
"$1")),
$html);
216 $pattern =
'/\[dclrefln field="' . preg_quote($field->getTitle(),
"/") .
'"\](.*?)\[\/dclrefln\]/';
217 if (preg_match($pattern,
$html)) {
218 $this->currentField = $field;
219 $html = preg_replace_callback($pattern,
array( $this,
"doReplace" ),
$html);
222 $pattern =
'/\[ext tableOf="' . preg_quote($field->getTitle(),
"/") .
'" field="(.*?)"\]/';
223 if (preg_match($pattern,
$html)) {
224 $this->currentField = $field;
225 $html = preg_replace_callback($pattern,
array( $this,
"doExtReplace" ),
$html);
228 $html = str_ireplace(
"[" . $field->getTitle() .
"]", $this->record_obj->getRecordFieldSingleHTML($field->getId()),
$html);
230 foreach (
$table->getStandardFields() as $field) {
231 $html = str_ireplace(
"[" . $field->getId() .
"]", $this->record_obj->getRecordFieldSingleHTML($field->getId()),
$html);
233 $rctpl->setVariable(
"CONTENT",
$html);
236 $perma_link =
new ilPermanentLinkGUI(
"dcl",
$_GET[
"ref_id"],
"_" . $this->tableview_id .
"_" . $this->record_obj->getId());
237 $tpl->setVariable(
'PRMLINK', $perma_link->getHTML());
241 if ($this->is_enabled_paging) {
243 $rctpl->setVariable(
'PREV_NEXT_RECORD_LINKS', $prevNextLinks);
244 $ilCtrl->clearParameters($this);
245 $rctpl->setVariable(
'FORM_ACTION',
$ilCtrl->getFormAction($this));
246 $rctpl->setVariable(
'RECORD', $this->lng->txt(
'dcl_record'));
247 $rctpl->setVariable(
'RECORD_FROM_TOTAL', sprintf($this->lng->txt(
'dcl_record_from_total'),
$this->current_record_position, count($this->record_ids)));
248 $rctpl->setVariable(
'TABLEVIEW_ID', $this->tableview_id);
253 if ($this->record_obj->hasPermissionToEdit((
int)
$_GET[
'ref_id'])) {
255 $ilCtrl->setParameterByClass(
'ildclrecordeditgui',
'table_id', $this->table->getId());
256 $ilCtrl->setParameterByClass(
'ildclrecordeditgui',
'tableview_id', $this->tableview_id);
258 $ilCtrl->saveParameterByClass(
'ildclrecordeditgui',
'record_id');
259 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
'ildclrecordeditgui',
'edit'));
260 $button->setCaption($this->lng->txt(
'dcl_edit_record'),
false);
261 $rctpl->setVariable(
'EDIT_RECORD_BUTTON', $button->render());
266 if ($this->table->getPublicCommentsEnabled()) {
267 $rctpl->setVariable(
'COMMENTS', $this->
renderComments($editComments));
270 $tpl->setContent($rctpl->get());
280 return $this->record_obj->getRecordFieldSingleHTML($this->currentField->getId(), $this->
setOptions($found[1]));
290 $ref_rec_ids = $this->record_obj->getRecordFieldValue($this->currentField->getId());
291 if (!is_array($ref_rec_ids)) {
292 $ref_rec_ids =
array( $ref_rec_ids );
294 if (!count($ref_rec_ids) || !$ref_rec_ids) {
298 foreach ($ref_rec_ids as $ref_rec_id) {
301 $field = $ref_recs[0]->getTable()->getFieldByTitle($found[1]);
303 $tpl =
new ilTemplate(
"tpl.reference_list.html",
true,
true,
"Modules/DataCollection");
304 $tpl->setCurrentBlock(
"reference_list");
308 ilUtil::sendInfo(
"Bad Viewdefinition at [ext tableOf=\"" . $found[1] .
"\" ...]",
true);
314 foreach ($ref_recs as $ref_record) {
315 $tpl->setCurrentBlock(
"reference");
316 $tpl->setVariable(
"CONTENT", $ref_record->getRecordFieldHTML($field->getId()));
317 $tpl->parseCurrentBlock();
330 return $this->notesGUI->getOnlyCommentsHtml();
332 return $this->notesGUI->editNoteForm();
341 if(!isset(
$_SESSION[
'dcl_record_ids']) ||
$_SESSION[
'dcl_table_id'] != $this->table->getId()) {
346 $this->record_ids =
$_SESSION[
'dcl_record_ids'];
347 foreach ($this->record_ids as $k => $recId) {
348 if ($recId == $this->record_id) {
350 $this->prev_record_id = $this->record_ids[$k - 1];
352 if (($k + 1) < count($this->record_ids)) {
353 $this->next_record_id = $this->record_ids[$k + 1];
355 $this->current_record_position = $k + 1;
371 $ilCtrl->setParameter($this,
'tableview_id', $this->tableview_id);
372 $prevStr = $this->lng->txt(
'dcl_prev_record');
373 $nextStr = $this->lng->txt(
'dcl_next_record');
374 $ilCtrl->setParameter($this,
'record_id', $this->prev_record_id);
375 $url =
$ilCtrl->getLinkTarget($this,
'renderRecord');
378 $ilCtrl->setParameter($this,
'record_id', $this->next_record_id);
379 $url =
$ilCtrl->getLinkTarget($this,
'renderRecord');
393 foreach ($this->record_ids as $k => $recId) {
394 $selected = ($recId == $this->record_id) ?
" selected" :
"";
395 $out .=
"<option value='{$recId}'{$selected}>" . ($k + 1) .
"</option>";
409 $options[
'link'][
'name'] = $link_name;
422 $this->table->getPartialRecords($list->getOrderField(), $list->getOrderDirection(), $list->getLimit(), $list->getOffset(), $list->getFilter());
430 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.
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.
if(!is_array($argv)) $options
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
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct(ilObjDataCollectionGUI $a_dcl_object)
static getContentStylePath($a_style_id)
get content style path
determineNextPrevRecords()
Find the previous/next record from the current position.