diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index 2a378c790..1b9ae8fc7 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -3063,6 +3063,34 @@ class SeedDMS_Core_DMS { } /* }}} */ + /** + * Returns a list of reviews, approvals which are not linked + * to a user, group anymore + * + * This method is for finding reviews or approvals whose user + * or group was deleted and not just removed from the process. + */ + function getProcessWithoutUserGroup($process, $usergroup) { /* {{{ */ + switch($process) { + case 'review': + $queryStr = "SELECT a.*, b.`name` FROM `tblDocumentReviewers`"; + break; + case 'approval': + $queryStr = "SELECT a.*, b.`name` FROM `tblDocumentApprovers`"; + break; + } + $queryStr .= " a LEFT JOIN `tblDocuments` b ON a.`documentID`=b.`id` where"; + switch($usergroup) { + case 'user': + $queryStr .= " a.`type`=0 and a.`required` not in (select `id` from `tblUsers`) ORDER by b.`id`"; + break; + case 'group': + $queryStr .= " a.`type`=1 and a.`required` not in (select `id` from `tblGroups`) ORDER by b.`id`"; + break; + } + return $this->db->getResultArray($queryStr); + } /* }}} */ + /** * Returns statitical information * diff --git a/out/out.ObjectCheck.php b/out/out.ObjectCheck.php index 4e548b5a2..265adbb1c 100644 --- a/out/out.ObjectCheck.php +++ b/out/out.ObjectCheck.php @@ -71,6 +71,11 @@ $unlinkeddocuments = $dms->checkDocuments(); $nofilesizeversions = $dms->getNoFileSizeDocumentContent(); $nochecksumversions = $dms->getNoChecksumDocumentContent(); $duplicateversions = $dms->getDuplicateDocumentContent(); +foreach(array('review', 'approval') as $process) { + foreach(array('user', 'group') as $ug) { + $processwithoutusergroup[$process][$ug] = $dms->getProcessWithoutUserGroup($process, $ug); + } +} $tmprevs = $dms->getDocumentsInRevision(); $docsinrevision = array(); foreach($tmprevs as $rev) { @@ -182,6 +187,7 @@ if($view) { $view->setParam('duplicateversions', $duplicateversions); $view->setParam('docsinrevision', $docsinrevision); $view->setParam('docsinreception', $docsinreception); + $view->setParam('processwithoutusergroup', $processwithoutusergroup); $view->setParam('unlink', $unlink); $view->setParam('setfilesize', $setfilesize); $view->setParam('setchecksum', $setchecksum); diff --git a/views/bootstrap/class.ObjectCheck.php b/views/bootstrap/class.ObjectCheck.php index 3d2dd32f4..2bdf8c577 100644 --- a/views/bootstrap/class.ObjectCheck.php +++ b/views/bootstrap/class.ObjectCheck.php @@ -352,6 +352,64 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Bootstrap_Style { } } /* }}} */ + function listProcessesWithoutUserGroup($process, $ug) { /* {{{ */ + $dms = $this->params['dms']; + $user = $this->params['user']; + $folder = $this->params['folder']; + $processwithoutusergroup = $this->params['processwithoutusergroup']; + $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("process_without_user_group")); + + if($processwithoutusergroup) { + print "
".getMLText("process")." | \n"; + print "".getMLText("user_group")." | \n"; + print "".getMLText("documentid")." | \n"; + print "".getMLText("version")." | \n"; + print "".getMLText("required")." | \n"; + print "|
---|---|---|---|---|---|
".$process." | "; + print "".$ug." | "; + print "".$rec['documentID']." | ".$rec['version']." | ".$rec['name']." | "; + print "".$rec['required']." | "; + print "