Merge branch 'seeddms-4.3.6' into develop

Conflicts:
	Makefile
This commit is contained in:
Uwe Steinmann 2014-03-18 16:55:06 +01:00
commit c1f5a31f13
36 changed files with 291 additions and 70 deletions

View File

@ -1,3 +1,16 @@
--------------------------------------------------------------------------------
Changes in version 4.3.6
--------------------------------------------------------------------------------
- fix mandatory reviewer/approver, if it is the owner or an administrator
- fix wrong sort order in second level of folder tree
- add missing translation (Bug #130)
- update of russion translation (Bug #131)
- turn off http only cookies if large file upload is turned on (Bug #132)
- list documents having a link to the current document
- preview image sizes can be set in configuration (Bug #124)
- show missing link to document in list of approvals
- update of document version detail page
--------------------------------------------------------------------------------
Changes in version 4.3.5
--------------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
VERSION=4.3.5
VERSION=4.3.6
SRC=CHANGELOG inc conf utils index.php languages views op out controllers README.md README.Notification README.Ubuntu drop-tables-innodb.sql styles js TODO LICENSE Makefile webdav install restapi
# webapp

View File

@ -243,7 +243,7 @@ class SeedDMS_Core_DMS {
$this->convertFileTypes = array();
$this->version = '@package_version@';
if($this->version[0] == '@')
$this->version = '4.3.5';
$this->version = '4.3.6';
} /* }}} */
function getDB() { /* {{{ */

View File

@ -1433,17 +1433,30 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
/**
* Return all document links
*
* The list contains all links to other documents, even those which
* may not be visible certain users. The application should call
* The list may contain all links to other documents, even those which
* may not be visible by certain users, unless you pass appropriate
* parameters to filter out public links and those created by
* the given user. The application may call
* SeedDMS_Core_DMS::filterDocumentLinks() afterwards.
*
* @param boolean $publiconly return on publically visible links
* @param object $user return also private links of this user
* @return array list of objects of class SeedDMS_Core_DocumentLink
*/
function getDocumentLinks() { /* {{{ */
function getDocumentLinks($publiconly=false, $user=null) { /* {{{ */
if (!isset($this->_documentLinks)) {
$db = $this->_dms->getDB();
$queryStr = "SELECT * FROM tblDocumentLinks WHERE document = " . $this->_id;
$tmp = array();
if($publiconly)
$tmp[] = "public=1";
if($user)
$tmp[] = "userID=".$user->getID();
if($tmp) {
$queryStr .= " AND (".implode(" OR ", $tmp).")";
}
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
@ -1457,6 +1470,50 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
return $this->_documentLinks;
} /* }}} */
/**
* Return all document having a link on this document
*
* The list contains all documents which have a link to the current
* document. The list contains even those documents which
* may not be accessible by the user, unless you pass appropriate
* parameters to filter out public links and those created by
* the given user.
* This functions is basically the reverse of
* SeedDMS_Core_Document::getDocumentLinks()
*
* The application may call
* SeedDMS_Core_DMS::filterDocumentLinks() afterwards.
*
* @param boolean $publiconly return on publically visible links
* @param object $user return also private links of this user
* @return array list of objects of class SeedDMS_Core_DocumentLink
*/
function getReverseDocumentLinks($publiconly=false, $user=null) { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT * FROM tblDocumentLinks WHERE target = " . $this->_id;
$tmp = array();
if($publiconly)
$tmp[] = "public=1";
if($user)
$tmp[] = "userID=".$user->getID();
if($tmp) {
$queryStr .= " AND (".implode(" OR ", $tmp).")";
}
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
$links = array();
foreach ($resArr as $row) {
$document = $this->_dms->getDocument($row["document"]);
array_push($links, new SeedDMS_Core_DocumentLink($row["id"], $document, $this, $row["userID"], $row["public"]));
}
return $links;
} /* }}} */
function addDocumentLink($targetID, $userID, $public) { /* {{{ */
$db = $this->_dms->getDB();
@ -1672,6 +1729,9 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
/**
* Get List of users and groups which have read access on the document
* The list will not include any guest users,
* administrators and the owner of the folder unless $listadmin resp.
* $listowner is set to true.
*
* This function is deprecated. Use
* {@see SeedDMS_Core_Document::getReadAccessList()} instead.

View File

@ -1302,6 +1302,9 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
/**
* Returns a list of groups and users with read access on the folder
* The list will not include any guest users,
* administrators and the owner of the folder unless $listadmin resp.
* $listowner is set to true.
*
* @param boolean $listadmin if set to true any admin will be listed too
* @param boolean $listowner if set to true the owner will be listed too

View File

@ -12,11 +12,11 @@
<email>uwe@steinmann.cx</email>
<active>yes</active>
</lead>
<date>2014-03-04</date>
<date>2014-03-18</date>
<time>16:19:34</time>
<version>
<release>4.3.5</release>
<api>4.3.5</api>
<release>4.3.6</release>
<api>4.3.6</api>
</version>
<stability>
<release>stable</release>
@ -24,7 +24,8 @@
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
no changes
- add optional parameters $publiconly=false and $user=null to SeedDMS_Core_Document::getDocumentLinks()
- add new method SeedDMS_Core_Document::getReverseDocumentLinks()
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">
@ -618,5 +619,21 @@ New release
- fix handling of multivalue attributes
</notes>
</release>
<release>
<date>2014-03-04</date>
<time>16:19:34</time>
<version>
<release>4.3.5</release>
<api>4.3.5</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
no changes
</notes>
<release>
</changelog>
</package>

View File

@ -98,13 +98,22 @@ class SeedDMS_Preview_Previewer {
case "image/gif":
case "image/jpeg":
case "image/jpg":
case "image/svg+xml":
$cmd = 'convert -resize '.$width.'x'.$width.' '.$file.' '.$target;
break;
case "application/pdf":
case "application/postscript":
$cmd = 'convert -density 18 -resize '.$width.'x'.$width.' '.$file.'[0] '.$target;
break;
case "text/plain":
$cmd = 'convert -resize '.$width.'x'.$width.' '.$file.'[0] '.$target;
break;
case "application/x-compressed-tar":
$cmd = 'tar tzvf '.$file.' | convert -resize '.$width.'x'.$width.' text:-[0] '.$target;
break;
}
if($cmd) {
system( $cmd);
exec($cmd);
}
return true;
}

View File

@ -11,10 +11,10 @@
<email>uwe@steinmann.cx</email>
<active>yes</active>
</lead>
<date>2013-04-29</date>
<time>19:34:07</time>
<date>2014-03-18</date>
<time>16:34:59</time>
<version>
<release>1.1.0</release>
<release>1.1.1</release>
<api>1.1.0</api>
</version>
<stability>
@ -23,7 +23,7 @@
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
preview image can also be created from a document file (SeedDMS_Core_DocumentFile)
add converters for .tar.gz, .ps, .txt
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">
@ -67,5 +67,21 @@ preview image can also be created from a document file (SeedDMS_Core_DocumentFil
initial version
</notes>
</release>
<release>
<date>2013-04-29</date>
<time>19:34:07</time>
<version>
<release>1.1.0</release>
<api>1.1.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
preview image can also be created from a document file (SeedDMS_Core_DocumentFile)
</notes>
</release>
</changelog>
</package>

View File

@ -97,6 +97,7 @@ if (!$user->isAdmin()) {
/* Update cookie lifetime */
if($settings->_cookieLifetime) {
$lifetime = time() + intval($settings->_cookieLifetime);
setcookie("mydms_session", $dms_session, $lifetime, $settings->_httpRoot, null, null, true);
/* Turn off http only cookies if jumploader is enabled */
setcookie("mydms_session", $dms_session, $lifetime, $settings->_httpRoot, null, null, !$settings->_enableLargeFileUpload);
}
?>

View File

@ -168,6 +168,10 @@ class Settings { /* {{{ */
var $_adminIP = "";
// Max Execution Time
var $_maxExecutionTime = null;
// Preview image width in lists
var $_previewWidthList = 40;
// Preview image width on document details page
var $_previewWidthDetail = 100;
// Extra Path to additional software, will be added to include path
var $_extraPath = null;
// DB-Driver used by adodb (see adodb-readme)
@ -310,6 +314,8 @@ class Settings { /* {{{ */
$this->_printDisclaimer = Settings::boolVal($tab["printDisclaimer"]);
$this->_language = strval($tab["language"]);
$this->_theme = strval($tab["theme"]);
$this->_previewWidthList = intval($tab["previewWidthList"]);
$this->_previewWidthDetail = intval($tab["previewWidthDetail"]);
// XML Path: /configuration/site/edition
$node = $xml->xpath('/configuration/site/edition');
@ -583,6 +589,8 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "printDisclaimer", $this->_printDisclaimer);
$this->setXMLAttributValue($node, "language", $this->_language);
$this->setXMLAttributValue($node, "theme", $this->_theme);
$this->setXMLAttributValue($node, "previewWidthList", $this->_previewWidthList);
$this->setXMLAttributValue($node, "previewWidthDetail", $this->_previewWidthDetail);
// XML Path: /configuration/site/edition
$node = $this->getXMLNode($xml, '/configuration/site', 'edition');

View File

@ -20,7 +20,7 @@
class SeedDMS_Version {
var $_number = "4.3.5";
var $_number = "4.3.6";
var $_string = "SeedDMS";
function SeedDMS_Version() {

View File

@ -116,7 +116,7 @@ function fileExistsInIncludePath($file) { /* {{{ */
* Load default settings + set
*/
define("SEEDDMS_INSTALL", "on");
define("SEEDDMS_VERSION", "4.3.5");
define("SEEDDMS_VERSION", "4.3.6");
require_once('../inc/inc.ClassSettings.php');

View File

@ -13,6 +13,8 @@
printDisclaimer="true"
language = "en_GB"
theme = "bootstrap"
previewWidthList = "40"
previewWidthDetail = "100"
>
</display>
<!-- strictFormCheck: Strict form checking. If set to true, then all fields in the form will be checked for a value. If set to false, then (most) comments and keyword fields become optional. Comments are always required when submitting a review or overriding document status.

View File

@ -638,6 +638,7 @@ Elternordner: [folder_path]
Benutzer: [username]
URL: [url]',
'return_from_subworkflow_email_subject' => '[sitename]: [name] - Rückkehr vom Subworkflow',
'reverse_links' => 'Dokumente mit Verknüpfung auf dieses Dokument',
'reviewers' => 'Prüfer',
'reviewer_already_assigned' => 'Prüfer bereits zugewiesen',
'reviewer_already_removed' => 'Prüfer wurde bereits aus dem Prüfvorgang entfernt oder hat die Prüfung bereits abgeschlossen',

View File

@ -142,7 +142,7 @@ if (isset($_POST["grpApprovers"])) {
}
// add mandatory reviewers/approvers
$docAccess = $folder->getReadAccessList();
$docAccess = $folder->getReadAccessList($settings->_enableAdminRevApp, $settings->_enableOwnerRevApp);
$res=$user->getMandatoryReviewers();
foreach ($res as $r){

View File

@ -128,7 +128,7 @@ if( move_uploaded_file( $source_file_path, $target_file_path ) ) {
}
// add mandatory reviewers/approvers
$docAccess = $folder->getReadAccessList();
$docAccess = $folder->getReadAccessList($settings->_enableAdminRevApp, $settings->_enableOwnerRevApp);
$res=$user->getMandatoryReviewers();
foreach ($res as $r){

View File

@ -122,11 +122,15 @@ switch($command) {
$showdocs = false;
else
$showdocs = true;
if(empty($_GET['orderby']))
$orderby = $settings->_sortFoldersDefault;
else
$orderby = $_GET['orderby'];
$folder = $dms->getFolder($nodeid);
if (!is_object($folder)) return '';
$subfolders = $folder->getSubFolders();
$subfolders = $folder->getSubFolders($orderby);
$subfolders = SeedDMS_Core_DMS::filterAccess($subfolders, $user, M_READ);
$tree = array();
foreach($subfolders as $subfolder) {
@ -136,7 +140,7 @@ switch($command) {
$tree[] = $level;
}
if($showdocs) {
$documents = $folder->getDocuments();
$documents = $folder->getDocuments($orderby);
$documents = SeedDMS_Core_DMS::filterAccess($documents, $user, M_READ);
foreach($documents as $document) {
$level = array('label'=>$document->getName(), 'id'=>$document->getID(), 'load_on_demand'=>false, 'is_folder'=>false);

View File

@ -274,7 +274,8 @@ if (isset($_COOKIE["mydms_session"])) {
/* Load session */
$dms_session = $_COOKIE["mydms_session"];
if(!$resArr = $session->load($dms_session)) {
setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot, null, null, true); //delete cookie
/* Turn off http only cookies if jumploader is enabled */
setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot, null, null, !$settings->_enableLargeFileUpload); //delete cookie
header("Location: " . $settings->_httpRoot . "out/out.Login.php?referuri=".$refer);
exit;
} else {
@ -292,7 +293,7 @@ if (isset($_COOKIE["mydms_session"])) {
$lifetime = time() + intval($settings->_cookieLifetime);
else
$lifetime = 0;
setcookie("mydms_session", $id, $lifetime, $settings->_httpRoot, null, null, true);
setcookie("mydms_session", $id, $lifetime, $settings->_httpRoot, null, null, !$settings->_enableLargeFileUpload);
}
// TODO: by the PHP manual: The superglobals $_GET and $_REQUEST are already decoded.

View File

@ -58,6 +58,8 @@ if ($action == "saveSettings")
$settings->_printDisclaimer = getBoolValue("printDisclaimer");
$settings->_language = $_POST["language"];
$settings->_theme = $_POST["theme"];
$settings->_previewWidthList = $_POST["previewWidthList"];
$settings->_previewWidthDetail = $_POST["previewWidthDetail"];
// SETTINGS - SITE - EDITION
$settings->_strictFormCheck = getBoolValue("strictFormCheck");

View File

@ -130,7 +130,7 @@ if ($_FILES['userfile']['error'] == 0) {
}
// add mandatory reviewers/approvers
$docAccess = $folder->getReadAccessList();
$docAccess = $folder->getReadAccessList($settings->_enableAdminRevApp, $settings->_enableOwnerRevApp);
$res=$user->getMandatoryReviewers();
foreach ($res as $r){

View File

@ -110,7 +110,7 @@ if( move_uploaded_file( $source_file_path, $target_file_path ) ) {
}
// add mandatory reviewers/approvers
$docAccess = $folder->getReadAccessList();
$docAccess = $folder->getReadAccessList($settings->_enableAdminRevApp, $settings->_enableOwnerRevApp);
$res=$user->getMandatoryReviewers();
foreach ($res as $r){

View File

@ -64,7 +64,7 @@ if ($latestContent->getVersion()==$version->getVersion()) {
$folder = $document->getFolder();
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'viewonlinefiletypes'=>$settings->_viewOnlineFileTypes, 'enableversionmodification'=>$settings->_enableVersionModification, 'cachedir'=>$settings->_cacheDir));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'viewonlinefiletypes'=>$settings->_viewOnlineFileTypes, 'enableversionmodification'=>$settings->_enableVersionModification, 'previewwidthdetail'=>$settings->_previewWidthDetail, 'cachedir'=>$settings->_cacheDir));
if($view) {
$view->show();
exit;

View File

@ -46,7 +46,7 @@ if (isset($_GET["orderby"]) && strlen($_GET["orderby"])==1 ) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'orderby'=>$orderby, 'showinprocess'=>$showInProcess, 'workflowmode'=>$settings->_workflowMode, 'cachedir'=>$settings->_cacheDir));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'orderby'=>$orderby, 'showinprocess'=>$showInProcess, 'workflowmode'=>$settings->_workflowMode, 'cachedir'=>$settings->_cacheDir, 'previewWidthList'=>$settings->_previewWidthList));
if($view) {
$view->show();
exit;

View File

@ -74,6 +74,8 @@ if($view) {
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
$view->setParam('cachedir', $settings->_cacheDir);
$view->setParam('workflowmode', $settings->_workflowMode);
$view->setParam('previewWidthList', $settings->_previewWidthList);
$view->setParam('previewWidthDetail', $settings->_previewWidthDetail);
$view->show();
exit;
}

View File

@ -68,6 +68,7 @@ if($view) {
$view->setParam('workflowmode', $settings->_workflowMode);
$view->setParam('enableRecursiveCount', $settings->_enableRecursiveCount);
$view->setParam('maxRecursiveCount', $settings->_maxRecursiveCount);
$view->setParam('previewWidthList', $settings->_previewWidthList);
$view->show();
exit;
}

View File

@ -35,7 +35,7 @@ if ($user->isGuest()) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'workflowmode'=>$settings->_workflowMode));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'cachedir'=>$settings->_cacheDir, 'workflowmode'=>$settings->_workflowMode, 'previewwidthlist'=>$settings->_previewWidthList));
if($view) {
$view->show();
exit;

View File

@ -57,7 +57,7 @@ class SeedDMS_View_GroupView extends SeedDMS_Blue_Style {
echo " : ".htmlspecialchars($group->getComment());
foreach($managers as $manager)
if($manager->getId() == $user->getId()) {
echo " : you are the manager of this group";
echo " : ".getMLText("manager_of_group");
$ismanager = true;
}
echo "</li>";

View File

@ -1019,7 +1019,7 @@ function clearFilename<?php print $formName ?>() {
$children[] = $node2;
}
}
$node['children'] = jqtree($path, $subfolder, $user, $accessmode, $showdocs, $expandtree);
$node['children'] = jqtree($path, $subfolder, $user, $accessmode, $showdocs, $expandtree, $orderby);
}
$children[] = $node;
}
@ -1061,7 +1061,7 @@ function clearFilename<?php print $formName ?>() {
$tree = array(array('label'=>$root->getName(), 'id'=>$root->getID(), 'load_on_demand'=>true, 'is_folder'=>true));
}
echo "<div id=\"jqtree".$formid."\" style=\"margin-left: 10px;\" data-url=\"../op/op.Ajax.php?command=subtree&showdocs=".$showdocs."\"></div>\n";
echo "<div id=\"jqtree".$formid."\" style=\"margin-left: 10px;\" data-url=\"../op/op.Ajax.php?command=subtree&showdocs=".$showdocs."&orderby=".$orderby."\"></div>\n";
?>
<script language="JavaScript">
var data = <?php echo json_encode($tree); ?>;

View File

@ -40,6 +40,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$viewonlinefiletypes = $this->params['viewonlinefiletypes'];
$enableversionmodification = $this->params['enableversionmodification'];
$cachedir = $this->params['cachedir'];
$previewwidthdetail = $this->params['previewwidthdetail'];
$latestContent = $document->getLatestContent();
$status = $version->getStatus();
@ -64,19 +65,42 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
?>
</td>
</tr>
<?php
if($document->getComment()) {
?>
<tr>
<td><?php printMLText("comment");?>:</td>
<td><?php print htmlspecialchars($document->getComment());?></td>
</tr>
<?php
}
?>
<tr>
<td><?php printMLText("used_discspace");?>:</td>
<td><?php print SeedDMS_Core_File::format_filesize($document->getUsedDiskSpace());?></td>
</tr>
<tr>
<tr>
<td><?php printMLText("creation_date");?>:</td>
<td><?php print getLongReadableDate($document->getDate()); ?></td>
</tr>
<?php
if($document->expires()) {
?>
<tr>
<td><?php printMLText("expires");?>:</td>
<td><?php print getReadableDate($document->getExpires()); ?></td>
</tr>
<?php
}
if($document->getKeywords()) {
?>
<tr>
<td><?php printMLText("keywords");?>:</td>
<td><?php print htmlspecialchars($document->getKeywords());?></td>
</tr>
<?php
}
if ($document->isLocked()) {
$lockingUser = $document->getLockingUser();
?>
@ -88,6 +112,20 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
}
?>
</tr>
<?php
$attributes = $document->getAttributes();
if($attributes) {
foreach($attributes as $attribute) {
$attrdef = $attribute->getAttributeDefinition();
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php echo htmlspecialchars($attribute->getValue()); ?></td>
</tr>
<?php
}
}
?>
</table>
<?php
$this->contentContainerEnd();
@ -100,8 +138,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
print "<table class=\"table table-condensed\">";
print "<thead>\n<tr>\n";
print "<th width='10%'></th>\n";
print "<th width='10%'>".getMLText("version")."</th>\n";
print "<th width='20%'>".getMLText("file")."</th>\n";
print "<th width='30%'>".getMLText("file")."</th>\n";
print "<th width='25%'>".getMLText("comment")."</th>\n";
print "<th width='15%'>".getMLText("status")."</th>\n";
print "<th width='20%'></th>\n";
@ -109,23 +146,17 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
print "<tr>\n";
print "<td><ul class=\"unstyled\">";
if ($file_exists){
print "<li><a href=\"../op/op.Download.php?documentid=".$document->getID()."&version=".$version->getVersion()."\" title=\"".htmlspecialchars($version->getMimeType())."\"><i class=\"icon-download\"></i> ".getMLText("download")."</a>";
if ($viewonlinefiletypes && in_array(strtolower($version->getFileType()), $viewonlinefiletypes))
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"icon-star\"></i> " . getMLText("view_online") . "</a>";
}else print "<li><img class=\"mimeicon\" src=\"images/icons/".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\"> ";
print "</ul>";
$previewer = new SeedDMS_Preview_Previewer($cachedir, 100);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail);
$previewer->createPreview($version);
if($previewer->hasPreview($version)) {
print("<img class=\"mimeicon\" width=\"100\" src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=100\" title=\"".htmlspecialchars($version->getMimeType())."\">");
print("<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidthdetail."\" title=\"".htmlspecialchars($version->getMimeType())."\">");
}
print "</td>\n";
print "<td class=\"center\">".$version->getVersion()."</td>\n";
print "<td><ul class=\"unstyled\">\n";
print "<li>".$version->getOriginalFileName()."</li>\n";
print "<li>".getMLText('version').": ".$version->getVersion()."</li>\n";
if ($file_exists) print "<li>". formatted_size(filesize($dms->contentDir . $version->getPath())) ." ".htmlspecialchars($version->getMimeType())."</li>";
else print "<li><span class=\"warning\">".getMLText("document_deleted")."</span></li>";
@ -140,7 +171,13 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
print "<td>";
//if (($document->getAccessMode($user) >= M_READWRITE)) {
print "<ul class=\"unstyled\">";
print "<ul class=\"actions unstyled\">";
if ($file_exists){
print "<li><a href=\"../op/op.Download.php?documentid=".$document->getID()."&version=".$version->getVersion()."\" title=\"".htmlspecialchars($version->getMimeType())."\"><i class=\"icon-download\"></i> ".getMLText("download")."</a>";
if ($viewonlinefiletypes && in_array(strtolower($version->getFileType()), $viewonlinefiletypes))
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"icon-star\"></i> " . getMLText("view_online") . "</a>";
}else print "<li><img class=\"mimeicon\" src=\"images/icons/".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\"> ";
if (($enableversionmodification && ($document->getAccessMode($user) >= M_READWRITE)) || $user->isAdmin()) {
print "<li><a href=\"out.RemoveVersion.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"icon-remove\"></i> ".getMLText("rm_version")."</a></li>";
}

View File

@ -58,7 +58,7 @@ class SeedDMS_View_GroupView extends SeedDMS_Bootstrap_Style {
echo " : ".htmlspecialchars($group->getComment());
foreach($managers as $manager)
if($manager->getId() == $user->getId()) {
echo " : you are the manager of this group";
echo " : ".getMLText("manager_of_group");
$ismanager = true;
}
echo "</li>";

View File

@ -38,8 +38,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
$showInProcess = $this->params['showinprocess'];
$cachedir = $this->params['cachedir'];
$workflowmode = $this->params['workflowmode'];
$previewwidth = 40;
$previewwidth = $this->params['previewWidthList'];
$db = $dms->getDB();
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth);

View File

@ -77,7 +77,7 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
}
print "<tr>\n";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</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>";
print "<td>".$st["version"]."</td>";

View File

@ -115,6 +115,14 @@ if(!is_writeable($settings->_configFilePath)) {
</SELECT>
</td>
</tr>
<tr title="<?php printMLText("settings_previewWidthList_desc");?>">
<td><?php printMLText("settings_previewWidthList");?>:</td>
<td><input name="previewWidthList" type="text" value="<?php echo $settings->_previewWidthList ?>" /></td>
</tr>
<tr title="<?php printMLText("settings_previewWidthDetail_desc");?>">
<td><?php printMLText("settings_previewWidthDetail");?>:</td>
<td><input name="previewWidthDetail" type="text" value="<?php echo $settings->_previewWidthDetail ?>" /></td>
</tr>
<!--
-- SETTINGS - SITE - EDITION

View File

@ -82,6 +82,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$enableownerrevapp = $this->params['enableownerrevapp'];
$workflowmode = $this->params['workflowmode'];
$cachedir = $this->params['cachedir'];
$previewwidthlist = $this->params['previewWidthList'];
$previewwidthdetail = $this->params['previewWidthDetail'];
$documentid = $document->getId();
$versions = $document->getContent();
@ -107,6 +109,10 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$links = $document->getDocumentLinks();
$links = SeedDMS_Core_DMS::filterDocumentLinks($user, $links);
/* Retrieve reverse linked documents */
$reverselinks = $document->getReverseDocumentLinks();
$reverselinks = SeedDMS_Core_DMS::filterDocumentLinks($user, $reverselinks);
/* Retrieve latest content */
$latestContent = $document->getLatestContent();
$needwkflaction = false;
@ -289,8 +295,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$this->contentContainerStart();
print "<table class=\"table\">";
print "<thead>\n<tr>\n";
print "<th width='10%'></th>\n";
print "<th width='30%'>".getMLText("file")."</th>\n";
print "<th width='*'></th>\n";
print "<th width='*'>".getMLText("file")."</th>\n";
print "<th width='25%'>".getMLText("comment")."</th>\n";
print "<th width='15%'>".getMLText("status")."</th>\n";
print "<th width='20%'></th>\n";
@ -308,14 +314,14 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "</ul>";
*/
$previewer = new SeedDMS_Preview_Previewer($cachedir, 100);
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail);
$previewer->createPreview($latestContent);
if ($viewonlinefiletypes && in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes))
print "<a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=". $latestContent->getVersion()."\">";
else
print "<a href=\"../op/op.Download.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\">";
if($previewer->hasPreview($latestContent)) {
print("<img class=\"mimeicon\" width=\"100\" src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=100\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">");
print("<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidthdetail."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">");
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
}
@ -898,23 +904,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<tr>\n";
print "<td nowrap>";
/*
print "<ul class=\"actions unstyled\">";
if ($file_exists){
print "<li><a href=\"../op/op.Download.php?documentid=".$documentid."&version=".$version->getVersion()."\"><i class=\"icon-download\"></i>".getMLText("download")."</a>";
if ($viewonlinefiletypes && in_array(strtolower($version->getFileType()), $viewonlinefiletypes))
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=".$version->getVersion()."\"><i class=\"icon-star\"></i>" . getMLText("view_online") . "</a>";
}else print "<li><img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
print "</ul>";
*/
if ($viewonlinefiletypes && in_array(strtolower($version->getFileType()), $viewonlinefiletypes))
print "<a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=".$version->getVersion()."\">";
else
print "<a href=\"../op/op.Download.php?documentid=".$documentid."&version=".$version->getVersion()."\">";
$previewer->createPreview($version);
if($previewer->hasPreview($version)) {
print("<img class=\"mimeicon\" width=\"100\" src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=100\" title=\"".htmlspecialchars($version->getMimeType())."\">");
print("<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidthdetail."\" title=\"".htmlspecialchars($version->getMimeType())."\">");
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
}
@ -995,13 +991,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<tr>";
print "<td>";
$previewer->createPreview($file);
$previewer->createPreview($file, $previewwidthdetail);
if ($viewonlinefiletypes && in_array(strtolower($file->getFileType()), $viewonlinefiletypes))
print "<a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&file=". $file->getID()."\">";
else
print "<a href=\"../op/op.Download.php?documentid=".$documentid."&file=".$file->getID()."\">";
if($previewer->hasPreview($file)) {
print("<img class=\"mimeicon\" width=\"100\" src=\"../op/op.Preview.php?documentid=".$document->getID()."&file=".$file->getID()."&width=100\" title=\"".htmlspecialchars($file->getMimeType())."\">");
print("<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"../op/op.Preview.php?documentid=".$document->getID()."&file=".$file->getID()."&width=".$previewwidthdetail."\" title=\"".htmlspecialchars($file->getMimeType())."\">");
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($file->getFileType())."\" title=\"".htmlspecialchars($file->getMimeType())."\">";
}
@ -1063,11 +1059,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$targetDoc = $link->getTarget();
$targetlc = $targetDoc->getLatestContent();
$previewer->createPreview($targetlc);
$previewer->createPreview($targetlc, $previewwidthlist);
print "<tr>";
print "<td><a href=\"../op/op.Download.php?documentid=".$targetDoc->getID()."&version=".$targetlc->getVersion()."\">";
if($previewer->hasPreview($targetlc)) {
print "<img class=\"mimeicon\" width=\"40\"src=\"../op/op.Preview.php?documentid=".$targetDoc->getID()."&version=".$targetlc->getVersion()."&width=40\" title=\"".htmlspecialchars($targetlc->getMimeType())."\">";
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\"src=\"../op/op.Preview.php?documentid=".$targetDoc->getID()."&version=".$targetlc->getVersion()."&width=".$previewwidthlist."\" title=\"".htmlspecialchars($targetlc->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($targetlc->getFileType())."\" title=\"".htmlspecialchars($targetlc->getMimeType())."\">";
}
@ -1115,6 +1111,49 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
<?php
}
$this->contentContainerEnd();
if (count($reverselinks) > 0) {
$this->contentHeading(getMLText("reverse_links"));
$this->contentContainerStart();
print "<table class=\"table table-condensed\">";
print "<thead>\n<tr>\n";
print "<th></th>\n";
print "<th></th>\n";
print "<th>".getMLText("comment")."</th>\n";
print "<th></th>\n";
print "<th></th>\n";
print "</tr>\n</thead>\n<tbody>\n";
foreach($reverselinks as $link) {
$responsibleUser = $link->getUser();
$sourceDoc = $link->getDocument();
$sourcelc = $sourceDoc->getLatestContent();
$previewer->createPreview($sourcelc, $previewwidthlist);
print "<tr>";
print "<td><a href=\"../op/op.Download.php?documentid=".$sourceDoc->getID()."&version=".$sourcelc->getVersion()."\">";
if($previewer->hasPreview($sourcelc)) {
print "<img class=\"mimeicon\" width=\"".$previewwidthlist."\"src=\"../op/op.Preview.php?documentid=".$sourceDoc->getID()."&version=".$sourcelc->getVersion()."&width=".$previewwidthlist."\" title=\"".htmlspecialchars($sourcelc->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($sourcelc->getFileType())."\" title=\"".htmlspecialchars($sourcelc->getMimeType())."\">";
}
print "</td>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$sourceDoc->getID()."\" class=\"linklist\">".htmlspecialchars($sourceDoc->getName())."</a></td>";
print "<td>".htmlspecialchars($sourceDoc->getComment())."</td>";
print "<td>".getMLText("document_link_by")." ".htmlspecialchars($responsibleUser->getFullName());
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
print "<br />".getMLText("document_link_public").": ".(($link->isPublic()) ? getMLText("yes") : getMLText("no"));
print "</td>";
print "<td><span class=\"actions\">";
if (($user->getID() == $responsibleUser->getID()) || ($document->getAccessMode($user) == M_ALL ))
print "<form action=\"../op/op.RemoveDocumentLink.php\" method=\"post\">".createHiddenFieldWithKey('removedocumentlink')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"linkid\" value=\"".$link->getID()."\" /><button type=\"submit\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</button></form>";
print "</span></td>";
print "</tr>";
}
print "</tbody>\n</table>\n";
$this->contentContainerEnd();
}
?>
</div>
</div>

View File

@ -83,8 +83,7 @@ class SeedDMS_View_ViewFolder extends SeedDMS_Bootstrap_Style {
$workflowmode = $this->params['workflowmode'];
$enableRecursiveCount = $this->params['enableRecursiveCount'];
$maxRecursiveCount = $this->params['maxRecursiveCount'];
$previewwidth = 40;
$previewwidth = $this->params['previewWidthList'];
$folderid = $folder->getId();

View File

@ -35,8 +35,7 @@ class SeedDMS_View_WorkflowSummary extends SeedDMS_Bootstrap_Style {
$dms = $this->params['dms'];
$user = $this->params['user'];
$cachedir = $this->params['cachedir'];
$previewwidth = 40;
$previewwidth = $this->params['previewWidthList'];
$this->htmlStartPage(getMLText("my_documents"));
$this->globalNavigation();