24 $this->cal_id = $a_cal_id;
38 $query =
'DELETE FROM cal_notification '.
39 'WHERE user_id = '.$ilDB->quote($a_usr_id,
'integer');
54 $query =
'DELETE FROM cal_notification '.
55 'WHERE cal_id = '.$ilDB->quote($a_cal_id,
'integer');
66 $this->cal_id = $a_id;
92 if($rcp_data[
'type'] == self::TYPE_USER)
100 $ilErr->appendMessage($lng->txt(
'cal_err_invalid_notification_rcps'));
119 $query =
'INSERT INTO cal_notification '.
120 '(notification_id,cal_id, user_type, user_id, email) '.
122 $ilDB->quote($ilDB->nextId(
'cal_notification'),
'integer').
', '.
123 $ilDB->quote((
int) $this->getEntryId(),
'integer').
', '.
124 $ilDB->quote((
int) $rcp[
'type'],
'integer').
', '.
125 $ilDB->quote((
int) $rcp[
'usr_id'],
'integer').
', '.
126 $ilDB->quote($rcp[
'email'],
'text').
128 $ilDB->manipulate(
$query);
141 $this->rcps[] =
array(
143 'usr_id' => $a_usr_id,
154 $this->rcps =
array();
166 $query =
'DELETE FROM cal_notification '.
167 'WHERE cal_id = '.$ilDB->quote($this->
getEntryId(),
'integer');
187 $query =
'SELECT * FROM cal_notification '.
188 'WHERE cal_id = '.$ilDB->quote($this->
getEntryId(),
'integer');
191 $this->rcps =
array();
207 if($ilDB->tableExists(
'cal_notification'))
216 'notification_id' =>
array(
'type' =>
'integer',
'length' => 4,
'notnull' =>
true),
217 'cal_id' =>
array(
'type' =>
'integer',
'length' => 4,
'notnull' =>
true,
'default' => 0),
218 'user_type' =>
array(
'type' =>
'integer',
'length' => 1,
'notnull' =>
true,
'default' => 0),
219 'user_id' =>
array(
'type' =>
'integer',
'length' => 4,
'notnull' =>
true,
'default' => 0),
220 'email' =>
array(
'type' =>
'text',
'length' => 64,
'notnull' =>
false)
223 $ilDB->addPrimaryKey(
229 $ilDB->createSequence(
'cal_notification');
230 $ilDB->addIndex(
'cal_notification',
array(
'cal_id'),
'i1');
addRecipient($a_type, $a_usr_id=0, $a_email='')
Add recipient.
static is_email($a_email)
This preg-based function checks whether an e-mail address is formally valid.
setEntryId($a_id)
Set calendar entry id.
setRecipients($a_rcps)
Set recipients.
getEntryId()
Get calendar entry id.
save()
Save recipients to db.
Create styles array
The data for the language used.
static deleteUser($a_usr_id)
Delete a singel user ilDB $ilDB.
read()
Read recipients ilDB $ilDB.
static deleteCalendarEntry($a_cal_id)
Delete notification for a calendar entry ilDB $ilDB.
deleteRecipients()
Delete all recipients ilDB $ilDB.
__construct($a_cal_id=0)
Init with calendar entry id.