mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
add dryrun paramter
This commit is contained in:
parent
c1b736022d
commit
9fad6c6e61
|
@ -48,14 +48,17 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
|||
$bodyhtml .= sprintf($tableformathtml."\n", getReadableDate($doc->getExpires()), $doc->getId(), '<a href="'.getBaseUrl().'/out/out.ViewDocument.php? documentid='.$doc->getId().'">'.htmlspecialchars($doc->getName()).'</a>');
|
||||
}
|
||||
$bodyhtml .= "</table>".PHP_EOL;
|
||||
$params = array();
|
||||
$params['count'] = count($docs);
|
||||
$params['__body__'] = $body;
|
||||
$params['__body_html__'] = $bodyhtml;
|
||||
$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);
|
||||
if(empty($taskparams['dryrun'])) {
|
||||
$params = array();
|
||||
$params['count'] = count($docs);
|
||||
$params['__body__'] = $body;
|
||||
$params['__body_html__'] = $bodyhtml;
|
||||
$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);
|
||||
} else {
|
||||
$logger->log('Task \'expired_docs\': Dry run, not sending reminder \'expired_docs_mail_subject\' to user \''.$u->getLogin().'\'', PEAR_LOG_INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,14 +74,18 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
|||
$bodyhtml .= sprintf($tableformathtml."\n", getReadableDate($doc->getExpires()), $doc->getId(), $doc->getName());
|
||||
}
|
||||
$bodyhtml .= "</table>".PHP_EOL;
|
||||
$params = array();
|
||||
$params['count'] = count($docs);
|
||||
$params['__body__'] = $body;
|
||||
$params['__body_html__'] = $bodyhtml;
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$email->toIndividual('', $taskparams['email'], 'expired_docs_mail_subject', '', $params);
|
||||
if(empty($taskparams['dryrun'])) {
|
||||
$params = array();
|
||||
$params['count'] = count($docs);
|
||||
$params['__body__'] = $body;
|
||||
$params['__body_html__'] = $bodyhtml;
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$email->toIndividual('', $taskparams['email'], 'expired_docs_mail_subject', '', $params);
|
||||
|
||||
$logger->log('Task \'expired_docs\': Sending reminder \'expired_docs_mail_subject\' to user \''.$taskparams['email'].'\'', PEAR_LOG_INFO);
|
||||
$logger->log('Task \'expired_docs\': Sending reminder \'expired_docs_mail_subject\' to user \''.$taskparams['email'].'\'', PEAR_LOG_INFO);
|
||||
} else {
|
||||
$logger->log('Task \'expired_docs\': Dry run, not sending reminder \'expired_docs_mail_subject\' to user \''.$taskparams['email'].'\'', PEAR_LOG_INFO);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$logger->log('Task \'expired_docs\': neither peruser nor email is set', PEAR_LOG_WARNING);
|
||||
|
@ -106,7 +113,12 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
|||
'name'=>'peruser',
|
||||
'type'=>'boolean',
|
||||
'description'=> 'Send mail to each user. If set, a list of all expired documents will be send to the owner of the documents.',
|
||||
)
|
||||
),
|
||||
array(
|
||||
'name'=>'dryrun',
|
||||
'type'=>'boolean',
|
||||
'description'=> 'Do not send emails, just log.',
|
||||
),
|
||||
);
|
||||
}
|
||||
} /* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user