run check only if required

speeds up calling a single check
This commit is contained in:
Uwe Steinmann 2017-08-03 07:12:03 +02:00
parent d82f8c44d1
commit 94a4844616

View File

@ -66,18 +66,36 @@ if(isset($_GET['setchecksum']) && $_GET['setchecksum'] == 1) {
$folder = $dms->getFolder($settings->_rootFolderID); $folder = $dms->getFolder($settings->_rootFolderID);
$unlinkedversions = $dms->getUnlinkedDocumentContent(); $unlinkedversions = $dms->getUnlinkedDocumentContent();
$unlinkedfolders = $dms->checkFolders(); if(!isset($_GET['action']) || $_GET['action'] == 'listUnlinkedFolders')) {
$unlinkeddocuments = $dms->checkDocuments(); $unlinkedfolders = $dms->checkFolders();
$nofilesizeversions = $dms->getNoFileSizeDocumentContent(); else
$nochecksumversions = $dms->getNoChecksumDocumentContent(); $unlinkedfolders = null;
$duplicateversions = $dms->getDuplicateDocumentContent(); if(!isset($_GET['action']) || $_GET['action'] == 'listUnlinkedDocuments')) {
foreach(array('review', 'approval') as $process) { $unlinkeddocuments = $dms->checkDocuments();
else
$unlinkeddocuments = null;
if(!isset($_GET['action']) || $_GET['action'] == 'listMissingFileSize')) {
$nofilesizeversions = $dms->getNoFileSizeDocumentContent();
else
$nofilesizeversions = null;
if(!isset($_GET['action']) || $_GET['action'] == 'listMissingChecksum')) {
$nochecksumversions = $dms->getNoChecksumDocumentContent();
else
$nochecksumversions = null;
if(!isset($_GET['action']) || $_GET['action'] == 'listDuplicateContent')) {
$duplicateversions = $dms->getDuplicateDocumentContent();
else
$duplicateversions = null;
foreach(array('review', 'approval', 'receipt', 'revision') as $process) {
foreach(array('user', 'group') as $ug) { foreach(array('user', 'group') as $ug) {
$processwithoutusergroup[$process][$ug] = $dms->getProcessWithoutUserGroup($process, $ug); if(!isset($_GET['action']) || $_GET['action'] == 'list'.ucfirst($process).'Without'.ucfirst($ug)) {
$processwithoutusergroup[$process][$ug] = $dms->getProcessWithoutUserGroup($process, $ug);
}
} }
} }
$tmprevs = $dms->getDocumentsInRevision();
$docsinrevision = array(); $docsinrevision = array();
if(!isset($_GET['action']) || $_GET['action'] == 'listDocsInRevisionNoAccess') {
$tmprevs = $dms->getDocumentsInRevision();
foreach($tmprevs as $rev) { foreach($tmprevs as $rev) {
if($doc = $dms->getDocument($rev['documentID'])) { if($doc = $dms->getDocument($rev['documentID'])) {
$isdisabled = false; $isdisabled = false;
@ -99,8 +117,11 @@ foreach($tmprevs as $rev) {
$docsinrevision[] = $doc; $docsinrevision[] = $doc;
} }
} }
$tmprevs = $dms->getDocumentsInReception(); }
$docsinreception = array(); $docsinreception = array();
if(!isset($_GET['action']) || $_GET['action'] == 'listDocsInReceptionNoAccess') {
$tmprevs = $dms->getDocumentsInReception();
foreach($tmprevs as $rev) { foreach($tmprevs as $rev) {
if($doc = $dms->getDocument($rev['documentID'])) { if($doc = $dms->getDocument($rev['documentID'])) {
$isdisabled = false; $isdisabled = false;
@ -122,6 +143,8 @@ foreach($tmprevs as $rev) {
$docsinreception[] = $doc; $docsinreception[] = $doc;
} }
} }
}
$rootfolder = $dms->getFolder($settings->_rootFolderID); $rootfolder = $dms->getFolder($settings->_rootFolderID);
function repair_tree($dms, $user, $folder, $path=':') { /* {{{ */ function repair_tree($dms, $user, $folder, $path=':') { /* {{{ */
@ -173,7 +196,10 @@ function repair_tree($dms, $user, $folder, $path=':') { /* {{{ */
return $objects; return $objects;
} /* }}} */ } /* }}} */
$repairobjects = repair_tree($dms, $user, $folder); if(!isset($_GET['action']) || $_GET['action'] == 'listRepair')
$repairobjects = repair_tree($dms, $user, $folder);
else
$repairobjects = null;
if($view) { if($view) {
$view->setParam('folder', $folder); $view->setParam('folder', $folder);