check for documents with missing revision date

This commit is contained in:
Uwe Steinmann 2022-09-18 12:44:56 +02:00
parent 94d6dd0511
commit 3721fcfc22
2 changed files with 32 additions and 1 deletions

View File

@ -109,16 +109,17 @@ foreach(array('review', 'approval', 'receipt', 'revision') as $process) {
}
}
$docsinrevision = array();
$docsmissingrevsiondate = array();
if(!isset($_GET['action']) || $_GET['action'] == 'listDocsInRevisionNoAccess') {
$tmprevs = $dms->getDocumentsInRevision();
foreach($tmprevs as $rev) {
if($doc = $dms->getDocument($rev['documentID'])) {
$content = $doc->getContentByVersion($rev['version']);
$isdisabled = false;
if($rev['type'] == 0) {
$ruser = $dms->getUser($rev['required']);
$isdisabled = $ruser->isDisabled();
$mode = $doc->getAccessMode($ruser);
$content = $doc->getContentByVersion($rev['version']);
$cmode = $content->getAccessMode($ruser);
} elseif($rev['type'] == 1) {
$rgroup = $dms->getGroup($rev['required']);
@ -130,6 +131,14 @@ foreach($tmprevs as $rev) {
*/
if($mode < M_READ || $cmode < M_READ || $isdisabled)
$docsinrevision[] = $doc;
/* If a document has a sleeping revisor then it must have a
* revision date, otherwise the revision will never be started.
*/
if($rev['status'] == S_LOG_SLEEPING) {
if(!$content->getRevisionDate())
$docsmissingrevsiondate[] = $doc;
}
}
}
}
@ -228,6 +237,7 @@ if($view) {
$view->setParam('wrongfiletypeversions', $wrongfiletypeversions);
$view->setParam('duplicateversions', $duplicateversions);
$view->setParam('docsinrevision', $docsinrevision);
$view->setParam('docsmissingrevsiondate', $docsmissingrevsiondate);
$view->setParam('docsinreception', $docsinreception);
$view->setParam('processwithoutusergroup', $processwithoutusergroup);
$view->setParam('unlink', $unlink);

View File

@ -452,6 +452,26 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Theme_Style {
}
} /* }}} */
function listDocsWithMissingRevisionDate() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$docsmissingrevsiondate = $this->params['docsmissingrevsiondate'];
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$previewconverters = $this->params['previewConverters'];
$timeout = $this->params['timeout'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
$previewer->setConverters($previewconverters);
$this->contentHeading(getMLText("docs_with_missing_revision_date"));
if($docsmissingrevsiondate) {
$this->printList($docsmissingrevsiondate, $previewer);
}
} /* }}} */
function listDocsInReceptionNoAccess() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@ -629,6 +649,7 @@ $(document).ready( function() {
$menuitems[] = array('label'=>getMLText('duplicate_content'), 'badge'=>count($duplicateversions), 'attributes'=>array(array('data-href', "#duplicate_content"), array('data-action', "listDuplicateContent")));
$menuitems[] = array('label'=>getMLText('docs_in_revision_no_access'), 'badge'=>count($docsinrevision), 'attributes'=>array(array('data-href', "#inrevision_no_access"), array('data-action', "listDocsInRevisionNoAccess")));
$menuitems[] = array('label'=>getMLText('docs_in_reception_no_access'), 'badge'=>count($docsinreception), 'attributes'=>array(array('data-href', "#inreception_no_access"), array('data-action', "listDocsInReceptionNoAccess")));
$menuitems[] = array('label'=>getMLText('docs_with_missing_revision_date'), 'badge'=>count($docsmissingrevsiondate), 'attributes'=>array(array('data-href', "#missing_revision_date"), array('data-action', "listDocsWithMissingRevisionDate")));
foreach(array('review', 'approval', 'receipt', 'revision') as $process) {
foreach(array('user', 'group') as $ug) {
$menuitems[] = array('label'=>getMLText($process."s_without_".$ug), 'badge'=>count($processwithoutusergroup[$process][$ug]), 'attributes'=>array(array('data-href', "#".$process.'_without_'.$ug), array('data-action', "list".ucfirst($process).'Without'.ucfirst($ug))));