4 require_once
'./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php';
5 require_once
'./Modules/DataCollection/classes/Fields/Base/class.ilDclDatatype.php';
6 require_once
'./Services/Exceptions/classes/class.ilException.php';
7 require_once
'./Services/User/classes/class.ilUserUtil.php';
90 public function doUpdate($omit_notification =
false)
100 "last_update" => array(
108 "last_edit_by" => array(
125 $recordfield->doUpdate();
129 if (!$omit_notification) {
130 ilObjDataCollection::sendNotification(
"update_record", $this->
getTableId(), $this->
id);
141 $ilDB = $DIC[
'ilDB'];
143 $query =
"Select * From il_dcl_record WHERE id = " .
$ilDB->quote($this->
getId(),
"integer") .
" ORDER BY id";
146 $rec =
$ilDB->fetchAssoc($set);
162 $ilDB = $DIC[
'ilDB'];
165 throw new ilException(
"The field does not have a related table!");
168 $id =
$ilDB->nextId(
"il_dcl_record");
171 =
"INSERT INTO il_dcl_record ( 186 $recordField->doCreate();
199 $this->recordfields[$field_id]->delete();
200 if (count($this->recordfields) == 1) {
235 $this->table_id = $a_id;
257 $this->create_date = $a_datetime;
279 $this->last_update = $a_datetime;
301 $this->owner = $a_id;
347 $record_field = $this->recordfields[$field_id];
349 $this->recordfields[$field_id]->setValue($value);
367 $this->recordfields[$field_id]->setValueFromForm(
$form);
384 return $this->recordfields[$field->getId()]->getValueFromExcel($excel,
$row, $col);
396 $value = $field->getValueFromExcel($excel,
$row, $col);
398 $this->{$field->getId()} = $value;
411 foreach ($this->recordfields as
$id => $record_field) {
412 $return[
$id] = $record_field->getValue();
428 if ($field_id === null) {
435 return $this->recordfields[$field_id]->getValue();
449 if ($field_id === null) {
456 return $this->recordfields[$field_id]->getValueForRepresentation();
474 return $this->recordfields[$field_id]->getExportValue();
492 return $this->recordfields[$field_id]->getPlainText();
507 if ($field_id ==
'owner') {
511 $worksheet->
setCell(
$row, $col, $name_array[
'lastname'] .
', ' . $name_array[
'firstname']);
518 $this->recordfields[$field_id]->fillExcelExport($worksheet,
$row, $col);
534 if (is_object($this->recordfields[$field_id])) {
535 $value = $this->recordfields[$field_id]->getFormulaValue();
556 if (is_object($this->recordfields[$field_id])) {
557 $html = $this->recordfields[$field_id]->getRecordRepresentation()->getHTML();
584 if (is_object($this->recordfields[$field_id])) {
585 $html = $this->recordfields[$field_id]->getSortingValue();
606 public function getRecordFieldSingleHTML($field_id, array
$options = array())
613 $field = $this->recordfields[$field_id];
618 $html = $field->getRecordRepresentation()->getSingleHTML(
$options,
false);
639 $this->recordfields[$field_id]->getRecordRepresentation()->fillFormInput(
$form);
650 if ($item =
$form->getItemByPostVar(
"field_" . $field_id)) {
668 $this->$field_id = $value;
678 if ($item =
$form->getItemByPostVar(
'field_' . $field_id)) {
698 return $usr_data[
'login'];
702 return $this->$field_id;
726 return $this->
getId();
741 $this->table->getCollectionObject()
748 return "<a class='dcl_comment' href='#' onclick=\"return " . $ajax_link .
"\"> 750 .
"' alt='{$nComments} Comments'><span class='ilHActProp'>{$nComments}</span></a>";
764 $this->table->getCollectionObject()->getId(),
785 if ($this->recordfields == null) {
788 foreach ($this->table->getRecordFields() as $field) {
804 if ($this->table == null) {
819 return $this->recordfields[$field_id];
828 public function doDelete($omit_notification =
false)
831 $ilDB = $DIC[
'ilDB'];
832 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
835 foreach ($this->recordfields as $recordfield) {
841 $this->
deleteMob($recordfield->getValue());
844 $recordfield->delete();
847 $query =
"DELETE FROM il_dcl_record WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
850 $this->table->loadRecords();
852 if (!$omit_notification) {
853 ilObjDataCollection::sendNotification(
"delete_record", $this->
getTableId(), $this->
getId());
855 $ilAppEventHandler->raise(
856 'Modules/DataCollection',
860 'table_id' => $this->table_id,
861 'record_id' => $this->
getId(),
882 $this->
setOwner($original->getOwner());
884 foreach ($new_fields as $old => $new) {
885 $old_rec_field = $original->getRecordField($old);
887 $new_rec_field->cloneStructure($old_rec_field);
888 $this->recordfields[] = $new_rec_field;
933 foreach ($this->table->getFilterableFields() as $field) {
934 if (!isset($filter[
"filter_" . $field->getId()]) || !$filter[
"filter_" . $field->getId()]) {
953 return $this->
getTable()->hasPermissionToEditRecord($ref_id, $this);
964 return $this->
getTable()->hasPermissionToDeleteRecord($ref_id, $this);
975 return $this->
getTable()->hasPermissionToViewRecord($ref_id, $this);
1008 if ($this->comments === null) {
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
static setCloneOf($old, $new, $type)
getStandardFieldFormulaValue($field_id)
static _lookupObjId($a_id)
getCreateDate()
Get Creation Date.
getRecordFieldExportValue($field_id)
Get Field Export Value.
hasPermissionToView($ref_id)
doDelete($omit_notification=false)
Delete.
getStandardFieldPlainText($field_id)
setStandardFieldValueFromExcel($excel, $row, $col, $field)
getRecordFieldHTML($field_id, array $options=array())
getTableId()
Get Table ID.
static _getNotesOfObject( $a_rep_obj_id, $a_obj_id, $a_obj_type, $a_type=IL_NOTE_PRIVATE, $a_incl_sub=false, $a_filter="", $a_all_public="y", $a_repository_mode=true, $a_sort_ascending=false, $a_news_id=0)
get all notes related to a specific object
deleteMob($obj_id)
Delete MOB.
passThroughFilter(array $filter)
getStandardFieldHTML($field_id, array $options=array())
setRecordFieldValue($field_id, $value)
Set a field value.
static getTableCache($table_id=0)
setLastEditBy($last_edit_by)
setCreateDate($a_datetime)
Set Creation Date.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
setLastUpdate($a_datetime)
Set Last Update Date.
setStandardField($field_id, $value)
loadRecordFields()
Load record fields.
static getFieldRepresentation(ilDclBaseFieldModel $field)
getRecordField($field_id)
getRecordFieldFormulaValue($field_id)
setStandardFieldFromForm($field_id, &$form)
cloneStructure($original_id, $new_fields)
if(isset($_POST['submit'])) $form
static _tableExists($table_id)
setOwner($a_id)
Set Owner.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getRecordCache($record_id=0)
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static _isStandardField($field_id)
static buildAjaxHash( $a_node_type, $a_node_id, $a_obj_type, $a_obj_id, $a_sub_type=null, $a_sub_id=null, $a_news_id=0)
Build ajax hash.
fillRecordFieldExcelExport(ilExcel $worksheet, &$row, &$col, $field_id)
static getListCommentsJSCall($a_hash, $a_update_code=null)
Get list comments js call.
deleteFile($obj_id)
Delete a file.
getRecordFieldPlainText($field_id)
Get Field Export Value.
hasPermissionToEdit($ref_id)
setId($a_id)
Set field id.
getLastUpdate()
Get Last Update Date.
static getRecordFieldCache($record, $field)
Class ilDclBaseRecordModel.
setRecordFieldValueFromForm($field_id, &$form)
Set a field value.
getRecordFieldValue($field_id)
Get Field Value.
getRecordFieldValueFromExcel($excel, $row, $col, $field)
getRecordFieldRepresentationValue($field_id)
Get Field Value for Representation in a Form.
getStandardField($field_id)
static _exists($a_id, $a_reference=false, $a_type=null)
hasPermissionToDelete($ref_id)
doUpdate($omit_notification=false)
doUpdate
setTableId($a_id)
Set Table ID.
fillRecordFieldFormInput($field_id, &$form)
getRecordFieldSortingValue($field_id, array $options=array())
fillStandardFieldFormInput($field_id, &$form)
getComments()
Get all comments of this record.