From 8a9099bbcb82bb538d8a67dfaabaf2dc46178b22 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 23 Apr 2013 19:03:56 +0200 Subject: [PATCH 01/35] various ui improvements --- styles/bootstrap/application.css | 11 +++ views/bootstrap/class.ViewDocument.php | 113 ++++++++++++++++--------- 2 files changed, 84 insertions(+), 40 deletions(-) diff --git a/styles/bootstrap/application.css b/styles/bootstrap/application.css index f9675e25e..fcbd6ba52 100644 --- a/styles/bootstrap/application.css +++ b/styles/bootstrap/application.css @@ -16,6 +16,17 @@ img.mimeicon { min-height: 100px; } +ul.actions li a:hover > i { + text-decoration: none; +} +ul.actions li a > i { + color: #000; + margin-right: 5px; +} +ul.actions li a.btn > i { + font-size: 200%; +} + @media (max-width: 480px) { .nav-tabs > li { float:none; diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index a9dee42e6..dcbea99fa 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -278,35 +278,44 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print ""; print "\n\n"; print "\n"; - print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; - print "\n"; - print "\n"; - print ""; @@ -565,9 +581,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { $this->contentContainerStart(); if($user->isAdmin()) { if(SeedDMS_Core_DMS::checkIfEqual($workflow->getInitState(), $latestContent->getWorkflowState())) { - print "".createHiddenFieldWithKey('removeworkflowfromdocument')."getVersion()."\" />"; + print "".createHiddenFieldWithKey('removeworkflowfromdocument')."getVersion()."\" />"; } else { - print "".createHiddenFieldWithKey('rewindworkflow')."getVersion()."\" />"; + print "".createHiddenFieldWithKey('rewindworkflow')."getVersion()."\" />"; } } @@ -746,8 +762,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "
".getMLText("version")."".getMLText("file")."".getMLText("file")."".getMLText("comment")."".getMLText("status")."
    "; + print "
"; + /* + print ""; + */ $previewer = new SeedDMS_Preview_Previewer($cachedir, 100); $previewer->createPreview($latestContent); + if ($viewonlinefiletypes && in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes)) + print "getVersion()."\">"; + else + print "getVersion()."\">"; if($previewer->hasPreview($latestContent)) { print("getID()."&version=".$latestContent->getVersion()."&width=100\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"); + } else { + print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; } + print ""; print "".$latestContent->getVersion()."
    \n"; + print "
    \n"; print "
  • ".$latestContent->getOriginalFileName() ."
  • \n"; + print "
  • ".getMLText('version').": ".$latestContent->getVersion()."
  • \n"; if ($file_exists) - print "
  • ". SeedDMS_Core_File::format_filesize($latestContent->getFileSize()) ." ".htmlspecialchars($latestContent->getMimeType())."
  • "; + print "
  • ". SeedDMS_Core_File::format_filesize($latestContent->getFileSize()) .", ".htmlspecialchars($latestContent->getMimeType())."
  • "; else print "
  • ".getMLText("document_deleted")."
  • "; $updatingUser = $latestContent->getUser(); @@ -314,7 +323,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "
  • ".getLongReadableDate($latestContent->getDate())."
  • "; print "
\n"; - print "
    \n"; + print "
      \n"; $attributes = $latestContent->getAttributes(); if($attributes) { foreach($attributes as $attribute) { @@ -335,15 +344,22 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "
"; - print "
"; print "\n\n"; print "\n"; - print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n"; print "\n"; @@ -763,23 +778,33 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { $file_exists=file_exists($dms->contentDir . $version->getPath()); print "\n"; - print "\n"; - print "\n"; print ""; print ""; print "\n\n"; } @@ -843,18 +875,19 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { $responsibleUser = $file->getUser(); print ""; - print ""; print "\n"; print "\n"; print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n\n\n"; @@ -909,9 +942,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print ""; print ""; print ""; - print ""; print ""; - print ""; + print ""; print ""; - print ""; + print "
  • getID()."\">".getMLText("delete")."
  • "; + print ""; print ""; } From 7f3afd614ed59360f69b7ad8763371e628417f1f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 19:34:58 +0200 Subject: [PATCH 06/35] new version 1.1.0 --- SeedDMS_Preview/package.xml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/SeedDMS_Preview/package.xml b/SeedDMS_Preview/package.xml index d90d1ccd1..f5e466917 100644 --- a/SeedDMS_Preview/package.xml +++ b/SeedDMS_Preview/package.xml @@ -11,11 +11,11 @@ uwe@steinmann.cx yes - 2012-11-20 - + 2013-04-29 + - 1.0.0 - 1.0.0 + 1.1.0 + 1.1.0 stable @@ -23,7 +23,7 @@ GPL License -initial version +preview image can also be created from a document file (SeedDMS_Core_DocumentFile) @@ -52,6 +52,20 @@ initial version + 2012-11-20 + + + 1.0.0 + 1.0.0 + + + stable + stable + + GPL License + + initial version + From fdb82c7abb6f8687d2d09eb6b6d966d1ec12c848 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 19:52:11 +0200 Subject: [PATCH 07/35] use better icon for version information download --- views/bootstrap/class.ViewDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 90853dc3a..e0c0b4699 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -383,7 +383,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "
  • getVersion()."\">".getMLText("edit_attributes")."
  • "; } - print "
  • ".getMLText("versioning_info")."
  • "; + print "
  • ".getMLText("versioning_info")."
  • "; print ""; echo ""; From 72d04d3059011421c170d30864f2f10b93187e5a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 19:52:41 +0200 Subject: [PATCH 08/35] add entries for 4.3.0 --- CHANGELOG | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index f5baaa13b..b57170b56 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +-------------------------------------------------------------------------------- + Changes in version 4.3.0 +-------------------------------------------------------------------------------- +- lots of clean in user interface +- create preview images for attachted document files + -------------------------------------------------------------------------------- Changes in version 4.2.1 -------------------------------------------------------------------------------- From 4edc498b805fcebbcdf05a2c6f9e195ba838ac6d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 19:54:46 +0200 Subject: [PATCH 09/35] added entry for 4.2.1 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index f5baaa13b..f726e3fa1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Changes in version 4.2.1 -------------------------------------------------------------------------------- - fixing jumploader upload, added missing file for uploading attachments +- various improvements of user interface -------------------------------------------------------------------------------- Changes in version 4.2.0 From b4ab7ace368424c8e066297b04fa2d897d5d5b01 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 19:55:50 +0200 Subject: [PATCH 10/35] better icon for version information download --- views/bootstrap/class.ViewDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index dcbea99fa..7c9d340cd 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -383,7 +383,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "
  • getVersion()."\">".getMLText("edit_attributes")."
  • "; } - print "
  • ".getMLText("versioning_info")."
  • "; + print "
  • ".getMLText("versioning_info")."
  • "; print ""; echo ""; From 034d7d6fd25c68dae1bafd806d45a477131320cf Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 19:56:44 +0200 Subject: [PATCH 11/35] remove entry from 4.3.0 because it was done in 4.2.1 --- CHANGELOG | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 16c463f7e..86a20cbd0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,6 @@ -------------------------------------------------------------------------------- Changes in version 4.3.0 -------------------------------------------------------------------------------- -- lots of clean in user interface - create preview images for attachted document files -------------------------------------------------------------------------------- From cf8a82b48e5572eb7f092fe9cca1cd8ab84a1e39 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 07:03:57 +0200 Subject: [PATCH 12/35] fixed typo --- languages/de_DE/lang.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/de_DE/lang.inc b/languages/de_DE/lang.inc index 3dafb849a..6e455eb48 100644 --- a/languages/de_DE/lang.inc +++ b/languages/de_DE/lang.inc @@ -768,7 +768,7 @@ $text = array( 'settings_viewOnlineFileTypes' => "Dateitypen für Online-Ansicht", 'settings_workflowMode_desc' => "Der erweiterte Workflow-Modes erlaubt es eigene Workflows zu erstellen.", 'settings_workflowMode' => "Workflow mode", -'settings_workflowMode_valtraditional' => "traditional", +'settings_workflowMode_valtraditional' => "traditionell", 'settings_workflowMode_valadvanced' => "erweitert", 'settings_zendframework' => "Zend Framework", 'signed_in_as' => "Angemeldet als", From 355900995d7178d905915a40ec3f1d63570d70cc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 08:01:17 +0200 Subject: [PATCH 13/35] fix error when adding individual approver --- SeedDMS_Core/Core/inc.ClassDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 65d36b083..87bdffdf1 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -2640,7 +2640,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ } } - if ( $indstatus || (isset($indstatus["status"]) && $indstatus["status"]!=-2)) { + if ( !$indstatus || (isset($indstatus["status"]) && $indstatus["status"]!=-2)) { // Add the user into the approvers database. $queryStr = "INSERT INTO `tblDocumentApprovers` (`documentID`, `version`, `type`, `required`) ". "VALUES ('". $this->_document->getID() ."', '". $this->_version ."', '0', '". $userID ."')"; From de59086fcab9b3b70846a6e65f4ce0540410116f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 08:01:49 +0200 Subject: [PATCH 14/35] add entry for fixed bug (when adding individual approver) --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index f726e3fa1..4ccbc3586 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ -------------------------------------------------------------------------------- - fixing jumploader upload, added missing file for uploading attachments - various improvements of user interface +- fixed bug when adding individual approver (Core) -------------------------------------------------------------------------------- Changes in version 4.2.0 From 17ea9bd88c711b8cd78f275f31848789684de1e4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 08:02:28 +0200 Subject: [PATCH 15/35] new version 4.2.1 --- SeedDMS_Core/package.xml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml index 818489229..ef7e456b5 100644 --- a/SeedDMS_Core/package.xml +++ b/SeedDMS_Core/package.xml @@ -12,11 +12,11 @@ uwe@steinmann.cx yes - 2013-04-22 - + 2013-04-30 + - 4.2.0 - 4.2.0 + 4.2.1 + 4.2.1 stable @@ -24,7 +24,7 @@ GPL License -- added method SeedDMS_Core_DMS::filterDocumentLinks() +- fixed bug in SeedDMS_Core_DocumentContent::addIndApp() @@ -497,5 +497,21 @@ New release - stay in sync with seeddms application + + 2013-04-22 + + + 4.2.0 + 4.2.0 + + + stable + stable + + GPL License + +- fixed bug in SeedDMS_Core_DocumentContent::addIndApp() + + From 025e88d5afcc89aef5ebdd0d181215eb122b107c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 08:02:53 +0200 Subject: [PATCH 16/35] add icon for setting approver/reviewer --- views/bootstrap/class.ViewDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 7c9d340cd..49448d88a 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -364,7 +364,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { if($workflowmode == 'traditional') { // Allow changing reviewers/approvals only if not reviewed if($accessop->maySetReviewersApprovers()) { - print "
  • ".getMLText("change_assignments")."
  • "; + print "
  • ".getMLText("change_assignments")."
  • "; } } else { if($accessop->maySetWorkflow()) { From f7a5daa8a0cbf7f9747aec108d76867ea5d05091 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 08:36:02 +0200 Subject: [PATCH 17/35] use same date format in getReadableDate() and getLongReadableDate() --- inc/inc.Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index 56151ac56..9dd41b107 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -27,7 +27,7 @@ function formatted_size($size_bytes) { /* {{{ */ } /* }}} */ function getReadableDate($timestamp) { - return date("d.m.Y", $timestamp); + return date("d/m/Y", $timestamp); } function getLongReadableDate($timestamp) { From 1ef343903cae5ed9d06e4b2ad84f2a3ecc7e73a0 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 08:36:53 +0200 Subject: [PATCH 18/35] show expiration date; show login on review/approval page --- views/bootstrap/class.ViewDocument.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 49448d88a..31b1e8614 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -213,6 +213,14 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
    expires()) { +?> + + + + +getKeywords()) { ?> @@ -463,7 +471,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { $reqName = getMLText("unknown_user")." '".$r["required"]."'"; } else { - $reqName = htmlspecialchars($required->getFullName()); + $reqName = htmlspecialchars($required->getFullName()." (".$required->getLogin().")"); } if($r["required"] == $user->getId()) $is_reviewer = true; @@ -485,7 +493,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print ""; + print "
  • ".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()." (".$updateUser->getLogin().")") : "unknown user id '".$r["userID"]."'")."
  • "; print "\n"; print "\n"; print ""; + print "
  • ".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()." (".$updateUser->getLogin().")") : "unknown user id '".$a["userID"]."'")."
  • "; print "\n"; print "\n"; print " + + + + getAccessMode($user) > M_READ) { print ""; From 4e27d0ce6bbff43679a24f6551de2ed8770f30bc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 17:03:39 +0200 Subject: [PATCH 21/35] expiration date is sepearated by '-' instead of '/' --- op/op.UpdateDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op/op.UpdateDocument.php b/op/op.UpdateDocument.php index cb6f6887a..e028bf4f3 100644 --- a/op/op.UpdateDocument.php +++ b/op/op.UpdateDocument.php @@ -220,7 +220,7 @@ if ($_FILES['userfile']['error'] == 0) { $expires = false; if ($_POST["expires"] != "false") { if($_POST["expdate"]) { - $tmp = explode('/', $_POST["expdate"]); + $tmp = explode('-', $_POST["expdate"]); $expires = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]); } else { $expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]); From 19061c5c2beeceb6e52e418508839489f79d5237 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 17:14:21 +0200 Subject: [PATCH 22/35] set expiration date if set --- op/op.AddDocument.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index 2e3517e1d..147010889 100644 --- a/op/op.AddDocument.php +++ b/op/op.AddDocument.php @@ -76,7 +76,15 @@ if (!is_numeric($sequence)) { UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("invalid_sequence")); } -$expires = (isset($_POST["expires"]) && $_POST["expires"] == "true") ? mktime(0,0,0, intval($_POST["expmonth"]), intval($_POST["expday"]), intval($_POST["expyear"])) : false; +$expires = false; +if ($_POST["expires"] != "false") { + if($_POST["expdate"]) { + $tmp = explode('-', $_POST["expdate"]); + $expires = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]); + } else { + $expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]); + } +} // Get the list of reviewers and approvers for this document. $reviewers = array(); From 9400a962a8b17157ffa429726db3bbf0b02f8701 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 17:23:24 +0200 Subject: [PATCH 23/35] maySetExpires() doesn't check if version modification is enabled this makes no sense because a expiration date can only be set for a document and not for the version --- inc/inc.ClassAccessOperation.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/inc/inc.ClassAccessOperation.php b/inc/inc.ClassAccessOperation.php index 434066bec..2c7502357 100644 --- a/inc/inc.ClassAccessOperation.php +++ b/inc/inc.ClassAccessOperation.php @@ -129,16 +129,13 @@ class SeedDMS_AccessOperation { * Check if expiration date may be set * * This check can only be done for documents. Setting the documents - * expiration date is only allowed if version modification is turned on in - * the settings and the document has not been obsoleted. - * The admin may set the expiration date even if is - * disallowed in the settings. + * expiration date is only allowed if the document has not been obsoleted. */ function maySetExpires() { /* {{{ */ if(get_class($this->obj) == 'SeedDMS_Core_Document') { $latestContent = $this->obj->getLatestContent(); $status = $latestContent->getStatus(); - if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && ($status["status"]!=S_OBSOLETE)) { + if ((($this->obj->getAccessMode($this->user) == M_ALL) || $this->user->isAdmin()) && ($status["status"]!=S_OBSOLETE)) { return true; } } From f2a37f3e0e774d1149938a70e54cf965881c18f7 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 17:24:45 +0200 Subject: [PATCH 24/35] remove link on current version for setting the expiration date the expiration date can only be set for the document --- views/bootstrap/class.ViewDocument.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 6d1588c85..e1057ad9a 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -381,9 +381,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { } } } + /* if($accessop->maySetExpires()) { print "
  • ".getMLText("set_expiry")."
  • "; } + */ if($accessop->mayEditComment()) { print "
  • getVersion()."\">".getMLText("edit_comment")."
  • "; } From 4d53a894351be899ccc75978ca48543f08ea8356 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 17:26:54 +0200 Subject: [PATCH 25/35] fix phrase for selecting a category --- views/bootstrap/class.EditDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.EditDocument.php b/views/bootstrap/class.EditDocument.php index aaec2b129..25dc7d78f 100644 --- a/views/bootstrap/class.EditDocument.php +++ b/views/bootstrap/class.EditDocument.php @@ -94,7 +94,7 @@ function checkForm()
    "; print "
    ".getMLText("version")."".getMLText("file")."".getMLText("file")."".getMLText("comment")."".getMLText("status")."
      "; + print "
    "; + /* + print ""; + */ + if ($viewonlinefiletypes && in_array(strtolower($version->getFileType()), $viewonlinefiletypes)) + print "getVersion()."\">"; + else + print "getVersion()."\">"; $previewer->createPreview($version); if($previewer->hasPreview($version)) { print("getID()."&version=".$version->getVersion()."&width=100\" title=\"".htmlspecialchars($version->getMimeType())."\">"); + } else { + print "getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; } + print "\n"; print "".$version->getVersion()."
      \n"; print "
    • ".$version->getOriginalFileName()."
    • \n"; - if ($file_exists) print "
    • ". SeedDMS_Core_File::format_filesize($version->getFileSize()) ." ".htmlspecialchars($version->getMimeType())."
    • "; + print "
    • ".getMLText('version').": ".$version->getVersion()."
    • \n"; + if ($file_exists) print "
    • ". SeedDMS_Core_File::format_filesize($version->getFileSize()) .", ".htmlspecialchars($version->getMimeType())."
    • "; else print "
    • ".getMLText("document_deleted")."
    • "; $updatingUser = $version->getUser(); print "
    • ".getMLText("uploaded_by")." getEmail()."\">".htmlspecialchars($updatingUser->getFullName())."
    • "; @@ -797,20 +822,27 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "
    ".htmlspecialchars($version->getComment())."".getOverallStatusText($vstat["status"]).""; - print "
      "; + print "
      \n"; - print "
    • ".$file->getOriginalFileName() ."
    • \n"; + print "
    • ".htmlspecialchars($file->getName())."
    • \n"; + print "
    • ".htmlspecialchars($file->getOriginalFileName())."
    • \n"; if ($file_exists) - print "
    • ". filesize($dms->contentDir . $file->getPath()) ." bytes ".htmlspecialchars($file->getMimeType())."
    • "; + print "
    • ".SeedDMS_Core_File::format_filesize(filesize($dms->contentDir . $file->getPath())) ." bytes, ".htmlspecialchars($file->getMimeType())."
    • "; else print "
    • ".htmlspecialchars($file->getMimeType())." - ".getMLText("document_deleted")."
    • "; print "
    • ".getMLText("uploaded_by")." getEmail()."\">".htmlspecialchars($responsibleUser->getFullName())."
    • "; @@ -890,7 +923,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "
    ".getMLText("comment")."".getMLText("document_link_by")."
    getID()."\" class=\"linklist\">".htmlspecialchars($targetDoc->getName())."".htmlspecialchars($targetDoc->getComment())."".htmlspecialchars($responsibleUser->getFullName()); + print "".getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName()); if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL )) - print ", ".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no")); + print "
    ".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no")); print "
    "; if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL )) From ecc800fc24c7b52e0fc5aaa1c1213c33afab95f2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 18:22:47 +0200 Subject: [PATCH 02/35] add border around preview images --- styles/bootstrap/application.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/styles/bootstrap/application.css b/styles/bootstrap/application.css index fcbd6ba52..d3a0df5be 100644 --- a/styles/bootstrap/application.css +++ b/styles/bootstrap/application.css @@ -2,6 +2,14 @@ body { /* Add top padding for full-width layout */ padding-top: 60px; } img.mimeicon { + -moz-border-bottom-colors: none; + -moz-border-image: none; + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + border-color: #CCCCCC #AAAAAA #999999 #CCCCCC; + border-style: solid; + border-width: 1px 2px 2px 1px; } .list-action a { From 9f7b665c4820b2a1b9a8b4c9f0f056918e7de02d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 19:30:25 +0200 Subject: [PATCH 03/35] create preview from document files as well a preview image can now be created from a document content or a document file. --- SeedDMS_Preview/Preview/Previewer.php | 58 ++++++++++++++++++--------- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/SeedDMS_Preview/Preview/Previewer.php b/SeedDMS_Preview/Preview/Previewer.php index 9b7e86d67..9f5aaf2f6 100644 --- a/SeedDMS_Preview/Preview/Previewer.php +++ b/SeedDMS_Preview/Preview/Previewer.php @@ -50,27 +50,50 @@ class SeedDMS_Preview_Previewer { $this->width = intval($width); } - function createPreview($documentcontent, $width=0) { /* {{{ */ + /** + * Retrieve the physical filename of the preview image on disk + * + * @param object $object document content or document file + * @param integer $width width of preview image + * @return string file name of preview image + */ + protected function getFileName($object, $width) { /* }}} */ + $document = $object->getDocument(); + $dir = $this->previewDir.'/'.$document->getDir(); + switch(get_class($object)) { + case "SeedDMS_Core_DocumentContent": + $target = $dir.'p'.$object->getVersion().'-'.$width.'.png'; + break; + case "SeedDMS_Core_DocumentFile": + $target = $dir.'f'.$object->getID().'-'.$width.'.png'; + break; + default: + return false; + } + return $target; + } /* }}} */ + + public function createPreview($object, $width=0) { /* {{{ */ if($width == 0) $width = $this->width; else $width = intval($width); if(!$this->previewDir) return false; - $document = $documentcontent->getDocument(); + $document = $object->getDocument(); $dir = $this->previewDir.'/'.$document->getDir(); if(!is_dir($dir)) { if (!SeedDMS_Core_File::makeDir($dir)) { return false; } } - $file = $document->_dms->contentDir.$documentcontent->getPath(); + $file = $document->_dms->contentDir.$object->getPath(); if(!file_exists($file)) return false; - $target = $dir.'p'.$documentcontent->getVersion().'-'.$width.'.png'; - if(!file_exists($target)) { + $target = $this->getFileName($object, $width); + if($target !== false && !file_exists($target)) { $cmd = ''; - switch($documentcontent->getMimeType()) { + switch($object->getMimeType()) { case "image/png": case "image/gif": case "image/jpeg": @@ -89,46 +112,43 @@ class SeedDMS_Preview_Previewer { } /* }}} */ - function hasPreview($documentcontent, $width=0) { /* {{{ */ + public function hasPreview($object, $width=0) { /* {{{ */ if($width == 0) $width = $this->width; else $width = intval($width); if(!$this->previewDir) return false; - $document = $documentcontent->getDocument(); - $dir = $this->previewDir.'/'.$document->getDir(); - $target = $dir.'p'.$documentcontent->getVersion().'-'.$width.'.png'; - if(file_exists($target)) { + $target = $this->getFileName($object, $width); + if($target && file_exists($target)) { return true; } return false; } /* }}} */ - function getPreview($documentcontent, $width=0) { /* {{{ */ + public function getPreview($object, $width=0) { /* {{{ */ if($width == 0) $width = $this->width; else $width = intval($width); if(!$this->previewDir) return false; - $document = $documentcontent->getDocument(); - $dir = $this->previewDir.'/'.$document->getDir(); - $target = $dir.'p'.$documentcontent->getVersion().'-'.$width.'.png'; - if(file_exists($target)) { + + $target = $this->getFileName($object, $width); + if($target && file_exists($target)) { readfile($target); } } /* }}} */ - function deletePreview($document, $documentcontent) { /* {{{ */ + public function deletePreview($document, $object, $width=0) { /* {{{ */ if($width == 0) $width = $this->width; else $width = intval($width); if(!$this->previewDir) return false; - $dir = $this->previewDir.'/'.$document->getDir(); - $target = $dir.'p'.$documentcontent->getVersion().'-'.$width.'.png'; + + $target = $this->getFileName($object, $width); } /* }}} */ } ?> From c3eb4d629cb31e782ef50391e3b8f30e91bdca87 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 19:32:00 +0200 Subject: [PATCH 04/35] create preview from document file too pass url parameter 'file' instead of 'version' --- op/op.Preview.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/op/op.Preview.php b/op/op.Preview.php index 8ae43c7f0..aa50245e8 100644 --- a/op/op.Preview.php +++ b/op/op.Preview.php @@ -46,18 +46,26 @@ if ($document->getAccessMode($user) < M_READ) { exit; } -$version = $_GET["version"]; -if (!isset($version) || !is_numeric($version) || intval($version)<1) { +if(isset($_GET['version'])) { + $version = $_GET["version"]; + if (!is_numeric($version) || intval($version)<1) + exit; + $object = $document->getContentByVersion($version); +} elseif(isset($_GET['file'])) { + $file = $_GET['file']; + if (!is_numeric($file) || intval($file)<1) + exit; + $object = $document->getDocumentFile($file); +} else { exit; } -$content = $document->getContentByVersion($version); -if (!is_object($content)) { +if (!is_object($object)) { exit; } $previewer = new SeedDMS_Preview_Previewer($settings->_cacheDir, $_GET["width"]); header('Content-Type: image/png'); -$previewer->getPreview($content); +$previewer->getPreview($object); ?> From 1f4dde6b59cd2acc2e239739272f44c492f997b4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 29 Apr 2013 19:32:55 +0200 Subject: [PATCH 05/35] show preview of document files too --- views/bootstrap/class.ViewDocument.php | 32 ++++++++++++++++++-------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index dcbea99fa..90853dc3a 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -875,13 +875,19 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { $responsibleUser = $file->getUser(); print "
    "; + $previewer->createPreview($file); + if ($viewonlinefiletypes && in_array(strtolower($file->getFileType()), $viewonlinefiletypes)) + print "getID()."\">"; + else + print "getID()."\">"; + if($previewer->hasPreview($file)) { + print("getID()."&file=".$file->getID()."&width=100\" title=\"".htmlspecialchars($file->getMimeType())."\">"); + } else { + print "getMimeIcon($file->getFileType())."\" title=\"".htmlspecialchars($file->getMimeType())."\">"; + } + print ""; + print "
      \n"; print "
    • ".htmlspecialchars($file->getName())."
    • \n"; @@ -895,10 +901,16 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "
    ".htmlspecialchars($file->getComment()).""; + print "
      "; if (($document->getAccessMode($user) == M_ALL)||($file->getUserID()==$user->getID())) - print "
      getID()."\" />
      "; - print "
    getDate()); ?>
    :getExpires()); ?>
    • ".$r["date"]."
    • "; /* $updateUser is the user who has done the review */ $updateUser = $dms->getUser($r["userID"]); - print "
    • ".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()) : "unknown user id '".$r["userID"]."'")."
    ".htmlspecialchars($r["comment"])."".getReviewStatusText($r["status"])."
      "; @@ -527,7 +535,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { $reqName = getMLText("unknown_user")." '".$a["required"]."'"; } else { - $reqName = htmlspecialchars($required->getFullName()); + $reqName = htmlspecialchars($required->getFullName()." (".$required->getLogin().")"); } if($a["required"] == $user->getId()) $is_approver = true; @@ -549,7 +557,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "
    • ".$a["date"]."
    • "; /* $updateUser is the user who has done the approval */ $updateUser = $dms->getUser($a["userID"]); - print "
    • ".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()) : "unknown user id '".$a["userID"]."'")."
    ".htmlspecialchars($a["comment"])."".getApprovalStatusText($a["status"])."
      "; From 5213e057b379ea3c734c3bf25d47159bf4850fbc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 08:40:14 +0200 Subject: [PATCH 19/35] add style for preview images --- styles/bootstrap/application.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/styles/bootstrap/application.css b/styles/bootstrap/application.css index fcbd6ba52..d3a0df5be 100644 --- a/styles/bootstrap/application.css +++ b/styles/bootstrap/application.css @@ -2,6 +2,14 @@ body { /* Add top padding for full-width layout */ padding-top: 60px; } img.mimeicon { + -moz-border-bottom-colors: none; + -moz-border-image: none; + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + border-color: #CCCCCC #AAAAAA #999999 #CCCCCC; + border-style: solid; + border-width: 1px 2px 2px 1px; } .list-action a { From 058c5f2749dfd6114da4b80bfbd4da6a2d0d9e33 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 17:02:03 +0200 Subject: [PATCH 20/35] expiration date of document can be set --- op/op.EditDocument.php | 35 ++++++++++++++++++++++++++ views/bootstrap/class.EditDocument.php | 12 +++++++++ 2 files changed, 47 insertions(+) diff --git a/op/op.EditDocument.php b/op/op.EditDocument.php index fb961229c..aee70d04c 100644 --- a/op/op.EditDocument.php +++ b/op/op.EditDocument.php @@ -161,6 +161,41 @@ if (($oldcomment = $document->getComment()) != $comment) { } } +$expires = false; +if ($_POST["expires"] != "false") { + if($_POST["expdate"]) { + $tmp = explode('-', $_POST["expdate"]); + $expires = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]); + } else { + $expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]); + } +} + +if ($expires) { + if($document->setExpires($expires)) { + if($notifier) { + $notifyList = $document->getNotifyList(); + $folder = $document->getFolder(); + // Send notification to subscribers. + $subject = "expiry_changed_email_subject"; + $message = "expiry_changed_email_body"; + $params = array(); + $params['name'] = $document->getName(); + $params['folder_path'] = $folder->getFolderPathPlain(); + $params['username'] = $user->getFullName(); + $params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID(); + $params['sitename'] = $settings->_siteName; + $params['http_root'] = $settings->_httpRoot; + $notifier->toList($user, $notifyList["users"], $subject, $message, $params); + foreach ($notifyList["groups"] as $grp) { + $notifier->toGroup($user, $grp, $subject, $message, $params); + } + } + } else { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured")); + } +} + if (($oldkeywords = $document->getKeywords()) != $keywords) { if($document->setKeywords($keywords)) { } diff --git a/views/bootstrap/class.EditDocument.php b/views/bootstrap/class.EditDocument.php index aaec2b129..498280cfd 100644 --- a/views/bootstrap/class.EditDocument.php +++ b/views/bootstrap/class.EditDocument.php @@ -107,6 +107,18 @@ function checkForm()
    : + + + +   + +
    : - getDocumentCategories(); foreach($categories as $category) { From 26ae06b1ef1cdc434347813e8e098fdff367f329 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 17:41:32 +0200 Subject: [PATCH 26/35] set expiration date to currently set value --- views/bootstrap/class.EditDocument.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.EditDocument.php b/views/bootstrap/class.EditDocument.php index 1b616a5e8..c4611db44 100644 --- a/views/bootstrap/class.EditDocument.php +++ b/views/bootstrap/class.EditDocument.php @@ -71,6 +71,11 @@ function checkForm() contentHeading(getMLText("edit_document_props")); $this->contentContainerStart(); + + if($document->expires()) + $expdate = date('d-m-Y', $document->getExpires()); + else + $expdate = ''; ?>
    @@ -111,7 +116,7 @@ function checkForm()
    : - +  
    getID()."&version=".$targetlc->getVersion()."\">"; if($previewer->hasPreview($targetlc)) { From d4e8bedfbc3f7ecf56e0c26cf09ef9ae44533f73 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 18:38:56 +0200 Subject: [PATCH 34/35] add entry for new handling of document expiration --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 2ca1bb0bc..685db0bdb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,9 @@ Changes in version 4.3.0 -------------------------------------------------------------------------------- - create preview images for attachted document files +- expiration date cannot be set for the version as indicated by the gui. + I was always set for the document, but this was not clear from the + gui. -------------------------------------------------------------------------------- Changes in version 4.2.1 From 7fa2ba6bcc643b252312802bb6f1c9d4375c1989 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Apr 2013 18:43:19 +0200 Subject: [PATCH 35/35] shorten some menu entries to make the menu fit into one line --- languages/de_DE/lang.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages/de_DE/lang.inc b/languages/de_DE/lang.inc index 6e455eb48..8b89b56d9 100644 --- a/languages/de_DE/lang.inc +++ b/languages/de_DE/lang.inc @@ -234,7 +234,7 @@ $text = array( 'edit_existing_notify' => "Benachrichtigungen bearbeiten", 'edit_folder_access' => "Zugriffsrechte bearbeiten", 'edit_folder_notify' => "Ordner Benachrichtigungen bearbeiten", -'edit_folder_props' => "Ordner bearbeiten", +'edit_folder_props' => "Bearbeiten", 'edit_group' => "Gruppe bearbeiten", 'edit_user_details' => "Benutzerdetails bearbeiten", 'edit_user' => "Benutzer bearbeiten", @@ -395,7 +395,7 @@ $text = array( 'month_view' => "Monatsansicht", 'monthly' => "monatlich", 'move_document' => "Verschieben", -'move_folder' => "Ordner verschieben", +'move_folder' => "Verschieben", 'move' => "Verschieben", 'my_account' => "Mein Profil", 'my_documents' => "Meine Dokumente", @@ -511,7 +511,7 @@ $text = array( 'rm_document' => "Löschen", 'rm_document_category' => "Lösche Kategorie", 'rm_file' => "Datei Löschen", -'rm_folder' => "Ordner löschen", +'rm_folder' => "Löschen", 'rm_from_clipboard' => "Aus Zwischenablage löschen", 'rm_group' => "Diese Gruppe löschen", 'rm_user' => "Diesen Benutzer löschen",