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;
90 if ($rcp_data[
'type'] == self::TYPE_USER) {
94 $ilErr->appendMessage($lng->txt(
'cal_err_invalid_notification_rcps'));
112 $query =
'INSERT INTO cal_notification ' .
113 '(notification_id,cal_id, user_type, user_id, email) ' .
115 $ilDB->quote($ilDB->nextId(
'cal_notification'),
'integer') .
', ' .
116 $ilDB->quote((
int) $this->getEntryId(),
'integer') .
', ' .
117 $ilDB->quote((
int) $rcp[
'type'],
'integer') .
', ' .
118 $ilDB->quote((
int) $rcp[
'usr_id'],
'integer') .
', ' .
119 $ilDB->quote($rcp[
'email'],
'text') .
121 $ilDB->manipulate(
$query);
134 $this->rcps[] =
array(
136 'usr_id' => $a_usr_id,
147 $this->rcps =
array();
159 $query =
'DELETE FROM cal_notification ' .
160 'WHERE cal_id = ' . $ilDB->quote($this->
getEntryId(),
'integer');
179 $query =
'SELECT * FROM cal_notification ' .
180 'WHERE cal_id = ' . $ilDB->quote($this->
getEntryId(),
'integer');
183 $this->rcps =
array();
198 if ($ilDB->tableExists(
'cal_notification')) {
206 'notification_id' =>
array(
'type' =>
'integer',
'length' => 4,
'notnull' =>
true),
207 'cal_id' =>
array(
'type' =>
'integer',
'length' => 4,
'notnull' =>
true,
'default' => 0),
208 'user_type' =>
array(
'type' =>
'integer',
'length' => 1,
'notnull' =>
true,
'default' => 0),
209 'user_id' =>
array(
'type' =>
'integer',
'length' => 4,
'notnull' =>
true,
'default' => 0),
210 'email' =>
array(
'type' =>
'text',
'length' => 64,
'notnull' =>
false)
213 $ilDB->addPrimaryKey(
219 $ilDB->createSequence(
'cal_notification');
220 $ilDB->addIndex(
'cal_notification',
array(
'cal_id'),
'i1');
addRecipient($a_type, $a_usr_id=0, $a_email='')
Add recipient.
static is_email($a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
setEntryId($a_id)
Set calendar entry id.
foreach($_POST as $key=> $value) $res
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.