Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2020-09-17 15:57:41 +02:00
commit 2c43ef2c96
6 changed files with 217 additions and 124 deletions

View File

@ -178,6 +178,8 @@
- allow inline editing of document name
- import of users does not issue an error if a group column isn't set
- removing a document version will not remove attachments of the document anymore
- make document details page like like view document page
- fix selection of documents/folders
--------------------------------------------------------------------------------
Changes in version 5.1.19

View File

@ -77,6 +77,7 @@ if($view) {
$view->setParam('enableversionmodification', $settings->_enableVersionModification);
$view->setParam('previewWidthDetail', $settings->_previewWidthDetail);
$view->setParam('previewConverters', isset($settings->_converters['preview']) ? $settings->_converters['preview'] : array());
$view->setParam('pdfConverters', isset($settings->_converters['pdf']) ? $settings->_converters['pdf'] : array());
$view->setParam('showFullPreview', $settings->_showFullPreview);
$view->setParam('convertToPdf', $settings->_convertToPdf);
$view->setParam('cachedir', $settings->_cacheDir);

View File

@ -36,13 +36,13 @@ function escapeHtml(text) {
}
function treeFolderSelected(formid, nodeid, nodename) {
$('#targetid'+formid).val(nodeid);
$('#'+formid).val(nodeid);
$('#choosefoldersearch'+formid).val(nodename);
$('#folderChooser'+formid).modal('hide');
}
function treeDocumentSelected(formid, nodeid, nodename) {
$('#docid'+formid).val(nodeid);
$('#'+formid).val(nodeid);
$('#choosedocsearch'+formid).val(nodename);
$('#docChooser'+formid).modal('hide');
}
@ -446,12 +446,18 @@ $(document).ready( function() {
for(var key in param1) {
if(key == 'callback')
callback = param1[key];
else
url += "&"+key+"="+param1[key];
else {
if($.isArray(param1[key])) {
if(param1[key].length > 0)
url += "&"+key+"[]="+param1[key].join("&"+key+"[]=");
} else
url += "&"+key+"="+param1[key];
}
}
} else {
url += "&"+param1;
}
console.log(url);
if(!element.data('no-spinner'))
element.prepend('<div style="position: absolute; overflow: hidden; background: #f7f7f7; z-index: 1000; height: '+element.height()+'px; width: '+element.width()+'px; opacity: 0.7; display: table;"><div style="display: table-cell;text-align: center; vertical-align: middle; "><img src="../views/bootstrap/images/ajax-loader.gif"></div>');
$.get(url, function(data) {

View File

@ -1384,7 +1384,7 @@ $(document).ready(function() {
else
$folderid = $folder->getID();
$content = '';
$content .= "<input type=\"hidden\" id=\"docid".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
$content .= "<div class=\"input-append\">\n";
$content .= "<input type=\"text\" id=\"choosedocsearch".$formid."\" data-target=\"".$formid."\" data-provide=\"typeahead\" name=\"docname".$formid."\" value=\"". (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" />";
if(!$skiptree)
@ -1423,7 +1423,7 @@ $(document).ready(function() {
$formid = md5($formname.$form);
?>
function documentSelected<?php echo $formid ?>(id, name) {
$('#docid<?php echo $formid ?>').val(id);
$('#<?php echo $formid ?>').val(id);
$('#choosedocsearch<?php echo $formid ?>').val(name);
$('#docChooser<?php echo $formid ?>').modal('hide');
}
@ -1448,7 +1448,7 @@ function folderSelected<?php echo $formid ?>(id, name) {
$formname = "targetid";
$formid = md5($formname.$form);
$content = '';
$content .= "<input type=\"hidden\" id=\"targetid".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
$content .= "<input type=\"hidden\" id=\"".$formid."\" name=\"".$formname."\" value=\"". (($default) ? $default->getID() : "") ."\">";
$content .= "<div class=\"input-append\">\n";
$content .= "<input type=\"text\" id=\"choosefoldersearch".$formid."\" data-target=\"".$formid."\" data-provide=\"typeahead\" name=\"targetname".$formid."\" value=\"". (($default) ? htmlspecialchars($default->getName()) : "") ."\" placeholder=\"".getMLText('type_to_search')."\" autocomplete=\"off\" target=\"".$formid."\"/>";
$content .= "<button type=\"button\" class=\"btn\" id=\"clearfolder".$formid."\" data-target=\"".$formid."\"><i class=\"fa fa-remove\"></i></button>";
@ -1490,7 +1490,7 @@ function folderSelected<?php echo $formid ?>(id, name) {
$formid = md5($formname.$form);
?>
function folderSelected<?php echo $formid ?>(id, name) {
$('#targetid<?php echo $formid ?>').val(id);
$('#<?php echo $formid ?>').val(id);
$('#choosefoldersearch<?php echo $formid ?>').val(name);
$('#folderChooser<?php echo $formid ?>').modal('hide');
}
@ -1498,7 +1498,7 @@ function folderSelected<?php echo $formid ?>(id, name) {
$(document).ready(function() {
$('#clearfolder<?php print $formid ?>').click(function(ev) {
$('#choosefoldersearch<?php echo $formid ?>').val('');
$('#targetid<?php echo $formid ?>').val('');
$('#<?php echo $formid ?>').val('');
});
});
*/

View File

@ -36,50 +36,100 @@ require_once("SeedDMS/Preview.php");
*/
class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
/**
* Output a single attribute in the document info section
*
* @param object $attribute attribute
*/
protected function printAttribute($attribute) { /* {{{ */
$attrdef = $attribute->getAttributeDefinition();
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php echo $this->getAttributeValue($attribute); ?></td>
</tr>
<?php
} /* }}} */
function preview() { /* {{{ */
$dms = $this->params['dms'];
$document = $this->params['document'];
$timeout = $this->params['timeout'];
$xsendfile = $this->params['xsendfile'];
$showfullpreview = $this->params['showFullPreview'];
$converttopdf = $this->params['convertToPdf'];
$pdfconverters = $this->params['pdfConverters'];
$cachedir = $this->params['cachedir'];
$version = $this->params['version'];
if(!$showfullpreview)
return;
switch($version->getMimeType()) {
case 'audio/mpeg':
case 'audio/mp3':
case 'audio/ogg':
case 'audio/wav':
$this->contentHeading(getMLText("preview"));
?>
<audio controls style="width: 100%;">
<source src="../op/op.Download.php?documentid=<?php echo $document->getID(); ?>&version=<?php echo $version->getVersion(); ?>" type="audio/mpeg">
</audio>
<?php
break;
case 'application/pdf':
$this->contentHeading(getMLText("preview"));
?>
<iframe src="../pdfviewer/web/viewer.html?file=<?php echo urlencode('../../op/op.Download.php?documentid='.$document->getID().'&version='.$version->getVersion()); ?>" width="100%" height="700px"></iframe>
<?php
break;
case 'image/svg+xml':
$this->contentHeading(getMLText("preview"));
?>
<img src="../op/op.Download.php?documentid=<?php echo $document->getID(); ?>&version=<?php echo $version->getVersion(); ?>" width="100%">
<?php
break;
default:
break;
$txt = $this->callHook('preDocumentPreview', $version);
if(is_string($txt))
echo $txt;
$txt = $this->callHook('documentPreview', $version);
if(is_string($txt))
echo $txt;
else {
switch($version->getMimeType()) {
case 'audio/mpeg':
case 'audio/mp3':
case 'audio/ogg':
case 'audio/wav':
$this->contentHeading(getMLText("preview"));
?>
<audio controls style="width: 100%;">
<source src="../op/op.ViewOnline.php?documentid=<?php echo $version->getDocument()->getID(); ?>&version=<?php echo $version->getVersion(); ?>" type="audio/mpeg">
</audio>
<?php
break;
case 'video/webm':
case 'video/mp4':
case 'video/avi':
case 'video/msvideo':
case 'video/x-msvideo':
case 'video/x-matroska':
$this->contentHeading(getMLText("preview"));
?>
<video controls style="width: 100%;">
<source src="../op/op.ViewOnline.php?documentid=<?php echo $version->getDocument()->getID(); ?>&version=<?php echo $version->getVersion(); ?>" type="video/mp4">
</video>
<?php
break;
case 'application/pdf':
$this->contentHeading(getMLText("preview"));
?>
<iframe src="../pdfviewer/web/viewer.html?file=<?php echo urlencode('../../op/op.ViewOnline.php?documentid='.$version->getDocument()->getID().'&version='.$version->getVersion()); ?>" width="100%" height="700px"></iframe>
<?php
break;
case 'image/svg+xml':
case 'image/jpg':
case 'image/jpeg':
case 'image/png':
case 'image/gif':
$this->contentHeading(getMLText("preview"));
?>
<img src="../op/op.ViewOnline.php?documentid=<?php echo $version->getDocument()->getID(); ?>&version=<?php echo $version->getVersion(); ?>" width="100%">
<?php
break;
default:
$txt = $this->callHook('additionalDocumentPreview', $version);
if(is_string($txt))
echo $txt;
break;
}
}
$txt = $this->callHook('postDocumentPreview', $version);
if(is_string($txt))
echo $txt;
if($converttopdf) {
$pdfpreviewer = new SeedDMS_Preview_PdfPreviewer($cachedir, $timeout, $xsendfile);
$pdfpreviewer->setConverters($pdfconverters);
if($pdfpreviewer->hasConverter($version->getMimeType())) {
$this->contentHeading(getMLText("preview"));
$this->contentHeading(getMLText("preview_pdf"));
?>
<iframe src="../pdfviewer/web/viewer.html?file=<?php echo urlencode('../../op/op.PdfPreview.php?documentid='.$document->getID().'&version='.$version->getVersion()); ?>" width="100%" height="700px"></iframe>
<iframe src="../pdfviewer/web/viewer.html?file=<?php echo urlencode('../../op/op.PdfPreview.php?documentid='.$version->getDocument()->getID().'&version='.$version->getVersion()); ?>" width="100%" height="700px"></iframe>
<?php
}
}
@ -90,6 +140,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$user = $this->params['user'];
$folder = $this->params['folder'];
$document = $this->params['document'];
$accessop = $this->params['accessobject'];
$version = $this->params['version'];
$accessop = $this->params['accessobject'];
$viewonlinefiletypes = $this->params['viewonlinefiletypes'];
@ -176,13 +227,17 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$attributes = $document->getAttributes();
if($attributes) {
foreach($attributes as $attribute) {
$attrdef = $attribute->getAttributeDefinition();
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php echo htmlspecialchars(implode(', ', $attribute->getValueAsArray())); ?></td>
</tr>
<?php
$arr = $this->callHook('showDocumentAttribute', $document, $attribute);
if(is_array($arr)) {
echo "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} elseif(is_string($arr)) {
echo $arr;
} else {
$this->printAttribute($attribute);
}
}
}
?>
@ -202,11 +257,10 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$this->contentContainerStart();
print "<table class=\"table table-condensed\">";
print "<thead>\n<tr>\n";
print "<th width='10%'></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";
print "<th colspan=\"2\">".htmlspecialchars($version->getOriginalFileName())."</th>\n";
// print "<th width='25%'>".getMLText("comment")."</th>\n";
print "<th width='20%'>".getMLText("status")."</th>\n";
print "<th width='25%'></th>\n";
print "</tr>\n</thead>\n<tbody>\n";
print "<tr>\n";
print "<td><ul class=\"unstyled\">";
@ -221,72 +275,96 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
print "</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>";
if ($file_exists)
print "<li>". SeedDMS_Core_File::format_filesize($version->getFileSize()) .", ".htmlspecialchars($version->getMimeType())."</li>";
else print "<li><span class=\"warning\">".getMLText("document_deleted")."</span></li>";
$updatingUser = $version->getUser();
print "<li>".getMLText("uploaded_by")." <a href=\"mailto:".$updatingUser->getEmail()."\">".htmlspecialchars($updatingUser->getFullName())."</a></li>";
print "<li>".getLongReadableDate($version->getDate())."</li>";
print "</ul>\n";
$txt = $this->callHook('showVersionComment', $version);
if($txt) {
echo $txt;
} else {
if($version->getComment())
print "<p style=\"font-style: italic;\">".htmlspecialchars($version->getComment())."</p>";
}
print "<ul class=\"actions unstyled\">\n";
$attributes = $version->getAttributes();
if($attributes) {
foreach($attributes as $attribute) {
$arr = $this->callHook('showDocumentContentAttribute', $version, $attribute);
if(is_array($arr)) {
print "<li>".$arr[0].": ".$arr[1]."</li>\n";
} else {
$attrdef = $attribute->getAttributeDefinition();
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n";
}
}
}
print "</ul></td>\n";
print "<td>".htmlspecialchars($version->getComment())."</td>";
print "<td>".getOverallStatusText($status["status"])."</td>";
print "<td width='10%'>";
print getOverallStatusText($status["status"]);
if ( $status["status"]==S_DRAFT_REV || $status["status"]==S_DRAFT_APP || $status["status"]==S_IN_WORKFLOW || $status["status"]==S_EXPIRED ){
print "<br><span".($document->hasExpired()?" class=\"warning\" ":"").">".(!$document->getExpires() ? getMLText("does_not_expire") : getMLText("expires").": ".getReadableDate($document->getExpires()))."</span>";
}
print "</td>";
print "<td>";
//if (($document->getAccessMode($user) >= M_READWRITE)) {
print "<ul class=\"actions unstyled\">";
if ($file_exists){
print "<ul class=\"actions unstyled\">";
if($accessop->check_controller_access('Download', array('action'=>'run')))
print "<li><a href=\"../op/op.Download.php?documentid=".$document->getID()."&version=".$version->getVersion()."\" title=\"".htmlspecialchars($version->getMimeType())."\"><i class=\"fa fa-download\"></i> ".getMLText("download")."</a>";
if ($viewonlinefiletypes && (in_array(strtolower($version->getFileType()), $viewonlinefiletypes) || in_array(strtolower($version->getMimeType()), $viewonlinefiletypes)))
if($accessop->check_controller_access('ViewOnline', array('action'=>'run')))
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-star\"></i> " . getMLText("view_online") . "</a>";
print "</ul>";
print "<ul class=\"actions unstyled\">";
}
if (($enableversionmodification && ($document->getAccessMode($user) >= M_READWRITE)) || $user->isAdmin()) {
print "<li><a href=\"out.RemoveVersion.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-remove\"></i> ".getMLText("rm_version")."</a></li>";
}
if (($enableversionmodification && ($document->getAccessMode($user) == M_ALL)) || $user->isAdmin()) {
if ( $status["status"]==S_RELEASED || $status["status"]==S_OBSOLETE ){
print "<li><a href='../out/out.OverrideContentStatus.php?documentid=".$document->getID()."&version=".$version->getVersion()."'><i class=\"fa fa-align-justify\"></i>".getMLText("change_status")."</a></li>";
print "<ul class=\"actions unstyled\">";
if ($file_exists){
if($accessop->mayEditVersion($version->getDocument())) {
print "<li><a href=\"../out/out.EditOnline.php?documentid=".$document->getId()."&version=".$version->getVersion()."\"><i class=\"fa fa-edit\"></i>".getMLText("edit_version")."</a></li>";
}
}
if (($enableversionmodification && ($document->getAccessMode($user) >= M_READWRITE)) || $user->isAdmin()) {
if($status["status"] != S_OBSOLETE)
print "<li><a href=\"out.EditComment.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-comment\"></i> ".getMLText("edit_comment")."</a></li>";
if ( $status["status"] == S_DRAFT_REV){
print "<li><a href=\"out.EditAttributes.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-edit\"></i> ".getMLText("edit_attributes")."</a></li>";
if($accessop->mayRemoveVersion($version->getDocument())) {
print "<li><a href=\"out.RemoveVersion.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-remove\"></i> ".getMLText("rm_version")."</a></li>";
}
print "</ul>";
if($accessop->mayOverrideStatus($version->getDocument())) {
print "<li><a href='../out/out.OverrideContentStatus.php?documentid=".$document->getID()."&version=".$version->getVersion()."'><i class=\"fa fa-align-justify\"></i>".getMLText("change_status")."</a></li>";
}
else {
print "&nbsp;";
if($accessop->mayEditComment($version->getDocument())) {
print "<li><a href=\"out.EditComment.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-comment\"></i> ".getMLText("edit_comment")."</a></li>";
}
if($accessop->mayEditAttributes($version->getDocument())) {
print "<li><a href=\"out.EditAttributes.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-edit\"></i> ".getMLText("edit_attributes")."</a></li>";
}
print "</ul>";
echo "</td>";
print "</tr></tbody>\n</table>\n";
$this->contentContainerEnd();
$this->contentContainerStart();
print "<table class=\"table-condensed\">\n";
print "<div class=\"row-fluid\">";
print "<div class=\"span6\">";
if (is_array($reviewStatus) && count($reviewStatus)>0) {
if (is_array($reviewStatus) && count($reviewStatus)>0) { /* {{{ */
print "<tr><td colspan=4>\n";
$this->contentSubHeading(getMLText("reviewers"));
print "</td></tr>\n";
print "<legend>".getMLText('reviewers')."</legend>";
print "<table class=\"table table-condensed\">\n";
print "<tr>\n";
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n";
print "<td width='25%'><b>".getMLText("comment")."</b></td>";
print "<td width='35%'><b>".getMLText("status")."</b></td>\n";
print "<td><b>".getMLText("name")."</b></td>\n";
print "<td><b>".getMLText("last_update")."</b></td>\n";
// print "<td width='25%'><b>".getMLText("comment")."</b></td>";
print "<td><b>".getMLText("status")."</b></td>\n";
print "</tr>\n";
foreach ($reviewStatus as $r) {
@ -298,7 +376,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
}
else {
$reqName = htmlspecialchars($required->getFullName());
$reqName = "<i class=\"fa fa-user\"></i> ".htmlspecialchars($required->getFullName()." (".$required->getLogin().")");
}
break;
case 1: // Reviewer is a group.
@ -307,32 +385,40 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$reqName = getMLText("unknown_group")." '".$r["required"]."'";
}
else {
$reqName = htmlspecialchars($required->getName());
$reqName = "<i class=\"fa fa-group\"></i> ".htmlspecialchars($required->getName());
}
break;
}
print "<tr>\n";
print "<tr".($r['status'] == 1 ? ' class="success"' : ($r['status'] == -1 ? ' class="error"' : '')).">\n";
print "<td>".$reqName."</td>\n";
print "<td><ul class=\"unstyled\"><li>".$r["date"]."</li>";
print "<td><i style=\"font-size: 80%;\">".$r["date"]." - ";
/* $updateUser is the user who has done the review */
$updateUser = $dms->getUser($r["userID"]);
print "<li>".(is_object($updateUser) ? $updateUser->getFullName() : "unknown user id '".$r["userID"]."'")."</li></ul></td>";
print "<td>".$r["comment"]."</td>\n";
print (is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()." (".$updateUser->getLogin().")") : "unknown user id '".$r["userID"]."'")."</i><br />";
print htmlspecialchars($r["comment"]);
if($r['file']) {
echo "<br />";
echo "<a href=\"../op/op.Download.php?documentid=".$documentid."&reviewlogid=".$r['reviewLogID']."\" class=\"btn btn-mini\"><i class=\"fa fa-download\"></i> ".getMLText('download')."</a>";
}
print "</td>\n";
print "<td>".getReviewStatusText($r["status"])."</td>\n";
print "</tr>\n";
}
}
print "</table>\n";
} /* }}} */
if (is_array($approvalStatus) && count($approvalStatus)>0) {
print "</div>\n";
print "<div class=\"span6\">";
print "<tr><td colspan=4>\n";
$this->contentSubHeading(getMLText("approvers"));
print "</td></tr>\n";
if (is_array($approvalStatus) && count($approvalStatus)>0) { /* {{{ */
print "<legend>".getMLText('approvers')."</legend>";
print "<table class=\"table table-condensed\">\n";
print "<tr>\n";
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n";
print "<td width='25%'><b>".getMLText("comment")."</b></td>";
print "<td width='35%'><b>".getMLText("status")."</b></td>\n";
print "<td><b>".getMLText("name")."</b></td>\n";
print "<td><b>".getMLText("last_update")."</b></td>\n";
// print "<td width='25%'><b>".getMLText("comment")."</b></td>";
print "<td><b>".getMLText("status")."</b></td>\n";
print "</tr>\n";
foreach ($approvalStatus as $a) {
@ -344,7 +430,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
}
else {
$reqName = htmlspecialchars($required->getFullName());
$reqName = "<i class=\"fa fa-user\"></i> ".htmlspecialchars($required->getFullName()." (".$required->getLogin().")");
}
break;
case 1: // Approver is a group.
@ -353,38 +439,39 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
$reqName = getMLText("unknown_group")." '".$r["required"]."'";
}
else {
$reqName = htmlspecialchars($required->getName());
$reqName = "<i class=\"fa fa-group\"></i> ".htmlspecialchars($required->getName());
}
break;
}
print "<tr>\n";
print "<tr".($a['status'] == 1 ? ' class="success"' : ($a['status'] == -1 ? ' class="error"' : ($a['status'] == -2 ? ' class=""' : ''))).">\n";
print "<td>".$reqName."</td>\n";
print "<td><ul class=\"documentDetail\"><li>".$a["date"]."</li>";
print "<td><i style=\"font-size: 80%;\">".$a["date"]." - ";
/* $updateUser is the user who has done the approval */
$updateUser = $dms->getUser($a["userID"]);
print "<li>".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()) : "unknown user id '".$a["userID"]."'")."</li></ul></td>";
print "<td>".$a["comment"]."</td>\n";
print (is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()." (".$updateUser->getLogin().")") : "unknown user id '".$a["userID"]."'")."</i><br />";
print htmlspecialchars($a["comment"]);
if($a['file']) {
echo "<br />";
echo "<a href=\"../op/op.Download.php?documentid=".$documentid."&approvelogid=".$a['approveLogID']."\" class=\"btn btn-mini\"><i class=\"fa fa-download\"></i> ".getMLText('download')."</a>";
}
echo "</td>\n";
print "<td>".getApprovalStatusText($a["status"])."</td>\n";
print "</tr>\n";
}
}
print "</table>\n";
} /* }}} */
print "</table>\n";
print "</div>\n";
print "</div>\n";
$this->contentContainerEnd();
$tmpfiles = $document->getDocumentFiles($version->getVersion());
/* Do the regular filtering by isPublic and access rights */
$tmpfiles = SeedDMS_Core_DMS::filterDocumentFiles($user, $tmpfiles);
/* Also filter only those files belonging to this version and skip files
* belonging to the document (version = 0)
/* Get attachments exclusively for this version, without those
* attached to the document
*/
$files = array();
foreach($tmpfiles as $file) {
if($file->getVersion() == $version->getVersion())
$files[] = $file;
}
$files = $document->getDocumentFiles($version->getVersion(), false);
/* Do the regular filtering by isPublic and access rights */
$files = SeedDMS_Core_DMS::filterDocumentFiles($user, $files);
if (count($files) > 0) {
if (count($files) > 0) { /* {{{ */
$this->contentHeading(getMLText("linked_files"));
$this->contentContainerStart();
@ -399,8 +486,6 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
print "</tr>\n</thead>\n<tbody>\n";
foreach($files as $file) {
if($file->getVersion() != $version->getVersion())
continue;
$file_exists=file_exists($dms->contentDir . $file->getPath());
@ -459,7 +544,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Bootstrap_Style {
print "</tbody>\n</table>\n";
$this->contentContainerEnd();
}
} /* }}} */
if($user->isAdmin() || $user->getId() == $document->getOwner()->getId()) {
$this->contentHeading(getMLText("status"));

View File

@ -670,8 +670,6 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$this->printVersionAttributes($folder, $latestContent);
print "</ul></td>\n";
// print "<td>".htmlspecialchars($latestContent->getComment())."</td>";
print "<td width='10%'>";
print getOverallStatusText($status["status"]);
if ( $status["status"]==S_DRAFT_REV || $status["status"]==S_DRAFT_APP || $status["status"]==S_IN_WORKFLOW || $status["status"]==S_EXPIRED ){
@ -681,8 +679,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<td>";
print "<ul class=\"unstyled actions\">";
if ($file_exists){
print "<ul class=\"unstyled actions\">";
if($accessobject->check_controller_access('Download', array('action'=>'version'))) {
print "<li><a href=\"../op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion()."\"><i class=\"fa fa-download\"></i>".getMLText("download")."</a></li>";
}
@ -690,8 +688,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes)))
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion()."\"><i class=\"fa fa-star\"></i>" . getMLText("view_online") . "</a></li>";
}
print "</ul>";
}
print "</ul>";
print "<ul class=\"unstyled actions\">";
if($accessobject->check_view_access('EditOnline'))
if($accessobject->mayEditVersion($latestContent->getDocument())) {