mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-01-30 13:09:16 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
4fb43aef5a
|
|
@ -503,7 +503,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
print "</ul>";
|
||||
} /* }}} */
|
||||
|
||||
protected function showVersionDetails($latestContent, $previewer) { /* {{{ */
|
||||
protected function showVersionDetails($latestContent, $previewer, $islatest=false) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$folder = $this->params['folder'];
|
||||
|
|
@ -599,7 +599,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
|
||||
$items = array();
|
||||
if ($file_exists){
|
||||
if($accessobject->mayEditVersion($latestContent->getDocument())) {
|
||||
if($islatest && $accessobject->mayEditVersion($latestContent->getDocument())) {
|
||||
$items[] = array('link'=>"../out/out.EditOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'edit', 'label'=>'edit_version');
|
||||
}
|
||||
}
|
||||
|
|
@ -609,14 +609,14 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
if($accessobject->mayRemoveVersion($latestContent->getDocument())) {
|
||||
$items[] = array('link'=>"../out/out.RemoveVersion.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'remove', 'label'=>'rm_version');
|
||||
}
|
||||
if($accessobject->mayOverrideStatus($latestContent->getDocument())) {
|
||||
if($islatest && $accessobject->mayOverrideStatus($latestContent->getDocument())) {
|
||||
$items[] = array('link'=>"../out/out.OverrideContentStatus.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'align-justify', 'label'=>'change_status');
|
||||
}
|
||||
if($enablereceiptworkflow && $accessobject->check_controller_access('SetRecipients'))
|
||||
if($islatest && $enablereceiptworkflow && $accessobject->check_controller_access('SetRecipients'))
|
||||
if($accessobject->maySetRecipients($latestContent->getDocument())) {
|
||||
$items[] = array('link'=>"../out/out.SetRecipients.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'check', 'label'=>'change_recipients');
|
||||
}
|
||||
if($enablerevisionworkflow && $accessobject->check_controller_access('SetRevisors'))
|
||||
if($islatest && $enablerevisionworkflow && $accessobject->check_controller_access('SetRevisors'))
|
||||
if($accessobject->maySetRevisors($latestContent->getDocument())) {
|
||||
$items[] = array('link'=>"../out/out.SetRevisors.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'refresh', 'label'=>'change_revisors');
|
||||
}
|
||||
|
|
@ -643,6 +643,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
if($accessobject->mayEditAttributes($latestContent->getDocument())) {
|
||||
$items[] = array('link'=>"out.EditAttributes.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'edit', 'label'=>'edit_attributes');
|
||||
}
|
||||
if(!$islatest)
|
||||
$items[] = array('link'=>"out.DocumentVersionDetail.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'info', 'label'=>'details');
|
||||
|
||||
if($newitems = $this->callHook('extraVersionActions', $latestContent))
|
||||
$items = array_merge($items, $newitems);
|
||||
|
|
@ -829,7 +831,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
$this->contentContainerStart();
|
||||
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail, $timeout, $xsendfile);
|
||||
$previewer->setConverters($previewconverters);
|
||||
$this->showVersionDetails($latestContent, $previewer);
|
||||
$this->showVersionDetails($latestContent, $previewer, true);
|
||||
$this->contentContainerEnd();
|
||||
|
||||
if($user->isAdmin()) {
|
||||
|
|
@ -1600,119 +1602,12 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
|||
if(is_string($txt))
|
||||
echo $txt;
|
||||
|
||||
$this->contentContainerStart();
|
||||
|
||||
print "<table class=\"table\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th colspan=\"2\"></th>\n";
|
||||
print "<th width='25%'></th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
for ($i = count($versions)-2; $i >= 0; $i--) {
|
||||
$version = $versions[$i];
|
||||
$vstat = $version->getStatus();
|
||||
$workflow = $version->getWorkflow();
|
||||
$workflowstate = $version->getWorkflowState();
|
||||
|
||||
// verify if file exists
|
||||
$file_exists=file_exists($dms->contentDir . $version->getPath());
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td style=\"width:".$previewwidthdetail."px; text-align: center;\">";
|
||||
if($file_exists) {
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($version->getFileType()), $viewonlinefiletypes) || in_array(strtolower($version->getMimeType()), $viewonlinefiletypes))) {
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
|
||||
print "<a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$version->getDocument()->getId()."&version=".$version->getVersion()."\">";
|
||||
}
|
||||
} else {
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'version'))) {
|
||||
print "<a href=\"../op/op.Download.php?documentid=".$version->getDocument()->getId()."&version=".$version->getVersion()."\">";
|
||||
}
|
||||
}
|
||||
}
|
||||
$previewer->createPreview($version);
|
||||
if($previewer->hasPreview($version)) {
|
||||
print("<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"../op/op.Preview.php?documentid=".$version->getDocument()->getId()."&version=".$version->getVersion()."&width=".$previewwidthdetail."\" title=\"".htmlspecialchars($version->getMimeType())."\">");
|
||||
} else {
|
||||
print "<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
|
||||
}
|
||||
if($file_exists) {
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'run')) || $accessobject->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
print "</a>\n";
|
||||
}
|
||||
print "</td>\n";
|
||||
print "<td><ul class=\"actions unstyled\">\n";
|
||||
print "<li>".htmlspecialchars($version->getOriginalFileName())."</li>\n";
|
||||
print "<li>".getMLText('version').": ".$version->getVersion()."</li>\n";
|
||||
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:".htmlspecialchars($updatingUser->getEmail())."\">".htmlspecialchars($updatingUser->getFullName())."</a></li>";
|
||||
print "<li>".getLongReadableDate($version->getDate())."</li>";
|
||||
print "<li>".getMLText('status').": ".getOverallStatusText($vstat["status"])."</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";
|
||||
$this->printVersionAttributes($folder, $version);
|
||||
print "</ul></td>\n";
|
||||
// print "<td>".htmlspecialchars($version->getComment())."</td>";
|
||||
print "<td>";
|
||||
if ($file_exists){
|
||||
print "<ul class=\"actions unstyled\">";
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'version'))) {
|
||||
print "<li><a href=\"../op/op.Download.php?documentid=".$version->getDocument()->getId()."&version=".$version->getVersion()."\"><i class=\"fa fa-download\"></i>".getMLText("download")."</a>";
|
||||
}
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($version->getFileType()), $viewonlinefiletypes) || in_array(strtolower($version->getMimeType()), $viewonlinefiletypes)))
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
|
||||
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$version->getDocument()->getId()."&version=".$version->getVersion()."\"><i class=\"fa fa-star\"></i>" . getMLText("view_online") . "</a>";
|
||||
}
|
||||
$items = $this->callHook('extraVersionViews', $version);
|
||||
if($items) {
|
||||
foreach($items as $item) {
|
||||
if(is_string($item))
|
||||
echo "<li>".$item."</li>";
|
||||
elseif(is_array($item))
|
||||
echo "<li><a href=\"".$item['link']."\">".(!empty($item['icon']) ? "<i class=\"fa fa-".$item['icon']."\"></i>" : "").getMLText($item['label'])."</a></li>";
|
||||
}
|
||||
}
|
||||
print "</ul>";
|
||||
}
|
||||
print "<ul class=\"actions unstyled\">";
|
||||
/* Only admin has the right to remove version in any case or a regular
|
||||
* user if enableVersionDeletion is on
|
||||
*/
|
||||
if($accessobject->mayRemoveVersion($document)) {
|
||||
print "<li>".$this->html_link('RemoveVersion', array('documentid'=>$version->getDocument()->getId(), 'version'=>$version->getVersion()), array(), "<i class=\"fa fa-remove\"></i>".getMLText("rm_version"), false, true)."</li>";
|
||||
}
|
||||
if($accessobject->check_controller_access('AddToTransmittal'))
|
||||
print "<li>".$this->html_link('AddToTransmittal', array('documentid'=>$version->getDocument()->getId(), 'version'=>$version->getVersion()), array(), "<i class=\"fa fa-list\"></i>".getMLText("add_to_transmittal"), false, true)."</li>";
|
||||
if($accessobject->mayEditComment($document)) {
|
||||
print "<li>".$this->html_link('EditComment', array('documentid'=>$version->getDocument()->getId(), 'version'=>$version->getVersion()), array(), "<i class=\"fa fa-comment\"></i>".getMLText("edit_comment"), false, true)."</li>";
|
||||
}
|
||||
if($accessobject->mayEditAttributes($document)) {
|
||||
print "<li>".$this->html_link('EditAttributes', array('documentid'=>$version->getDocument()->getId(), 'version'=>$version->getVersion()), array(), "<i class=\"fa fa-edit\"></i>".getMLText("edit_attributes"), false, true)."</li>";
|
||||
}
|
||||
print "<li>".$this->html_link('DocumentVersionDetail', array('documentid'=>$version->getDocument()->getId(), 'version'=>$version->getVersion()), array(), "<i class=\"fa fa-info-circle\"></i>".getMLText("details"), false, true)."</li>";
|
||||
$items = $this->callHook('extraVersionActions', $version);
|
||||
if($items) {
|
||||
foreach($items as $item) {
|
||||
if(is_string($item))
|
||||
echo "<li>".$item."</li>";
|
||||
elseif(is_array($item))
|
||||
echo "<li><a href=\"".$item['link']."\">".(!empty($item['icon']) ? "<i class=\"fa fa-".$item['icon']."\"></i>" : "").getMLText($item['label'])."</a></li>";
|
||||
}
|
||||
}
|
||||
print "</ul>";
|
||||
print "</td>\n</tr>\n";
|
||||
$this->contentContainerStart();
|
||||
$this->showVersionDetails($version, $previewer, false);
|
||||
$this->contentContainerEnd();
|
||||
}
|
||||
print "</tbody>\n</table>\n";
|
||||
$this->contentContainerEnd();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user