Mail sendto default and add filter
This commit is contained in:
parent
2595f1f9ee
commit
d28ba84cb3
@ -1187,9 +1187,10 @@ class Utils
|
||||
* @param string $subject Topic/Subject of mail
|
||||
* @param string $message Message
|
||||
* @param string $filename List of files to attach (full path of filename on file system)
|
||||
* @param string $filter Filter file send
|
||||
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
public function sendDumpDatabase($sendto = '', $from = '', $subject = '', $message = '', $filename = '')
|
||||
public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -1205,6 +1206,8 @@ class Utils
|
||||
|
||||
if (!empty($sendto)) {
|
||||
$sendto = dol_escape_htmltag($sendto);
|
||||
} elseif (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) {
|
||||
$from = dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL);
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
@ -1225,7 +1228,7 @@ class Utils
|
||||
$tmpfiles = dol_most_recent_file($conf->admin->dir_output.'/backup', $filename);
|
||||
}
|
||||
} else {
|
||||
$tmpfiles = dol_most_recent_file($conf->admin->dir_output.'/backup');
|
||||
$tmpfiles = dol_most_recent_file($conf->admin->dir_output.'/backup', $filter);
|
||||
}
|
||||
if ($tmpfiles) {
|
||||
foreach ($tmpfiles as $key => $val) {
|
||||
|
||||
@ -100,7 +100,7 @@ class modCron extends DolibarrModules
|
||||
$this->cronjobs = array(
|
||||
0=>array('entity'=>0, 'label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'tempfilesold+logfiles', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>50, 'status'=>1, 'test'=>true),
|
||||
1=>array('entity'=>0, 'label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>in_array($this->db->type, array('mysql', 'mysqli'))),
|
||||
2=>array('entity'=>0, 'label'=>'MakeSendLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'sendDumpDatabase', 'parameters'=>'', 'comment'=>'MakeSendLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>604800, 'priority'=>91, 'status'=>0, 'test'=>in_array($this->db->type, array('mysql', 'mysqli'))),
|
||||
2=>array('entity'=>0, 'label'=>'MakeSendLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'sendDumpDatabase', 'parameters'=>',,,,,sql', 'comment'=>'MakeSendLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>604800, 'priority'=>91, 'status'=>0, 'test'=>in_array($this->db->type, array('mysql', 'mysqli'))),
|
||||
// 1=>array('entity'=>0, 'label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24)
|
||||
);
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ JobDisabled=Job disabled
|
||||
MakeLocalDatabaseDumpShort=Local database backup
|
||||
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep
|
||||
MakeSendLocalDatabaseDumpShort=Send local database backup
|
||||
MakeSendLocalDatabaseDump=Send local datebase backup to mail. Parameters are: to, from, subject, message , filename
|
||||
MakeSendLocalDatabaseDump=Send local datebase backup to mail. Parameters are: to, from, subject, message , filename (Name file send), filter (sql for only database)
|
||||
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run.
|
||||
DATAPOLICYJob=Data cleaner and anonymizer
|
||||
JobXMustBeEnabled=Job %s must be enabled
|
||||
|
||||
Loading…
Reference in New Issue
Block a user