diff --git a/views/bootstrap/class.ObjectCheck.php b/views/bootstrap/class.ObjectCheck.php index 61284bae8..ac74a3cf3 100644 --- a/views/bootstrap/class.ObjectCheck.php +++ b/views/bootstrap/class.ObjectCheck.php @@ -85,211 +85,6 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Bootstrap_Style { } } /* }}} */ - function _tree($dms, $user, $folder, $path=':') { /* {{{ */ - - $objects = array(); - - /* Don't do folderlist check for root folder */ - if($path != ':') { - /* If the path contains a folder id twice, the a cyclic relation - * exists. - */ - $tmparr = explode(':', $path); - array_shift($tmparr); - if(count($tmparr) != count(array_unique($tmparr))) { - $objects[] = array('object'=>$folder, 'msg'=>'Folder path contains cyclic relation'); - } - $folderList = $folder->getFolderList(); - /* Check the folder */ - if($folderList != $path) { - $objects[] = array('object'=>$folder, 'msg'=>"Folderlist is '".$folderList."', should be '".$path); - } - } - - $subfolders = $folder->getSubFolders(); - foreach($subfolders as $subfolder) { - $objects = array_merge($objects, $this->_tree($dms, $user, $subfolder, $path.$folder->getId().':')); - } - $path .= $folder->getId().':'; - $documents = $folder->getDocuments(); - foreach($documents as $document) { - /* Check the folder list of the document */ - $folderList = $document->getFolderList(); - if($folderList != $path) { - $objects[] = array('object'=>$document, 'msg'=>"Folderlist is '".$folderList."', should be '".$path); - } - - /* Check if the content is available */ - $versions = $document->getContent(); - if($versions) { - foreach($versions as $version) { - $filepath = $dms->contentDir . $version->getPath(); - if(!file_exists($filepath)) { - $objects[] = array('object'=>$version, 'msg'=>'Document content is missing'); - } - } - } else { - $objects[] = array('object'=>$version, 'msg'=>'Document has no content at all'); - } - } - - return $objects; - } /* }}} */ - - function tree($dms, $folder, $repair, $path=':', $indent='') { /* {{{ */ - global $user; - - /* Don't do folderlist check for root folder */ - if($path != ':') { - /* If the path contains a folder id twice, the a cyclic relation - * exists. - */ - $tmparr = explode(':', $path); - array_shift($tmparr); - if(count($tmparr) != count(array_unique($tmparr))) { - print "\n"; - print "getID()."\">"; - print "getID()."\">"; - print htmlspecialchars($path); - print ""; - - $owner = $folder->getOwner(); - print "".htmlspecialchars($owner->getFullName()).""; - print "Folder path contains cyclic relation"; - if($repair) { - print "".getMLText('repaired')."\n"; - } else { - print "\n"; - } - print "\n"; - } - $folderList = $folder->getFolderList(); - /* Check the folder */ - if($folderList != $path) { - print "\n"; - $this->needsrepair = true; - print "getID()."\">"; - print "getID()."\">"; - $tmppath = $folder->getPath(); - for ($i = 1; $i < count($tmppath); $i++) { - print "/".htmlspecialchars($tmppath[$i]->getName()); - } - print ""; - - $owner = $folder->getOwner(); - print "".htmlspecialchars($owner->getFullName()).""; - print "Folderlist is '".$folderList."', should be '".$path."'"; - if($repair) { - $folder->repair(); - print "".getMLText('repaired')."\n"; - } else { - print "\n"; - } - print "\n"; - } - } - - $subfolders = $folder->getSubFolders(); - foreach($subfolders as $subfolder) { - $this->tree($dms, $subfolder, $repair, $path.$folder->getId().':', $indent.' '); - } - $path .= $folder->getId().':'; - $documents = $folder->getDocuments(); - foreach($documents as $document) { - /* Check the folder list of the document */ - $folderList = $document->getFolderList(); - if($folderList != $path) { - print "\n"; - $this->needsrepair = true; - $lc = $document->getLatestContent(); - print "getID()."\">getMimeIcon($lc->getFileType())."\" title=\"".$lc->getMimeType()."\">"; - print "getID()."\">/"; - $folder = $document->getFolder(); - $tmppath = $folder->getPath(); - for ($i = 1; $i < count($tmppath); $i++) { - print htmlspecialchars($tmppath[$i]->getName())."/"; - } - print htmlspecialchars($document->getName()); - print ""; - $owner = $document->getOwner(); - print "".htmlspecialchars($owner->getFullName()).""; - print "Folderlist is '".$folderList."', should be '".$path."'"; - if($repair) { - $document->repair(); - print "".getMLText('repaired')."\n"; - } else { - print "\n"; - } - print "\n"; - } - - /* Check if the content is available */ - $versions = $document->getContent(); - if($versions) { - foreach($versions as $version) { - $filepath = $dms->contentDir . $version->getPath(); - if(!file_exists($filepath)) { - print "\n"; - print "getID()."\" class=\"table-row-document\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">"; - print "getID()."\">getMimeIcon($version->getFileType())."\" title=\"".$version->getMimeType()."\">"; - print "getID()."\">/"; - $folder = $document->getFolder(); - $tmppath = $folder->getPath(); - for ($i = 1; $i < count($tmppath); $i++) { - print htmlspecialchars($tmppath[$i]->getName())."/"; - } - print htmlspecialchars($document->getName()); - print ""; - $owner = $document->getOwner(); - print "".htmlspecialchars($owner->getFullName()).""; - print "Document content of version ".$version->getVersion()." is missing ('".$path."')"; - if($repair) { - print "Cannot repaired\n"; - } else { - print "\n"; - } - echo ""; - echo "
"; - if($document->getAccessMode($user) >= M_ALL) { - echo $this->printDeleteDocumentButton($document, 'splash_rm_document', true); - } else { - echo ''; - } - if($document->getAccessMode($user) >= M_READWRITE) { - print ''; - } else { - print ''; - } - if($document->getAccessMode($user) >= M_READWRITE) { - print $this->printLockButton($document, 'splash_document_locked', 'splash_document_unlocked', true); - } - if($this->enableClipboard) { - print ''; - } - echo "
"; - echo ""; - print "\n"; - } - } - } else { - print "\n"; - print "\n"; - print "getID()."\">/"; - $folder = $document->getFolder(); - $tmppath = $folder->getPath(); - for ($i = 1; $i < count($tmppath); $i++) { - print htmlspecialchars($tmppath[$i]->getName())."/"; - } - print htmlspecialchars($document->getName()); - print ""; - $owner = $document->getOwner(); - print "".htmlspecialchars($owner->getFullName()).""; - print "Document has no content! Delete the document manually."; - print "\n"; - } - } - } /* }}} */ - function listRepair() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; @@ -614,7 +409,7 @@ $(document).ready( function() { echo '
  • '.count($unlinkeddocuments).''.getMLText("unlinked_documents").'
  • '; echo '
  • '.count($unlinkedcontent).''.getMLText("unlinked_content").'
  • '; echo '
  • '.count($nofilesizeversions).''.getMLText("missing_filesize").'
  • '; - echo '
  • '.count($nochecksumversions).''.getMLText("missing_checksum").'
  • '; + echo '
  • '.count($nochecksumversions).''.getMLText("missing_checksum").'
  • '; echo ''; $this->contentHeading(getMLText("object_check_warning")); echo '