PHP 클래스 NotificationTarget, glpi

상속: extends CommonDBChild
파일 보기 프로젝트 열기: glpi-project/glpi 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$datas See https://forge.indepnet.net/projects/5/wiki/NotificationTemplatesTags
$dohistory From CommonDBTM
$entity
$events array of event name => event label
$html_tags Tags which have data in HTML : do not try to clean them
$items_id
$itemtype From CommonDBChild
$notification_targets
$notification_targets_labels
$notificationoptions
$obj Object which raises the notification event
$options
$prefix
$raiseevent
$table
$tag_descriptions
$target Array to store emails by notification
$target_object Object which is associated with the event

공개 메소드들

메소드 설명
__construct ( $entity = '', $event = '', $object = null, $options = [] )
addAdditionnalInfosForTarget ( )
addAdditionnalUserInfo ( array $data ) : empty
addGroupsToTargets ( $entity )
addProfilesToTargets ( )
addTagToList ( $options = [] )
addTarget ( $target = '', $label = '', $type = Notification::USER_TYPE )
addToAddressesList ( array $data ) Add new mail with lang to current email array
clearAddressesList ( )
countForGroup ( Group $group ) : integer Count Notification for a group
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
formatURL ( $usertype, $redirect )
getAdditionalTargets ( $event = '' ) Allows to add more notification targets Can be overridden in some case (for example Ticket)
getAddressesByGroup ( $manager, $group_id ) Get targets for all the users of a group
getAddressesByTarget ( $data, $options = [] ) Get addresses by type of notification
getAdminAddress ( ) Get GLPI's global administrator email
getAllEvents ( ) : an Return all (GLPI + plugins) notification events for the object type
getContentFooter ( ) Get footer to add to content
getContentHeader ( ) Get header to add to content
getDatasForTemplate ( $event, $options = [] ) Get all data needed for template processing Provides minimum information for alerts Can be overridden by each NotificationTartget class if needed
getDefaultUserType ( )
getDistinctUserSql ( )
getEntity ( )
getEntityAdminAddress ( ) Get entity admin email
getEvents ( ) : an Return main notification events for the object type Internal use only => should use getAllEvents
getForTemplate ( $event, $options )
getFromDBForTarget ( $notifications_id, $type, $ID ) : true Retrieve an item from the database for a specific target
getInstance ( $item, $event = '', $options = [] ) : a Get a notificationtarget class by giving the object which raises the event
getInstanceByType ( $itemtype, $event = '', $options = [] ) : a Get a notificationtarget class by giving an itemtype
getItemAuthorAddress ( ) Get the email of the item's user
getItemGroupAddress ( ) Get Group of the item
getItemGroupSupervisorAddress ( ) Get Group supervisor of the item
getItemGroupTechInChargeAddress ( ) Get Group of technicians in charge of the item
getItemGroupWithoutSupervisorAddress ( ) Get Group without supervisor of the item
getItemOwnerAddress ( ) Get user owner of the material
getItemTechnicianInChargeAddress ( ) Get technician in charge of the item
getMessageID ( ) : message
getNotificationTargets ( $entity ) Return all the targets for this notification Values returned by this method are the ones for the alerts Can be updated by implementing the getAdditionnalTargets() method Can be overwitten (like dbconnection)
getObjectItem ( $event = '' ) : the Get item associated with the object on which the event was raised
getProfileJoinSql ( )
getRawName ( ) Get a notificationtarget class by giving the object which raises the event
getReplyTo ( $options = [] ) : the Get the reply to address
getSender ( $options = [] ) : the Get admin which sends the notification
getSpecificTargets ( $data, $options ) Get addresses by a method not defined in NotificationTarget (specific to an itemtype)
getSubjectPrefix ( $event = '' )
getTabNameForItem ( CommonGLPI $item, $withtemplate )
getTable ( ) Temporary hack for this class since 0.84
getTags ( )
getTargets ( )
getTypeName ( $nb )
getUserByField ( $field, $search_in_object = false ) Add user to the notified users list
getUsersAddressesByProfile ( $profiles_id ) : nothing Get users emails by profile
showForGroup ( Group $group ) : nothing Display notification registered for a group
showForNotification ( Notification $notification )
updateTargets ( $input )
validateSendTo ( $event, array $infos, $notify_me = false ) : true Validate send before doing it (may be overloaded : exemple for private tasks or followups)

메소드 상세

__construct() 공개 메소드

