프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$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) |
public __construct ( $entity = '', $event = '', $object = null, $options = [] ) | ||
$entity | (default '') | |
$event | (default '') | |
$object | (default null) | |
$options | array |
public addAdditionnalUserInfo ( array $data ) : empty | ||
$data | array | |
리턴 | empty | array |
public addTarget ( $target = '', $label = '', $type = Notification::USER_TYPE ) | ||
$target | (default '') | |
$label | (default '') | |
$type | (=Notification::USER_TYPE) |
public addToAddressesList ( array $data ) | ||
$data | array | array of data (mail, lang[, id for user]) |
static public countForGroup ( Group $group ) : integer | ||
$group | Group | Group object |
리턴 | integer |
static public displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate ) | ||
$item | CommonGLPI |
public getAdditionalTargets ( $event = '' ) | ||
$event | specif event to get additional targets (default '') |
public getAddressesByGroup ( $manager, $group_id ) | ||
$manager | 0 all users, 1 only supervisors, 2 all users without supervisors | |
$group_id | id of the group |
public getAddressesByTarget ( $data, $options = [] ) | ||
$data | ||
$options | array |
public getAllEvents ( ) : an | ||
리턴 | an | array which contains : event => event label |
public getDatasForTemplate ( $event, $options = [] ) | ||
$event | ||
$options | array |
public getEvents ( ) : an | ||
리턴 | an | array which contains : event => event label |
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 |
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 |
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 |
public getItemGroupSupervisorAddress ( ) |
public getItemGroupTechInChargeAddress ( ) |
public getItemGroupWithoutSupervisorAddress ( ) |
public getItemTechnicianInChargeAddress ( ) |
public getNotificationTargets ( $entity ) | ||
$entity | the entity on which the event is raised |
public getObjectItem ( $event = '' ) : the | ||
$event | (default '') | |
리턴 | the | object associated with the itemtype |
public getRawName ( ) |
public getReplyTo ( $options = [] ) : the | ||
$options | array | |
리턴 | the | reply to address |
public getSender ( $options = [] ) : the | ||
$options | array | |
리턴 | the | sender's address |
public getSpecificTargets ( $data, $options ) | ||
$data | ||
$options |
public getTabNameForItem ( CommonGLPI $item, $withtemplate ) | ||
$item | CommonGLPI |
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) |
public getUsersAddressesByProfile ( $profiles_id ) : nothing | ||
$profiles_id | the profile ID to get users emails | |
리턴 | nothing |
static public showForGroup ( Group $group ) : nothing | ||
$group | Group | Group object |
리턴 | nothing |
public showForNotification ( Notification $notification ) | ||
$notification | Notification | Notification object |
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 |
public $datas |