5 require_once
'./Services/Table/classes/class.ilTable2GUI.php';
6 require_once
'class.ilDataCollectionRecordViewGUI.php';
7 require_once
'class.ilDataCollectionField.php';
8 require_once
'./Services/Tracking/classes/class.ilLPStatus.php';
9 require_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
10 require_once
'class.ilDataCollectionDatatype.php';
45 $this->
setId(
"dcl_record_list" . $table->
getId());
46 parent::__construct($a_parent_obj, $a_parent_cmd);
48 $this->parent_obj = $a_parent_obj;
49 $this->
setRowTemplate(
"tpl.record_list_row.html",
"Modules/DataCollection");
53 $this->numeric_fields = array();
54 foreach($this->table->getVisibleFields() as $field)
56 $title = $field->getTitle();
59 if($field->getLearningProgress()){
60 $this->
addColumn($lng->txt(
"dcl_status"),
"_status_".$field->getTitle());
63 $this->numeric_fields[] =
$title;
66 $this->
addColumn($lng->txt(
"actions"),
"",
"30px");
76 $this->
setFormAction($ilCtrl->getFormAction($a_parent_obj,
"applyFilter"));
78 $this->
setStyle(
'table', $this->
getStyle(
'table') .
' ' .
'dcl_record_list');
90 $this->object_data =
$data;
103 foreach($this->table->getFields() as $field)
105 if($field->getExportable())
107 $worksheet->writeString(
$row, $col, $field->getTitle());
114 return in_array($field, $this->numeric_fields);
124 foreach($this->object_data as $record){
125 $record_data = array();
126 $record_data[
"_front"] = null;
128 $record_data[
'_record'] = ($ilCtrl->getCmd() ==
'exportExcel') ? $record : null;
130 foreach($this->table->getVisibleFields() as $field)
132 $title = $field->getTitle();
135 $arr_properties = $field->getProperties();
142 $record_data[
$title] = $record->getRecordFieldHTML($field->getId(),
$options);
145 if ($field->getLearningProgress()) {
146 $record_data[
"_status_".$title] = $this->
getStatus($record, $field);
150 $ilCtrl->setParameterByClass(
"ildatacollectionfieldeditgui",
"record_id", $record->getId());
151 $ilCtrl->setParameterByClass(
"ildatacollectionrecordviewgui",
"record_id", $record->getId());
152 $ilCtrl->setParameterByClass(
"ildatacollectionrecordeditgui",
"record_id", $record->getId());
154 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
158 $record_data[
"_front"] = $ilCtrl->getLinkTargetByClass(
"ildatacollectionrecordviewgui",
'renderRecord');
162 $alist->setId($record->getId());
163 $alist->setListTitle($lng->txt(
"actions"));
167 $alist->addItem($lng->txt(
'view'),
'view', $ilCtrl->getLinkTargetByClass(
"ildatacollectionrecordviewgui",
'renderRecord'));
170 if($record->hasPermissionToEdit($this->parent_obj->parent_obj->ref_id))
172 $alist->addItem($lng->txt(
'edit'),
'edit', $ilCtrl->getLinkTargetByClass(
"ildatacollectionrecordeditgui",
'edit'));
175 if($record->hasPermissionToDelete($this->parent_obj->parent_obj->ref_id))
177 $alist->addItem($lng->txt(
'delete'),
'delete', $ilCtrl->getLinkTargetByClass(
"ildatacollectionrecordeditgui",
'confirmDelete'));
180 $record_data[
"_actions"] = $alist->getHTML();
181 $data[] = $record_data;
193 foreach($this->table->getFields() as $field)
195 if($field->getExportable())
197 $worksheet->writeString(
$row, $col, $record[
"_record"]->getRecordFieldExportValue($field->getId()));
211 foreach($this->table->getVisibleFields() as $field)
213 $title = $field->getTitle();
214 $this->tpl->setCurrentBlock(
"field");
215 $content = $record_data[
$title];
216 if ($content ===
false || $content === null) $content =
'';
217 $this->tpl->setVariable(
"CONTENT", $content);
218 $this->tpl->parseCurrentBlock();
219 if($field->getLearningProgress()){
220 $this->tpl->setCurrentBlock(
"field");
221 $this->tpl->setVariable(
"CONTENT", $record_data[
"_status_".
$title]);
222 $this->tpl->parseCurrentBlock();
226 if ($record_data[
"_front"])
228 $this->tpl->setVariable(
"VIEW_IMAGE_LINK", $record_data[
"_front"]);
231 $this->tpl->setVariable(
"ACTIONS", $record_data[
"_actions"]);
244 if($status = $record_field->getStatus()){
245 $return =
"<img src='".ilLearningProgressBaseGUI::_getImagePathForStatus($status->status).
"'>";
255 foreach($this->table->getFilterableFields() as $field) {
257 $input->readFromSession();
258 $value = $input->getValue();
259 if (is_array($value)) {
260 if ($value[
'from'] || $value[
'to']) {
261 $this->filter[
"filter_".$field->getId()] = $value;
265 $this->filter[
"filter_".$field->getId()] = $value;
Class ilDataCollectionField.
setFormName($a_formname)
Set Form name.
Class ilDataCollectionField.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setStyle($a_element, $a_style)
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="")
Build img tag.
const PROPERTYID_ILIAS_REFERENCE_LINK
setShowTemplates($a_value)
Toggle templates.
getStatus(ilDataCollectionRecord $record, ilDataCollectionField $field)
This adds the collumn for status.
const PROPERTYID_REFERENCE_LINK
static addFilterInputFieldToTable(ilDataCollectionField $field, ilTable2GUI &$table)
addFilterInputFieldToTable This function adds the according filter item to the table gui passed as ar...
static _getViewDefinitionId($record_obj)
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilDataCollectionRecord.
static getRecordFieldCache($record, $field)
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
if(!is_array($argv)) $options
Class ilDataCollectionField.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getFilter()
Return array of fields that are currently stored in the filter.
fillRowExcel($worksheet, &$row, $record)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
writeFilterToSession()
Write filter values to session.
Class ilDataCollectionField.
User interface class for advanced drop-down selection lists.
fillHeaderExcel($worksheet, &$row)
__construct(ilDataCollectionRecordListGUI $a_parent_obj, $a_parent_cmd, ilDataCollectionTable $table)
setFormAction($a_form_action)
Set Form action parameter.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
fillRow($record_data)
fill row
setEnableHeader($a_enableheader)
Set Enable Header.
buildData()
Parse data from record objects to an array that is then set to this table with ::setData() ...
setEnableTitle($a_enabletitle)
Set Enable Title.