ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailingList Class Reference
+ Collaboration diagram for ilMailingList:

Public Member Functions

 __construct (ilObjUser $user, $id=0)
 insert ()
 update ()
 delete ()
 getAssignedEntries ()
 assignAddressbookEntry ($addr_id=0)
 deassignAddressbookEntry ($a_id=0)
 deassignAllEntries ()
 setId ($a_mail_id=0)
 getId ()
 setUserId ($a_user_id=0)
 getUserId ()
 setTitle ($a_title= '')
 getTitle ()
 setDescription ($a_description= '')
 getDescription ()
 setCreatedate ($_createdate= '0000-00-00 00:00:00')
 getCreatedate ()
 setChangedate ($a_changedate= '0000-00-00 00:00:00')
 getChangedate ()
 setMode ($a_mode)
 getMode ()

Static Public Member Functions

static _isOwner ($a_ml_id, $a_usr_id)

Data Fields

const MODE_ADDRESSBOOK = 1
const MODE_TEMPORARY = 2

Private Member Functions

 read ()

Private Attributes

 $mail_id = 0
 $user_id = 0
 $title = ''
 $description = ''
 $createdate = '0000-00-00 00:00:00'
 $changedate = '0000-00-00 00:00:00'
 $user = null
 $db = null

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 30 of file class.ilMailingList.php.

Constructor & Destructor Documentation

ilMailingList::__construct ( ilObjUser  $user,
  $id = 0 
)

Definition at line 45 of file class.ilMailingList.php.

References $user, read(), and setMode().

{
global $ilDB;
$this->db = $ilDB;
$this->user = $user;
$this->mail_id = $id;
$this->user_id = $this->user->getId();
$this->setMode(self::MODE_ADDRESSBOOK);
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilMailingList::_isOwner (   $a_ml_id,
  $a_usr_id 
)
static

Definition at line 311 of file class.ilMailingList.php.

References $res, and $row.

Referenced by ilMailingListsGUI\mailToList(), ilMailingListsGUI\performDelete(), ilMailingListsGUI\performDeleteMembers(), ilMailingListsGUI\saveAssignmentForm(), ilMailingListsGUI\saveForm(), ilMailingListsGUI\showAssignmentForm(), and ilMailingListsGUI\showForm().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM addressbook_mlist
WHERE ml_id = %s
AND user_id =%s',
array('integer', 'integer'),
array($a_ml_id, $a_usr_id));
$row = $ilDB->fetchObject($res);
return is_object($row) ? true : false;
}

+ Here is the caller graph for this function:

ilMailingList::assignAddressbookEntry (   $addr_id = 0)

Definition at line 220 of file class.ilMailingList.php.

References getId().

{
$nextId = $this->db->nextId('addressbook_mlist_ass');
$statement = $this->db->manipulateF('
INSERT INTO addressbook_mlist_ass
( a_id,
ml_id,
addr_id
)
VALUES(%s,%s,%s )',
array('integer', 'integer', 'integer'),
array($nextId, $this->getId(), $addr_id));
return true;
}

+ Here is the call graph for this function:

ilMailingList::deassignAddressbookEntry (   $a_id = 0)

Definition at line 236 of file class.ilMailingList.php.

{
$statement = $this->db->manipulateF('
DELETE FROM addressbook_mlist_ass
WHERE a_id = %s',
array('integer'),
array($a_id));
return true;
}
ilMailingList::deassignAllEntries ( )

Definition at line 248 of file class.ilMailingList.php.

References getId().

Referenced by delete().

{
$statement = $this->db->manipulateF('
DELETE FROM addressbook_mlist_ass
WHERE ml_id = %s',
array('integer'),
array($this->getId()));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailingList::delete ( )

Definition at line 130 of file class.ilMailingList.php.

References deassignAllEntries(), getId(), and getUserId().

{
if ($this->mail_id && $this->user_id)
{
$statement = $this->db->manipulateF('
DELETE FROM addressbook_mlist
WHERE ml_id = %s
AND user_id = %s',
array('integer', 'integer'),
array($this->getId(), $this->getUserId()));
return true;
}
else
{
return false;
}
}

+ Here is the call graph for this function:

ilMailingList::getAssignedEntries ( )

Definition at line 180 of file class.ilMailingList.php.

References $res, $row, DB_FETCHMODE_OBJECT, getId(), and getMode().

{
if($this->getMode() == self::MODE_ADDRESSBOOK)
{
$res = $this->db->queryf('
SELECT * FROM addressbook_mlist_ass
INNER JOIN addressbook ON addressbook.addr_id = addressbook_mlist_ass.addr_id
WHERE ml_id = %s',
array('integer'),
array($this->getId()));
}
else
{
$res = $this->db->queryf('
SELECT * FROM addressbook_mlist_ass
INNER JOIN usr_data ON addressbook_mlist_ass.addr_id = usr_data.usr_id
WHERE ml_id = %s',
array('integer'),
array($this->getId()));
}
$entries = array();
$counter = 0;
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$entries[$counter] = array('a_id' => $row->a_id,
'addr_id' => $row->addr_id,
'login' => $row->login,
'email' => $row->email,
'firstname' => $row->firstname,
'lastname' => $row->lastname
);
++$counter;
}
return $entries;
}

+ Here is the call graph for this function:

ilMailingList::getChangedate ( )

Definition at line 306 of file class.ilMailingList.php.

References $changedate.

Referenced by update().

{
}

+ Here is the caller graph for this function:

ilMailingList::getCreatedate ( )

Definition at line 295 of file class.ilMailingList.php.

References $createdate.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilMailingList::getDescription ( )

Definition at line 287 of file class.ilMailingList.php.

References $description.

Referenced by insert(), and update().

{
}

+ Here is the caller graph for this function:

ilMailingList::getId ( )

Definition at line 263 of file class.ilMailingList.php.

References $mail_id.

Referenced by assignAddressbookEntry(), deassignAllEntries(), delete(), getAssignedEntries(), read(), and update().

{
}

+ Here is the caller graph for this function:

ilMailingList::getMode ( )

Definition at line 336 of file class.ilMailingList.php.

Referenced by getAssignedEntries(), insert(), and update().

{
return $this->mode;
}

+ Here is the caller graph for this function:

ilMailingList::getTitle ( )

Definition at line 279 of file class.ilMailingList.php.

References $title.

Referenced by insert(), and update().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilMailingList::getUserId ( )

Definition at line 271 of file class.ilMailingList.php.

References $user_id.

Referenced by delete(), insert(), read(), and update().

{
}

+ Here is the caller graph for this function:

ilMailingList::insert ( )

Definition at line 60 of file class.ilMailingList.php.

References getCreatedate(), getDescription(), getMode(), getTitle(), and getUserId().

{
$nextId = $this->db->nextId('addressbook_mlist');
$statement = $this->db->manipulateF('
INSERT INTO addressbook_mlist
( ml_id,
user_id,
title,
description,
createdate,
changedate,
lmode
)
VALUES(%s, %s, %s, %s, %s, %s, %s)',
array( 'integer',
'integer',
'text',
'text',
'timestamp',
'timestamp',
'integer'),
array( $nextId,
$this->getUserId(),
$this->getTitle(),
$this->getDescription(),
$this->getCreatedate(),
NULL,
$this->getMode()
));
$this->mail_id = $nextId;
return true;
}

+ Here is the call graph for this function:

ilMailingList::read ( )
private

Definition at line 151 of file class.ilMailingList.php.

References $res, $row, DB_FETCHMODE_OBJECT, getId(), getUserId(), setChangedate(), setCreatedate(), setDescription(), setId(), setMode(), setTitle(), and setUserId().

Referenced by __construct().

