mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +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 {
|
} else {
|
||||||
$users = $dms->getAllUsers();
|
$users = $dms->getAllUsers();
|
||||||
}
|
}
|
||||||
|
if(!empty($taskparams['lists'])) {
|
||||||
|
$lists = $taskparams['lists'];
|
||||||
|
} else {
|
||||||
|
$lists = ['newdocuments', 'updateddocuments', 'statuschange'];
|
||||||
|
}
|
||||||
$docs = [];
|
$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());
|
$docs[$dt] = $dms->getLatestChanges($dt, mktime(0, 0, 0)-intval($taskparams['days'])*86400, time());
|
||||||
}
|
}
|
||||||
foreach($users as $u) {
|
foreach($users as $u) {
|
||||||
if(!$u->isGuest() && !$u->isDisabled()) {
|
if(!$u->isGuest() && !$u->isDisabled()) {
|
||||||
$body = '';
|
$body = '';
|
||||||
$bodyhtml = '';
|
$bodyhtml = '';
|
||||||
foreach(['newdocuments', 'updateddocuments', 'statuschange'] as $dt) {
|
foreach($lists as $dt) {
|
||||||
$params = array();
|
$params = array();
|
||||||
$bodyhtml .= "<h2>".getMLText('latest_'.$dt)."</h2>".PHP_EOL;
|
$bodyhtml .= "<h2>".getMLText('latest_'.$dt)."</h2>".PHP_EOL;
|
||||||
$ds = SeedDMS_Core_DMS::filterAccess($docs[$dt], $u, M_READ);
|
$ds = SeedDMS_Core_DMS::filterAccess($docs[$dt], $u, M_READ);
|
||||||
|
@ -810,13 +815,20 @@ class SeedDMS_RecentChangesTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
||||||
array(
|
array(
|
||||||
'name'=>'days',
|
'name'=>'days',
|
||||||
'type'=>'integer',
|
'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(
|
array(
|
||||||
'name'=>'users',
|
'name'=>'users',
|
||||||
'type'=>'users',
|
'type'=>'users',
|
||||||
'multiple'=>true,
|
'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