diff --git a/CHANGELOG b/CHANGELOG index f5baaa13b..685db0bdb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,17 @@ +-------------------------------------------------------------------------------- + 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 -------------------------------------------------------------------------------- - 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 diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 65d36b083..bd6a4babf 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -523,10 +523,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ * set to S_EXPIRED but the document isn't actually expired. * The method will update the document status log database table * if needed. - * FIXME: Why does it not set a document to S_EXPIRED if it is - * currently in state S_RELEASED * FIXME: some left over reviewers/approvers are in the way if - * no workflow is set an traditional workflow mode is on. In that + * no workflow is set and traditional workflow mode is on. In that * case the status is set to S_DRAFT_REV or S_DRAFT_APP * * @return boolean true if status has changed @@ -536,7 +534,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ if($lc) { $st=$lc->getStatus(); - if (($st["status"]==S_DRAFT_REV || $st["status"]==S_DRAFT_APP || $st["status"]==S_IN_WORKFLOW) && $this->hasExpired()){ + if (($st["status"]==S_DRAFT_REV || $st["status"]==S_DRAFT_APP || $st["status"]==S_IN_WORKFLOW || $st["status"]==S_RELEASED) && $this->hasExpired()){ return $lc->setStatus(S_EXPIRED,"", $this->getOwner()); } elseif ($st["status"]==S_EXPIRED && !$this->hasExpired() ){ @@ -2640,7 +2638,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 ."')"; 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() + + 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); } /* }}} */ } ?> 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 + 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; } } 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) { diff --git a/languages/de_DE/lang.inc b/languages/de_DE/lang.inc index 3dafb849a..1c9807ec8 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", @@ -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", @@ -827,7 +827,7 @@ $text = array( 'update_info' => "Informationen zur Aktualisierung", 'update_locked_msg' => "Dieses Dokument wurde gesperrt

Die Sperrung wurde von [username] eingerichtet.
", 'update_reviewers' => "Liste der Prüfer aktualisieren", -'update' => "aktualisieren", +'update' => "Aktualisieren", 'uploaded_by' => "Hochgeladen durch", 'uploading_failed' => "Das Hochladen einer Datei ist fehlgeschlagen. Bitte überprüfen Sie die maximale Dateigröße für Uploads.", 'uploading_zerosize' => "Versuch eine leere Datei hochzuladen. Vorgang wird abgebrochen.", diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index 2e3517e1d..fbe743974 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 (!isset($_POST['expires']) || $_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(); 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/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); ?> diff --git a/op/op.UpdateDocument.php b/op/op.UpdateDocument.php index cb6f6887a..dcfa92ad0 100644 --- a/op/op.UpdateDocument.php +++ b/op/op.UpdateDocument.php @@ -218,9 +218,9 @@ if ($_FILES['userfile']['error'] == 0) { } $expires = false; - if ($_POST["expires"] != "false") { + if (!isset($_POST['expires']) || $_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"]); diff --git a/styles/bootstrap/application.css b/styles/bootstrap/application.css index f9675e25e..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 { @@ -16,6 +24,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.EditDocument.php b/views/bootstrap/class.EditDocument.php index aaec2b129..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 = ''; ?>

@@ -94,7 +99,7 @@ function checkForm() : - getDocumentCategories(); foreach($categories as $category) { @@ -107,6 +112,18 @@ function checkForm() + + : + + + + +   + + + getAccessMode($user) > M_READ) { print ""; diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 0f2cc7315..918dd8be2 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -122,6 +122,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { if($needwkflaction) { $this->infoMsg(getMLText('needs_workflow_action')); } + + $status = $latestContent->getStatus(); + $reviewStatus = $latestContent->getReviewStatus(); + $approvalStatus = $latestContent->getApprovalStatus(); + ?>