25 $this->usr_id = $a_usr_id;
36 public static function lookupData($a_user_ids, $a_field_ids)
42 $query =
"SELECT * FROM udf_text " .
43 "WHERE " .
$ilDB->in(
'usr_id', $a_user_ids,
false,
'integer') .
' ' .
44 'AND ' .
$ilDB->in(
'field_id', $a_field_ids,
false,
'integer');
49 $udfd[
$row[
'usr_id']][
$row[
'field_id']] = $row[
'value'];
52 include_once
'./Services/User/classes/class.ilCustomUserFieldsHelper.php';
54 foreach ($def_helper->getActivePlugins() as $plugin) {
55 foreach ($plugin->lookupUserData($a_user_ids, $a_field_ids) as $user_id => $usr_data) {
56 foreach ($usr_data as $field_id => $value) {
57 $udfd[$user_id][$field_id] = $value;
70 public function set($a_field, $a_value)
72 $this->user_data[$a_field] = $a_value;
74 public function get($a_field)
76 return isset($this->user_data[$a_field]) ? $this->user_data[$a_field] :
'';
96 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
100 $field_def = array();
101 foreach ($udf_obj->getDefinitions() as $definition) {
110 "usr_id" => array(
"integer", $this->
getUserId()),
111 "field_id" => array(
"integer", $definition[
'field_id'])),
113 "value" => array(
"clob", $this->
get(
"f_" . $definition[
'field_id']))
120 "usr_id" => array(
"integer", $this->
getUserId()),
121 "field_id" => array(
"integer", $definition[
'field_id'])),
123 "value" => array(
"text", $this->
get(
"f_" . $definition[
'field_id']))
157 $ilDB = $DIC[
'ilDB'];
160 "DELETE FROM udf_text WHERE " 161 .
" usr_id = " .
$ilDB->quote($a_user_id,
"integer")
164 "DELETE FROM udf_clob WHERE " 165 .
" usr_id = " .
$ilDB->quote($a_user_id,
"integer")
178 $ilDB = $DIC[
'ilDB'];
181 "DELETE FROM udf_text WHERE " 182 .
" field_id = " .
$ilDB->quote($a_field_id,
"integer")
185 "DELETE FROM udf_clob WHERE " 186 .
" field_id = " .
$ilDB->quote($a_field_id,
"integer")
200 $ilDB = $DIC[
'ilDB'];
203 "UPDATE udf_text SET value = " .
$ilDB->quote(
"",
"text") .
" WHERE " 204 .
" field_id = " .
$ilDB->quote($a_field_id,
"integer")
205 .
" AND value = " .
$ilDB->quote($a_value,
"text")
211 include_once
'./Services/Xml/classes/class.ilXmlWriter.php';
216 return $xml_writer->xmlDumpMem(
false);
225 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
228 foreach ($udf_obj->getDefinitions() as $definition) {
229 if ($definition[
"export"] !=
false) {
230 $xml_writer->xmlElement(
232 array(
'Id' => $definition[
'il_id'],
233 'Name' => $definition[
'field_name']),
234 (
string) $this->user_data[
'f_' . (
int) $definition[
'field_id']]
243 $this->user_data = array();
244 $query =
"SELECT * FROM udf_text " .
245 "WHERE usr_id = " . $this->db->quote($this->usr_id,
'integer') .
"";
248 $this->user_data[
"f_" .
$row[
"field_id"]] =
$row[
"value"];
250 $query =
"SELECT * FROM udf_clob " .
251 "WHERE usr_id = " . $this->db->quote($this->usr_id,
'integer') .
"";
254 $this->user_data[
"f_" .
$row[
"field_id"]] =
$row[
"value"];
static _getInstance()
Get instance.
static deleteEntriesOfField($a_field_id)
Delete data of particular field.
static lookupData($a_user_ids, $a_field_ids)
Lookup data.
static getInstance()
Get instance.
foreach($_POST as $key=> $value) $res
addToXML($xml_writer)
add user defined field data to xml (using usr dtd)
static deleteEntriesOfUser($a_user_id)
Delete data of user.
static deleteFieldValue($a_field_id, $a_value)
Delete data of particular value of a (selection) field.