120            return '/^[^<>\\\\":]*$/i';
 
  138            'SELECT id FROM il_dcl_field WHERE title = ' . 
$ilDB->quote(
$title, 
'text') . 
' AND table_id = ' 
  179        $this->table_id = $a_id;
 
  202        if (substr($a_title, 0, 1) == 
"_" && substr($a_title, 0, 2) != 
"__") {
 
  203            $a_title = 
"_" . $a_title;
 
  205        $this->title = $a_title;
 
  227        $this->description = $a_desc;
 
  250        $this->datatype = 
null;
 
  251        $this->datatypeId = $a_id;
 
  277        $this->required = $a_required;
 
  306        $this->unique = 
$unique ? 1 : 0;
 
  328        return $this->datatype->getTitle();
 
  345        return $this->datatype->getStorageLocation();
 
  354        if ($this->datatype == 
null) {
 
  366        $this->exportable = $tablefield_setting->isExportable();
 
  367        $this->order = $tablefield_setting->getFieldOrder();
 
  376        if (!isset($this->exportable)) {
 
  389        if ($this->exportable == 
null) {
 
  400        return (array) $this;
 
  422        $query = 
"SELECT * FROM il_dcl_field WHERE id = " . 
$ilDB->quote($this->
getId(), 
"integer");
 
  424        $rec = 
$ilDB->fetchAssoc($set);
 
  445        $this->
setId($rec[
"id"]);
 
  466            throw new ilException(
"The field does not have a related table!");
 
  469        $id = 
$ilDB->nextId(
"il_dcl_field");
 
  471        $query = 
"INSERT INTO il_dcl_field (" . 
"id" . 
", table_id" . 
", datatype_id" . 
", title" . 
", description" . 
", required" . 
", is_unique" 
  472            . 
", is_locked" . 
" ) VALUES (" . 
$ilDB->quote($this->
getId(), 
"integer") . 
"," . 
$ilDB->quote($this->
getTableId(), 
"integer") . 
"," 
  490            $tableview->createFieldSetting($this->
id);
 
  510            "datatype_id" => array(
 
  518            "description" => array(
 
  526            "is_unique" => array(
 
  530            "is_locked" => array(
 
  552        foreach ($this->property as $prop) {
 
  565        $tablefield_setting->setExportable($this->exportable);
 
  566        $tablefield_setting->setFieldOrder($this->order);
 
  567        $tablefield_setting->store();
 
  582        $query = 
"DELETE FROM il_dcl_field_prop WHERE field_id = " . 
$ilDB->quote($this->
getId(), 
"text");
 
  585        $query = 
"DELETE FROM il_dcl_field WHERE id = " . 
$ilDB->quote($this->
getId(), 
"text");
 
  589            $field_setting->delete();
 
  605        if ($this->order == 
null) {
 
  644        return (isset($this->property[$key]) && $this->property[$key]->getValue() != 
null);
 
  659        return ($instance !== 
null) ? $instance->getValue() : 
null;
 
  674            $value = $this->
property[$key];
 
  692        if (isset($this->property[$key])) {
 
  693            $this->
property[$key]->setValue($value);
 
  703        return $this->
property[$key];
 
  759        if ($value == 
null) {
 
  765            foreach ($table->getRecords() as $record) {
 
  766                if ($this->
normalizeValue($record->getRecordFieldValue($this->getId())) == $this->normalizeValue($value) && ($record->getId() != $record_id || $record_id == 0)) {
 
  783        if (is_string($value)) {
 
  784            $value = trim(preg_replace(
"/\\s+/uism", 
" ", $value));
 
  799        $this->
setTitle($original->getTitle());
 
  802        $this->
setLocked($original->getLocked());
 
  803        $this->
setOrder($original->getOrder());
 
  820        foreach ($records as $rec) {
 
  832        if (count($orgProps) == 0) {
 
  835        foreach ($orgProps as $prop_name) {
 
  837            $fieldprop_obj->setFieldId($this->
getId());
 
  838            $fieldprop_obj->setName($prop_name);
 
  847            $fieldprop_obj->setValue($value);
 
  848            $fieldprop_obj->create();
 
  886        $select_str = 
"sort_stloc_{$this->getId()}.value AS field_{$this->getId()}";
 
  888            = 
"LEFT JOIN il_dcl_record_field AS sort_record_field_{$this->getId()} ON (sort_record_field_{$this->getId()}.record_id = record.id AND sort_record_field_{$this->getId()}.field_id = " 
  889            . 
$ilDB->quote($this->
getId(), 
'integer') . 
") ";
 
  890        $join_str .= 
"LEFT JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS sort_stloc_{$this->getId()} ON (sort_stloc_{$this->getId()}.record_field_id = sort_record_field_{$this->getId()}.id)";
 
  892        $sql_obj->setSelectStatement($select_str);
 
  893        $sql_obj->setJoinStatement($join_str);
 
  894        $sql_obj->setOrderStatement(
"field_{$this->getId()} {$direction}");
 
  989        foreach ($titles as $k => 
$title) {
 
  994                $import_fields[$k] = $this;
 
 1031            'field_id' => $this->
getId(),
 
 1040        foreach ($properties as $prop) {
 
 1041            $values[
'prop_' . $prop] = $this->
getProperty($prop);
 
 1076        $ilConfirmationGUI->addHiddenItem(
'confirmed', 1);
 
 1077        $ilConfirmationGUI->addHiddenItem(
'field_id', $form->
getInput(
'field_id'));
 
 1078        $ilConfirmationGUI->addHiddenItem(
'title', $form->
getInput(
'title'));
 
 1079        $ilConfirmationGUI->addHiddenItem(
'description', $form->
getInput(
'description'));
 
 1080        $ilConfirmationGUI->addHiddenItem(
'datatype', $form->
getInput(
'datatype'));
 
 1081        $ilConfirmationGUI->addHiddenItem(
'required', $form->
getInput(
'required'));
 
 1082        $ilConfirmationGUI->addHiddenItem(
'unique', $form->
getInput(
'unique'));
 
 1083        $ilConfirmationGUI->setConfirm(
$DIC->language()->txt(
'dcl_update_field'), 
'update');
 
 1084        $ilConfirmationGUI->setCancel(
$DIC->language()->txt(
'cancel'), 
'edit');
 
 1086        return $ilConfirmationGUI;
 
static where($where, $operator=null)
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
Class ilDclBaseFieldModel.
doCreate()
Create new field.
doDelete()
Remove field and properties.
fillHeaderExcel(ilExcel $worksheet, &$row, &$col)
const PROP_SUPPORTED_FILE_TYPES
const PROP_TEXT_SELECTION_OPTIONS
setExportable($exportable)
updateTableFieldSetting()
update exportable and fieldorder
setDatatypeId($a_id)
Set datatype id.
const PROP_PLUGIN_HOOK_NAME
updateProperties()
Update properties of this field in Database.
setRequired($a_required)
Set Required.
getPropertyInstance($key)
Return ActiveRecord of property.
const PROP_FORMULA_EXPRESSION
const PROP_LINK_DETAIL_PAGE_TEXT
const PROP_DATE_SELECTION_OPTIONS
getDescription()
Get description.
getStorageLocationOverride()
getRecordQuerySortObject($direction="asc", $sort_by_status=false)
Returns a query-object for building the record-loader-sql-query.
checkValidityFromForm(ilPropertyFormGUI &$form, $record_id=null)
fillPropertiesForm(ilPropertyFormGUI &$form)
called to fill the 'edit field' form
loadTableFieldSetting()
loadTableFieldSetting
setProperty($key, $value)
Set a property for a field (does not save)
getRequired()
Get Required Required.
const PROP_DISPLAY_COPY_LINK_ACTION_MENU
setDescription($a_desc)
Set description.
static _getTitleInvalidChars($a_as_regex=true)
All valid chars for filed titles.
loadDatatype()
Load datatype for model.
getConfirmationGUI(ilPropertyFormGUI $form)
called by ilDclFieldEditGUI if isConfirmationRequired returns true
addToTableViews()
create ilDclTableViewFieldSettings for this field in each tableview
storePropertiesFromForm(ilPropertyFormGUI $form)
called when saving the 'edit field' form
isConfirmationRequired(ilPropertyFormGUI $form)
called by ilDclFieldEditGUI when updating field properties if you overwrite this method,...
getRecordQueryFilterObject($filter_value="", ilDclBaseFieldModel $sort_field=null)
Returns a query-object for building the record-loader-sql-query.
const PROP_LEARNING_PROGRESS
getValidFieldProperties()
Returns all valid properties for a field-type.
static _getFieldIdByTitle($title, $table_id)
hasProperty($key)
Checks if a certain property for a field is set.
const PROP_REFERENCE_LINK
cloneProperties(ilDclBaseFieldModel $originalField)
getProperty($key)
Returns a certain property of a field.
loadProperties()
Get all properties of a field.
const PROP_ILIAS_REFERENCE_LINK
$storage_location_override
getTableId()
Get table id.
cloneStructure($original_id)
getStorageLocation()
Get storage location for the model.
setTitle($a_title)
Set title.
const PROP_DATE_SELECTION_TYPE
loadExportability()
Load exportability.
buildFromDBRecord($rec)
Builds model from db record.
hasNumericSorting()
Set to true, when the sorting should be handled numerical.
const PROP_TEXT_SELECTION_TYPE
checkTitlesForImport(array &$titles, array &$import_fields)
const PROP_LENGTH
General properties.
getSortField()
Returns the sort-field id.
getDatatypeId()
Get datatype_id.
checkValidity($value, $record_id=null)
Check if input is valid.
setStorageLocationOverride($storage_location_override)
setTableId($a_id)
Set table id.
checkFieldCreationInput(ilPropertyFormGUI $form)
Checks input of specific fields befor saving.
setId($a_id)
Set field id.
static getDatatype($datatyp_id)
Get cached datatypes.
static getRecordFieldCache($record, $field)
static getFieldProperties($field_id)
Cache Field properties.
static getTableCache($table_id=0)
static setCloneOf($old, $new, $type)
static getFieldCache($field_id=0)
const INPUTFORMAT_REFERENCE
static getFieldRepresentationInstance(ilDclBaseFieldModel $field)
Returns FieldRepresentation from BaseFieldModel.
Class ilDclFieldProperty.
Class ilDclRecordQueryObject.
static _getDatatypeForId($id)
gives you the datatype id of a specified standard field.
static getInstance($table_id, $field)
static getAllForTableId($table_id)
static _tableExists($table_id)
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
Base class for ILIAS Exception handling.
static isUtf8($a_str)
Check whether string is utf-8.