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

This commit is contained in:
Uwe Steinmann 2023-10-13 21:40:26 +02:00
commit ac69311242
9 changed files with 20 additions and 3 deletions

View File

@ -473,8 +473,11 @@ class SeedDMS_SessionMgr {
* *
* @return array list of sessions * @return array list of sessions
*/ */
function getUserSessions($user) { /* {{{ */ function getUserSessions($user, $limit=0) { /* {{{ */
$queryStr = "SELECT * FROM `tblSessions` WHERE `userID`=".$user->getID(); $queryStr = "SELECT * FROM `tblSessions` WHERE `userID`=".$user->getID();
$queryStr .= " ORDER BY `lastAccess` DESC";
if($limit > 0)
$queryStr .= " LIMIT ".(int) $limit;
$resArr = $this->db->getResultArray($queryStr); $resArr = $this->db->getResultArray($queryStr);
if (is_bool($resArr) && $resArr == false) if (is_bool($resArr) && $resArr == false)
return false; return false;

View File

@ -184,6 +184,8 @@ class Settings { /* {{{ */
var $_enableOwnerRevApp = false; var $_enableOwnerRevApp = false;
// enable/disable listing logged in user as reviewer/approver // enable/disable listing logged in user as reviewer/approver
var $_enableSelfRevApp = false; var $_enableSelfRevApp = false;
// enable/disable hidden user as reviewer/approver
var $_enableHiddenRevApp = false;
// enable/disable update of a review/approval by the reviewer/approver // enable/disable update of a review/approval by the reviewer/approver
var $_enableUpdateRevApp = false; var $_enableUpdateRevApp = false;
// enable/disable removal of a review/approval by the admiistrator // enable/disable removal of a review/approval by the admiistrator

View File

@ -80,6 +80,7 @@ if($view) {
$view->setParam('enableownerreceipt', $settings->_enableOwnerReceipt); $view->setParam('enableownerreceipt', $settings->_enableOwnerReceipt);
$view->setParam('enableselfreceipt', $settings->_enableSelfReceipt); $view->setParam('enableselfreceipt', $settings->_enableSelfReceipt);
$view->setParam('libraryfolder', $libfolder); $view->setParam('libraryfolder', $libfolder);
$view->setParam('enablehiddenrevapp', $settings->_enableHiddenRevApp);
$view->setParam('dropfolderdir', $settings->_dropFolderDir); $view->setParam('dropfolderdir', $settings->_dropFolderDir);
$view->setParam('dropfolderfile', isset($_REQUEST["dropfolderfileform1"]) ?$_REQUEST["dropfolderfileform1"] : ''); $view->setParam('dropfolderfile', isset($_REQUEST["dropfolderfileform1"]) ?$_REQUEST["dropfolderfileform1"] : '');
$view->setParam('workflowmode', $settings->_workflowMode); $view->setParam('workflowmode', $settings->_workflowMode);

View File

@ -69,6 +69,7 @@ if($view) {
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp); $view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp); $view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
$view->setParam('enableselfrevapp', $settings->_enableSelfRevApp); $view->setParam('enableselfrevapp', $settings->_enableSelfRevApp);
$view->setParam('enablehiddenrevapp', $settings->_enableHiddenRevApp);
$view->setParam('accessobject', $accessop); $view->setParam('accessobject', $accessop);
$view($_GET); $view($_GET);
exit; exit;

View File

@ -75,6 +75,7 @@ if($view) {
$view->setParam('enableselfrevapp', $settings->_enableSelfRevApp); $view->setParam('enableselfrevapp', $settings->_enableSelfRevApp);
$view->setParam('enablereceiptworkflow', $settings->_enableReceiptWorkflow); $view->setParam('enablereceiptworkflow', $settings->_enableReceiptWorkflow);
$view->setParam('enableselfreceipt', $settings->_enableSelfReceipt); $view->setParam('enableselfreceipt', $settings->_enableSelfReceipt);
$view->setParam('enablehiddenrevapp', $settings->_enableHiddenRevApp);
$view->setParam('dropfolderdir', $settings->_dropFolderDir); $view->setParam('dropfolderdir', $settings->_dropFolderDir);
$view->setParam('workflowmode', $settings->_workflowMode); $view->setParam('workflowmode', $settings->_workflowMode);
$view->setParam('presetexpiration', $settings->_presetExpirationDate); $view->setParam('presetexpiration', $settings->_presetExpirationDate);

View File

@ -161,6 +161,7 @@ console.log(params);
$enableadminreceipt = $this->params['enableadminreceipt']; $enableadminreceipt = $this->params['enableadminreceipt'];
$enableownerreceipt = $this->params['enableownerreceipt']; $enableownerreceipt = $this->params['enableownerreceipt'];
$enableselfreceipt = $this->params['enableselfreceipt']; $enableselfreceipt = $this->params['enableselfreceipt'];
$enablehiddenrevapp = $this->params['enablehiddenrevapp'];
$strictformcheck = $this->params['strictformcheck']; $strictformcheck = $this->params['strictformcheck'];
$nodocumentformfields = $this->params['nodocumentformfields']; $nodocumentformfields = $this->params['nodocumentformfields'];
$dropfolderdir = $this->params['dropfolderdir']; $dropfolderdir = $this->params['dropfolderdir'];
@ -531,6 +532,7 @@ console.log(params);
$options = array(); $options = array();
foreach ($docAccess["users"] as $usr) { foreach ($docAccess["users"] as $usr) {
if(!$enablehiddenrevapp && $usr->isHidden()) continue;
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue; if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
$mandatory=false; $mandatory=false;
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true; foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
@ -649,6 +651,7 @@ console.log(params);
$options = array(); $options = array();
foreach ($docAccess["users"] as $usr) { foreach ($docAccess["users"] as $usr) {
if(!$enablehiddenrevapp && $usr->isHidden()) continue;
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue; if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
$mandatory=false; $mandatory=false;

View File

@ -41,6 +41,7 @@ class SeedDMS_View_SetReviewersApprovers extends SeedDMS_Theme_Style {
$enableadminrevapp = $this->params['enableadminrevapp']; $enableadminrevapp = $this->params['enableadminrevapp'];
$enableownerrevapp = $this->params['enableownerrevapp']; $enableownerrevapp = $this->params['enableownerrevapp'];
$enableselfrevapp = $this->params['enableselfrevapp']; $enableselfrevapp = $this->params['enableselfrevapp'];
$enablehiddenrevapp = $this->params['enablehiddenrevapp'];
$overallStatus = $content->getStatus(); $overallStatus = $content->getStatus();
$owner = $document->getOwner(); $owner = $document->getOwner();
@ -115,6 +116,7 @@ class SeedDMS_View_SetReviewersApprovers extends SeedDMS_Theme_Style {
break; break;
} }
} else { } else {
if(!$enablehiddenrevapp && $usr->isHidden()) continue;
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue; if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())); $options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()));
} }
@ -256,6 +258,7 @@ class SeedDMS_View_SetReviewersApprovers extends SeedDMS_Theme_Style {
} }
} }
else { else {
if(!$enablehiddenrevapp && $usr->isHidden()) continue;
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue; if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())); $options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()));
} }