{
if ($this->getId() && $this->getUserId())
{
$res = $this->db->queryf('
SELECT * FROM addressbook_mlist
WHERE ml_id = %s
AND user_id =%s',
array('integer', 'integer'),
array($this->getId(), $this->getUserId()));
if (is_object($row))
{
$this->setId($row->ml_id);
$this->setUserId($row->user_id);
$this->setTitle($row->title);
$this->setDescription($row->description);
$this->setCreatedate($row->createdate);
$this->setChangedate($row->changedae);
$this->setMode($row->lmode);
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailingList::setChangedate (   $a_changedate = '0000-00-00 00:00:00')

Definition at line 299 of file class.ilMailingList.php.

Referenced by read().

:00:00')
{
if($a_changedate == '0000-00-00 00:00:00')
$this->changedate = NULL;
else
$this->changedate = $a_changedate;
}

+ Here is the caller graph for this function:

ilMailingList::setCreatedate (   $_createdate = '0000-00-00 00:00:00')

Definition at line 291 of file class.ilMailingList.php.

Referenced by read().

:00:00')
{
$this->createdate = $_createdate;
}

+ Here is the caller graph for this function:

ilMailingList::setDescription (   $a_description = '')

Definition at line 283 of file class.ilMailingList.php.

Referenced by read().

{
$this->description = $a_description;
}

+ Here is the caller graph for this function:

ilMailingList::setId (   $a_mail_id = 0)

Definition at line 259 of file class.ilMailingList.php.

Referenced by read().

{
$this->mail_id = $a_mail_id;
}

+ Here is the caller graph for this function:

ilMailingList::setMode (   $a_mode)

Definition at line 327 of file class.ilMailingList.php.

Referenced by __construct(), and read().

{
$a_mode = (int)$a_mode;
if(in_array($a_mode, array(self::MODE_ADDRESSBOOK, self::MODE_TEMPORARY)))
{
$this->mode = (int)$a_mode;
}
}

+ Here is the caller graph for this function:

ilMailingList::setTitle (   $a_title = '')

Definition at line 275 of file class.ilMailingList.php.

Referenced by read().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilMailingList::setUserId (   $a_user_id = 0)

Definition at line 267 of file class.ilMailingList.php.

Referenced by read().

{
$this->user_id = $a_user_id;
}

+ Here is the caller graph for this function:

ilMailingList::update ( )

Definition at line 95 of file class.ilMailingList.php.

References getChangedate(), getDescription(), getId(), getMode(), getTitle(), and getUserId().

{
if ($this->mail_id && $this->user_id)
{
$statement = $this->db->manipulateF('
UPDATE addressbook_mlist
SET title = %s,
description = %s,
changedate = %s,
lmode = %s
WHERE ml_id = %s
AND user_id = %s',
array( 'text',
'text',
'timestamp',
'integer',
'integer',
'integer'
),
array( $this->getTitle(),
$this->getDescription(),
$this->getChangedate(),
$this->getMode(),
$this->getId(),
$this->getUserId()
));
return true;
}
else
{
return false;
}
}

+ Here is the call graph for this function:

Field Documentation

ilMailingList::$changedate = '0000-00-00 00:00:00'
private

Definition at line 37 of file class.ilMailingList.php.

Referenced by getChangedate().

ilMailingList::$createdate = '0000-00-00 00:00:00'
private

Definition at line 36 of file class.ilMailingList.php.

Referenced by getCreatedate().

ilMailingList::$db = null
private

Definition at line 40 of file class.ilMailingList.php.

ilMailingList::$description = ''
private

Definition at line 35 of file class.ilMailingList.php.

Referenced by getDescription().

ilMailingList::$mail_id = 0
private

Definition at line 32 of file class.ilMailingList.php.

Referenced by getId().

ilMailingList::$title = ''
private

Definition at line 34 of file class.ilMailingList.php.

Referenced by getTitle().

ilMailingList::$user = null
private

Definition at line 39 of file class.ilMailingList.php.

Referenced by __construct().

ilMailingList::$user_id = 0
private

Definition at line 33 of file class.ilMailingList.php.

Referenced by getUserId().

const ilMailingList::MODE_ADDRESSBOOK = 1

Definition at line 42 of file class.ilMailingList.php.


The documentation for this class was generated from the following file: