ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilDataCollectionStandardField Class Reference

Class ilDataCollectionField. More...

+ Inheritance diagram for ilDataCollectionStandardField:
+ Collaboration diagram for ilDataCollectionStandardField:

Public Member Functions

 doRead ()
 
 doCreate ()
 
 doUpdate ()
 
 cloneStructure (ilDataCollectionStandardField $original_record)
 
 getLocked ()
 
 isStandardField ()
 
 isUnique ()
 
- Public Member Functions inherited from ilDataCollectionField
 __construct ($a_id=0)
 
 setId ($a_id)
 Set field id. More...
 
 getId ()
 Get field id. More...
 
 setTableId ($a_id)
 Set table id. More...
 
 getTableId ()
 Get table id. More...
 
 setTitle ($a_title)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription ($a_desc)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setDatatypeId ($a_id)
 Set datatype id. More...
 
 getDatatypeId ()
 Get datatype_id. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required Required. More...
 
 setPropertyvalue ($a_value, $a_id)
 Set Property Value. More...
 
 isUnique ()
 
 setUnique ($unique)
 
 getPropertyvalues ()
 Get Property Values. More...
 
 setVisible ($visible)
 setVisible More...
 
 setFilterable ($filterable)
 setFilterable More...
 
 getDatatype ()
 
 getLength ()
 
 getTextArea ()
 
 getLearningProgress ()
 
 getDatatypeTitle ()
 
 getStorageLocation ()
 
 isVisible ()
 
 isFilterable ()
 
 isEditable ()
 isEditable More...
 
 setEditable ($editable)
 
 getExportable ()
 
 toArray ()
 
 isStandardField ()
 
 doRead ()
 Read field. More...
 
 buildFromDBRecord ($rec)
 
 doCreate ()
 Create new field. More...
 
 doUpdate ()
 Update field. More...
 
 getFilterable ()
 
 doDelete ()
 
 getOrder ()
 
 setOrder ($order)
 
 getFieldRef ()
 
 getFieldReflist ()
 
 isNRef ()
 
 getProperties ()
 Get all properties of a field. More...
 
 setProperties ($data)
 
 setLocked ($locked)
 
 getLocked ()
 
 checkValidity ($value, $record_id=NULL)
 
 cloneStructure ($original_id)
 
 cloneProperties (ilDataCollectionField $originalField)
 
 setExportable ($exportable)
 

Static Public Member Functions

static _getStandardFieldsAsArray ()
 
static _getStandardFields ($table_id)
 
static _getAllStandardFieldTitles ()
 
static _isStandardField ($field_id)
 
static _getDatatypeForId ($id)
 gives you the datatype id of a specified standard field. More...
 
- Static Public Member Functions inherited from ilDataCollectionField
static _getTitleValidChars ($a_as_regex=true)
 All valid chars for filed titles. More...
 
static _getFieldIdByTitle ($title, $table_id)
 

Additional Inherited Members

- Data Fields inherited from ilDataCollectionField
const PROPERTYID_LENGTH = 1
 
const PROPERTYID_REGEX = 2
 
const PROPERTYID_REFERENCE = 3
 
const PROPERTYID_URL = 4
 LINK OR EMAIL! More...
 
const PROPERTYID_TEXTAREA = 5
 
const PROPERTYID_REFERENCE_LINK = 6
 
const PROPERTYID_WIDTH = 7
 
const PROPERTYID_HEIGHT = 8
 
const PROPERTYID_LEARNING_PROGRESS = 9
 
const PROPERTYID_ILIAS_REFERENCE_LINK = 10
 
const PROPERTYID_N_REFERENCE = 11
 
const PROPERTYID_FORMULA_EXPRESSION = 12
 
const PROPERTYID_DISPLAY_COPY_LINK_ACTION_MENU = 13
 
const PROPERTYID_LINK_DETAIL_PAGE_TEXT = 14
 
const PROPERTYID_LINK_DETAIL_PAGE_MOB = 15
 
const PROPERTYID_SUPPORTED_FILE_TYPES = 16
 
const VIEW_VIEW = 1
 
const EDIT_VIEW = 2
 
const FILTER_VIEW = 3
 
const EXPORTABLE_VIEW = 4
 
- Protected Member Functions inherited from ilDataCollectionField
 loadDatatype ()
 
 loadVisibility ()
 
 loadFilterability ()
 
 loadViewDefinition ($view)
 loadViewDefinition More...
 
 updateProperties ()
 Update properties of this field in Database. More...
 
 updateVisibility ()
 
 updateFilterability ()
 
 updateEditability ()
 
 updateExportability ()
 
