dolibarr  7.0.0-beta
Public Member Functions | List of all members
Notify Class Reference

Class to manage notifications. More...

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 confirmMessage ($action, $socid, $object)
 Return message that say how many notification (and to which email) will occurs on requested event. More...
 
 getNotificationsArray ($notifcode, $socid=0, $object=null, $userid=0, $scope=array('thirdparty', 'user', 'global'))
 Return number of notifications activated for action code (and third party) More...
 
 send ($notifcode, $object)
 Check if notification are active for couple action/company. More...
 

Detailed Description

Class to manage notifications.

Definition at line 31 of file notify.class.php.

Constructor & Destructor Documentation

Notify::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 68 of file notify.class.php.

Member Function Documentation

Notify::confirmMessage (   $action,
  $socid,
  $object 
)

Return message that say how many notification (and to which email) will occurs on requested event.

This is to show confirmation messages before event is recorded.

Parameters
string$actionId of action in llx_c_action_trigger
int$socidId of third party
Object$objectObject the notification is about
Returns
string Message

Definition at line 83 of file notify.class.php.

References getNotificationsArray(), and img_object().

Notify::getNotificationsArray (   $notifcode,
  $socid = 0,
  $object = null,
  $userid = 0,
  $scope = array('thirdparty', 'user', 'global') 
)

Return number of notifications activated for action code (and third party)

Parameters
string$notifcodeCode of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
int$socidId of third party or 0 for all thirdparties or -1 for no thirdparties
Object$objectObject the notification is about (need it to check threshold value of some notifications)
int$useridId of user or 0 for all users or -1 for no users
array$scopeScope where to search
Returns
array|int <0 if KO, array of notifications to send if OK

Definition at line 124 of file notify.class.php.

References $resql, dol_syslog(), float, and isValidEmail().

Referenced by confirmMessage().

Notify::send (   $notifcode,
  $object 
)

Check if notification are active for couple action/company.

If yes, send mail and save trace into llx_notify.

Parameters
string$notifcodeCode of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
Object$objectObject the notification deals on
Returns
int <0 if KO, or number of changes if OK

Definition at line 284 of file notify.class.php.

References dol_concatdesc(), dol_getIdFromCode(), dol_is_file(), dol_mimetype(), dol_now(), dol_print_error(), dol_sanitizeFileName(), dol_strlen(), dol_syslog(), dolGetFirstLastname(), float, and if.


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