diff --git a/inc/inc.Tasks.php b/inc/inc.Tasks.php index 146da29f4..cd5c1d26f 100644 --- a/inc/inc.Tasks.php +++ b/inc/inc.Tasks.php @@ -27,8 +27,6 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */ $tableformathead = " %-10s %5s %-60s"; $tableformathtml = "%s%d%s"; $tableformatheadhtml = "%s%s%s"; - $body = ''; - $bodyhtml = ''; require_once('inc/inc.ClassEmailNotify.php'); $email = new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword); @@ -39,6 +37,8 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */ if(!$u->isGuest() && !$u->isDisabled()) { $docs = $dms->getDocumentsExpired(intval($taskparams['days']), $u); if (count($docs)>0) { + $body = ''; + $bodyhtml = ''; $bodyhtml .= "".PHP_EOL; $bodyhtml .= sprintf($tableformatheadhtml."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), "")); $body .= sprintf($tableformathead."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), "")); @@ -66,6 +66,8 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */ } elseif($taskparams['email']) { $docs = $dms->getDocumentsExpired(intval($taskparams['days'])); if (count($docs)>0) { + $body = ''; + $bodyhtml = ''; $bodyhtml .= "
".PHP_EOL; $bodyhtml .= sprintf($tableformatheadhtml."\n", getMLText("expiration_date", array(), ""), "ID", getMLText("name", array(), "")); $body .= sprintf($tableformathead."\n", getMLText("expiration_date", array(), ""), "ID", getMLText("name", array(), ""));