- Protected Attributes inherited from ilDataCollectionField
 $id
 
 $table_id
 
 $title
 
 $description
 
 $datatypeId
 
 $required
 
 $order
 
 $unique
 
 $visible
 
 $editable
 
 $filterable
 
 $locked
 
 $property = array()
 
 $exportable
 
 $datatype
 

Detailed Description

Member Function Documentation

◆ _getAllStandardFieldTitles()

static ilDataCollectionStandardField::_getAllStandardFieldTitles ( )
static
Returns
array all possible standardfield titles, in all languages (used for excel-import);

Definition at line 117 of file class.ilDataCollectionStandardField.php.

References ilDataCollectionField\$id, and $ilDB.

Referenced by ilDataCollectionRecordListGUI\getImportFieldsFromTitles().

117  {
118  global $ilDB;
119  $identifiers = '';
120  foreach (array('dcl_id', 'dcl_creation_date', 'dcl_last_update', 'dcl_owner', 'dcl_last_edited_by', 'dcl_comments') as $id) {
121  $identifiers .= $ilDB->quote($id, 'text') . ',';
122  }
123  $identifiers = rtrim($identifiers, ',');
124  $sql = $ilDB->query('SELECT value FROM lng_data WHERE identifier IN (' . $identifiers . ')');
125  $titles = array();
126  while ($rec = $ilDB->fetchAssoc($sql)) {
127  $titles[] = $rec['value'];
128  }
129  return $titles;
130  }
global $ilDB
+ Here is the caller graph for this function:

◆ _getDatatypeForId()

static ilDataCollectionStandardField::_getDatatypeForId (   $id)
static

gives you the datatype id of a specified standard field.

Parameters
$idthe id of the standardfield eg. "create_date"

Definition at line 153 of file class.ilDataCollectionStandardField.php.

References ilDataCollectionField\$datatype, and ilDataCollectionField\$id.

Referenced by ilDataCollectionField\getDatatypeId().

154  {
155  $datatype = null;
156  foreach (self::_getStandardFieldsAsArray() as $fields_data) {
157  if ($id == $fields_data['id']) {
158  $datatype = $fields_data['datatype_id'];
159  break;
160  }
161  }
162  return $datatype;
163  }
+ Here is the caller graph for this function:

◆ _getStandardFields()

static ilDataCollectionStandardField::_getStandardFields (   $table_id)
static

Definition at line 99 of file class.ilDataCollectionStandardField.php.

References ilDataCollectionField\$table_id.

Referenced by ilDataCollectionTable\getFields().

100  {
101  $stdFields = array();
102  foreach(self::_getStandardFieldsAsArray() as $array)
103  {
104  $array["table_id"] = $table_id;
105  //$array["datatype_id"] = self::_getDatatypeForId($array["id"]);
106  $field = new ilDataCollectionStandardField();
107  $field->buildFromDBRecord($array);
108  $stdFields[] = $field;
109  }
110  return $stdFields;
111  }
+ Here is the caller graph for this function:

◆ _getStandardFieldsAsArray()

static ilDataCollectionStandardField::_getStandardFieldsAsArray ( )
static

Definition at line 80 of file class.ilDataCollectionStandardField.php.

References $lng, ilDataCollectionDatatype\INPUTFORMAT_DATETIME, ilDataCollectionDatatype\INPUTFORMAT_NONE, ilDataCollectionDatatype\INPUTFORMAT_NUMBER, and ilDataCollectionDatatype\INPUTFORMAT_TEXT.

