mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
take out code for show document/folder lines in table
they have been moved into the new functions printDocumentListRow() and printFolderListRow()
This commit is contained in:
parent
e552294073
commit
216e38378d
|
@ -207,166 +207,18 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
|
|||
|
||||
|
||||
foreach($subFolders as $subFolder) {
|
||||
|
||||
$owner = $subFolder->getOwner();
|
||||
$comment = $subFolder->getComment();
|
||||
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
|
||||
$subsub = $subFolder->getSubFolders();
|
||||
$subsub = SeedDMS_Core_DMS::filterAccess($subsub, $user, M_READ);
|
||||
$subdoc = $subFolder->getDocuments();
|
||||
$subdoc = SeedDMS_Core_DMS::filterAccess($subdoc, $user, M_READ);
|
||||
|
||||
print "<tr id=\"table-row-folder-".$subFolder->getID()."\" rel=\"folder_".$subFolder->getID()."\" class=\"folder\" ondragover=\"allowDrop(event)\" ondrop=\"onDrop(event)\">";
|
||||
// print "<td><img src=\"images/folder_closed.gif\" width=18 height=18 border=0></td>";
|
||||
print "<td><a rel=\"folder_".$subFolder->getID()."\" draggable=\"true\" ondragstart=\"onDragStartFolder(event);\" href=\"out.ViewFolder.php?folderid=".$subFolder->getID()."&showtree=".$showtree."\"><img draggable=\"false\" src=\"".$this->imgpath."folder.png\" width=\"24\" height=\"24\" border=0></a></td>\n";
|
||||
print "<td><a href=\"out.ViewFolder.php?folderid=".$subFolder->getID()."&showtree=".$showtree."\">" . htmlspecialchars($subFolder->getName()) . "</a>";
|
||||
print "<br /><span style=\"font-size: 85%; font-style: italic; color: #666;\">".getMLText('owner').": <b>".htmlspecialchars($owner->getFullName())."</b>, ".getMLText('creation_date').": <b>".date('Y-m-d', $subFolder->getDate())."</b></span>";
|
||||
if($comment) {
|
||||
print "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
|
||||
}
|
||||
print "</td>\n";
|
||||
// print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td colspan=\"1\" nowrap><small>";
|
||||
if($enableRecursiveCount) {
|
||||
if($user->isAdmin()) {
|
||||
/* No need to check for access rights in countChildren() for
|
||||
* admin. So pass 0 as the limit.
|
||||
*/
|
||||
$cc = $subFolder->countChildren($user, 0);
|
||||
print $cc['folder_count']." ".getMLText("folders")."<br />".$cc['document_count']." ".getMLText("documents");
|
||||
} else {
|
||||
$cc = $subFolder->countChildren($user, $maxRecursiveCount);
|
||||
if($maxRecursiveCount > 5000)
|
||||
$rr = 100.0;
|
||||
else
|
||||
$rr = 10.0;
|
||||
print (!$cc['folder_precise'] ? '~'.(round($cc['folder_count']/$rr)*$rr) : $cc['folder_count'])." ".getMLText("folders")."<br />".(!$cc['document_precise'] ? '~'.(round($cc['document_count']/$rr)*$rr) : $cc['document_count'])." ".getMLText("documents");
|
||||
}
|
||||
} else {
|
||||
print count($subsub)." ".getMLText("folders")."<br />".count($subdoc)." ".getMLText("documents");
|
||||
}
|
||||
print "</small></td>";
|
||||
// print "<td></td>";
|
||||
print "<td>";
|
||||
print "<div class=\"list-action\">";
|
||||
if($subFolder->getAccessMode($user) >= M_ALL) {
|
||||
$this->printDeleteFolderButton($subFolder, 'splash_rm_folder');
|
||||
} else {
|
||||
?>
|
||||
<span style="padding: 2px; color: #CCC;"><i class="icon-remove"></i></span>
|
||||
<?php
|
||||
}
|
||||
if($subFolder->getAccessMode($user) >= M_READWRITE) {
|
||||
?>
|
||||
<a class_="btn btn-mini" href="../out/out.EditFolder.php?folderid=<?php echo $subFolder->getID(); ?>"><i class="icon-edit"></i></a>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<span style="padding: 2px; color: #CCC;"><i class="icon-edit"></i></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a class="addtoclipboard" rel="<?php echo "F".$subFolder->getID(); ?>" msg="<?php printMLText('splash_added_to_clipboard'); ?>" _href="../op/op.AddToClipboard.php?folderid=<?php echo $folder->getID(); ?>&type=folder&id=<?php echo $subFolder->getID(); ?>" title="<?php printMLText("add_to_clipboard");?>"><i class="icon-copy"></i></a>
|
||||
<?php
|
||||
print "</div>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
echo $this->folderListRow($subFolder);
|
||||
}
|
||||
|
||||
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
|
||||
foreach($documents as $document) {
|
||||
|
||||
$owner = $document->getOwner();
|
||||
$comment = $document->getComment();
|
||||
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
|
||||
$docID = $document->getID();
|
||||
if($latestContent = $document->getLatestContent()) {
|
||||
$previewer->createPreview($latestContent);
|
||||
$version = $latestContent->getVersion();
|
||||
$status = $latestContent->getStatus();
|
||||
$needwkflaction = false;
|
||||
if($workflowmode == 'advanced') {
|
||||
$workflow = $latestContent->getWorkflow();
|
||||
if($workflow) {
|
||||
$needwkflaction = $latestContent->needsWorkflowAction($user);
|
||||
}
|
||||
}
|
||||
|
||||
/* Retrieve attacheѕ files */
|
||||
$files = $document->getDocumentFiles();
|
||||
|
||||
/* Retrieve linked documents */
|
||||
$links = $document->getDocumentLinks();
|
||||
$links = SeedDMS_Core_DMS::filterDocumentLinks($user, $links);
|
||||
|
||||
print "<tr id=\"table-row-document-".$docID."\">";
|
||||
|
||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
||||
print "<td><a rel=\"document_".$docID."\" draggable=\"true\" ondragstart=\"onDragStartDocument(event);\" href=\"../op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
||||
if($previewer->hasPreview($latestContent)) {
|
||||
print "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
} else {
|
||||
print "<img draggable=\"false\" class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
}
|
||||
print "</a></td>";
|
||||
} else
|
||||
print "<td><img draggable=\"false\" class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\"></td>";
|
||||
|
||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$docID."&showtree=".$showtree."\">" . htmlspecialchars($document->getName()) . "</a>";
|
||||
print "<br /><span style=\"font-size: 85%; font-style: italic; color: #666; \">".getMLText('owner').": <b>".htmlspecialchars($owner->getFullName())."</b>, ".getMLText('creation_date').": <b>".date('Y-m-d', $document->getDate())."</b>, ".getMLText('version')." <b>".$version."</b> - <b>".date('Y-m-d', $latestContent->getDate())."</b></span>";
|
||||
if($comment) {
|
||||
print "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
|
||||
}
|
||||
print "</td>\n";
|
||||
// print "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||
print "<td nowrap>";
|
||||
$attentionstr = '';
|
||||
if ( $document->isLocked() ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("lock.png")."\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"> ";
|
||||
}
|
||||
if ( $needwkflaction ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("attention.gif")."\" title=\"". getMLText("workflow").": "."\"> ";
|
||||
}
|
||||
if($attentionstr)
|
||||
print $attentionstr."<br />";
|
||||
print "<small>";
|
||||
if(count($files))
|
||||
print count($files)." ".getMLText("linked_files")."<br />";
|
||||
if(count($links))
|
||||
print count($links)." ".getMLText("linked_documents")."<br />";
|
||||
print getOverallStatusText($status["status"])."</small></td>";
|
||||
// print "<td>".$version."</td>";
|
||||
print "<td>";
|
||||
print "<div class=\"list-action\">";
|
||||
if($document->getAccessMode($user) >= M_ALL) {
|
||||
$this->printDeleteDocumentButton($document, 'splash_rm_document');
|
||||
} else {
|
||||
?>
|
||||
<span style="padding: 2px; color: #CCC;"><i class="icon-remove"></i></span>
|
||||
<?php
|
||||
}
|
||||
if($document->getAccessMode($user) >= M_READWRITE) {
|
||||
?>
|
||||
<a href="../out/out.EditDocument.php?documentid=<?php echo $docID; ?>"><i class="icon-edit"></i></a>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<span style="padding: 2px; color: #CCC;"><i class="icon-edit"></i></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a class="addtoclipboard" rel="<?php echo "D".$docID; ?>" msg="<?php printMLText('splash_added_to_clipboard'); ?>" _href="../op/op.AddToClipboard.php?folderid=<?php echo $folder->getID(); ?>&type=document&id=<?php echo $docID; ?>" title="<?php printMLText("add_to_clipboard");?>"><i class="icon-copy"></i></a>
|
||||
<?php
|
||||
print "</div>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
echo $this->documentListRow($document, $previewer);
|
||||
}
|
||||
|
||||
if ((count($subFolders) > 0)||(count($documents) > 0)) echo "</tbody>\n</table>\n";
|
||||
if ((count($subFolders) > 0)||(count($documents) > 0))
|
||||
echo "</tbody>\n</table>\n";
|
||||
|
||||
|
||||
echo "</div>\n";
|
||||
echo "</div>\n"; // End of right column div
|
||||
|
||||
$this->contentEnd();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user