mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
use check_xxx_access() and html_link(), backported from 6.0.x
This commit is contained in:
parent
496c70c024
commit
b7885ad6f6
|
@ -216,7 +216,6 @@ $(document).ready( function() {
|
|||
echo $txt;
|
||||
else {
|
||||
$this->contentHeading(getMLText("document_infos"));
|
||||
// $this->contentContainerStart();
|
||||
$txt = $this->callHook('preDocumentInfos', $document);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
|
@ -384,76 +383,79 @@ $(document).ready( function() {
|
|||
if(!$showfullpreview)
|
||||
return;
|
||||
|
||||
$latestContent = $this->callHook('documentLatestContent', $document);
|
||||
if($latestContent === null)
|
||||
$latestContent = $document->getLatestContent();
|
||||
$txt = $this->callHook('preDocumentPreview', $latestContent);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
$txt = $this->callHook('documentPreview', $latestContent);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
switch($latestContent->getMimeType()) {
|
||||
case 'audio/mpeg':
|
||||
case 'audio/mp3':
|
||||
case 'audio/ogg':
|
||||
case 'audio/wav':
|
||||
$this->contentHeading(getMLText("preview"));
|
||||
?>
|
||||
<audio controls style="width: 100%;" preload="false">
|
||||
<source src="<?= $settings->_httpRoot ?>op/op.ViewOnline.php?documentid=<?php echo $latestContent->getDocument()->getID(); ?>&version=<?php echo $latestContent->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"));
|
||||
?>
|
||||
$accessobject = $this->params['accessobject'];
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'version'))) {
|
||||
$latestContent = $this->callHook('documentLatestContent', $document);
|
||||
if($latestContent === null)
|
||||
$latestContent = $document->getLatestContent();
|
||||
$txt = $this->callHook('preDocumentPreview', $latestContent);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
$txt = $this->callHook('documentPreview', $latestContent);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
switch($latestContent->getMimeType()) {
|
||||
case 'audio/mpeg':
|
||||
case 'audio/mp3':
|
||||
case 'audio/ogg':
|
||||
case 'audio/wav':
|
||||
$this->contentHeading(getMLText("preview"));
|
||||
?>
|
||||
<audio controls style="width: 100%;" preload="false">
|
||||
<source src="<?= $settings->_httpRoot ?>op/op.ViewOnline.php?documentid=<?php echo $latestContent->getDocument()->getID(); ?>&version=<?php echo $latestContent->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="<?= $settings->_httpRoot ?>op/op.ViewOnline.php?documentid=<?php echo $latestContent->getDocument()->getID(); ?>&version=<?php echo $latestContent->getVersion(); ?>" type="video/mp4">
|
||||
</video>
|
||||
<?php
|
||||
break;
|
||||
case 'application/pdf':
|
||||
$this->contentHeading(getMLText("preview"));
|
||||
?>
|
||||
<iframe src="<?= $settings->_httpRoot ?>pdfviewer/web/viewer.html?file=<?php echo urlencode($settings->_httpRoot.'op/op.ViewOnline.php?documentid='.$latestContent->getDocument()->getID().'&version='.$latestContent->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="<?= $settings->_httpRoot ?>op/op.ViewOnline.php?documentid=<?php echo $latestContent->getDocument()->getID(); ?>&version=<?php echo $latestContent->getVersion(); ?>" width="100%">
|
||||
<?php
|
||||
break;
|
||||
default:
|
||||
$txt = $this->callHook('additionalDocumentPreview', $latestContent);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
break;
|
||||
<?php
|
||||
break;
|
||||
case 'application/pdf':
|
||||
$this->contentHeading(getMLText("preview"));
|
||||
?>
|
||||
<iframe src="<?= $settings->_httpRoot ?>pdfviewer/web/viewer.html?file=<?php echo urlencode($settings->_httpRoot.'op/op.ViewOnline.php?documentid='.$latestContent->getDocument()->getID().'&version='.$latestContent->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="<?= $settings->_httpRoot ?>op/op.ViewOnline.php?documentid=<?php echo $latestContent->getDocument()->getID(); ?>&version=<?php echo $latestContent->getVersion(); ?>" width="100%">
|
||||
<?php
|
||||
break;
|
||||
default:
|
||||
$txt = $this->callHook('additionalDocumentPreview', $latestContent);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$txt = $this->callHook('postDocumentPreview', $latestContent);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
$txt = $this->callHook('postDocumentPreview', $latestContent);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
|
||||
if($converttopdf) {
|
||||
$pdfpreviewer = new SeedDMS_Preview_PdfPreviewer($cachedir, $timeout, $xsendfile);
|
||||
$pdfpreviewer->setConverters($pdfconverters);
|
||||
if($pdfpreviewer->hasConverter($latestContent->getMimeType())) {
|
||||
$this->contentHeading(getMLText("preview_pdf"));
|
||||
if($converttopdf) {
|
||||
$pdfpreviewer = new SeedDMS_Preview_PdfPreviewer($cachedir, $timeout, $xsendfile);
|
||||
$pdfpreviewer->setConverters($pdfconverters);
|
||||
if($pdfpreviewer->hasConverter($latestContent->getMimeType())) {
|
||||
$this->contentHeading(getMLText("preview_pdf"));
|
||||
?>
|
||||
<iframe src="<?= $settings->_httpRoot ?>pdfviewer/web/viewer.html?file=<?php echo urlencode($settings->_httpRoot.'op/op.PdfPreview.php?documentid='.$latestContent->getDocument()->getID().'&version='.$latestContent->getVersion()); ?>" width="100%" height="700px"></iframe>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
@ -496,7 +498,7 @@ $(document).ready( function() {
|
|||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$folder = $this->params['folder'];
|
||||
$accessop = $this->params['accessobject'];
|
||||
$accessobject = $this->params['accessobject'];
|
||||
$viewonlinefiletypes = $this->params['viewonlinefiletypes'];
|
||||
$enableownerrevapp = $this->params['enableownerrevapp'];
|
||||
$workflowmode = $this->params['workflowmode'];
|
||||
|
@ -518,10 +520,10 @@ $(document).ready( function() {
|
|||
$this->columnStart(4);
|
||||
if ($file_exists) {
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes))) {
|
||||
if($accessop->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
print "<a target=\"_blank\" href=\"".$this->params['settings']->_httpRoot."op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion()."\">";
|
||||
} else {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'version')))
|
||||
print "<a href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion()."\">";
|
||||
}
|
||||
}
|
||||
|
@ -531,7 +533,7 @@ $(document).ready( function() {
|
|||
} else {
|
||||
print "<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
}
|
||||
if ($file_exists && ($accessop->check_controller_access('ViewOnline', array('action'=>'run')) || $accessop->check_controller_access('Download', array('action'=>'version')))) {
|
||||
if ($file_exists && ($accessobject->check_controller_access('ViewOnline', array('action'=>'run')) || $accessobject->check_controller_access('Download', array('action'=>'version')))) {
|
||||
print "</a>";
|
||||
}
|
||||
// print "</td>\n";
|
||||
|
@ -575,9 +577,9 @@ $(document).ready( function() {
|
|||
$this->columnStart(4);
|
||||
if ($file_exists){
|
||||
$items = array();
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'version')))
|
||||
$items[] = array('link'=>$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'download', 'label'=>'download');
|
||||
if($accessop->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes)))
|
||||
$items[] = array('link'=>$this->params['settings']->_httpRoot."op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion(), 'icon'=>'eye', 'label'=>'view_online', 'target'=>'_blank');
|
||||
if($newitems = $this->callHook('extraVersionViews', $latestContent))
|
||||
|
@ -589,38 +591,40 @@ $(document).ready( function() {
|
|||
|
||||
$items = array();
|
||||
if ($file_exists){
|
||||
if($islatest && $accessop->mayEditVersion()) {
|
||||
if($islatest && $accessobject->mayEditVersion()) {
|
||||
$items[] = array('link'=>$this->params['settings']->_httpRoot."out/out.EditOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'edit', 'label'=>'edit_version');
|
||||
}
|
||||
}
|
||||
/* Only admin has the right to remove version in any case or a regular
|
||||
* user if enableVersionDeletion is on
|
||||
*/
|
||||
if($accessop->mayRemoveVersion()) {
|
||||
if($accessobject->mayRemoveVersion()) {
|
||||
$items[] = array('link'=>$this->params['settings']->_httpRoot."out/out.RemoveVersion.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'remove', 'label'=>'rm_version');
|
||||
}
|
||||
if($islatest && $accessop->mayOverwriteStatus()) {
|
||||
if($islatest && $accessobject->mayOverwriteStatus()) {
|
||||
$items[] = array('link'=>$this->params['settings']->_httpRoot."out/out.OverrideContentStatus.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'align-justify', 'label'=>'change_status');
|
||||
}
|
||||
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||
// Allow changing reviewers/approvals only if not reviewed
|
||||
if($accessop->maySetReviewersApprovers()) {
|
||||
if($accessobject->maySetReviewersApprovers()) {
|
||||
$items[] = array('link'=>$this->params['settings']->_httpRoot."out/out.SetReviewersApprovers.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'edit', 'label'=>'change_assignments');
|
||||
}
|
||||
} elseif($workflowmode == 'advanced') {
|
||||
if($accessop->maySetWorkflow()) {
|
||||
if($accessobject->maySetWorkflow()) {
|
||||
$workflow = $latestContent->getWorkflow();
|
||||
if(!$workflow) {
|
||||
$items[] = array('link'=>$this->params['settings']->_httpRoot."out/out.SetWorkflow.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'random', 'label'=>'set_workflow');
|
||||
}
|
||||
}
|
||||
}
|
||||
if($accessop->mayEditComment()) {
|
||||
$items[] = array('link'=>"out.EditComment.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'comment', 'label'=>'edit_comment');
|
||||
}
|
||||
if($accessop->mayEditAttributes()) {
|
||||
$items[] = array('link'=>"out.EditAttributes.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'edit', 'label'=>'edit_attributes');
|
||||
}
|
||||
if($accessobject->check_view_access('EditComment'))
|
||||
if($accessobject->mayEditComment()) {
|
||||
$items[] = array('link'=>"out.EditComment.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'comment', 'label'=>'edit_comment');
|
||||
}
|
||||
if($accessobject->check_view_access('EditAttributes'))
|
||||
if($accessobject->mayEditAttributes()) {
|
||||
$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');
|
||||
|
||||
|
@ -645,7 +649,7 @@ $(document).ready( function() {
|
|||
$user = $this->params['user'];
|
||||
$folder = $this->params['folder'];
|
||||
$document = $this->params['document'];
|
||||
$accessop = $this->params['accessobject'];
|
||||
$accessobject = $this->params['accessobject'];
|
||||
$viewonlinefiletypes = $this->params['viewonlinefiletypes'];
|
||||
$enableownerrevapp = $this->params['enableownerrevapp'];
|
||||
$enableremoverevapp = $this->params['enableremoverevapp'];
|
||||
|
@ -733,8 +737,9 @@ $(document).ready( function() {
|
|||
if(is_string($txt))
|
||||
echo $txt;
|
||||
$this->documentInfos();
|
||||
$this->preview();
|
||||
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
|
||||
$this->preview();
|
||||
}
|
||||
$this->columnEnd();
|
||||
$this->columnStart(8);
|
||||
|
||||
|
@ -927,23 +932,25 @@ $(document).ready( function() {
|
|||
print htmlspecialchars($r["comment"]);
|
||||
if($r['file']) {
|
||||
echo "<br />";
|
||||
echo "<a href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$documentid."&reviewlogid=".$r['reviewLogID']."\" class=\"btn btn-secondary btn-mini\"><i class=\"fa fa-download\"></i> ".getMLText('download')."</a>";
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'run'))) {
|
||||
echo "<a href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&reviewlogid=".$r['reviewLogID']."\" class=\"btn btn-secondary btn-mini\"><i class=\"fa fa-download\"></i> ".getMLText('download')."</a>";
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
print "<td>";
|
||||
if($class)
|
||||
echo "<i class=\"fa fa-circle text-".$class."\"></i> ";
|
||||
print getReviewStatusText($r["status"])."</td>\n";
|
||||
print "<td>";
|
||||
if($class)
|
||||
echo "<i class=\"fa fa-circle text-".$class."\"></i> ";
|
||||
print getReviewStatusText($r["status"])."</td>\n";
|
||||
print "<td><ul class=\"actions unstyled\">";
|
||||
if($accesserr)
|
||||
echo "<li><span class=\"text-error\">".$accesserr."</span></li>";
|
||||
|
||||
if($accessop->mayReview()) {
|
||||
echo "<li><span class=\"text-error\">".$accesserr."</span></li>";
|
||||
|
||||
if($accessobject->mayReview()) {
|
||||
if ($is_reviewer) {
|
||||
if ($r["status"]==0) {
|
||||
print "<li><a href=\"".$this->params['settings']->_httpRoot."out/out.ReviewDocument.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion()."&reviewid=".$r['reviewID']."\" class=\"btn btn-primary btn-mini\">".getMLText("add_review")."</a></li>";
|
||||
} elseif ($accessop->mayUpdateReview($updateUser) && (($r["status"]==1)||($r["status"]==-1))) {
|
||||
print "<li><a href=\"".$this->params['settings']->_httpRoot."out/out.ReviewDocument.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion()."&reviewid=".$r['reviewID']."\" class=\"btn btn-primary btn-mini\">".getMLText("edit")."</a></li>";
|
||||
print $this->html_link('ReviewDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'reviewid'=>$r['reviewID']), array('class'=>'btn btn-mini btn-primary'), getMLText("add_review"), false, true, array('<li>', '</li>'));
|
||||
} elseif ($accessobject->mayUpdateReview($updateUser) && (($r["status"]==1)||($r["status"]==-1))){
|
||||
print $this->html_link('ReviewDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'reviewid'=>$r['reviewID']), array('class'=>'btn btn-mini btn-primary'), getMLText("edit"), false, true, array('<li>', '</li>'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1031,23 +1038,25 @@ $(document).ready( function() {
|
|||
print htmlspecialchars($a["comment"]);
|
||||
if($a['file']) {
|
||||
echo "<br />";
|
||||
echo "<a href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$documentid."&approvelogid=".$a['approveLogID']."\" class=\"btn btn-secondary btn-mini\"><i class=\"fa fa-download\"></i> ".getMLText('download')."</a>";
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'run'))) {
|
||||
echo "<a href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&approvelogid=".$a['approveLogID']."\" class=\"btn btn-secondary btn-mini\"><i class=\"fa fa-download\"></i> ".getMLText('download')."</a>";
|
||||
}
|
||||
}
|
||||
echo "</td>\n";
|
||||
print "<td>";
|
||||
if($class)
|
||||
echo "<i class=\"fa fa-circle text-".$class."\"></i> ";
|
||||
print getApprovalStatusText($a["status"])."</td>\n";
|
||||
print "<td>";
|
||||
if($class)
|
||||
echo "<i class=\"fa fa-circle text-".$class."\"></i> ";
|
||||
print getApprovalStatusText($a["status"])."</td>\n";
|
||||
print "<td><ul class=\"actions unstyled\">";
|
||||
if($accesserr)
|
||||
echo "<li><span class=\"text-error\">".$accesserr."</span></li>";
|
||||
|
||||
if($accessop->mayApprove()) {
|
||||
echo "<li><span class=\"text-error\">".$accesserr."</span></li>";
|
||||
|
||||
if($accessobject->mayApprove()) {
|
||||
if ($is_approver) {
|
||||
if ($a['status'] == 0) {
|
||||
print "<li><a class=\"btn btn-primary btn-mini\" href=\"".$this->params['settings']->_httpRoot."out/out.ApproveDocument.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion()."&approveid=".$a['approveID']."\">".getMLText("add_approval")."</a></li>";
|
||||
} elseif ($accessop->mayUpdateApproval($updateUser) && (($a["status"]==1)||($a["status"]==-1))) {
|
||||
print "<li><a class=\"btn btn-primary btn-mini\" href=\"".$this->params['settings']->_httpRoot."out/out.ApproveDocument.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion()."&approveid=".$a['approveID']."\">".getMLText("edit")."</a></li>";
|
||||
print $this->html_link('ApproveDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'approveid'=>$a['approveID']), array('class'=>'btn btn-mini btn-primary'), getMLText("add_approval"), false, true, array('<li>', '</li>'));
|
||||
} elseif ($accessobject->mayUpdateApproval($updateUser) && (($a["status"]==1)||($a["status"]==-1))){
|
||||
print $this->html_link('ApproveDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'approveid'=>$a['approveID']), array('class'=>'btn btn-mini btn-primary'), getMLText("edit"), false, true, array('<li>', '</li>'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1100,7 +1109,7 @@ $(document).ready( function() {
|
|||
<div class="tab-pane <?php if($currenttab == 'workflow') echo 'active'; ?>" id="workflow" role="tabpanel">
|
||||
<?php
|
||||
$this->rowStart();
|
||||
if($user_is_involved || $user->isAdmin())
|
||||
if ($user_is_involved && $accessobject->check_view_access('WorkflowGraph'))
|
||||
$this->columnStart(6);
|
||||
else
|
||||
$this->columnStart(12);
|
||||
|
@ -1288,7 +1297,7 @@ $(document).ready( function() {
|
|||
}
|
||||
$this->contentContainerEnd();
|
||||
$this->columnEnd();
|
||||
if($user_is_involved || $user->isAdmin()) {
|
||||
if ($user_is_involved && $accessobject->check_view_access('WorkflowGraph')) {
|
||||
$this->columnStart(6);
|
||||
?>
|
||||
<iframe src="out.WorkflowGraph.php?workflow=<?php echo $workflow->getID(); ?><?php if($allowedtransitions) foreach($allowedtransitions as $tr) {echo "&transitions[]=".$tr->getID();} ?>" width="99%" height="661" style="border: 1px solid #AAA;"></iframe>
|
||||
|
@ -1343,10 +1352,15 @@ $(document).ready( function() {
|
|||
print "<td>";
|
||||
$previewer->createPreview($file, $previewwidthdetail);
|
||||
if($file_exists) {
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($file->getFileType()), $viewonlinefiletypes) || in_array(strtolower($file->getMimeType()), $viewonlinefiletypes)))
|
||||
print "<a target=\"_blank\" href=\"".$this->params['settings']->_httpRoot."op/op.ViewOnline.php?documentid=".$documentid."&file=". $file->getID()."\">";
|
||||
else
|
||||
print "<a href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$documentid."&file=".$file->getID()."\">";
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($file->getFileType()), $viewonlinefiletypes) || in_array(strtolower($file->getMimeType()), $viewonlinefiletypes))) {
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
|
||||
print "<a target=\"_blank\" href=\"".$this->params['settings']->_httpRoot."op/op.ViewOnline.php?documentid=".$documentid."&file=". $file->getID()."\">";
|
||||
}
|
||||
} else {
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'file'))) {
|
||||
print "<a href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$documentid."&file=".$file->getID()."\">";
|
||||
}
|
||||
}
|
||||
}
|
||||
if($previewer->hasPreview($file)) {
|
||||
print("<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"".$this->params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&file=".$file->getID()."&width=".$previewwidthdetail."\" title=\"".htmlspecialchars($file->getMimeType())."\">");
|
||||
|
@ -1354,7 +1368,8 @@ $(document).ready( function() {
|
|||
print "<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"".$this->getMimeIcon($file->getFileType())."\" title=\"".htmlspecialchars($file->getMimeType())."\">";
|
||||
}
|
||||
if($file_exists) {
|
||||
print "</a>";
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'run')) || $accessobject->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
print "</a>";
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
|
@ -1377,9 +1392,14 @@ $(document).ready( function() {
|
|||
|
||||
print "<td><ul class=\"unstyled actions\">";
|
||||
if ($file_exists) {
|
||||
print "<li><a href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$documentid."&file=".$file->getID()."\"><i class=\"fa fa-download\"></i>".getMLText('download')."</a>";
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($file->getFileType()), $viewonlinefiletypes) || in_array(strtolower($file->getMimeType()), $viewonlinefiletypes)))
|
||||
print "<li><a target=\"_blank\" href=\"".$this->params['settings']->_httpRoot."op/op.ViewOnline.php?documentid=".$documentid."&file=". $file->getID()."\"><i class=\"fa fa-star\"></i>" . getMLText("view_online") . "</a></li>";
|
||||
if($accessobject->check_controller_access('Download', array('action'=>'file'))) {
|
||||
print "<li><a href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$documentid."&file=".$file->getID()."\"><i class=\"fa fa-download\"></i>".getMLText('download')."</a></li>";
|
||||
}
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($file->getFileType()), $viewonlinefiletypes) || in_array(strtolower($file->getMimeType()), $viewonlinefiletypes))) {
|
||||
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
|
||||
print "<li><a target=\"_blank\" href=\"".$this->params['settings']->_httpRoot."op/op.ViewOnline.php?documentid=".$documentid."&file=". $file->getID()."\"><i class=\"fa fa-star\"></i>" . getMLText("view_online") . "</a></li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</ul><ul class=\"unstyled actions\">";
|
||||
if (($document->getAccessMode($user) == M_ALL)||($file->getUserID()==$user->getID())) {
|
||||
|
@ -1395,13 +1415,15 @@ $(document).ready( function() {
|
|||
}
|
||||
else $this->infoMsg(getMLText("no_attached_files"));
|
||||
|
||||
if ($document->getAccessMode($user) >= M_READWRITE){
|
||||
if(0){
|
||||
if($accessobject->check_controller_access('AddFile')) {
|
||||
if ($document->getAccessMode($user) >= M_READWRITE){
|
||||
if(0){
|
||||
?>
|
||||
<div id="_draganddrophandler" class="droptarget well alert" data-droptarget="attachment_<?= $document->getID(); ?>" data-target="<?= $document->getID(); ?>" data-uploadformtoken="<?= createFormKey(''); ?>"><?php printMLText('drop_files_here'); ?><a href="<?= $this->params['settings']->_httpRoot ?>out/out.AddFile.php?documentid=<?= $documentid ?>"> <?= getMLText("add") ?></a></div>
|
||||
<?php
|
||||
}
|
||||
print $this->html_link('AddFile', array('documentid'=>$documentid), array('class'=>'btn btn-primary'), getMLText("add"), false, true)."\n";
|
||||
}
|
||||
print "<a href=\"".$this->params['settings']->_httpRoot."out/out.AddFile.php?documentid=".$documentid."\" class=\"btn btn-primary\">".getMLText("add")."</a>\n";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
@ -1443,7 +1465,7 @@ $(document).ready( function() {
|
|||
}
|
||||
else $this->infoMsg(getMLText("no_linked_files"));
|
||||
|
||||
if (!$user->isGuest()){
|
||||
if ($accessobject->check_view_access('AddDocumentLink')){
|
||||
?>
|
||||
<br>
|
||||
<form action="<?= $this->params['settings']->_httpRoot ?>op/op.AddDocumentLink.php" id="form1" name="form1" class="form-horizontal">
|
||||
|
|
Loading…
Reference in New Issue
Block a user