81  {
82 
83  //TODO: this isn't particularly pretty especially as $lng is used in the model. On the long run the standard fields should be refactored into "normal" fields.
84  global $lng;
85  $stdfields = array(
86  array("id"=>"id", "title" => $lng->txt("dcl_id"), "description" => $lng->txt("dcl_id_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_NUMBER, "required" => true),
87  array("id"=>"create_date", "title" => $lng->txt("dcl_creation_date"), "description" => $lng->txt("dcl_creation_date_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_DATETIME, "required" => true),
88  array("id"=>"last_update", "title" => $lng->txt("dcl_last_update"), "description" => $lng->txt("dcl_last_update_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_DATETIME, "required" => true),
89  array("id"=>"owner", "title" => $lng->txt("dcl_owner"), "description" => $lng->txt("dcl_owner_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_TEXT, "required" => true),
90  array("id"=>"last_edit_by", "title" => $lng->txt("dcl_last_edited_by"), "description" => $lng->txt("dcl_last_edited_by_description"), "datatype_id" => ilDataCollectionDatatype::INPUTFORMAT_TEXT, "required" => true),
91  array('id' => 'comments', 'title' => $lng->txt('dcl_comments'), 'description' => $lng->txt('dcl_comments_description'), 'datatype_id' => ilDataCollectionDatatype::INPUTFORMAT_NONE, 'required' => false),
92  );
93  return $stdfields;
94  }
global $lng
Definition: privfeed.php:40

◆ _isStandardField()

static ilDataCollectionStandardField::_isStandardField (   $field_id)
static

Definition at line 135 of file class.ilDataCollectionStandardField.php.

Referenced by ilDataCollectionRecord\getRecordFieldExportValue(), ilDataCollectionRecord\getRecordFieldFormInput(), ilDataCollectionRecord\getRecordFieldHTML(), ilDataCollectionRecord\getRecordFieldSortingValue(), ilDataCollectionRecord\getRecordFieldValue(), and ilDataCollectionRecord\setRecordFieldValue().

136  {
137  $return = false;
138  foreach(self::_getStandardFieldsAsArray() as $field)
139  {
140  if($field["id"] == $field_id)
141  {
142  $return = true;
143  }
144  }
145 
146  return $return;
147  }
+ Here is the caller graph for this function:

◆ cloneStructure()

ilDataCollectionStandardField::cloneStructure ( ilDataCollectionStandardField  $original_record)
Parameters
ilDataCollectionStandardField$original_record

Definition at line 56 of file class.ilDataCollectionStandardField.php.

References doUpdate(), ilDataCollectionField\getExportable(), getLocked(), ilDataCollectionField\getOrder(), ilDataCollectionField\getRequired(), ilDataCollectionField\isEditable(), ilDataCollectionField\isFilterable(), isUnique(), ilDataCollectionField\isVisible(), ilDataCollectionField\setEditable(), ilDataCollectionField\setExportable(), ilDataCollectionField\setFilterable(), ilDataCollectionField\setLocked(), ilDataCollectionField\setOrder(), ilDataCollectionField\setRequired(), ilDataCollectionField\setUnique(), and ilDataCollectionField\setVisible().

56  {
57  $this->setEditable($original_record->isEditable());
58  $this->setLocked($original_record->getLocked());
59  $this->setFilterable($original_record->isFilterable());
60  $this->setVisible($original_record->isVisible());
61  $this->setOrder($original_record->getOrder());
62  $this->setRequired($original_record->getRequired());
63  $this->setUnique($original_record->isUnique());
64  $this->setExportable($original_record->getExportable());
65 
66  $this->doUpdate();
67  }
setRequired($a_required)
Set Required.
getRequired()
Get Required Required.
setFilterable($filterable)
setFilterable
+ Here is the call graph for this function:

◆ doCreate()

ilDataCollectionStandardField::doCreate ( )

Definition at line 34 of file class.ilDataCollectionStandardField.php.

References $ilLog, and ilUtil\sendFailure().

35  {
36  global $ilLog;
37  $message = "Standard fields cannot be written to DB";
38  ilUtil::sendFailure($message);
39  $ilLog->write("[ilDataCollectionStandardField] ".$message);
40  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ doRead()

ilDataCollectionStandardField::doRead ( )

Definition at line 23 of file class.ilDataCollectionStandardField.php.

References $ilLog, and ilUtil\sendFailure().

24  {
25  global $ilLog;
26  $message = "Standard fields cannot be read from DB";
27  ilUtil::sendFailure($message);
28  $ilLog->write("[ilDataCollectionStandardField] ".$message);
29  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ doUpdate()

ilDataCollectionStandardField::doUpdate ( )

Definition at line 45 of file class.ilDataCollectionStandardField.php.

References ilDataCollectionField\updateExportability(), ilDataCollectionField\updateFilterability(), and ilDataCollectionField\updateVisibility().

Referenced by cloneStructure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocked()

ilDataCollectionStandardField::getLocked ( )

Definition at line 72 of file class.ilDataCollectionStandardField.php.

Referenced by cloneStructure().

73  {
74  return true;
75  }
+ Here is the caller graph for this function:

◆ isStandardField()

ilDataCollectionStandardField::isStandardField ( )

Definition at line 168 of file class.ilDataCollectionStandardField.php.

169  {
170  return true;
171  }

◆ isUnique()

ilDataCollectionStandardField::isUnique ( )

Definition at line 176 of file class.ilDataCollectionStandardField.php.

Referenced by cloneStructure().

177  {
178  return false;
179  }
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: