mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
e878f438fd
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 "<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";
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
function listReviewWithoutUser() { /* {{{ */
|
||||
$this->listProcessesWithoutUserGroup('review', 'user');
|
||||
} /* }}} */
|
||||
|
||||
function listReviewWithoutGroup() { /* {{{ */
|
||||
$this->listProcessesWithoutUserGroup('review', 'group');
|
||||
} /* }}} */
|
||||
|
||||
function listApprovalWithoutUser() { /* {{{ */
|
||||
$this->listProcessesWithoutUserGroup('approval', 'user');
|
||||
} /* }}} */
|
||||
|
||||
function listApprovalWithoutGroup() { /* {{{ */
|
||||
$this->listProcessesWithoutUserGroup('approval', 'group');
|
||||
} /* }}} */
|
||||
|
||||
function js() { /* {{{ */
|
||||
$user = $this->params['user'];
|
||||
$folder = $this->params['folder'];
|
||||
|
@ -421,6 +479,12 @@ $(document).ready( function() {
|
|||
echo '<li class=""><a data-href="#inrevision_no_access" data-action="listDocsInRevisionNoAccess"><span class="badge '.($docsinrevision ? 'badge-info ' : '').'badge-right">'.count($docsinrevision).'</span>'.getMLText("docs_in_revision_no_access").'</a></li>';
|
||||
echo '<li class=""><a data-href="#inreception_no_access" data-action="listDocsInReceptionNoAccess"><span class="badge '.($docsinreception ? 'badge-info ' : '').'badge-right">'.count($docsinreception).'</span>'.getMLText("docs_in_reception_no_access").'</a></li>';
|
||||
echo '</ul>';
|
||||
echo '<ul class="nav nav-list bs-docs-sidenav _affix">';
|
||||
echo '<li class=""><a data-href="#review_without_user" data-action="listReviewWithoutUser"><span class="badge '.($processwithoutusergroup['review']['user'] ? 'badge-info ' : '').'badge-right">'.count($processwithoutusergroup['review']['user']).'</span>'.getMLText("reviews_without_user").'</a></li>';
|
||||
echo '<li class=""><a data-href="#review_without_group" data-action="listReviewWithoutGroup"><span class="badge '.($processwithoutusergroup['review']['group'] ? 'badge-info ' : '').'badge-right">'.count($processwithoutusergroup['review']['group']).'</span>'.getMLText("reviews_without_group").'</a></li>';
|
||||
echo '<li class=""><a data-href="#approval_without_user" data-action="listApprovalWithoutUser"><span class="badge '.($processwithoutusergroup['approval']['user'] ? 'badge-info ' : '').'badge-right">'.count($processwithoutusergroup['approval']['user']).'</span>'.getMLText("approvals_without_user").'</a></li>';
|
||||
echo '<li class=""><a data-href="#approval_without_group" data-action="listApprovalWithoutGroup"><span class="badge '.($processwithoutusergroup['approval']['group'] ? 'badge-info ' : '').'badge-right">'.count($processwithoutusergroup['approval']['group']).'</span>'.getMLText("approvals_without_group").'</a></li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
echo '<div class="span9">';
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user