mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
- check for document content which is not linked to a document
This commit is contained in:
parent
c580ea2c76
commit
b9db056c43
|
@ -94,6 +94,7 @@ function tree($folder, $repair, $path=':', $indent='') { /* {{{ */
|
||||||
|
|
||||||
/* Check if the content is available */
|
/* Check if the content is available */
|
||||||
$versions = $document->getContent();
|
$versions = $document->getContent();
|
||||||
|
if($versions) {
|
||||||
foreach($versions as $version) {
|
foreach($versions as $version) {
|
||||||
$filepath = $dms->contentDir . $version->getPath();
|
$filepath = $dms->contentDir . $version->getPath();
|
||||||
if(!file_exists($filepath)) {
|
if(!file_exists($filepath)) {
|
||||||
|
@ -118,6 +119,22 @@ function tree($folder, $repair, $path=':', $indent='') { /* {{{ */
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
print "<tr>\n";
|
||||||
|
print "<td></td>\n";
|
||||||
|
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 has no content! Delete the document manually.</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -156,6 +173,39 @@ print "</tbody></table>\n";
|
||||||
if($needsrepair && $repair == 0) {
|
if($needsrepair && $repair == 0) {
|
||||||
echo '<p><a href="out.ObjectCheck.php?repair=1">'.getMLText('do_object_repair').'</a></p>';
|
echo '<p><a href="out.ObjectCheck.php?repair=1">'.getMLText('do_object_repair').'</a></p>';
|
||||||
}
|
}
|
||||||
|
UI::contentContainerEnd();
|
||||||
|
|
||||||
|
UI::contentHeading(getMLText("unlinked_content"));
|
||||||
|
UI::contentContainerStart();
|
||||||
|
if(isset($_GET['unlink']) && $_GET['unlink'] == 1) {
|
||||||
|
$unlink = 1;
|
||||||
|
echo "<p>".getMLText('unlinking_objects')."</p>";
|
||||||
|
} else {
|
||||||
|
$unlink = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($versions = $dms->getUnlinkedDocumentContent()) {
|
||||||
|
print "<table class=\"folderView\">";
|
||||||
|
print "<thead>\n<tr>\n";
|
||||||
|
print "<th>".getMLText("document")."</th>\n";
|
||||||
|
print "<th>".getMLText("version")."</th>\n";
|
||||||
|
print "<th>".getMLText("original_filename")."</th>\n";
|
||||||
|
print "<th>".getMLText("mimetype")."</th>\n";
|
||||||
|
print "<th></th>\n";
|
||||||
|
print "</tr>\n</thead>\n<tbody>\n";
|
||||||
|
foreach($versions as $version) {
|
||||||
|
$doc = $version->getDocument();
|
||||||
|
print "<tr><td>".$doc->getId()."</td><td>".$version->getVersion()."</td><td>".$version->getOriginalFileName()."</td><td>".$version->getMimeType()."</td>";
|
||||||
|
if($unlink) {
|
||||||
|
$doc->removeContent($version);
|
||||||
|
}
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
print "</tbody></table>\n";
|
||||||
|
if($unlink == 0) {
|
||||||
|
echo '<p><a href="out.ObjectCheck.php?unlink=1">'.getMLText('do_object_unlink').'</a></p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UI::contentContainerEnd();
|
UI::contentContainerEnd();
|
||||||
UI::htmlEndPage();
|
UI::htmlEndPage();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user