mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 21:21:27 +00:00
regard mandatory reviewers/approvers
the owner of the document may not remove mandatory reviewers/approvers anymore. Only admin may do that, it he/she is not the owner.
This commit is contained in:
parent
ea8a695551
commit
c54faf8f90
|
@ -60,6 +60,7 @@ if ($overallStatus["status"]==S_REJECTED || $overallStatus["status"]==S_OBSOLETE
|
||||||
}
|
}
|
||||||
|
|
||||||
$folder = $document->getFolder();
|
$folder = $document->getFolder();
|
||||||
|
$owner = $document->getOwner();
|
||||||
|
|
||||||
// Retrieve a list of all users and groups that have review / approve
|
// Retrieve a list of all users and groups that have review / approve
|
||||||
// privileges.
|
// privileges.
|
||||||
|
@ -104,6 +105,18 @@ foreach ($approvalStatus as $i=>$rs) {
|
||||||
// Get the list of proposed reviewers, stripping out any duplicates.
|
// Get the list of proposed reviewers, stripping out any duplicates.
|
||||||
$pIndRev = (isset($_POST["indReviewers"]) ? array_values(array_unique($_POST["indReviewers"])) : array());
|
$pIndRev = (isset($_POST["indReviewers"]) ? array_values(array_unique($_POST["indReviewers"])) : array());
|
||||||
$pGrpRev = (isset($_POST["grpReviewers"]) ? array_values(array_unique($_POST["grpReviewers"])) : array());
|
$pGrpRev = (isset($_POST["grpReviewers"]) ? array_values(array_unique($_POST["grpReviewers"])) : array());
|
||||||
|
if($user->getID() != $owner->getID()) {
|
||||||
|
$res=$owner->getMandatoryReviewers();
|
||||||
|
if($user->isAdmin())
|
||||||
|
$res = array();
|
||||||
|
} else
|
||||||
|
$res=$user->getMandatoryReviewers();
|
||||||
|
foreach ($res as $r) {
|
||||||
|
if(!in_array($r['reviewerUserID'], $pIndRev))
|
||||||
|
$pIndRev[] = $r['reviewerUserID'];
|
||||||
|
if(!in_array($r['reviewerGroupID'], $pGrpRev))
|
||||||
|
$pGrpRev[] = $r['reviewerGroupID'];
|
||||||
|
}
|
||||||
foreach ($pIndRev as $p) {
|
foreach ($pIndRev as $p) {
|
||||||
if (is_numeric($p)) {
|
if (is_numeric($p)) {
|
||||||
if (isset($accessIndex["i"][$p])) {
|
if (isset($accessIndex["i"][$p])) {
|
||||||
|
@ -319,6 +332,18 @@ if (count($reviewIndex["g"]) > 0) {
|
||||||
// Get the list of proposed approvers, stripping out any duplicates.
|
// Get the list of proposed approvers, stripping out any duplicates.
|
||||||
$pIndApp = (isset($_POST["indApprovers"]) ? array_values(array_unique($_POST["indApprovers"])) : array());
|
$pIndApp = (isset($_POST["indApprovers"]) ? array_values(array_unique($_POST["indApprovers"])) : array());
|
||||||
$pGrpApp = (isset($_POST["grpApprovers"]) ? array_values(array_unique($_POST["grpApprovers"])) : array());
|
$pGrpApp = (isset($_POST["grpApprovers"]) ? array_values(array_unique($_POST["grpApprovers"])) : array());
|
||||||
|
if($user->getID() != $owner->getID()) {
|
||||||
|
$res=$owner->getMandatoryApprovers();
|
||||||
|
if($user->isAdmin())
|
||||||
|
$res = array();
|
||||||
|
} else
|
||||||
|
$res=$user->getMandatoryApprovers();
|
||||||
|
foreach ($res as $r) {
|
||||||
|
if(!in_array($r['approverUserID'], $pIndApp))
|
||||||
|
$pIndApp[] = $r['approverUserID'];
|
||||||
|
if(!in_array($r['approverGroupID'], $pGrpApp))
|
||||||
|
$pGrpApp[] = $r['approverGroupID'];
|
||||||
|
}
|
||||||
foreach ($pIndApp as $p) {
|
foreach ($pIndApp as $p) {
|
||||||
if (is_numeric($p)) {
|
if (is_numeric($p)) {
|
||||||
if (isset($accessIndex["i"][$p])) {
|
if (isset($accessIndex["i"][$p])) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user