mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-10 11:02:41 +00:00
do send mail to disabled users or guests
This commit is contained in:
parent
99bc6becb6
commit
bbcf7cb979
|
@ -37,25 +37,27 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
||||||
if(!empty($taskparams['peruser'])) {
|
if(!empty($taskparams['peruser'])) {
|
||||||
$users = $dms->getAllUsers();
|
$users = $dms->getAllUsers();
|
||||||
foreach($users as $u) {
|
foreach($users as $u) {
|
||||||
$docs = $dms->getDocumentsExpired(intval($taskparams['days']), $u);
|
if(!$u->isGuest() && !$u->isDisabled()) {
|
||||||
if (count($docs)>0) {
|
$docs = $dms->getDocumentsExpired(intval($taskparams['days']), $u);
|
||||||
$bodyhtml .= "<table>".PHP_EOL;
|
if (count($docs)>0) {
|
||||||
$bodyhtml .= sprintf($tableformatheadhtml."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), ""));
|
$bodyhtml .= "<table>".PHP_EOL;
|
||||||
$body .= sprintf($tableformathead."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), ""));
|
$bodyhtml .= sprintf($tableformatheadhtml."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), ""));
|
||||||
$body .= "---------------------------------------------------------------------------------\n";
|
$body .= sprintf($tableformathead."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), ""));
|
||||||
foreach($docs as $doc) {
|
$body .= "---------------------------------------------------------------------------------\n";
|
||||||
$body .= sprintf($tableformat."\n", getReadableDate($doc->getExpires()), $doc->getId(), $doc->getName());
|
foreach($docs as $doc) {
|
||||||
$bodyhtml .= sprintf($tableformathtml."\n", getReadableDate($doc->getExpires()), $doc->getId(), $doc->getName());
|
$body .= sprintf($tableformat."\n", getReadableDate($doc->getExpires()), $doc->getId(), $doc->getName());
|
||||||
}
|
$bodyhtml .= sprintf($tableformathtml."\n", getReadableDate($doc->getExpires()), $doc->getId(), $doc->getName());
|
||||||
$bodyhtml .= "</table>".PHP_EOL;
|
}
|
||||||
$params = array();
|
$bodyhtml .= "</table>".PHP_EOL;
|
||||||
$params['count'] = count($docs);
|
$params = array();
|
||||||
$params['__body__'] = $body;
|
$params['count'] = count($docs);
|
||||||
$params['__body_html__'] = $bodyhtml;
|
$params['__body__'] = $body;
|
||||||
$params['sitename'] = $settings->_siteName;
|
$params['__body_html__'] = $bodyhtml;
|
||||||
$email->toIndividual('', $u, 'expired_docs_mail_subject', '', $params);
|
$params['sitename'] = $settings->_siteName;
|
||||||
|
$email->toIndividual('', $u, 'expired_docs_mail_subject', '', $params);
|
||||||
|
|
||||||
$logger->log('Task \'expired_docs\': Sending reminder \'expired_docs_mail_subject\' to user \''.$u->getLogin().'\'', PEAR_LOG_INFO);
|
$logger->log('Task \'expired_docs\': Sending reminder \'expired_docs_mail_subject\' to user \''.$u->getLogin().'\'', PEAR_LOG_INFO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif($taskparams['email']) {
|
} elseif($taskparams['email']) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user