43 if (!is_array($values)) {
44 $values =
array( $values );
46 $datatype = $this->
getField()->getDatatype();
48 $query =
"DELETE FROM il_dcl_stloc" . $datatype->getStorageLocation() .
"_value WHERE record_field_id = " 49 .
$ilDB->quote($this->
id,
"integer");
52 if (!count($values) || $values[0] == 0) {
56 $query =
"INSERT INTO il_dcl_stloc" . $datatype->getStorageLocation() .
"_value (value, record_field_id, id) VALUES";
57 foreach ($values as
$value) {
58 $next_id =
$ilDB->nextId(
"il_dcl_stloc" . $datatype->getStorageLocation() .
"_value");
59 $query .=
" (" .
$ilDB->quote($value, $datatype->getDbType()) .
", " .
$ilDB->quote($this->getId(),
"integer") .
", " 60 .
$ilDB->quote($next_id,
"integer") .
"),";
80 if ($this->value === null) {
83 $datatype = $this->
getField()->getDatatype();
86 $supported_internal_types =
array(
92 $supported_types = array_merge(
array(
96 ), $supported_internal_types);
97 $datatypeId = $refField->getDatatypeId();
98 if (in_array($datatypeId, $supported_types)) {
99 if (in_array($datatypeId, $supported_internal_types)) {
100 $query =
"SELECT stlocOrig.value AS value, ilias_object.title AS value_ref ";
102 $query =
"SELECT stlocOrig.value AS value, stlocRef.value AS value_ref ";
104 $query .=
"FROM il_dcl_stloc" . $datatype->getStorageLocation() .
"_value AS stlocOrig ";
106 $query .=
" INNER JOIN il_dcl_record_field AS refField ON stlocOrig.value = refField.record_id AND refField.field_id = " 107 .
$ilDB->quote($refField->getId(),
"integer");
108 $query .=
" INNER JOIN il_dcl_stloc" . $refField->getStorageLocation()
109 .
"_value AS stlocRef ON stlocRef.record_field_id = refField.id ";
111 $query =
"SELECT stlocOrig.value AS value ";
112 $query .=
"FROM il_dcl_stloc" . $datatype->getStorageLocation() .
"_value AS stlocOrig ";
115 switch ($datatypeId) {
117 $query .=
" INNER JOIN object_reference AS ilias_ref ON ilias_ref.ref_id = stlocRef.value ";
118 $query .=
" INNER JOIN object_data AS ilias_object ON ilias_object.obj_id = ilias_ref.obj_id ";
122 $query .=
" INNER JOIN object_data AS ilias_object ON ilias_object.obj_id = stlocRef.value ";
125 $query .=
" WHERE stlocOrig.record_field_id = " .
$ilDB->quote($this->
id,
"integer");
126 if (in_array($datatypeId, $supported_types)) {
127 $query .=
" ORDER BY value_ref ASC";
132 $this->value =
array();
133 while ($rec =
$ilDB->fetchAssoc($set)) {
134 $this->value[] = $rec[
'value'];
142 if ($this->value === null) {
144 $ilDB = $DIC[
'ilDB'];
145 $datatype = $this->
getField()->getDatatype();
146 $query =
"SELECT * FROM il_dcl_stloc" . $datatype->getStorageLocation() .
"_value WHERE record_field_id = " 147 .
$ilDB->quote($this->
id,
"integer");
149 $this->value =
array();
150 while ($rec =
$ilDB->fetchAssoc($set)) {
151 $this->value[] = $rec[
'value'];
165 return $ilDataCollectionNReferenceFieldGUI->getSingleHTML(
$options);
178 if ($link ==
"[" . $this->
getField()->getTitle() .
"]") {
182 return parent::getLinkHTML($link,
$value);
192 return $ilDataCollectionNReferenceFieldGUI->getHTML();
199 $stringValue = parent::getValueFromExcel($excel,
$row, $col);
202 if (!count($referenceIds) && $stringValue) {
208 return $referenceIds;
218 foreach ($values as
$value) {
221 $names[] = $ref_rec->getRecordField($this->
getField()->getFieldRef())->getValue();
226 $string .= $name .
", ";
231 $string = substr($string, 0, -2);
245 $slicedStrings = explode(
", ", $stringValues);
246 $slicedReferences =
array();
248 for (
$i = 0;
$i < count($slicedStrings);
$i++) {
251 $searchString = implode(array_slice($slicedStrings, $resolved,
$i - $resolved + 1));
253 $slicedReferences[] = $ref;
260 $searchString = $slicedStrings[
$i];
262 $slicedReferences[] = $ref;
267 return $slicedReferences;
setMaxReferenceLength($max_reference_length)
getLinkHTML($link, $value)
static getFieldCache($field_id=0)
const INPUTFORMAT_BOOLEAN
getValueFromExcel($excel, $row, $col)
Class ilDclNReferenceFieldGUI.
getSingleHTML($options=null)
this funciton is used to in the viewdefinition of a single record.
static getRecordCache($record_id=0)
Class ilDclBaseFieldModel.
const INPUTFORMAT_ILIAS_REF
getReferencesFromString($stringValues)
This method tries to get as many valid references out of a string separated by commata.
Create styles array
The data for the language used.
static getExcelCharForInteger($int)
getReferenceFromValue($value)
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options