mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
removeFromProcesses() will not touch documents for which the new user does not have at least read access
This commit is contained in:
parent
5dab792dba
commit
87fe831973
|
@ -932,11 +932,11 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
* Remove user from all processes
|
* Remove user from all processes
|
||||||
*
|
*
|
||||||
* This method adds another log entry to the reviews, approvals, receptions, revisions,
|
* This method adds another log entry to the reviews, approvals, receptions, revisions,
|
||||||
* which indicates the user has been deleted from the process. By default it will
|
* which indicates that the user has been deleted from the process. By default it will
|
||||||
* do so for each review/approval/reception/revision regardless of its current state unless
|
* do so for each review/approval/reception/revision regardless of its current state unless
|
||||||
* the user has been removed already (status=-2). So even
|
* the user has been removed already (status=-2). So even
|
||||||
* reviews/approvals/receptions/revisions already processed by the user will be added the log
|
* reviews/approvals/receptions/revisions already processed by the user will be added the log
|
||||||
* entry. Only if the last log entry was a removal already, it will not be
|
* entry. Only, if the last log entry was a removal already, it will not be
|
||||||
* added a second time.
|
* added a second time.
|
||||||
* This behaviour can be changed by passing a list of states in the optional
|
* This behaviour can be changed by passing a list of states in the optional
|
||||||
* argument $states. Only reviews, etc. in the given state will be affected.
|
* argument $states. Only reviews, etc. in the given state will be affected.
|
||||||
|
@ -944,7 +944,11 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
* (state = 0).
|
* (state = 0).
|
||||||
*
|
*
|
||||||
* The last optional parameter $newuser is for replacing the user currently in
|
* The last optional parameter $newuser is for replacing the user currently in
|
||||||
* charge by another user.
|
* charge by another user. If this parameter is passed, the old user will
|
||||||
|
* be deleted first (like described above) and afterwards the new user will
|
||||||
|
* be addded. The deletion of the old user and adding the new user will only
|
||||||
|
* happen if the new user has at least read access on the document. If not,
|
||||||
|
* the document will be skipped and remained unchanged.
|
||||||
*
|
*
|
||||||
* @param object $user the user doing the removal (needed for entry in
|
* @param object $user the user doing the removal (needed for entry in
|
||||||
* review and approve log).
|
* review and approve log).
|
||||||
|
@ -961,6 +965,10 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
$reviewStatus = $this->getReviewStatus();
|
$reviewStatus = $this->getReviewStatus();
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
foreach ($reviewStatus["indstatus"] as $ri) {
|
foreach ($reviewStatus["indstatus"] as $ri) {
|
||||||
|
if(!($doc = $this->_dms->getDocument($ri['documentID'])))
|
||||||
|
continue;
|
||||||
|
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
||||||
|
continue;
|
||||||
if($ri['status'] != -2 && (!isset($states['review']) || in_array($ri['status'], $states['review']))) {
|
if($ri['status'] != -2 && (!isset($states['review']) || in_array($ri['status'], $states['review']))) {
|
||||||
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $ri["reviewID"] ."', '-2', '".(($newuser && $ri['status'] == 0) ? 'Reviewer replaced by '.$newuser->getLogin() : 'Reviewer removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
"VALUES ('". $ri["reviewID"] ."', '-2', '".(($newuser && $ri['status'] == 0) ? 'Reviewer replaced by '.$newuser->getLogin() : 'Reviewer removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
||||||
|
@ -990,6 +998,10 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
$approvalStatus = $this->getApprovalStatus();
|
$approvalStatus = $this->getApprovalStatus();
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
foreach ($approvalStatus["indstatus"] as $ai) {
|
foreach ($approvalStatus["indstatus"] as $ai) {
|
||||||
|
if(!($doc = $this->_dms->getDocument($ai['documentID'])))
|
||||||
|
continue;
|
||||||
|
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
||||||
|
continue;
|
||||||
if($ai['status'] != -2 && (!isset($states['approval']) || in_array($ai['status'], $states['approval']))) {
|
if($ai['status'] != -2 && (!isset($states['approval']) || in_array($ai['status'], $states['approval']))) {
|
||||||
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $ai["approveID"] ."', '-2', '".(($newuser && $ai['status'] == 0)? 'Approver replaced by '.$newuser->getLogin() : 'Approver removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
"VALUES ('". $ai["approveID"] ."', '-2', '".(($newuser && $ai['status'] == 0)? 'Approver replaced by '.$newuser->getLogin() : 'Approver removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
||||||
|
@ -1019,6 +1031,10 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
$receiptStatus = $this->getReceiptStatus();
|
$receiptStatus = $this->getReceiptStatus();
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
foreach ($receiptStatus["indstatus"] as $ri) {
|
foreach ($receiptStatus["indstatus"] as $ri) {
|
||||||
|
if(!($doc = $this->_dms->getDocument($ri['documentID'])))
|
||||||
|
continue;
|
||||||
|
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
||||||
|
continue;
|
||||||
if($ri['status'] != -2 && (!isset($states['receipt']) || in_array($ri['status'], $states['receipt']))) {
|
if($ri['status'] != -2 && (!isset($states['receipt']) || in_array($ri['status'], $states['receipt']))) {
|
||||||
$queryStr = "INSERT INTO `tblDocumentReceiptLog` (`receiptID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentReceiptLog` (`receiptID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $ri["receiptID"] ."', '-2', '".(($newuser && $ri['status'] == 0) ? 'Recipient replaced by '.$newuser->getLogin() : 'Recipient removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
"VALUES ('". $ri["receiptID"] ."', '-2', '".(($newuser && $ri['status'] == 0) ? 'Recipient replaced by '.$newuser->getLogin() : 'Recipient removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
||||||
|
@ -1048,6 +1064,10 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
$revisionStatus = $this->getRevisionStatus();
|
$revisionStatus = $this->getRevisionStatus();
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
foreach ($revisionStatus["indstatus"] as $ri) {
|
foreach ($revisionStatus["indstatus"] as $ri) {
|
||||||
|
if(!($doc = $this->_dms->getDocument($ri['documentID'])))
|
||||||
|
continue;
|
||||||
|
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
||||||
|
continue;
|
||||||
if($ri['status'] != -2 && (!isset($states['revision']) || in_array($ri['status'], $states['revision']))) {
|
if($ri['status'] != -2 && (!isset($states['revision']) || in_array($ri['status'], $states['revision']))) {
|
||||||
$queryStr = "INSERT INTO `tblDocumentRevisionLog` (`revisionID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentRevisionLog` (`revisionID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $ri["revisionID"] ."', '-2', '".(($newuser && in_array($ri['status'], array(S_LOG_WAITING, S_LOG_SLEEPING))) ? 'Revisor replaced by '.$newuser->getLogin() : 'Revisor removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
"VALUES ('". $ri["revisionID"] ."', '-2', '".(($newuser && in_array($ri['status'], array(S_LOG_WAITING, S_LOG_SLEEPING))) ? 'Revisor replaced by '.$newuser->getLogin() : 'Revisor removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||||
<notes>
|
<notes>
|
||||||
- all changes from 5.1.26
|
- all changes from 5.1.26
|
||||||
|
- removeFromProcesses() will not touch documents for which the new user does not have at least read access
|
||||||
</notes>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<dir baseinstalldir="SeedDMS" name="/">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user