- check for missing document content

This commit is contained in:
steinm 2012-10-05 19:59:22 +00:00
parent 7f93fe51d5
commit fc96b169b3

View File

@ -34,6 +34,7 @@ function tree($folder, $repair, $path=':', $indent='') { /* {{{ */
$folderList = $folder->getFolderList(); $folderList = $folder->getFolderList();
/* Check the folder */ /* Check the folder */
if($folderList != $path) { if($folderList != $path) {
print "<tr>\n";
$needsrepair = true; $needsrepair = true;
print "<td><a class=\"standardText\" href=\"../out/out.ViewFolder.php?folderid=".$folder->getID()."\"><img src=\"../out/images/folder_closed.gif\" width=18 height=18 border=0></a></td>"; print "<td><a class=\"standardText\" href=\"../out/out.ViewFolder.php?folderid=".$folder->getID()."\"><img src=\"../out/images/folder_closed.gif\" width=18 height=18 border=0></a></td>";
print "<td><a class=\"standardText\" href=\"../out/out.ViewFolder.php?folderid=".$folder->getID()."\">"; print "<td><a class=\"standardText\" href=\"../out/out.ViewFolder.php?folderid=".$folder->getID()."\">";
@ -64,9 +65,10 @@ function tree($folder, $repair, $path=':', $indent='') { /* {{{ */
$path .= $folder->getId().':'; $path .= $folder->getId().':';
$documents = $folder->getDocuments(); $documents = $folder->getDocuments();
foreach($documents as $document) { foreach($documents as $document) {
/* Check the document */ /* Check the folder list of the document */
$folderList = $document->getFolderList(); $folderList = $document->getFolderList();
if($folderList != $path) { if($folderList != $path) {
print "<tr>\n";
$needsrepair = true; $needsrepair = true;
$lc = $document->getLatestContent(); $lc = $document->getLatestContent();
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\"><img class=\"mimeicon\" src=\"../out/images/icons/".UI::getMimeIcon($lc->getFileType())."\" title=\"".$lc->getMimeType()."\"></a></td>"; print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\"><img class=\"mimeicon\" src=\"../out/images/icons/".UI::getMimeIcon($lc->getFileType())."\" title=\"".$lc->getMimeType()."\"></a></td>";
@ -76,7 +78,7 @@ function tree($folder, $repair, $path=':', $indent='') { /* {{{ */
for ($i = 1; $i < count($tmppath); $i++) { for ($i = 1; $i < count($tmppath); $i++) {
print htmlspecialchars($tmppath[$i]->getName())."/"; print htmlspecialchars($tmppath[$i]->getName())."/";
} }
print $document->getName(); print htmlspecialchars($document->getName());
print "</a></td>"; print "</a></td>";
$owner = $document->getOwner(); $owner = $document->getOwner();
print "<td>".htmlspecialchars($owner->getFullName())."</td>"; print "<td>".htmlspecialchars($owner->getFullName())."</td>";
@ -89,6 +91,33 @@ function tree($folder, $repair, $path=':', $indent='') { /* {{{ */
} }
print "</tr>\n"; print "</tr>\n";
} }
/* Check if the content is available */
$versions = $document->getContent();
foreach($versions as $version) {
$filepath = $dms->contentDir . $version->getPath();
if(!file_exists($filepath)) {
print "<tr>\n";
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\"><img class=\"mimeicon\" src=\"../out/images/icons/".UI::getMimeIcon($version->getFileType())."\" title=\"".$version->getMimeType()."\"></a></td>";
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\">/";
$folder = $document->getFolder();
$tmppath = $folder->getPath();
for ($i = 1; $i < count($tmppath); $i++) {
print htmlspecialchars($tmppath[$i]->getName())."/";
}
print htmlspecialchars($document->getName());
print "</a></td>";
$owner = $document->getOwner();
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>Document content of version ".$version->getVersion()." is missing ('".$path."')</td>";
if($repair) {
print "<td><span class=\"warning\">Cannot repaired</span></td>\n";
} else {
print "<td></td>\n";
}
print "</tr>\n";
}
}
} }
} /* }}} */ } /* }}} */