mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
lists of recent changes can be configured
This commit is contained in:
parent
3bef98756a
commit
f63f7847f0
|
@ -763,15 +763,20 @@ class SeedDMS_RecentChangesTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
|||
} else {
|
||||
$users = $dms->getAllUsers();
|
||||
}
|
||||
if(!empty($taskparams['lists'])) {
|
||||
$lists = $taskparams['lists'];
|
||||
} else {
|
||||
$lists = ['newdocuments', 'updateddocuments', 'statuschange'];
|
||||
}
|
||||
$docs = [];
|
||||
foreach(['newdocuments', 'updateddocuments', 'statuschange'] as $dt) {
|
||||
foreach($lists as $dt) {
|
||||
$docs[$dt] = $dms->getLatestChanges($dt, mktime(0, 0, 0)-intval($taskparams['days'])*86400, time());
|
||||
}
|
||||
foreach($users as $u) {
|
||||
if(!$u->isGuest() && !$u->isDisabled()) {
|
||||
$body = '';
|
||||
$bodyhtml = '';
|
||||
foreach(['newdocuments', 'updateddocuments', 'statuschange'] as $dt) {
|
||||
foreach($lists as $dt) {
|
||||
$params = array();
|
||||
$bodyhtml .= "<h2>".getMLText('latest_'.$dt)."</h2>".PHP_EOL;
|
||||
$ds = SeedDMS_Core_DMS::filterAccess($docs[$dt], $u, M_READ);
|
||||
|
@ -810,13 +815,20 @@ class SeedDMS_RecentChangesTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
|||
array(
|
||||
'name'=>'days',
|
||||
'type'=>'integer',
|
||||
'description'=> 'Number of days to check for. Negative values will look into the past. 0 will just check for documents expiring the current day. Keep in mind that the document is still valid on the expiration date.',
|
||||
'description'=> 'Number of days to look back.',
|
||||
),
|
||||
array(
|
||||
'name'=>'lists',
|
||||
'type'=>'select',
|
||||
'description'=>'Number of days to look back.',
|
||||
'multiple'=>true,
|
||||
'options'=>[['newdocuments', getMLText('latest_newdocuments')], ['updateddocuments', getMLText('latest_updateddocuments')], ['statuschange', getMLText('latest_statuschange')]],
|
||||
),
|
||||
array(
|
||||
'name'=>'users',
|
||||
'type'=>'users',
|
||||
'multiple'=>true,
|
||||
'description'=> 'Send list of recently changed documents to this users',
|
||||
'description'=> 'Send list of recently changed or added documents to this users',
|
||||
)
|
||||
);
|
||||
} /* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user