23 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
24 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
58 $this->user_id = $a_usr_id;
59 $this->obj_id = $a_obj_id;
81 $query =
"SELECT * FROM member_agreement ".
82 "WHERE obj_id = ".$ilDB->quote($a_obj_id);
84 $res = $ilDB->query($query);
87 $user_data[$row->usr_id][
'accepted'] = $row->accepted;
88 $user_data[$row->usr_id][
'acceptance_time'] = $row->acceptance_time;
90 return $user_data ? $user_data : array();
105 $query =
"SELECT * FROM member_agreement ".
106 "WHERE obj_id = ".$ilDB->quote($a_obj_id).
" ".
109 $res = $ilDB->query($query);
110 return $res->numRows() ?
true :
false;
125 $query =
"SELECT * FROM member_agreement ".
126 "WHERE accepted = 1";
128 $res = $ilDB->query($query);
129 return $res->numRows() ?
true :
false;
144 $query =
"SELECT accepted FROM member_agreement ".
145 "WHERE usr_id = ".$ilDB->quote($a_usr_id).
" ".
146 "AND obj_id = ".$ilDB->quote($a_obj_id);
147 $res = $ilDB->query($query);
150 return $row->accepted == 1 ?
true :
false;
166 $query =
"DELETE FROM member_agreement ".
167 "WHERE usr_id =".$ilDB->quote($a_usr_id).
" ";
168 $ilDB->query($query);
184 $query =
"DELETE FROM member_agreement ".
185 "WHERE obj_id =".$ilDB->quote($a_obj_id).
" ";
186 $ilDB->query($query);
204 $query =
"UPDATE member_agreement SET accepted = 0 ";
205 $ilDB->query($query);
221 $query =
"UPDATE member_agreement ".
223 "WHERE obj_id = ".$ilDB->quote($a_container_id).
" ";
224 $ilDB->query($query);
237 $this->accepted = $a_status;
249 $this->acceptance_time = $a_timest;
264 return $this->accepted ?
false :
true;
301 $query =
"INSERT INTO member_agreement ".
302 "SET usr_id = ".$this->db->quote($this->user_id).
", ".
303 "obj_id = ".$this->db->quote($this->obj_id).
", ".
304 "accepted = ".$this->db->quote((
int) $this->
isAccepted()).
", ".
307 $this->db->query($query);
317 public function delete()
319 $query =
"DELETE FROM member_agreement ".
320 "WHERE usr_id = ".$this->db->quote($this->user_id).
" ".
321 "AND obj_id = ".$this->db->quote($this->obj_id);
323 $this->db->query($query);
334 $query =
"SELECT * FROM member_agreement ".
335 "WHERE usr_id = ".$this->db->quote($this->user_id).
" ".
336 "AND obj_id = ".$this->db->quote($this->obj_id).
" ";
338 $res = $this->db->query($query);
340 $this->accepted = $row->accepted;
341 $this->acceptance_time = $row->acceptance_time;