public __construct ( $entity = '', $event = '', $object = null, $options = [] )
$entity (default '')
$event (default '')
$object (default null)
$options array

addAdditionnalInfosForTarget() 공개 메소드

addAdditionnalUserInfo() 공개 메소드

public addAdditionnalUserInfo ( array $data ) : empty
$data array
리턴 empty array

addGroupsToTargets() 공개 메소드

public addGroupsToTargets ( $entity )
$entity

addProfilesToTargets() 공개 메소드

addTagToList() 공개 메소드

public addTagToList ( $options = [] )
$options array

addTarget() 공개 메소드

public addTarget ( $target = '', $label = '', $type = Notification::USER_TYPE )
$target (default '')
$label (default '')
$type (=Notification::USER_TYPE)

addToAddressesList() 공개 메소드

Add new mail with lang to current email array
public addToAddressesList ( array $data )
$data array array of data (mail, lang[, id for user])

clearAddressesList() 공개 메소드

public clearAddressesList ( )

countForGroup() 정적인 공개 메소드

Count Notification for a group
static public countForGroup ( Group $group ) : integer
$group Group Group object
리턴 integer

displayTabContentForItem() 정적인 공개 메소드

static public displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
$item CommonGLPI

formatURL() 공개 메소드

public formatURL ( $usertype, $redirect )
$usertype
$redirect

getAdditionalTargets() 공개 메소드

Allows to add more notification targets Can be overridden in some case (for example Ticket)
public getAdditionalTargets ( $event = '' )
$event specif event to get additional targets (default '')

getAddressesByGroup() 공개 메소드

Get targets for all the users of a group
public getAddressesByGroup ( $manager, $group_id )
$manager 0 all users, 1 only supervisors, 2 all users without supervisors
$group_id id of the group

getAddressesByTarget() 공개 메소드

Get addresses by type of notification
public getAddressesByTarget ( $data, $options = [] )
$data
$options array

getAdminAddress() 공개 메소드

Get GLPI's global administrator email
public getAdminAddress ( )

getAllEvents() 공개 메소드

Return all (GLPI + plugins) notification events for the object type
public getAllEvents ( ) : an
리턴 an array which contains : event => event label

getContentFooter() 공개 메소드

Get footer to add to content
public getContentFooter ( )

getContentHeader() 공개 메소드

Get header to add to content
public getContentHeader ( )

getDatasForTemplate() 공개 메소드

Get all data needed for template processing Provides minimum information for alerts Can be overridden by each NotificationTartget class if needed
public getDatasForTemplate ( $event, $options = [] )
$event
$options array

getDefaultUserType() 공개 메소드

public getDefaultUserType ( )

getDistinctUserSql() 공개 메소드

public getDistinctUserSql ( )

getEntity() 공개 메소드

public getEntity ( )

getEntityAdminAddress() 공개 메소드

Get entity admin email

getEvents() 공개 메소드

Return main notification events for the object type Internal use only => should use getAllEvents
public getEvents ( ) : an
리턴 an array which contains : event => event label

getForTemplate() 공개 메소드

public getForTemplate ( $event, $options )
$event
$options

getFromDBForTarget() 공개 메소드

Retrieve an item from the database for a specific target
public getFromDBForTarget ( $notifications_id, $type, $ID ) : true
$notifications_id integer notification ID
$type type of the target to retrive
$ID integer ID of the target to retrieve
리턴 true if succeed else false

getInstance() 정적인 공개 메소드

Get a notificationtarget class by giving the object which raises the event
static public getInstance ( $item, $event = '', $options = [] ) : a
$item the object which raises the event
$event the event which will be used (default '')
$options array of options
리턴 a notificationtarget class or false

getInstanceByType() 정적인 공개 메소드

Get a notificationtarget class by giving an itemtype
static public getInstanceByType ( $itemtype, $event = '', $options = [] ) : a
$itemtype the itemtype of the object which raises the event
$event the event which will be used (default '')
$options array of options
리턴 a notificationtarget class or false

getItemAuthorAddress() 공개 메소드

Get the email of the item's user

getItemGroupAddress() 공개 메소드

Get Group of the item
public getItemGroupAddress ( )

getItemGroupSupervisorAddress() 공개 메소드

Get Group supervisor of the item

getItemGroupTechInChargeAddress() 공개 메소드

Get Group of technicians in charge of the item

getItemGroupWithoutSupervisorAddress() 공개 메소드

Get Group without supervisor of the item

getItemOwnerAddress() 공개 메소드

