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 ,
'integer');
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 ,
'integer').
" ".
110 return $res->numRows() ?
true :
false;
125 $query =
"SELECT * FROM member_agreement ".
126 "WHERE accepted = 1";
129 return $res->numRows() ?
true :
false;
144 $query =
"SELECT accepted FROM member_agreement ".
145 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ".
146 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
150 return $row->accepted == 1 ?
true :
false;
166 $query =
"DELETE FROM member_agreement ".
167 "WHERE usr_id =".$ilDB->quote($a_usr_id ,
'integer').
" ";
184 $query =
"DELETE FROM member_agreement ".
185 "WHERE obj_id =".$ilDB->quote($a_obj_id ,
'integer').
" ";
204 $query =
"UPDATE member_agreement SET accepted = 0 ";
221 $query =
"UPDATE member_agreement ".
223 "WHERE obj_id = ".$ilDB->quote($a_container_id ,
'integer').
" ";
237 $this->accepted = $a_status;
249 $this->acceptance_time = $a_timest;
264 return $this->accepted ?
false :
true;
303 $query =
"INSERT INTO member_agreement (usr_id,obj_id,accepted,acceptance_time) ".
305 $this->db->quote($this->user_id ,
'integer').
", ".
306 $this->db->quote($this->obj_id ,
'integer').
", ".
307 $this->db->quote((
int) $this->
isAccepted() ,
'integer').
", ".
320 public function delete()
324 $query =
"DELETE FROM member_agreement ".
325 "WHERE usr_id = ".$this->db->quote($this->user_id ,
'integer').
" ".
326 "AND obj_id = ".$this->db->quote($this->obj_id ,
'integer');
338 $query =
"SELECT * FROM member_agreement ".
339 "WHERE usr_id = ".$this->db->quote($this->user_id ,
'integer').
" ".
340 "AND obj_id = ".$this->db->quote($this->obj_id ,
'integer').
" ";
345 $this->accepted =
$row->accepted;
346 $this->acceptance_time =
$row->acceptance_time;