5 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionTable.php');
6 require_once(
'./Services/COPage/classes/class.ilPageObjectGUI.php');
7 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecord.php');
8 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionField.php');
9 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinition.php');
10 require_once(
'./Services/UIComponent/Button/classes/class.ilLinkButton.php');
11 require_once(
'class.ilDataCollectionRecordEditGUI.php');
12 require_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
13 require_once(
"Modules/DataCollection/classes/class.ilDataCollectionRecordListTableGUI.php");
14 require_once(
"Modules/DataCollection/classes/class.ilDataCollectionRecordListGUI.php");
71 $this->dcl_gui_object = $a_dcl_object;
73 $this->record_id = (int)
$_REQUEST[
'record_id'];
76 if (!$this->record_obj->hasPermissionToView((
int)
$_GET[
'ref_id'])) {
78 $ilCtrl->redirectByClass(
'ildatacollectionrecordlistgui',
'listRecords');
82 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
84 $tpl->setCurrentBlock(
"SyntaxStyle");
86 $tpl->parseCurrentBlock();
88 $tpl->setCurrentBlock(
"ContentStyle");
90 $tpl->parseCurrentBlock();
92 $this->table = $this->record_obj->getTable();
95 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
96 $repId = $this->dcl_gui_object->getDataCollectionObject()->getId();
97 $objId = (int)$this->record_id;
98 $this->notesGUI =
new ilNoteGUI($repId, $objId);
99 $this->notesGUI->enablePublicNotes(
true);
100 $this->notesGUI->enablePublicNotesDeletion(
true);
101 $ilCtrl->setParameterByClass(
"ilnotegui",
"record_id", $this->record_id);
102 $ilCtrl->setParameterByClass(
"ilnotegui",
"rep_id", $repId);
104 if (isset($_GET[
'disable_paging']) && $_GET[
'disable_paging']) {
105 $this->is_enabled_paging =
false;
108 if ($this->is_enabled_paging) {
117 $cmd = $ilCtrl->getCmd();
118 $cmdClass = $ilCtrl->getCmdClass();
129 $this->notesGUI->deleteNote();
133 $this->notesGUI->cancelDelete();
137 $this->notesGUI->$cmd();
169 return $view->getActive() AND $view->getId() !== NULL;
181 return $view->getActive() AND $view->getId() !== NULL;
191 $rctpl =
new ilTemplate(
"tpl.record_view.html",
false,
true,
"Modules/DataCollection");
193 $ilTabs->setTabActive(
"id_content");
195 $view_id = self::_getViewDefinitionId($this->record_obj);
198 $ilCtrl->redirectByClass(
"ildatacollectionrecordlistgui",
"listRecords");
202 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php");
204 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
207 $html = $pageObj->getHTML();
208 $rctpl->addCss(
"./Services/COPage/css/content.css");
209 $rctpl->fillCssFiles();
211 foreach (
$table->getRecordFields() as $field) {
213 $pattern =
'/\[dcliln field="' . preg_quote($field->getTitle(),
"/") .
'"\](.*?)\[\/dcliln\]/';
214 if (preg_match($pattern,
$html)) {
215 $html = preg_replace($pattern, $this->record_obj->getRecordFieldSingleHTML($field->getId(), $this->
setOptions(
"$1")),
$html);
219 $pattern =
'/\[dclrefln field="' . preg_quote($field->getTitle(),
"/") .
'"\](.*?)\[\/dclrefln\]/';
220 if (preg_match($pattern,
$html)) {
221 $this->currentField = $field;
222 $html = preg_replace_callback($pattern, array( $this,
"doReplace" ),
$html);
225 $pattern =
'/\[ext tableOf="' . preg_quote($field->getTitle(),
"/") .
'" field="(.*?)"\]/';
226 if (preg_match($pattern,
$html)) {
227 $this->currentField = $field;
228 $html = preg_replace_callback($pattern, array( $this,
"doExtReplace" ),
$html);
231 $html = str_ireplace(
"[" . $field->getTitle() .
"]", $this->record_obj->getRecordFieldSingleHTML($field->getId()),
$html);
233 foreach (
$table->getStandardFields() as $field) {
234 $html = str_ireplace(
"[" . $field->getId() .
"]", $this->record_obj->getRecordFieldSingleHTML($field->getId()),
$html);
236 $rctpl->setVariable(
"CONTENT",
$html);
240 $tpl->setVariable(
'PRMLINK', $perma_link->getHTML());
244 if ($this->is_enabled_paging) {
246 $rctpl->setVariable(
'PREV_NEXT_RECORD_LINKS', $prevNextLinks);
247 $ilCtrl->clearParameters($this);
248 $rctpl->setVariable(
'FORM_ACTION', $ilCtrl->getFormAction($this));
249 $rctpl->setVariable(
'RECORD', $lng->txt(
'dcl_record'));
255 if ($this->record_obj->hasPermissionToEdit((
int)
$_GET[
'ref_id'])) {
257 $ilCtrl->setParameterByClass(
'ildatacollectionrecordeditgui',
'table_id', $this->table->getId());
259 $ilCtrl->saveParameterByClass(
'ildatacollectionrecordeditgui',
'record_id');
260 $button->setUrl($ilCtrl->getLinkTargetByClass(
'ildatacollectionrecordeditgui',
'edit'));
261 $button->setCaption($lng->txt(
'dcl_edit_record'),
false);
262 $rctpl->setVariable(
'EDIT_RECORD_BUTTON', $button->render());
268 if ($this->table->getPublicCommentsEnabled()) {
269 $rctpl->setVariable(
'COMMENTS', $this->
renderComments($editComments));
272 $tpl->setContent($rctpl->get());
282 return $this->record_obj->getRecordFieldSingleHTML($this->currentField->getId(), $this->
setOptions($found[1]));
292 $ref_rec_ids = $this->record_obj->getRecordFieldValue($this->currentField->getId());
293 if (!is_array($ref_rec_ids)) {
294 $ref_rec_ids = array( $ref_rec_ids );
296 if (!count($ref_rec_ids) || !$ref_rec_ids) {
300 foreach ($ref_rec_ids as $ref_rec_id) {
303 $field = $ref_recs[0]->getTable()->getFieldByTitle($found[1]);
305 $tpl =
new ilTemplate(
"tpl.reference_list.html",
true,
true,
"Modules/DataCollection");
306 $tpl->setCurrentBlock(
"reference_list");
310 ilUtil::sendInfo(
"Bad Viewdefinition at [ext tableOf=\"" . $found[1] .
"\" ...]",
true);
316 foreach ($ref_recs as $ref_record) {
317 $tpl->setCurrentBlock(
"reference");
318 $tpl->setVariable(
"CONTENT", $ref_record->getRecordFieldHTML($field->getId()));
319 $tpl->parseCurrentBlock();
332 return $this->notesGUI->getOnlyCommentsHtml();
334 return $this->notesGUI->editNoteForm();
343 if(!isset(
$_SESSION[
'dcl_record_ids']) ||
$_SESSION[
'dcl_table_id'] != $this->table->getId()) {
348 $this->record_ids =
$_SESSION[
'dcl_record_ids'];
349 foreach ($this->record_ids as $k => $recId) {
350 if ($recId == $this->record_id) {
352 $this->prev_record_id = $this->record_ids[$k - 1];
354 if (($k + 1) < count($this->record_ids)) {
355 $this->next_record_id = $this->record_ids[$k + 1];
357 $this->current_record_position = $k + 1;
372 $prevStr = $lng->txt(
'dcl_prev_record');
373 $nextStr = $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());
static getRecordCache($record_id=0)
Class ilDataCollectionField.
renderComments($edit=false)
Class ilDataCollectionRecordListGUI.
static getIdByTableId($a_table_id)
Get view definition id by table id.
Class for permanent links.
static hasTableValidViewDefinition(ilDataCollectionTable $table)
static hasWriteAccess($ref)
renderPrevNextLinks()
Determine and return the markup for the previous/next records.
__construct(ilObjDataCollectionGUI $a_dcl_object)
setOptions($link_name)
setOptions string $link_name
getTableId()
Get Table ID.
Class ilDataCollectionRecordViewGUI.
Class ilDataCollectionRecordViewViewdefinitionGUI.
getSyntaxStylePath()
get syntax style path
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilDataCollectionRecord.
Class ilObjDataCollectionGUI.
if(!is_array($argv)) $options
Class ilDataCollectionField.
special template class to simplify handling of ITX/PEAR
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static hasValidViewDefinition(ilDataCollectionRecord $record_obj)
static _getViewDefinitionId(ilDataCollectionRecord $record_obj)
renderSelectOptions()
Render select options.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
renderRecord($editComments=false)
static getInstanceByTableId($table_id)
getContentStylePath($a_style_id)
get content style path
loadSession()
If we come from a goto Link we need to build up the session data.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
determineNextPrevRecords()
Find the previous/next record from the current position.
static getTableCache($table_id=0)