show preview image in list

This commit is contained in:
Uwe Steinmann 2015-07-08 07:24:50 +02:00
parent bab558cd5c
commit 26982d1da0
4 changed files with 61 additions and 11 deletions

View File

@ -26,12 +26,17 @@ include("../inc/inc.DBInit.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
/**
* Include class to preview documents
*/
require_once("SeedDMS/Preview.php");
if ($user->isGuest()) {
UI::exitError(getMLText("my_documents"),getMLText("access_denied"));
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList));
if($view) {
$view->show();
exit;

View File

@ -27,12 +27,17 @@ include("../inc/inc.DBInit.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
/**
* Include class to preview documents
*/
require_once("SeedDMS/Preview.php");
if ($user->isGuest()) {
UI::exitError(getMLText("my_documents"),getMLText("access_denied"));
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList));
if($view) {
$view->show();
exit;

View File

@ -34,7 +34,10 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$db = $dms->getDB();
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$this->htmlStartPage(getMLText("approval_summary"));
$this->globalNavigation();
@ -54,8 +57,8 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
$printheader = true;
foreach ($approvalStatus["indstatus"] as $st) {
$document = $dms->getDocument($st['documentID']);
if($document)
$version = $document->getContentByVersion($st['version']);
$version = $document->getContentByVersion($st['version']);
$previewer->createPreview($version);
$owner = $document->getOwner();
$moduser = $dms->getUser($st['required']);
@ -64,6 +67,7 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
if ($printheader){
print "<table class=\"table-condensed\">";
print "<thead>\n<tr>\n";
print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("status")."</th>\n";
@ -75,6 +79,14 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
}
print "<tr>\n";
$previewer->createPreview($version);
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">";
if($previewer->hasPreview($version)) {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
}
print "</a></td>";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>".getOverallStatusText($st["status"])."</td>";
@ -100,8 +112,7 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
$printheader = true;
foreach ($approvalStatus["grpstatus"] as $st) {
$document = $dms->getDocument($st['documentID']);
if($document)
$version = $document->getContentByVersion($st['version']);
$version = $document->getContentByVersion($st['version']);
$owner = $document->getOwner();
$modgroup = $dms->getGroup($st['required']);
@ -110,6 +121,7 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
if ($printheader){
print "<table class=\"table-condensed\">";
print "<thead>\n<tr>\n";
print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("status")."</th>\n";
@ -121,6 +133,14 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
}
print "<tr>\n";
$previewer->createPreview($version);
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">";
if($previewer->hasPreview($version)) {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
}
print "</a></td>";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>".getOverallStatusText($st["status"])."</td>";

View File

@ -34,6 +34,10 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);
$this->htmlStartPage(getMLText("my_documents"));
$this->globalNavigation();
@ -56,8 +60,7 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
$iRev = array();
foreach ($reviewStatus["indstatus"] as $st) {
$document = $dms->getDocument($st['documentID']);
if($document)
$version = $document->getContentByVersion($st['version']);
$version = $document->getContentByVersion($st['version']);
$owner = $document->getOwner();
$moduser = $dms->getUser($st['required']);
@ -66,6 +69,7 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
if ($printheader){
print "<table class=\"table-condensed\">";
print "<thead>\n<tr>\n";
print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("status")."</th>\n";
@ -77,6 +81,14 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
}
print "<tr>\n";
$previewer->createPreview($version);
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">";
if($previewer->hasPreview($version)) {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
}
print "</a></td>";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>".getOverallStatusText($st["status"])."</td>";
@ -102,8 +114,7 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
$printheader=true;
foreach ($reviewStatus["grpstatus"] as $st) {
$document = $dms->getDocument($st['documentID']);
if($document)
$version = $document->getContentByVersion($st['version']);
$version = $document->getContentByVersion($st['version']);
$owner = $document->getOwner();
$modgroup = $dms->getGroup($st['required']);
@ -112,6 +123,7 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
if ($printheader){
print "<table class=\"folderView\">";
print "<thead>\n<tr>\n";
print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("status")."</th>\n";
@ -123,6 +135,14 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
}
print "<tr>\n";
$previewer->createPreview($version);
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">";
if($previewer->hasPreview($version)) {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
}
print "</a></td>";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>".getOverallStatusText($st["status"])."</td>";