|
dolibarr 21.0.4
|
Class to manage the table of subscription to notifications. More...

Public Member Functions | |
| __construct ($db) | |
| Constructor. | |
| confirmMessage ($action, $socid, $object) | |
| Return message that say how many notification (and to which email) will occurs on requested event. | |
| delete ($user=null) | |
| Delete a notification from database. | |
| create ($user=null, $notrigger=0) | |
| Create notification information record. | |
| fetch ($id, $socid=0, $type='email') | |
| Load record from database. | |
| update ($user=null, $notrigger=0) | |
| Update record in database. | |
| getNotificationsArray ($notifcode, $socid=0, $object=null, $userid=0, $scope=array('thirdparty', 'user', 'global')) | |
| Return number of notifications activated, for all or a given action code (and third party) | |
| send ($notifcode, $object, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array()) | |
| Check if notification are active for couple action/company. | |
Class to manage the table of subscription to notifications.
Definition at line 38 of file notify.class.php.
| Notify::__construct | ( | $db | ) |
| 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.
| string | $action | Id of action in llx_c_action_trigger |
| int | $socid | Id of third party |
| Object | $object | Object the notification is about |
Definition at line 192 of file notify.class.php.
References $object, getDolGlobalString(), getNotificationsArray(), and img_object().
| Notify::create | ( | $user = null, | |
| $notrigger = 0 ) |
Create notification information record.
| ?User | $user | User |
| int<0,1> | $notrigger 1=Disable triggers |
Definition at line 303 of file notify.class.php.
| Notify::delete | ( | $user = null | ) |
Delete a notification from database.
| ?User | $user | User deleting |
Definition at line 269 of file notify.class.php.
References dol_syslog().
| Notify::fetch | ( | $id, | |
| $socid = 0, | |||
| $type = 'email' ) |
Load record from database.
| int | $id | Id of record |
| int | $socid | Id of company. If this is filled, function will return only records belonging to this thirdparty |
| string | $type | If id of company filled, we say if we want record of this type only |
Definition at line 354 of file notify.class.php.
References dol_print_error(), email, and type.
| Notify::getNotificationsArray | ( | $notifcode, | |
| $socid = 0, | |||
| $object = null, | |||
| $userid = 0, | |||
| $scope = array('thirdparty', 'user', 'global') ) |
Return number of notifications activated, for all or a given action code (and third party)
| string | $notifcode | Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage) |
| int | $socid | Id of third party or 0 for all thirdparties or -1 for no thirdparties |
| CommonObject | $object | Object the notification is about (need it to check threshold value of some notifications) |
| int | $userid | Id of user or 0 for all users or -1 for no users |
| array | $scope | Scope where to search |
Definition at line 458 of file notify.class.php.
References $conf, $object, dol_syslog(), and isValidEmail().
Referenced by confirmMessage().
| Notify::send | ( | $notifcode, | |
| $object, | |||
| $filename_list = array(), | |||
| $mimetype_list = array(), | |||
| $mimefilename_list = array() ) |
Check if notification are active for couple action/company.
If yes, send mail and save trace into llx_notify.
| string | $notifcode | Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage) |
| CommonObject | $object | Object the notification deals on |
| string[] | $filename_list | List of files to attach (full path of filename on file system) |
| string[] | $mimetype_list | List of MIME type of attached files |
| string[] | $mimefilename_list | List of attached file name in message |
Definition at line 626 of file notify.class.php.
References $conf, $object, complete_substitutions_array(), dol_getIdFromCode(), dol_is_file(), dol_now(), dol_print_error(), dol_sanitizeFileName(), dol_strlen(), dol_syslog(), dolGetFirstLastname(), get_exdir(), getCommonSubstitutionArray(), getDolGlobalString(), and make_substitutions().
| Notify::update | ( | $user = null, | |
| $notrigger = 0 ) |
Update record in database.
| ?User | $user | Object user |
| int<0,1> | $notrigger 1=Disable triggers |
Definition at line 405 of file notify.class.php.
References type.