do not use $this->check_access() anymore

This commit is contained in:
Uwe Steinmann 2019-11-20 13:47:57 +01:00
parent d2382f437c
commit 55727bd1a2
6 changed files with 73 additions and 69 deletions

View File

@ -133,6 +133,7 @@ $(document).ready( function() {
$dms = $this->params['dms'];
$user = $this->params['user'];
$selrole = $this->params['selrole'];
$accessobject = $this->params['accessobject'];
if($selrole) {
$this->contentHeading(getMLText("role_info"));
@ -148,11 +149,11 @@ $(document).ready( function() {
echo "<br /><small>".htmlspecialchars($currUser->getComment())."</small>";
echo "</td>";
echo "<td>";
if($this->check_access(array('UsrMgr', 'RemoveUser'))) {
if($accessobject->check_view_access(array('UsrMgr', 'RemoveUser'))) {
echo "<div class=\"list-action\">";
if($this->check_access('UsrMgr'))
if($accessobject->check_view_access('UsrMgr'))
echo "<a href=\"../out/out.UsrMgr.php?userid=".$currUser->getID()."\"><i class=\"icon-edit\"></i></a> ";
if($this->check_access('RemoveUser'))
if($accessobject->check_view_access('RemoveUser'))
echo "<a href=\"../out/out.RemoveUser.php?userid=".$currUser->getID()."\"><i class=\"icon-remove\"></i></a>";
echo "</div>";
}

View File

@ -73,6 +73,7 @@ $(document).ready( function() {
$user = $this->params['user'];
$selrole = $this->params['selrole'];
$settings = $this->params['settings'];
$accessobject = $this->params['accessobject'];
if($selrole) {
$this->contentHeading(getMLText("role_info"));
@ -88,7 +89,7 @@ $(document).ready( function() {
echo "<br /><small>".htmlspecialchars($currUser->getComment())."</small>";
echo "</td>";
echo "<td>";
if($this->check_access(array('UsrMgr', 'RemoveUser'))) {
if($accessobject->check_view_access(array('UsrMgr', 'RemoveUser'))) {
echo "<div class=\"list-action\">";
echo $this->html_link('UsrMgr', array('userid'=>$currUser->getID()), array(), '<i class="icon-edit"></i>', false);
echo $this->html_link('RemoveUser', array('userid'=>$currUser->getID()), array(), '<i class="icon-remove"></i>', false);

View File

@ -227,6 +227,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Bootstrap_Style {
function menuTasks() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$accessobject = $this->params['accessobject'];
$tasks = $this->__myTasks();
if(!$tasks)
@ -320,7 +321,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Bootstrap_Style {
$content .= " </ul>\n";
$content .= " </li>\n";
}
if ($this->check_access('MyDocuments')) {
if ($accessobject->check_view_access('MyDocuments')) {
$content .= " <li class=\"divider\"></li>\n";
$content .= " <li><a href=\"../out/out.MyDocuments.php\">".getMLText("my_documents")."</a></li>\n";
}

View File

@ -38,6 +38,7 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style {
$httproot = $this->params['httproot'];
$quota = $this->params['quota'];
$pwdexpiration = $this->params['pwdexpiration'];
$accessobject = $this->params['accessobject'];
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
@ -104,7 +105,7 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style {
}
echo "</td>";
echo "<td>";
if($this->check_access(array('UsrMgr', 'RemoveUser'))) {
if($accessobject->check_view_access(array('UsrMgr', 'RemoveUser'))) {
echo "<div class=\"list-action\">";
echo $this->html_link('UsrMgr', array('userid'=>$currUser->getID()), array(), '<i class="icon-edit"></i>', false);
echo $this->html_link('RemoveUser', array('userid'=>$currUser->getID()), array(), '<i class="icon-remove"></i>', false);

View File

@ -194,6 +194,7 @@ $(document).ready( function() {
$quota = $this->params['quota'];
$undeluserids = $this->params['undeluserids'];
$enableemail = $this->params['enableemail'];
$accessobject = $this->params['accessobject'];
if($seluser) {
?>
@ -205,7 +206,7 @@ $(document).ready( function() {
<ul class="dropdown-menu">
<?php
$menuitems = array();
if(!in_array($seluser->getID(), $undeluserids) && $this->check_access('RemoveUser')) {
if(!in_array($seluser->getID(), $undeluserids) && $accessobject->check_view_access('RemoveUser')) {
$menuitems['removeuser'] = array('link'=>$this->html_url('RemoveUser', array('userid'=>$seluser->getID())), 'label'=>'<i class="icon-remove"></i> '.getMLText("rm_user"));
}
$menuitems['removeuserfromprozess'] = array('link'=>$this->html_url('RemoveUserFromProcesses', array('userid'=>$seluser->getID())), 'label'=>'<i class="icon-remove"></i> '.getMLText("rm_user_from_processes"));
@ -248,7 +249,6 @@ $(document).ready( function() {
$undeluserids = $this->params['undeluserids'];
$workflowmode = $this->params['workflowmode'];
$quota = $this->params['quota'];
$accessop = $this->params['accessobject'];
?>
<form class="form-horizontal" action="../op/op.UsrMgr.php" method="post" enctype="multipart/form-data" name="form" id="form">
<?php
@ -586,7 +586,7 @@ $(document).ready( function() {
$undeluserids = $this->params['undeluserids'];
$workflowmode = $this->params['workflowmode'];
$quota = $this->params['quota'];
$accessop = $this->params['accessobject'];
$accessobject = $this->params['accessobject'];
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
@ -616,17 +616,17 @@ $(document).ready( function() {
);
?>
</form>
<?php if($accessop->check_view_access($this, array('action'=>'actionmenu'))) { ?>
<?php if($accessobject->check_view_access($this, array('action'=>'actionmenu'))) { ?>
<div class="ajax" style="margin-bottom: 15px;" data-view="UsrMgr" data-action="actionmenu" <?php echo ($seluser ? "data-query=\"userid=".$seluser->getID()."\"" : "") ?>></div>
<?php } ?>
<?php if($accessop->check_view_access($this, array('action'=>'info'))) { ?>
<?php if($accessobject->check_view_access($this, array('action'=>'info'))) { ?>
<div class="ajax" data-view="UsrMgr" data-action="info" <?php echo ($seluser ? "data-query=\"userid=".$seluser->getID()."\"" : "") ?>></div>
<?php } ?>
</div>
<div class="span8">
<?php $this->contentContainerStart(); ?>
<?php if($accessop->check_view_access($this, array('action'=>'form'))) { ?>
<?php if($accessobject->check_view_access($this, array('action'=>'form'))) { ?>
<div class="ajax" data-view="UsrMgr" data-action="form" <?php echo ($seluser ? "data-query=\"userid=".$seluser->getID()."\"" : "") ?>></div>
<?php } ?>
</div>

View File

@ -359,8 +359,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
if(!$showfullpreview)
return;
$accessop = $this->params['accessobject'];
if($accessop->check_controller_access('ViewOnline', array('action'=>'version'))) {
$accessobject = $this->params['accessobject'];
if($accessobject->check_controller_access('ViewOnline', array('action'=>'version'))) {
$latestContent = $this->callHook('documentLatestContent', $document);
if($latestContent === null)
$latestContent = $document->getLatestContent();
@ -444,7 +444,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$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'];
$enableownerreceipt = $this->params['enableownerreceipt'];
@ -535,7 +535,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
if(is_string($txt))
echo $txt;
$this->documentInfos();
if($accessop->check_controller_access('ViewOnline', array('action'=>'run'))) {
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
$this->preview();
}
?>
@ -614,11 +614,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$previewer->createPreview($latestContent);
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=\"../op/op.ViewOnline.php?documentid=".$documentid."&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=\"../op/op.Download.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\">";
}
}
@ -629,7 +629,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
}
if ($file_exists) {
if($accessop->check_controller_access('Download', array('action'=>'run')) || $accessop->check_controller_access('ViewOnline', array('action'=>'run')))
if($accessobject->check_controller_access('Download', array('action'=>'run')) || $accessobject->check_controller_access('ViewOnline', array('action'=>'run')))
print "</a>";
}
print "</td>\n";
@ -682,69 +682,69 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<ul class=\"unstyled actions\">";
if ($file_exists){
if($accessop->check_controller_access('Download', array('action'=>'version'))) {
if($accessobject->check_controller_access('Download', array('action'=>'version'))) {
print "<li><a href=\"../op/op.Download.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\"><i class=\"icon-download\"></i>".getMLText("download")."</a></li>";
}
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)))
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=". $latestContent->getVersion()."\"><i class=\"icon-star\"></i>" . getMLText("view_online") . "</a></li>";
}
}
print "</ul>";
print "<ul class=\"unstyled actions\">";
if($this->check_access('EditOnline'))
if($accessop->mayEditVersion($document)) {
if($accessobject->check_view_access('EditOnline'))
if($accessobject->mayEditVersion($document)) {
print "<li>".$this->html_link('EditOnline', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-edit\"></i>".getMLText("edit_version"), false, true)."</li>";
}
/* Only admin has the right to remove version in any case or a regular
* user if enableVersionDeletion is on
*/
if($accessop->check_controller_access('RemoveVersion'))
if($accessop->mayRemoveVersion($document)) {
if($accessobject->check_controller_access('RemoveVersion'))
if($accessobject->mayRemoveVersion($document)) {
print "<li>".$this->html_link('RemoveVersion', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-remove\"></i>".getMLText("rm_version"), false, true)."</li>";
}
if($accessop->check_controller_access('OverrideContentStatus'))
if($accessop->mayOverrideStatus($document)) {
if($accessobject->check_controller_access('OverrideContentStatus'))
if($accessobject->mayOverrideStatus($document)) {
print "<li>".$this->html_link('OverrideContentStatus', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-align-justify\"></i>".getMLText("change_status"), false, true)."</li>";
}
if($enablereceiptworkflow && $accessop->check_controller_access('SetRecipients'))
if($accessop->maySetRecipients($document)) {
if($enablereceiptworkflow && $accessobject->check_controller_access('SetRecipients'))
if($accessobject->maySetRecipients($document)) {
print "<li>".$this->html_link('SetRecipients', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-check\"></i>".getMLText("change_recipients"), false, true)."</li>";
}
if($enablerevisionworkflow && $accessop->check_controller_access('SetRevisors'))
if($accessop->maySetRevisors($document)) {
if($enablerevisionworkflow && $accessobject->check_controller_access('SetRevisors'))
if($accessobject->maySetRevisors($document)) {
print "<li>".$this->html_link('SetRevisors', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-refresh\"></i>".getMLText("change_revisors"), false, true)."</li>";
}
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
// Allow changing reviewers/approvals only if not reviewed
if($accessop->check_controller_access('SetReviewersApprovers'))
if($accessop->maySetReviewersApprovers($document)) {
if($accessobject->check_controller_access('SetReviewersApprovers'))
if($accessobject->maySetReviewersApprovers($document)) {
print "<li>".$this->html_link('SetReviewersApprovers', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-edit\"></i>".getMLText("change_assignments"), false, true)."</li>";
}
} else {
if($accessop->check_controller_access('SetWorkflow'))
if($accessop->maySetWorkflow($document)) {
if($accessobject->check_controller_access('SetWorkflow'))
if($accessobject->maySetWorkflow($document)) {
if(!$workflow) {
print "<li>".$this->html_link('SetWorkflow', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-random\"></i>".getMLText("set_workflow"), false, true)."</li>";
}
}
}
/*
if($accessop->maySetExpires($document)) {
if($accessobject->maySetExpires($document)) {
print "<li>".$this->html_link('SetExpires', array('documentid'=>$documentid), array(), "<i class=\"icon-time\"></i>".getMLText("set_expiry"), false, true)."</li>";
}
*/
if($accessop->check_controller_access('AddToTransmittal'))
if($accessobject->check_controller_access('AddToTransmittal'))
if($dms->getAllTransmittals($user)) {
if($this->check_access('AddToTransmittal'))
if($accessobject->check_view_access('AddToTransmittal'))
print "<li>".$this->html_link('AddToTransmittal', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-list\"></i>".getMLText("add_to_transmittal"), false, true)."</li>";
}
if($accessop->check_controller_access('EditComment'))
if($accessop->mayEditComment($document)) {
if($accessobject->check_controller_access('EditComment'))
if($accessobject->mayEditComment($document)) {
print "<li>".$this->html_link('EditComment', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-comment\"></i>".getMLText("edit_comment"), false, true)."</li>";
}
if($accessop->check_controller_access('EditAttributes'))
if($accessop->mayEditAttributes($document)) {
if($accessobject->check_controller_access('EditAttributes'))
if($accessobject->mayEditAttributes($document)) {
print "<li>".$this->html_link('EditAttributes', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion()), array(), "<i class=\"icon-edit\"></i>".getMLText("edit_attributes"), false, true)."</li>";
}
@ -881,7 +881,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print htmlspecialchars($r["comment"]);
if($r['file']) {
echo "<br />";
if($accessop->check_controller_access('Download', array('action'=>'run'))) {
if($accessobject->check_controller_access('Download', array('action'=>'run'))) {
echo "<a href=\"../op/op.Download.php?documentid=".$documentid."&reviewlogid=".$r['reviewLogID']."\" class=\"btn btn-mini\"><i class=\"icon-download\"></i> ".getMLText('download')."</a>";
}
}
@ -891,11 +891,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
if($accesserr)
echo "<li><span class=\"alert alert-error\">".$accesserr."</span></li>";
if($accessop->mayReview($document)) {
if($accessobject->mayReview($document)) {
if ($is_reviewer) {
if ($r["status"]==0) {
print "<li>".$this->html_link('ReviewDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'reviewid'=>$r['reviewID']), array('class'=>'btn btn-mini'), getMLText("add_review"), false, true)."</li>";
} elseif ($accessop->mayUpdateReview($document, $updateUser) && (($r["status"]==1)||($r["status"]==-1))){
} elseif ($accessobject->mayUpdateReview($document, $updateUser) && (($r["status"]==1)||($r["status"]==-1))){
print "<li>".$this->html_link('ReviewDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'reviewid'=>$r['reviewID']), array('class'=>'btn btn-mini'), getMLText("edit"), false, true)."</li>";
}
}
@ -973,7 +973,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print htmlspecialchars($a["comment"]);
if($a['file']) {
echo "<br />";
if($accessop->check_controller_access('Download', array('action'=>'run'))) {
if($accessobject->check_controller_access('Download', array('action'=>'run'))) {
echo "<a href=\"../op/op.Download.php?documentid=".$documentid."&approvelogid=".$a['approveLogID']."\" class=\"btn btn-mini\"><i class=\"icon-download\"></i> ".getMLText('download')."</a>";
}
}
@ -983,11 +983,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
if($accesserr)
echo "<li><span class=\"alert alert-error\">".$accesserr."</span></li>";
if($accessop->mayApprove($document)) {
if($accessobject->mayApprove($document)) {
if ($is_approver) {
if ($a['status'] == 0) {
print "<li>".$this->html_link('ApproveDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'approveid'=>$a['approveID']), array('class'=>'btn btn-mini'), getMLText("add_approval"), false, true)."</li>";
} elseif ($accessop->mayUpdateApproval($document, $updateUser) && (($a["status"]==1)||($a["status"]==-1))){
} elseif ($accessobject->mayUpdateApproval($document, $updateUser) && (($a["status"]==1)||($a["status"]==-1))){
print "<li>".$this->html_link('ApproveDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'approveid'=>$a['approveID']), array('class'=>'btn btn-mini'), getMLText("edit"), false, true)."</li>";
}
}
@ -1045,7 +1045,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
<div class="tab-pane <?php if($currenttab == 'workflow') echo 'active'; ?>" id="workflow">
<?php
echo "<div class=\"row-fluid\">";
if ($user_is_involved && $this->check_access('WorkflowGraph'))
if ($user_is_involved && $accessobject->check_view_access('WorkflowGraph'))
echo "<div class=\"span6\">";
else
echo "<div class=\"span12\">";
@ -1233,7 +1233,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
}
$this->contentContainerEnd();
echo "</div>";
if ($user_is_involved && $this->check_access('WorkflowGraph')) {
if ($user_is_involved && $accessobject->check_view_access('WorkflowGraph')) {
echo "<div class=\"span6\">";
?>
<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>
@ -1322,11 +1322,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<td><ul class=\"unstyled\">";
if($accesserr)
echo "<li><span class=\"alert alert-error\">".$accesserr."</span></li>";
if($accessop->mayReceipt($document)) {
if($accessobject->mayReceipt($document)) {
if ($is_recipient) {
if($r["status"]==0) {
print "<li>".$this->html_link('ReceiptDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'receiptid'=>$r['receiptID']), array('class'=>'btn btn-mini'), getMLText("add_receipt"), false, true)."</li>";
} elseif ($accessop->mayUpdateReceipt($document, $updateUser) && (($r["status"]==1 && $enablereceiptreject)||($r["status"]==-1))) {
} elseif ($accessobject->mayUpdateReceipt($document, $updateUser) && (($r["status"]==1 && $enablereceiptreject)||($r["status"]==-1))) {
print "<li>".$this->html_link('ReceiptDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'receiptid'=>$r['receiptID']), array('class'=>'btn btn-mini'), getMLText("edit"), false, true)."</li>";
}
}
@ -1340,7 +1340,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
</table>
<?php
$this->contentContainerEnd();
if($accessop->check_view_access('ViewDocument', array('action'=>'receptionBar'))/* $user->isAdmin() || $user->getId() == $document->getOwner()->getId()*/) {
if($accessobject->check_view_access('ViewDocument', array('action'=>'receptionBar'))/* $user->isAdmin() || $user->getId() == $document->getOwner()->getId()*/) {
/* Do not count entries '-2' as they are removed userѕ */
$totalreceipts = $stat['-1'] + $stat['0'] + $stat['1'];
?>
@ -1448,7 +1448,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<td><ul class=\"unstyled\">";
if($accesserr)
echo "<li><span class=\"alert alert-error\">".$accesserr."</span></li>";
if($accessop->mayRevise($document)) {
if($accessobject->mayRevise($document)) {
if ($is_recipient && $r["status"]==0) {
print "<li>".$this->html_link('ReviseDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'revisionid'=>$r['revisionID']), array('class'=>'btn btn-mini'), getMLText("add_revision"), false, true)."</li>";
} elseif (($updateUser==$user)&&(($r["status"]==1)||($r["status"]==-1))&&(!$document->hasExpired())){
@ -1505,11 +1505,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
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($accessop->check_controller_access('ViewOnline', array('action'=>'run'))) {
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
print "<a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=".$version->getVersion()."\">";
}
} else {
if($accessop->check_controller_access('Download', array('action'=>'version'))) {
if($accessobject->check_controller_access('Download', array('action'=>'version'))) {
print "<a href=\"../op/op.Download.php?documentid=".$documentid."&version=".$version->getVersion()."\">";
}
}
@ -1521,7 +1521,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
}
if($file_exists) {
if($accessop->check_controller_access('Download', array('action'=>'run')) || $accessop->check_controller_access('ViewOnline', array('action'=>'run')))
if($accessobject->check_controller_access('Download', array('action'=>'run')) || $accessobject->check_controller_access('ViewOnline', array('action'=>'run')))
print "</a>\n";
}
print "</td>\n";
@ -1560,11 +1560,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<td>";
print "<ul class=\"actions unstyled\">";
if ($file_exists){
if($accessop->check_controller_access('Download', array('action'=>'version'))) {
if($accessobject->check_controller_access('Download', array('action'=>'version'))) {
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) || in_array(strtolower($version->getMimeType()), $viewonlinefiletypes)))
if($accessop->check_controller_access('ViewOnline', array('action'=>'run'))) {
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=".$version->getVersion()."\"><i class=\"icon-star\"></i>" . getMLText("view_online") . "</a>";
}
print "</ul>";
@ -1573,15 +1573,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
/* Only admin has the right to remove version in any case or a regular
* user if enableVersionDeletion is on
*/
if($accessop->mayRemoveVersion($document)) {
if($accessobject->mayRemoveVersion($document)) {
print "<li>".$this->html_link('RemoveVersion', array('documentid'=>$documentid, 'version'=>$version->getVersion()), array(), "<i class=\"icon-remove\"></i>".getMLText("rm_version"), false, true)."</li>";
}
if($accessop->check_controller_access('AddToTransmittal'))
if($accessobject->check_controller_access('AddToTransmittal'))
print "<li>".$this->html_link('AddToTransmittal', array('documentid'=>$documentid, 'version'=>$version->getVersion()), array(), "<i class=\"icon-list\"></i>".getMLText("add_to_transmittal"), false, true)."</li>";
if($accessop->mayEditComment($document)) {
if($accessobject->mayEditComment($document)) {
print "<li>".$this->html_link('EditComment', array('documentid'=>$documentid, 'version'=>$version->getVersion()), array(), "<i class=\"icon-comment\"></i>".getMLText("edit_comment"), false, true)."</li>";
}
if($accessop->mayEditAttributes($document)) {
if($accessobject->mayEditAttributes($document)) {
print "<li>".$this->html_link('EditAttributes', array('documentid'=>$documentid, 'version'=>$version->getVersion()), array(), "<i class=\"icon-edit\"></i>".getMLText("edit_attributes"), false, true)."</li>";
}
print "<li>".$this->html_link('DocumentVersionDetail', array('documentid'=>$documentid, 'version'=>$version->getVersion()), array(), "<i class=\"icon-info-sign\"></i>".getMLText("details"), false, true)."</li>";
@ -1630,11 +1630,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$previewer->createPreview($file, $previewwidthdetail);
if($file_exists) {
if ($viewonlinefiletypes && (in_array(strtolower($file->getFileType()), $viewonlinefiletypes) || in_array(strtolower($file->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=\"../op/op.ViewOnline.php?documentid=".$documentid."&file=". $file->getID()."\">";
}
} else {
if($accessop->check_controller_access('Download', array('action'=>'file'))) {
if($accessobject->check_controller_access('Download', array('action'=>'file'))) {
print "<a href=\"../op/op.Download.php?documentid=".$documentid."&file=".$file->getID()."\">";
}
}
@ -1645,7 +1645,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"".$this->getMimeIcon($file->getFileType())."\" title=\"".htmlspecialchars($file->getMimeType())."\">";
}
if($file_exists) {
if($accessop->check_controller_access('Download', array('action'=>'run')) || $accessop->check_controller_access('ViewOnline', array('action'=>'run')))
if($accessobject->check_controller_access('Download', array('action'=>'run')) || $accessobject->check_controller_access('ViewOnline', array('action'=>'run')))
print "</a>";
}
print "</td>";
@ -1669,11 +1669,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<td><ul class=\"unstyled actions\">";
if ($file_exists) {
if($accessop->check_controller_access('Download', array('action'=>'file'))) {
if($accessobject->check_controller_access('Download', array('action'=>'file'))) {
print "<li><a href=\"../op/op.Download.php?documentid=".$documentid."&file=".$file->getID()."\"><i class=\"icon-download\"></i>".getMLText('download')."</a></li>";
}
if ($viewonlinefiletypes && (in_array(strtolower($file->getFileType()), $viewonlinefiletypes) || in_array(strtolower($file->getMimeType()), $viewonlinefiletypes))) {
if($accessop->check_controller_access('ViewOnline', array('action'=>'run'))) {
if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) {
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&file=". $file->getID()."\"><i class=\"icon-star\"></i>" . getMLText("view_online") . "</a></li>";
}
}
@ -1692,7 +1692,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
}
else printMLText("no_attached_files");
if($accessop->check_controller_access('AddFile')) {
if($accessobject->check_controller_access('AddFile')) {
if ($document->getAccessMode($user) >= M_READWRITE){
print "<ul class=\"unstyled\"><li>".$this->html_link('AddFile', array('documentid'=>$documentid), array('class'=>'btn'), getMLText("add"), false, true)."</li></ul>\n";
}