23 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
24 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
59 $this->user_id = $a_usr_id;
60 $this->obj_id = $a_obj_id;
82 $query =
"SELECT * FROM member_agreement " .
83 "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;
162 $query =
"SELECT usr_id FROM member_agreement " .
163 "WHERE obj_id = " . $ilDB->quote($a_obj_id,
'integer') .
' ' .
169 $user_ids[] =
$row[
'usr_id'];
188 $query =
"DELETE FROM member_agreement " .
189 "WHERE usr_id =" . $ilDB->quote($a_usr_id,
'integer') .
" ";
206 $query =
"DELETE FROM member_agreement " .
207 "WHERE obj_id =" . $ilDB->quote($a_obj_id,
'integer') .
" ";
225 $query =
"UPDATE member_agreement SET accepted = 0 ";
242 $query =
"UPDATE member_agreement " .
243 "SET accepted = 0 " .
244 "WHERE obj_id = " . $ilDB->quote($a_container_id,
'integer') .
" ";
258 $this->accepted = $a_status;
270 $this->acceptance_time = $a_timest;
284 return $this->accepted ? false :
true;
323 $query =
"INSERT INTO member_agreement (usr_id,obj_id,accepted,acceptance_time) " .
325 $this->db->quote($this->user_id,
'integer') .
", " .
326 $this->db->quote($this->obj_id,
'integer') .
", " .
327 $this->db->quote((
int) $this->
isAccepted(),
'integer') .
", " .
330 $ilDB->manipulate(
$query);
340 public function delete()
344 $query =
"DELETE FROM member_agreement " .
345 "WHERE usr_id = " . $this->db->quote($this->user_id,
'integer') .
" " .
346 "AND obj_id = " . $this->db->quote($this->obj_id,
'integer');
358 $query =
"SELECT * FROM member_agreement " .
359 "WHERE usr_id = " . $this->db->quote($this->user_id,
'integer') .
" " .
360 "AND obj_id = " . $this->db->quote($this->obj_id,
'integer') .
" ";
364 $this->accepted =
$row->accepted;
365 $this->acceptance_time =
$row->acceptance_time;
setAcceptanceTime($a_timest)
set acceptance time
static _resetContainer($a_container_id)
Reset all agreements for a specific container.
static _reset()
Reset all.
static _readByObjId($a_obj_id)
Read user data by object id.
static _hasAccepted($a_usr_id, $a_obj_id)
Check if user has accepted agreement.
agreementRequired()
Checks whether the agreement is accepted This function return always true if no acceptance is require...
setAccepted($a_status)
set accepted
foreach($_POST as $key=> $value) $res
static _deleteByUser($a_usr_id)
Delete all entries by user.
getAcceptanceTime()
get Acceptance time
static _hasAgreements()
Check if there is any user agreement.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _hasFields($a_container_id)
Check if there are any define fields.
static _hasAgreementsByObjId($a_obj_id)
Check if there is any user agreement.
static _getInstance()
Get instance of ilPrivacySettings.
static _deleteByObjId($a_obj_id)
Delete all entries by obj_id.
static lookupAcceptedAgreements($a_obj_id)
Lookup users who have accepted the agreement.
save()
save Acceptance settings
__construct($a_usr_id, $a_obj_id)
Constructor.