123            return '/^[^<>\\\\":]*$/i';
 
  140        $result = 
$ilDB->query(
'SELECT id FROM il_dcl_field WHERE title = ' . 
$ilDB->quote(
$title, 
'text') . 
' AND table_id = ' 
  180        $this->table_id = $a_id;
 
  203        if (substr($a_title, 0, 1) == 
"_" && substr($a_title, 0, 2) != 
"__") {
 
  204            $a_title = 
"_" . $a_title;
 
  206        $this->title = $a_title;
 
  228        $this->description = $a_desc;
 
  251        $this->datatype = 
null;
 
  252        $this->datatypeId = $a_id;
 
  278        $this->required = $a_required;
 
  306        $this->unique = 
$unique ? 1 : 0;
 
  327        return $this->datatype->getTitle();
 
  342        return $this->datatype->getStorageLocation();
 
  351        if ($this->datatype == 
null) {
 
  362        $this->exportable = $tablefield_setting->isExportable();
 
  363        $this->order = $tablefield_setting->getFieldOrder();
 
  371        if (!isset($this->exportable)) {
 
  383        if ($this->exportable == 
null) {
 
  394        return (array) $this;
 
  416        $query = 
"SELECT * FROM il_dcl_field WHERE id = " . 
$ilDB->quote($this->
getId(), 
"integer");
 
  418        $rec = 
$ilDB->fetchAssoc($set);
 
  438        $this->
setId($rec[
"id"]);
 
  459            throw new ilException(
"The field does not have a related table!");
 
  462        $id = 
$ilDB->nextId(
"il_dcl_field");
 
  464        $query = 
"INSERT INTO il_dcl_field (" . 
"id" . 
", table_id" . 
", datatype_id" . 
", title" . 
", description" . 
", required" . 
", is_unique" 
  465            . 
", is_locked" . 
" ) VALUES (" . 
$ilDB->quote($this->
getId(), 
"integer") . 
"," . 
$ilDB->quote($this->
getTableId(), 
"integer") . 
"," 
  482            $tableview->createFieldSetting($this->
id);
 
  495        $ilDB->update(
"il_dcl_field", array(
 
  500            "datatype_id" => array(
 
  508            "description" => array(
 
  516            "is_unique" => array(
 
  520            "is_locked" => array(
 
  540        foreach ($this->property as $prop) {
 
  553        $tablefield_setting->setExportable($this->exportable);
 
  554        $tablefield_setting->setFieldOrder($this->order);
 
  555        $tablefield_setting->store();
 
  569        $query = 
"DELETE FROM il_dcl_field_prop WHERE field_id = " . 
$ilDB->quote($this->
getId(), 
"text");
 
  572        $query = 
"DELETE FROM il_dcl_field WHERE id = " . 
$ilDB->quote($this->
getId(), 
"text");
 
  576            $field_setting->delete();
 
  590        if ($this->order == 
null) {
 
  625        return (isset($this->property[
$key]) && $this->property[
$key]->getValue() != 
null);
 
  639        return ($instance !== 
null)? $instance->getValue() : 
null;
 
  654            $value = $this->
property[
$key];
 
  670        if (isset($this->property[
$key])) {
 
  671            $this->
property[
$key]->setValue($value);
 
  681        return $this->
property[
$key];
 
  718        $value = 
$form->getInput(
'field_' . $this->
getId());
 
  732        if ($value == 
null) {
 
  738            foreach (
$table->getRecords() as $record) {
 
  739                if ($this->
normalizeValue($record->getRecordFieldValue($this->getId())) == $this->normalizeValue($value) &&
 
  740                    ($record->getId() != $record_id || $record_id == 0)) {
 
  757        if (is_string($value)) {
 
  758            $value = trim(preg_replace(
"/\\s+/uism", 
" ", $value));
 
  773        $this->
setTitle($original->getTitle());
 
  776        $this->
setLocked($original->getLocked());
 
  777        $this->
setOrder($original->getOrder());
 
  805        if (count($orgProps) == 0) {
 
  808        foreach ($orgProps as $prop_name) {
 
  810            $fieldprop_obj->setFieldId($this->
getId());
 
  811            $fieldprop_obj->setName($prop_name);
 
  820            $fieldprop_obj->setValue($value);
 
  821            $fieldprop_obj->create();
 
  858        $select_str = 
"sort_stloc_{$this->getId()}.value AS field_{$this->getId()}";
 
  859        $join_str = 
"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 = " 
  860            . 
$ilDB->quote($this->
getId(), 
'integer') . 
") ";
 
  861        $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)";
 
  863        $sql_obj->setSelectStatement($select_str);
 
  864        $sql_obj->setJoinStatement($join_str);
 
  865        $sql_obj->setOrderStatement(
"field_{$this->getId()} {$direction}");
 
  955        foreach ($titles as $k => 
$title) {
 
  960                $import_fields[$k] = $this;
 
  976            $value = 
$form->getInput($representation->getPropertyInputFieldId(
$property));
 
  997            'field_id' => $this->
getId(),
 
 1006        foreach ($properties as $prop) {
 
 1007            $values[
'prop_' . $prop] = $this->
getProperty($prop);
 
 1010        $form->setValuesByArray($values);
 
 1041        $ilConfirmationGUI->setFormAction(
$form->getFormAction());
 
 1042        $ilConfirmationGUI->addHiddenItem(
'confirmed', 1);
 
 1043        $ilConfirmationGUI->addHiddenItem(
'field_id', 
$form->getInput(
'field_id'));
 
 1044        $ilConfirmationGUI->addHiddenItem(
'title', 
$form->getInput(
'title'));
 
 1045        $ilConfirmationGUI->addHiddenItem(
'description', 
$form->getInput(
'description'));
 
 1046        $ilConfirmationGUI->addHiddenItem(
'datatype', 
$form->getInput(
'datatype'));
 
 1047        $ilConfirmationGUI->addHiddenItem(
'required', 
$form->getInput(
'required'));
 
 1048        $ilConfirmationGUI->addHiddenItem(
'unique', 
$form->getInput(
'unique'));
 
 1049        $ilConfirmationGUI->setConfirm(
$DIC->language()->txt(
'dcl_update_field'), 
'update');
 
 1050        $ilConfirmationGUI->setCancel(
$DIC->language()->txt(
'cancel'), 
'edit');
 
 1051        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)
Base class for ILIAS Exception handling.
static isUtf8($a_str)
Check whether string is utf-8.
if(empty($password)) $table
if(isset($_POST['submit'])) $form