Merge branch 'seeddms-5.0.x' into seeddms-5.1.x

This commit is contained in:
Uwe Steinmann 2017-08-02 17:41:04 +02:00
commit 50e969452c
3 changed files with 66 additions and 0 deletions

View File

@ -2488,6 +2488,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
*

View File

@ -66,6 +66,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);
}
}
$rootfolder = $dms->getFolder($settings->_rootFolderID);
if($view) {
@ -76,6 +81,7 @@ if($view) {
$view->setParam('nofilesizeversions', $nofilesizeversions);
$view->setParam('nochecksumversions', $nochecksumversions);
$view->setParam('duplicateversions', $duplicateversions);
$view->setParam('processwithoutusergroup', $processwithoutusergroup);
$view->setParam('unlink', $unlink);
$view->setParam('setfilesize', $setfilesize);
$view->setParam('setchecksum', $setchecksum);

View File

@ -205,6 +205,7 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Bootstrap_Style {
$nofilesizeversions = $this->params['nofilesizeversions'];
$nochecksumversions = $this->params['nochecksumversions'];
$duplicateversions = $this->params['duplicateversions'];
$processwithoutusergroup = $this->params['processwithoutusergroup'];
$repair = $this->params['repair'];
$unlink = $this->params['unlink'];
$setfilesize = $this->params['setfilesize'];
@ -407,6 +408,37 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Bootstrap_Style {
print "</tbody></table>\n";
}
$this->contentContainerEnd();
$this->contentHeading(getMLText("process_without_user_group"));
$this->contentContainerStart();
if($processwithoutusergroup) {
print "<table class=\"table table-condensed\">";
print "<thead>\n<tr>\n";
print "<th>".getMLText("process")."</th>\n";
print "<th>".getMLText("user_group")."</th>\n";
print "<th>".getMLText("documentid")."</th>\n";
print "<th>".getMLText("version")."</th>\n";
print "<th>".getMLText("required")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n";
foreach(array('review', 'approval') as $process) {
foreach(array('user', 'group') as $ug) {
if($processwithoutusergroup[$process][$ug]) {
foreach($processwithoutusergroup[$process][$ug] as $rec) {
print "<tr>";
print "<td>".$process."</td>";
print "<td>".$ug."</td>";
print "<td>".$rec['documentID']."</td><td>".$rec['version']."</td><td>".$rec['name']."</td>";
print "<td>".$rec['required']."</td>";
print "</tr>\n";
}
}
}
}
print "</tbody></table>\n";
}
$this->contentContainerEnd();
$this->contentEnd();
$this->htmlEndPage();