Get user owner of the material
public getItemOwnerAddress ( )

getItemTechnicianInChargeAddress() 공개 메소드

Get technician in charge of the item

getMessageID() 공개 메소드

public getMessageID ( ) : message
리턴 message id for notification

getNotificationTargets() 공개 메소드

Return all the targets for this notification Values returned by this method are the ones for the alerts Can be updated by implementing the getAdditionnalTargets() method Can be overwitten (like dbconnection)
public getNotificationTargets ( $entity )
$entity the entity on which the event is raised

getObjectItem() 공개 메소드

Get item associated with the object on which the event was raised
public getObjectItem ( $event = '' ) : the
$event (default '')
리턴 the object associated with the itemtype

getProfileJoinSql() 공개 메소드

public getProfileJoinSql ( )

getRawName() 공개 메소드

Get a notificationtarget class by giving the object which raises the event
또한 보기: CommonDBTM::getRawName
public getRawName ( )

getReplyTo() 공개 메소드

Get the reply to address
public getReplyTo ( $options = [] ) : the
$options array
리턴 the reply to address

getSender() 공개 메소드

Get admin which sends the notification
public getSender ( $options = [] ) : the
$options array
리턴 the sender's address

getSpecificTargets() 공개 메소드

Get addresses by a method not defined in NotificationTarget (specific to an itemtype)
public getSpecificTargets ( $data, $options )
$data
$options

getSubjectPrefix() 공개 메소드

public getSubjectPrefix ( $event = '' )
$event (default '')

getTabNameForItem() 공개 메소드

public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI

getTable() 정적인 공개 메소드

Temporary hack for this class since 0.84
static public getTable ( )

getTags() 공개 메소드

public getTags ( )

getTargets() 공개 메소드

public getTargets ( )

getTypeName() 정적인 공개 메소드

static public getTypeName ( $nb )

getUserByField() 공개 메소드

Add user to the notified users list
public getUserByField ( $field, $search_in_object = false )
$field look for user looking for this field in the object which raises the event
$search_in_object search is done in the object ? if not in target object (false by default)

getUsersAddressesByProfile() 공개 메소드

Get users emails by profile
public getUsersAddressesByProfile ( $profiles_id ) : nothing
$profiles_id the profile ID to get users emails
리턴 nothing

showForGroup() 정적인 공개 메소드

Display notification registered for a group
static public showForGroup ( Group $group ) : nothing
$group Group Group object
리턴 nothing

showForNotification() 공개 메소드

public showForNotification ( Notification $notification )
$notification Notification Notification object

updateTargets() 정적인 공개 메소드

static public updateTargets ( $input )
$input

validateSendTo() 공개 메소드

Validate send before doing it (may be overloaded : exemple for private tasks or followups)
public validateSendTo ( $event, array $infos, $notify_me = false ) : true
$event string notification event
$infos array array of destination of the notification
$notify_me boolean notify me on my action ? ($infos contains users_id to check if the target is me) (false by default)
리턴 true

프로퍼티 상세

$datas 공개적으로 프로퍼티

See https://forge.indepnet.net/projects/5/wiki/NotificationTemplatesTags
public $datas

$dohistory 공개적으로 프로퍼티

From CommonDBTM
public $dohistory

$entity 공개적으로 프로퍼티

public $entity

$events 공개적으로 프로퍼티

array of event name => event label
public $events

$html_tags 공개적으로 프로퍼티

Tags which have data in HTML : do not try to clean them
public $html_tags

$items_id 공개적으로 정적으로 프로퍼티

public static $items_id

$itemtype 공개적으로 정적으로 프로퍼티

From CommonDBChild
public static $itemtype

$notification_targets 공개적으로 프로퍼티

public $notification_targets

$notification_targets_labels 공개적으로 프로퍼티

public $notification_targets_labels

$notificationoptions 공개적으로 프로퍼티

public $notificationoptions

$obj 공개적으로 프로퍼티

Object which raises the notification event
public $obj

$options 공개적으로 프로퍼티

public $options

$prefix 공개적으로 프로퍼티

public $prefix

$raiseevent 공개적으로 프로퍼티

public $raiseevent

$table 공개적으로 프로퍼티

public $table

$tag_descriptions 공개적으로 프로퍼티

public $tag_descriptions

$target 공개적으로 프로퍼티

Array to store emails by notification
public $target

$target_object 공개적으로 프로퍼티

Object which is associated with the event
public $target_object