View File

@ -143,6 +143,7 @@ console.log(element);
$enableselfrevapp = $this->params['enableselfrevapp']; $enableselfrevapp = $this->params['enableselfrevapp'];
$enablereceiptworkflow = $this->params['enablereceiptworkflow']; $enablereceiptworkflow = $this->params['enablereceiptworkflow'];
$enableselfreceipt = $this->params['enableselfreceipt']; $enableselfreceipt = $this->params['enableselfreceipt'];
$enablehiddenrevapp = $this->params['enablehiddenrevapp'];
$dropfolderdir = $this->params['dropfolderdir']; $dropfolderdir = $this->params['dropfolderdir'];
$workflowmode = $this->params['workflowmode']; $workflowmode = $this->params['workflowmode'];
$presetexpiration = $this->params['presetexpiration']; $presetexpiration = $this->params['presetexpiration'];
@ -349,6 +350,7 @@ console.log(element);
$res=$user->getMandatoryReviewers(); $res=$user->getMandatoryReviewers();
$options = array(); $options = array();
foreach ($docAccess["users"] as $usr) { foreach ($docAccess["users"] as $usr) {
if(!$enablehiddenrevapp && $usr->isHidden()) continue;
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue; if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
$mandatory=false; $mandatory=false;
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true; foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
@ -519,6 +521,7 @@ console.log(element);
$options = array(); $options = array();
$res=$user->getMandatoryApprovers(); $res=$user->getMandatoryApprovers();
foreach ($docAccess["users"] as $usr) { foreach ($docAccess["users"] as $usr) {
if(!$enablehiddenrevapp && $usr->isHidden()) continue;
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue; if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
$mandatory=false; $mandatory=false;

View File

@ -68,7 +68,7 @@ class SeedDMS_View_UserList extends SeedDMS_Theme_Style {
<thead><tr><th></th><th><?php printMLText('name'); ?></th><th><?php printMLText('groups'); ?></th><th><?php printMLText('role'); ?></th><th><?php printMLText('discspace'); ?></th><th><?php printMLText('authentication'); ?></th><th></th></tr></thead><tbody> <thead><tr><th></th><th><?php printMLText('name'); ?></th><th><?php printMLText('groups'); ?></th><th><?php printMLText('role'); ?></th><th><?php printMLText('discspace'); ?></th><th><?php printMLText('authentication'); ?></th><th></th></tr></thead><tbody>
<?php <?php
foreach ($allUsers as $currUser) { foreach ($allUsers as $currUser) {
echo "<tr".($currUser->isDisabled() ? " class=\"error\"" : "").">"; echo "<tr".($currUser->isDisabled() ? " class=\"table-error error\"" : ( $currUser->isHidden() ? " class=\"table-warning warning\"" : "")).">";
echo "<td>"; echo "<td>";
if ($currUser->hasImage()) if ($currUser->hasImage())
print "<img width=\"100\" src=\"".$this->html_url('UserImage', array('userid'=>$currUser->getId()))."\" >"; print "<img width=\"100\" src=\"".$this->html_url('UserImage', array('userid'=>$currUser->getId()))."\" >";
@ -112,7 +112,7 @@ class SeedDMS_View_UserList extends SeedDMS_Theme_Style {
printMLText("password_expired"); printMLText("password_expired");
} }
} }
$sessions = $sessionmgr->getUserSessions($currUser); $sessions = $sessionmgr->getUserSessions($currUser, 10);
if($sessions) { if($sessions) {
foreach($sessions as $session) { foreach($sessions as $session) {
echo "<br />".getMLText('lastaccess').": ".getLongReadableDate($session->getLastAccess()); echo "<br />".getMLText('lastaccess').": ".getLongReadableDate($session->getLastAccess());