pass translator to SeedDMS_EmailNotify, and SeedDMS_TaskSchedulerBase

This commit is contained in:
Uwe Steinmann 2026-04-05 18:56:59 +02:00
parent 58664d8a72
commit 249a9bb655
2 changed files with 8 additions and 5 deletions

View File

@ -43,6 +43,8 @@ class SeedDMS_SchedulerTaskBase {
var $conversionmgr;
var $translator;
/**
* Call a hook with a given name
*
@ -105,7 +107,7 @@ class SeedDMS_SchedulerTaskBase {
return $ret;
} /* }}} */
public function __construct($dms=null, $user=null, $settings=null, $logger=null, $fulltextservice=null, $notifier=null, $conversionmgr=null) { /* {{{ */
public function __construct($dms=null, $user=null, $settings=null, $logger=null, $fulltextservice=null, $notifier=null, $conversionmgr=null, $translator=null) { /* {{{ */
$this->dms = $dms;
$this->user = $user;
$this->settings = $settings;
@ -113,6 +115,7 @@ class SeedDMS_SchedulerTaskBase {
$this->fulltextservice = $fulltextservice;
$this->notifier = $notifier;
$this->conversionmgr = $conversionmgr;
$this->translator = $translator;
} /* }}} */
public function execute(SeedDMS_SchedulerTask $task) { /* {{{ */

View File

@ -29,7 +29,7 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
$tableformatheadhtml = "<tr><th>%s</th><th>%s</th><th>%s</th></tr>";
require_once('inc/inc.ClassEmailNotify.php');
$email = new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword);
$email = new SeedDMS_EmailNotify($dms, $this->translator, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword);
if(!empty($taskparams['peruser'])) {
$users = $dms->getAllUsers();
@ -575,7 +575,7 @@ class SeedDMS_CalendarTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
require_once('inc/inc.ClassEmailNotify.php');
require_once('inc/inc.ClassCalendar.php');
$email = new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword);
$email = new SeedDMS_EmailNotify($dms, $this->translator, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword);
$calendar = new SeedDMS_Calendar($dms->getDB(), null);
$allusers = $dms->getAllUsers();
@ -671,7 +671,7 @@ class SeedDMS_StatisticTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
$tableformatheadhtml = "<tr><th>%s</th><th>%s</th></tr>";
require_once('inc/inc.ClassEmailNotify.php');
$email = new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword);
$email = new SeedDMS_EmailNotify($dms, $this->translator, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword);
$userstotal = $dms->getStatisticalData('userstotal');
$docstotal = $dms->getStatisticalData('docstotal');
@ -773,7 +773,7 @@ class SeedDMS_RecentChangesTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
$tableformatheadhtml = "<tr><th>%s</th><th>%s</th><th>%s</th></tr>";
require_once('inc/inc.ClassEmailNotify.php');
$email = new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword);
$email = new SeedDMS_EmailNotify($dms, $this->translator, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword);
if(!empty($taskparams['users'])) {
$userids = $taskparams['users'];