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
*/
function getUserSessions($user) { /* {{{ */
function getUserSessions($user, $limit=0) { /* {{{ */
$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);
if (is_bool($resArr) && $resArr == false)
return false;

View File

@ -184,6 +184,8 @@ class Settings { /* {{{ */
var $_enableOwnerRevApp = false;
// enable/disable listing logged in user as reviewer/approver
var $_enableSelfRevApp = false;
// enable/disable hidden user as reviewer/approver
var $_enableHiddenRevApp = false;
// enable/disable update of a review/approval by the reviewer/approver
var $_enableUpdateRevApp = false;
// 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('enableselfreceipt', $settings->_enableSelfReceipt);
$view->setParam('libraryfolder', $libfolder);
$view->setParam('enablehiddenrevapp', $settings->_enableHiddenRevApp);
$view->setParam('dropfolderdir', $settings->_dropFolderDir);
$view->setParam('dropfolderfile', isset($_REQUEST["dropfolderfileform1"]) ?$_REQUEST["dropfolderfileform1"] : '');
$view->setParam('workflowmode', $settings->_workflowMode);

View File

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

View File

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

View File

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

View File

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

View File

@ -143,6 +143,7 @@ console.log(element);
$enableselfrevapp = $this->params['enableselfrevapp'];
$enablereceiptworkflow = $this->params['enablereceiptworkflow'];
$enableselfreceipt = $this->params['enableselfreceipt'];
$enablehiddenrevapp = $this->params['enablehiddenrevapp'];
$dropfolderdir = $this->params['dropfolderdir'];
$workflowmode = $this->params['workflowmode'];
$presetexpiration = $this->params['presetexpiration'];
@ -349,6 +350,7 @@ console.log(element);
$res=$user->getMandatoryReviewers();
$options = array();
foreach ($docAccess["users"] as $usr) {
if(!$enablehiddenrevapp && $usr->isHidden()) continue;
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
$mandatory=false;
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
@ -519,6 +521,7 @@ console.log(element);
$options = array();
$res=$user->getMandatoryApprovers();
foreach ($docAccess["users"] as $usr) {
if(!$enablehiddenrevapp && $usr->isHidden()) continue;
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
$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>
<?php
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>";
if ($currUser->hasImage())
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");
}
}
$sessions = $sessionmgr->getUserSessions($currUser);
$sessions = $sessionmgr->getUserSessions($currUser, 10);
if($sessions) {
foreach($sessions as $session) {
echo "<br />".getMLText('lastaccess').": ".getLongReadableDate($session->getLastAccess());