23 $this->usr_id = $a_usr_id;
34 public static function lookupData($a_user_ids, $a_field_ids)
38 $query =
"SELECT * FROM udf_text ".
39 "WHERE ".$ilDB->in(
'usr_id',$a_user_ids,
false,
'integer').
' '.
40 'AND '.$ilDB->in(
'field_id',$a_field_ids,
false,
'integer');
46 $udfd[
$row[
'usr_id']][
$row[
'field_id']] = $row[
'value'];
56 function set($a_field,$a_value)
58 $this->user_data[$a_field] = $a_value;
60 function get($a_field)
62 return isset($this->user_data[$a_field]) ? $this->user_data[$a_field] :
'';
80 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
85 foreach($udf_obj->getDefinitions() as $definition)
93 $ilDB->replace(
"udf_clob", array(
94 "usr_id" => array(
"integer", $this->
getUserId()),
95 "field_id" => array(
"integer", $definition[
'field_id'])),
97 "value" => array(
"clob", $this->
get(
"f_".$definition[
'field_id']))
102 $ilDB->replace(
"udf_text", array(
103 "usr_id" => array(
"integer", $this->
getUserId()),
104 "field_id" => array(
"integer", $definition[
'field_id'])),
106 "value" => array(
"text", $this->
get(
"f_".$definition[
'field_id']))
139 $ilDB->manipulate(
"DELETE FROM udf_text WHERE "
140 .
" usr_id = ".$ilDB->quote($a_user_id,
"integer")
142 $ilDB->manipulate(
"DELETE FROM udf_clob WHERE "
143 .
" usr_id = ".$ilDB->quote($a_user_id,
"integer")
156 $ilDB->manipulate(
"DELETE FROM udf_text WHERE "
157 .
" field_id = ".$ilDB->quote($a_field_id,
"integer")
159 $ilDB->manipulate(
"DELETE FROM udf_clob WHERE "
160 .
" field_id = ".$ilDB->quote($a_field_id,
"integer")
174 $ilDB->manipulate(
"UPDATE udf_text SET value = ".$ilDB->quote(
"",
"text").
" WHERE "
175 .
" field_id = ".$ilDB->quote($a_field_id,
"integer")
176 .
" AND value = ".$ilDB->quote($a_value,
"text")
182 include_once
'./Services/Xml/classes/class.ilXmlWriter.php';
187 return $xml_writer->xmlDumpMem(
false);
196 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
199 foreach($udf_obj->getDefinitions() as $definition)
201 if ($definition[
"export"] != FALSE)
203 $xml_writer->xmlElement(
'UserDefinedField',
204 array(
'Id' => $definition[
'il_id'],
205 'Name' => $definition[
'field_name']),
206 (
string) $this->user_data[
'f_'.(
int) $definition[
'field_id']]);
215 $this->user_data = array();
216 $query =
"SELECT * FROM udf_text ".
217 "WHERE usr_id = ".$this->db->quote($this->usr_id,
'integer').
"";
221 $this->user_data[
"f_".$row[
"field_id"]] =
$row[
"value"];
223 $query =
"SELECT * FROM udf_clob ".
224 "WHERE usr_id = ".$this->db->quote($this->usr_id,
'integer').
"";
228 $this->user_data[
"f_".$row[
"field_id"]] =
$row[
"value"];