From dd1381413900e5d37f1e01585addafdb041b34ec Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 8 Jul 2015 07:24:50 +0200 Subject: [PATCH 1/2] show preview image in list --- out/out.ApprovalSummary.php | 7 +++++- out/out.ReviewSummary.php | 7 +++++- views/bootstrap/class.ApprovalSummary.php | 30 +++++++++++++++++++---- views/bootstrap/class.ReviewSummary.php | 28 ++++++++++++++++++--- 4 files changed, 61 insertions(+), 11 deletions(-) diff --git a/out/out.ApprovalSummary.php b/out/out.ApprovalSummary.php index f3667b3a5..7b0b49f4c 100644 --- a/out/out.ApprovalSummary.php +++ b/out/out.ApprovalSummary.php @@ -24,12 +24,17 @@ include("../inc/inc.Language.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; diff --git a/out/out.ReviewSummary.php b/out/out.ReviewSummary.php index 2c51cef90..c49f89efc 100644 --- a/out/out.ReviewSummary.php +++ b/out/out.ReviewSummary.php @@ -25,12 +25,17 @@ include("../inc/inc.Language.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; diff --git a/views/bootstrap/class.ApprovalSummary.php b/views/bootstrap/class.ApprovalSummary.php index 932b3fb7e..69bb71ff9 100644 --- a/views/bootstrap/class.ApprovalSummary.php +++ b/views/bootstrap/class.ApprovalSummary.php @@ -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 ""; print "\n\n"; + print "\n"; print "\n"; print "\n"; print "\n"; @@ -75,6 +79,14 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style { } print "\n"; + $previewer->createPreview($version); + print ""; print ""; print ""; print ""; @@ -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 "
".getMLText("name")."".getMLText("owner")."".getMLText("status")."
"; + if($previewer->hasPreview($version)) { + print "getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; + } else { + print "getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; + } + print "".htmlspecialchars($document->getName())."".htmlspecialchars($owner->getFullName())."".getOverallStatusText($st["status"])."
"; print "\n\n"; + print "\n"; print "\n"; print "\n"; print "\n"; @@ -121,6 +133,14 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style { } print "\n"; + $previewer->createPreview($version); + print ""; print ""; print ""; print ""; diff --git a/views/bootstrap/class.ReviewSummary.php b/views/bootstrap/class.ReviewSummary.php index 49001f7af..7ca1802a4 100644 --- a/views/bootstrap/class.ReviewSummary.php +++ b/views/bootstrap/class.ReviewSummary.php @@ -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 "
".getMLText("name")."".getMLText("owner")."".getMLText("status")."
"; + if($previewer->hasPreview($version)) { + print "getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; + } else { + print "getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; + } + print "".htmlspecialchars($document->getName())."".htmlspecialchars($owner->getFullName())."".getOverallStatusText($st["status"])."
"; print "\n\n"; + print "\n"; print "\n"; print "\n"; print "\n"; @@ -77,6 +81,14 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style { } print "\n"; + $previewer->createPreview($version); + print ""; print ""; print ""; print ""; @@ -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 "
".getMLText("name")."".getMLText("owner")."".getMLText("status")."
"; + if($previewer->hasPreview($version)) { + print "getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; + } else { + print "getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; + } + print "".htmlspecialchars($document->getName())."".htmlspecialchars($owner->getFullName())."".getOverallStatusText($st["status"])."
"; print "\n\n"; + print "\n"; print "\n"; print "\n"; print "\n"; @@ -123,6 +135,14 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style { } print "\n"; + $previewer->createPreview($version); + print ""; print ""; print ""; print ""; From 24fcffbc6c44e1ad2554955c8f698166b17610a5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 8 Jul 2015 07:25:41 +0200 Subject: [PATCH 2/2] add item for 4.3.20 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 5efe93564..f42752f10 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ -------------------------------------------------------------------------------- - fix setting expire date when editing a document (Closes: #225) - MyDocumets: list only documents to approve which have passed review +- show preview image in Review/Approval summary -------------------------------------------------------------------------------- Changes in version 4.3.19
".getMLText("name")."".getMLText("owner")."".getMLText("status")."
"; + if($previewer->hasPreview($version)) { + print "getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; + } else { + print "getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; + } + print "".htmlspecialchars($document->getName())."".htmlspecialchars($owner->getFullName())."".getOverallStatusText($st["status"])."